Deprecation cleanup

Wed Oct  9 17:40:13 2002  Manish Singh  <yosh@gimp.org>

        * gtk/gtkaccelmap.c gtk/gtkfixed.[ch] gtk/gtkkeyhash.c gtk/gtkmenu.c
        gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtkrc.c gtk/gtkspinbutton.[ch]
        gtk/gtktable.[ch] gtk/gtkthemes.c: Deprecation cleanup
This commit is contained in:
Manish Singh 2002-10-10 01:02:25 +00:00 committed by Manish Singh
parent 8b6ce08115
commit 28bc53032b
19 changed files with 194 additions and 153 deletions

View File

@ -1,3 +1,9 @@
Wed Oct 9 17:40:13 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkaccelmap.c gtk/gtkfixed.[ch] gtk/gtkkeyhash.c gtk/gtkmenu.c
gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtkrc.c gtk/gtkspinbutton.[ch]
gtk/gtktable.[ch] gtk/gtkthemes.c: Deprecation cleanup
Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org> Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c * gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c

View File

@ -1,3 +1,9 @@
Wed Oct 9 17:40:13 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkaccelmap.c gtk/gtkfixed.[ch] gtk/gtkkeyhash.c gtk/gtkmenu.c
gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtkrc.c gtk/gtkspinbutton.[ch]
gtk/gtktable.[ch] gtk/gtkthemes.c: Deprecation cleanup
Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org> Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c * gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c

View File

@ -1,3 +1,9 @@
Wed Oct 9 17:40:13 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkaccelmap.c gtk/gtkfixed.[ch] gtk/gtkkeyhash.c gtk/gtkmenu.c
gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtkrc.c gtk/gtkspinbutton.[ch]
gtk/gtktable.[ch] gtk/gtkthemes.c: Deprecation cleanup
Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org> Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c * gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c

View File

@ -1,3 +1,9 @@
Wed Oct 9 17:40:13 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkaccelmap.c gtk/gtkfixed.[ch] gtk/gtkkeyhash.c gtk/gtkmenu.c
gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtkrc.c gtk/gtkspinbutton.[ch]
gtk/gtktable.[ch] gtk/gtkthemes.c: Deprecation cleanup
Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org> Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c * gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c

View File

@ -1,3 +1,9 @@
Wed Oct 9 17:40:13 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkaccelmap.c gtk/gtkfixed.[ch] gtk/gtkkeyhash.c gtk/gtkmenu.c
gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtkrc.c gtk/gtkspinbutton.[ch]
gtk/gtktable.[ch] gtk/gtkthemes.c: Deprecation cleanup
Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org> Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c * gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c

View File

@ -1,3 +1,9 @@
Wed Oct 9 17:40:13 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkaccelmap.c gtk/gtkfixed.[ch] gtk/gtkkeyhash.c gtk/gtkmenu.c
gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtkrc.c gtk/gtkspinbutton.[ch]
gtk/gtktable.[ch] gtk/gtkthemes.c: Deprecation cleanup
Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org> Wed Oct 9 16:52:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c * gtk/gtkclipboard.[ch] gtk/gtkeditable.[ch] gtk/gtkgc.c

View File

@ -515,7 +515,7 @@ gtk_accel_map_load_scanner (GScanner *scanner)
scanner->config->symbol_2_token = FALSE; scanner->config->symbol_2_token = FALSE;
saved_symbol = g_scanner_lookup_symbol (scanner, "gtk_accel_path"); saved_symbol = g_scanner_lookup_symbol (scanner, "gtk_accel_path");
g_scanner_scope_add_symbol (scanner, 0, "gtk_accel_path", g_scanner_scope_add_symbol (scanner, 0, "gtk_accel_path",
(gpointer) accel_map_parse_accel_path); accel_map_parse_accel_path);
/* outer parsing loop /* outer parsing loop
*/ */

View File

