diff options
author | Manish Singh <yosh@gimp.org> | 2002-10-13 20:44:18 +0000 |
---|---|---|
committer | Manish Singh <yosh@src.gnome.org> | 2002-10-13 20:44:18 +0000 |
commit | aa54cfeede6e16fcde760a417a1c81da04ac8a0c (patch) | |
tree | 63a3b15c5ed70368e879bd1652acc488af6e43ce /gtk | |
parent | c77265d3a7326bbe184c14bd85eed17712905e31 (diff) | |
download | gdk-pixbuf-aa54cfeede6e16fcde760a417a1c81da04ac8a0c.tar.gz |
Deprecation cleanup
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]
gtk/gtkwidget.[ch] modules/input/gtkimcontextxim.c
modules/input/imam-et.c modules/input/imcyrillic-translit.c
modules/input/imhangul.c modules/input/iminuktitut.c
modules/input/imipa.c modules/input/imthai-broken.c
modules/input/imti-er.c modules/input/imti-et.c
modules/input/imviqr.c: Deprecation cleanup
* modules/input/Makefile.am: Added disable deprecation flags
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkcurve.c | 69 | ||||
-rw-r--r-- | gtk/gtkcurve.h | 12 | ||||
-rw-r--r-- | gtk/gtkgamma.c | 79 | ||||
-rw-r--r-- | gtk/gtkgamma.h | 12 | ||||
-rw-r--r-- | gtk/gtklayout.c | 83 | ||||
-rw-r--r-- | gtk/gtklayout.h | 12 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 1011 | ||||
-rw-r--r-- | gtk/gtkwidget.h | 16 |
8 files changed, 668 insertions, 626 deletions
diff --git a/gtk/gtkcurve.c b/gtk/gtkcurve.c index 416c92a81..3a059245a 100644 --- a/gtk/gtkcurve.c +++ b/gtk/gtkcurve.c @@ -33,7 +33,6 @@ #include "gtkmain.h" #include "gtkmarshalers.h" #include "gtkradiobutton.h" -#include "gtksignal.h" #include "gtktable.h" #include "gtkintl.h" @@ -78,26 +77,28 @@ static gint gtk_curve_graph_events (GtkWidget *widget, GtkCurve *c); static void gtk_curve_size_graph (GtkCurve *curve); -GtkType +GType gtk_curve_get_type (void) { - static GtkType curve_type = 0; + static GType curve_type = 0; if (!curve_type) { - static const GtkTypeInfo curve_info = + static const GTypeInfo curve_info = { - "GtkCurve", - sizeof (GtkCurve), sizeof (GtkCurveClass), - (GtkClassInitFunc) gtk_curve_class_init, - (GtkObjectInitFunc) gtk_curve_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_curve_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkCurve), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_curve_init, }; - curve_type = gtk_type_unique (GTK_TYPE_DRAWING_AREA, &curve_info); + curve_type = g_type_register_static (GTK_TYPE_DRAWING_AREA, "GtkCurve", + &curve_info, 0); } return curve_type; } @@ -106,9 +107,8 @@ static void gtk_curve_class_init (GtkCurveClass *class) { GObjectClass *gobject_class = G_OBJECT_CLASS (class); - GtkObjectClass *object_class = GTK_OBJECT_CLASS (class); - parent_class = gtk_type_class (GTK_TYPE_DRAWING_AREA); + parent_class = g_type_class_peek_parent (class); gobject_class->finalize = gtk_curve_finalize; @@ -166,9 +166,13 @@ gtk_curve_class_init (GtkCurveClass *class) G_PARAM_WRITABLE)); curve_type_changed_signal = - gtk_signal_new ("curve_type_changed", GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCurveClass, curve_type_changed), - _gtk_marshal_VOID__VOID, GTK_TYPE_NONE, 0); + g_signal_new ("curve_type_changed", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkCurveClass, curve_type_changed), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); } static void @@ -195,8 +199,8 @@ gtk_curve_init (GtkCurve *curve) old_mask = gtk_widget_get_events (GTK_WIDGET (curve)); gtk_widget_set_events (GTK_WIDGET (curve), old_mask | GRAPH_MASK); - gtk_signal_connect (GTK_OBJECT (curve), "event", - (GtkSignalFunc) gtk_curve_graph_events, curve); + g_signal_connect (curve, "event", + G_CALLBACK (gtk_curve_graph_events), curve); gtk_curve_size_graph (curve); } @@ -416,8 +420,8 @@ gtk_curve_draw (GtkCurve *c, gint width, gint height) gdk_draw_arc (c->pixmap, style->fg_gc[state], TRUE, x, y, RADIUS * 2, RADIUS*2, 0, 360*64); } - gdk_draw_pixmap (GTK_WIDGET (c)->window, style->fg_gc[state], c->pixmap, - 0, 0, 0, 0, width + RADIUS * 2, height + RADIUS * 2); + gdk_draw_drawable (GTK_WIDGET (c)->window, style->fg_gc[state], c->pixmap, + 0, 0, 0, 0, width + RADIUS * 2, height + RADIUS * 2); } static gint @@ -465,8 +469,8 @@ gtk_curve_graph_events (GtkWidget *widget, GdkEvent *event, GtkCurve *c) { case GDK_CONFIGURE: if (c->pixmap) - gdk_pixmap_unref (c->pixmap); - c->pixmap = 0; + g_object_unref (c->pixmap); + c->pixmap = NULL; /* fall through */ case GDK_EXPOSE: if (!c->pixmap) @@ -655,7 +659,7 @@ gtk_curve_graph_events (GtkWidget *widget, GdkEvent *event, GtkCurve *c) cursor = gdk_cursor_new_for_display (gtk_widget_get_display (w), c->cursor_type); gdk_window_set_cursor (w->window, cursor); - gdk_cursor_destroy (cursor); + gdk_cursor_unref (cursor); } retval = TRUE; break; @@ -712,7 +716,7 @@ gtk_curve_set_curve_type (GtkCurve *c, GtkCurveType new_type) c->curve_type = new_type; gtk_curve_interpolate (c, width, height); } - gtk_signal_emit (GTK_OBJECT (c), curve_type_changed_signal); + g_signal_emit (c, curve_type_changed_signal, 0); g_object_notify (G_OBJECT (c), "curve_type"); gtk_curve_draw (c, width, height); } @@ -738,8 +742,9 @@ gtk_curve_size_graph (GtkCurve *curve) else height = width / aspect; - gtk_drawing_area_size (GTK_DRAWING_AREA (curve), - width + RADIUS * 2, height + RADIUS * 2); + gtk_widget_set_size_request (GTK_WIDGET (curve), + width + RADIUS * 2, + height + RADIUS * 2); } static void @@ -785,7 +790,7 @@ gtk_curve_reset (GtkCurve *c) if (old_type != GTK_CURVE_TYPE_SPLINE) { - gtk_signal_emit (GTK_OBJECT (c), curve_type_changed_signal); + g_signal_emit (c, curve_type_changed_signal, 0); g_object_notify (G_OBJECT (c), "curve_type"); } } @@ -818,7 +823,7 @@ gtk_curve_set_gamma (GtkCurve *c, gfloat gamma) } if (old_type != GTK_CURVE_TYPE_FREE) - gtk_signal_emit (GTK_OBJECT (c), curve_type_changed_signal); + g_signal_emit (c, curve_type_changed_signal, 0); gtk_curve_draw (c, c->num_points, c->height); } @@ -890,7 +895,7 @@ gtk_curve_set_vector (GtkCurve *c, int veclen, gfloat vector[]) } if (old_type != GTK_CURVE_TYPE_FREE) { - gtk_signal_emit (GTK_OBJECT (c), curve_type_changed_signal); + g_signal_emit (c, curve_type_changed_signal, 0); g_object_notify (G_OBJECT (c), "curve_type"); } @@ -1017,7 +1022,7 @@ gtk_curve_get_vector (GtkCurve *c, int veclen, gfloat vector[]) GtkWidget* gtk_curve_new (void) { - return gtk_type_new (gtk_curve_get_type ()); + return g_object_new (GTK_TYPE_CURVE, NULL); } static void @@ -1029,7 +1034,7 @@ gtk_curve_finalize (GObject *object) curve = GTK_CURVE (object); if (curve->pixmap) - gdk_pixmap_unref (curve->pixmap); + g_object_unref (curve->pixmap); if (curve->point) g_free (curve->point); if (curve->ctlpoint) diff --git a/gtk/gtkcurve.h b/gtk/gtkcurve.h index 4ffeeab45..0d0c94b36 100644 --- a/gtk/gtkcurve.h +++ b/gtk/gtkcurve.h @@ -47,11 +47,11 @@ extern "C" { #define GTK_TYPE_CURVE (gtk_curve_get_type ()) -#define GTK_CURVE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CURVE, GtkCurve)) -#define GTK_CURVE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CURVE, GtkCurveClass)) -#define GTK_IS_CURVE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CURVE)) -#define GTK_IS_CURVE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CURVE)) -#define GTK_CURVE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_CURVE, GtkCurveClass)) +#define GTK_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CURVE, GtkCurve)) +#define GTK_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CURVE, GtkCurveClass)) +#define GTK_IS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CURVE)) +#define GTK_IS_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CURVE)) +#define GTK_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CURVE, GtkCurveClass)) typedef struct _GtkCurve GtkCurve; @@ -96,7 +96,7 @@ struct _GtkCurveClass }; -GtkType gtk_curve_get_type (void) G_GNUC_CONST; +GType gtk_curve_get_type (void) G_GNUC_CONST; GtkWidget* gtk_curve_new (void); void gtk_curve_reset (GtkCurve *curve); void gtk_curve_set_gamma (GtkCurve *curve, gfloat gamma); diff --git a/gtk/gtkgamma.c b/gtk/gtkgamma.c index bb5a12c03..ccdeb7f82 100644 --- a/gtk/gtkgamma.c +++ b/gtk/gtkgamma.c @@ -34,11 +34,10 @@ #include "gtkdrawingarea.h" #include "gtkentry.h" #include "gtkhbox.h" +#include "gtkimage.h" #include "gtklabel.h" #include "gtkmain.h" -#include "gtkpixmap.h" #include "gtkradiobutton.h" -#include "gtksignal.h" #include "gtkstock.h" #include "gtktable.h" #include "gtkvbox.h" @@ -212,26 +211,28 @@ static const char *xpm[][27] = } }; -GtkType +GType gtk_gamma_curve_get_type (void) { - static GtkType gamma_curve_type = 0; + static GType gamma_curve_type = 0; if (!gamma_curve_type) { - static const GtkTypeInfo gamma_curve_info = + static const GTypeInfo gamma_curve_info = { - "GtkGammaCurve", - sizeof (GtkGammaCurve), sizeof (GtkGammaCurveClass), - (GtkClassInitFunc) gtk_gamma_curve_class_init, - (GtkObjectInitFunc) gtk_gamma_curve_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_gamma_curve_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkGammaCurve), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_gamma_curve_init, }; - gamma_curve_type = gtk_type_unique (GTK_TYPE_VBOX, &gamma_curve_info); + gamma_curve_type = g_type_register_static (GTK_TYPE_VBOX, "GtkGammaCurve", + &gamma_curve_info, 0); } return gamma_curve_type; } @@ -241,7 +242,7 @@ gtk_gamma_curve_class_init (GtkGammaCurveClass *class) { GtkObjectClass *object_class; - parent_class = gtk_type_class (GTK_TYPE_VBOX); + parent_class = g_type_class_peek_parent (class); object_class = (GtkObjectClass *) class; object_class->destroy = gtk_gamma_curve_destroy; @@ -260,8 +261,8 @@ gtk_gamma_curve_init (GtkGammaCurve *curve) gtk_container_add (GTK_CONTAINER (curve), curve->table); curve->curve = gtk_curve_new (); - gtk_signal_connect (GTK_OBJECT (curve->curve), "curve_type_changed", - (GtkSignalFunc) curve_type_changed_callback, curve); + g_signal_connect (curve->curve, "curve_type_changed", + G_CALLBACK (curve_type_changed_callback), curve); gtk_table_attach_defaults (GTK_TABLE (curve->table), curve->curve, 0, 1, 0, 1); vbox = gtk_vbox_new (/* homogeneous */ FALSE, /* spacing */ 3); @@ -271,13 +272,13 @@ gtk_gamma_curve_init (GtkGammaCurve *curve) for (i = 0; i < 3; ++i) { curve->button[i] = gtk_toggle_button_new (); - gtk_object_set_data (GTK_OBJECT (curve->button[i]), "_GtkGammaCurveIndex", - GINT_TO_POINTER (i)); + g_object_set_data (G_OBJECT (curve->button[i]), "_GtkGammaCurveIndex", + GINT_TO_POINTER (i)); gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]); - gtk_signal_connect (GTK_OBJECT (curve->button[i]), "realize", - (GtkSignalFunc) button_realize_callback, 0); - gtk_signal_connect (GTK_OBJECT (curve->button[i]), "toggled", - (GtkSignalFunc) button_toggled_callback, curve); + g_signal_connect (curve->button[i], "realize", + G_CALLBACK (button_realize_callback), NULL); + g_signal_connect (curve->button[i], "toggled", + G_CALLBACK (button_toggled_callback), curve); gtk_widget_show (curve->button[i]); } @@ -285,13 +286,13 @@ gtk_gamma_curve_init (GtkGammaCurve *curve) for (i = 3; i < 5; ++i) { curve->button[i] = gtk_button_new (); - gtk_object_set_data (GTK_OBJECT (curve->button[i]), "_GtkGammaCurveIndex", - GINT_TO_POINTER (i)); + g_object_set_data (G_OBJECT (curve->button[i]), "_GtkGammaCurveIndex", + GINT_TO_POINTER (i)); gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]); - gtk_signal_connect (GTK_OBJECT (curve->button[i]), "realize", - (GtkSignalFunc) button_realize_callback, 0); - gtk_signal_connect (GTK_OBJECT (curve->button[i]), "clicked", - (GtkSignalFunc) button_clicked_callback, curve); + g_signal_connect (curve->button[i], "realize", + G_CALLBACK (button_realize_callback), NULL); + g_signal_connect (curve->button[i], "clicked", + G_CALLBACK (button_clicked_callback), curve); gtk_widget_show (curve->button[i]); } @@ -308,16 +309,16 @@ button_realize_callback (GtkWidget *w) GdkPixmap *pm; int i; - i = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (w), "_GtkGammaCurveIndex")); + i = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "_GtkGammaCurveIndex")); pm = gdk_pixmap_create_from_xpm_d (w->window, &mask, &w->style->bg[GTK_STATE_NORMAL], (gchar **)xpm[i]); - pixmap = gtk_pixmap_new (pm, mask); + pixmap = gtk_image_new_from_pixmap (pm, mask); gtk_container_add (GTK_CONTAINER (w), pixmap); gtk_widget_show (pixmap); - gdk_pixmap_unref (pm); - gdk_bitmap_unref (mask); /* a bitmap is really just a special pixmap */ + g_object_unref (pm); + g_object_unref (mask); } static void @@ -330,7 +331,7 @@ button_toggled_callback (GtkWidget *w, gpointer data) if (!GTK_TOGGLE_BUTTON (w)->active) return; - active = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (w), "_GtkGammaCurveIndex")); + active = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "_GtkGammaCurveIndex")); for (i = 0; i < 3; ++i) if ((i != active) && GTK_TOGGLE_BUTTON (c->button[i])->active) @@ -381,7 +382,7 @@ button_clicked_callback (GtkWidget *w, gpointer data) GtkGammaCurve *c = data; int active; - active = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (w), "_GtkGammaCurveIndex")); + active = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "_GtkGammaCurveIndex")); if (active == 3) { /* set gamma */ @@ -420,15 +421,15 @@ button_clicked_callback (GtkWidget *w, gpointer data) hbox = GTK_DIALOG (c->gamma_dialog)->action_area; button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - (GtkSignalFunc) gamma_cancel_callback, c); + g_signal_connect (button, "clicked", + G_CALLBACK (gamma_cancel_callback), c); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); gtk_widget_show (button); button = gtk_button_new_from_stock (GTK_STOCK_OK); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - (GtkSignalFunc) gamma_ok_callback, c); + g_signal_connect (button, "clicked", + G_CALLBACK (gamma_ok_callback), c); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); gtk_widget_grab_default (button); gtk_widget_show (button); @@ -464,7 +465,7 @@ curve_type_changed_callback (GtkWidget *w, gpointer data) GtkWidget* gtk_gamma_curve_new (void) { - return gtk_type_new (GTK_TYPE_GAMMA_CURVE); + return g_object_new (GTK_TYPE_GAMMA_CURVE, NULL); } static void diff --git a/gtk/gtkgamma.h b/gtk/gtkgamma.h index d9733c28d..bbf1aab21 100644 --- a/gtk/gtkgamma.h +++ b/gtk/gtkgamma.h @@ -48,11 +48,11 @@ extern "C" { #define GTK_TYPE_GAMMA_CURVE (gtk_gamma_curve_get_type ()) -#define GTK_GAMMA_CURVE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurve)) -#define GTK_GAMMA_CURVE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass)) -#define GTK_IS_GAMMA_CURVE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_GAMMA_CURVE)) -#define GTK_IS_GAMMA_CURVE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_GAMMA_CURVE)) -#define GTK_GAMMA_CURVE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass)) +#define GTK_GAMMA_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurve)) +#define GTK_GAMMA_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass)) +#define GTK_IS_GAMMA_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_GAMMA_CURVE)) +#define GTK_IS_GAMMA_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_GAMMA_CURVE)) +#define GTK_GAMMA_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass)) typedef struct _GtkGammaCurve GtkGammaCurve; typedef struct _GtkGammaCurveClass GtkGammaCurveClass; @@ -83,7 +83,7 @@ struct _GtkGammaCurveClass }; -GtkType gtk_gamma_curve_get_type (void) G_GNUC_CONST; +GType gtk_gamma_curve_get_type (void) G_GNUC_CONST; GtkWidget* gtk_gamma_curve_new (void); diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c index e48968fc1..3d9ad1b53 100644 --- a/gtk/gtklayout.c +++ b/gtk/gtklayout.c @@ -31,7 +31,6 @@ #include "gdkconfig.h" #include "gtklayout.h" -#include "gtksignal.h" #include "gtkprivate.h" #include "gtkintl.h" #include "gtkmarshalers.h" @@ -208,39 +207,43 @@ gtk_layout_set_adjustments (GtkLayout *layout, if (layout->hadjustment && (layout->hadjustment != hadj)) { - gtk_signal_disconnect_by_data (GTK_OBJECT (layout->hadjustment), layout); - gtk_object_unref (GTK_OBJECT (layout->hadjustment)); + g_signal_handlers_disconnect_by_func (layout->hadjustment, + gtk_layout_adjustment_changed, + layout); + g_object_unref (layout->hadjustment); } if (layout->vadjustment && (layout->vadjustment != vadj)) { - gtk_signal_disconnect_by_data (GTK_OBJECT (layout->vadjustment), layout); - gtk_object_unref (GTK_OBJECT (layout->vadjustment)); + g_signal_handlers_disconnect_by_func (layout->vadjustment, + gtk_layout_adjustment_changed, + layout); + g_object_unref (layout->vadjustment); } if (layout->hadjustment != hadj) { layout->hadjustment = hadj; - gtk_object_ref (GTK_OBJECT (layout->hadjustment)); + g_object_ref (layout->hadjustment); gtk_object_sink (GTK_OBJECT (layout->hadjustment)); gtk_layout_set_adjustment_upper (layout->hadjustment, layout->width, FALSE); - gtk_signal_connect (GTK_OBJECT (layout->hadjustment), "value_changed", - (GtkSignalFunc) gtk_layout_adjustment_changed, - layout); + g_signal_connect (layout->hadjustment, "value_changed", + G_CALLBACK (gtk_layout_adjustment_changed), + layout); need_adjust = TRUE; } if (layout->vadjustment != vadj) { layout->vadjustment = vadj; - gtk_object_ref (GTK_OBJECT (layout->vadjustment)); + g_object_ref (layout->vadjustment); gtk_object_sink (GTK_OBJECT (layout->vadjustment)); gtk_layout_set_adjustment_upper (layout->vadjustment, layout->height, FALSE); - gtk_signal_connect (GTK_OBJECT (layout->vadjustment), "value_changed", - (GtkSignalFunc) gtk_layout_adjustment_changed, - layout); + g_signal_connect (layout->vadjustment, "value_changed", + G_CALLBACK (gtk_layout_adjustment_changed), + layout); need_adjust = TRUE; } @@ -255,8 +258,8 @@ gtk_layout_finalize (GObject *object) { GtkLayout *layout = GTK_LAYOUT (object); - gtk_object_unref (GTK_OBJECT (layout->hadjustment)); - gtk_object_unref (GTK_OBJECT (layout->vadjustment)); + g_object_unref (layout->hadjustment); + g_object_unref (layout->vadjustment); G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -442,9 +445,9 @@ gtk_layout_set_adjustment_upper (GtkAdjustment *adj, } if (changed || always_emit_changed) - gtk_signal_emit_by_name (GTK_OBJECT (adj), "changed"); + gtk_adjustment_changed (adj); if (value_changed) - gtk_signal_emit_by_name (GTK_OBJECT (adj), "value_changed"); + gtk_adjustment_value_changed (adj); } /** @@ -542,33 +545,40 @@ gtk_layout_thaw (GtkLayout *layout) g_return_if_fail (GTK_IS_LAYOUT (layout)); if (layout->freeze_count) - if (!(--layout->freeze_count)) - gtk_widget_draw (GTK_WIDGET (layout), NULL); + { + if (!(--layout->freeze_count)) + { + gtk_widget_queue_draw (GTK_WIDGET (layout)); + gdk_window_process_updates (GTK_WIDGET (layout)->window, TRUE); + } + } + } /* Basic Object handling procedures */ -GtkType +GType gtk_layout_get_type (void) { - static GtkType layout_type = 0; + static GType layout_type = 0; if (!layout_type) { static const GTypeInfo layout_info = { sizeof (GtkLayoutClass), - NULL, /* base_init */ - NULL, /* base_finalize */ + NULL, /* base_init */ + NULL, /* base_finalize */ (GClassInitFunc) gtk_layout_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ + NULL, /* class_finalize */ + NULL, /* class_data */ sizeof (GtkLayout), - 16, /* n_preallocs */ + 0, /* n_preallocs */ (GInstanceInitFunc) gtk_layout_init, }; - layout_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkLayout", &layout_info, 0); + layout_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkLayout", + &layout_info, 0); } return layout_type; @@ -578,16 +588,14 @@ static void gtk_layout_class_init (GtkLayoutClass *class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; gobject_class = (GObjectClass*) class; - object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; container_class = (GtkContainerClass*) class; - parent_class = gtk_type_class (GTK_TYPE_CONTAINER); + parent_class = g_type_class_peek_parent (class); gobject_class->set_property = gtk_layout_set_property; gobject_class->get_property = gtk_layout_get_property; @@ -665,12 +673,15 @@ gtk_layout_class_init (GtkLayoutClass *class) class->set_scroll_adjustments = gtk_layout_set_adjustments; widget_class->set_scroll_adjustments_signal = - gtk_signal_new ("set_scroll_adjustments", - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkLayoutClass, set_scroll_adjustments), - _gtk_marshal_VOID__OBJECT_OBJECT, - GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT); + g_signal_new ("set_scroll_adjustments", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkLayoutClass, set_scroll_adjustments), + NULL, NULL, + _gtk_marshal_VOID__OBJECT_OBJECT, + G_TYPE_NONE, 2, + GTK_TYPE_ADJUSTMENT, + GTK_TYPE_ADJUSTMENT); } static void diff --git a/gtk/gtklayout.h b/gtk/gtklayout.h index d12765008..fbe4b5081 100644 --- a/gtk/gtklayout.h +++ b/gtk/gtklayout.h @@ -41,11 +41,11 @@ extern "C" { #define GTK_TYPE_LAYOUT (gtk_layout_get_type ()) -#define GTK_LAYOUT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_LAYOUT, GtkLayout)) -#define GTK_LAYOUT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LAYOUT, GtkLayoutClass)) -#define GTK_IS_LAYOUT(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_LAYOUT)) -#define GTK_IS_LAYOUT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LAYOUT)) -#define GTK_LAYOUT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_LAYOUT, GtkLayoutClass)) +#define GTK_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LAYOUT, GtkLayout)) +#define GTK_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LAYOUT, GtkLayoutClass)) +#define GTK_IS_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LAYOUT)) +#define GTK_IS_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LAYOUT)) +#define GTK_LAYOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LAYOUT, GtkLayoutClass)) typedef struct _GtkLayout GtkLayout; @@ -89,7 +89,7 @@ struct _GtkLayoutClass void (*_gtk_reserved4) (void); }; -GtkType gtk_layout_get_type (void) G_GNUC_CONST; +GType gtk_layout_get_type (void) G_GNUC_CONST; GtkWidget* gtk_layout_new (GtkAdjustment *hadjustment, GtkAdjustment *vadjustment); void gtk_layout_put (GtkLayout *layout, diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 4be918835..8fe9579e2 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -38,7 +38,6 @@ #include "gtkselection.h" #include "gtksettings.h" #include "gtksizegroup.h" -#include "gtksignal.h" #include "gtkwidget.h" #include "gtkwindow.h" #include "gtkbindings.h" @@ -243,25 +242,25 @@ GParamSpecPool *_gtk_widget_child_property_pool = NULL; GObjectNotifyContext *_gtk_widget_child_property_notify_context = NULL; /* --- functions --- */ -GtkType +GType gtk_widget_get_type (void) { - static GtkType widget_type = 0; + static GType widget_type = 0; if (!widget_type) { static const GTypeInfo widget_info = { sizeof (GtkWidgetClass), - NULL, /* base_init */ - NULL, /* base_finalize */ + NULL, /* base_init */ + NULL, /* base_finalize */ (GClassInitFunc) gtk_widget_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ + NULL, /* class_finalize */ + NULL, /* class_init */ sizeof (GtkWidget), - 0, /* n_preallocs */ + 0, /* n_preallocs */ (GInstanceInitFunc) gtk_widget_init, - NULL, /* value_table */ + NULL, /* value_table */ }; static const GInterfaceInfo accessibility_info = @@ -515,346 +514,361 @@ gtk_widget_class_init (GtkWidgetClass *klass) GDK_EXTENSION_EVENTS_NONE, G_PARAM_READWRITE)); widget_signals[SHOW] = - gtk_signal_new ("show", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, show), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("show", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, show), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); widget_signals[HIDE] = - gtk_signal_new ("hide", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, hide), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("hide", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, hide), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); widget_signals[MAP] = - gtk_signal_new ("map", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, map), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("map", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, map), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); widget_signals[UNMAP] = - gtk_signal_new ("unmap", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, unmap), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("unmap", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, unmap), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); widget_signals[REALIZE] = - gtk_signal_new ("realize", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, realize), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("realize", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, realize), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); widget_signals[UNREALIZE] = - gtk_signal_new ("unrealize", - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, unrealize), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("unrealize", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, unrealize), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); widget_signals[SIZE_REQUEST] = g_signal_new ("size_request", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GtkWidgetClass, size_request), - NULL, NULL, - _gtk_marshal_VOID__BOXED, - GTK_TYPE_NONE, 1, - GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, size_request), + NULL, NULL, + _gtk_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[SIZE_ALLOCATE] = - gtk_signal_new ("size_allocate", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, size_allocate), - _gtk_marshal_VOID__BOXED, - GTK_TYPE_NONE, 1, - GDK_TYPE_RECTANGLE | G_SIGNAL_TYPE_STATIC_SCOPE); + g_signal_new ("size_allocate", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, size_allocate), + NULL, NULL, + _gtk_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + GDK_TYPE_RECTANGLE | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[STATE_CHANGED] = - gtk_signal_new ("state_changed", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, state_changed), - _gtk_marshal_VOID__ENUM, - GTK_TYPE_NONE, 1, - GTK_TYPE_STATE_TYPE); + g_signal_new ("state_changed", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, state_changed), + NULL, NULL, + _gtk_marshal_VOID__ENUM, + G_TYPE_NONE, 1, + GTK_TYPE_STATE_TYPE); widget_signals[PARENT_SET] = - gtk_signal_new ("parent_set", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, parent_set), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, - GTK_TYPE_WIDGET); + g_signal_new ("parent_set", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, parent_set), + NULL, NULL, + _gtk_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_WIDGET); widget_signals[HIERARCHY_CHANGED] = - gtk_signal_new ("hierarchy_changed", - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, hierarchy_changed), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, - GTK_TYPE_WIDGET); + g_signal_new ("hierarchy_changed", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, hierarchy_changed), + NULL, NULL, + _gtk_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_WIDGET); widget_signals[STYLE_SET] = - gtk_signal_new ("style_set", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, style_set), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, - GTK_TYPE_STYLE); + g_signal_new ("style_set", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, style_set), + NULL, NULL, + _gtk_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_STYLE); widget_signals[DIRECTION_CHANGED] = - gtk_signal_new ("direction_changed", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, direction_changed), - _gtk_marshal_VOID__ENUM, - GTK_TYPE_NONE, 1, - GTK_TYPE_TEXT_DIRECTION); + g_signal_new ("direction_changed", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, direction_changed), + NULL, NULL, + _gtk_marshal_VOID__ENUM, + G_TYPE_NONE, 1, + GTK_TYPE_TEXT_DIRECTION); widget_signals[GRAB_NOTIFY] = - gtk_signal_new ("grab_notify", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, grab_notify), - _gtk_marshal_VOID__BOOLEAN, - GTK_TYPE_NONE, 1, - GTK_TYPE_BOOL); + g_signal_new ("grab_notify", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkWidgetClass, grab_notify), + NULL, NULL, + _gtk_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, + G_TYPE_BOOLEAN); widget_signals[CHILD_NOTIFY] = g_signal_new ("child_notify", - G_TYPE_FROM_CLASS (klass), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (GtkWidgetClass, child_notify), NULL, NULL, g_cclosure_marshal_VOID__PARAM, - G_TYPE_NONE, - 1, G_TYPE_PARAM); + G_TYPE_NONE, 1, + G_TYPE_PARAM); widget_signals[MNEMONIC_ACTIVATE] = g_signal_new ("mnemonic_activate", - GTK_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - GTK_SIGNAL_OFFSET (GtkWidgetClass, mnemonic_activate), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOOLEAN, - GTK_TYPE_BOOL, 1, - GTK_TYPE_BOOL); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, mnemonic_activate), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOOLEAN, + G_TYPE_BOOLEAN, 1, + G_TYPE_BOOLEAN); widget_signals[GRAB_FOCUS] = - gtk_signal_new ("grab_focus", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, grab_focus), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("grab_focus", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkWidgetClass, grab_focus), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); widget_signals[FOCUS] = g_signal_new ("focus", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkWidgetClass, focus), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__ENUM, - G_TYPE_BOOLEAN, 1, - GTK_TYPE_DIRECTION_TYPE); + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, focus), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__ENUM, + G_TYPE_BOOLEAN, 1, + GTK_TYPE_DIRECTION_TYPE); widget_signals[EVENT] = g_signal_new ("event", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[EVENT_AFTER] = g_signal_new ("event-after", - G_TYPE_FROM_CLASS (object_class), - 0, - 0, - NULL, NULL, - _gtk_marshal_VOID__BOXED, - G_TYPE_NONE, 1, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + 0, + 0, + NULL, NULL, + _gtk_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[BUTTON_PRESS_EVENT] = g_signal_new ("button_press_event", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, button_press_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, button_press_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[BUTTON_RELEASE_EVENT] = g_signal_new ("button_release_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, button_release_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, button_release_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[SCROLL_EVENT] = g_signal_new ("scroll_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, scroll_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, scroll_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[MOTION_NOTIFY_EVENT] = g_signal_new ("motion_notify_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, motion_notify_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, motion_notify_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[DELETE_EVENT] = g_signal_new ("delete_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, delete_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, delete_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[DESTROY_EVENT] = g_signal_new ("destroy_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, destroy_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, destroy_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[EXPOSE_EVENT] = g_signal_new ("expose_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, expose_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, expose_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[KEY_PRESS_EVENT] = g_signal_new ("key_press_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, key_press_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, key_press_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[KEY_RELEASE_EVENT] = g_signal_new ("key_release_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, key_release_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, key_release_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[ENTER_NOTIFY_EVENT] = g_signal_new ("enter_notify_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, enter_notify_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, enter_notify_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[LEAVE_NOTIFY_EVENT] = g_signal_new ("leave_notify_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, leave_notify_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, leave_notify_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[CONFIGURE_EVENT] = g_signal_new ("configure_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, configure_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, configure_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[FOCUS_IN_EVENT] = g_signal_new ("focus_in_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, focus_in_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, focus_in_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[FOCUS_OUT_EVENT] = g_signal_new ("focus_out_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, focus_out_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, focus_out_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[MAP_EVENT] = g_signal_new ("map_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, map_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, map_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[UNMAP_EVENT] = g_signal_new ("unmap_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, unmap_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, unmap_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[PROPERTY_NOTIFY_EVENT] = g_signal_new ("property_notify_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, property_notify_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, property_notify_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[SELECTION_CLEAR_EVENT] = g_signal_new ("selection_clear_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, selection_clear_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, selection_clear_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[SELECTION_REQUEST_EVENT] = g_signal_new ("selection_request_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, selection_request_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, selection_request_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[SELECTION_NOTIFY_EVENT] = g_signal_new ("selection_notify_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, selection_notify_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, selection_notify_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[SELECTION_RECEIVED] = g_signal_new ("selection_received", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GtkWidgetClass, selection_received), NULL, NULL, @@ -864,7 +878,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) G_TYPE_UINT); widget_signals[SELECTION_GET] = g_signal_new ("selection_get", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GtkWidgetClass, selection_get), NULL, NULL, @@ -875,61 +889,65 @@ gtk_widget_class_init (GtkWidgetClass *klass) G_TYPE_UINT); widget_signals[PROXIMITY_IN_EVENT] = g_signal_new ("proximity_in_event", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, proximity_in_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, proximity_in_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[PROXIMITY_OUT_EVENT] = g_signal_new ("proximity_out_event", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, proximity_out_event), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, proximity_out_event), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[DRAG_LEAVE] = - gtk_signal_new ("drag_leave", - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_leave), - _gtk_marshal_VOID__OBJECT_UINT, - GTK_TYPE_NONE, 2, - GDK_TYPE_DRAG_CONTEXT, - GTK_TYPE_UINT); + g_signal_new ("drag_leave", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, drag_leave), + NULL, NULL, + _gtk_marshal_VOID__OBJECT_UINT, + G_TYPE_NONE, 2, + GDK_TYPE_DRAG_CONTEXT, + G_TYPE_UINT); widget_signals[DRAG_BEGIN] = - gtk_signal_new ("drag_begin", - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_begin), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, - GDK_TYPE_DRAG_CONTEXT); + g_signal_new ("drag_begin", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, drag_begin), + NULL, NULL, + _gtk_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GDK_TYPE_DRAG_CONTEXT); widget_signals[DRAG_END] = - gtk_signal_new ("drag_end", - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_end), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, - GDK_TYPE_DRAG_CONTEXT); + g_signal_new ("drag_end", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, drag_end), + NULL, NULL, + _gtk_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GDK_TYPE_DRAG_CONTEXT); widget_signals[DRAG_DATA_DELETE] = - gtk_signal_new ("drag_data_delete", - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_data_delete), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, - GDK_TYPE_DRAG_CONTEXT); + g_signal_new ("drag_data_delete", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, drag_data_delete), + NULL, NULL, + _gtk_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GDK_TYPE_DRAG_CONTEXT); widget_signals[DRAG_MOTION] = g_signal_new ("drag_motion", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, drag_motion), - _gtk_boolean_handled_accumulator, NULL, + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, drag_motion), + _gtk_boolean_handled_accumulator, NULL, _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT, G_TYPE_BOOLEAN, 4, GDK_TYPE_DRAG_CONTEXT, @@ -938,10 +956,10 @@ gtk_widget_class_init (GtkWidgetClass *klass) G_TYPE_UINT); widget_signals[DRAG_DROP] = g_signal_new ("drag_drop", - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, drag_drop), - _gtk_boolean_handled_accumulator, NULL, + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkWidgetClass, drag_drop), + _gtk_boolean_handled_accumulator, NULL, _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT, G_TYPE_BOOLEAN, 4, GDK_TYPE_DRAG_CONTEXT, @@ -950,7 +968,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) G_TYPE_UINT); widget_signals[DRAG_DATA_GET] = g_signal_new ("drag_data_get", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GtkWidgetClass, drag_data_get), NULL, NULL, @@ -962,9 +980,9 @@ gtk_widget_class_init (GtkWidgetClass *klass) G_TYPE_UINT); widget_signals[DRAG_DATA_RECEIVED] = g_signal_new ("drag_data_received", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, - GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_data_received), + G_STRUCT_OFFSET (GtkWidgetClass, drag_data_received), NULL, NULL, _gtk_marshal_VOID__OBJECT_INT_INT_BOXED_UINT_UINT, G_TYPE_NONE, 6, @@ -976,63 +994,65 @@ gtk_widget_class_init (GtkWidgetClass *klass) G_TYPE_UINT); widget_signals[VISIBILITY_NOTIFY_EVENT] = g_signal_new ("visibility_notify_event", - G_TYPE_FROM_CLASS(object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, visibility_notify_event), - _gtk_boolean_handled_accumulator, NULL, + G_STRUCT_OFFSET (GtkWidgetClass, visibility_notify_event), + _gtk_boolean_handled_accumulator, NULL, _gtk_marshal_BOOLEAN__BOXED, G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[CLIENT_EVENT] = g_signal_new ("client_event", - G_TYPE_FROM_CLASS(object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, client_event), + G_STRUCT_OFFSET (GtkWidgetClass, client_event), _gtk_boolean_handled_accumulator, NULL, _gtk_marshal_BOOLEAN__BOXED, G_TYPE_BOOLEAN, 1, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[NO_EXPOSE_EVENT] = g_signal_new ("no_expose_event", - G_TYPE_FROM_CLASS(object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, no_expose_event), + G_STRUCT_OFFSET (GtkWidgetClass, no_expose_event), _gtk_boolean_handled_accumulator, NULL, _gtk_marshal_BOOLEAN__BOXED, G_TYPE_BOOLEAN, 1, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[WINDOW_STATE_EVENT] = g_signal_new ("window_state_event", - G_TYPE_FROM_CLASS(object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkWidgetClass, window_state_event), + G_STRUCT_OFFSET (GtkWidgetClass, window_state_event), _gtk_boolean_handled_accumulator, NULL, _gtk_marshal_BOOLEAN__BOXED, G_TYPE_BOOLEAN, 1, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); widget_signals[POPUP_MENU] = g_signal_new ("popup_menu", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, - GTK_SIGNAL_OFFSET (GtkWidgetClass, popup_menu), + G_STRUCT_OFFSET (GtkWidgetClass, popup_menu), _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__VOID, + _gtk_marshal_BOOLEAN__VOID, G_TYPE_BOOLEAN, 0); widget_signals[SHOW_HELP] = g_signal_new ("show_help", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, - GTK_SIGNAL_OFFSET (GtkWidgetClass, show_help), + G_STRUCT_OFFSET (GtkWidgetClass, show_help), _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__ENUM, - G_TYPE_BOOLEAN, 1, GTK_TYPE_WIDGET_HELP_TYPE); + _gtk_marshal_BOOLEAN__ENUM, + G_TYPE_BOOLEAN, 1, + GTK_TYPE_WIDGET_HELP_TYPE); widget_signals[ACCEL_CLOSURES_CHANGED] = - gtk_signal_new ("accel_closures_changed", - 0, - GTK_CLASS_TYPE (object_class), - 0, - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("accel_closures_changed", + G_TYPE_FROM_CLASS (gobject_class), + 0, + 0, + NULL, NULL, + _gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); binding_set = gtk_binding_set_by_class (klass); gtk_binding_entry_add_signal (binding_set, GDK_F10, GDK_SHIFT_MASK, @@ -1263,14 +1283,14 @@ gtk_widget_get_property (GObject *object, g_value_set_object (value, gtk_widget_get_style (widget)); break; case PROP_EVENTS: - eventp = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_event_mask); + eventp = g_object_get_qdata (G_OBJECT (widget), quark_event_mask); if (!eventp) g_value_set_flags (value, 0); else g_value_set_flags (value, *eventp); break; case PROP_EXTENSION_EVENTS: - modep = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_extension_event_mode); + modep = g_object_get_qdata (G_OBJECT (widget), quark_extension_event_mode); if (!modep) g_value_set_enum (value, 0); else @@ -1406,20 +1426,20 @@ gtk_widget_thaw_child_notify (GtkWidget *widget) * its properties in one go. For example you might write: * <literal>gtk_widget_new (GTK_TYPE_LABEL, "label", "Hello World", "xalign", * 0.0, NULL)</literal> to create a left-aligned label. Equivalent to - * gtk_object_new(), but returns a widget so you don't have to + * g_object_new(), but returns a widget so you don't have to * cast the object yourself. * * Return value: a new #GtkWidget of type @widget_type **/ GtkWidget* -gtk_widget_new (GtkType type, +gtk_widget_new (GType type, const gchar *first_property_name, ...) { GtkWidget *widget; va_list var_args; - g_return_val_if_fail (gtk_type_is_a (type, GTK_TYPE_WIDGET), NULL); + g_return_val_if_fail (g_type_is_a (type, GTK_TYPE_WIDGET), NULL); va_start (var_args, first_property_name); widget = (GtkWidget *)g_object_new_valist (type, first_property_name, var_args); @@ -1434,8 +1454,8 @@ gtk_widget_new (GtkType type, * @first_property_name: name of first property to set * @Varargs: value of first property, followed by more properties, %NULL-terminated * - * Like gtk_object_set() - there's no reason to use this instead of - * gtk_object_set(). + * Like g_object_set() - there's no reason to use this instead of + * g_object_set(). **/ void gtk_widget_set (GtkWidget *widget, @@ -1556,7 +1576,7 @@ gtk_widget_unparent (GtkWidget *widget) old_parent = widget->parent; widget->parent = NULL; gtk_widget_set_parent_window (widget, NULL); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[PARENT_SET], old_parent); + g_signal_emit (widget, widget_signals[PARENT_SET], 0, old_parent); if (toplevel) { _gtk_widget_propagate_hierarchy_changed (widget, toplevel); @@ -1568,7 +1588,7 @@ gtk_widget_unparent (GtkWidget *widget) if (!widget->parent) g_object_notify_queue_clear (G_OBJECT (widget), nqueue); g_object_notify_queue_thaw (G_OBJECT (widget), nqueue); - gtk_widget_unref (widget); + g_object_unref (widget); } /** @@ -1584,7 +1604,7 @@ gtk_widget_unparent (GtkWidget *widget) * reference GTK+ holds to it will be removed. Removing a * widget from its container or the list of toplevels results in the * widget being finalized, unless you've added additional references - * to the widget with gtk_object_ref(). + * to the widget with g_object_ref(). * * In most cases, only toplevel widgets (windows) require explicit * destruction, because when you destroy a toplevel its children will @@ -1649,12 +1669,12 @@ gtk_widget_show (GtkWidget *widget) if (!GTK_WIDGET_VISIBLE (widget)) { - g_object_ref (G_OBJECT (widget)); + g_object_ref (widget); if (!GTK_WIDGET_TOPLEVEL (widget)) gtk_widget_queue_resize (widget); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[SHOW]); + g_signal_emit (widget, widget_signals[SHOW], 0); g_object_notify (G_OBJECT (widget), "visible"); - g_object_unref (G_OBJECT (widget)); + g_object_unref (widget); } } @@ -1677,7 +1697,9 @@ static void gtk_widget_show_map_callback (GtkWidget *widget, GdkEvent *event, gint *flag) { *flag = TRUE; - gtk_signal_disconnect_by_data (GTK_OBJECT (widget), flag); + g_signal_handlers_disconnect_by_func (widget, + gtk_widget_show_map_callback, + flag); } /** @@ -1703,12 +1725,12 @@ gtk_widget_show_now (GtkWidget *widget) { gtk_widget_show (widget); - gtk_signal_connect (GTK_OBJECT (widget), "map_event", - GTK_SIGNAL_FUNC (gtk_widget_show_map_callback), - &flag); + g_signal_connect (widget, "map_event", + G_CALLBACK (gtk_widget_show_map_callback), + &flag); while (!flag) - gtk_main_iteration(); + gtk_main_iteration (); } else gtk_widget_show (widget); @@ -1728,12 +1750,12 @@ gtk_widget_hide (GtkWidget *widget) if (GTK_WIDGET_VISIBLE (widget)) { - gtk_widget_ref (widget); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[HIDE]); + g_object_ref (widget); + g_signal_emit (widget, widget_signals[HIDE], 0); if (!GTK_WIDGET_TOPLEVEL (widget)) gtk_widget_queue_resize (widget); g_object_notify (G_OBJECT (widget), "visible"); - gtk_widget_unref (widget); + g_object_unref (widget); } } @@ -1832,7 +1854,7 @@ gtk_widget_map (GtkWidget *widget) if (!GTK_WIDGET_REALIZED (widget)) gtk_widget_realize (widget); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[MAP]); + g_signal_emit (widget, widget_signals[MAP], 0); if (GTK_WIDGET_NO_WINDOW (widget)) gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE); @@ -1856,7 +1878,7 @@ gtk_widget_unmap (GtkWidget *widget) { if (GTK_WIDGET_NO_WINDOW (widget)) gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[UNMAP]); + g_signal_emit (widget, widget_signals[UNMAP], 0); } } @@ -1880,7 +1902,7 @@ gtk_widget_unmap (GtkWidget *widget) * isn't very useful otherwise. Many times when you think you might * need it, a better approach is to connect to a signal that will be * called after the widget is realized automatically, such as - * "expose_event". Or simply gtk_signal_connect_after() to the + * "expose_event". Or simply g_signal_connect_after() to the * "realize" signal. * **/ @@ -1897,7 +1919,7 @@ gtk_widget_realize (GtkWidget *widget) { /* if (GTK_IS_CONTAINER (widget) && !GTK_WIDGET_NO_WINDOW (widget)) - g_message ("gtk_widget_realize(%s)", gtk_type_name (GTK_WIDGET_TYPE (widget))); + g_message ("gtk_widget_realize(%s)", g_type_name (GTK_WIDGET_TYPE (widget))); */ if (widget->parent == NULL && @@ -1911,11 +1933,11 @@ gtk_widget_realize (GtkWidget *widget) gtk_widget_ensure_style (widget); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[REALIZE]); + g_signal_emit (widget, widget_signals[REALIZE], 0); if (GTK_WIDGET_HAS_SHAPE_MASK (widget)) { - shape_info = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_shape_info); + shape_info = g_object_get_qdata (G_OBJECT (widget), quark_shape_info); gdk_window_shape_combine_mask (widget->window, shape_info->shape_mask, shape_info->offset_x, @@ -1954,10 +1976,10 @@ gtk_widget_unrealize (GtkWidget *widget) if (GTK_WIDGET_REALIZED (widget)) { - gtk_widget_ref (widget); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[UNREALIZE]); + g_object_ref (widget); + g_signal_emit (widget, widget_signals[UNREALIZE], 0); GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED | GTK_MAPPED); - gtk_widget_unref (widget); + g_object_unref (widget); } } @@ -2077,7 +2099,7 @@ gtk_widget_queue_clear_area (GtkWidget *widget, x -= wx - widget->allocation.x; y -= wy - widget->allocation.y; - gdk_window_get_size (widget->window, &wwidth, &wheight); + gdk_drawable_get_size (widget->window, &wwidth, &wheight); if (x + width <= 0 || y + height <= 0 || x >= wwidth || y >= wheight) @@ -2344,7 +2366,7 @@ gtk_widget_size_allocate (GtkWidget *widget, if (!alloc_needed && !size_changed && !position_changed) return; - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[SIZE_ALLOCATE], &real_allocation); + g_signal_emit (widget, widget_signals[SIZE_ALLOCATE], 0, &real_allocation); if (GTK_WIDGET_MAPPED (widget)) { @@ -2877,10 +2899,11 @@ gtk_widget_mnemonic_activate (GtkWidget *widget, if (!GTK_WIDGET_IS_SENSITIVE (widget)) handled = TRUE; else - gtk_signal_emit (GTK_OBJECT (widget), - widget_signals[MNEMONIC_ACTIVATE], - group_cycling, - &handled); + g_signal_emit (widget, + widget_signals[MNEMONIC_ACTIVATE], + 0, + group_cycling, + &handled); return handled; } @@ -3010,9 +3033,9 @@ gtk_widget_event_internal (GtkWidget *widget, { gboolean return_val = FALSE; - gtk_widget_ref (widget); + g_object_ref (widget); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[EVENT], event, &return_val); + g_signal_emit (widget, widget_signals[EVENT], 0, event, &return_val); return_val |= !WIDGET_REALIZED_FOR_EVENT (widget, event); if (!return_val) { @@ -3106,14 +3129,14 @@ gtk_widget_event_internal (GtkWidget *widget, break; } if (signal_num != -1) - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[signal_num], event, &return_val); + g_signal_emit (widget, widget_signals[signal_num], 0, event, &return_val); } if (WIDGET_REALIZED_FOR_EVENT (widget, event)) - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[EVENT_AFTER], event); + g_signal_emit (widget, widget_signals[EVENT_AFTER], 0, event); else return_val = TRUE; - gtk_widget_unref (widget); + g_object_unref (widget); return return_val; } @@ -3138,7 +3161,7 @@ gtk_widget_activate (GtkWidget *widget) if (WIDGET_CLASS (widget)->activate_signal) { /* FIXME: we should eventually check the signals signature here */ - gtk_signal_emit (GTK_OBJECT (widget), WIDGET_CLASS (widget)->activate_signal); + g_signal_emit (widget, WIDGET_CLASS (widget)->activate_signal, 0); return TRUE; } @@ -3174,9 +3197,9 @@ gtk_widget_set_scroll_adjustments (GtkWidget *widget, if (WIDGET_CLASS (widget)->set_scroll_adjustments_signal) { /* FIXME: we should eventually check the signals signature here */ - gtk_signal_emit (GTK_OBJECT (widget), - WIDGET_CLASS (widget)->set_scroll_adjustments_signal, - hadjustment, vadjustment); + g_signal_emit (widget, + WIDGET_CLASS (widget)->set_scroll_adjustments_signal, 0, + hadjustment, vadjustment); return TRUE; } else @@ -3220,10 +3243,10 @@ gtk_widget_reparent_fixup_child (GtkWidget *widget, if (GTK_WIDGET_NO_WINDOW (widget)) { if (widget->window) - gdk_window_unref (widget->window); + g_object_unref (widget->window); widget->window = (GdkWindow*) client_data; if (widget->window) - gdk_window_ref (widget->window); + g_object_ref (widget->window); if (GTK_IS_CONTAINER (widget)) gtk_container_forall (GTK_CONTAINER (widget), @@ -3258,10 +3281,10 @@ gtk_widget_reparent (GtkWidget *widget, if (GTK_WIDGET_REALIZED (widget) && GTK_WIDGET_REALIZED (new_parent)) GTK_PRIVATE_SET_FLAG (widget, GTK_IN_REPARENT); - gtk_widget_ref (widget); + g_object_ref (widget); gtk_container_remove (GTK_CONTAINER (widget->parent), widget); gtk_container_add (GTK_CONTAINER (new_parent), widget); - gtk_widget_unref (widget); + g_object_unref (widget); if (GTK_WIDGET_IN_REPARENT (widget)) { @@ -3368,10 +3391,10 @@ gtk_widget_grab_focus (GtkWidget *widget) if (!GTK_WIDGET_IS_SENSITIVE (widget)) return; - g_object_ref (G_OBJECT (widget)); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[GRAB_FOCUS]); + g_object_ref (widget); + g_signal_emit (widget, widget_signals[GRAB_FOCUS], 0); g_object_notify (G_OBJECT (widget), "has_focus"); - g_object_unref (G_OBJECT (widget)); + g_object_unref (widget); } static void @@ -3581,7 +3604,7 @@ gtk_widget_get_name (GtkWidget *widget) if (widget->name) return widget->name; - return gtk_type_name (GTK_WIDGET_TYPE (widget)); + return g_type_name (GTK_WIDGET_TYPE (widget)); } /** @@ -3788,7 +3811,7 @@ gtk_widget_set_parent (GtkWidget *widget, /* keep this function in sync with gtk_menu_attach_to_widget() */ - gtk_widget_ref (widget); + g_object_ref (widget); gtk_object_sink (GTK_OBJECT (widget)); widget->parent = parent; @@ -3804,7 +3827,7 @@ gtk_widget_set_parent (GtkWidget *widget, gtk_widget_reset_rc_styles (widget); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[PARENT_SET], NULL); + g_signal_emit (widget, widget_signals[PARENT_SET], 0, NULL); if (GTK_WIDGET_ANCHORED (widget->parent)) _gtk_widget_propagate_hierarchy_changed (widget, NULL); g_object_notify (G_OBJECT (widget), "parent"); @@ -3975,13 +3998,12 @@ gtk_widget_modify_style (GtkWidget *widget, g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_RC_STYLE (style)); - old_style = gtk_object_get_data_by_id (GTK_OBJECT (widget), - quark_rc_style); + old_style = g_object_get_qdata (G_OBJECT (widget), quark_rc_style); - gtk_object_set_data_by_id_full (GTK_OBJECT (widget), - quark_rc_style, - gtk_rc_style_copy (style), - (GtkDestroyNotify)gtk_rc_style_unref); + g_object_set_qdata_full (G_OBJECT (widget), + quark_rc_style, + gtk_rc_style_copy (style), + (GDestroyNotify) gtk_rc_style_unref); /* note that "style" may be invalid here if it was the old * modifier style and the only reference was our own. @@ -4019,16 +4041,15 @@ gtk_widget_get_modifier_style (GtkWidget *widget) g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - rc_style = gtk_object_get_data_by_id (GTK_OBJECT (widget), - quark_rc_style); + rc_style = g_object_get_qdata (G_OBJECT (widget), quark_rc_style); if (!rc_style) { rc_style = gtk_rc_style_new (); - gtk_object_set_data_by_id_full (GTK_OBJECT (widget), - quark_rc_style, - rc_style, - (GtkDestroyNotify)gtk_rc_style_unref); + g_object_set_qdata_full (G_OBJECT (widget), + quark_rc_style, + rc_style, + (GDestroyNotify) gtk_rc_style_unref); } return rc_style; @@ -4222,7 +4243,7 @@ gtk_widget_set_style_internal (GtkWidget *widget, GtkStyle *style, gboolean initial_emission) { - g_object_ref (G_OBJECT (widget)); + g_object_ref (widget); g_object_freeze_notify (G_OBJECT (widget)); if (widget->style != style || initial_emission) @@ -4249,21 +4270,23 @@ gtk_widget_set_style_internal (GtkWidget *widget, if (GTK_WIDGET_REALIZED (widget)) widget->style = gtk_style_attach (widget->style, widget->window); - gtk_signal_emit (GTK_OBJECT (widget), - widget_signals[STYLE_SET], - initial_emission ? NULL : previous_style); + g_signal_emit (widget, + widget_signals[STYLE_SET], + 0, + initial_emission ? NULL : previous_style); g_object_unref (previous_style); if (widget->parent && !initial_emission) gtk_widget_queue_resize (widget); } else if (initial_emission) - gtk_signal_emit (GTK_OBJECT (widget), - widget_signals[STYLE_SET], - NULL); + g_signal_emit (widget, + widget_signals[STYLE_SET], + 0, + NULL); g_object_notify (G_OBJECT (widget), "style"); g_object_thaw_notify (G_OBJECT (widget)); - g_object_unref (G_OBJECT (widget)); + g_object_unref (widget); } static void @@ -4277,22 +4300,21 @@ gtk_widget_propagate_hierarchy_changed_recurse (GtkWidget *widget, if (GTK_WIDGET_ANCHORED (widget) != new_anchored) { - gtk_widget_ref (widget); + g_object_ref (widget); if (new_anchored) GTK_PRIVATE_SET_FLAG (widget, GTK_ANCHORED); else GTK_PRIVATE_UNSET_FLAG (widget, GTK_ANCHORED); - g_signal_emit (GTK_OBJECT (widget), widget_signals[HIERARCHY_CHANGED], - 0, client_data); + g_signal_emit (widget, widget_signals[HIERARCHY_CHANGED], 0, client_data); if (GTK_IS_CONTAINER (widget)) gtk_container_forall (GTK_CONTAINER (widget), gtk_widget_propagate_hierarchy_changed_recurse, client_data); - gtk_widget_unref (widget); + g_object_unref (widget); } } @@ -4361,7 +4383,7 @@ gtk_widget_get_default_style (void) static PangoContext * gtk_widget_peek_pango_context (GtkWidget *widget) { - return gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_pango_context); + return g_object_get_qdata (G_OBJECT (widget), quark_pango_context); } /** @@ -4389,7 +4411,7 @@ gtk_widget_get_pango_context (GtkWidget *widget) g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - context = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_pango_context); + context = g_object_get_qdata (G_OBJECT (widget), quark_pango_context); if (context) { screen = g_object_get_data (G_OBJECT (context), "gdk-pango-screen"); @@ -4400,8 +4422,10 @@ gtk_widget_get_pango_context (GtkWidget *widget) if (!context) { context = gtk_widget_create_pango_context (GTK_WIDGET (widget)); - gtk_object_set_data_by_id_full (GTK_OBJECT (widget), quark_pango_context, context, - (GDestroyNotify) g_object_unref); + g_object_set_qdata_full (G_OBJECT (widget), + quark_pango_context, + context, + g_object_unref); } return context; @@ -4537,17 +4561,17 @@ gtk_widget_set_parent_window (GtkWidget *widget, g_return_if_fail (GTK_IS_WIDGET (widget)); - old_parent_window = gtk_object_get_data_by_id (GTK_OBJECT (widget), - quark_parent_window); + old_parent_window = g_object_get_qdata (G_OBJECT (widget), + quark_parent_window); if (parent_window != old_parent_window) { - gtk_object_set_data_by_id (GTK_OBJECT (widget), quark_parent_window, - parent_window); + g_object_set_qdata (G_OBJECT (widget), quark_parent_window, + parent_window); if (old_parent_window) - gdk_window_unref (old_parent_window); + g_object_unref (old_parent_window); if (parent_window) - gdk_window_ref (parent_window); + g_object_ref (parent_window); } } @@ -4755,8 +4779,7 @@ gtk_widget_get_parent_window (GtkWidget *widget) g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); g_return_val_if_fail (widget->parent != NULL, NULL); - parent_window = gtk_object_get_data_by_id (GTK_OBJECT (widget), - quark_parent_window); + parent_window = g_object_get_qdata (G_OBJECT (widget), quark_parent_window); return (parent_window != NULL) ? parent_window : widget->parent->window; } @@ -4814,9 +4837,10 @@ gtk_widget_child_focus (GtkWidget *widget, !GTK_WIDGET_CAN_FOCUS (widget)) return FALSE; - gtk_signal_emit (GTK_OBJECT (widget), - widget_signals[FOCUS], - direction, &return_val); + g_signal_emit (widget, + widget_signals[FOCUS], + 0, + direction, &return_val); return return_val; } @@ -4852,6 +4876,8 @@ gtk_widget_set_uposition (GtkWidget *widget, /* FIXME this function is the only place that aux_info->x and * aux_info->y are even used I believe, and this function is * deprecated. Should be cleaned up. + * + * (Actually, size_allocate uses them) -Yosh */ GtkWidgetAuxInfo *aux_info; @@ -5061,7 +5087,7 @@ gtk_widget_set_events (GtkWidget *widget, g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (!GTK_WIDGET_REALIZED (widget)); - eventp = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_event_mask); + eventp = g_object_get_qdata (G_OBJECT (widget), quark_event_mask); if (events) { @@ -5069,12 +5095,12 @@ gtk_widget_set_events (GtkWidget *widget, eventp = g_new (gint, 1); *eventp = events; - gtk_object_set_data_by_id (GTK_OBJECT (widget), quark_event_mask, eventp); + g_object_set_qdata (G_OBJECT (widget), quark_event_mask, eventp); } else if (eventp) { g_free (eventp); - gtk_object_remove_data_by_id (GTK_OBJECT (widget), quark_event_mask); + g_object_set_qdata (G_OBJECT (widget), quark_event_mask, NULL); } g_object_notify (G_OBJECT (widget), "events"); @@ -5097,7 +5123,7 @@ gtk_widget_add_events (GtkWidget *widget, g_return_if_fail (GTK_IS_WIDGET (widget)); - eventp = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_event_mask); + eventp = g_object_get_qdata (G_OBJECT (widget), quark_event_mask); if (events) { @@ -5108,12 +5134,12 @@ gtk_widget_add_events (GtkWidget *widget, } *eventp |= events; - gtk_object_set_data_by_id (GTK_OBJECT (widget), quark_event_mask, eventp); + g_object_set_qdata (G_OBJECT (widget), quark_event_mask, eventp); } else if (eventp) { g_free (eventp); - gtk_object_remove_data_by_id (GTK_OBJECT (widget), quark_event_mask); + g_object_set_qdata (G_OBJECT (widget), quark_event_mask, NULL); } if (GTK_WIDGET_REALIZED (widget)) @@ -5162,13 +5188,13 @@ gtk_widget_set_extension_events (GtkWidget *widget, g_return_if_fail (GTK_IS_WIDGET (widget)); - modep = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_extension_event_mode); + modep = g_object_get_qdata (G_OBJECT (widget), quark_extension_event_mode); if (!modep) modep = g_new (GdkExtensionMode, 1); *modep = mode; - gtk_object_set_data_by_id (GTK_OBJECT (widget), quark_extension_event_mode, modep); + g_object_set_qdata (G_OBJECT (widget), quark_extension_event_mode, modep); g_object_notify (G_OBJECT (widget), "extension_events"); } @@ -5230,14 +5256,14 @@ gtk_widget_get_toplevel (GtkWidget *widget) **/ GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget, - GtkType widget_type) + GType widget_type) { g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - while (widget && !gtk_type_is_a (GTK_WIDGET_TYPE (widget), widget_type)) + while (widget && !g_type_is_a (GTK_WIDGET_TYPE (widget), widget_type)) widget = widget->parent; - if (!(widget && gtk_type_is_a (GTK_WIDGET_TYPE (widget), widget_type))) + if (!(widget && g_type_is_a (GTK_WIDGET_TYPE (widget), widget_type))) return NULL; return widget; @@ -5262,7 +5288,7 @@ gtk_widget_get_colormap (GtkWidget *widget) if (widget->window) { - colormap = gdk_window_get_colormap (widget->window); + colormap = gdk_drawable_get_colormap (widget->window); /* If window was destroyed previously, we'll get NULL here */ if (colormap) return colormap; @@ -5271,7 +5297,7 @@ gtk_widget_get_colormap (GtkWidget *widget) tmp_widget = widget; while (tmp_widget) { - colormap = gtk_object_get_data_by_id (GTK_OBJECT (tmp_widget), quark_colormap); + colormap = g_object_get_qdata (G_OBJECT (tmp_widget), quark_colormap); if (colormap) return colormap; @@ -5337,12 +5363,12 @@ gtk_widget_set_colormap (GtkWidget *widget, g_return_if_fail (!GTK_WIDGET_REALIZED (widget)); g_return_if_fail (GDK_IS_COLORMAP (colormap)); - g_object_ref (G_OBJECT (colormap)); + g_object_ref (colormap); g_object_set_qdata_full (G_OBJECT (widget), quark_colormap, colormap, - (GtkDestroyNotify) g_object_unref); + g_object_unref); } /** @@ -5362,7 +5388,7 @@ gtk_widget_get_events (GtkWidget *widget) g_return_val_if_fail (GTK_IS_WIDGET (widget), 0); - events = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_event_mask); + events = g_object_get_qdata (G_OBJECT (widget), quark_event_mask); if (events) return *events; @@ -5385,7 +5411,7 @@ gtk_widget_get_extension_events (GtkWidget *widget) g_return_val_if_fail (GTK_IS_WIDGET (widget), 0); - mode = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_extension_event_mode); + mode = g_object_get_qdata (G_OBJECT (widget), quark_extension_event_mode); if (mode) return *mode; @@ -5479,10 +5505,10 @@ gtk_widget_set_composite_name (GtkWidget *widget, if (!quark_composite_name) quark_composite_name = g_quark_from_static_string ("gtk-composite-name"); - gtk_object_set_data_by_id_full (GTK_OBJECT (widget), - quark_composite_name, - g_strdup (name), - g_free); + g_object_set_qdata_full (G_OBJECT (widget), + quark_composite_name, + g_strdup (name), + g_free); } /** @@ -5526,7 +5552,7 @@ gtk_widget_get_composite_name (GtkWidget *widget) * gtk_widget_pop_composite_child (<!-- -->); * gtk_widget_set_parent (scrolled_window->hscrollbar, * GTK_WIDGET (scrolled_window)); - * gtk_widget_ref (scrolled_window->hscrollbar); + * g_object_ref (scrolled_window->hscrollbar); * </programlisting></informalexample> **/ void @@ -5633,7 +5659,7 @@ gtk_widget_emit_direction_changed (GtkWidget *widget, gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ? PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[DIRECTION_CHANGED], old_dir); + g_signal_emit (widget, widget_signals[DIRECTION_CHANGED], 0, old_dir); } /** @@ -5705,7 +5731,7 @@ gtk_widget_set_default_direction_recurse (GtkWidget *widget, gpointer data) { GtkTextDirection old_dir = GPOINTER_TO_UINT (data); - g_object_ref (G_OBJECT (widget)); + g_object_ref (widget); if (!GTK_WIDGET_DIRECTION_SET (widget)) gtk_widget_emit_direction_changed (widget, old_dir); @@ -5715,7 +5741,7 @@ gtk_widget_set_default_direction_recurse (GtkWidget *widget, gpointer data) gtk_widget_set_default_direction_recurse, data); - g_object_unref (G_OBJECT (widget)); + g_object_unref (widget); } /** @@ -5822,17 +5848,17 @@ gtk_widget_finalize (GObject *object) if (aux_info) gtk_widget_aux_info_destroy (aux_info); - events = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_event_mask); + events = g_object_get_qdata (G_OBJECT (widget), quark_event_mask); if (events) g_free (events); - mode = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_extension_event_mode); + mode = g_object_get_qdata (G_OBJECT (widget), quark_extension_event_mode); if (mode) g_free (mode); - accessible = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_accessible_object); + accessible = g_object_get_qdata (G_OBJECT (widget), quark_accessible_object); if (accessible) - g_object_unref (G_OBJECT (accessible)); + g_object_unref (accessible); G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -5896,7 +5922,7 @@ gtk_widget_real_realize (GtkWidget *widget) if (widget->parent) { widget->window = gtk_widget_get_parent_window (widget); - gdk_window_ref (widget->window); + g_object_ref (widget->window); } widget->style = gtk_style_attach (widget->style, widget->window); } @@ -5917,7 +5943,7 @@ gtk_widget_real_unrealize (GtkWidget *widget) GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED); - /* printf ("unrealizing %s\n", gtk_type_name (GTK_OBJECT (widget)->klass->type)); + /* printf ("unrealizing %s\n", g_type_name (G_TYPE_FROM_INSTANCE (widget))); */ /* We must do unrealize child widget BEFORE container widget. @@ -5940,7 +5966,7 @@ gtk_widget_real_unrealize (GtkWidget *widget) } else { - gdk_window_unref (widget->window); + g_object_unref (widget->window); widget->window = NULL; } @@ -6027,13 +6053,12 @@ gtk_widget_propagate_state (GtkWidget *widget, if (old_state != GTK_WIDGET_STATE (widget)) { - gtk_widget_ref (widget); + g_object_ref (widget); if (!GTK_WIDGET_IS_SENSITIVE (widget) && GTK_WIDGET_HAS_GRAB (widget)) gtk_grab_remove (widget); - gtk_signal_emit (GTK_OBJECT (widget), widget_signals[STATE_CHANGED], old_state); - + g_signal_emit (widget, widget_signals[STATE_CHANGED], 0, old_state); if (GTK_IS_CONTAINER (widget)) { @@ -6048,7 +6073,7 @@ gtk_widget_propagate_state (GtkWidget *widget, (GtkCallback) gtk_widget_propagate_state, data); } - gtk_widget_unref (widget); + g_object_unref (widget); } } @@ -6068,7 +6093,7 @@ _gtk_widget_get_aux_info (GtkWidget *widget, { GtkWidgetAuxInfo *aux_info; - aux_info = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_aux_info); + aux_info = g_object_get_qdata (G_OBJECT (widget), quark_aux_info); if (!aux_info && create) { if (!aux_info_mem_chunk) @@ -6083,7 +6108,7 @@ _gtk_widget_get_aux_info (GtkWidget *widget, aux_info->y = 0; aux_info->x_set = FALSE; aux_info->y_set = FALSE; - gtk_object_set_data_by_id (GTK_OBJECT (widget), quark_aux_info, aux_info); + g_object_set_qdata (G_OBJECT (widget), quark_aux_info, aux_info); } return aux_info; @@ -6106,7 +6131,7 @@ gtk_widget_aux_info_destroy (GtkWidgetAuxInfo *aux_info) static void gtk_widget_shape_info_destroy (GtkWidgetShapeInfo *info) { - gdk_drawable_unref (info->shape_mask); + g_object_unref (info->shape_mask); g_free (info); } @@ -6150,7 +6175,7 @@ gtk_widget_shape_combine_mask (GtkWidget *widget, g_object_set_qdata_full (G_OBJECT (widget), quark_shape_info, shape_info, (GDestroyNotify) gtk_widget_shape_info_destroy); - shape_info->shape_mask = gdk_drawable_ref (shape_mask); + shape_info->shape_mask = g_object_ref (shape_mask); shape_info->offset_x = offset_x; shape_info->offset_y = offset_y; @@ -6559,7 +6584,7 @@ gtk_widget_class_path (GtkWidget *widget, gchar *d; guint l; - string = gtk_type_name (GTK_WIDGET_TYPE (widget)); + string = g_type_name (GTK_WIDGET_TYPE (widget)); l = strlen (string); while (tmp_path_len <= len + l + 1) { @@ -6658,7 +6683,7 @@ gtk_widget_real_get_accessible (GtkWidget *widget) default_registry = atk_get_default_registry (); factory = atk_registry_get_factory (default_registry, - GTK_OBJECT_TYPE (widget)); + G_TYPE_FROM_INSTANCE (widget)); accessible = atk_object_factory_create_accessible (factory, G_OBJECT (widget)); @@ -6686,7 +6711,7 @@ gtk_widget_ref_accessible (AtkImplementor *implementor) accessible = gtk_widget_get_accessible (GTK_WIDGET (implementor)); if (accessible) - g_object_ref (G_OBJECT (accessible)); + g_object_ref (accessible); return accessible; } diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 1429f5af6..2a4d81123 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -90,11 +90,11 @@ typedef enum * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET. */ #define GTK_TYPE_WIDGET (gtk_widget_get_type ()) -#define GTK_WIDGET(widget) (GTK_CHECK_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget)) -#define GTK_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass)) -#define GTK_IS_WIDGET(widget) (GTK_CHECK_TYPE ((widget), GTK_TYPE_WIDGET)) -#define GTK_IS_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET)) -#define GTK_WIDGET_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass)) +#define GTK_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget)) +#define GTK_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass)) +#define GTK_IS_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_TYPE ((widget), GTK_TYPE_WIDGET)) +#define GTK_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET)) +#define GTK_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass)) /* Macros for extracting various fields from GtkWidget and GtkWidgetClass. */ @@ -426,8 +426,8 @@ struct _GtkWidgetShapeInfo GdkBitmap *shape_mask; }; -GtkType gtk_widget_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_widget_new (GtkType type, +GType gtk_widget_get_type (void) G_GNUC_CONST; +GtkWidget* gtk_widget_new (GType type, const gchar *first_property_name, ...); GtkWidget* gtk_widget_ref (GtkWidget *widget); @@ -576,7 +576,7 @@ void gtk_widget_set_extension_events (GtkWidget *widget, GdkExtensionMode gtk_widget_get_extension_events (GtkWidget *widget); GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget); GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget, - GtkType widget_type); + GType widget_type); GdkColormap* gtk_widget_get_colormap (GtkWidget *widget); GdkVisual* gtk_widget_get_visual (GtkWidget *widget); |