aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-17 07:42:18 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-17 07:42:18 +0800
commit183eb85406f50023f3b31b30d320457b2484cce2 (patch)
treee0c03171b903ea39bea0db241ed48e9d1993d268 /widgets
parent6e93dd6be8cdf45628a9799e7e6c9cb84af49156 (diff)
downloadgsoc2013-evolution-183eb85406f50023f3b31b30d320457b2484cce2.tar
gsoc2013-evolution-183eb85406f50023f3b31b30d320457b2484cce2.tar.gz
gsoc2013-evolution-183eb85406f50023f3b31b30d320457b2484cce2.tar.bz2
gsoc2013-evolution-183eb85406f50023f3b31b30d320457b2484cce2.tar.lz
gsoc2013-evolution-183eb85406f50023f3b31b30d320457b2484cce2.tar.xz
gsoc2013-evolution-183eb85406f50023f3b31b30d320457b2484cce2.tar.zst
gsoc2013-evolution-183eb85406f50023f3b31b30d320457b2484cce2.zip
lots of GObject work.
2002-11-16 Chris Toshok <toshok@ximian.com> * gal/widgets/color-group.c: lots of GObject work. * gal/widgets/color-palette.[ch]: same. * gal/widgets/e-canvas-backgruond.[ch]: same. * gal/widgets/e-canvas-vbox.[ch]: same. * gal/widgets/e-canvas.[ch]: same. * e-categories-master-list-array.[ch]: same. * e-categories-master-list-combo.[ch]: same. * e-categories-master-list-dialog-model.[ch]: same. * e-categories-master-list-dialog.[ch]: same. * e-categories-master-list-option-menu.[ch]: same. * e-categories-master-list.[ch]: same. * e-categories.[ch]: same. * e-file-selection.[ch]: same. * e-gui-utils.c: same. * e-hscrollbar.[ch]: same. * e-option-menu.[ch]: same. * e-popup-menu.[ch]: same. * e-printable.[ch]: same. * e-reflow-sorted.[ch]: same. * e-reflow.[ch]: same. * e-scroll-frame.[ch]: same. * e-vscrollbar.[ch]: same. * gtk-combo-box.[ch]: same. * gtk-combo-stack.[ch]: same. * gtk-combo-text.[ch]: same. * test-e-font.c: same. * widget-color-combo.[ch]: same. * widget-pixmap-combo.[ch]: same. svn path=/trunk/; revision=18798
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-canvas-background.c219
-rw-r--r--widgets/misc/e-canvas-background.h8
-rw-r--r--widgets/misc/e-canvas-vbox.c174
-rw-r--r--widgets/misc/e-canvas-vbox.h8
-rw-r--r--widgets/misc/e-canvas.c120
-rw-r--r--widgets/misc/e-canvas.h8
-rw-r--r--widgets/misc/e-gui-utils.c22
-rw-r--r--widgets/misc/e-popup-menu.c6
-rw-r--r--widgets/misc/e-printable.c161
-rw-r--r--widgets/misc/e-printable.h8
-rw-r--r--widgets/misc/e-reflow.c252
-rw-r--r--widgets/misc/e-reflow.h8
12 files changed, 508 insertions, 486 deletions
diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c
index ff09ce0e1d..4ae2be5e77 100644
--- a/widgets/misc/e-canvas-background.c
+++ b/widgets/misc/e-canvas-background.c
@@ -33,6 +33,7 @@
#include "gal/widgets/e-canvas.h"
#include "gal/widgets/e-canvas-utils.h"
#include "gal/util/e-util.h"
+#include "gal/util/e-i18n.h"
#include <string.h>
#define PARENT_OBJECT_TYPE gnome_canvas_item_get_type ()
@@ -55,15 +56,15 @@ struct _ECanvasBackgroundPrivate {
static GnomeCanvasItemClass *parent_class;
enum {
- ARG_0,
- ARG_FILL_COLOR,
- ARG_FILL_COLOR_GDK,
- ARG_FILL_COLOR_RGBA,
- ARG_FILL_STIPPLE,
- ARG_X1,
- ARG_X2,
- ARG_Y1,
- ARG_Y2,
+ PROP_0,
+ PROP_FILL_COLOR,
+ PROP_FILL_COLOR_GDK,
+ PROP_FILL_COLOR_RGBA,
+ PROP_FILL_STIPPLE,
+ PROP_X1,
+ PROP_X2,
+ PROP_Y1,
+ PROP_Y2,
};
static void
@@ -168,7 +169,7 @@ set_stipple (ECanvasBackground *ecb, GdkBitmap *stipple, int use_value)
}
static void
-ecb_destroy (GtkObject *object)
+ecb_dispose (GObject *object)
{
ECanvasBackground *ecb = E_CANVAS_BACKGROUND (object);
@@ -176,12 +177,15 @@ ecb_destroy (GtkObject *object)
gdk_bitmap_unref (ecb->priv->stipple);
ecb->priv->stipple = NULL;
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ if (G_OBJECT_CLASS (parent_class)->dispose)
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
-ecb_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
+ecb_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GnomeCanvasItem *item;
ECanvasBackground *ecb;
@@ -190,13 +194,13 @@ ecb_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
GdkColor *pcolor;
gboolean color_changed = FALSE;
- item = GNOME_CANVAS_ITEM (o);
- ecb = E_CANVAS_BACKGROUND (o);
+ item = GNOME_CANVAS_ITEM (object);
+ ecb = E_CANVAS_BACKGROUND (object);
- switch (arg_id){
- case ARG_FILL_COLOR:
- if (GTK_VALUE_STRING (*arg))
- gdk_color_parse (GTK_VALUE_STRING (*arg), &color);
+ switch (prop_id){
+ case PROP_FILL_COLOR:
+ if (g_value_get_string (value))
+ gdk_color_parse (g_value_get_string (value), &color);
ecb->priv->rgba = ((color.red & 0xff00) << 16 |
(color.green & 0xff00) << 8 |
@@ -205,8 +209,8 @@ ecb_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
color_changed = TRUE;
break;
- case ARG_FILL_COLOR_GDK:
- pcolor = GTK_VALUE_BOXED (*arg);
+ case PROP_FILL_COLOR_GDK:
+ pcolor = g_value_get_pointer (value);
if (pcolor) {
color = *pcolor;
}
@@ -218,29 +222,29 @@ ecb_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
color_changed = TRUE;
break;
- case ARG_FILL_COLOR_RGBA:
- ecb->priv->rgba = GTK_VALUE_UINT (*arg);
+ case PROP_FILL_COLOR_RGBA:
+ ecb->priv->rgba = g_value_get_uint (value);
color.red = ((ecb->priv->rgba >> 24) & 0xff) * 0x101;
color.green = ((ecb->priv->rgba >> 16) & 0xff) * 0x101;
color.blue = ((ecb->priv->rgba >> 8) & 0xff) * 0x101;
color_changed = TRUE;
break;
- case ARG_FILL_STIPPLE:
- set_stipple (ecb, GTK_VALUE_BOXED (*arg), TRUE);
+ case PROP_FILL_STIPPLE:
+ set_stipple (ecb, g_value_get_object (value), TRUE);
break;
- case ARG_X1:
- ecb->priv->x1 = GTK_VALUE_DOUBLE (*arg);
+ case PROP_X1:
+ ecb->priv->x1 = g_value_get_double (value);
break;
- case ARG_X2:
- ecb->priv->x2 = GTK_VALUE_DOUBLE (*arg);
+ case PROP_X2:
+ ecb->priv->x2 = g_value_get_double (value);
break;
- case ARG_Y1:
- ecb->priv->y1 = GTK_VALUE_DOUBLE (*arg);
+ case PROP_Y1:
+ ecb->priv->y1 = g_value_get_double (value);
break;
- case ARG_Y2:
- ecb->priv->y2 = GTK_VALUE_DOUBLE (*arg);
+ case PROP_Y2:
+ ecb->priv->y2 = g_value_get_double (value);
break;
}
@@ -260,38 +264,41 @@ ecb_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
}
static void
-ecb_get_arg (GtkObject *o, GtkArg *arg, guint arg_id)
+ecb_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GnomeCanvasItem *item;
ECanvasBackground *ecb;
- item = GNOME_CANVAS_ITEM (o);
- ecb = E_CANVAS_BACKGROUND (o);
+ item = GNOME_CANVAS_ITEM (object);
+ ecb = E_CANVAS_BACKGROUND (object);
- switch (arg_id){
- case ARG_FILL_COLOR_GDK:
- GTK_VALUE_BOXED (*arg) = gdk_color_copy (&ecb->priv->color);
+ switch (prop_id){
+ case PROP_FILL_COLOR_GDK:
+ g_value_set_pointer (value, gdk_color_copy (&ecb->priv->color));
break;
- case ARG_FILL_COLOR_RGBA:
- GTK_VALUE_UINT (*arg) = ecb->priv->rgba;
+ case PROP_FILL_COLOR_RGBA:
+ g_value_set_uint (value, ecb->priv->rgba);
break;
- case ARG_FILL_STIPPLE:
- GTK_VALUE_BOXED (*arg) = ecb->priv->stipple;
+ case PROP_FILL_STIPPLE:
+ g_value_set_object (value, ecb->priv->stipple);
break;
- case ARG_X1:
- GTK_VALUE_DOUBLE (*arg) = ecb->priv->x1;
+ case PROP_X1:
+ g_value_set_double (value, ecb->priv->x1);
break;
- case ARG_X2:
- GTK_VALUE_DOUBLE (*arg) = ecb->priv->x2;
+ case PROP_X2:
+ g_value_set_double (value, ecb->priv->x2);
break;
- case ARG_Y1:
- GTK_VALUE_DOUBLE (*arg) = ecb->priv->y1;
+ case PROP_Y1:
+ g_value_set_double (value, ecb->priv->y1);
break;
- case ARG_Y2:
- GTK_VALUE_DOUBLE (*arg) = ecb->priv->y2;
+ case PROP_Y2:
+ g_value_set_double (value, ecb->priv->y2);
break;
default:
- arg->type = GTK_TYPE_INVALID;
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@@ -403,15 +410,15 @@ ecb_point (GnomeCanvasItem *item, double x, double y, int cx, int cy,
}
static void
-ecb_class_init (GtkObjectClass *object_class)
+ecb_class_init (GObjectClass *object_class)
{
GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class;
- parent_class = gtk_type_class (PARENT_OBJECT_TYPE);
+ parent_class = g_type_class_ref (PARENT_OBJECT_TYPE);
- object_class->destroy = ecb_destroy;
- object_class->set_arg = ecb_set_arg;
- object_class->get_arg = ecb_get_arg;
+ object_class->dispose = ecb_dispose;
+ object_class->set_property = ecb_set_property;
+ object_class->get_property = ecb_get_property;
item_class->update = ecb_update;
item_class->realize = ecb_realize;
@@ -419,43 +426,65 @@ ecb_class_init (GtkObjectClass *object_class)
item_class->draw = ecb_draw;
item_class->point = ecb_point;
- gtk_object_add_arg_type ("ECanvasBackground::fill_color", GTK_TYPE_STRING,
- GTK_ARG_WRITABLE, ARG_FILL_COLOR);
- gtk_object_add_arg_type ("ECanvasBackground::fill_color_gdk", GDK_TYPE_COLOR,
- GTK_ARG_READWRITE, ARG_FILL_COLOR_GDK);
- gtk_object_add_arg_type ("ECanvasBackground::fill_color_rgba", GTK_TYPE_UINT,
- GTK_ARG_READWRITE, ARG_FILL_COLOR_RGBA);
- gtk_object_add_arg_type ("ECanvasBackground::fill_stipple", GDK_TYPE_WINDOW,
- GTK_ARG_READWRITE, ARG_FILL_STIPPLE);
- gtk_object_add_arg_type ("ECanvasBackground::x1", GTK_TYPE_DOUBLE,
- GTK_ARG_READWRITE, ARG_X1);
- gtk_object_add_arg_type ("ECanvasBackground::x2", GTK_TYPE_DOUBLE,
- GTK_ARG_READWRITE, ARG_X2);
- gtk_object_add_arg_type ("ECanvasBackground::y1", GTK_TYPE_DOUBLE,
- GTK_ARG_READWRITE, ARG_Y1);
- gtk_object_add_arg_type ("ECanvasBackground::y2", GTK_TYPE_DOUBLE,
- GTK_ARG_READWRITE, ARG_Y2);
+ g_object_class_install_property (object_class, PROP_FILL_COLOR,
+ g_param_spec_string ("fill_color",
+ _( "Fill color" ),
+ _( "Fill color" ),
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_FILL_COLOR_GDK,
+ g_param_spec_pointer ("fill_color_gdk",
+ _( "GDK fill color" ),
+ _( "GDK fill color" ),
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_FILL_COLOR_RGBA,
+ g_param_spec_uint ("fill_color_rgba",
+ _( "GDK fill color" ),
+ _( "GDK fill color" ),
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_FILL_STIPPLE,
+ g_param_spec_object ("fill_stipple",
+ _( "Fill stipple" ),
+ _( "FIll stipple" ),
+ GDK_TYPE_WINDOW,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_X1,
+ g_param_spec_double ("x1",
+ _( "X1" ),
+ _( "X1" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_X2,
+ g_param_spec_double ("x2",
+ _( "X2" ),
+ _( "X2" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_Y1,
+ g_param_spec_double ("y1",
+ _( "Y1" ),
+ _( "Y1" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_Y2,
+ g_param_spec_double ("y2",
+ _( "Y2" ),
+ _( "Y2" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
}
-GtkType
-e_canvas_background_get_type (void)
-{
- static GtkType type = 0;
-
- if (!type){
- GtkTypeInfo info = {
- "ECanvasBackground",
- sizeof (ECanvasBackground),
- sizeof (ECanvasBackgroundClass),
- (GtkClassInitFunc) ecb_class_init,
- (GtkObjectInitFunc) ecb_init,
- NULL, /* reserved 1 */
- NULL, /* reserved 2 */
- (GtkClassInitFunc) NULL
- };
-
- type = gtk_type_unique (PARENT_OBJECT_TYPE, &info);
- }
-
- return type;
-}
+E_MAKE_TYPE (e_canvas_background,
+ "ECanvasBackground",
+ ECanvasBackground,
+ ecb_class_init,
+ ecb_init,
+ PARENT_OBJECT_TYPE)
diff --git a/widgets/misc/e-canvas-background.h b/widgets/misc/e-canvas-background.h
index b4da6d679a..4a8e3294fb 100644
--- a/widgets/misc/e-canvas-background.h
+++ b/widgets/misc/e-canvas-background.h
@@ -43,10 +43,10 @@ G_BEGIN_DECLS
#define E_CANVAS_BACKGROUND_TYPE (e_canvas_background_get_type ())
-#define E_CANVAS_BACKGROUND(obj) (GTK_CHECK_CAST ((obj), E_CANVAS_BACKGROUND_TYPE, ECanvasBackground))
-#define E_CANVAS_BACKGROUND_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CANVAS_BACKGROUND_TYPE, ECanvasBackgroundClass))
-#define E_IS_CANVAS_BACKGROUND(obj) (GTK_CHECK_TYPE ((obj), E_CANVAS_BACKGROUND_TYPE))
-#define E_IS_CANVAS_BACKGROUND_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_CANVAS_BACKGROUND_TYPE))
+#define E_CANVAS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_CANVAS_BACKGROUND_TYPE, ECanvasBackground))
+#define E_CANVAS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_CANVAS_BACKGROUND_TYPE, ECanvasBackgroundClass))
+#define E_IS_CANVAS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_CANVAS_BACKGROUND_TYPE))
+#define E_IS_CANVAS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_CANVAS_BACKGROUND_TYPE))
typedef struct _ECanvasBackground ECanvasBackground;
typedef struct _ECanvasBackgroundClass ECanvasBackgroundClass;
diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c
index 8ed70d0be9..354da5d872 100644
--- a/widgets/misc/e-canvas-vbox.c
+++ b/widgets/misc/e-canvas-vbox.c
@@ -29,12 +29,13 @@
#include "e-canvas-utils.h"
#include "e-canvas.h"
#include "gal/util/e-util.h"
+#include "gal/util/e-i18n.h"
static void e_canvas_vbox_init (ECanvasVbox *CanvasVbox);
static void e_canvas_vbox_class_init (ECanvasVboxClass *klass);
-static void e_canvas_vbox_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
-static void e_canvas_vbox_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
-static void e_canvas_vbox_destroy (GtkObject *object);
+static void e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
+static void e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void e_canvas_vbox_dispose (GObject *object);
static gint e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event);
static void e_canvas_vbox_realize (GnomeCanvasItem *item);
@@ -45,72 +46,71 @@ static void e_canvas_vbox_real_add_item(ECanvasVbox *e_canvas_vbox, GnomeCanvasI
static void e_canvas_vbox_real_add_item_start(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item);
static void e_canvas_vbox_resize_children (GnomeCanvasItem *item);
+#define PARENT_TYPE GNOME_TYPE_CANVAS_GROUP
static GnomeCanvasGroupClass *parent_class = NULL;
/* The arguments we take */
enum {
- ARG_0,
- ARG_WIDTH,
- ARG_MINIMUM_WIDTH,
- ARG_HEIGHT,
- ARG_SPACING
+ PROP_0,
+ PROP_WIDTH,
+ PROP_MINIMUM_WIDTH,
+ PROP_HEIGHT,
+ PROP_SPACING
};
-GtkType
-e_canvas_vbox_get_type (void)
-{
- static GtkType type = 0;
-
- if (!type)
- {
- static const GtkTypeInfo info =
- {
- "ECanvasVbox",
- sizeof (ECanvasVbox),
- sizeof (ECanvasVboxClass),
- (GtkClassInitFunc) e_canvas_vbox_class_init,
- (GtkObjectInitFunc) e_canvas_vbox_init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- type = gtk_type_unique (gnome_canvas_group_get_type (), &info);
- }
-
- return type;
-}
+E_MAKE_TYPE (e_canvas_vbox,
+ "ECanvasVbox",
+ ECanvasVbox,
+ e_canvas_vbox_class_init,
+ e_canvas_vbox_init,
+ PARENT_TYPE)
static void
e_canvas_vbox_class_init (ECanvasVboxClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- object_class = (GtkObjectClass*) klass;
+ object_class = (GObjectClass*) klass;
item_class = (GnomeCanvasItemClass *) klass;
- parent_class = gtk_type_class (gnome_canvas_group_get_type ());
-
- gtk_object_add_arg_type ("ECanvasVbox::width", GTK_TYPE_DOUBLE,
- GTK_ARG_READWRITE, ARG_WIDTH);
- gtk_object_add_arg_type ("ECanvasVbox::minimum_width", GTK_TYPE_DOUBLE,
- GTK_ARG_READWRITE, ARG_MINIMUM_WIDTH);
- gtk_object_add_arg_type ("ECanvasVbox::height", GTK_TYPE_DOUBLE,
- GTK_ARG_READABLE, ARG_HEIGHT);
- gtk_object_add_arg_type ("ECanvasVbox::spacing", GTK_TYPE_DOUBLE,
- GTK_ARG_READWRITE, ARG_SPACING);
+ parent_class = g_type_class_ref (PARENT_TYPE);
klass->add_item = e_canvas_vbox_real_add_item;
klass->add_item_start = e_canvas_vbox_real_add_item_start;
- object_class->set_arg = e_canvas_vbox_set_arg;
- object_class->get_arg = e_canvas_vbox_get_arg;
- object_class->destroy = e_canvas_vbox_destroy;
+ object_class->set_property = e_canvas_vbox_set_property;
+ object_class->get_property = e_canvas_vbox_get_property;
+ object_class->dispose = e_canvas_vbox_dispose;
/* GnomeCanvasItem method overrides */
item_class->event = e_canvas_vbox_event;
item_class->realize = e_canvas_vbox_realize;
+
+ g_object_class_install_property (object_class, PROP_WIDTH,
+ g_param_spec_double ("width",
+ _( "Width" ),
+ _( "Width" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
+ g_param_spec_double ("minimum_width",
+ _( "Minimum width" ),
+ _( "Minimum Width" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_HEIGHT,
+ g_param_spec_double ("height",
+ _( "Height" ),
+ _( "Height" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READABLE));
+ g_object_class_install_property (object_class, PROP_SPACING,
+ g_param_spec_double ("spacing",
+ _( "Spacing" ),
+ _( "Spacing" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
}
static void
@@ -127,50 +127,50 @@ e_canvas_vbox_init (ECanvasVbox *vbox)
}
static void
-e_canvas_vbox_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
+e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GnomeCanvasItem *item;
ECanvasVbox *e_canvas_vbox;
- item = GNOME_CANVAS_ITEM (o);
- e_canvas_vbox = E_CANVAS_VBOX (o);
+ item = GNOME_CANVAS_ITEM (object);
+ e_canvas_vbox = E_CANVAS_VBOX (object);
- switch (arg_id){
- case ARG_WIDTH:
- case ARG_MINIMUM_WIDTH:
- e_canvas_vbox->minimum_width = GTK_VALUE_DOUBLE (*arg);
+ switch (prop_id){
+ case PROP_WIDTH:
+ case PROP_MINIMUM_WIDTH:
+ e_canvas_vbox->minimum_width = g_value_get_double (value);
e_canvas_vbox_resize_children(item);
e_canvas_item_request_reflow(item);
break;
- case ARG_SPACING:
- e_canvas_vbox->spacing = GTK_VALUE_DOUBLE (*arg);
+ case PROP_SPACING:
+ e_canvas_vbox->spacing = g_value_get_double (value);
e_canvas_item_request_reflow(item);
break;
}
}
static void
-e_canvas_vbox_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
ECanvasVbox *e_canvas_vbox;
e_canvas_vbox = E_CANVAS_VBOX (object);
- switch (arg_id) {
- case ARG_WIDTH:
- GTK_VALUE_DOUBLE (*arg) = e_canvas_vbox->width;
+ switch (prop_id) {
+ case PROP_WIDTH:
+ g_value_set_double (value, e_canvas_vbox->width);
break;
- case ARG_MINIMUM_WIDTH:
- GTK_VALUE_DOUBLE (*arg) = e_canvas_vbox->minimum_width;
+ case PROP_MINIMUM_WIDTH:
+ g_value_set_double (value, e_canvas_vbox->minimum_width);
break;
- case ARG_HEIGHT:
- GTK_VALUE_DOUBLE (*arg) = e_canvas_vbox->height;
+ case PROP_HEIGHT:
+ g_value_set_double (value, e_canvas_vbox->height);
break;
- case ARG_SPACING:
- GTK_VALUE_DOUBLE (*arg) = e_canvas_vbox->spacing;
+ case PROP_SPACING:
+ g_value_set_double (value, e_canvas_vbox->spacing);
break;
default:
- arg->type = GTK_TYPE_INVALID;
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@@ -185,11 +185,14 @@ disconnect_item_cb (gpointer data, gpointer user_data)
vbox = E_CANVAS_VBOX (user_data);
item = GNOME_CANVAS_ITEM (data);
- gtk_signal_disconnect_by_data (GTK_OBJECT (item), vbox);
+ g_signal_handlers_disconnect_matched (item,
+ G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL,
+ vbox);
}
static void
-e_canvas_vbox_destroy (GtkObject *object)
+e_canvas_vbox_dispose (GObject *object)
{
ECanvasVbox *vbox = E_CANVAS_VBOX(object);
@@ -198,8 +201,8 @@ e_canvas_vbox_destroy (GtkObject *object)
g_list_free(vbox->items);
vbox->items = NULL;
}
-
- GTK_OBJECT_CLASS(parent_class)->destroy (object);
+
+ G_OBJECT_CLASS(parent_class)->dispose (object);
}
static gint
@@ -250,17 +253,18 @@ e_canvas_vbox_realize (GnomeCanvasItem *item)
}
static void
-e_canvas_vbox_remove_item (GnomeCanvasItem *item, ECanvasVbox *vbox)
+e_canvas_vbox_remove_item (gpointer data, GObject *where_object_was)
{
- vbox->items = g_list_remove(vbox->items, item);
+ ECanvasVbox *vbox = data;
+ vbox->items = g_list_remove(vbox->items, where_object_was);
}
static void
e_canvas_vbox_real_add_item(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item)
{
e_canvas_vbox->items = g_list_append(e_canvas_vbox->items, item);
- gtk_signal_connect(GTK_OBJECT(item), "destroy",
- GTK_SIGNAL_FUNC(e_canvas_vbox_remove_item), e_canvas_vbox);
+ g_object_weak_ref (G_OBJECT (item),
+ e_canvas_vbox_remove_item, e_canvas_vbox);
if ( GTK_OBJECT_FLAGS( e_canvas_vbox ) & GNOME_CANVAS_ITEM_REALIZED ) {
gnome_canvas_item_set(item,
"width", (double) e_canvas_vbox->minimum_width,
@@ -274,8 +278,8 @@ static void
e_canvas_vbox_real_add_item_start(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item)
{
e_canvas_vbox->items = g_list_prepend(e_canvas_vbox->items, item);
- gtk_signal_connect(GTK_OBJECT(item), "destroy",
- GTK_SIGNAL_FUNC(e_canvas_vbox_remove_item), e_canvas_vbox);
+ g_object_weak_ref (G_OBJECT (item),
+ e_canvas_vbox_remove_item, e_canvas_vbox);
if ( GTK_OBJECT_FLAGS( e_canvas_vbox ) & GNOME_CANVAS_ITEM_REALIZED ) {
gnome_canvas_item_set(item,
"width", (double) e_canvas_vbox->minimum_width,
@@ -323,10 +327,10 @@ e_canvas_vbox_reflow( GnomeCanvasItem *item, int flags )
gdouble item_width;
list = e_canvas_vbox->items;
- gtk_object_get (GTK_OBJECT(list->data),
- "height", &item_height,
- "width", &item_width,
- NULL);
+ g_object_get (list->data,
+ "height", &item_height,
+ "width", &item_width,
+ NULL);
e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(list->data),
(double) 0,
(double) running_height);
@@ -338,10 +342,10 @@ e_canvas_vbox_reflow( GnomeCanvasItem *item, int flags )
for( ; list; list = g_list_next(list)) {
running_height += e_canvas_vbox->spacing;
- gtk_object_get (GTK_OBJECT(list->data),
- "height", &item_height,
- "width", &item_width,
- NULL);
+ g_object_get (list->data,
+ "height", &item_height,
+ "width", &item_width,
+ NULL);
e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(list->data),
(double) 0,
diff --git a/widgets/misc/e-canvas-vbox.h b/widgets/misc/e-canvas-vbox.h
index eaf671f671..7d80e7c056 100644
--- a/widgets/misc/e-canvas-vbox.h
+++ b/widgets/misc/e-canvas-vbox.h
@@ -44,10 +44,10 @@ extern "C" {
*/
#define E_CANVAS_VBOX_TYPE (e_canvas_vbox_get_type ())
-#define E_CANVAS_VBOX(obj) (GTK_CHECK_CAST ((obj), E_CANVAS_VBOX_TYPE, ECanvasVbox))
-#define E_CANVAS_VBOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CANVAS_VBOX_TYPE, ECanvasVboxClass))
-#define E_IS_CANVAS_VBOX(obj) (GTK_CHECK_TYPE ((obj), E_CANVAS_VBOX_TYPE))
-#define E_IS_CANVAS_VBOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_CANVAS_VBOX_TYPE))
+#define E_CANVAS_VBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_CANVAS_VBOX_TYPE, ECanvasVbox))
+#define E_CANVAS_VBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_CANVAS_VBOX_TYPE, ECanvasVboxClass))
+#define E_IS_CANVAS_VBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_CANVAS_VBOX_TYPE))
+#define E_IS_CANVAS_VBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_CANVAS_VBOX_TYPE))
typedef struct _ECanvasVbox ECanvasVbox;
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index 3a88a81c41..310ae9a01a 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -28,7 +28,7 @@
#include <gtk/gtkmain.h>
static void e_canvas_init (ECanvas *card);
-static void e_canvas_destroy (GtkObject *object);
+static void e_canvas_dispose (GObject *object);
static void e_canvas_class_init (ECanvasClass *klass);
static void e_canvas_realize (GtkWidget *widget);
static void e_canvas_unrealize (GtkWidget *widget);
@@ -51,6 +51,7 @@ static void e_canvas_style_set (GtkWidget *widget,
static int emit_event (GnomeCanvas *canvas, GdkEvent *event);
+#define PARENT_TYPE GNOME_TYPE_CANVAS
static GnomeCanvasClass *parent_class = NULL;
#define d(x)
@@ -62,45 +63,27 @@ enum {
static guint e_canvas_signals [LAST_SIGNAL] = { 0, };
-GtkType
-e_canvas_get_type (void)
-{
- static GtkType canvas_type = 0;
-
- if (!canvas_type)
- {
- static const GtkTypeInfo canvas_info =
- {
- "ECanvas",
- sizeof (ECanvas),
- sizeof (ECanvasClass),
- (GtkClassInitFunc) e_canvas_class_init,
- (GtkObjectInitFunc) e_canvas_init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- canvas_type = gtk_type_unique (gnome_canvas_get_type (), &canvas_info);
- }
-
- return canvas_type;
-}
+E_MAKE_TYPE (e_canvas,
+ "ECanvas",
+ ECanvas,
+ e_canvas_class_init,
+ e_canvas_init,
+ PARENT_TYPE)
static void
e_canvas_class_init (ECanvasClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
GnomeCanvasClass *canvas_class;
GtkWidgetClass *widget_class;
- object_class = (GtkObjectClass*) klass;
+ object_class = (GObjectClass*) klass;
canvas_class = (GnomeCanvasClass *) klass;
widget_class = (GtkWidgetClass *) klass;
- parent_class = gtk_type_class (gnome_canvas_get_type ());
+ parent_class = g_type_class_ref (PARENT_TYPE);
- object_class->destroy = e_canvas_destroy;
+ object_class->dispose = e_canvas_dispose;
widget_class->key_press_event = e_canvas_key;
widget_class->key_release_event = e_canvas_key;
@@ -115,14 +98,13 @@ e_canvas_class_init (ECanvasClass *klass)
klass->reflow = NULL;
e_canvas_signals [REFLOW] =
- gtk_signal_new ("reflow",
- GTK_RUN_LAST,
- E_OBJECT_CLASS_TYPE (object_class),
- GTK_SIGNAL_OFFSET (ECanvasClass, reflow),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
- E_OBJECT_CLASS_ADD_SIGNALS (object_class, e_canvas_signals, LAST_SIGNAL);
+ g_signal_new ("reflow",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ECanvasClass, reflow),
+ NULL, NULL,
+ e_marshal_NONE__NONE,
+ G_TYPE_NONE, 0);
}
static void
@@ -138,7 +120,7 @@ e_canvas_init (ECanvas *canvas)
}
static void
-e_canvas_destroy (GtkObject *object)
+e_canvas_dispose (GObject *object)
{
ECanvas *canvas = E_CANVAS(object);
@@ -148,8 +130,8 @@ e_canvas_destroy (GtkObject *object)
if (canvas->toplevel) {
if (canvas->visibility_notify_id)
- gtk_signal_disconnect (GTK_OBJECT(canvas->toplevel),
- canvas->visibility_notify_id);
+ g_signal_handler_disconnect (canvas->toplevel,
+ canvas->visibility_notify_id);
canvas->visibility_notify_id = 0;
g_object_unref (canvas->toplevel);
@@ -158,14 +140,14 @@ e_canvas_destroy (GtkObject *object)
e_canvas_hide_tooltip(canvas);
- if ((GTK_OBJECT_CLASS (parent_class))->destroy)
- (*(GTK_OBJECT_CLASS (parent_class))->destroy) (object);
+ if ((G_OBJECT_CLASS (parent_class))->dispose)
+ (*(G_OBJECT_CLASS (parent_class))->dispose) (object);
}
GtkWidget *
e_canvas_new ()
{
- return GTK_WIDGET (gtk_type_new (e_canvas_get_type ()));
+ return GTK_WIDGET (g_object_new (E_CANVAS_TYPE, NULL));
}
@@ -273,9 +255,9 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
while (item && !finished) {
g_object_ref (item);
- gtk_signal_emit_by_name (GTK_OBJECT (item), "event",
- &ev,
- &finished);
+ g_signal_emit_by_name (item, "event",
+ &ev,
+ &finished);
#ifndef NO_WARNINGS
#warning FIXME - needs thought
@@ -684,12 +666,12 @@ e_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event)
static void
ec_style_set_recursive (GnomeCanvasItem *item, GtkStyle *previous_style)
{
- guint signal_id = gtk_signal_lookup ("style_set", GTK_OBJECT_TYPE (item));
+ guint signal_id = g_signal_lookup ("style_set", G_OBJECT_TYPE (item));
if (signal_id >= 1) {
GSignalQuery query;
g_signal_query (signal_id, &query);
if (query.return_type == GTK_TYPE_NONE && query.n_params == 1 && query.param_types[0] == GTK_TYPE_STYLE) {
- gtk_signal_emit (GTK_OBJECT (item), signal_id, previous_style);
+ g_signal_emit (item, signal_id, 0, previous_style);
}
}
@@ -820,8 +802,8 @@ e_canvas_item_invoke_reflow (GnomeCanvasItem *item, int flags)
if (item->object.flags & E_CANVAS_ITEM_NEEDS_REFLOW) {
ECanvasItemReflowFunc func;
func = (ECanvasItemReflowFunc)
- gtk_object_get_data (GTK_OBJECT (item),
- "ECanvasItem::reflow_callback");
+ g_object_get_data (G_OBJECT (item),
+ "ECanvasItem::reflow_callback");
if (func)
func (item, flags);
}
@@ -851,8 +833,8 @@ idle_handler (gpointer data)
/* Reset idle id */
canvas->idle_id = 0;
- gtk_signal_emit (GTK_OBJECT (canvas),
- e_canvas_signals [REFLOW]);
+ g_signal_emit (canvas,
+ e_canvas_signals [REFLOW], 0);
GDK_THREADS_LEAVE();
@@ -901,20 +883,20 @@ e_canvas_item_request_parent_reflow (GnomeCanvasItem *item)
void
e_canvas_item_set_reflow_callback (GnomeCanvasItem *item, ECanvasItemReflowFunc func)
{
- gtk_object_set_data(GTK_OBJECT(item), "ECanvasItem::reflow_callback", (gpointer) func);
+ g_object_set_data(G_OBJECT(item), "ECanvasItem::reflow_callback", (gpointer) func);
}
void
e_canvas_item_set_selection_callback (GnomeCanvasItem *item, ECanvasItemSelectionFunc func)
{
- gtk_object_set_data(GTK_OBJECT(item), "ECanvasItem::selection_callback", (gpointer) func);
+ g_object_set_data(G_OBJECT(item), "ECanvasItem::selection_callback", (gpointer) func);
}
void
e_canvas_item_set_selection_compare_callback (GnomeCanvasItem *item, ECanvasItemSelectionCompareFunc func)
{
- gtk_object_set_data(GTK_OBJECT(item), "ECanvasItem::selection_compare_callback", (gpointer) func);
+ g_object_set_data(G_OBJECT(item), "ECanvasItem::selection_compare_callback", (gpointer) func);
}
void
@@ -937,7 +919,8 @@ e_canvas_item_set_cursor (GnomeCanvasItem *item, gpointer id)
for (list = canvas->selection; list; list = g_list_next(list)) {
info = list->data;
- func = (ECanvasItemSelectionFunc)gtk_object_get_data(GTK_OBJECT(info->item), "ECanvasItem::selection_callback");
+ func = (ECanvasItemSelectionFunc)g_object_get_data(G_OBJECT(info->item),
+ "ECanvasItem::selection_callback");
if (func)
func(info->item, flags, info->id);
g_message ("ECANVAS: free info (2): item %p, id %p",
@@ -958,7 +941,8 @@ e_canvas_item_set_cursor (GnomeCanvasItem *item, gpointer id)
g_message ("ECANVAS: new info item %p, id %p", item, id);
flags = E_CANVAS_ITEM_SELECTION_SELECT | E_CANVAS_ITEM_SELECTION_CURSOR;
- func = (ECanvasItemSelectionFunc)gtk_object_get_data(GTK_OBJECT(item), "ECanvasItem::selection_callback");
+ func = (ECanvasItemSelectionFunc)g_object_get_data(G_OBJECT(item),
+ "ECanvasItem::selection_callback");
if (func)
func(item, flags, id);
@@ -989,7 +973,8 @@ e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id)
canvas = E_CANVAS(item->canvas);
if (canvas->cursor) {
- func = (ECanvasItemSelectionFunc)gtk_object_get_data(GTK_OBJECT(canvas->cursor->item), "ECanvasItem::selection_callback");
+ func = (ECanvasItemSelectionFunc)g_object_get_data(G_OBJECT(canvas->cursor->item),
+ "ECanvasItem::selection_callback");
if (func)
func(canvas->cursor->item, flags, canvas->cursor->id);
}
@@ -1004,11 +989,13 @@ e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id)
if (search->item == item) {
ECanvasItemSelectionCompareFunc compare_func;
- compare_func = (ECanvasItemSelectionCompareFunc)gtk_object_get_data(GTK_OBJECT(search->item), "ECanvasItem::selection_compare_callback");
+ compare_func = (ECanvasItemSelectionCompareFunc)g_object_get_data(G_OBJECT(search->item),
+ "ECanvasItem::selection_compare_callback");
if (compare_func(search->item, search->id, id, 0) == 0) {
canvas->cursor = search;
- func = (ECanvasItemSelectionFunc)gtk_object_get_data(GTK_OBJECT(item), "ECanvasItem::selection_callback");
+ func = (ECanvasItemSelectionFunc)g_object_get_data(G_OBJECT(item),
+ "ECanvasItem::selection_callback");
if (func)
func(item, flags, search->id);
return;
@@ -1022,7 +1009,8 @@ e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id)
info->id = id;
g_message ("ECANVAS: new info (2): item %p, id %p", item, id);
- func = (ECanvasItemSelectionFunc)gtk_object_get_data(GTK_OBJECT(item), "ECanvasItem::selection_callback");
+ func = (ECanvasItemSelectionFunc)g_object_get_data(G_OBJECT(item),
+ "ECanvasItem::selection_callback");
if (func)
func(item, flags, id);
@@ -1051,11 +1039,13 @@ e_canvas_item_remove_selection (GnomeCanvasItem *item, gpointer id)
if (info->item == item) {
ECanvasItemSelectionCompareFunc compare_func;
- compare_func = (ECanvasItemSelectionCompareFunc)gtk_object_get_data(GTK_OBJECT(info->item), "ECanvasItem::selection_compare_callback");
+ compare_func = (ECanvasItemSelectionCompareFunc)g_object_get_data(G_OBJECT(info->item),
+ "ECanvasItem::selection_compare_callback");
if (compare_func(info->item, info->id, id, 0) == 0) {
ECanvasItemSelectionFunc func;
- func = (ECanvasItemSelectionFunc) gtk_object_get_data(GTK_OBJECT(info->item), "ECanvasItem::selection_callback");
+ func = (ECanvasItemSelectionFunc) g_object_get_data(G_OBJECT(info->item),
+ "ECanvasItem::selection_callback");
if (func)
func(info->item, flags, info->id);
canvas->selection = g_list_remove_link(canvas->selection, list);
@@ -1087,8 +1077,8 @@ void e_canvas_popup_tooltip (ECanvas *canvas, GtkWidget *widget, int x, int y)
gtk_widget_add_events(canvas->toplevel, GDK_VISIBILITY_NOTIFY_MASK);
g_object_ref (canvas->toplevel);
canvas->visibility_notify_id =
- gtk_signal_connect (GTK_OBJECT (canvas->toplevel), "visibility_notify_event",
- GTK_SIGNAL_FUNC (e_canvas_visibility), canvas);
+ g_signal_connect (canvas->toplevel, "visibility_notify_event",
+ G_CALLBACK (e_canvas_visibility), canvas);
}
}
gtk_widget_set_uposition (widget, x, y);
diff --git a/widgets/misc/e-canvas.h b/widgets/misc/e-canvas.h
index 2cda185ef3..5cdcc4ab90 100644
--- a/widgets/misc/e-canvas.h
+++ b/widgets/misc/e-canvas.h
@@ -36,10 +36,10 @@ extern "C" {
*/
#define E_CANVAS_TYPE (e_canvas_get_type ())
-#define E_CANVAS(obj) (GTK_CHECK_CAST ((obj), E_CANVAS_TYPE, ECanvas))
-#define E_CANVAS_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CANVAS_TYPE, ECanvasClass))
-#define E_IS_CANVAS(obj) (GTK_CHECK_TYPE ((obj), E_CANVAS_TYPE))
-#define E_IS_CANVAS_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_CANVAS_TYPE))
+#define E_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_CANVAS_TYPE, ECanvas))
+#define E_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_CANVAS_TYPE, ECanvasClass))
+#define E_IS_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_CANVAS_TYPE))
+#define E_IS_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_CANVAS_TYPE))
typedef void (*ECanvasItemReflowFunc) (GnomeCanvasItem *item,
gint flags);
diff --git a/widgets/misc/e-gui-utils.c b/widgets/misc/e-gui-utils.c
index 4e37fcc47b..9c66c70f1e 100644
--- a/widgets/misc/e-gui-utils.c
+++ b/widgets/misc/e-gui-utils.c
@@ -65,8 +65,8 @@ e_auto_kill_popup_menu_on_hide (GtkMenu *menu)
g_return_if_fail (menu != NULL);
g_return_if_fail (GTK_IS_MENU (menu));
- gtk_signal_connect (GTK_OBJECT (menu), "hide",
- GTK_SIGNAL_FUNC (kill_popup_menu), menu);
+ g_signal_connect (menu, "hide",
+ G_CALLBACK (kill_popup_menu), menu);
}
void
@@ -118,7 +118,7 @@ static void
e_container_change_tab_order_destroy_notify(gpointer data)
{
GList *list = data;
- g_list_foreach(list, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach(list, (GFunc) g_object_unref, NULL);
g_list_free(list);
}
@@ -162,8 +162,7 @@ e_container_change_tab_order_callback(GtkContainer *container,
GTK_IS_CONTAINER (child) &&
!GTK_WIDGET_HAS_FOCUS (child))
if (gtk_widget_child_focus (GTK_WIDGET (child), direction)) {
- gtk_signal_emit_stop_by_name (
- GTK_OBJECT (container), "focus");
+ g_signal_stop_emission_by_name (container, "focus");
return TRUE;
}
}
@@ -171,14 +170,13 @@ e_container_change_tab_order_callback(GtkContainer *container,
else if (GTK_WIDGET_DRAWABLE (child)) {
if (GTK_IS_CONTAINER (child)) {
if (gtk_widget_child_focus (GTK_WIDGET (child), direction)) {
- gtk_signal_emit_stop_by_name (
- GTK_OBJECT (container), "focus");
+ g_signal_stop_emission_by_name (container, "focus");
return TRUE;
}
}
else if (GTK_WIDGET_CAN_FOCUS (child)) {
gtk_widget_grab_focus (child);
- gtk_signal_emit_stop_by_name (GTK_OBJECT (container), "focus");
+ g_signal_stop_emission_by_name (container, "focus");
return TRUE;
}
}
@@ -192,7 +190,7 @@ e_container_change_tab_order(GtkContainer *container, GList *widgets)
{
GList *list;
list = g_list_copy(widgets);
- g_list_foreach(list, (GFunc) gtk_object_ref, NULL);
+ g_list_foreach(list, (GFunc) g_object_ref, NULL);
return gtk_signal_connect_full(GTK_OBJECT(container), "focus",
GTK_SIGNAL_FUNC(e_container_change_tab_order_callback),
NULL, list,
@@ -232,15 +230,15 @@ e_container_focus_nth_entry(GtkContainer *container, int n)
}
gboolean
-e_glade_xml_connect_widget (GladeXML *gui, char *name, char *signal, GtkSignalFunc cb, gpointer closure)
+e_glade_xml_connect_widget (GladeXML *gui, char *name, char *signal, GCallback cb, gpointer closure)
{
GtkWidget *widget;
widget = glade_xml_get_widget (gui, name);
if (widget) {
- gtk_signal_connect (GTK_OBJECT (widget), signal,
- cb, closure);
+ g_signal_connect (widget, signal,
+ cb, closure);
return TRUE;
}
diff --git a/widgets/misc/e-popup-menu.c b/widgets/misc/e-popup-menu.c
index e3a8ec20ab..b8745625ca 100644
--- a/widgets/misc/e-popup-menu.c
+++ b/widgets/misc/e-popup-menu.c
@@ -128,9 +128,9 @@ e_popup_menu_create_with_domain (EPopupMenu *menu_list,
if (!menu_list[i].submenu) {
if (menu_list[i].fn)
- gtk_signal_connect (GTK_OBJECT (item), "activate",
- GTK_SIGNAL_FUNC (menu_list[i].fn),
- menu_list[i].use_custom_closure ? menu_list[i].closure : default_closure);
+ g_signal_connect (item, "activate",
+ G_CALLBACK (menu_list[i].fn),
+ menu_list[i].use_custom_closure ? menu_list[i].closure : default_closure);
} else {
/* submenu */
GtkMenu *submenu;
diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c
index e0134e06f5..534f153823 100644
--- a/widgets/misc/e-printable.c
+++ b/widgets/misc/e-printable.c
@@ -28,7 +28,7 @@
#define EP_CLASS(e) ((EPrintableClass *)((GtkObject *)e)->klass)
-#define PARENT_TYPE gtk_object_get_type ()
+#define PARENT_TYPE GTK_TYPE_OBJECT
static GtkObjectClass *e_printable_parent_class;
@@ -48,52 +48,55 @@ static void
e_printable_class_init (GtkObjectClass *object_class)
{
EPrintableClass *klass = E_PRINTABLE_CLASS(object_class);
- e_printable_parent_class = gtk_type_class (PARENT_TYPE);
+ e_printable_parent_class = g_type_class_ref (PARENT_TYPE);
e_printable_signals [PRINT_PAGE] =
- gtk_signal_new ("print_page",
- GTK_RUN_LAST,
- E_OBJECT_CLASS_TYPE (object_class),
- GTK_SIGNAL_OFFSET (EPrintableClass, print_page),
- e_marshal_NONE__OBJECT_DOUBLE_DOUBLE_BOOLEAN,
- G_TYPE_NONE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE,
- G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
+ g_signal_new ("print_page",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EPrintableClass, print_page),
+ NULL, NULL,
+ e_marshal_NONE__OBJECT_DOUBLE_DOUBLE_BOOLEAN,
+ G_TYPE_NONE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE,
+ G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
e_printable_signals [DATA_LEFT] =
- gtk_signal_new ("data_left",
- GTK_RUN_LAST,
- E_OBJECT_CLASS_TYPE (object_class),
- GTK_SIGNAL_OFFSET (EPrintableClass, data_left),
- e_marshal_BOOLEAN__NONE,
- G_TYPE_BOOLEAN, 0, G_TYPE_NONE);
+ g_signal_new ("data_left",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EPrintableClass, data_left),
+ NULL, NULL,
+ e_marshal_BOOLEAN__NONE,
+ G_TYPE_BOOLEAN, 0, G_TYPE_NONE);
e_printable_signals [RESET] =
- gtk_signal_new ("reset",
- GTK_RUN_LAST,
- E_OBJECT_CLASS_TYPE (object_class),
- GTK_SIGNAL_OFFSET (EPrintableClass, reset),
- gtk_marshal_NONE__NONE,
- G_TYPE_NONE, 0, G_TYPE_NONE);
+ g_signal_new ("reset",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EPrintableClass, reset),
+ NULL, NULL,
+ e_marshal_NONE__NONE,
+ G_TYPE_NONE, 0, G_TYPE_NONE);
e_printable_signals [HEIGHT] =
- gtk_signal_new ("height",
- GTK_RUN_LAST,
- E_OBJECT_CLASS_TYPE (object_class),
- GTK_SIGNAL_OFFSET (EPrintableClass, height),
- e_marshal_DOUBLE__OBJECT_DOUBLE_DOUBLE_BOOLEAN,
- G_TYPE_DOUBLE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE,
- G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
-
+ g_signal_new ("height",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EPrintableClass, height),
+ NULL, NULL,
+ e_marshal_DOUBLE__OBJECT_DOUBLE_DOUBLE_BOOLEAN,
+ G_TYPE_DOUBLE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE,
+ G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
+
e_printable_signals [WILL_FIT] =
- gtk_signal_new ("will_fit",
- GTK_RUN_LAST,
- E_OBJECT_CLASS_TYPE (object_class),
- GTK_SIGNAL_OFFSET (EPrintableClass, will_fit),
- e_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLE_BOOLEAN,
- G_TYPE_BOOLEAN, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE,
- G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
-
- E_OBJECT_CLASS_ADD_SIGNALS (object_class, e_printable_signals, LAST_SIGNAL);
+ g_signal_new ("will_fit",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EPrintableClass, will_fit),
+ NULL, NULL,
+ e_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLE_BOOLEAN,
+ G_TYPE_BOOLEAN, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE,
+ G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
klass->print_page = NULL;
klass->data_left = NULL;
@@ -103,35 +106,17 @@ e_printable_class_init (GtkObjectClass *object_class)
}
-GtkType
-e_printable_get_type (void)
-{
- static guint type = 0;
-
- if (!type)
- {
- GtkTypeInfo info =
- {
- "EPrintable",
- sizeof (EPrintable),
- sizeof (EPrintableClass),
- (GtkClassInitFunc) e_printable_class_init,
- NULL,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- type = gtk_type_unique (gtk_object_get_type (), &info);
- }
-
- return type;
-}
+E_MAKE_TYPE (e_printable,
+ "EPrintable",
+ EPrintable,
+ e_printable_class_init,
+ NULL,
+ PARENT_TYPE)
EPrintable *
e_printable_new(void)
{
- return E_PRINTABLE(gtk_type_new(e_printable_get_type()));
+ return E_PRINTABLE(g_object_new(E_PRINTABLE_TYPE, NULL));
}
void
@@ -144,12 +129,12 @@ e_printable_print_page (EPrintable *e_printable,
g_return_if_fail (e_printable != NULL);
g_return_if_fail (E_IS_PRINTABLE (e_printable));
- gtk_signal_emit (GTK_OBJECT (e_printable),
- e_printable_signals [PRINT_PAGE],
- context,
- width,
- height,
- quantized);
+ g_signal_emit (e_printable,
+ e_printable_signals [PRINT_PAGE], 0,
+ context,
+ width,
+ height,
+ quantized);
}
gboolean
@@ -160,9 +145,9 @@ e_printable_data_left (EPrintable *e_printable)
g_return_val_if_fail (e_printable != NULL, FALSE);
g_return_val_if_fail (E_IS_PRINTABLE (e_printable), FALSE);
- gtk_signal_emit (GTK_OBJECT (e_printable),
- e_printable_signals [DATA_LEFT],
- &ret_val);
+ g_signal_emit (e_printable,
+ e_printable_signals [DATA_LEFT], 0,
+ &ret_val);
return ret_val;
}
@@ -173,8 +158,8 @@ e_printable_reset (EPrintable *e_printable)
g_return_if_fail (e_printable != NULL);
g_return_if_fail (E_IS_PRINTABLE (e_printable));
- gtk_signal_emit (GTK_OBJECT (e_printable),
- e_printable_signals [RESET]);
+ g_signal_emit (e_printable,
+ e_printable_signals [RESET], 0);
}
gdouble
@@ -189,13 +174,13 @@ e_printable_height (EPrintable *e_printable,
g_return_val_if_fail (e_printable != NULL, -1);
g_return_val_if_fail (E_IS_PRINTABLE (e_printable), -1);
- gtk_signal_emit (GTK_OBJECT (e_printable),
- e_printable_signals [HEIGHT],
- context,
- width,
- max_height,
- quantized,
- &ret_val);
+ g_signal_emit (e_printable,
+ e_printable_signals [HEIGHT], 0,
+ context,
+ width,
+ max_height,
+ quantized,
+ &ret_val);
return ret_val;
}
@@ -212,13 +197,13 @@ e_printable_will_fit (EPrintable *e_printable,
g_return_val_if_fail (e_printable != NULL, -1);
g_return_val_if_fail (E_IS_PRINTABLE (e_printable), -1);
- gtk_signal_emit (GTK_OBJECT (e_printable),
- e_printable_signals [WILL_FIT],
- context,
- width,
- max_height,
- quantized,
- &ret_val);
+ g_signal_emit (e_printable,
+ e_printable_signals [WILL_FIT], 0,
+ context,
+ width,
+ max_height,
+ quantized,
+ &ret_val);
return ret_val;
}
diff --git a/widgets/misc/e-printable.h b/widgets/misc/e-printable.h
index e2f87bdfda..0c665f89c2 100644
--- a/widgets/misc/e-printable.h
+++ b/widgets/misc/e-printable.h
@@ -30,10 +30,10 @@
G_BEGIN_DECLS
#define E_PRINTABLE_TYPE (e_printable_get_type ())
-#define E_PRINTABLE(o) (GTK_CHECK_CAST ((o), E_PRINTABLE_TYPE, EPrintable))
-#define E_PRINTABLE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_PRINTABLE_TYPE, EPrintableClass))
-#define E_IS_PRINTABLE(o) (GTK_CHECK_TYPE ((o), E_PRINTABLE_TYPE))
-#define E_IS_PRINTABLE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_PRINTABLE_TYPE))
+#define E_PRINTABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_PRINTABLE_TYPE, EPrintable))
+#define E_PRINTABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_PRINTABLE_TYPE, EPrintableClass))
+#define E_IS_PRINTABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_PRINTABLE_TYPE))
+#define E_IS_PRINTABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_PRINTABLE_TYPE))
typedef struct {
GtkObject base;
diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c
index c38331dcd7..aaf925f683 100644
--- a/widgets/misc/e-reflow.c
+++ b/widgets/misc/e-reflow.c
@@ -31,6 +31,7 @@
#include "e-canvas.h"
#include "gal/e-text/e-text.h"
#include "gal/util/e-util.h"
+#include "gal/util/e-i18n.h"
#include "gal/widgets/e-unicode.h"
#include <gtk/gtksignal.h>
#include "e-selection-model-simple.h"
@@ -53,17 +54,18 @@ static void e_reflow_resize_children (GnomeCanvasItem *item);
#define E_REFLOW_BORDER_WIDTH 7
#define E_REFLOW_FULL_GUTTER (E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH * 2)
+#define PARENT_TYPE GNOME_TYPE_CANVAS_GROUP
static GnomeCanvasGroupClass *parent_class = NULL;
/* The arguments we take */
enum {
- ARG_0,
- ARG_MINIMUM_WIDTH,
- ARG_WIDTH,
- ARG_HEIGHT,
- ARG_EMPTY_MESSAGE,
- ARG_MODEL,
- ARG_COLUMN_WIDTH
+ PROP_0,
+ PROP_MINIMUM_WIDTH,
+ PROP_WIDTH,
+ PROP_HEIGHT,
+ PROP_EMPTY_MESSAGE,
+ PROP_MODEL,
+ PROP_COLUMN_WIDTH
};
enum {
@@ -508,10 +510,10 @@ disconnect_adjustment (EReflow *reflow)
if (reflow->adjustment == NULL)
return;
- gtk_signal_disconnect (GTK_OBJECT (reflow->adjustment),
- reflow->adjustment_changed_id);
- gtk_signal_disconnect (GTK_OBJECT (reflow->adjustment),
- reflow->adjustment_value_changed_id);
+ g_signal_handler_disconnect (reflow->adjustment,
+ reflow->adjustment_changed_id);
+ g_signal_handler_disconnect (reflow->adjustment,
+ reflow->adjustment_value_changed_id);
g_object_unref (reflow->adjustment);
@@ -531,11 +533,11 @@ connect_adjustment (EReflow *reflow, GtkAdjustment *adjustment)
reflow->adjustment = adjustment;
reflow->adjustment_changed_id =
- gtk_signal_connect (GTK_OBJECT (adjustment), "changed",
- GTK_SIGNAL_FUNC (adjustment_changed), reflow);
+ g_signal_connect (adjustment, "changed",
+ G_CALLBACK (adjustment_changed), reflow);
reflow->adjustment_value_changed_id =
- gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
- GTK_SIGNAL_FUNC (adjustment_changed), reflow);
+ g_signal_connect (adjustment, "value_changed",
+ G_CALLBACK (adjustment_changed), reflow);
g_object_ref (adjustment);
}
@@ -550,9 +552,9 @@ static void
connect_set_adjustment (EReflow *reflow)
{
reflow->set_scroll_adjustments_id =
- gtk_signal_connect (GTK_OBJECT (GNOME_CANVAS_ITEM (reflow)->canvas),
- "set_scroll_adjustments",
- GTK_SIGNAL_FUNC (set_scroll_adjustments), reflow);
+ g_signal_connect (GNOME_CANVAS_ITEM (reflow)->canvas,
+ "set_scroll_adjustments",
+ G_CALLBACK (set_scroll_adjustments), reflow);
}
#endif
@@ -560,8 +562,8 @@ static void
disconnect_set_adjustment (EReflow *reflow)
{
if (reflow->set_scroll_adjustments_id != 0) {
- gtk_signal_disconnect (GTK_OBJECT (GNOME_CANVAS_ITEM (reflow)->canvas),
- reflow->set_scroll_adjustments_id);
+ g_signal_handler_disconnect (GNOME_CANVAS_ITEM (reflow)->canvas,
+ reflow->set_scroll_adjustments_id);
reflow->set_scroll_adjustments_id = 0;
}
}
@@ -569,7 +571,7 @@ disconnect_set_adjustment (EReflow *reflow)
static void
column_width_changed (EReflow *reflow)
{
- gtk_signal_emit (GTK_OBJECT (reflow), signals[COLUMN_WIDTH_CHANGED], reflow->column_width);
+ g_signal_emit (reflow, signals[COLUMN_WIDTH_CHANGED], 0, reflow->column_width);
}
@@ -577,41 +579,41 @@ column_width_changed (EReflow *reflow)
/* Virtual functions */
static void
-e_reflow_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
+e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GnomeCanvasItem *item;
EReflow *reflow;
- item = GNOME_CANVAS_ITEM (o);
- reflow = E_REFLOW (o);
+ item = GNOME_CANVAS_ITEM (object);
+ reflow = E_REFLOW (object);
- switch (arg_id){
- case ARG_HEIGHT:
- reflow->height = GTK_VALUE_DOUBLE (*arg);
+ switch (prop_id){
+ case PROP_HEIGHT:
+ reflow->height = g_value_get_double (value);
reflow->need_reflow_columns = TRUE;
e_canvas_item_request_reflow(item);
break;
- case ARG_MINIMUM_WIDTH:
- reflow->minimum_width = GTK_VALUE_DOUBLE (*arg);
- if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS(o))
+ case PROP_MINIMUM_WIDTH:
+ reflow->minimum_width = g_value_get_double (value);
+ if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS(object))
set_empty(reflow);
e_canvas_item_request_reflow(item);
break;
- case ARG_EMPTY_MESSAGE:
+ case PROP_EMPTY_MESSAGE:
g_free(reflow->empty_message);
- reflow->empty_message = g_strdup(GTK_VALUE_STRING (*arg));
- if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS(o))
+ reflow->empty_message = g_strdup(g_value_get_string (value));
+ if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS(object))
set_empty(reflow);
break;
- case ARG_MODEL:
- connect_model (reflow, (EReflowModel *) GTK_VALUE_OBJECT (*arg));
+ case PROP_MODEL:
+ connect_model (reflow, (EReflowModel *) g_value_get_object (value));
break;
- case ARG_COLUMN_WIDTH:
- if (reflow->column_width != GTK_VALUE_INT (*arg)) {
+ case PROP_COLUMN_WIDTH:
+ if (reflow->column_width != g_value_get_int (value)) {
GtkAdjustment *adjustment = gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas));
double old_width = reflow->column_width;
- reflow->column_width = GTK_VALUE_INT (*arg);
+ reflow->column_width = g_value_get_int (value);
adjustment->step_increment = (reflow->column_width + E_REFLOW_FULL_GUTTER) / 2;
adjustment->page_increment = adjustment->page_size - adjustment->step_increment;
gtk_adjustment_changed(adjustment);
@@ -629,39 +631,39 @@ e_reflow_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
}
static void
-e_reflow_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+e_reflow_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
EReflow *reflow;
reflow = E_REFLOW (object);
- switch (arg_id) {
- case ARG_MINIMUM_WIDTH:
- GTK_VALUE_DOUBLE (*arg) = reflow->minimum_width;
+ switch (prop_id) {
+ case PROP_MINIMUM_WIDTH:
+ g_value_set_double (value, reflow->minimum_width);
break;
- case ARG_WIDTH:
- GTK_VALUE_DOUBLE (*arg) = reflow->width;
+ case PROP_WIDTH:
+ g_value_set_double (value, reflow->width);
break;
- case ARG_HEIGHT:
- GTK_VALUE_DOUBLE (*arg) = reflow->height;
+ case PROP_HEIGHT:
+ g_value_set_double (value, reflow->height);
break;
- case ARG_EMPTY_MESSAGE:
- GTK_VALUE_STRING (*arg) = g_strdup(reflow->empty_message);
+ case PROP_EMPTY_MESSAGE:
+ g_value_set_string (value, g_strdup(reflow->empty_message));
break;
- case ARG_MODEL:
- GTK_VALUE_OBJECT (*arg) = (GtkObject *) reflow->model;
+ case PROP_MODEL:
+ g_value_set_object (value, reflow->model);
break;
- case ARG_COLUMN_WIDTH:
- GTK_VALUE_INT (*arg) = reflow->column_width;
+ case PROP_COLUMN_WIDTH:
+ g_value_set_double (value, reflow->column_width);
break;
default:
- arg->type = GTK_TYPE_INVALID;
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
-e_reflow_destroy (GtkObject *object)
+e_reflow_dispose (GObject *object)
{
EReflow *reflow = E_REFLOW(object);
@@ -685,7 +687,7 @@ e_reflow_destroy (GtkObject *object)
g_free(reflow->empty_message);
reflow->empty_message = NULL;
- GTK_OBJECT_CLASS(parent_class)->destroy (object);
+ G_OBJECT_CLASS(parent_class)->dispose (object);
}
static void
@@ -784,9 +786,9 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
GnomeCanvasItem *item = reflow->items[unsorted];
EFocus has_focus;
if (item) {
- gtk_object_get(GTK_OBJECT(item),
- "has_focus", &has_focus,
- NULL);
+ g_object_get(item,
+ "has_focus", &has_focus,
+ NULL);
if (has_focus) {
if (event->key.state & GDK_SHIFT_MASK) {
if (i == 0)
@@ -1260,49 +1262,17 @@ e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent
static void
e_reflow_class_init (EReflowClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- object_class = (GtkObjectClass*) klass;
+ object_class = (GObjectClass*) klass;
item_class = (GnomeCanvasItemClass *) klass;
- parent_class = gtk_type_class (gnome_canvas_group_get_type ());
-
- gtk_object_add_arg_type ("EReflow::minimum_width", GTK_TYPE_DOUBLE,
- GTK_ARG_READWRITE, ARG_MINIMUM_WIDTH);
- gtk_object_add_arg_type ("EReflow::width", GTK_TYPE_DOUBLE,
- GTK_ARG_READABLE, ARG_WIDTH);
- gtk_object_add_arg_type ("EReflow::height", GTK_TYPE_DOUBLE,
- GTK_ARG_READWRITE, ARG_HEIGHT);
- gtk_object_add_arg_type ("EReflow::empty_message", GTK_TYPE_STRING,
- GTK_ARG_READWRITE, ARG_EMPTY_MESSAGE);
- gtk_object_add_arg_type ("EReflow::model", E_REFLOW_MODEL_TYPE,
- GTK_ARG_READWRITE, ARG_MODEL);
- gtk_object_add_arg_type ("EReflow::column_width", GTK_TYPE_INT,
- GTK_ARG_READWRITE, ARG_COLUMN_WIDTH);
-
- signals [SELECTION_EVENT] =
- gtk_signal_new ("selection_event",
- GTK_RUN_LAST,
- E_OBJECT_CLASS_TYPE (object_class),
- GTK_SIGNAL_OFFSET (EReflowClass, selection_event),
- e_marshal_INT__OBJECT_BOXED,
- GTK_TYPE_INT, 2, GTK_TYPE_OBJECT,
- GDK_TYPE_EVENT);
+ parent_class = g_type_class_ref (PARENT_TYPE);
- signals [COLUMN_WIDTH_CHANGED] =
- gtk_signal_new ("column_width_changed",
- GTK_RUN_LAST,
- E_OBJECT_CLASS_TYPE (object_class),
- GTK_SIGNAL_OFFSET (EReflowClass, column_width_changed),
- e_marshal_NONE__DOUBLE,
- GTK_TYPE_NONE, 1, GTK_TYPE_DOUBLE);
-
- E_OBJECT_CLASS_ADD_SIGNALS (object_class, signals, LAST_SIGNAL);
-
- object_class->set_arg = e_reflow_set_arg;
- object_class->get_arg = e_reflow_get_arg;
- object_class->destroy = e_reflow_destroy;
+ object_class->set_property = e_reflow_set_property;
+ object_class->get_property = e_reflow_get_property;
+ object_class->dispose = e_reflow_dispose;
/* GnomeCanvasItem method overrides */
item_class->event = e_reflow_event;
@@ -1314,6 +1284,68 @@ e_reflow_class_init (EReflowClass *klass)
klass->selection_event = e_reflow_selection_event_real;
klass->column_width_changed = NULL;
+
+ g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
+ g_param_spec_double ("minimum_width",
+ _( "Minimum width" ),
+ _( "Minimum Width" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_WIDTH,
+ g_param_spec_double ("width",
+ _( "Width" ),
+ _( "Width" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READABLE));
+
+
+ g_object_class_install_property (object_class, PROP_HEIGHT,
+ g_param_spec_double ("height",
+ _( "Height" ),
+ _( "Height" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_EMPTY_MESSAGE,
+ g_param_spec_string ("empty_message",
+ _( "Empty message" ),
+ _( "Empty message" ),
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_EMPTY_MESSAGE,
+ g_param_spec_object ("model",
+ _( "Reflow model" ),
+ _( "Reflow model" ),
+ E_REFLOW_MODEL_TYPE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_WIDTH,
+ g_param_spec_double ("column_width",
+ _( "Column width" ),
+ _( "Column width" ),
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ signals [SELECTION_EVENT] =
+ g_signal_new ("selection_event",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EReflowClass, selection_event),
+ NULL, NULL,
+ e_marshal_INT__OBJECT_BOXED,
+ G_TYPE_INT, 2, G_TYPE_OBJECT,
+ GDK_TYPE_EVENT);
+
+ signals [COLUMN_WIDTH_CHANGED] =
+ g_signal_new ("column_width_changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EReflowClass, column_width_changed),
+ NULL, NULL,
+ e_marshal_NONE__DOUBLE,
+ G_TYPE_NONE, 1, G_TYPE_DOUBLE);
}
static void
@@ -1374,25 +1406,9 @@ e_reflow_init (EReflow *reflow)
e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(reflow), e_reflow_reflow);
}
-GtkType
-e_reflow_get_type (void)
-{
- static GtkType type = 0;
-
- if (!type) {
- static const GtkTypeInfo info = {
- "EReflow",
- sizeof (EReflow),
- sizeof (EReflowClass),
- (GtkClassInitFunc) e_reflow_class_init,
- (GtkObjectInitFunc) e_reflow_init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- type = gtk_type_unique (gnome_canvas_group_get_type (), &info);
- }
-
- return type;
-}
+E_MAKE_TYPE (e_reflow,
+ "EReflow",
+ EReflow,
+ e_reflow_class_init,
+ e_reflow_init,
+ PARENT_TYPE)
diff --git a/widgets/misc/e-reflow.h b/widgets/misc/e-reflow.h
index bd0f3c2ce9..09f1292c4e 100644
--- a/widgets/misc/e-reflow.h
+++ b/widgets/misc/e-reflow.h
@@ -46,10 +46,10 @@ extern "C" {
*/
#define E_REFLOW_TYPE (e_reflow_get_type ())
-#define E_REFLOW(obj) (GTK_CHECK_CAST ((obj), E_REFLOW_TYPE, EReflow))
-#define E_REFLOW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_REFLOW_TYPE, EReflowClass))
-#define E_IS_REFLOW(obj) (GTK_CHECK_TYPE ((obj), E_REFLOW_TYPE))
-#define E_IS_REFLOW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_REFLOW_TYPE))
+#define E_REFLOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_REFLOW_TYPE, EReflow))
+#define E_REFLOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_REFLOW_TYPE, EReflowClass))
+#define E_IS_REFLOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_REFLOW_TYPE))
+#define E_IS_REFLOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_REFLOW_TYPE))
typedef struct EReflowPriv EReflowPriv;