@ -48,7 +48,7 @@ static void gtk_fixed_forall (GtkContainer *container,
gboolean include_internals, gboolean include_internals,
GtkCallback callback, GtkCallback callback,
gpointer callback_data); gpointer callback_data);
static GtkType gtk_fixed_child_type (GtkContainer *container); static GType gtk_fixed_child_type (GtkContainer *container);
static void gtk_fixed_set_child_property (GtkContainer *container, static void gtk_fixed_set_child_property (GtkContainer *container,
GtkWidget *child, GtkWidget *child,
@ -64,26 +64,28 @@ static void gtk_fixed_get_child_property (GtkContainer *container,
static GtkContainerClass *parent_class = NULL; static GtkContainerClass *parent_class = NULL;
GtkType GType
gtk_fixed_get_type (void) gtk_fixed_get_type (void)
{ {
static GtkType fixed_type = 0; static GType fixed_type = 0;
if (!fixed_type) if (!fixed_type)
{ {
static const GtkTypeInfo fixed_info = static const GTypeInfo fixed_info =
{ {
"GtkFixed",
sizeof (GtkFixed),
sizeof (GtkFixedClass), sizeof (GtkFixedClass),
(GtkClassInitFunc) gtk_fixed_class_init, NULL, /* base_init */
(GtkObjectInitFunc) gtk_fixed_init, NULL, /* base_finalize */
/* reserved_1 */ NULL, (GClassInitFunc) gtk_fixed_class_init,
/* reserved_2 */ NULL, NULL, /* class_finalize */
(GtkClassInitFunc) NULL, NULL, /* class_data */
sizeof (GtkFixed),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_fixed_init,
}; };
fixed_type = gtk_type_unique (GTK_TYPE_CONTAINER, &fixed_info); fixed_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkFixed",
&fixed_info, 0);
} }
return fixed_type; return fixed_type;
@ -92,15 +94,13 @@ gtk_fixed_get_type (void)
static void static void
gtk_fixed_class_init (GtkFixedClass *class) gtk_fixed_class_init (GtkFixedClass *class)
{ {
GtkObjectClass *object_class;
GtkWidgetClass *widget_class; GtkWidgetClass *widget_class;
GtkContainerClass *container_class; GtkContainerClass *container_class;
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class; widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class; container_class = (GtkContainerClass*) class;
parent_class = gtk_type_class (GTK_TYPE_CONTAINER); parent_class = g_type_class_peek_parent (class);
widget_class->realize = gtk_fixed_realize; widget_class->realize = gtk_fixed_realize;
widget_class->size_request = gtk_fixed_size_request; widget_class->size_request = gtk_fixed_size_request;
@ -135,7 +135,7 @@ gtk_fixed_class_init (GtkFixedClass *class)
G_PARAM_READWRITE)); G_PARAM_READWRITE));
} }
static GtkType static GType
gtk_fixed_child_type (GtkContainer *container) gtk_fixed_child_type (GtkContainer *container)
{ {
return GTK_TYPE_WIDGET; return GTK_TYPE_WIDGET;
@ -152,10 +152,7 @@ gtk_fixed_init (GtkFixed *fixed)
GtkWidget* GtkWidget*
gtk_fixed_new (void) gtk_fixed_new (void)
{ {
GtkFixed *fixed; return g_object_new (GTK_TYPE_FIXED, NULL);
fixed = gtk_type_new (GTK_TYPE_FIXED);
return GTK_WIDGET (fixed);
} }
static GtkFixedChild* static GtkFixedChild*

View File

@ -38,11 +38,11 @@ extern "C" {
#define GTK_TYPE_FIXED (gtk_fixed_get_type ()) #define GTK_TYPE_FIXED (gtk_fixed_get_type ())
#define GTK_FIXED(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FIXED, GtkFixed)) #define GTK_FIXED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FIXED, GtkFixed))
#define GTK_FIXED_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FIXED, GtkFixedClass)) #define GTK_FIXED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FIXED, GtkFixedClass))
#define GTK_IS_FIXED(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FIXED)) #define GTK_IS_FIXED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FIXED))
#define GTK_IS_FIXED_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FIXED)) #define GTK_IS_FIXED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FIXED))
#define GTK_FIXED_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_FIXED, GtkFixedClass)) #define GTK_FIXED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FIXED, GtkFixedClass))
typedef struct _GtkFixed GtkFixed; typedef struct _GtkFixed GtkFixed;
@ -69,7 +69,7 @@ struct _GtkFixedChild
}; };
GtkType gtk_fixed_get_type (void) G_GNUC_CONST; GType gtk_fixed_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_fixed_new (void); GtkWidget* gtk_fixed_new (void);
void gtk_fixed_put (GtkFixed *fixed, void gtk_fixed_put (GtkFixed *fixed,
GtkWidget *widget, GtkWidget *widget,

View File

@ -168,7 +168,8 @@ void
_gtk_key_hash_free (GtkKeyHash *key_hash) _gtk_key_hash_free (GtkKeyHash *key_hash)
{ {
g_signal_handlers_disconnect_by_func (key_hash->keymap, g_signal_handlers_disconnect_by_func (key_hash->keymap,
G_CALLBACK (key_hash_keys_changed), key_hash); key_hash_keys_changed,
key_hash);
if (key_hash->keycode_hash) if (key_hash->keycode_hash)
{ {

View File

@ -175,7 +175,7 @@ gtk_menu_get_private (GtkMenu *menu)
private->have_position = FALSE; private->have_position = FALSE;
g_object_set_qdata_full (G_OBJECT (menu), private_quark, g_object_set_qdata_full (G_OBJECT (menu), private_quark,
private, (GDestroyNotify) g_free); private, g_free);
} }
return private; return private;

View File

@ -72,10 +72,10 @@ static GQuark quark_weakrefs = 0;
* *
****************************************************/ ****************************************************/
GtkType GType
gtk_object_get_type (void) gtk_object_get_type (void)
{ {
static GtkType object_type = 0; static GType object_type = 0;
if (!object_type) if (!object_type)
{ {
@ -88,9 +88,9 @@ gtk_object_get_type (void)
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GtkObject), sizeof (GtkObject),
16, /* n_preallocs */ 16, /* n_preallocs */
(GInstanceInitFunc) gtk_object_init, (GInstanceInitFunc) gtk_object_init,
NULL, /* value_table */ NULL, /* value_table */
}; };
object_type = g_type_register_static (G_TYPE_OBJECT, "GtkObject", object_type = g_type_register_static (G_TYPE_OBJECT, "GtkObject",
@ -383,7 +383,7 @@ gtk_object_dispose (GObject *gobject)
static void static void
gtk_object_real_destroy (GtkObject *object) gtk_object_real_destroy (GtkObject *object)
{ {
g_signal_handlers_destroy (G_OBJECT (object)); g_signal_handlers_destroy (object);
} }
static void static void

View File

@ -142,9 +142,9 @@ gtk_old_editable_get_type (void)
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GtkOldEditable), sizeof (GtkOldEditable),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gtk_old_editable_init, (GInstanceInitFunc) gtk_old_editable_init,
NULL /* value_table */ NULL, /* value_table */
}; };
static const GInterfaceInfo editable_info = static const GInterfaceInfo editable_info =

View File

@ -885,11 +885,11 @@ gtk_rc_parse (const gchar *filename)
GType GType
gtk_rc_style_get_type (void) gtk_rc_style_get_type (void)
{ {
static GType object_type = 0; static GType rc_style_type = 0;
if (!object_type) if (!rc_style_type)
{ {
static const GTypeInfo object_info = static const GTypeInfo rc_style_info =
{ {
sizeof (GtkRcStyleClass), sizeof (GtkRcStyleClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
@ -902,12 +902,11 @@ gtk_rc_style_get_type (void)
(GInstanceInitFunc) gtk_rc_style_init, (GInstanceInitFunc) gtk_rc_style_init,
}; };
object_type = g_type_register_static (G_TYPE_OBJECT, rc_style_type = g_type_register_static (G_TYPE_OBJECT, "GtkRcStyle",
"GtkRcStyle", &rc_style_info, 0);
&object_info, 0);
} }
return object_type; return rc_style_type;
} }
static void static void
@ -978,7 +977,7 @@ gtk_rc_style_finalize (GObject *object)
{ {
GSList *rc_styles = tmp_list1->data; GSList *rc_styles = tmp_list1->data;
GtkStyle *style = g_hash_table_lookup (realized_style_ht, rc_styles); GtkStyle *style = g_hash_table_lookup (realized_style_ht, rc_styles);
gtk_style_unref (style); g_object_unref (style);
/* Remove the list of styles from the other rc_styles /* Remove the list of styles from the other rc_styles
* in the list * in the list
@ -1021,8 +1020,7 @@ gtk_rc_style_finalize (GObject *object)
tmp_list1 = rc_style->icon_factories; tmp_list1 = rc_style->icon_factories;
while (tmp_list1) while (tmp_list1)
{ {
g_object_unref (G_OBJECT (tmp_list1->data)); g_object_unref (tmp_list1->data);
tmp_list1 = tmp_list1->next; tmp_list1 = tmp_list1->next;
} }
g_slist_free (rc_style->icon_factories); g_slist_free (rc_style->icon_factories);
@ -1064,19 +1062,19 @@ gtk_rc_style_copy (GtkRcStyle *orig)
} }
void void
gtk_rc_style_ref (GtkRcStyle *rc_style) gtk_rc_style_ref (GtkRcStyle *rc_style)
{ {
g_return_if_fail (GTK_IS_RC_STYLE (rc_style)); g_return_if_fail (GTK_IS_RC_STYLE (rc_style));
g_object_ref (G_OBJECT (rc_style)); g_object_ref (rc_style);
} }
void void
gtk_rc_style_unref (GtkRcStyle *rc_style) gtk_rc_style_unref (GtkRcStyle *rc_style)
{ {
g_return_if_fail (GTK_IS_RC_STYLE (rc_style)); g_return_if_fail (GTK_IS_RC_STYLE (rc_style));
g_object_unref (G_OBJECT (rc_style)); g_object_unref (rc_style);
} }
static GtkRcStyle * static GtkRcStyle *
@ -1283,7 +1281,7 @@ gtk_rc_reset_widgets (GtkSettings *settings)
if (gtk_widget_get_screen (list->data) == settings->screen) if (gtk_widget_get_screen (list->data) == settings->screen)
{ {
gtk_widget_reset_rc_styles (list->data); gtk_widget_reset_rc_styles (list->data);
gtk_widget_unref (list->data); g_object_unref (list->data);
} }
} }
g_list_free (toplevels); g_list_free (toplevels);
@ -1639,16 +1637,16 @@ gtk_rc_get_style (GtkWidget *widget)
if (context->rc_sets_class) if (context->rc_sets_class)
{ {
GtkType type; GType type;
type = GTK_OBJECT_TYPE (widget); type = G_TYPE_FROM_INSTANCE (widget);
while (type) while (type)
{ {
const gchar *path; const gchar *path;
gchar *path_reversed; gchar *path_reversed;
guint path_length; guint path_length;
path = gtk_type_name (type); path = g_type_name (type);
path_length = strlen (path); path_length = strlen (path);
path_reversed = g_strdup (path); path_reversed = g_strdup (path);
g_strreverse (path_reversed); g_strreverse (path_reversed);
@ -1656,14 +1654,13 @@ gtk_rc_get_style (GtkWidget *widget)
rc_styles = gtk_rc_styles_match (rc_styles, context->rc_sets_class, path_length, path, path_reversed); rc_styles = gtk_rc_styles_match (rc_styles, context->rc_sets_class, path_length, path, path_reversed);
g_free (path_reversed); g_free (path_reversed);
type = gtk_type_parent (type); type = g_type_parent (type);
} }
} }
rc_styles = sort_and_dereference_sets (rc_styles); rc_styles = sort_and_dereference_sets (rc_styles);
widget_rc_style = gtk_object_get_data_by_id (GTK_OBJECT (widget), widget_rc_style = g_object_get_qdata (G_OBJECT (widget), rc_style_key_id);
rc_style_key_id);
if (widget_rc_style) if (widget_rc_style)
rc_styles = g_slist_prepend (rc_styles, widget_rc_style); rc_styles = g_slist_prepend (rc_styles, widget_rc_style);
@ -2089,7 +2086,7 @@ gtk_rc_init_style (GtkRcContext *context,
iter = factories; iter = factories;
while (iter != NULL) while (iter != NULL)
{ {
g_object_ref (G_OBJECT (iter->data)); g_object_ref (iter->data);
iter = g_slist_next (iter); iter = g_slist_next (iter);
} }
@ -2586,7 +2583,7 @@ gtk_rc_parse_style (GtkRcContext *context,
factories = parent_style->icon_factories; factories = parent_style->icon_factories;
while (factories != NULL) while (factories != NULL)
{ {
g_object_ref (G_OBJECT (factories->data)); g_object_ref (factories->data);
factories = factories->next; factories = factories->next;
} }
} }
@ -3166,7 +3163,7 @@ gtk_rc_parse_engine (GtkRcContext *context,
if (result != G_TOKEN_NONE) if (result != G_TOKEN_NONE)
{ {
g_object_unref (G_OBJECT (new_style)); g_object_unref (new_style);
new_style = NULL; new_style = NULL;
} }
} }
@ -3198,8 +3195,8 @@ gtk_rc_parse_engine (GtkRcContext *context,
if (new_style) if (new_style)
{ {
new_style->engine_specified = TRUE; new_style->engine_specified = TRUE;
g_object_unref (G_OBJECT (*rc_style)); g_object_unref (*rc_style);
*rc_style = new_style; *rc_style = new_style;
} }

View File

@ -37,7 +37,6 @@
#include "gtkspinbutton.h" #include "gtkspinbutton.h"
#include "gtkmain.h" #include "gtkmain.h"
#include "gtkmarshalers.h" #include "gtkmarshalers.h"
#include "gtksignal.h"
#include "gtksettings.h" #include "gtksettings.h"
#include "gtkintl.h" #include "gtkintl.h"
@ -146,23 +145,24 @@ static guint spinbutton_signals[LAST_SIGNAL] = {0};
#define NO_ARROW 2 #define NO_ARROW 2
GtkType GType
gtk_spin_button_get_type (void) gtk_spin_button_get_type (void)
{ {
static GtkType spin_button_type = 0; static GType spin_button_type = 0;
if (!spin_button_type) if (!spin_button_type)
{ {
static const GtkTypeInfo spin_button_info = static const GTypeInfo spin_button_info =
{ {
"GtkSpinButton",
sizeof (GtkSpinButton),
sizeof (GtkSpinButtonClass), sizeof (GtkSpinButtonClass),
(GtkClassInitFunc) gtk_spin_button_class_init, NULL, /* base_init */
(GtkObjectInitFunc) gtk_spin_button_init, NULL, /* base_finalize */
/* reserved_1 */ NULL, (GClassInitFunc) gtk_spin_button_class_init,
/* reserved_2 */ NULL, NULL, /* class_finalize */
(GtkClassInitFunc) NULL, NULL, /* class_data */
sizeof (GtkSpinButton),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_spin_button_init,
}; };
static const GInterfaceInfo editable_info = static const GInterfaceInfo editable_info =
@ -172,7 +172,10 @@ gtk_spin_button_get_type (void)
NULL /* interface_data */ NULL /* interface_data */
}; };
spin_button_type = gtk_type_unique (GTK_TYPE_ENTRY, &spin_button_info); spin_button_type =
g_type_register_static (GTK_TYPE_ENTRY, "GtkSpinButton",
&spin_button_info, 0);
g_type_add_interface_static (spin_button_type, g_type_add_interface_static (spin_button_type,
GTK_TYPE_EDITABLE, GTK_TYPE_EDITABLE,
&editable_info); &editable_info);
@ -198,7 +201,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
widget_class = (GtkWidgetClass*) class; widget_class = (GtkWidgetClass*) class;
entry_class = (GtkEntryClass*) class; entry_class = (GtkEntryClass*) class;
parent_class = gtk_type_class (GTK_TYPE_ENTRY); parent_class = g_type_class_peek_parent (class);
gobject_class->finalize = gtk_spin_button_finalize; gobject_class->finalize = gtk_spin_button_finalize;
@ -309,34 +312,37 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
G_PARAM_READABLE), G_PARAM_READABLE),
gtk_rc_property_parse_enum); gtk_rc_property_parse_enum);
spinbutton_signals[INPUT] = spinbutton_signals[INPUT] =
gtk_signal_new ("input", g_signal_new ("input",
GTK_RUN_LAST, G_TYPE_FROM_CLASS (gobject_class),
GTK_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST,
GTK_SIGNAL_OFFSET (GtkSpinButtonClass, input), G_STRUCT_OFFSET (GtkSpinButtonClass, input),
_gtk_marshal_INT__POINTER, NULL, NULL,
GTK_TYPE_INT, 1, GTK_TYPE_POINTER); _gtk_marshal_INT__POINTER,
G_TYPE_INT, 1,
G_TYPE_POINTER);
spinbutton_signals[OUTPUT] = spinbutton_signals[OUTPUT] =
g_signal_new ("output", g_signal_new ("output",
G_TYPE_FROM_CLASS(object_class), G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET(GtkSpinButtonClass, output), G_STRUCT_OFFSET (GtkSpinButtonClass, output),
_gtk_boolean_handled_accumulator, NULL, _gtk_boolean_handled_accumulator, NULL,
_gtk_marshal_BOOLEAN__VOID, _gtk_marshal_BOOLEAN__VOID,
G_TYPE_BOOLEAN, 0); G_TYPE_BOOLEAN, 0);
spinbutton_signals[VALUE_CHANGED] = spinbutton_signals[VALUE_CHANGED] =
gtk_signal_new ("value_changed", g_signal_new ("value_changed",
GTK_RUN_LAST, G_TYPE_FROM_CLASS (gobject_class),
GTK_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST,
GTK_SIGNAL_OFFSET (GtkSpinButtonClass, value_changed), G_STRUCT_OFFSET (GtkSpinButtonClass, value_changed),
_gtk_marshal_VOID__VOID, NULL, NULL,
GTK_TYPE_NONE, 0); _gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/* Action signals */ /* Action signals */
spinbutton_signals[CHANGE_VALUE] = spinbutton_signals[CHANGE_VALUE] =
g_signal_new ("change_value", g_signal_new ("change_value",
G_TYPE_FROM_CLASS (object_class), G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkSpinButtonClass, change_value), G_STRUCT_OFFSET (GtkSpinButtonClass, change_value),
NULL, NULL, NULL, NULL,
@ -522,7 +528,7 @@ gtk_spin_button_realize (GtkWidget *widget)
GdkWindowAttr attributes; GdkWindowAttr attributes;
gint attributes_mask; gint attributes_mask;
guint real_width; guint real_width;
gint return_val; gboolean return_val;
gint arrow_size; gint arrow_size;
spin_button = GTK_SPIN_BUTTON (widget); spin_button = GTK_SPIN_BUTTON (widget);
@ -562,8 +568,7 @@ gtk_spin_button_realize (GtkWidget *widget)
gtk_style_set_background (widget->style, spin_button->panel, GTK_STATE_NORMAL); gtk_style_set_background (widget->style, spin_button->panel, GTK_STATE_NORMAL);
return_val = FALSE; return_val = FALSE;
gtk_signal_emit (GTK_OBJECT (spin_button), spinbutton_signals[OUTPUT], g_signal_emit (spin_button, spinbutton_signals[OUTPUT], 0, &return_val);
&return_val);
if (return_val == FALSE) if (return_val == FALSE)
gtk_spin_button_default_output (spin_button); gtk_spin_button_default_output (spin_button);
@ -750,7 +755,7 @@ gtk_spin_button_expose (GtkWidget *widget,
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;
gdk_window_get_size (spin->panel, &rect.width, &rect.height); gdk_drawable_get_size (spin->panel, &rect.width, &rect.height);
shadow_type = spin_button_get_shadow_type (spin); shadow_type = spin_button_get_shadow_type (spin);
@ -1200,16 +1205,16 @@ static void
gtk_spin_button_value_changed (GtkAdjustment *adjustment, gtk_spin_button_value_changed (GtkAdjustment *adjustment,
GtkSpinButton *spin_button) GtkSpinButton *spin_button)
{ {
gint return_val; gboolean return_val;
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
return_val = FALSE; return_val = FALSE;
gtk_signal_emit (GTK_OBJECT (spin_button), spinbutton_signals[OUTPUT], g_signal_emit (spin_button, spinbutton_signals[OUTPUT], 0, &return_val);
&return_val);
if (return_val == FALSE) if (return_val == FALSE)
gtk_spin_button_default_output (spin_button); gtk_spin_button_default_output (spin_button);
gtk_signal_emit (GTK_OBJECT (spin_button), g_signal_emit (spin_button, spinbutton_signals[VALUE_CHANGED], 0);
spinbutton_signals[VALUE_CHANGED]);
spin_button_redraw (spin_button); spin_button_redraw (spin_button);
@ -1334,8 +1339,7 @@ gtk_spin_button_snap (GtkSpinButton *spin_button,
else else
{ {
gint return_val = FALSE; gint return_val = FALSE;
gtk_signal_emit (GTK_OBJECT (spin_button), spinbutton_signals[OUTPUT], g_signal_emit (spin_button, spinbutton_signals[OUTPUT], 0, &return_val);
&return_val);
if (return_val == FALSE) if (return_val == FALSE)
gtk_spin_button_default_output (spin_button); gtk_spin_button_default_output (spin_button);
} }
@ -1547,7 +1551,7 @@ gtk_spin_button_new (GtkAdjustment *adjustment,
if (adjustment) if (adjustment)
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), NULL); g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), NULL);
spin = gtk_type_new (GTK_TYPE_SPIN_BUTTON); spin = g_object_new (GTK_TYPE_SPIN_BUTTON, NULL);
gtk_spin_button_configure (spin, adjustment, climb_rate, digits); gtk_spin_button_configure (spin, adjustment, climb_rate, digits);
@ -1580,7 +1584,7 @@ gtk_spin_button_new_with_range (gdouble min,
g_return_val_if_fail (min < max, NULL); g_return_val_if_fail (min < max, NULL);
g_return_val_if_fail (step != 0.0, NULL); g_return_val_if_fail (step != 0.0, NULL);
spin = gtk_type_new (GTK_TYPE_SPIN_BUTTON); spin = g_object_new (GTK_TYPE_SPIN_BUTTON, NULL);
adj = gtk_adjustment_new (min, min, max, step, 10 * step, 0); adj = gtk_adjustment_new (min, min, max, step, 10 * step, 0);
@ -1630,21 +1634,25 @@ gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
{ {
if (spin_button->adjustment) if (spin_button->adjustment)
{ {
gtk_signal_disconnect_by_data (GTK_OBJECT (spin_button->adjustment), g_signal_handlers_disconnect_by_func (spin_button->adjustment,
(gpointer) spin_button); gtk_spin_button_value_changed,
gtk_object_unref (GTK_OBJECT (spin_button->adjustment)); spin_button);
g_signal_handlers_disconnect_by_func (spin_button->adjustment,
adjustment_changed_cb,
spin_button);
g_object_unref (spin_button->adjustment);
} }
spin_button->adjustment = adjustment; spin_button->adjustment = adjustment;
if (adjustment) if (adjustment)
{ {
gtk_object_ref (GTK_OBJECT (adjustment)); g_object_ref (adjustment);
gtk_object_sink (GTK_OBJECT (adjustment)); gtk_object_sink (GTK_OBJECT (adjustment));
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", g_signal_connect (adjustment, "value_changed",
(GtkSignalFunc) gtk_spin_button_value_changed, G_CALLBACK (gtk_spin_button_value_changed),
(gpointer) spin_button); spin_button);
gtk_signal_connect (GTK_OBJECT (adjustment), "changed", g_signal_connect (adjustment, "changed",
(GtkSignalFunc) adjustment_changed_cb, G_CALLBACK (adjustment_changed_cb),
(gpointer) spin_button); spin_button);
spin_button->timer_step = spin_button->adjustment->step_increment; spin_button->timer_step = spin_button->adjustment->step_increment;
} }
@ -1861,8 +1869,7 @@ gtk_spin_button_set_value (GtkSpinButton *spin_button,
else else
{ {
gint return_val = FALSE; gint return_val = FALSE;
gtk_signal_emit (GTK_OBJECT (spin_button), spinbutton_signals[OUTPUT], g_signal_emit (spin_button, spinbutton_signals[OUTPUT], 0, &return_val);
&return_val);
if (return_val == FALSE) if (return_val == FALSE)
gtk_spin_button_default_output (spin_button); gtk_spin_button_default_output (spin_button);
} }
@ -2157,8 +2164,7 @@ gtk_spin_button_update (GtkSpinButton *spin_button)
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button)); g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
return_val = FALSE; return_val = FALSE;
gtk_signal_emit (GTK_OBJECT (spin_button), spinbutton_signals[INPUT], g_signal_emit (spin_button, spinbutton_signals[INPUT], 0, &val, &return_val);
&val, &return_val);
if (return_val == FALSE) if (return_val == FALSE)
{ {
return_val = gtk_spin_button_default_input (spin_button, &val); return_val = gtk_spin_button_default_input (spin_button, &val);
@ -2194,8 +2200,8 @@ gtk_spin_button_update (GtkSpinButton *spin_button)
else else
{ {
return_val = FALSE; return_val = FALSE;
gtk_signal_emit (GTK_OBJECT (spin_button), spinbutton_signals[OUTPUT], g_signal_emit (spin_button, spinbutton_signals[OUTPUT], 0,
&return_val); &return_val);
if (return_val == FALSE) if (return_val == FALSE)
gtk_spin_button_default_output (spin_button); gtk_spin_button_default_output (spin_button);
} }

View File

@ -42,11 +42,11 @@ extern "C" {
#define GTK_TYPE_SPIN_BUTTON (gtk_spin_button_get_type ()) #define GTK_TYPE_SPIN_BUTTON (gtk_spin_button_get_type ())
#define GTK_SPIN_BUTTON(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_SPIN_BUTTON, GtkSpinButton)) #define GTK_SPIN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SPIN_BUTTON, GtkSpinButton))
#define GTK_SPIN_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SPIN_BUTTON, GtkSpinButtonClass)) #define GTK_SPIN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SPIN_BUTTON, GtkSpinButtonClass))
#define GTK_IS_SPIN_BUTTON(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SPIN_BUTTON)) #define GTK_IS_SPIN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SPIN_BUTTON))
#define GTK_IS_SPIN_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SPIN_BUTTON)) #define GTK_IS_SPIN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SPIN_BUTTON))
#define GTK_SPIN_BUTTON_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_SPIN_BUTTON, GtkSpinButtonClass)) #define GTK_SPIN_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SPIN_BUTTON, GtkSpinButtonClass))
#define GTK_INPUT_ERROR -1 #define GTK_INPUT_ERROR -1
@ -119,7 +119,7 @@ struct _GtkSpinButtonClass
}; };
GtkType gtk_spin_button_get_type (void) G_GNUC_CONST; GType gtk_spin_button_get_type (void) G_GNUC_CONST;
void gtk_spin_button_configure (GtkSpinButton *spin_button, void gtk_spin_button_configure (GtkSpinButton *spin_button,
GtkAdjustment *adjustment, GtkAdjustment *adjustment,

View File

@ -84,7 +84,7 @@ static void gtk_table_get_child_property (GtkContainer *container,
guint property_id, guint property_id,
GValue *value, GValue *value,
GParamSpec *pspec); GParamSpec *pspec);
static GtkType gtk_table_child_type (GtkContainer *container); static GType gtk_table_child_type (GtkContainer *container);
static void gtk_table_size_request_init (GtkTable *table); static void gtk_table_size_request_init (GtkTable *table);
@ -100,26 +100,28 @@ static void gtk_table_size_allocate_pass2 (GtkTable *table);
static GtkContainerClass *parent_class = NULL; static GtkContainerClass *parent_class = NULL;
GtkType GType
gtk_table_get_type (void) gtk_table_get_type (void)
{ {
static GtkType table_type = 0; static GType table_type = 0;
if (!table_type) if (!table_type)
{ {
static const GtkTypeInfo table_info = static const GTypeInfo table_info =
{ {
"GtkTable",
sizeof (GtkTable),
sizeof (GtkTableClass), sizeof (GtkTableClass),
(GtkClassInitFunc) gtk_table_class_init, NULL,
(GtkObjectInitFunc) gtk_table_init, NULL,
/* reserved_1 */ NULL, (GClassInitFunc) gtk_table_class_init,
/* reserved_2 */ NULL, NULL,
(GtkClassInitFunc) NULL, NULL,
sizeof (GtkTable),
0,
(GInstanceInitFunc) gtk_table_init,
}; };
table_type = gtk_type_unique (gtk_container_get_type (), &table_info); table_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkTable",
&table_info, 0);
} }
return table_type; return table_type;
@ -252,7 +254,7 @@ gtk_table_class_init (GtkTableClass *class)
G_PARAM_READWRITE)); G_PARAM_READWRITE));
} }
static GtkType static GType
gtk_table_child_type (GtkContainer *container) gtk_table_child_type (GtkContainer *container)
{ {
return GTK_TYPE_WIDGET; return GTK_TYPE_WIDGET;
@ -490,11 +492,11 @@ gtk_table_new (guint rows,
GtkTable *table; GtkTable *table;
if (rows == 0) if (rows == 0)
rows = 1; rows = 1;
if (columns == 0) if (columns == 0)
columns = 1; columns = 1;
table = gtk_type_new (gtk_table_get_type ()); table = g_object_new (GTK_TYPE_TABLE, NULL);
table->homogeneous = (homogeneous ? TRUE : FALSE); table->homogeneous = (homogeneous ? TRUE : FALSE);

View File

@ -38,11 +38,11 @@ extern "C" {
#define GTK_TYPE_TABLE (gtk_table_get_type ()) #define GTK_TYPE_TABLE (gtk_table_get_type ())
#define GTK_TABLE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TABLE, GtkTable)) #define GTK_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TABLE, GtkTable))
#define GTK_TABLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TABLE, GtkTableClass)) #define GTK_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TABLE, GtkTableClass))
#define GTK_IS_TABLE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TABLE)) #define GTK_IS_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TABLE))
#define GTK_IS_TABLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TABLE)) #define GTK_IS_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TABLE))
#define GTK_TABLE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TABLE, GtkTableClass)) #define GTK_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TABLE, GtkTableClass))
typedef struct _GtkTable GtkTable; typedef struct _GtkTable GtkTable;
@ -99,7 +99,7 @@ struct _GtkTableRowCol
}; };
GtkType gtk_table_get_type (void) G_GNUC_CONST; GType gtk_table_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_table_new (guint rows, GtkWidget* gtk_table_new (guint rows,
guint columns, guint columns,
gboolean homogeneous); gboolean homogeneous);

View File

@ -147,7 +147,9 @@ gtk_theme_engine_get_type (void)
NULL, /* instance_init */ NULL, /* instance_init */
}; };
theme_engine_type = g_type_register_static (G_TYPE_TYPE_MODULE, "GtkThemeEngine", &theme_engine_info, 0); theme_engine_type =
g_type_register_static (G_TYPE_TYPE_MODULE, "GtkThemeEngine",
&theme_engine_info, 0);
} }
return theme_engine_type; return theme_engine_type;
@ -167,7 +169,7 @@ gtk_theme_engine_get (const gchar *name)
if (!result) if (!result)
{ {
result = GTK_THEME_ENGINE (g_object_new (GTK_TYPE_THEME_ENGINE, NULL)); result = g_object_new (GTK_TYPE_THEME_ENGINE, NULL);
g_type_module_set_name (G_TYPE_MODULE (result), name); g_type_module_set_name (G_TYPE_MODULE (result), name);
result->name = g_strdup (name); result->name = g_strdup (name);