diff options
author | Manish Singh <yosh@gimp.org> | 2002-10-04 23:50:27 +0000 |
---|---|---|
committer | Manish Singh <yosh@src.gnome.org> | 2002-10-04 23:50:27 +0000 |
commit | 2ffa58f11d0fdfdee4859f37dd69bcec21b34e41 (patch) | |
tree | 48127a3db81fb37f274d8ca497e68f9e6d0fe64f | |
parent | 2aa899147773436da85d0b43711c526c3ee8cf99 (diff) | |
download | gdk-pixbuf-2ffa58f11d0fdfdee4859f37dd69bcec21b34e41.tar.gz |
Deprecation cleanup
Fri Oct 4 16:48:27 2002 Manish Singh <yosh@gimp.org>
* gtkaspectframe.[ch] gtkbin.[ch] gtkframe.[ch] gtkhruler.[ch]
gtkruler.[ch] gtkvruler.[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/gtkaspectframe.c | 31 | ||||
-rw-r--r-- | gtk/gtkaspectframe.h | 12 | ||||
-rw-r--r-- | gtk/gtkbin.c | 48 | ||||
-rw-r--r-- | gtk/gtkbin.h | 12 | ||||
-rw-r--r-- | gtk/gtkframe.c | 38 | ||||
-rw-r--r-- | gtk/gtkframe.h | 12 | ||||
-rw-r--r-- | gtk/gtkhruler.c | 40 | ||||
-rw-r--r-- | gtk/gtkhruler.h | 12 | ||||
-rw-r--r-- | gtk/gtkruler.c | 48 | ||||
-rw-r--r-- | gtk/gtkruler.h | 12 | ||||
-rw-r--r-- | gtk/gtkvruler.c | 40 | ||||
-rw-r--r-- | gtk/gtkvruler.h | 12 |
18 files changed, 186 insertions, 161 deletions
@@ -1,3 +1,8 @@ +Fri Oct 4 16:48:27 2002 Manish Singh <yosh@gimp.org> + + * gtkaspectframe.[ch] gtkbin.[ch] gtkframe.[ch] gtkhruler.[ch] + gtkruler.[ch] gtkvruler.[ch]: Deprecation cleanup + Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0e11fa2d8..2d462801a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Fri Oct 4 16:48:27 2002 Manish Singh <yosh@gimp.org> + + * gtkaspectframe.[ch] gtkbin.[ch] gtkframe.[ch] gtkhruler.[ch] + gtkruler.[ch] gtkvruler.[ch]: Deprecation cleanup + Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0e11fa2d8..2d462801a 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Fri Oct 4 16:48:27 2002 Manish Singh <yosh@gimp.org> + + * gtkaspectframe.[ch] gtkbin.[ch] gtkframe.[ch] gtkhruler.[ch] + gtkruler.[ch] gtkvruler.[ch]: Deprecation cleanup + Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0e11fa2d8..2d462801a 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Fri Oct 4 16:48:27 2002 Manish Singh <yosh@gimp.org> + + * gtkaspectframe.[ch] gtkbin.[ch] gtkframe.[ch] gtkhruler.[ch] + gtkruler.[ch] gtkvruler.[ch]: Deprecation cleanup + Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0e11fa2d8..2d462801a 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Fri Oct 4 16:48:27 2002 Manish Singh <yosh@gimp.org> + + * gtkaspectframe.[ch] gtkbin.[ch] gtkframe.[ch] gtkhruler.[ch] + gtkruler.[ch] gtkvruler.[ch]: Deprecation cleanup + Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0e11fa2d8..2d462801a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Fri Oct 4 16:48:27 2002 Manish Singh <yosh@gimp.org> + + * gtkaspectframe.[ch] gtkbin.[ch] gtkframe.[ch] gtkhruler.[ch] + gtkruler.[ch] gtkvruler.[ch]: Deprecation cleanup + Fri Oct 4 15:47:06 2002 Manish Singh <yosh@gimp.org> * gtkbbox.[ch] gtkhbbox.[ch] gtkhscale.[ch] gtkscale.[ch] diff --git a/gtk/gtkaspectframe.c b/gtk/gtkaspectframe.c index b0c58b1c7..7776c76c3 100644 --- a/gtk/gtkaspectframe.c +++ b/gtk/gtkaspectframe.c @@ -58,26 +58,29 @@ static void gtk_aspect_frame_compute_child_allocation (GtkFrame *fram static GtkFrameClass *parent_class = NULL; -GtkType +GType gtk_aspect_frame_get_type (void) { - static GtkType aspect_frame_type = 0; + static GType aspect_frame_type = 0; if (!aspect_frame_type) { - static const GtkTypeInfo aspect_frame_info = + static const GTypeInfo aspect_frame_info = { - "GtkAspectFrame", - sizeof (GtkAspectFrame), sizeof (GtkAspectFrameClass), - (GtkClassInitFunc) gtk_aspect_frame_class_init, - (GtkObjectInitFunc) gtk_aspect_frame_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_aspect_frame_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkAspectFrame), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_aspect_frame_init, }; - aspect_frame_type = gtk_type_unique (GTK_TYPE_FRAME, &aspect_frame_info); + aspect_frame_type = + g_type_register_static (GTK_TYPE_FRAME, "GtkAspectFrame", + &aspect_frame_info, 0); } return aspect_frame_type; @@ -87,13 +90,11 @@ static void gtk_aspect_frame_class_init (GtkAspectFrameClass *class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; GtkFrameClass *frame_class; - parent_class = gtk_type_class (GTK_TYPE_FRAME); + parent_class = g_type_class_peek_parent (class); gobject_class = (GObjectClass*) class; - object_class = (GtkObjectClass*) class; frame_class = (GtkFrameClass*) class; gobject_class->set_property = gtk_aspect_frame_set_property; @@ -222,7 +223,7 @@ gtk_aspect_frame_new (const gchar *label, { GtkAspectFrame *aspect_frame; - aspect_frame = gtk_type_new (gtk_aspect_frame_get_type ()); + aspect_frame = g_object_new (GTK_TYPE_ASPECT_FRAME, NULL); aspect_frame->xalign = CLAMP (xalign, 0.0, 1.0); aspect_frame->yalign = CLAMP (yalign, 0.0, 1.0); diff --git a/gtk/gtkaspectframe.h b/gtk/gtkaspectframe.h index 5cb058216..426da7c95 100644 --- a/gtk/gtkaspectframe.h +++ b/gtk/gtkaspectframe.h @@ -38,11 +38,11 @@ extern "C" { #define GTK_TYPE_ASPECT_FRAME (gtk_aspect_frame_get_type ()) -#define GTK_ASPECT_FRAME(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_ASPECT_FRAME, GtkAspectFrame)) -#define GTK_ASPECT_FRAME_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_ASPECT_FRAME, GtkAspectFrameClass)) -#define GTK_IS_ASPECT_FRAME(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_ASPECT_FRAME)) -#define GTK_IS_ASPECT_FRAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ASPECT_FRAME)) -#define GTK_ASPECT_FRAME_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_ASPECT_FRAME, GtkAspectFrameClass)) +#define GTK_ASPECT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ASPECT_FRAME, GtkAspectFrame)) +#define GTK_ASPECT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ASPECT_FRAME, GtkAspectFrameClass)) +#define GTK_IS_ASPECT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ASPECT_FRAME)) +#define GTK_IS_ASPECT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ASPECT_FRAME)) +#define GTK_ASPECT_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ASPECT_FRAME, GtkAspectFrameClass)) typedef struct _GtkAspectFrame GtkAspectFrame; @@ -66,7 +66,7 @@ struct _GtkAspectFrameClass }; -GtkType gtk_aspect_frame_get_type (void) G_GNUC_CONST; +GType gtk_aspect_frame_get_type (void) G_GNUC_CONST; GtkWidget* gtk_aspect_frame_new (const gchar *label, gfloat xalign, gfloat yalign, diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c index 1f30f5292..1160f8225 100644 --- a/gtk/gtkbin.c +++ b/gtk/gtkbin.c @@ -27,41 +27,41 @@ #include "gtkbin.h" -static void gtk_bin_class_init (GtkBinClass *klass); -static void gtk_bin_init (GtkBin *bin); -static void gtk_bin_add (GtkContainer *container, - GtkWidget *widget); -static void gtk_bin_remove (GtkContainer *container, - GtkWidget *widget); -static void gtk_bin_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data); -static GtkType gtk_bin_child_type (GtkContainer*container); +static void gtk_bin_class_init (GtkBinClass *klass); +static void gtk_bin_init (GtkBin *bin); +static void gtk_bin_add (GtkContainer *container, + GtkWidget *widget); +static void gtk_bin_remove (GtkContainer *container, + GtkWidget *widget); +static void gtk_bin_forall (GtkContainer *container, + gboolean include_internals, + GtkCallback callback, + gpointer callback_data); +static GType gtk_bin_child_type (GtkContainer *container); static GtkContainerClass *parent_class = NULL; -GtkType +GType gtk_bin_get_type (void) { - static GtkType bin_type = 0; + static GType bin_type = 0; if (!bin_type) { static const GTypeInfo bin_info = { sizeof (GtkBinClass), - NULL, /* base_init */ - NULL, /* base_finalize */ + NULL, /* base_init */ + NULL, /* base_finalize */ (GClassInitFunc) gtk_bin_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ + NULL, /* class_finalize */ + NULL, /* class_data */ sizeof (GtkBin), - 0, /* n_preallocs */ + 0, /* n_preallocs */ (GInstanceInitFunc) gtk_bin_init, - NULL, /* value_table */ + NULL, /* value_table */ }; bin_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkBin", @@ -74,15 +74,11 @@ gtk_bin_get_type (void) static void gtk_bin_class_init (GtkBinClass *class) { - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; GtkContainerClass *container_class; - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; container_class = (GtkContainerClass*) class; - parent_class = gtk_type_class (GTK_TYPE_CONTAINER); + parent_class = g_type_class_peek_parent (class); container_class->add = gtk_bin_add; container_class->remove = gtk_bin_remove; @@ -99,13 +95,13 @@ gtk_bin_init (GtkBin *bin) } -static GtkType +static GType gtk_bin_child_type (GtkContainer *container) { if (!GTK_BIN (container)->child) return GTK_TYPE_WIDGET; else - return GTK_TYPE_NONE; + return G_TYPE_NONE; } static void diff --git a/gtk/gtkbin.h b/gtk/gtkbin.h index 3b914013f..89b61a419 100644 --- a/gtk/gtkbin.h +++ b/gtk/gtkbin.h @@ -38,11 +38,11 @@ extern "C" { #define GTK_TYPE_BIN (gtk_bin_get_type ()) -#define GTK_BIN(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_BIN, GtkBin)) -#define GTK_BIN_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_BIN, GtkBinClass)) -#define GTK_IS_BIN(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_BIN)) -#define GTK_IS_BIN_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BIN)) -#define GTK_BIN_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_BIN, GtkBinClass)) +#define GTK_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BIN, GtkBin)) +#define GTK_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BIN, GtkBinClass)) +#define GTK_IS_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BIN)) +#define GTK_IS_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BIN)) +#define GTK_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BIN, GtkBinClass)) typedef struct _GtkBin GtkBin; @@ -61,7 +61,7 @@ struct _GtkBinClass }; -GtkType gtk_bin_get_type (void) G_GNUC_CONST; +GType gtk_bin_get_type (void) G_GNUC_CONST; GtkWidget *gtk_bin_get_child (GtkBin *bin); diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index bedf2c4ae..8d43389fd 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -76,26 +76,28 @@ static void gtk_frame_real_compute_child_allocation (GtkFrame *frame, static GtkBinClass *parent_class = NULL; -GtkType +GType gtk_frame_get_type (void) { - static GtkType frame_type = 0; + static GType frame_type = 0; if (!frame_type) { - static const GtkTypeInfo frame_info = + static const GTypeInfo frame_info = { - "GtkFrame", - sizeof (GtkFrame), sizeof (GtkFrameClass), - (GtkClassInitFunc) gtk_frame_class_init, - (GtkObjectInitFunc) gtk_frame_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_frame_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkFrame), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_frame_init, }; - frame_type = gtk_type_unique (gtk_bin_get_type (), &frame_info); + frame_type = g_type_register_static (GTK_TYPE_BIN, "GtkFrame", + &frame_info, 0); } return frame_type; @@ -105,16 +107,14 @@ static void gtk_frame_class_init (GtkFrameClass *class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; gobject_class = (GObjectClass*) class; - object_class = GTK_OBJECT_CLASS (class); widget_class = GTK_WIDGET_CLASS (class); container_class = GTK_CONTAINER_CLASS (class); - parent_class = gtk_type_class (gtk_bin_get_type ()); + parent_class = g_type_class_peek_parent (class); gobject_class->set_property = gtk_frame_set_property; gobject_class->get_property = gtk_frame_get_property; @@ -265,13 +265,7 @@ gtk_frame_get_property (GObject *object, GtkWidget* gtk_frame_new (const gchar *label) { - GtkFrame *frame; - - frame = gtk_type_new (gtk_frame_get_type ()); - - gtk_frame_set_label (frame, label); - - return GTK_WIDGET (frame); + return g_object_new (GTK_TYPE_FRAME, "label", label, NULL); } static void @@ -470,7 +464,7 @@ gtk_frame_set_shadow_type (GtkFrame *frame, if (GTK_WIDGET_DRAWABLE (frame)) { - gtk_widget_queue_clear (GTK_WIDGET (frame)); + gtk_widget_queue_draw (GTK_WIDGET (frame)); } gtk_widget_queue_resize (GTK_WIDGET (frame)); diff --git a/gtk/gtkframe.h b/gtk/gtkframe.h index 70c490237..7fa585065 100644 --- a/gtk/gtkframe.h +++ b/gtk/gtkframe.h @@ -38,11 +38,11 @@ extern "C" { #define GTK_TYPE_FRAME (gtk_frame_get_type ()) -#define GTK_FRAME(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FRAME, GtkFrame)) -#define GTK_FRAME_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FRAME, GtkFrameClass)) -#define GTK_IS_FRAME(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FRAME)) -#define GTK_IS_FRAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FRAME)) -#define GTK_FRAME_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_FRAME, GtkFrameClass)) +#define GTK_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FRAME, GtkFrame)) +#define GTK_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FRAME, GtkFrameClass)) +#define GTK_IS_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FRAME)) +#define GTK_IS_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FRAME)) +#define GTK_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FRAME, GtkFrameClass)) typedef struct _GtkFrame GtkFrame; @@ -68,7 +68,7 @@ struct _GtkFrameClass }; -GtkType gtk_frame_get_type (void) G_GNUC_CONST; +GType gtk_frame_get_type (void) G_GNUC_CONST; GtkWidget* gtk_frame_new (const gchar *label); void gtk_frame_set_label (GtkFrame *frame, diff --git a/gtk/gtkhruler.c b/gtk/gtkhruler.c index 320c14942..8e6dc2ad2 100644 --- a/gtk/gtkhruler.c +++ b/gtk/gtkhruler.c @@ -46,26 +46,28 @@ static void gtk_hruler_draw_ticks (GtkRuler *ruler); static void gtk_hruler_draw_pos (GtkRuler *ruler); -GtkType +GType gtk_hruler_get_type (void) { - static GtkType hruler_type = 0; + static GType hruler_type = 0; if (!hruler_type) { - static const GtkTypeInfo hruler_info = + static const GTypeInfo hruler_info = { - "GtkHRuler", - sizeof (GtkHRuler), sizeof (GtkHRulerClass), - (GtkClassInitFunc) gtk_hruler_class_init, - (GtkObjectInitFunc) gtk_hruler_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_hruler_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkHRuler), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_hruler_init, }; - hruler_type = gtk_type_unique (GTK_TYPE_RULER, &hruler_info); + hruler_type = g_type_register_static (GTK_TYPE_RULER, "GtkHRuler", + &hruler_info, 0); } return hruler_type; @@ -100,7 +102,7 @@ gtk_hruler_init (GtkHRuler *hruler) GtkWidget* gtk_hruler_new (void) { - return GTK_WIDGET (gtk_type_new (GTK_TYPE_HRULER)); + return g_object_new (GTK_TYPE_HRULER, NULL); } static gint @@ -266,7 +268,7 @@ gtk_hruler_draw_ticks (GtkRuler *ruler) } } - g_object_unref (G_OBJECT (layout)); + g_object_unref (layout); } static void @@ -300,12 +302,12 @@ gtk_hruler_draw_pos (GtkRuler *ruler) { /* If a backing store exists, restore the ruler */ if (ruler->backing_store && ruler->non_gr_exp_gc) - gdk_draw_pixmap (ruler->widget.window, - ruler->non_gr_exp_gc, - ruler->backing_store, - ruler->xsrc, ruler->ysrc, - ruler->xsrc, ruler->ysrc, - bs_width, bs_height); + gdk_draw_drawable (ruler->widget.window, + ruler->non_gr_exp_gc, + ruler->backing_store, + ruler->xsrc, ruler->ysrc, + ruler->xsrc, ruler->ysrc, + bs_width, bs_height); increment = (gdouble) width / (ruler->upper - ruler->lower); diff --git a/gtk/gtkhruler.h b/gtk/gtkhruler.h index 829665c62..3440d1b52 100644 --- a/gtk/gtkhruler.h +++ b/gtk/gtkhruler.h @@ -48,11 +48,11 @@ extern "C" { #define GTK_TYPE_HRULER (gtk_hruler_get_type ()) -#define GTK_HRULER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_HRULER, GtkHRuler)) -#define GTK_HRULER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_HRULER, GtkHRulerClass)) -#define GTK_IS_HRULER(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_HRULER)) -#define GTK_IS_HRULER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HRULER)) -#define GTK_HRULER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_HRULER, GtkHRulerClass)) +#define GTK_HRULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HRULER, GtkHRuler)) +#define GTK_HRULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HRULER, GtkHRulerClass)) +#define GTK_IS_HRULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HRULER)) +#define GTK_IS_HRULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HRULER)) +#define GTK_HRULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HRULER, GtkHRulerClass)) typedef struct _GtkHRuler GtkHRuler; @@ -69,7 +69,7 @@ struct _GtkHRulerClass }; -GtkType gtk_hruler_get_type (void) G_GNUC_CONST; +GType gtk_hruler_get_type (void) G_GNUC_CONST; GtkWidget* gtk_hruler_new (void); diff --git a/gtk/gtkruler.c b/gtk/gtkruler.c index 7553fec1c..67f126f27 100644 --- a/gtk/gtkruler.c +++ b/gtk/gtkruler.c @@ -63,26 +63,28 @@ static const GtkRulerMetric ruler_metrics[] = }; -GtkType +GType gtk_ruler_get_type (void) { - static GtkType ruler_type = 0; + static GType ruler_type = 0; if (!ruler_type) { - static const GtkTypeInfo ruler_info = + static const GTypeInfo ruler_info = { - "GtkRuler", - sizeof (GtkRuler), sizeof (GtkRulerClass), - (GtkClassInitFunc) gtk_ruler_class_init, - (GtkObjectInitFunc) gtk_ruler_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_ruler_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkRuler), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_ruler_init, }; - ruler_type = gtk_type_unique (GTK_TYPE_WIDGET, &ruler_info); + ruler_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkRuler", + &ruler_info, 0); } return ruler_type; @@ -92,14 +94,12 @@ static void gtk_ruler_class_init (GtkRulerClass *class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; GtkWidgetClass *widget_class; gobject_class = G_OBJECT_CLASS (class); - object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; - parent_class = gtk_type_class (GTK_TYPE_WIDGET); + parent_class = g_type_class_peek_parent (class); gobject_class->set_property = gtk_ruler_set_property; gobject_class->get_property = gtk_ruler_get_property; @@ -388,9 +388,9 @@ gtk_ruler_unrealize (GtkWidget *widget) GtkRuler *ruler = GTK_RULER (widget); if (ruler->backing_store) - gdk_pixmap_unref (ruler->backing_store); + g_object_unref (ruler->backing_store); if (ruler->non_gr_exp_gc) - gdk_gc_destroy (ruler->non_gr_exp_gc); + g_object_unref (ruler->non_gr_exp_gc); ruler->backing_store = NULL; ruler->non_gr_exp_gc = NULL; @@ -429,12 +429,12 @@ gtk_ruler_expose (GtkWidget *widget, gtk_ruler_draw_ticks (ruler); - gdk_draw_pixmap (widget->window, - ruler->non_gr_exp_gc, - ruler->backing_store, - 0, 0, 0, 0, - widget->allocation.width, - widget->allocation.height); + gdk_draw_drawable (widget->window, + ruler->non_gr_exp_gc, + ruler->backing_store, + 0, 0, 0, 0, + widget->allocation.width, + widget->allocation.height); gtk_ruler_draw_pos (ruler); } @@ -453,12 +453,12 @@ gtk_ruler_make_pixmap (GtkRuler *ruler) if (ruler->backing_store) { - gdk_window_get_size (ruler->backing_store, &width, &height); + gdk_drawable_get_size (ruler->backing_store, &width, &height); if ((width == widget->allocation.width) && (height == widget->allocation.height)) return; - gdk_pixmap_unref (ruler->backing_store); + g_object_unref (ruler->backing_store); } ruler->backing_store = gdk_pixmap_new (widget->window, diff --git a/gtk/gtkruler.h b/gtk/gtkruler.h index e515890dd..a27c69866 100644 --- a/gtk/gtkruler.h +++ b/gtk/gtkruler.h @@ -48,11 +48,11 @@ extern "C" { #define GTK_TYPE_RULER (gtk_ruler_get_type ()) -#define GTK_RULER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_RULER, GtkRuler)) -#define GTK_RULER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_RULER, GtkRulerClass)) -#define GTK_IS_RULER(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_RULER)) -#define GTK_IS_RULER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RULER)) -#define GTK_RULER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_RULER, GtkRulerClass)) +#define GTK_RULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RULER, GtkRuler)) +#define GTK_RULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RULER, GtkRulerClass)) +#define GTK_IS_RULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RULER)) +#define GTK_IS_RULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RULER)) +#define GTK_RULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RULER, GtkRulerClass)) typedef struct _GtkRuler GtkRuler; @@ -108,7 +108,7 @@ struct _GtkRulerMetric }; -GtkType gtk_ruler_get_type (void) G_GNUC_CONST; +GType gtk_ruler_get_type (void) G_GNUC_CONST; void gtk_ruler_set_metric (GtkRuler *ruler, GtkMetricType metric); void gtk_ruler_set_range (GtkRuler *ruler, diff --git a/gtk/gtkvruler.c b/gtk/gtkvruler.c index 978f62345..52d8bf2d8 100644 --- a/gtk/gtkvruler.c +++ b/gtk/gtkvruler.c @@ -46,26 +46,28 @@ static void gtk_vruler_draw_ticks (GtkRuler *ruler); static void gtk_vruler_draw_pos (GtkRuler *ruler); -GtkType +GType gtk_vruler_get_type (void) { - static GtkType vruler_type = 0; + static GType vruler_type = 0; if (!vruler_type) { - static const GtkTypeInfo vruler_info = + static const GTypeInfo vruler_info = { - "GtkVRuler", - sizeof (GtkVRuler), sizeof (GtkVRulerClass), - (GtkClassInitFunc) gtk_vruler_class_init, - (GtkObjectInitFunc) gtk_vruler_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_vruler_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkVRuler), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_vruler_init, }; - vruler_type = gtk_type_unique (GTK_TYPE_RULER, &vruler_info); + vruler_type = g_type_register_static (GTK_TYPE_RULER, "GtkVRuler", + &vruler_info, 0); } return vruler_type; @@ -99,7 +101,7 @@ gtk_vruler_init (GtkVRuler *vruler) GtkWidget* gtk_vruler_new (void) { - return GTK_WIDGET (gtk_type_new (GTK_TYPE_VRULER)); + return g_object_new (GTK_TYPE_VRULER, NULL); } @@ -267,7 +269,7 @@ gtk_vruler_draw_ticks (GtkRuler *ruler) } } - g_object_unref (G_OBJECT (layout)); + g_object_unref (layout); } @@ -302,12 +304,12 @@ gtk_vruler_draw_pos (GtkRuler *ruler) { /* If a backing store exists, restore the ruler */ if (ruler->backing_store && ruler->non_gr_exp_gc) - gdk_draw_pixmap (ruler->widget.window, - ruler->non_gr_exp_gc, - ruler->backing_store, - ruler->xsrc, ruler->ysrc, - ruler->xsrc, ruler->ysrc, - bs_width, bs_height); + gdk_draw_drawable (ruler->widget.window, + ruler->non_gr_exp_gc, + ruler->backing_store, + ruler->xsrc, ruler->ysrc, + ruler->xsrc, ruler->ysrc, + bs_width, bs_height); increment = (gdouble) height / (ruler->upper - ruler->lower); diff --git a/gtk/gtkvruler.h b/gtk/gtkvruler.h index e47db489e..ef626e690 100644 --- a/gtk/gtkvruler.h +++ b/gtk/gtkvruler.h @@ -48,11 +48,11 @@ extern "C" { #define GTK_TYPE_VRULER (gtk_vruler_get_type ()) -#define GTK_VRULER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_VRULER, GtkVRuler)) -#define GTK_VRULER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_VRULER, GtkVRulerClass)) -#define GTK_IS_VRULER(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_VRULER)) -#define GTK_IS_VRULER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VRULER)) -#define GTK_VRULER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_VRULER, GtkVRulerClass)) +#define GTK_VRULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_VRULER, GtkVRuler)) +#define GTK_VRULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_VRULER, GtkVRulerClass)) +#define GTK_IS_VRULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VRULER)) +#define GTK_IS_VRULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VRULER)) +#define GTK_VRULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VRULER, GtkVRulerClass)) typedef struct _GtkVRuler GtkVRuler; @@ -69,7 +69,7 @@ struct _GtkVRulerClass }; -GtkType gtk_vruler_get_type (void) G_GNUC_CONST; +GType gtk_vruler_get_type (void) G_GNUC_CONST; GtkWidget* gtk_vruler_new (void); |