Commit aa54cfee authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

Deprecation cleanup

Sun Oct 13 13:43:16 2002  Manish Singh  <yosh@gimp.org>

        * gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]
        gtk/gtkwidget.[ch] modules/input/gtkimcontextxim.c
        modules/input/imam-et.c modules/input/imcyrillic-translit.c
        modules/input/imhangul.c modules/input/iminuktitut.c
        modules/input/imipa.c modules/input/imthai-broken.c
        modules/input/imti-er.c modules/input/imti-et.c
        modules/input/imviqr.c: Deprecation cleanup

        * modules/input/Makefile.am: Added disable deprecation flags
parent c77265d3
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]
gtk/gtkwidget.[ch] modules/input/gtkimcontextxim.c
modules/input/imam-et.c modules/input/imcyrillic-translit.c
modules/input/imhangul.c modules/input/iminuktitut.c
modules/input/imipa.c modules/input/imthai-broken.c
modules/input/imti-er.c modules/input/imti-et.c
modules/input/imviqr.c: Deprecation cleanup
* modules/input/Makefile.am: Added disable deprecation flags
Sun Oct 13 12:29:15 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch]
......
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]
gtk/gtkwidget.[ch] modules/input/gtkimcontextxim.c
modules/input/imam-et.c modules/input/imcyrillic-translit.c
modules/input/imhangul.c modules/input/iminuktitut.c
modules/input/imipa.c modules/input/imthai-broken.c
modules/input/imti-er.c modules/input/imti-et.c
modules/input/imviqr.c: Deprecation cleanup
* modules/input/Makefile.am: Added disable deprecation flags
Sun Oct 13 12:29:15 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch]
......
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]
gtk/gtkwidget.[ch] modules/input/gtkimcontextxim.c
modules/input/imam-et.c modules/input/imcyrillic-translit.c
modules/input/imhangul.c modules/input/iminuktitut.c
modules/input/imipa.c modules/input/imthai-broken.c
modules/input/imti-er.c modules/input/imti-et.c
modules/input/imviqr.c: Deprecation cleanup
* modules/input/Makefile.am: Added disable deprecation flags
Sun Oct 13 12:29:15 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch]
......
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]
gtk/gtkwidget.[ch] modules/input/gtkimcontextxim.c
modules/input/imam-et.c modules/input/imcyrillic-translit.c
modules/input/imhangul.c modules/input/iminuktitut.c
modules/input/imipa.c modules/input/imthai-broken.c
modules/input/imti-er.c modules/input/imti-et.c
modules/input/imviqr.c: Deprecation cleanup
* modules/input/Makefile.am: Added disable deprecation flags
Sun Oct 13 12:29:15 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch]
......
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]
gtk/gtkwidget.[ch] modules/input/gtkimcontextxim.c
modules/input/imam-et.c modules/input/imcyrillic-translit.c
modules/input/imhangul.c modules/input/iminuktitut.c
modules/input/imipa.c modules/input/imthai-broken.c
modules/input/imti-er.c modules/input/imti-et.c
modules/input/imviqr.c: Deprecation cleanup
* modules/input/Makefile.am: Added disable deprecation flags
Sun Oct 13 12:29:15 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch]
......
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]
gtk/gtkwidget.[ch] modules/input/gtkimcontextxim.c
modules/input/imam-et.c modules/input/imcyrillic-translit.c
modules/input/imhangul.c modules/input/iminuktitut.c
modules/input/imipa.c modules/input/imthai-broken.c
modules/input/imti-er.c modules/input/imti-et.c
modules/input/imviqr.c: Deprecation cleanup
* modules/input/Makefile.am: Added disable deprecation flags
Sun Oct 13 12:29:15 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch]
......
......@@ -33,7 +33,6 @@
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkradiobutton.h"
#include "gtksignal.h"
#include "gtktable.h"
#include "gtkintl.h"
......@@ -78,26 +77,28 @@ static gint gtk_curve_graph_events (GtkWidget *widget,
GtkCurve *c);
static void gtk_curve_size_graph (GtkCurve *curve);
GtkType
GType
gtk_curve_get_type (void)
{
static GtkType curve_type = 0;
static GType curve_type = 0;
if (!curve_type)
{
static const GtkTypeInfo curve_info =
static const GTypeInfo curve_info =
{
"GtkCurve",
sizeof (GtkCurve),
sizeof (GtkCurveClass),
(GtkClassInitFunc) gtk_curve_class_init,
(GtkObjectInitFunc) gtk_curve_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gtk_curve_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkCurve),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_curve_init,
};
curve_type = gtk_type_unique (GTK_TYPE_DRAWING_AREA, &curve_info);
curve_type = g_type_register_static (GTK_TYPE_DRAWING_AREA, "GtkCurve",
&curve_info, 0);
}
return curve_type;
}
......@@ -106,9 +107,8 @@ static void
gtk_curve_class_init (GtkCurveClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
parent_class = gtk_type_class (GTK_TYPE_DRAWING_AREA);
parent_class = g_type_class_peek_parent (class);
gobject_class->finalize = gtk_curve_finalize;
......@@ -166,9 +166,13 @@ gtk_curve_class_init (GtkCurveClass *class)
G_PARAM_WRITABLE));
curve_type_changed_signal =
gtk_signal_new ("curve_type_changed", GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkCurveClass, curve_type_changed),
_gtk_marshal_VOID__VOID, GTK_TYPE_NONE, 0);
g_signal_new ("curve_type_changed",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkCurveClass, curve_type_changed),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
static void
......@@ -195,8 +199,8 @@ gtk_curve_init (GtkCurve *curve)
old_mask = gtk_widget_get_events (GTK_WIDGET (curve));
gtk_widget_set_events (GTK_WIDGET (curve), old_mask | GRAPH_MASK);
gtk_signal_connect (GTK_OBJECT (curve), "event",
(GtkSignalFunc) gtk_curve_graph_events, curve);
g_signal_connect (curve, "event",
G_CALLBACK (gtk_curve_graph_events), curve);
gtk_curve_size_graph (curve);
}
......@@ -416,8 +420,8 @@ gtk_curve_draw (GtkCurve *c, gint width, gint height)
gdk_draw_arc (c->pixmap, style->fg_gc[state], TRUE, x, y,
RADIUS * 2, RADIUS*2, 0, 360*64);
}
gdk_draw_pixmap (GTK_WIDGET (c)->window, style->fg_gc[state], c->pixmap,
0, 0, 0, 0, width + RADIUS * 2, height + RADIUS * 2);
gdk_draw_drawable (GTK_WIDGET (c)->window, style->fg_gc[state], c->pixmap,
0, 0, 0, 0, width + RADIUS * 2, height + RADIUS * 2);
}
static gint
......@@ -465,8 +469,8 @@ gtk_curve_graph_events (GtkWidget *widget, GdkEvent *event, GtkCurve *c)
{
case GDK_CONFIGURE:
if (c->pixmap)
gdk_pixmap_unref (c->pixmap);
c->pixmap = 0;
g_object_unref (c->pixmap);
c->pixmap = NULL;
/* fall through */
case GDK_EXPOSE:
if (!c->pixmap)
......@@ -655,7 +659,7 @@ gtk_curve_graph_events (GtkWidget *widget, GdkEvent *event, GtkCurve *c)
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (w),
c->cursor_type);
gdk_window_set_cursor (w->window, cursor);
gdk_cursor_destroy (cursor);
gdk_cursor_unref (cursor);
}
retval = TRUE;
break;
......@@ -712,7 +716,7 @@ gtk_curve_set_curve_type (GtkCurve *c, GtkCurveType new_type)
c->curve_type = new_type;
gtk_curve_interpolate (c, width, height);
}
gtk_signal_emit (GTK_OBJECT (c), curve_type_changed_signal);
g_signal_emit (c, curve_type_changed_signal, 0);
g_object_notify (G_OBJECT (c), "curve_type");
gtk_curve_draw (c, width, height);
}
......@@ -738,8 +742,9 @@ gtk_curve_size_graph (GtkCurve *curve)
else
height = width / aspect;
gtk_drawing_area_size (GTK_DRAWING_AREA (curve),
width + RADIUS * 2, height + RADIUS * 2);
gtk_widget_set_size_request (GTK_WIDGET (curve),
width + RADIUS * 2,
height + RADIUS * 2);
}
static void
......@@ -785,7 +790,7 @@ gtk_curve_reset (GtkCurve *c)
if (old_type != GTK_CURVE_TYPE_SPLINE)
{
gtk_signal_emit (GTK_OBJECT (c), curve_type_changed_signal);
g_signal_emit (c, curve_type_changed_signal, 0);
g_object_notify (G_OBJECT (c), "curve_type");
}
}
......@@ -818,7 +823,7 @@ gtk_curve_set_gamma (GtkCurve *c, gfloat gamma)
}
if (old_type != GTK_CURVE_TYPE_FREE)
gtk_signal_emit (GTK_OBJECT (c), curve_type_changed_signal);
g_signal_emit (c, curve_type_changed_signal, 0);
gtk_curve_draw (c, c->num_points, c->height);
}
......@@ -890,7 +895,7 @@ gtk_curve_set_vector (GtkCurve *c, int veclen, gfloat vector[])
}
if (old_type != GTK_CURVE_TYPE_FREE)
{
gtk_signal_emit (GTK_OBJECT (c), curve_type_changed_signal);
g_signal_emit (c, curve_type_changed_signal, 0);
g_object_notify (G_OBJECT (c), "curve_type");
}
......@@ -1017,7 +1022,7 @@ gtk_curve_get_vector (GtkCurve *c, int veclen, gfloat vector[])
GtkWidget*
gtk_curve_new (void)
{
return gtk_type_new (gtk_curve_get_type ());
return g_object_new (GTK_TYPE_CURVE, NULL);
}
static void
......@@ -1029,7 +1034,7 @@ gtk_curve_finalize (GObject *object)
curve = GTK_CURVE (object);
if (curve->pixmap)
gdk_pixmap_unref (curve->pixmap);
g_object_unref (curve->pixmap);
if (curve->point)
g_free (curve->point);
if (curve->ctlpoint)
......
......@@ -47,11 +47,11 @@ extern "C" {
#define GTK_TYPE_CURVE (gtk_curve_get_type ())
#define GTK_CURVE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CURVE, GtkCurve))
#define GTK_CURVE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CURVE, GtkCurveClass))
#define GTK_IS_CURVE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CURVE))
#define GTK_IS_CURVE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CURVE))
#define GTK_CURVE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_CURVE, GtkCurveClass))
#define GTK_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CURVE, GtkCurve))
#define GTK_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CURVE, GtkCurveClass))
#define GTK_IS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CURVE))
#define GTK_IS_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CURVE))
#define GTK_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CURVE, GtkCurveClass))
typedef struct _GtkCurve GtkCurve;
......@@ -96,7 +96,7 @@ struct _GtkCurveClass
};
GtkType gtk_curve_get_type (void) G_GNUC_CONST;
GType gtk_curve_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_curve_new (void);
void gtk_curve_reset (GtkCurve *curve);
void gtk_curve_set_gamma (GtkCurve *curve, gfloat gamma);
......
......@@ -34,11 +34,10 @@
#include "gtkdrawingarea.h"
#include "gtkentry.h"
#include "gtkhbox.h"
#include "gtkimage.h"
#include "gtklabel.h"
#include "gtkmain.h"
#include "gtkpixmap.h"
#include "gtkradiobutton.h"
#include "gtksignal.h"
#include "gtkstock.h"
#include "gtktable.h"
#include "gtkvbox.h"
......@@ -212,26 +211,28 @@ static const char *xpm[][27] =
}
};
GtkType
GType
gtk_gamma_curve_get_type (void)
{
static GtkType gamma_curve_type = 0;
static GType gamma_curve_type = 0;
if (!gamma_curve_type)
{
static const GtkTypeInfo gamma_curve_info =
static const GTypeInfo gamma_curve_info =
{
"GtkGammaCurve",
sizeof (GtkGammaCurve),
sizeof (GtkGammaCurveClass),
(GtkClassInitFunc) gtk_gamma_curve_class_init,
(GtkObjectInitFunc) gtk_gamma_curve_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gtk_gamma_curve_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkGammaCurve),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_gamma_curve_init,
};
gamma_curve_type = gtk_type_unique (GTK_TYPE_VBOX, &gamma_curve_info);
gamma_curve_type = g_type_register_static (GTK_TYPE_VBOX, "GtkGammaCurve",
&gamma_curve_info, 0);
}
return gamma_curve_type;
}
......@@ -241,7 +242,7 @@ gtk_gamma_curve_class_init (GtkGammaCurveClass *class)
{
GtkObjectClass *object_class;
parent_class = gtk_type_class (GTK_TYPE_VBOX);
parent_class = g_type_class_peek_parent (class);
object_class = (GtkObjectClass *) class;
object_class->destroy = gtk_gamma_curve_destroy;
......@@ -260,8 +261,8 @@ gtk_gamma_curve_init (GtkGammaCurve *curve)
gtk_container_add (GTK_CONTAINER (curve), curve->table);
curve->curve = gtk_curve_new ();
gtk_signal_connect (GTK_OBJECT (curve->curve), "curve_type_changed",
(GtkSignalFunc) curve_type_changed_callback, curve);
g_signal_connect (curve->curve, "curve_type_changed",
G_CALLBACK (curve_type_changed_callback), curve);
gtk_table_attach_defaults (GTK_TABLE (curve->table), curve->curve, 0, 1, 0, 1);
vbox = gtk_vbox_new (/* homogeneous */ FALSE, /* spacing */ 3);
......@@ -271,13 +272,13 @@ gtk_gamma_curve_init (GtkGammaCurve *curve)
for (i = 0; i < 3; ++i)
{
curve->button[i] = gtk_toggle_button_new ();
gtk_object_set_data (GTK_OBJECT (curve->button[i]), "_GtkGammaCurveIndex",
GINT_TO_POINTER (i));
g_object_set_data (G_OBJECT (curve->button[i]), "_GtkGammaCurveIndex",
GINT_TO_POINTER (i));
gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]);
gtk_signal_connect (GTK_OBJECT (curve->button[i]), "realize",
(GtkSignalFunc) button_realize_callback, 0);
gtk_signal_connect (GTK_OBJECT (curve->button[i]), "toggled",
(GtkSignalFunc) button_toggled_callback, curve);
g_signal_connect (curve->button[i], "realize",
G_CALLBACK (button_realize_callback), NULL);
g_signal_connect (curve->button[i], "toggled",
G_CALLBACK (button_toggled_callback), curve);
gtk_widget_show (curve->button[i]);
}
......@@ -285,13 +286,13 @@ gtk_gamma_curve_init (GtkGammaCurve *curve)
for (i = 3; i < 5; ++i)
{
curve->button[i] = gtk_button_new ();
gtk_object_set_data (GTK_OBJECT (curve->button[i]), "_GtkGammaCurveIndex",
GINT_TO_POINTER (i));
g_object_set_data (G_OBJECT (curve->button[i]), "_GtkGammaCurveIndex",
GINT_TO_POINTER (i));
gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]);
gtk_signal_connect (GTK_OBJECT (curve->button[i]), "realize",
(GtkSignalFunc) button_realize_callback, 0);
gtk_signal_connect (GTK_OBJECT (curve->button[i]), "clicked",
(GtkSignalFunc) button_clicked_callback, curve);
g_signal_connect (curve->button[i], "realize",
G_CALLBACK (button_realize_callback), NULL);
g_signal_connect (curve->button[i], "clicked",
G_CALLBACK (button_clicked_callback), curve);
gtk_widget_show (curve->button[i]);
}
......@@ -308,16 +309,16 @@ button_realize_callback (GtkWidget *w)
GdkPixmap *pm;
int i;
i = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (w), "_GtkGammaCurveIndex"));
i = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "_GtkGammaCurveIndex"));
pm = gdk_pixmap_create_from_xpm_d (w->window, &mask,
&w->style->bg[GTK_STATE_NORMAL], (gchar **)xpm[i]);
pixmap = gtk_pixmap_new (pm, mask);
pixmap = gtk_image_new_from_pixmap (pm, mask);
gtk_container_add (GTK_CONTAINER (w), pixmap);
gtk_widget_show (pixmap);
gdk_pixmap_unref (pm);
gdk_bitmap_unref (mask); /* a bitmap is really just a special pixmap */
g_object_unref (pm);
g_object_unref (mask);
}
static void
......@@ -330,7 +331,7 @@ button_toggled_callback (GtkWidget *w, gpointer data)
if (!GTK_TOGGLE_BUTTON (w)->active)
return;
active = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (w), "_GtkGammaCurveIndex"));
active = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "_GtkGammaCurveIndex"));
for (i = 0; i < 3; ++i)
if ((i != active) && GTK_TOGGLE_BUTTON (c->button[i])->active)
......@@ -381,7 +382,7 @@ button_clicked_callback (GtkWidget *w, gpointer data)
GtkGammaCurve *c = data;
int active;
active = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (w), "_GtkGammaCurveIndex"));
active = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "_GtkGammaCurveIndex"));
if (active == 3)
{
/* set gamma */
......@@ -420,15 +421,15 @@ button_clicked_callback (GtkWidget *w, gpointer data)
hbox = GTK_DIALOG (c->gamma_dialog)->action_area;
button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gamma_cancel_callback, c);
g_signal_connect (button, "clicked",
G_CALLBACK (gamma_cancel_callback), c);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_widget_show (button);
button = gtk_button_new_from_stock (GTK_STOCK_OK);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gamma_ok_callback, c);
g_signal_connect (button, "clicked",
G_CALLBACK (gamma_ok_callback), c);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
gtk_widget_show (button);
......@@ -464,7 +465,7 @@ curve_type_changed_callback (GtkWidget *w, gpointer data)
GtkWidget*
gtk_gamma_curve_new (void)
{
return gtk_type_new (GTK_TYPE_GAMMA_CURVE);
return g_object_new (GTK_TYPE_GAMMA_CURVE, NULL);
}
static void
......
......@@ -48,11 +48,11 @@ extern "C" {
#define GTK_TYPE_GAMMA_CURVE (gtk_gamma_curve_get_type ())
#define GTK_GAMMA_CURVE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurve))
#define GTK_GAMMA_CURVE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass))
#define GTK_IS_GAMMA_CURVE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_GAMMA_CURVE))
#define GTK_IS_GAMMA_CURVE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_GAMMA_CURVE))
#define GTK_GAMMA_CURVE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass))
#define GTK_GAMMA_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurve))
#define GTK_GAMMA_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass))
#define GTK_IS_GAMMA_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_GAMMA_CURVE))
#define GTK_IS_GAMMA_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_GAMMA_CURVE))
#define GTK_GAMMA_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass))
typedef struct _GtkGammaCurve GtkGammaCurve;
typedef struct _GtkGammaCurveClass GtkGammaCurveClass;
......@@ -83,7 +83,7 @@ struct _GtkGammaCurveClass
};
GtkType gtk_gamma_curve_get_type (void) G_GNUC_CONST;
GType gtk_gamma_curve_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_gamma_curve_new (void);
......
......@@ -31,7 +31,6 @@
#include "gdkconfig.h"
#include "gtklayout.h"
#include "gtksignal.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
......@@ -208,39 +207,43 @@ gtk_layout_set_adjustments (GtkLayout *layout,
if (layout->hadjustment && (layout->hadjustment != hadj))
{
gtk_signal_disconnect_by_data (GTK_OBJECT (layout->hadjustment), layout);
gtk_object_unref (GTK_OBJECT (layout->hadjustment));
g_signal_handlers_disconnect_by_func (layout->hadjustment,
gtk_layout_adjustment_changed,
layout);
g_object_unref (layout->hadjustment);
}
if (layout->vadjustment && (layout->vadjustment != vadj))
{
gtk_signal_disconnect_by_data (GTK_OBJECT (layout->vadjustment), layout);
gtk_object_unref (GTK_OBJECT (layout->vadjustment));
g_signal_handlers_disconnect_by_func (layout->vadjustment,
gtk_layout_adjustment_changed,
layout);
g_object_unref (layout->vadjustment);
}
if (layout->hadjustment != hadj)
{
layout->hadjustment = hadj;
gtk_object_ref (GTK_OBJECT (layout->hadjustment));
g_object_ref (layout->hadjustment);
gtk_object_sink (GTK_OBJECT (layout->hadjustment));
gtk_layout_set_adjustment_upper (layout->hadjustment, layout->width, FALSE);
gtk_signal_connect (GTK_OBJECT (layout->hadjustment), "value_changed",
(GtkSignalFunc) gtk_layout_adjustment_changed,
layout);
g_signal_connect (layout->hadjustment, "value_changed",
G_CALLBACK (gtk_layout_adjustment_changed),
layout);
need_adjust = TRUE;
}
if (layout->vadjustment != vadj)
{
layout->vadjustment = vadj;
gtk_object_ref (GTK_OBJECT (layout->vadjustment));
g_object_ref (layout->vadjustment);
gtk_object_sink (GTK_OBJECT (layout->vadjustment));
gtk_layout_set_adjustment_upper (layout->vadjustment, layout->height, FALSE);
gtk_signal_connect (GTK_OBJECT (layout->vadjustment), "value_changed",
(GtkSignalFunc) gtk_layout_adjustment_changed,
layout);
g_signal_connect (layout->vadjustment, "value_changed",
G_CALLBACK (gtk_layout_adjustment_changed),
layout);
need_adjust = TRUE;
}
......@@ -255,8 +258,8 @@ gtk_layout_finalize (GObject *object)
{
GtkLayout *layout = GTK_LAYOUT (object);
gtk_object_unref (GTK_OBJECT (layout->hadjustment));
gtk_object_unref (GTK_OBJECT (layout->vadjustment));
g_object_unref (layout->hadjustment);
g_object_unref (layout->vadjustment);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
......@@ -442,9 +445,9 @@ gtk_layout_set_adjustment_upper (GtkAdjustment *adj,
}
if (changed || always_emit_changed)
gtk_signal_emit_by_name (GTK_OBJECT (adj), "changed");
gtk_adjustment_changed (adj);
if (value_changed)
gtk_signal_emit_by_name (GTK_OBJECT (adj), "value_changed");
gtk_adjustment_value_changed (adj);
}
/**
......@@ -542,33 +545,40 @@ gtk_layout_thaw (GtkLayout *layout)
g_return_if_fail (GTK_IS_LAYOUT (layout));
if (layout->freeze_count)
if (!(--layout->freeze_count))
gtk_widget_draw (GTK_WIDGET (layout), NULL);
{
if (!(--layout->freeze_count))
{
gtk_widget_queue_draw (GTK_WIDGET (layout));
gdk_window_process_updates (GTK_WIDGET (layout)->window, TRUE);
}
}
}
/* Basic Object handling procedures
*/
GtkType
GType
gtk_layout_get_type (void)
{
static GtkType layout_type = 0;
static GType layout_type = 0;
if (!layout_type)
{
static const GTypeInfo layout_info =
{
sizeof (GtkLayoutClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gtk_layout_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkLayout),
16, /* n_preallocs */
0, /* n_preallocs */
(GInstanceInitFunc) gtk_layout_init,
};
layout_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkLayout", &layout_info, 0);
layout_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkLayout",
&layout_info, 0);
}
return layout_type;
......@@ -578,16 +588,14 @@ static void
gtk_layout_class_init (GtkLayoutClass *class)
{
GObjectClass *gobject_class;
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
gobject_class = (GObjectClass*) class;
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class;
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
parent_class = g_type_class_peek_parent (class);
gobject_class->set_property = gtk_layout_set_property;
gobject_class->get_property = gtk_layout_get_property;
......@@ -665,12 +673,15 @@ gtk_layout_class_init (GtkLayoutClass *class)
class->set_scroll_adjustments = gtk_layout_set_adjustments;
widget_class->set_scroll_adjustments_signal =
gtk_signal_new ("set_scroll_adjustments",
GTK_RUN_LAST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkLayoutClass, set_scroll_adjustments),
_gtk_marshal_VOID__OBJECT_OBJECT,
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
g_signal_new ("set_scroll_adjustments",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkLayoutClass, set_scroll_adjustments),
NULL, NULL,
_gtk_marshal_VOID__OBJECT_OBJECT,
G_TYPE_NONE, 2,
GTK_TYPE_ADJUSTMENT,
GTK_TYPE_ADJUSTMENT);
}
static void
......
......@@ -41,11 +41,11 @@ extern "C" {
#define GTK_TYPE_LAYOUT (gtk_layout_get_type ())
#define GTK_LAYOUT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_LAYOUT, GtkLayout))
#define GTK_LAYOUT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LAYOUT, GtkLayoutClass))
#define GTK_IS_LAYOUT(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_LAYOUT))
#define GTK_IS_LAYOUT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LAYOUT))
#define GTK_LAYOUT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_LAYOUT, GtkLayoutClass))
#define GTK_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LAYOUT, GtkLayout))
#define GTK_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LAYOUT, GtkLayoutClass))
#define GTK_IS_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LAYOUT))
#define GTK_IS_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LAYOUT))
#define GTK_LAYOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LAYOUT, GtkLayoutClass))
typedef struct _GtkLayout GtkLayout;
......@@ -89,7 +89,7 @@ struct _GtkLayoutClass
void (*_gtk_reserved4) (void);
};
GtkType gtk_layout_get_type (void) G_GNUC_CONST;
GType gtk_layout_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_layout_new (GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
void gtk_layout_put (GtkLayout *layout,
......
This diff is collapsed.
......@@ -90,11 +90,11 @@ typedef enum
* Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET.
*/
#define GTK_TYPE_WIDGET (gtk_widget_get_type ())
#define GTK_WIDGET(widget) (GTK_CHECK_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
#define GTK_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass))
#define GTK_IS_WIDGET(widget) (GTK_CHECK_TYPE ((widget), GTK_TYPE_WIDGET))
#define GTK_IS_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
#define GTK_WIDGET_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass))
#define GTK_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
#define GTK_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass))
#define GTK_IS_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_TYPE ((widget), GTK_TYPE_WIDGET))
#define GTK_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
#define GTK_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass))
/* Macros for extracting various fields from GtkWidget and GtkWidgetClass.
*/
......@@ -426,8 +426,8 @@ struct _GtkWidgetShapeInfo
GdkBitmap *shape_mask;
};
GtkType gtk_widget_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_widget_new (GtkType type,
GType gtk_widget_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_widget_new (GType type,
const gchar *first_property_name,
...);
GtkWidget* gtk_widget_ref (GtkWidget *widget);
......@@ -576,7 +576,7 @@ void gtk_widget_set_extension_events (GtkWidget *widget,
GdkExtensionMode gtk_widget_get_extension_events (GtkWidget *widget);
GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget);
GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget,
GtkType widget_type);