diff options
author | Manish Singh <yosh@gimp.org> | 2002-10-04 22:49:28 +0000 |
---|---|---|
committer | Manish Singh <yosh@src.gnome.org> | 2002-10-04 22:49:28 +0000 |
commit | 2aa899147773436da85d0b43711c526c3ee8cf99 (patch) | |
tree | 620113290ff719826a224d9dd5a1b6a181264343 | |
parent | fc7534bbcbf839799a145dcf106d3a9f7eb8a570 (diff) | |
download | gtk+-2aa899147773436da85d0b43711c526c3ee8cf99.tar.gz |
Deprecation cleanup
Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org>
* gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch]
gtkvscale.[ch] gtkvbbox.[ch]: Deprecation cleanup
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 5 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 5 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 5 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 5 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 5 | ||||
-rw-r--r-- | gtk/gtkbbox.c | 19 | ||||
-rw-r--r-- | gtk/gtkbbox.h | 12 | ||||
-rw-r--r-- | gtk/gtkhbbox.c | 27 | ||||
-rw-r--r-- | gtk/gtkhbbox.h | 12 | ||||
-rw-r--r-- | gtk/gtkhscale.c | 37 | ||||
-rw-r--r-- | gtk/gtkhscale.h | 12 | ||||
-rw-r--r-- | gtk/gtkscale.c | 30 | ||||
-rw-r--r-- | gtk/gtkscale.h | 12 | ||||
-rw-r--r-- | gtk/gtkvbbox.c | 28 | ||||
-rw-r--r-- | gtk/gtkvbbox.h | 12 | ||||
-rw-r--r-- | gtk/gtkvscale.c | 39 | ||||
-rw-r--r-- | gtk/gtkvscale.h | 12 |
18 files changed, 152 insertions, 130 deletions
@@ -1,3 +1,8 @@ +Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> + + * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] + gtkvscale.[ch] gtkvbbox.[ch]: Deprecation cleanup + Fri Oct 4 15:05:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com> * modules/input/gtkimcontextxim.c (get_ic_real): Fix memory diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index d0083cf47b..0e11fa2d86 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> + + * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] + gtkvscale.[ch] gtkvbbox.[ch]: Deprecation cleanup + Fri Oct 4 15:05:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com> * modules/input/gtkimcontextxim.c (get_ic_real): Fix memory diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index d0083cf47b..0e11fa2d86 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> + + * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] + gtkvscale.[ch] gtkvbbox.[ch]: Deprecation cleanup + Fri Oct 4 15:05:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com> * modules/input/gtkimcontextxim.c (get_ic_real): Fix memory diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index d0083cf47b..0e11fa2d86 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> + + * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] + gtkvscale.[ch] gtkvbbox.[ch]: Deprecation cleanup + Fri Oct 4 15:05:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com> * modules/input/gtkimcontextxim.c (get_ic_real): Fix memory diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index d0083cf47b..0e11fa2d86 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> + + * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] + gtkvscale.[ch] gtkvbbox.[ch]: Deprecation cleanup + Fri Oct 4 15:05:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com> * modules/input/gtkimcontextxim.c (get_ic_real): Fix memory diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index d0083cf47b..0e11fa2d86 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> + + * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] + gtkvscale.[ch] gtkvbbox.[ch]: Deprecation cleanup + Fri Oct 4 15:05:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com> * modules/input/gtkimcontextxim.c (get_ic_real): Fix memory diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c index b7167e4e02..15fe55a88e 100644 --- a/gtk/gtkbbox.c +++ b/gtk/gtkbbox.c @@ -64,29 +64,30 @@ static void gtk_button_box_get_child_property (GtkContainer *container, #define DEFAULT_CHILD_IPAD_X 4 #define DEFAULT_CHILD_IPAD_Y 0 -GtkType +GType gtk_button_box_get_type (void) { - static GtkType button_box_type = 0; + static GType button_box_type = 0; if (!button_box_type) { static const GTypeInfo button_box_info = { sizeof (GtkButtonBoxClass), - NULL, /* base_init */ - NULL, /* base_finalize */ + NULL, /* base_init */ + NULL, /* base_finalize */ (GClassInitFunc) gtk_button_box_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ + NULL, /* class_finalize */ + NULL, /* class_data */ sizeof (GtkButtonBox), 0, /* n_preallocs */ (GInstanceInitFunc) gtk_button_box_init, - NULL, /* value_table */ + NULL, /* value_table */ }; - button_box_type = g_type_register_static (GTK_TYPE_BOX, "GtkButtonBox", - &button_box_info, G_TYPE_FLAG_ABSTRACT); + button_box_type = + g_type_register_static (GTK_TYPE_BOX, "GtkButtonBox", + &button_box_info, G_TYPE_FLAG_ABSTRACT); } return button_box_type; diff --git a/gtk/gtkbbox.h b/gtk/gtkbbox.h index 0b6d11f9d5..d69c44dfca 100644 --- a/gtk/gtkbbox.h +++ b/gtk/gtkbbox.h @@ -36,11 +36,11 @@ extern "C" { #define GTK_TYPE_BUTTON_BOX (gtk_button_box_get_type ()) -#define GTK_BUTTON_BOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_BUTTON_BOX, GtkButtonBox)) -#define GTK_BUTTON_BOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_BUTTON_BOX, GtkButtonBoxClass)) -#define GTK_IS_BUTTON_BOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_BUTTON_BOX)) -#define GTK_IS_BUTTON_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUTTON_BOX)) -#define GTK_BUTTON_BOX_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_BUTTON_BOX, GtkButtonBoxClass)) +#define GTK_BUTTON_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BUTTON_BOX, GtkButtonBox)) +#define GTK_BUTTON_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BUTTON_BOX, GtkButtonBoxClass)) +#define GTK_IS_BUTTON_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BUTTON_BOX)) +#define GTK_IS_BUTTON_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUTTON_BOX)) +#define GTK_BUTTON_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON_BOX, GtkButtonBoxClass)) #define GTK_BUTTONBOX_DEFAULT -1 @@ -64,7 +64,7 @@ struct _GtkButtonBoxClass }; -GtkType gtk_button_box_get_type (void) G_GNUC_CONST; +GType gtk_button_box_get_type (void) G_GNUC_CONST; GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget); void gtk_button_box_set_layout (GtkButtonBox *widget, diff --git a/gtk/gtkhbbox.c b/gtk/gtkhbbox.c index fee56b4177..cf79327235 100644 --- a/gtk/gtkhbbox.c +++ b/gtk/gtkhbbox.c @@ -37,26 +37,29 @@ static void gtk_hbutton_box_size_allocate (GtkWidget *widget, static gint default_spacing = 30; static gint default_layout_style = GTK_BUTTONBOX_EDGE; -GtkType +GType gtk_hbutton_box_get_type (void) { - static GtkType hbutton_box_type = 0; + static GType hbutton_box_type = 0; if (!hbutton_box_type) { - static const GtkTypeInfo hbutton_box_info = + static const GTypeInfo hbutton_box_info = { - "GtkHButtonBox", - sizeof (GtkHButtonBox), sizeof (GtkHButtonBoxClass), - (GtkClassInitFunc) gtk_hbutton_box_class_init, - (GtkObjectInitFunc) gtk_hbutton_box_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_hbutton_box_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkHButtonBox), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_hbutton_box_init, }; - hbutton_box_type = gtk_type_unique (GTK_TYPE_BUTTON_BOX, &hbutton_box_info); + hbutton_box_type = + g_type_register_static (GTK_TYPE_BUTTON_BOX, "GtkHButtonBox", + &hbutton_box_info, 0); } return hbutton_box_type; @@ -84,7 +87,7 @@ gtk_hbutton_box_new (void) { GtkHButtonBox *hbutton_box; - hbutton_box = gtk_type_new (GTK_TYPE_HBUTTON_BOX); + hbutton_box = g_object_new (GTK_TYPE_HBUTTON_BOX, NULL); return GTK_WIDGET (hbutton_box); } diff --git a/gtk/gtkhbbox.h b/gtk/gtkhbbox.h index 41e62e26fd..52203b4724 100644 --- a/gtk/gtkhbbox.h +++ b/gtk/gtkhbbox.h @@ -37,11 +37,11 @@ extern "C" { #define GTK_TYPE_HBUTTON_BOX (gtk_hbutton_box_get_type ()) -#define GTK_HBUTTON_BOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_HBUTTON_BOX, GtkHButtonBox)) -#define GTK_HBUTTON_BOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_HBUTTON_BOX, GtkHButtonBoxClass)) -#define GTK_IS_HBUTTON_BOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_HBUTTON_BOX)) -#define GTK_IS_HBUTTON_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HBUTTON_BOX)) -#define GTK_HBUTTON_BOX_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_HBUTTON_BOX, GtkHButtonBoxClass)) +#define GTK_HBUTTON_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HBUTTON_BOX, GtkHButtonBox)) +#define GTK_HBUTTON_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HBUTTON_BOX, GtkHButtonBoxClass)) +#define GTK_IS_HBUTTON_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HBUTTON_BOX)) +#define GTK_IS_HBUTTON_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HBUTTON_BOX)) +#define GTK_HBUTTON_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HBUTTON_BOX, GtkHButtonBoxClass)) typedef struct _GtkHButtonBox GtkHButtonBox; @@ -58,7 +58,7 @@ struct _GtkHButtonBoxClass }; -GtkType gtk_hbutton_box_get_type (void) G_GNUC_CONST; +GType gtk_hbutton_box_get_type (void) G_GNUC_CONST; GtkWidget* gtk_hbutton_box_new (void); /* buttons can be added by gtk_container_add() */ diff --git a/gtk/gtkhscale.c b/gtk/gtkhscale.c index 3d8df65d69..13c6fd2a55 100644 --- a/gtk/gtkhscale.c +++ b/gtk/gtkhscale.c @@ -28,7 +28,6 @@ #include <stdio.h> #include <stdlib.h> #include "gtkhscale.h" -#include "gtksignal.h" #include "gtkintl.h" static gpointer parent_class; @@ -38,26 +37,28 @@ static void gtk_hscale_init (GtkHScale *hscale); static gboolean gtk_hscale_expose (GtkWidget *widget, GdkEventExpose *event); -GtkType +GType gtk_hscale_get_type (void) { - static GtkType hscale_type = 0; + static GType hscale_type = 0; if (!hscale_type) { - static const GtkTypeInfo hscale_info = + static const GTypeInfo hscale_info = { - "GtkHScale", - sizeof (GtkHScale), sizeof (GtkHScaleClass), - (GtkClassInitFunc) gtk_hscale_class_init, - (GtkObjectInitFunc) gtk_hscale_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_hscale_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkHScale), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_hscale_init, }; - hscale_type = gtk_type_unique (GTK_TYPE_SCALE, &hscale_info); + hscale_type = g_type_register_static (GTK_TYPE_SCALE, "GtkHScale", + &hscale_info, 0); } return hscale_type; @@ -66,11 +67,9 @@ gtk_hscale_get_type (void) static void gtk_hscale_class_init (GtkHScaleClass *class) { - GObjectClass *gobject_class; GtkWidgetClass *widget_class; GtkRangeClass *range_class; - gobject_class = G_OBJECT_CLASS (class); widget_class = GTK_WIDGET_CLASS (class); range_class = GTK_RANGE_CLASS (class); @@ -95,13 +94,7 @@ gtk_hscale_init (GtkHScale *hscale) GtkWidget* gtk_hscale_new (GtkAdjustment *adjustment) { - GtkWidget *hscale; - - hscale = gtk_widget_new (GTK_TYPE_HSCALE, - "adjustment", adjustment, - NULL); - - return hscale; + return g_object_new (GTK_TYPE_HSCALE, "adjustment", adjustment, NULL); } /** @@ -235,7 +228,7 @@ gtk_hscale_expose (GtkWidget *widget, x, y, layout); - g_object_unref (G_OBJECT (layout)); + g_object_unref (layout); } return FALSE; diff --git a/gtk/gtkhscale.h b/gtk/gtkhscale.h index 18b96e6aeb..9b820bb111 100644 --- a/gtk/gtkhscale.h +++ b/gtk/gtkhscale.h @@ -38,11 +38,11 @@ extern "C" { #define GTK_TYPE_HSCALE (gtk_hscale_get_type ()) -#define GTK_HSCALE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_HSCALE, GtkHScale)) -#define GTK_HSCALE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_HSCALE, GtkHScaleClass)) -#define GTK_IS_HSCALE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_HSCALE)) -#define GTK_IS_HSCALE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HSCALE)) -#define GTK_HSCALE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_HSCALE, GtkHScaleClass)) +#define GTK_HSCALE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HSCALE, GtkHScale)) +#define GTK_HSCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HSCALE, GtkHScaleClass)) +#define GTK_IS_HSCALE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HSCALE)) +#define GTK_IS_HSCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HSCALE)) +#define GTK_HSCALE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HSCALE, GtkHScaleClass)) typedef struct _GtkHScale GtkHScale; @@ -59,7 +59,7 @@ struct _GtkHScaleClass }; -GtkType gtk_hscale_get_type (void) G_GNUC_CONST; +GType gtk_hscale_get_type (void) G_GNUC_CONST; GtkWidget* gtk_hscale_new (GtkAdjustment *adjustment); GtkWidget* gtk_hscale_new_with_range (gdouble min, gdouble max, diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c index 6dfe0cf6dc..598d9dc1ab 100644 --- a/gtk/gtkscale.c +++ b/gtk/gtkscale.c @@ -69,25 +69,25 @@ static void gtk_scale_style_set (GtkWidget *widget, static void gtk_scale_get_range_border (GtkRange *range, GtkBorder *border); -GtkType +GType gtk_scale_get_type (void) { - static GtkType scale_type = 0; + static GType scale_type = 0; if (!scale_type) { static const GTypeInfo scale_info = { sizeof (GtkScaleClass), - NULL, /* base_init */ - NULL, /* base_finalize */ + NULL, /* base_init */ + NULL, /* base_finalize */ (GClassInitFunc) gtk_scale_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ + NULL, /* class_finalize */ + NULL, /* class_data */ sizeof (GtkScale), - 0, /* n_preallocs */ + 0, /* n_preallocs */ (GInstanceInitFunc) gtk_scale_init, - NULL, /* value_table */ + NULL, /* value_table */ }; scale_type = g_type_register_static (GTK_TYPE_RANGE, "GtkScale", @@ -123,17 +123,15 @@ static void gtk_scale_class_init (GtkScaleClass *class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; GtkWidgetClass *widget_class; - GtkRangeClass *range_class; - GtkBindingSet *binding_set; + GtkRangeClass *range_class; + GtkBindingSet *binding_set; gobject_class = G_OBJECT_CLASS (class); - object_class = (GtkObjectClass*) class; range_class = (GtkRangeClass*) class; widget_class = (GtkWidgetClass*) class; - parent_class = gtk_type_class (GTK_TYPE_RANGE); + parent_class = g_type_class_peek_parent (class); gobject_class->set_property = gtk_scale_set_property; gobject_class->get_property = gtk_scale_get_property; @@ -144,7 +142,7 @@ gtk_scale_class_init (GtkScaleClass *class) signals[FORMAT_VALUE] = g_signal_new ("format_value", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GtkScaleClass, format_value), single_string_accumulator, NULL, @@ -561,7 +559,7 @@ _gtk_scale_get_value_size (GtkScale *scale, if (height) *height = MAX (*height, logical_rect.height); - g_object_unref (G_OBJECT (layout)); + g_object_unref (layout); } else { @@ -608,7 +606,7 @@ _gtk_scale_format_value (GtkScale *scale, { gchar *fmt = NULL; - g_signal_emit (G_OBJECT (scale), + g_signal_emit (scale, signals[FORMAT_VALUE], 0, value, diff --git a/gtk/gtkscale.h b/gtk/gtkscale.h index 59b804746a..82f3fea0cb 100644 --- a/gtk/gtkscale.h +++ b/gtk/gtkscale.h @@ -38,11 +38,11 @@ extern "C" { #define GTK_TYPE_SCALE (gtk_scale_get_type ()) -#define GTK_SCALE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_SCALE, GtkScale)) -#define GTK_SCALE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCALE, GtkScaleClass)) -#define GTK_IS_SCALE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SCALE)) -#define GTK_IS_SCALE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCALE)) -#define GTK_SCALE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_SCALE, GtkScaleClass)) +#define GTK_SCALE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SCALE, GtkScale)) +#define GTK_SCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCALE, GtkScaleClass)) +#define GTK_IS_SCALE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SCALE)) +#define GTK_IS_SCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCALE)) +#define GTK_SCALE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SCALE, GtkScaleClass)) typedef struct _GtkScale GtkScale; @@ -73,7 +73,7 @@ struct _GtkScaleClass void (*_gtk_reserved4) (void); }; -GtkType gtk_scale_get_type (void) G_GNUC_CONST; +GType gtk_scale_get_type (void) G_GNUC_CONST; void gtk_scale_set_digits (GtkScale *scale, gint digits); diff --git a/gtk/gtkvbbox.c b/gtk/gtkvbbox.c index 18c01e1c88..c2274f7228 100644 --- a/gtk/gtkvbbox.c +++ b/gtk/gtkvbbox.c @@ -37,26 +37,29 @@ static void gtk_vbutton_box_size_allocate (GtkWidget *widget, static gint default_spacing = 10; static GtkButtonBoxStyle default_layout_style = GTK_BUTTONBOX_EDGE; -GtkType +GType gtk_vbutton_box_get_type (void) { - static GtkType vbutton_box_type = 0; + static GType vbutton_box_type = 0; if (!vbutton_box_type) { - static const GtkTypeInfo vbutton_box_info = + static const GTypeInfo vbutton_box_info = { - "GtkVButtonBox", - sizeof (GtkVButtonBox), sizeof (GtkVButtonBoxClass), - (GtkClassInitFunc) gtk_vbutton_box_class_init, - (GtkObjectInitFunc) gtk_vbutton_box_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_vbutton_box_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkVButtonBox), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_vbutton_box_init, }; - vbutton_box_type = gtk_type_unique (GTK_TYPE_BUTTON_BOX, &vbutton_box_info); + vbutton_box_type = + g_type_register_static (GTK_TYPE_BUTTON_BOX, "GtkVButtonBox", + &vbutton_box_info, 0); } return vbutton_box_type; @@ -84,7 +87,8 @@ gtk_vbutton_box_new (void) { GtkVButtonBox *vbutton_box; - vbutton_box = gtk_type_new (GTK_TYPE_VBUTTON_BOX); + vbutton_box = g_object_new (GTK_TYPE_VBUTTON_BOX, NULL); + return GTK_WIDGET (vbutton_box); } diff --git a/gtk/gtkvbbox.h b/gtk/gtkvbbox.h index b5dac7dd8f..45980d0853 100644 --- a/gtk/gtkvbbox.h +++ b/gtk/gtkvbbox.h @@ -37,11 +37,11 @@ extern "C" { #define GTK_TYPE_VBUTTON_BOX (gtk_vbutton_box_get_type ()) -#define GTK_VBUTTON_BOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_VBUTTON_BOX, GtkVButtonBox)) -#define GTK_VBUTTON_BOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_VBUTTON_BOX, GtkVButtonBoxClass)) -#define GTK_IS_VBUTTON_BOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_VBUTTON_BOX)) -#define GTK_IS_VBUTTON_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VBUTTON_BOX)) -#define GTK_VBUTTON_BOX_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_VBUTTON_BOX, GtkVButtonBoxClass)) +#define GTK_VBUTTON_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_VBUTTON_BOX, GtkVButtonBox)) +#define GTK_VBUTTON_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_VBUTTON_BOX, GtkVButtonBoxClass)) +#define GTK_IS_VBUTTON_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VBUTTON_BOX)) +#define GTK_IS_VBUTTON_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VBUTTON_BOX)) +#define GTK_VBUTTON_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VBUTTON_BOX, GtkVButtonBoxClass)) typedef struct _GtkVButtonBox GtkVButtonBox; @@ -58,7 +58,7 @@ struct _GtkVButtonBoxClass }; -GtkType gtk_vbutton_box_get_type (void) G_GNUC_CONST; +GType gtk_vbutton_box_get_type (void) G_GNUC_CONST; GtkWidget *gtk_vbutton_box_new (void); /* buttons can be added by gtk_container_add() */ diff --git a/gtk/gtkvscale.c b/gtk/gtkvscale.c index 9fa56f76ef..ae28fddfdc 100644 --- a/gtk/gtkvscale.c +++ b/gtk/gtkvscale.c @@ -28,7 +28,6 @@ #include <stdio.h> #include <stdlib.h> #include "gtkvscale.h" -#include "gtksignal.h" #include "gtkintl.h" #define VALUE_SPACING 2 @@ -40,26 +39,28 @@ static void gtk_vscale_init (GtkVScale *vscale); static gboolean gtk_vscale_expose (GtkWidget *widget, GdkEventExpose *event); -GtkType +GType gtk_vscale_get_type (void) { - static GtkType vscale_type = 0; + static GType vscale_type = 0; if (!vscale_type) { - static const GtkTypeInfo vscale_info = + static const GTypeInfo vscale_info = { - "GtkVScale", - sizeof (GtkVScale), - sizeof (GtkVScaleClass), - (GtkClassInitFunc) gtk_vscale_class_init, - (GtkObjectInitFunc) gtk_vscale_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + sizeof (GtkVScaleClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_vscale_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkVScale), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_vscale_init, }; - vscale_type = gtk_type_unique (GTK_TYPE_SCALE, &vscale_info); + vscale_type = g_type_register_static (GTK_TYPE_SCALE, "GtkVScale", + &vscale_info, 0); } return vscale_type; @@ -68,11 +69,9 @@ gtk_vscale_get_type (void) static void gtk_vscale_class_init (GtkVScaleClass *class) { - GObjectClass *gobject_class; GtkWidgetClass *widget_class; GtkRangeClass *range_class; - gobject_class = G_OBJECT_CLASS (class); widget_class = GTK_WIDGET_CLASS (class); range_class = GTK_RANGE_CLASS (class); @@ -96,13 +95,7 @@ gtk_vscale_init (GtkVScale *vscale) GtkWidget* gtk_vscale_new (GtkAdjustment *adjustment) { - GtkWidget *vscale; - - vscale = gtk_widget_new (GTK_TYPE_VSCALE, - "adjustment", adjustment, - NULL); - - return vscale; + return g_object_new (GTK_TYPE_VSCALE, "adjustment", adjustment, NULL); } @@ -235,7 +228,7 @@ gtk_vscale_expose (GtkWidget *widget, x, y, layout); - g_object_unref (G_OBJECT (layout)); + g_object_unref (layout); } return FALSE; diff --git a/gtk/gtkvscale.h b/gtk/gtkvscale.h index 69757ecdee..7a1a66727a 100644 --- a/gtk/gtkvscale.h +++ b/gtk/gtkvscale.h @@ -38,11 +38,11 @@ extern "C" { #define GTK_TYPE_VSCALE (gtk_vscale_get_type ()) -#define GTK_VSCALE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_VSCALE, GtkVScale)) -#define GTK_VSCALE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_VSCALE, GtkVScaleClass)) -#define GTK_IS_VSCALE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_VSCALE)) -#define GTK_IS_VSCALE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VSCALE)) -#define GTK_VSCALE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_VSCALE, GtkVScaleClass)) +#define GTK_VSCALE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_VSCALE, GtkVScale)) +#define GTK_VSCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_VSCALE, GtkVScaleClass)) +#define GTK_IS_VSCALE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VSCALE)) +#define GTK_IS_VSCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VSCALE)) +#define GTK_VSCALE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VSCALE, GtkVScaleClass)) typedef struct _GtkVScale GtkVScale; @@ -59,7 +59,7 @@ struct _GtkVScaleClass }; -GtkType gtk_vscale_get_type (void) G_GNUC_CONST; +GType gtk_vscale_get_type (void) G_GNUC_CONST; GtkWidget* gtk_vscale_new (GtkAdjustment *adjustment); GtkWidget* gtk_vscale_new_with_range (gdouble min, gdouble max, |