From e63d08e43f7f736556dd9d8cb401a68dac18e1fd Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Sun, 28 Jun 1998 07:46:10 +0000 Subject: call the base class init fucntions from all parent types upon class Sun Jun 28 04:29:10 1998 Tim Janik * gtk/gtktypeutils.c (gtk_type_class_init): call the base class init fucntions from all parent types upon class initialization. * gtk/gtkcontainer.c: (gtk_container_get_type): announce gtk_container_base_class_init to the type system. (gtk_container_base_class_init): new function to feature base class initialization. (gtk_container_get_child_arg): (gtk_container_set_child_arg): call the GtkContainerClass get_child_arg and set_child_arg methods of the class indicated through the argument name. * gtk/gtkobject.c: (gtk_object_base_class_init): new function to feature base class initialization. (gtk_object_init_type): announce gtk_object_base_class_init to the type system. (gtk_object_class_init): setup the get_arg and set_arg pointers for GtkObjectClass. (gtk_object_setv): (gtk_object_getv): call the GtkObjectClass get_arg and set_arg methods, instead of bothering the type system with this. * gtk/gtkaccellabel.c: * gtk/gtkbutton.c: * gtk/gtkradiobutton.c: * gtk/gtktable.c: * gtk/gtktogglebutton.c: * gtk/gtktipsquery.c: * gtk/gtkbox.c: * gtk/gtkpacker.c: * gtk/gtkwidget.c: * gtk/gtkwindow.c: * gtk/gtkframe.c: * gtk/gtkmisc.c: * gtk/gtklabel.c: set the object_class->{g|s}et_arg pointers to the corresponding gtk_*_{g|s]et_arg functions and updated the gtk_*_get_type functions wrt GtkTypeInfo initialization. changed a lot of the set/get arg functions to take a GtkObject argument. gtk/gtkadjustment.c: gtk/gtkalignment.c: gtk/gtkarrow.c: gtk/gtkaspectframe.c: gtk/gtkbbox.c: gtk/gtkbin.c: gtk/gtkcheckbutton.c: gtk/gtkcheckmenuitem.c: gtk/gtkclist.c: gtk/gtkcolorsel.c: gtk/gtkcombo.c: gtk/gtkctree.c: gtk/gtkcurve.c: gtk/gtkdata.c: gtk/gtkdialog.c: gtk/gtkdrawingarea.c: gtk/gtkeditable.c: gtk/gtkentry.c: gtk/gtkeventbox.c: gtk/gtkfilesel.c: gtk/gtkfixed.c: gtk/gtkfontsel.c: gtk/gtkgamma.c: gtk/gtkhandlebox.c: gtk/gtkhbbox.c: gtk/gtkhbox.c: gtk/gtkhpaned.c: gtk/gtkhruler.c: gtk/gtkhscale.c: gtk/gtkhscrollbar.c: gtk/gtkhseparator.c: gtk/gtkimage.c: gtk/gtkinputdialog.c: gtk/gtkitem.c: gtk/gtkitemfactory.c: gtk/gtklist.c: gtk/gtklistitem.c: gtk/gtkmenu.c: gtk/gtkmenubar.c: gtk/gtkmenuitem.c: gtk/gtkmenushell.c: gtk/gtknotebook.c: gtk/gtkoptionmenu.c: gtk/gtkpaned.c: gtk/gtkpixmap.c: gtk/gtkpreview.c: gtk/gtkprogressbar.c: gtk/gtkradiomenuitem.c: gtk/gtkrange.c: gtk/gtkruler.c: gtk/gtkscale.c: gtk/gtkscrollbar.c: gtk/gtkscrolledwindow.c: gtk/gtkseparator.c: gtk/gtkspinbutton.c: gtk/gtkstatusbar.c: gtk/gtktext.c: gtk/gtktoolbar.c: gtk/gtktooltips.c: gtk/gtktree.c: gtk/gtktreeitem.c: gtk/gtkvbbox.c: gtk/gtkvbox.c: gtk/gtkviewport.c: gtk/gtkvpaned.c: gtk/gtkvruler.c: gtk/gtkvscale.c: gtk/gtkvscrollbar.c: gtk/gtkvseparator.c: updated the GtkTypeInfo initialization code to match the modified GtkTypeInfo structure. --- gtk/gtkaccellabel.c | 29 ++++++++++----- gtk/gtkadjustment.c | 5 +-- gtk/gtkalignment.c | 5 +-- gtk/gtkarrow.c | 5 +-- gtk/gtkaspectframe.c | 5 +-- gtk/gtkbbox.c | 5 +-- gtk/gtkbin.c | 5 +-- gtk/gtkbox.c | 24 +++++++++---- gtk/gtkbutton.c | 26 ++++++++++---- gtk/gtkcheckbutton.c | 5 +-- gtk/gtkcheckmenuitem.c | 5 +-- gtk/gtkclist.c | 5 +-- gtk/gtkcolorsel.c | 10 +++--- gtk/gtkcombo.c | 5 +-- gtk/gtkcontainer.c | 54 ++++++++++++++++++---------- gtk/gtkctree.c | 5 +-- gtk/gtkcurve.c | 5 +-- gtk/gtkdata.c | 5 +-- gtk/gtkdialog.c | 5 +-- gtk/gtkdrawingarea.c | 5 +-- gtk/gtkeditable.c | 5 +-- gtk/gtkentry.c | 5 +-- gtk/gtkeventbox.c | 5 +-- gtk/gtkfilesel.c | 5 +-- gtk/gtkfixed.c | 5 +-- gtk/gtkfontsel.c | 26 ++++++++------ gtk/gtkframe.c | 23 ++++++++---- gtk/gtkgamma.c | 5 +-- gtk/gtkhandlebox.c | 5 +-- gtk/gtkhbbox.c | 5 +-- gtk/gtkhbox.c | 5 +-- gtk/gtkhpaned.c | 5 +-- gtk/gtkhruler.c | 5 +-- gtk/gtkhscale.c | 5 +-- gtk/gtkhscrollbar.c | 5 +-- gtk/gtkhseparator.c | 5 +-- gtk/gtkimage.c | 5 +-- gtk/gtkinputdialog.c | 5 +-- gtk/gtkitem.c | 5 +-- gtk/gtkitemfactory.c | 5 +-- gtk/gtklabel.c | 25 +++++++++---- gtk/gtklist.c | 5 +-- gtk/gtklistitem.c | 5 +-- gtk/gtkmenu.c | 5 +-- gtk/gtkmenubar.c | 5 +-- gtk/gtkmenuitem.c | 5 +-- gtk/gtkmenushell.c | 5 +-- gtk/gtkmisc.c | 26 ++++++++++---- gtk/gtknotebook.c | 5 +-- gtk/gtkobject.c | 76 +++++++++++++++++++++++++++------------ gtk/gtkobject.h | 10 +++++- gtk/gtkoptionmenu.c | 5 +-- gtk/gtkpacker.c | 10 ++++-- gtk/gtkpaned.c | 5 +-- gtk/gtkpixmap.c | 5 +-- gtk/gtkpreview.c | 5 +-- gtk/gtkprogressbar.c | 5 +-- gtk/gtkradiobutton.c | 7 ++-- gtk/gtkradiomenuitem.c | 5 +-- gtk/gtkrange.c | 5 +-- gtk/gtkruler.c | 5 +-- gtk/gtkscale.c | 5 +-- gtk/gtkscrollbar.c | 5 +-- gtk/gtkscrolledwindow.c | 5 +-- gtk/gtkseparator.c | 5 +-- gtk/gtkspinbutton.c | 5 +-- gtk/gtkstatusbar.c | 5 +-- gtk/gtktable.c | 7 ++-- gtk/gtktext.c | 5 +-- gtk/gtktipsquery.c | 26 ++++++++++---- gtk/gtktogglebutton.c | 8 +++-- gtk/gtktoolbar.c | 5 +-- gtk/gtktooltips.c | 5 +-- gtk/gtktree.c | 5 +-- gtk/gtktreeitem.c | 5 +-- gtk/gtktypeutils.c | 96 +++++++++++++++++++++---------------------------- gtk/gtktypeutils.h | 49 ++++++++++++------------- gtk/gtkvbbox.c | 5 +-- gtk/gtkvbox.c | 5 +-- gtk/gtkviewport.c | 5 +-- gtk/gtkvpaned.c | 5 +-- gtk/gtkvruler.c | 5 +-- gtk/gtkvscale.c | 5 +-- gtk/gtkvscrollbar.c | 5 +-- gtk/gtkvseparator.c | 5 +-- gtk/gtkwidget.c | 41 +++++++++++---------- gtk/gtkwindow.c | 23 ++++++++---- 87 files changed, 578 insertions(+), 353 deletions(-) (limited to 'gtk') diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index e3ec59fdf..74059250e 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -33,10 +33,10 @@ enum { static void gtk_accel_label_class_init (GtkAccelLabelClass *klass); static void gtk_accel_label_init (GtkAccelLabel *accel_label); -static void gtk_accel_label_set_arg (GtkAccelLabel *accel_label, - GtkArg *arg, - guint arg_id); -static void gtk_accel_label_get_arg (GtkAccelLabel *accel_label, +static void gtk_accel_label_set_arg (GtkObject *object, + GtkArg *arg, + guint arg_id); +static void gtk_accel_label_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void gtk_accel_label_destroy (GtkObject *object); @@ -64,8 +64,9 @@ gtk_accel_label_get_type (void) sizeof (GtkAccelLabelClass), (GtkClassInitFunc) gtk_accel_label_class_init, (GtkObjectInitFunc) gtk_accel_label_init, - (GtkArgSetFunc) gtk_accel_label_set_arg, - (GtkArgGetFunc) gtk_accel_label_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; accel_label_type = gtk_type_unique (gtk_label_get_type (), &accel_label_info); @@ -91,7 +92,9 @@ gtk_accel_label_class_init (GtkAccelLabelClass *class) parent_class = gtk_type_class (gtk_label_get_type ()); gtk_object_add_arg_type ("GtkAccelLabel::accel_widget", GTK_TYPE_WIDGET, GTK_ARG_READWRITE, ARG_ACCEL_WIDGET); - + + object_class->set_arg = gtk_accel_label_set_arg; + object_class->get_arg = gtk_accel_label_get_arg; object_class->destroy = gtk_accel_label_destroy; object_class->finalize = gtk_accel_label_finalize; @@ -109,10 +112,14 @@ gtk_accel_label_class_init (GtkAccelLabelClass *class) } static void -gtk_accel_label_set_arg (GtkAccelLabel *accel_label, +gtk_accel_label_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkAccelLabel *accel_label; + + accel_label = GTK_ACCEL_LABEL (object); + switch (arg_id) { case ARG_ACCEL_WIDGET: @@ -124,10 +131,14 @@ gtk_accel_label_set_arg (GtkAccelLabel *accel_label, } static void -gtk_accel_label_get_arg (GtkAccelLabel *accel_label, +gtk_accel_label_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkAccelLabel *accel_label; + + accel_label = GTK_ACCEL_LABEL (object); + switch (arg_id) { case ARG_ACCEL_WIDGET: diff --git a/gtk/gtkadjustment.c b/gtk/gtkadjustment.c index 9488df263..fc65dffe8 100644 --- a/gtk/gtkadjustment.c +++ b/gtk/gtkadjustment.c @@ -48,8 +48,9 @@ gtk_adjustment_get_type (void) sizeof (GtkAdjustmentClass), (GtkClassInitFunc) gtk_adjustment_class_init, (GtkObjectInitFunc) gtk_adjustment_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; adjustment_type = gtk_type_unique (gtk_data_get_type (), &adjustment_info); diff --git a/gtk/gtkalignment.c b/gtk/gtkalignment.c index 938bad77e..f06ad7a49 100644 --- a/gtk/gtkalignment.c +++ b/gtk/gtkalignment.c @@ -41,8 +41,9 @@ gtk_alignment_get_type (void) sizeof (GtkAlignmentClass), (GtkClassInitFunc) gtk_alignment_class_init, (GtkObjectInitFunc) gtk_alignment_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; alignment_type = gtk_type_unique (gtk_bin_get_type (), &alignment_info); diff --git a/gtk/gtkarrow.c b/gtk/gtkarrow.c index 26878c7f4..1e07ac270 100644 --- a/gtk/gtkarrow.c +++ b/gtk/gtkarrow.c @@ -42,8 +42,9 @@ gtk_arrow_get_type (void) sizeof (GtkArrowClass), (GtkClassInitFunc) gtk_arrow_class_init, (GtkObjectInitFunc) gtk_arrow_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; arrow_type = gtk_type_unique (gtk_misc_get_type (), &arrow_info); diff --git a/gtk/gtkaspectframe.c b/gtk/gtkaspectframe.c index 9fa3304bc..57577861c 100644 --- a/gtk/gtkaspectframe.c +++ b/gtk/gtkaspectframe.c @@ -51,8 +51,9 @@ gtk_aspect_frame_get_type (void) sizeof (GtkAspectFrameClass), (GtkClassInitFunc) gtk_aspect_frame_class_init, (GtkObjectInitFunc) gtk_aspect_frame_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; aspect_frame_type = gtk_type_unique (gtk_frame_get_type (), &aspect_frame_info); diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c index 5ad1267c0..87ae80a88 100644 --- a/gtk/gtkbbox.c +++ b/gtk/gtkbbox.c @@ -43,8 +43,9 @@ gtk_button_box_get_type (void) sizeof (GtkButtonBoxClass), (GtkClassInitFunc) gtk_button_box_class_init, (GtkObjectInitFunc) gtk_button_box_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; button_box_type = gtk_type_unique (gtk_box_get_type (), &button_box_info); diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c index 6486ad90b..8a716f31b 100644 --- a/gtk/gtkbin.c +++ b/gtk/gtkbin.c @@ -54,8 +54,9 @@ gtk_bin_get_type (void) sizeof (GtkBinClass), (GtkClassInitFunc) gtk_bin_class_init, (GtkObjectInitFunc) gtk_bin_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; bin_type = gtk_type_unique (gtk_container_get_type (), &bin_info); diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index 0b0b0a58f..ee016b8a9 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -35,10 +35,10 @@ enum { static void gtk_box_class_init (GtkBoxClass *klass); static void gtk_box_init (GtkBox *box); -static void gtk_box_get_arg (GtkBox *box, +static void gtk_box_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gtk_box_set_arg (GtkBox *box, +static void gtk_box_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void gtk_box_map (GtkWidget *widget); @@ -82,8 +82,9 @@ gtk_box_get_type (void) sizeof (GtkBoxClass), (GtkClassInitFunc) gtk_box_class_init, (GtkObjectInitFunc) gtk_box_init, - (GtkArgSetFunc) gtk_box_set_arg, - (GtkArgGetFunc) gtk_box_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; box_type = gtk_type_unique (GTK_TYPE_CONTAINER, &box_info); @@ -113,6 +114,9 @@ gtk_box_class_init (GtkBoxClass *class) gtk_container_add_child_arg_type ("GtkBox::pack_type", GTK_TYPE_PACK_TYPE, GTK_ARG_READWRITE, CHILD_ARG_PACK_TYPE); gtk_container_add_child_arg_type ("GtkBox::position", GTK_TYPE_LONG, GTK_ARG_READWRITE, CHILD_ARG_POSITION); + object_class->set_arg = gtk_box_set_arg; + object_class->get_arg = gtk_box_get_arg; + widget_class->map = gtk_box_map; widget_class->unmap = gtk_box_unmap; widget_class->draw = gtk_box_draw; @@ -137,10 +141,14 @@ gtk_box_init (GtkBox *box) } static void -gtk_box_set_arg (GtkBox *box, +gtk_box_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkBox *box; + + box = GTK_BOX (object); + switch (arg_id) { case ARG_SPACING: @@ -155,10 +163,14 @@ gtk_box_set_arg (GtkBox *box, } static void -gtk_box_get_arg (GtkBox *box, +gtk_box_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkBox *box; + + box = GTK_BOX (object); + switch (arg_id) { case ARG_SPACING: diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 710907fa7..7d617cc10 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -46,10 +46,10 @@ enum { static void gtk_button_class_init (GtkButtonClass *klass); static void gtk_button_init (GtkButton *button); -static void gtk_button_set_arg (GtkButton *button, +static void gtk_button_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gtk_button_get_arg (GtkButton *button, +static void gtk_button_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void gtk_button_map (GtkWidget *widget); @@ -111,8 +111,9 @@ gtk_button_get_type (void) sizeof (GtkButtonClass), (GtkClassInitFunc) gtk_button_class_init, (GtkObjectInitFunc) gtk_button_init, - (GtkArgSetFunc) gtk_button_set_arg, - (GtkArgGetFunc) gtk_button_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; button_type = gtk_type_unique (gtk_container_get_type (), &button_info); @@ -175,6 +176,9 @@ gtk_button_class_init (GtkButtonClass *klass) gtk_object_class_add_signals (object_class, button_signals, LAST_SIGNAL); + object_class->set_arg = gtk_button_set_arg; + object_class->get_arg = gtk_button_get_arg; + widget_class->activate_signal = button_signals[CLICKED]; widget_class->map = gtk_button_map; widget_class->unmap = gtk_button_unmap; @@ -225,14 +229,18 @@ gtk_button_child_type (GtkContainer *container) } static void -gtk_button_set_arg (GtkButton *button, +gtk_button_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) { - GtkWidget *label; + GtkButton *button; + + button = GTK_BUTTON (object); switch (arg_id) { + GtkWidget *label; + case ARG_LABEL: if (button->child) { @@ -251,10 +259,14 @@ gtk_button_set_arg (GtkButton *button, } static void -gtk_button_get_arg (GtkButton *button, +gtk_button_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkButton *button; + + button = GTK_BUTTON (object); + switch (arg_id) { case ARG_LABEL: diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c index 81a41c349..7101d1142 100644 --- a/gtk/gtkcheckbutton.c +++ b/gtk/gtkcheckbutton.c @@ -60,8 +60,9 @@ gtk_check_button_get_type (void) sizeof (GtkCheckButtonClass), (GtkClassInitFunc) gtk_check_button_class_init, (GtkObjectInitFunc) gtk_check_button_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; check_button_type = gtk_type_unique (gtk_toggle_button_get_type (), &check_button_info); diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c index 3da14fa88..86592c3c1 100644 --- a/gtk/gtkcheckmenuitem.c +++ b/gtk/gtkcheckmenuitem.c @@ -61,8 +61,9 @@ gtk_check_menu_item_get_type (void) sizeof (GtkCheckMenuItemClass), (GtkClassInitFunc) gtk_check_menu_item_class_init, (GtkObjectInitFunc) gtk_check_menu_item_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; check_menu_item_type = gtk_type_unique (gtk_menu_item_get_type (), &check_menu_item_info); diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index d4e090c7f..961398a3f 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -294,8 +294,9 @@ gtk_clist_get_type (void) sizeof (GtkCListClass), (GtkClassInitFunc) gtk_clist_class_init, (GtkObjectInitFunc) gtk_clist_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; clist_type = gtk_type_unique (gtk_container_get_type (), &clist_info); diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index fd7279394..be02d6c33 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -207,8 +207,9 @@ gtk_color_selection_get_type (void) sizeof (GtkColorSelectionClass), (GtkClassInitFunc) gtk_color_selection_class_init, (GtkObjectInitFunc) gtk_color_selection_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; color_selection_type = gtk_type_unique (gtk_vbox_get_type (), &colorsel_info); @@ -1444,8 +1445,9 @@ gtk_color_selection_dialog_get_type (void) sizeof (GtkColorSelectionDialogClass), (GtkClassInitFunc) gtk_color_selection_dialog_class_init, (GtkObjectInitFunc) gtk_color_selection_dialog_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; color_selection_dialog_type = gtk_type_unique (gtk_window_get_type (), &colorsel_diag_info); diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c index 3c7914ab8..3313374e4 100644 --- a/gtk/gtkcombo.c +++ b/gtk/gtkcombo.c @@ -703,8 +703,9 @@ gtk_combo_get_type (void) sizeof (GtkComboClass), (GtkClassInitFunc) gtk_combo_class_init, (GtkObjectInitFunc) gtk_combo_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; combo_type = gtk_type_unique (gtk_hbox_get_type (), &combo_info); } diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index fc9bb9dfd..7f67645e6 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -80,13 +80,14 @@ static void gtk_container_marshal_signal_3 (GtkObject *object, GtkArg *args); +static void gtk_container_base_class_init (GtkContainerClass *klass); static void gtk_container_class_init (GtkContainerClass *klass); static void gtk_container_init (GtkContainer *container); static void gtk_container_destroy (GtkObject *object); -static void gtk_container_get_arg (GtkContainer *container, +static void gtk_container_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gtk_container_set_arg (GtkContainer *container, +static void gtk_container_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void gtk_container_add_unimplemented (GtkContainer *container, @@ -147,8 +148,9 @@ gtk_container_get_type (void) sizeof (GtkContainerClass), (GtkClassInitFunc) gtk_container_class_init, (GtkObjectInitFunc) gtk_container_init, - (GtkArgSetFunc) gtk_container_set_arg, - (GtkArgGetFunc) gtk_container_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) gtk_container_base_class_init, }; container_type = gtk_type_unique (gtk_widget_get_type (), &container_info); @@ -157,6 +159,15 @@ gtk_container_get_type (void) return container_type; } +static void +gtk_container_base_class_init (GtkContainerClass *class) +{ + /* reset instance specifc class fields that don't get inherited */ + class->n_child_args = 0; + class->set_child_arg = NULL; + class->get_child_arg = NULL; +} + static void gtk_container_class_init (GtkContainerClass *class) { @@ -223,7 +234,9 @@ gtk_container_class_init (GtkContainerClass *class) GTK_TYPE_NONE, 1, GTK_TYPE_WIDGET); gtk_object_class_add_signals (object_class, container_signals, LAST_SIGNAL); - + + object_class->get_arg = gtk_container_get_arg; + object_class->set_arg = gtk_container_set_arg; object_class->destroy = gtk_container_destroy; /* Other container classes should overwrite show_all and hide_all, @@ -239,11 +252,7 @@ gtk_container_class_init (GtkContainerClass *class) class->foreach = NULL; class->focus = gtk_container_real_focus; class->set_focus_child = gtk_container_real_set_focus_child; - - /* linkage */ class->child_type = NULL; - class->get_child_arg = NULL; - class->set_child_arg = NULL; } static void @@ -259,10 +268,10 @@ gtk_container_get_child_arg (GtkContainer *container, g_return_if_fail (GTK_IS_CONTAINER (container)); g_return_if_fail (child != NULL); g_return_if_fail (GTK_IS_WIDGET (child)); + g_return_if_fail (arg != NULL); - class = GTK_CONTAINER_CLASS (GTK_OBJECT (container)->klass); - - if (class->get_child_arg) + class = gtk_type_class (type); + if (class && class->get_child_arg) class->get_child_arg (container, child, arg, arg_id); else arg->type = GTK_TYPE_INVALID; @@ -281,10 +290,10 @@ gtk_container_set_child_arg (GtkContainer *container, g_return_if_fail (GTK_IS_CONTAINER (container)); g_return_if_fail (child != NULL); g_return_if_fail (GTK_IS_WIDGET (child)); + g_return_if_fail (arg != NULL); - class = GTK_CONTAINER_CLASS (GTK_OBJECT (container)->klass); - - if (class->set_child_arg) + class = gtk_type_class (type); + if (class && class->set_child_arg) class->set_child_arg (container, child, arg, arg_id); } @@ -297,10 +306,11 @@ gtk_container_child_type (GtkContainer *container) g_return_val_if_fail (container != NULL, 0); g_return_val_if_fail (GTK_IS_CONTAINER (container), 0); - slot = GTK_TYPE_NONE; class = GTK_CONTAINER_CLASS (GTK_OBJECT (container)->klass); if (class->child_type) slot = class->child_type (container); + else + slot = GTK_TYPE_NONE; return slot; } @@ -767,10 +777,14 @@ gtk_container_destroy (GtkObject *object) } static void -gtk_container_set_arg (GtkContainer *container, +gtk_container_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkContainer *container; + + container = GTK_CONTAINER (object); + switch (arg_id) { case ARG_BORDER_WIDTH: @@ -788,10 +802,14 @@ gtk_container_set_arg (GtkContainer *container, } static void -gtk_container_get_arg (GtkContainer *container, +gtk_container_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkContainer *container; + + container = GTK_CONTAINER (object); + switch (arg_id) { case ARG_BORDER_WIDTH: diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c index 1d589827d..47a429e02 100644 --- a/gtk/gtkctree.c +++ b/gtk/gtkctree.c @@ -211,8 +211,9 @@ gtk_ctree_get_type (void) sizeof (GtkCTreeClass), (GtkClassInitFunc) gtk_ctree_class_init, (GtkObjectInitFunc) gtk_ctree_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; ctree_type = gtk_type_unique (gtk_clist_get_type (), &ctree_info); diff --git a/gtk/gtkcurve.c b/gtk/gtkcurve.c index d275e44ec..7eedea0c8 100644 --- a/gtk/gtkcurve.c +++ b/gtk/gtkcurve.c @@ -65,8 +65,9 @@ gtk_curve_get_type (void) sizeof (GtkCurveClass), (GtkClassInitFunc) gtk_curve_class_init, (GtkObjectInitFunc) gtk_curve_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; curve_type = gtk_type_unique (gtk_drawing_area_get_type (), &curve_info); diff --git a/gtk/gtkdata.c b/gtk/gtkdata.c index 5b503bacb..132839419 100644 --- a/gtk/gtkdata.c +++ b/gtk/gtkdata.c @@ -46,8 +46,9 @@ gtk_data_get_type (void) sizeof (GtkDataClass), (GtkClassInitFunc) gtk_data_class_init, (GtkObjectInitFunc) NULL, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; data_type = gtk_type_unique (gtk_object_get_type (), &data_info); diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index e89d180a4..d55521ed5 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -41,8 +41,9 @@ gtk_dialog_get_type (void) sizeof (GtkDialogClass), (GtkClassInitFunc) gtk_dialog_class_init, (GtkObjectInitFunc) gtk_dialog_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; dialog_type = gtk_type_unique (gtk_window_get_type (), &dialog_info); diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c index 352c95b8e..903f6495c 100644 --- a/gtk/gtkdrawingarea.c +++ b/gtk/gtkdrawingarea.c @@ -41,8 +41,9 @@ gtk_drawing_area_get_type (void) sizeof (GtkDrawingAreaClass), (GtkClassInitFunc) gtk_drawing_area_class_init, (GtkObjectInitFunc) gtk_drawing_area_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; drawing_area_type = gtk_type_unique (gtk_widget_get_type (), &drawing_area_info); diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c index 1c116962a..163b414da 100644 --- a/gtk/gtkeditable.c +++ b/gtk/gtkeditable.c @@ -121,8 +121,9 @@ gtk_editable_get_type (void) sizeof (GtkEditableClass), (GtkClassInitFunc) gtk_editable_class_init, (GtkObjectInitFunc) gtk_editable_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; editable_type = gtk_type_unique (gtk_widget_get_type (), &editable_info); diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index e80d8c157..58e47aff4 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -214,8 +214,9 @@ gtk_entry_get_type (void) sizeof (GtkEntryClass), (GtkClassInitFunc) gtk_entry_class_init, (GtkObjectInitFunc) gtk_entry_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; entry_type = gtk_type_unique (gtk_editable_get_type (), &entry_info); diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c index f33133925..56f9c166f 100644 --- a/gtk/gtkeventbox.c +++ b/gtk/gtkeventbox.c @@ -47,8 +47,9 @@ gtk_event_box_get_type (void) sizeof (GtkEventBoxClass), (GtkClassInitFunc) gtk_event_box_class_init, (GtkObjectInitFunc) gtk_event_box_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; event_box_type = gtk_type_unique (gtk_bin_get_type (), &event_box_info); diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index 3f8181666..0f378f348 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -331,8 +331,9 @@ gtk_file_selection_get_type (void) sizeof (GtkFileSelectionClass), (GtkClassInitFunc) gtk_file_selection_class_init, (GtkObjectInitFunc) gtk_file_selection_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; file_selection_type = gtk_type_unique (gtk_window_get_type (), &filesel_info); diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c index 3dbce8ca1..ca365f16c 100644 --- a/gtk/gtkfixed.c +++ b/gtk/gtkfixed.c @@ -61,8 +61,9 @@ gtk_fixed_get_type (void) sizeof (GtkFixedClass), (GtkClassInitFunc) gtk_fixed_class_init, (GtkObjectInitFunc) gtk_fixed_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; fixed_type = gtk_type_unique (gtk_container_get_type (), &fixed_info); diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c index fd4d4ca52..aae84bbbb 100644 --- a/gtk/gtkfontsel.c +++ b/gtk/gtkfontsel.c @@ -399,8 +399,9 @@ gtk_font_selection_get_type() sizeof(GtkFontSelectionClass), (GtkClassInitFunc) gtk_font_selection_class_init, (GtkObjectInitFunc) gtk_font_selection_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; font_selection_type = gtk_type_unique (gtk_notebook_get_type(), @@ -2363,13 +2364,15 @@ gtk_font_selection_get_fonts (void) res_y = atoi(field); if (pixels == 0 && points == 0) - if (res_x == 0 && res_y == 0) - flags = SCALABLE_FONT; - else - { - flags = SCALABLE_BITMAP_FONT; - fontsel_info->scaled_bitmaps_available = TRUE; - } + { + if (res_x == 0 && res_y == 0) + flags = SCALABLE_FONT; + else + { + flags = SCALABLE_BITMAP_FONT; + fontsel_info->scaled_bitmaps_available = TRUE; + } + } else flags = BITMAP_FONT; @@ -3074,8 +3077,9 @@ gtk_font_selection_dialog_get_type (void) sizeof (GtkFontSelectionDialogClass), (GtkClassInitFunc) gtk_font_selection_dialog_class_init, (GtkObjectInitFunc) gtk_font_selection_dialog_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; font_selection_dialog_type = gtk_type_unique (gtk_window_get_type (), &fontsel_diag_info); diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index 7b1df57ce..319d53f90 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -30,10 +30,10 @@ enum { static void gtk_frame_class_init (GtkFrameClass *klass); static void gtk_frame_init (GtkFrame *frame); -static void gtk_frame_set_arg (GtkFrame *frame, +static void gtk_frame_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gtk_frame_get_arg (GtkFrame *frame, +static void gtk_frame_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void gtk_frame_finalize (GtkObject *object); @@ -68,8 +68,9 @@ gtk_frame_get_type (void) sizeof (GtkFrameClass), (GtkClassInitFunc) gtk_frame_class_init, (GtkObjectInitFunc) gtk_frame_init, - (GtkArgSetFunc) gtk_frame_set_arg, - (GtkArgGetFunc) gtk_frame_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; frame_type = gtk_type_unique (gtk_bin_get_type (), &frame_info); @@ -94,6 +95,8 @@ gtk_frame_class_init (GtkFrameClass *class) gtk_object_add_arg_type ("GtkFrame::label_yalign", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_LABEL_YALIGN); gtk_object_add_arg_type ("GtkFrame::shadow", GTK_TYPE_SHADOW_TYPE, GTK_ARG_READWRITE, ARG_SHADOW); + object_class->set_arg = gtk_frame_set_arg; + object_class->get_arg = gtk_frame_get_arg; object_class->finalize = gtk_frame_finalize; widget_class->draw = gtk_frame_draw; @@ -117,10 +120,14 @@ gtk_frame_init (GtkFrame *frame) } static void -gtk_frame_set_arg (GtkFrame *frame, +gtk_frame_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkFrame *frame; + + frame = GTK_FRAME (object); + switch (arg_id) { case ARG_LABEL: @@ -141,10 +148,14 @@ gtk_frame_set_arg (GtkFrame *frame, } static void -gtk_frame_get_arg (GtkFrame *frame, +gtk_frame_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkFrame *frame; + + frame = GTK_FRAME (object); + switch (arg_id) { case ARG_LABEL: diff --git a/gtk/gtkgamma.c b/gtk/gtkgamma.c index 19d34ef1a..9542d1b1e 100644 --- a/gtk/gtkgamma.c +++ b/gtk/gtkgamma.c @@ -216,8 +216,9 @@ gtk_gamma_curve_get_type (void) sizeof (GtkGammaCurveClass), (GtkClassInitFunc) gtk_gamma_curve_class_init, (GtkObjectInitFunc) gtk_gamma_curve_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; gamma_curve_type = diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index 6a9e6ece8..386152fcf 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -93,8 +93,9 @@ gtk_handle_box_get_type (void) sizeof (GtkHandleBoxClass), (GtkClassInitFunc) gtk_handle_box_class_init, (GtkObjectInitFunc) gtk_handle_box_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; handle_box_type = gtk_type_unique (gtk_bin_get_type (), &handle_box_info); diff --git a/gtk/gtkhbbox.c b/gtk/gtkhbbox.c index 28a7afb14..36d86905b 100644 --- a/gtk/gtkhbbox.c +++ b/gtk/gtkhbbox.c @@ -44,8 +44,9 @@ gtk_hbutton_box_get_type (void) sizeof (GtkHButtonBoxClass), (GtkClassInitFunc) gtk_hbutton_box_class_init, (GtkObjectInitFunc) gtk_hbutton_box_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; hbutton_box_type = gtk_type_unique (gtk_button_box_get_type (), &hbutton_box_info); diff --git a/gtk/gtkhbox.c b/gtk/gtkhbox.c index 9b36dc7e1..c7b5455f4 100644 --- a/gtk/gtkhbox.c +++ b/gtk/gtkhbox.c @@ -41,8 +41,9 @@ gtk_hbox_get_type (void) sizeof (GtkHBoxClass), (GtkClassInitFunc) gtk_hbox_class_init, (GtkObjectInitFunc) gtk_hbox_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; hbox_type = gtk_type_unique (GTK_TYPE_BOX, &hbox_info); diff --git a/gtk/gtkhpaned.c b/gtk/gtkhpaned.c index 3131f6914..af9c0302d 100644 --- a/gtk/gtkhpaned.c +++ b/gtk/gtkhpaned.c @@ -50,8 +50,9 @@ gtk_hpaned_get_type (void) sizeof (GtkHPanedClass), (GtkClassInitFunc) gtk_hpaned_class_init, (GtkObjectInitFunc) gtk_hpaned_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; hpaned_type = gtk_type_unique (gtk_paned_get_type (), &hpaned_info); diff --git a/gtk/gtkhruler.c b/gtk/gtkhruler.c index 2ad6cce64..bbb36b0ff 100644 --- a/gtk/gtkhruler.c +++ b/gtk/gtkhruler.c @@ -52,8 +52,9 @@ gtk_hruler_get_type (void) sizeof (GtkHRulerClass), (GtkClassInitFunc) gtk_hruler_class_init, (GtkObjectInitFunc) gtk_hruler_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; hruler_type = gtk_type_unique (gtk_ruler_get_type (), &hruler_info); diff --git a/gtk/gtkhscale.c b/gtk/gtkhscale.c index 0180e3209..2ebbeed84 100644 --- a/gtk/gtkhscale.c +++ b/gtk/gtkhscale.c @@ -59,8 +59,9 @@ gtk_hscale_get_type (void) sizeof (GtkHScaleClass), (GtkClassInitFunc) gtk_hscale_class_init, (GtkObjectInitFunc) gtk_hscale_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; hscale_type = gtk_type_unique (gtk_scale_get_type (), &hscale_info); diff --git a/gtk/gtkhscrollbar.c b/gtk/gtkhscrollbar.c index 3bc1f7614..57ba99c4e 100644 --- a/gtk/gtkhscrollbar.c +++ b/gtk/gtkhscrollbar.c @@ -55,8 +55,9 @@ gtk_hscrollbar_get_type (void) sizeof (GtkHScrollbarClass), (GtkClassInitFunc) gtk_hscrollbar_class_init, (GtkObjectInitFunc) gtk_hscrollbar_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; hscrollbar_type = gtk_type_unique (gtk_scrollbar_get_type (), &hscrollbar_info); diff --git a/gtk/gtkhseparator.c b/gtk/gtkhseparator.c index 18e1aef3f..fe0a4f09f 100644 --- a/gtk/gtkhseparator.c +++ b/gtk/gtkhseparator.c @@ -39,8 +39,9 @@ gtk_hseparator_get_type (void) sizeof (GtkHSeparatorClass), (GtkClassInitFunc) gtk_hseparator_class_init, (GtkObjectInitFunc) gtk_hseparator_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; hseparator_type = gtk_type_unique (gtk_separator_get_type (), &hseparator_info); diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index bb4c747cb..aa3e7bc13 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -40,8 +40,9 @@ gtk_image_get_type (void) sizeof (GtkImageClass), (GtkClassInitFunc) gtk_image_class_init, (GtkObjectInitFunc) gtk_image_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; image_type = gtk_type_unique (gtk_misc_get_type (), &image_info); diff --git a/gtk/gtkinputdialog.c b/gtk/gtkinputdialog.c index d42e30f55..a109d3ec2 100644 --- a/gtk/gtkinputdialog.c +++ b/gtk/gtkinputdialog.c @@ -141,8 +141,9 @@ gtk_input_dialog_get_type (void) sizeof (GtkInputDialogClass), (GtkClassInitFunc) gtk_input_dialog_class_init, (GtkObjectInitFunc) gtk_input_dialog_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; input_dialog_type = gtk_type_unique (gtk_dialog_get_type (), diff --git a/gtk/gtkitem.c b/gtk/gtkitem.c index 5e8a3b0d0..4a49e5b57 100644 --- a/gtk/gtkitem.c +++ b/gtk/gtkitem.c @@ -56,8 +56,9 @@ gtk_item_get_type (void) sizeof (GtkItemClass), (GtkClassInitFunc) gtk_item_class_init, (GtkObjectInitFunc) gtk_item_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; item_type = gtk_type_unique (gtk_bin_get_type (), &item_info); diff --git a/gtk/gtkitemfactory.c b/gtk/gtkitemfactory.c index ebc86c4f3..76b9454d2 100644 --- a/gtk/gtkitemfactory.c +++ b/gtk/gtkitemfactory.c @@ -162,8 +162,9 @@ gtk_item_factory_get_type (void) sizeof (GtkItemFactoryClass), (GtkClassInitFunc) gtk_item_factory_class_init, (GtkObjectInitFunc) gtk_item_factory_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; item_factory_type = gtk_type_unique (GTK_TYPE_OBJECT, &item_factory_info); diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index da5ee65f0..1b2bf893b 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -28,10 +28,10 @@ enum { static void gtk_label_class_init (GtkLabelClass *klass); static void gtk_label_init (GtkLabel *label); -static void gtk_label_set_arg (GtkLabel *label, +static void gtk_label_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gtk_label_get_arg (GtkLabel *label, +static void gtk_label_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void gtk_label_finalize (GtkObject *object); @@ -63,8 +63,9 @@ gtk_label_get_type (void) sizeof (GtkLabelClass), (GtkClassInitFunc) gtk_label_class_init, (GtkObjectInitFunc) gtk_label_init, - (GtkArgSetFunc) gtk_label_set_arg, - (GtkArgGetFunc) gtk_label_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; label_type = gtk_type_unique (gtk_misc_get_type (), &label_info); @@ -87,7 +88,9 @@ gtk_label_class_init (GtkLabelClass *class) gtk_object_add_arg_type ("GtkLabel::label", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_LABEL); gtk_object_add_arg_type ("GtkLabel::justify", GTK_TYPE_JUSTIFICATION, GTK_ARG_READWRITE, ARG_JUSTIFY); - + + object_class->set_arg = gtk_label_set_arg; + object_class->get_arg = gtk_label_get_arg; object_class->finalize = gtk_label_finalize; widget_class->size_request = gtk_label_size_request; @@ -97,10 +100,14 @@ gtk_label_class_init (GtkLabelClass *class) } static void -gtk_label_set_arg (GtkLabel *label, +gtk_label_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkLabel *label; + + label = GTK_LABEL (object); + switch (arg_id) { case ARG_LABEL: @@ -115,10 +122,14 @@ gtk_label_set_arg (GtkLabel *label, } static void -gtk_label_get_arg (GtkLabel *label, +gtk_label_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkLabel *label; + + label = GTK_LABEL (object); + switch (arg_id) { case ARG_LABEL: diff --git a/gtk/gtklist.c b/gtk/gtklist.c index c9797c34b..9e67051e6 100644 --- a/gtk/gtklist.c +++ b/gtk/gtklist.c @@ -94,8 +94,9 @@ gtk_list_get_type (void) sizeof (GtkListClass), (GtkClassInitFunc) gtk_list_class_init, (GtkObjectInitFunc) gtk_list_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; list_type = gtk_type_unique (gtk_container_get_type (), &list_info); diff --git a/gtk/gtklistitem.c b/gtk/gtklistitem.c index 3120d0a71..d019ad212 100644 --- a/gtk/gtklistitem.c +++ b/gtk/gtklistitem.c @@ -60,8 +60,9 @@ gtk_list_item_get_type (void) sizeof (GtkListItemClass), (GtkClassInitFunc) gtk_list_item_class_init, (GtkObjectInitFunc) gtk_list_item_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; list_item_type = gtk_type_unique (gtk_item_get_type (), &list_item_info); diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 6a36f37a2..4dfa10cef 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -79,8 +79,9 @@ gtk_menu_get_type (void) sizeof (GtkMenuClass), (GtkClassInitFunc) gtk_menu_class_init, (GtkObjectInitFunc) gtk_menu_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; menu_type = gtk_type_unique (gtk_menu_shell_get_type (), &menu_info); diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index 34b678241..0288d303d 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -52,8 +52,9 @@ gtk_menu_bar_get_type (void) sizeof (GtkMenuBarClass), (GtkClassInitFunc) gtk_menu_bar_class_init, (GtkObjectInitFunc) gtk_menu_bar_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; menu_bar_type = gtk_type_unique (gtk_menu_shell_get_type (), &menu_bar_info); diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index 55d399127..4631a51db 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -77,8 +77,9 @@ gtk_menu_item_get_type (void) sizeof (GtkMenuItemClass), (GtkClassInitFunc) gtk_menu_item_class_init, (GtkObjectInitFunc) gtk_menu_item_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; menu_item_type = gtk_type_unique (gtk_item_get_type (), &menu_item_info); diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index e7afdfa39..2f3cd65aa 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -78,8 +78,9 @@ gtk_menu_shell_get_type (void) sizeof (GtkMenuShellClass), (GtkClassInitFunc) gtk_menu_shell_class_init, (GtkObjectInitFunc) gtk_menu_shell_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; menu_shell_type = gtk_type_unique (gtk_container_get_type (), &menu_shell_info); diff --git a/gtk/gtkmisc.c b/gtk/gtkmisc.c index 148e689db..1c3021b01 100644 --- a/gtk/gtkmisc.c +++ b/gtk/gtkmisc.c @@ -31,10 +31,10 @@ enum { static void gtk_misc_class_init (GtkMiscClass *klass); static void gtk_misc_init (GtkMisc *misc); static void gtk_misc_realize (GtkWidget *widget); -static void gtk_misc_set_arg (GtkMisc *misc, +static void gtk_misc_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gtk_misc_get_arg (GtkMisc *misc, +static void gtk_misc_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); @@ -53,8 +53,9 @@ gtk_misc_get_type (void) sizeof (GtkMiscClass), (GtkClassInitFunc) gtk_misc_class_init, (GtkObjectInitFunc) gtk_misc_init, - (GtkArgSetFunc) gtk_misc_set_arg, - (GtkArgGetFunc) gtk_misc_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; misc_type = gtk_type_unique (GTK_TYPE_WIDGET, &misc_info); @@ -66,14 +67,19 @@ gtk_misc_get_type (void) static void gtk_misc_class_init (GtkMiscClass *class) { + GtkObjectClass *object_class; GtkWidgetClass *widget_class; + object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; gtk_object_add_arg_type ("GtkMisc::xalign", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_XALIGN); gtk_object_add_arg_type ("GtkMisc::yalign", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_YALIGN); gtk_object_add_arg_type ("GtkMisc::xpad", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_XPAD); gtk_object_add_arg_type ("GtkMisc::ypad", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_YPAD); + + object_class->set_arg = gtk_misc_set_arg; + object_class->get_arg = gtk_misc_get_arg; widget_class->realize = gtk_misc_realize; } @@ -90,10 +96,14 @@ gtk_misc_init (GtkMisc *misc) } static void -gtk_misc_set_arg (GtkMisc *misc, +gtk_misc_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkMisc *misc; + + misc = GTK_MISC (object); + switch (arg_id) { case ARG_XALIGN: @@ -114,10 +124,14 @@ gtk_misc_set_arg (GtkMisc *misc, } static void -gtk_misc_get_arg (GtkMisc *misc, +gtk_misc_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkMisc *misc; + + misc = GTK_MISC (object); + switch (arg_id) { case ARG_XALIGN: diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index deb98e563..c0d3a0970 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -161,8 +161,9 @@ gtk_notebook_get_type (void) sizeof (GtkNotebookClass), (GtkClassInitFunc) gtk_notebook_class_init, (GtkObjectInitFunc) gtk_notebook_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; notebook_type = gtk_type_unique (gtk_container_get_type (), ¬ebook_info); diff --git a/gtk/gtkobject.c b/gtk/gtkobject.c index 827d8186c..0fc276cb1 100644 --- a/gtk/gtkobject.c +++ b/gtk/gtkobject.c @@ -61,24 +61,25 @@ struct _GtkArgInfo }; -void gtk_object_init_type (void); -static void gtk_object_class_init (GtkObjectClass *klass); -static void gtk_object_init (GtkObject *object); -static void gtk_object_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void gtk_object_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void gtk_object_shutdown (GtkObject *object); -static void gtk_object_real_destroy (GtkObject *object); -static void gtk_object_finalize (GtkObject *object); -static void gtk_object_notify_weaks (GtkObject *object); - -GtkArg* gtk_object_collect_args (guint *nargs, - GtkType (*) (const gchar*), - va_list args1, - va_list args2); +void gtk_object_init_type (void); +static void gtk_object_base_class_init (GtkObjectClass *klass); +static void gtk_object_class_init (GtkObjectClass *klass); +static void gtk_object_init (GtkObject *object); +static void gtk_object_set_arg (GtkObject *object, + GtkArg *arg, + guint arg_id); +static void gtk_object_get_arg (GtkObject *object, + GtkArg *arg, + guint arg_id); +static void gtk_object_shutdown (GtkObject *object); +static void gtk_object_real_destroy (GtkObject *object); +static void gtk_object_finalize (GtkObject *object); +static void gtk_object_notify_weaks (GtkObject *object); + +GtkArg* gtk_object_collect_args (guint *nargs, + GtkType (*) (const gchar*), + va_list args1, + va_list args2); static guint object_signals[LAST_SIGNAL] = { 0 }; @@ -140,8 +141,9 @@ gtk_object_init_type (void) sizeof (GtkObjectClass), (GtkClassInitFunc) gtk_object_class_init, (GtkObjectInitFunc) gtk_object_init, - gtk_object_set_arg, - gtk_object_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) gtk_object_base_class_init, }; object_type = gtk_type_unique (0, &object_info); @@ -160,12 +162,21 @@ gtk_object_get_type (void) } static void -gtk_object_class_init (GtkObjectClass *class) +gtk_object_base_class_init (GtkObjectClass *class) { + /* reset instance specific fields that don't get inhrited */ class->signals = NULL; class->nsignals = 0; class->n_args = 0; + /* reset instance specifc methods that don't get inherited */ + class->get_arg = NULL; + class->set_arg = NULL; +} + +static void +gtk_object_class_init (GtkObjectClass *class) +{ gtk_object_add_arg_type ("GtkObject::user_data", GTK_TYPE_POINTER, GTK_ARG_READWRITE, @@ -189,6 +200,8 @@ gtk_object_class_init (GtkObjectClass *class) gtk_object_class_add_signals (class, object_signals, LAST_SIGNAL); + class->get_arg = gtk_object_get_arg; + class->set_arg = gtk_object_set_arg; class->shutdown = gtk_object_shutdown; class->destroy = gtk_object_real_destroy; class->finalize = gtk_object_finalize; @@ -286,7 +299,7 @@ gtk_object_set_arg (GtkObject *object, case ARG_SIGNAL: if ((arg->name[9 + 2 + 6] != ':') || (arg->name[9 + 2 + 7] != ':')) { - g_warning ("invalid signal argument: \"%s\"\n", arg->name); + g_warning ("gtk_object_set_arg(): invalid signal argument: \"%s\"\n", arg->name); return; } gtk_signal_connect (object, arg->name + 9 + 2 + 6 + 2, @@ -296,7 +309,7 @@ gtk_object_set_arg (GtkObject *object, case ARG_OBJECT_SIGNAL: if ((arg->name[9 + 2 + 13] != ':') || (arg->name[9 + 2 + 14] != ':')) { - g_warning ("invalid signal argument: \"%s\"\n", arg->name); + g_warning ("gtk_object_set_arg(): invalid signal argument: \"%s\"\n", arg->name); return; } gtk_signal_connect_object (object, arg->name + 9 + 2 + 13 + 2, @@ -677,6 +690,7 @@ gtk_object_getv (GtkObject *object, GtkArgInfo *info; gchar *lookup_name; gchar *d; + GtkObjectClass *oclass; /* hm, the name cutting shouldn't be needed on gets, but what the heck... @@ -722,7 +736,16 @@ gtk_object_getv (GtkObject *object, g_free (lookup_name); args[i].type = info->type; + + oclass = gtk_type_class (info->class_type); + if (oclass && oclass->get_arg) + oclass->get_arg (object, &args[i], info->arg_id); + else + args[i].type = GTK_TYPE_INVALID; + +#if 0 gtk_type_get_arg (object, info->class_type, &args[i], info->arg_id); +#endif } } @@ -882,6 +905,7 @@ gtk_object_setv (GtkObject *object, gchar *lookup_name; gchar *d; gboolean arg_ok; + GtkObjectClass *oclass; lookup_name = g_strdup (args[i].name); d = strchr (lookup_name, ':'); @@ -928,7 +952,13 @@ gtk_object_setv (GtkObject *object, if (!arg_ok) continue; + oclass = gtk_type_class (info->class_type); + if (oclass && oclass->set_arg) + oclass->set_arg (object, &args[i], info->arg_id); + +#if 0 gtk_type_set_arg (object, info->class_type, &args[i], info->arg_id); +#endif } } diff --git a/gtk/gtkobject.h b/gtk/gtkobject.h index be18e8736..945a1131c 100644 --- a/gtk/gtkobject.h +++ b/gtk/gtkobject.h @@ -189,6 +189,14 @@ struct _GtkObjectClass /* The number of arguments per class. */ guint n_args; + + /* Non overridable class methods to set and get per class arguments */ + void (*set_arg) (GtkObject *object, + GtkArg *arg, + guint arg_id); + void (*get_arg) (GtkObject *object, + GtkArg *arg, + guint arg_id); /* The functions that will end an objects life time. In one way ore * another all three of them are defined for all objects. If an @@ -199,7 +207,7 @@ struct _GtkObjectClass * an example of how to do this). */ void (* shutdown) (GtkObject *object); - void (* destroy) (GtkObject *object); + void (* destroy) (GtkObject *object); void (* finalize) (GtkObject *object); }; diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c index fb00bf614..b90c9a83b 100644 --- a/gtk/gtkoptionmenu.c +++ b/gtk/gtkoptionmenu.c @@ -77,8 +77,9 @@ gtk_option_menu_get_type (void) sizeof (GtkOptionMenuClass), (GtkClassInitFunc) gtk_option_menu_class_init, (GtkObjectInitFunc) gtk_option_menu_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; option_menu_type = gtk_type_unique (gtk_button_get_type (), &option_menu_info); diff --git a/gtk/gtkpacker.c b/gtk/gtkpacker.c index a48a6f0d2..00e8dedd4 100644 --- a/gtk/gtkpacker.c +++ b/gtk/gtkpacker.c @@ -167,8 +167,9 @@ gtk_packer_get_type (void) sizeof (GtkPackerClass), (GtkClassInitFunc) gtk_packer_class_init, (GtkObjectInitFunc) gtk_packer_init, - (GtkArgSetFunc) gtk_packer_set_arg, - (GtkArgGetFunc) gtk_packer_get_arg + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; packer_type = gtk_type_unique (GTK_TYPE_CONTAINER, &packer_info); @@ -180,9 +181,11 @@ gtk_packer_get_type (void) static void gtk_packer_class_init (GtkPackerClass *klass) { + GtkObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; + object_class = (GtkObjectClass*) klass; widget_class = (GtkWidgetClass*) klass; container_class = (GtkContainerClass*) klass; parent_class = gtk_type_class (GTK_TYPE_CONTAINER); @@ -207,6 +210,9 @@ gtk_packer_class_init (GtkPackerClass *klass) gtk_container_add_child_arg_type ("GtkPacker::ipad_y", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_I_PAD_Y); gtk_container_add_child_arg_type ("GtkPacker::position", GTK_TYPE_LONG, GTK_ARG_READWRITE, CHILD_ARG_POSITION); + object_class->set_arg = gtk_packer_set_arg; + object_class->get_arg = gtk_packer_get_arg; + widget_class->map = gtk_packer_map; widget_class->unmap = gtk_packer_unmap; widget_class->draw = gtk_packer_draw; diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index 2009ae7f7..46a00ce3a 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -54,8 +54,9 @@ gtk_paned_get_type (void) sizeof (GtkPanedClass), (GtkClassInitFunc) gtk_paned_class_init, (GtkObjectInitFunc) gtk_paned_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; paned_type = gtk_type_unique (gtk_container_get_type (), &paned_info); diff --git a/gtk/gtkpixmap.c b/gtk/gtkpixmap.c index f9045807c..52bdfc46c 100644 --- a/gtk/gtkpixmap.c +++ b/gtk/gtkpixmap.c @@ -42,8 +42,9 @@ gtk_pixmap_get_type (void) sizeof (GtkPixmapClass), (GtkClassInitFunc) gtk_pixmap_class_init, (GtkObjectInitFunc) gtk_pixmap_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; pixmap_type = gtk_type_unique (GTK_TYPE_MISC, &pixmap_info); diff --git a/gtk/gtkpreview.c b/gtk/gtkpreview.c index 3f07ca22a..402d9634f 100644 --- a/gtk/gtkpreview.c +++ b/gtk/gtkpreview.c @@ -139,8 +139,9 @@ gtk_preview_get_type (void) sizeof (GtkPreviewClass), (GtkClassInitFunc) gtk_preview_class_init, (GtkObjectInitFunc) gtk_preview_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; preview_type = gtk_type_unique (gtk_widget_get_type (), &preview_info); diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c index eae5bfa8e..c2677f412 100644 --- a/gtk/gtkprogressbar.c +++ b/gtk/gtkprogressbar.c @@ -48,8 +48,9 @@ gtk_progress_bar_get_type (void) sizeof (GtkProgressBarClass), (GtkClassInitFunc) gtk_progress_bar_class_init, (GtkObjectInitFunc) gtk_progress_bar_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; progress_bar_type = gtk_type_unique (gtk_widget_get_type (), &progress_bar_info); diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c index b5b6cedd6..0d9bcf079 100644 --- a/gtk/gtkradiobutton.c +++ b/gtk/gtkradiobutton.c @@ -60,8 +60,9 @@ gtk_radio_button_get_type (void) sizeof (GtkRadioButtonClass), (GtkClassInitFunc) gtk_radio_button_class_init, (GtkObjectInitFunc) gtk_radio_button_init, - (GtkArgSetFunc) gtk_radio_button_set_arg, - (GtkArgGetFunc) gtk_radio_button_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; radio_button_type = gtk_type_unique (gtk_check_button_get_type (), &radio_button_info); @@ -85,6 +86,8 @@ gtk_radio_button_class_init (GtkRadioButtonClass *class) gtk_object_add_arg_type ("GtkRadioButton::group", GTK_TYPE_RADIO_BUTTON, GTK_ARG_WRITABLE, ARG_GROUP); + object_class->set_arg = gtk_radio_button_set_arg; + object_class->get_arg = gtk_radio_button_get_arg; object_class->destroy = gtk_radio_button_destroy; button_class->clicked = gtk_radio_button_clicked; diff --git a/gtk/gtkradiomenuitem.c b/gtk/gtkradiomenuitem.c index 711557776..ab7fbce37 100644 --- a/gtk/gtkradiomenuitem.c +++ b/gtk/gtkradiomenuitem.c @@ -41,8 +41,9 @@ gtk_radio_menu_item_get_type (void) sizeof (GtkRadioMenuItemClass), (GtkClassInitFunc) gtk_radio_menu_item_class_init, (GtkObjectInitFunc) gtk_radio_menu_item_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; radio_menu_item_type = gtk_type_unique (gtk_check_menu_item_get_type (), &radio_menu_item_info); diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 999e1888c..5f9b2459d 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -95,8 +95,9 @@ gtk_range_get_type (void) sizeof (GtkRangeClass), (GtkClassInitFunc) gtk_range_class_init, (GtkObjectInitFunc) gtk_range_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; range_type = gtk_type_unique (gtk_widget_get_type (), &range_info); diff --git a/gtk/gtkruler.c b/gtk/gtkruler.c index b4af977ad..42f3f274e 100644 --- a/gtk/gtkruler.c +++ b/gtk/gtkruler.c @@ -54,8 +54,9 @@ gtk_ruler_get_type (void) sizeof (GtkRulerClass), (GtkClassInitFunc) gtk_ruler_class_init, (GtkObjectInitFunc) gtk_ruler_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; ruler_type = gtk_type_unique (gtk_widget_get_type (), &ruler_info); diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c index f1e162729..298ede58f 100644 --- a/gtk/gtkscale.c +++ b/gtk/gtkscale.c @@ -46,8 +46,9 @@ gtk_scale_get_type (void) sizeof (GtkScaleClass), (GtkClassInitFunc) gtk_scale_class_init, (GtkObjectInitFunc) gtk_scale_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; scale_type = gtk_type_unique (gtk_range_get_type (), &scale_info); diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c index f765269ac..f738a44e7 100644 --- a/gtk/gtkscrollbar.c +++ b/gtk/gtkscrollbar.c @@ -35,8 +35,9 @@ gtk_scrollbar_get_type (void) sizeof (GtkScrollbarClass), (GtkClassInitFunc) gtk_scrollbar_class_init, (GtkObjectInitFunc) gtk_scrollbar_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; scrollbar_type = gtk_type_unique (gtk_range_get_type (), &scrollbar_info); diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index b2a5c580e..d6fd1f66f 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -65,8 +65,9 @@ gtk_scrolled_window_get_type (void) sizeof (GtkScrolledWindowClass), (GtkClassInitFunc) gtk_scrolled_window_class_init, (GtkObjectInitFunc) gtk_scrolled_window_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; scrolled_window_type = gtk_type_unique (gtk_container_get_type (), &scrolled_window_info); diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c index 1fffc270e..dec87bb1e 100644 --- a/gtk/gtkseparator.c +++ b/gtk/gtkseparator.c @@ -37,8 +37,9 @@ gtk_separator_get_type (void) sizeof (GtkSeparatorClass), (GtkClassInitFunc) gtk_separator_class_init, (GtkObjectInitFunc) gtk_separator_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; separator_type = gtk_type_unique (gtk_widget_get_type (), &separator_info); diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index ce98510eb..0134fe51b 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -107,8 +107,9 @@ gtk_spin_button_get_type (void) sizeof (GtkSpinButtonClass), (GtkClassInitFunc) gtk_spin_button_class_init, (GtkObjectInitFunc) gtk_spin_button_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; spin_button_type = gtk_type_unique (gtk_entry_get_type (), diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c index b0b8f87e3..86429a53d 100644 --- a/gtk/gtkstatusbar.c +++ b/gtk/gtkstatusbar.c @@ -61,8 +61,9 @@ gtk_statusbar_get_type (void) sizeof (GtkStatusbarClass), (GtkClassInitFunc) gtk_statusbar_class_init, (GtkObjectInitFunc) gtk_statusbar_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; statusbar_type = gtk_type_unique (gtk_hbox_get_type (), &statusbar_info); diff --git a/gtk/gtktable.c b/gtk/gtktable.c index 3fae34559..6ffbeaeb7 100644 --- a/gtk/gtktable.c +++ b/gtk/gtktable.c @@ -106,8 +106,9 @@ gtk_table_get_type (void) sizeof (GtkTableClass), (GtkClassInitFunc) gtk_table_class_init, (GtkObjectInitFunc) gtk_table_init, - gtk_table_set_arg, - gtk_table_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; table_type = gtk_type_unique (gtk_container_get_type (), &table_info); @@ -143,6 +144,8 @@ gtk_table_class_init (GtkTableClass *class) gtk_container_add_child_arg_type ("GtkTable::x_padding", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_X_PADDING); gtk_container_add_child_arg_type ("GtkTable::y_padding", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_Y_PADDING); + object_class->get_arg = gtk_table_get_arg; + object_class->set_arg = gtk_table_set_arg; object_class->finalize = gtk_table_finalize; widget_class->map = gtk_table_map; diff --git a/gtk/gtktext.c b/gtk/gtktext.c index a11f37a26..fac367331 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -459,8 +459,9 @@ gtk_text_get_type (void) sizeof (GtkTextClass), (GtkClassInitFunc) gtk_text_class_init, (GtkObjectInitFunc) gtk_text_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; text_type = gtk_type_unique (gtk_editable_get_type (), &text_info); diff --git a/gtk/gtktipsquery.c b/gtk/gtktipsquery.c index 6a1927816..732d82e16 100644 --- a/gtk/gtktipsquery.c +++ b/gtk/gtktipsquery.c @@ -64,10 +64,10 @@ static void gtk_tips_query_init (GtkTipsQuery *tips_query); static void gtk_tips_query_destroy (GtkObject *object); static gint gtk_tips_query_event (GtkWidget *widget, GdkEvent *event); -static void gtk_tips_query_set_arg (GtkTipsQuery *tips_query, +static void gtk_tips_query_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gtk_tips_query_get_arg (GtkTipsQuery *tips_query, +static void gtk_tips_query_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void gtk_tips_query_real_start_query (GtkTipsQuery *tips_query); @@ -98,8 +98,9 @@ gtk_tips_query_get_type (void) sizeof (GtkTipsQueryClass), (GtkClassInitFunc) gtk_tips_query_class_init, (GtkObjectInitFunc) gtk_tips_query_init, - (GtkArgSetFunc) gtk_tips_query_set_arg, - (GtkArgGetFunc) gtk_tips_query_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; tips_query_type = gtk_type_unique (gtk_label_get_type (), &tips_query_info); @@ -195,7 +196,10 @@ gtk_tips_query_class_init (GtkTipsQueryClass *class) GTK_TYPE_GDK_EVENT); gtk_object_class_add_signals (object_class, tips_query_signals, SIGNAL_LAST); + object_class->set_arg = gtk_tips_query_set_arg; + object_class->get_arg = gtk_tips_query_get_arg; object_class->destroy = gtk_tips_query_destroy; + widget_class->event = gtk_tips_query_event; class->start_query = gtk_tips_query_real_start_query; @@ -219,10 +223,14 @@ gtk_tips_query_init (GtkTipsQuery *tips_query) } static void -gtk_tips_query_set_arg (GtkTipsQuery *tips_query, +gtk_tips_query_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkTipsQuery *tips_query; + + tips_query = GTK_TIPS_QUERY (object); + switch (arg_id) { case ARG_EMIT_ALWAYS: @@ -243,10 +251,14 @@ gtk_tips_query_set_arg (GtkTipsQuery *tips_query, } static void -gtk_tips_query_get_arg (GtkTipsQuery *tips_query, - GtkArg *arg, +gtk_tips_query_get_arg (GtkObject *object, + GtkArg *arg, guint arg_id) { + GtkTipsQuery *tips_query; + + tips_query = GTK_TIPS_QUERY (object); + switch (arg_id) { case ARG_EMIT_ALWAYS: diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c index bb3df60b3..1a975da15 100644 --- a/gtk/gtktogglebutton.c +++ b/gtk/gtktogglebutton.c @@ -71,8 +71,9 @@ gtk_toggle_button_get_type (void) sizeof (GtkToggleButtonClass), (GtkClassInitFunc) gtk_toggle_button_class_init, (GtkObjectInitFunc) gtk_toggle_button_init, - (GtkArgSetFunc) gtk_toggle_button_set_arg, - (GtkArgGetFunc) gtk_toggle_button_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; toggle_button_type = gtk_type_unique (gtk_button_get_type (), &toggle_button_info); @@ -107,6 +108,9 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class) gtk_object_class_add_signals (object_class, toggle_button_signals, LAST_SIGNAL); + object_class->set_arg = gtk_toggle_button_set_arg; + object_class->get_arg = gtk_toggle_button_get_arg; + widget_class->draw_focus = gtk_toggle_button_draw_focus; button_class->pressed = gtk_toggle_button_pressed; diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index ad19b4b20..cc9f25e0e 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -90,8 +90,9 @@ gtk_toolbar_get_type (void) sizeof (GtkToolbarClass), (GtkClassInitFunc) gtk_toolbar_class_init, (GtkObjectInitFunc) gtk_toolbar_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; toolbar_type = gtk_type_unique (gtk_container_get_type (), &toolbar_info); diff --git a/gtk/gtktooltips.c b/gtk/gtktooltips.c index b60c63211..044a6011f 100644 --- a/gtk/gtktooltips.c +++ b/gtk/gtktooltips.c @@ -63,8 +63,9 @@ gtk_tooltips_get_type (void) sizeof (GtkTooltipsClass), (GtkClassInitFunc) gtk_tooltips_class_init, (GtkObjectInitFunc) gtk_tooltips_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; tooltips_type = gtk_type_unique (gtk_data_get_type (), &tooltips_info); diff --git a/gtk/gtktree.c b/gtk/gtktree.c index bbb1f9cae..149389e65 100644 --- a/gtk/gtktree.c +++ b/gtk/gtktree.c @@ -88,8 +88,9 @@ gtk_tree_get_type (void) sizeof (GtkTreeClass), (GtkClassInitFunc) gtk_tree_class_init, (GtkObjectInitFunc) gtk_tree_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; tree_type = gtk_type_unique (gtk_container_get_type (), &tree_info); diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c index ba6fd074d..4aefd26ed 100644 --- a/gtk/gtktreeitem.c +++ b/gtk/gtktreeitem.c @@ -106,8 +106,9 @@ gtk_tree_item_get_type (void) sizeof (GtkTreeItemClass), (GtkClassInitFunc) gtk_tree_item_class_init, (GtkObjectInitFunc) gtk_tree_item_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; tree_item_type = gtk_type_unique (gtk_item_get_type (), &tree_item_info); diff --git a/gtk/gtktypeutils.c b/gtk/gtktypeutils.c index 30a0d0d65..8672f408f 100644 --- a/gtk/gtktypeutils.c +++ b/gtk/gtktypeutils.c @@ -191,6 +191,8 @@ gtk_type_create (GtkType parent_type, new_node->type_info = *type_info; new_node->type_info.type_name = type_name; + /* new_node->type_info.reserved_1 = NULL; */ + new_node->type_info.reserved_2 = NULL; new_node->n_supers = parent ? parent->n_supers + 1 : 0; new_node->chunk_alloc_locked = FALSE; new_node->supers = g_new0 (GtkType, new_node->n_supers + 1); @@ -472,42 +474,6 @@ gtk_type_is_a (GtkType type, return FALSE; } -void -gtk_type_get_arg (GtkObject *object, - GtkType type, - GtkArg *arg, - guint arg_id) -{ - GtkTypeNode *node; - - g_return_if_fail (object != NULL); - g_return_if_fail (arg != NULL); - - LOOKUP_TYPE_NODE (node, type); - - if (node && node->type_info.arg_get_func) - (* node->type_info.arg_get_func) (object, arg, arg_id); - else - arg->type = GTK_TYPE_INVALID; -} - -void -gtk_type_set_arg (GtkObject *object, - GtkType type, - GtkArg *arg, - guint arg_id) -{ - GtkTypeNode *node; - - g_return_if_fail (object != NULL); - g_return_if_fail (arg != NULL); - - LOOKUP_TYPE_NODE (node, type); - - if (node && node->type_info.arg_set_func) - (* node->type_info.arg_set_func) (object, arg, arg_id); -} - GtkArg* gtk_arg_copy (GtkArg *src_arg, GtkArg *dest_arg) @@ -534,6 +500,12 @@ gtk_type_class_init (GtkTypeNode *node) { if (!node->klass && node->type_info.class_size) { + GtkObjectClass *object_class; + GtkTypeNode *base_node; + GSList *slist; + + g_assert (node->type_info.class_size >= sizeof (GtkObjectClass)); + node->klass = g_malloc0 (node->type_info.class_size); if (node->parent_type) @@ -547,28 +519,42 @@ gtk_type_class_init (GtkTypeNode *node) if (parent->klass) memcpy (node->klass, parent->klass, parent->type_info.class_size); } - - if (gtk_type_is_a (node->type, GTK_TYPE_OBJECT)) - { - GtkObjectClass *object_class; + object_class = node->klass; + object_class->type = node->type; + + /* stack all base class initialization functions, so we + * call them in ascending order. + */ + base_node = node; + slist = NULL; + while (base_node) + { + if (base_node->type_info.base_class_init_func) + slist = g_slist_prepend (slist, base_node->type_info.base_class_init_func); + LOOKUP_TYPE_NODE (base_node, base_node->parent_type); + } + if (slist) + { + GSList *walk; + + for (walk = slist; walk; walk = walk->next) + { + register GtkClassInitFunc base_class_init; + + base_class_init = walk->data; + base_class_init (node->klass); + } + g_slist_free (slist); + } + /* FIXME: this initialization needs to be done through * a function pointer someday. */ g_assert (node->type_info.class_size >= sizeof (GtkObjectClass)); - object_class = node->klass; - object_class->type = node->type; - object_class->signals = NULL; - object_class->nsignals = 0; - object_class->n_args = 0; - } - - /* class_init_func is used as data pointer for - * class_size==0 types - */ if (node->type_info.class_init_func) - (* node->type_info.class_init_func) (node->klass); + node->type_info.class_init_func (node->klass); } } @@ -582,7 +568,7 @@ gtk_type_enum_get_values (GtkType enum_type) LOOKUP_TYPE_NODE (node, enum_type); if (node) - return (GtkEnumValue*) node->type_info.class_init_func; + return (GtkEnumValue*) node->type_info.reserved_1; } g_warning ("gtk_type_enum_get_values(): type `%s' is not derived from `enum' or `flags'", @@ -608,10 +594,10 @@ gtk_type_register_intern (gchar *name, info.type_name = name; info.object_size = 0; info.class_size = 0; - info.class_init_func = (void*) values; + info.class_init_func = NULL; info.object_init_func = NULL; - info.arg_set_func = NULL; - info.arg_get_func = NULL; + info.reserved_1 = values; + info.reserved_2 = NULL; /* relookup pointers afterwards. */ diff --git a/gtk/gtktypeutils.h b/gtk/gtktypeutils.h index 325409442..5b2c4b25f 100644 --- a/gtk/gtktypeutils.h +++ b/gtk/gtktypeutils.h @@ -80,16 +80,20 @@ typedef struct _GtkTypeInfo GtkTypeInfo; typedef struct _GtkEnumValue GtkEnumValue; typedef struct _GtkEnumValue GtkFlagValue; -typedef void (*GtkClassInitFunc) (gpointer klass); -typedef void (*GtkObjectInitFunc) (gpointer object); -typedef void (*GtkArgGetFunc) (GtkObject *object, GtkArg *arg, guint arg_id); -typedef void (*GtkArgSetFunc) (GtkObject *object, GtkArg *arg, guint arg_id); -typedef gint (*GtkFunction) (gpointer data); +typedef void (*GtkClassInitFunc) (gpointer klass); +typedef void (*GtkObjectInitFunc) (gpointer object); +typedef void (*GtkArgGetFunc) (GtkObject *object, + GtkArg *arg, + guint arg_id); +typedef void (*GtkArgSetFunc) (GtkObject *object, + GtkArg *arg, + guint arg_id); +typedef gint (*GtkFunction) (gpointer data); typedef void (*GtkCallbackMarshal) (GtkObject *object, - gpointer data, - guint n_args, - GtkArg *args); -typedef void (*GtkDestroyNotify) (gpointer data); + gpointer data, + guint n_args, + GtkArg *args); +typedef void (*GtkDestroyNotify) (gpointer data); struct _GtkArg { @@ -169,13 +173,14 @@ struct _GtkArg struct _GtkTypeInfo { - gchar *type_name; - guint object_size; - guint class_size; - GtkClassInitFunc class_init_func; - GtkObjectInitFunc object_init_func; - GtkArgSetFunc arg_set_func; - GtkArgGetFunc arg_get_func; + gchar *type_name; + guint object_size; + guint class_size; + GtkClassInitFunc class_init_func; + GtkObjectInitFunc object_init_func; + gpointer reserved_1; + gpointer reserved_2; + GtkClassInitFunc base_class_init_func; }; struct _GtkEnumValue @@ -205,22 +210,14 @@ void gtk_type_describe_tree (GtkType type, gboolean show_size); gint gtk_type_is_a (GtkType type, GtkType is_a_type); -void gtk_type_get_arg (GtkObject *object, - GtkType type, - GtkArg *arg, - guint arg_id); -void gtk_type_set_arg (GtkObject *object, - GtkType type, - GtkArg *arg, - guint arg_id); -GtkArg* gtk_arg_copy (GtkArg *src_arg, - GtkArg *dest_arg); GtkType gtk_type_register_enum (const gchar *type_name, GtkEnumValue *values); GtkType gtk_type_register_flags (const gchar *type_name, GtkFlagValue *values); GtkEnumValue* gtk_type_enum_get_values (GtkType enum_type); GtkFlagValue* gtk_type_flags_get_values (GtkType flags_type); +GtkArg* gtk_arg_copy (GtkArg *src_arg, + GtkArg *dest_arg); #ifdef __cplusplus diff --git a/gtk/gtkvbbox.c b/gtk/gtkvbbox.c index 8c9860ecb..99aedaf5e 100644 --- a/gtk/gtkvbbox.c +++ b/gtk/gtkvbbox.c @@ -43,8 +43,9 @@ gtk_vbutton_box_get_type (void) sizeof (GtkVButtonBoxClass), (GtkClassInitFunc) gtk_vbutton_box_class_init, (GtkObjectInitFunc) gtk_vbutton_box_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; vbutton_box_type = gtk_type_unique (gtk_button_box_get_type (), &vbutton_box_info); diff --git a/gtk/gtkvbox.c b/gtk/gtkvbox.c index b819700af..958d82101 100644 --- a/gtk/gtkvbox.c +++ b/gtk/gtkvbox.c @@ -41,8 +41,9 @@ gtk_vbox_get_type (void) sizeof (GtkVBoxClass), (GtkClassInitFunc) gtk_vbox_class_init, (GtkObjectInitFunc) gtk_vbox_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; vbox_type = gtk_type_unique (GTK_TYPE_BOX, &vbox_info); diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c index 614692287..266e69144 100644 --- a/gtk/gtkviewport.c +++ b/gtk/gtkviewport.c @@ -60,8 +60,9 @@ gtk_viewport_get_type (void) sizeof (GtkViewportClass), (GtkClassInitFunc) gtk_viewport_class_init, (GtkObjectInitFunc) gtk_viewport_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; viewport_type = gtk_type_unique (gtk_bin_get_type (), &viewport_info); diff --git a/gtk/gtkvpaned.c b/gtk/gtkvpaned.c index 5b5b67017..f5b24dd79 100644 --- a/gtk/gtkvpaned.c +++ b/gtk/gtkvpaned.c @@ -50,8 +50,9 @@ gtk_vpaned_get_type (void) sizeof (GtkVPanedClass), (GtkClassInitFunc) gtk_vpaned_class_init, (GtkObjectInitFunc) gtk_vpaned_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; vpaned_type = gtk_type_unique (gtk_paned_get_type (), &vpaned_info); diff --git a/gtk/gtkvruler.c b/gtk/gtkvruler.c index b7e2184f9..7099fc46c 100644 --- a/gtk/gtkvruler.c +++ b/gtk/gtkvruler.c @@ -52,8 +52,9 @@ gtk_vruler_get_type (void) sizeof (GtkVRulerClass), (GtkClassInitFunc) gtk_vruler_class_init, (GtkObjectInitFunc) gtk_vruler_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; vruler_type = gtk_type_unique (gtk_ruler_get_type (), &vruler_info); diff --git a/gtk/gtkvscale.c b/gtk/gtkvscale.c index 57ad90ef6..3b08063e5 100644 --- a/gtk/gtkvscale.c +++ b/gtk/gtkvscale.c @@ -60,8 +60,9 @@ gtk_vscale_get_type (void) sizeof (GtkVScaleClass), (GtkClassInitFunc) gtk_vscale_class_init, (GtkObjectInitFunc) gtk_vscale_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; vscale_type = gtk_type_unique (gtk_scale_get_type (), &vscale_info); diff --git a/gtk/gtkvscrollbar.c b/gtk/gtkvscrollbar.c index ba42df24a..d1eab8e75 100644 --- a/gtk/gtkvscrollbar.c +++ b/gtk/gtkvscrollbar.c @@ -54,8 +54,9 @@ gtk_vscrollbar_get_type (void) sizeof (GtkVScrollbarClass), (GtkClassInitFunc) gtk_vscrollbar_class_init, (GtkObjectInitFunc) gtk_vscrollbar_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; vscrollbar_type = gtk_type_unique (gtk_scrollbar_get_type (), &vscrollbar_info); diff --git a/gtk/gtkvseparator.c b/gtk/gtkvseparator.c index 567332087..85556e656 100644 --- a/gtk/gtkvseparator.c +++ b/gtk/gtkvseparator.c @@ -39,8 +39,9 @@ gtk_vseparator_get_type (void) sizeof (GtkVSeparatorClass), (GtkClassInitFunc) gtk_vseparator_class_init, (GtkObjectInitFunc) gtk_vseparator_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; vseparator_type = gtk_type_unique (gtk_separator_get_type (), &vseparator_info); diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index a43fbba83..51b7b86b7 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -165,10 +165,10 @@ static void gtk_widget_marshal_signal_7 (GtkObject *object, static void gtk_widget_class_init (GtkWidgetClass *klass); static void gtk_widget_init (GtkWidget *widget); -static void gtk_widget_set_arg (GtkWidget *widget, +static void gtk_widget_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gtk_widget_get_arg (GtkWidget *widget, +static void gtk_widget_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void gtk_widget_shutdown (GtkObject *object); @@ -266,8 +266,9 @@ gtk_widget_get_type (void) sizeof (GtkWidgetClass), (GtkClassInitFunc) gtk_widget_class_init, (GtkObjectInitFunc) gtk_widget_init, - (GtkArgSetFunc) gtk_widget_set_arg, - (GtkArgGetFunc) gtk_widget_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; widget_type = gtk_type_unique (gtk_object_get_type (), &widget_info); @@ -686,7 +687,9 @@ gtk_widget_class_init (GtkWidgetClass *klass) GTK_TYPE_GDK_EVENT); gtk_object_class_add_signals (object_class, widget_signals, LAST_SIGNAL); - + + object_class->set_arg = gtk_widget_set_arg; + object_class->get_arg = gtk_widget_get_arg; object_class->shutdown = gtk_widget_shutdown; object_class->destroy = gtk_widget_real_destroy; object_class->finalize = gtk_widget_finalize; @@ -751,23 +754,19 @@ gtk_widget_class_init (GtkWidgetClass *klass) } } -/***************************************** - * gtk_widget_set_arg: - * - * arguments: - * - * results: - *****************************************/ - static void -gtk_widget_set_arg (GtkWidget *widget, +gtk_widget_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) { - guint32 saved_flags; + GtkWidget *widget; + + widget = GTK_WIDGET (object); switch (arg_id) { + guint32 saved_flags; + case ARG_NAME: gtk_widget_set_name (widget, GTK_VALUE_STRING (*arg)); break; @@ -845,16 +844,20 @@ gtk_widget_set_arg (GtkWidget *widget, *****************************************/ static void -gtk_widget_get_arg (GtkWidget *widget, +gtk_widget_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { - GtkWidgetAuxInfo *aux_info; - gint *eventp; - GdkExtensionMode *modep; + GtkWidget *widget; + + widget = GTK_WIDGET (object); switch (arg_id) { + GtkWidgetAuxInfo *aux_info; + gint *eventp; + GdkExtensionMode *modep; + case ARG_NAME: if (widget->name) GTK_VALUE_STRING (*arg) = g_strdup (widget->name); diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index b2b40e49a..a62f04737 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -57,10 +57,10 @@ static void gtk_window_marshal_signal_2 (GtkObject *object, GtkArg *args); static void gtk_window_class_init (GtkWindowClass *klass); static void gtk_window_init (GtkWindow *window); -static void gtk_window_set_arg (GtkWindow *window, +static void gtk_window_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gtk_window_get_arg (GtkWindow *window, +static void gtk_window_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void gtk_window_shutdown (GtkObject *object); @@ -122,8 +122,9 @@ gtk_window_get_type (void) sizeof (GtkWindowClass), (GtkClassInitFunc) gtk_window_class_init, (GtkObjectInitFunc) gtk_window_init, - (GtkArgSetFunc) gtk_window_set_arg, - (GtkArgGetFunc) gtk_window_get_arg, + /* reversed_1 */ NULL, + /* reversed_2 */ NULL, + (GtkClassInitFunc) NULL, }; window_type = gtk_type_unique (gtk_bin_get_type (), &window_info); @@ -163,6 +164,8 @@ gtk_window_class_init (GtkWindowClass *klass) gtk_object_class_add_signals (object_class, window_signals, LAST_SIGNAL); + object_class->set_arg = gtk_window_set_arg; + object_class->get_arg = gtk_window_get_arg; object_class->shutdown = gtk_window_shutdown; object_class->destroy = gtk_window_destroy; object_class->finalize = gtk_window_finalize; @@ -215,10 +218,14 @@ gtk_window_init (GtkWindow *window) } static void -gtk_window_set_arg (GtkWindow *window, +gtk_window_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkWindow *window; + + window = GTK_WINDOW (object); + switch (arg_id) { case ARG_TYPE: @@ -248,10 +255,14 @@ gtk_window_set_arg (GtkWindow *window, } static void -gtk_window_get_arg (GtkWindow *window, +gtk_window_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { + GtkWindow *window; + + window = GTK_WINDOW (object); + switch (arg_id) { case ARG_TYPE: -- cgit v1.2.1