forked from AuroraMiddleware/gtk
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
This commit is contained in:
parent
2aa8991477
commit
2ffa58f11d
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
48
gtk/gtkbin.c
48
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
|
||||
|
12
gtk/gtkbin.h
12
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);
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user