diff options
author | Chris Toshok <toshok@ximian.com> | 2002-11-17 08:02:53 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-11-17 08:02:53 +0800 |
commit | 0bbe38655b71d4dd71277a1ecee246732f9fc2b1 (patch) | |
tree | 10655a0c2acb5f300986dfcfb90e5dbb3645d337 /widgets/table/e-cell-pixbuf.c | |
parent | d8e4ebebc320c72ae93c88dc43d8ae220a94331d (diff) | |
download | gsoc2013-evolution-0bbe38655b71d4dd71277a1ecee246732f9fc2b1.tar gsoc2013-evolution-0bbe38655b71d4dd71277a1ecee246732f9fc2b1.tar.gz gsoc2013-evolution-0bbe38655b71d4dd71277a1ecee246732f9fc2b1.tar.bz2 gsoc2013-evolution-0bbe38655b71d4dd71277a1ecee246732f9fc2b1.tar.lz gsoc2013-evolution-0bbe38655b71d4dd71277a1ecee246732f9fc2b1.tar.xz gsoc2013-evolution-0bbe38655b71d4dd71277a1ecee246732f9fc2b1.tar.zst gsoc2013-evolution-0bbe38655b71d4dd71277a1ecee246732f9fc2b1.zip |
GObject port work.
2002-11-16 Chris Toshok <toshok@ximian.com>
* e-cell-checkbox.[ch]: GObject port work.
* e-cell-combo.[ch]: same.
* e-cell-date.[ch]: same.
* e-cell-float.[ch]: same.
* e-cell-number.[ch]: same.
* e-cell-pixbuf.[ch]: same.
* e-cell-popup.[ch]: same.
* e-cell-progress.[ch]: same.
* e-cell-size.[ch]: same.
* e-cell-spin-button.[ch]: same.
* e-cell-text.[ch]: same.
* e-cell-toggle.[ch]: same.
* e-cell-tree.[ch]: same.
* e-cell-vbox.[ch]: same.
* e-cell.[ch]: same.
* e-table-col.c: same.
* e-table-column.c: same.
* e-table-config-field.[ch]: same.
* e-table-config.c: same.
* e-table-config.glade: same.
* e-table-field-chooser-dialog.[ch]: same.
* e-table-field-chooser-item.[ch]: same.
* e-table-field-chooser.[ch]: same.
* e-table-group-container.[ch]: same.
* e-table-group-leaf.[ch]: same.
* e-table-group.[ch]: same.
* e-table-header-item.[ch]: same.
* e-table-header-utils.[ch]: same.
* e-table-header.c: same.
* e-table-item.[ch]: same.
* e-table-scrolled.[ch]: same.
* e-table-utils.c: same.
* e-table.[ch]: same.
* e-tree-memory-callbacks.h: same.
* e-tree-scrolled.[ch]: same.
* e-tree-sorted-variable.c: same.
* e-tree.[ch]: same.
* test-check.c: same.
* test-cols.c: same.
* test-table.c: same.
svn path=/trunk/; revision=18801
Diffstat (limited to 'widgets/table/e-cell-pixbuf.c')
-rw-r--r-- | widgets/table/e-cell-pixbuf.c | 123 |
1 files changed, 65 insertions, 58 deletions
diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c index d58a75dd1c..50c3b2cc7a 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/widgets/table/e-cell-pixbuf.c @@ -24,7 +24,9 @@ #include <stdio.h> #include <libgnomecanvas/gnome-canvas.h> #include "e-cell-pixbuf.h" +#include <gal/util/e-i18n.h> +#define PARENT_TYPE E_CELL_TYPE static ECellClass *parent_class; typedef struct _ECellPixbufView ECellPixbufView; @@ -36,11 +38,11 @@ struct _ECellPixbufView { /* Object argument IDs */ enum { - ARG_0, + PROP_0, - ARG_SELECTED_COLUMN, - ARG_FOCUSED_COLUMN, - ARG_UNSELECTED_COLUMN + PROP_SELECTED_COLUMN, + PROP_FOCUSED_COLUMN, + PROP_UNSELECTED_COLUMN }; static int @@ -69,7 +71,7 @@ e_cell_pixbuf_new (void) { ECellPixbuf *ecp; - ecp = gtk_type_new (E_CELL_PIXBUF_TYPE); + ecp = g_object_new (E_CELL_PIXBUF_TYPE, NULL); e_cell_pixbuf_construct (ecp); return (ECell *) ecp; @@ -291,30 +293,33 @@ pixbuf_max_width (ECellView *ecell_view, int model_col, int view_col) } static void -pixbuf_destroy (GtkObject *object) +pixbuf_dispose (GObject *object) { - 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 -pixbuf_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +pixbuf_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - switch (arg_id) { - case ARG_SELECTED_COLUMN: - pixbuf->selected_column = GTK_VALUE_INT (*arg); + switch (prop_id) { + case PROP_SELECTED_COLUMN: + pixbuf->selected_column = g_value_get_int (value); break; - case ARG_FOCUSED_COLUMN: - pixbuf->focused_column = GTK_VALUE_INT (*arg); + case PROP_FOCUSED_COLUMN: + pixbuf->focused_column = g_value_get_int (value); break; - case ARG_UNSELECTED_COLUMN: - pixbuf->unselected_column = GTK_VALUE_INT (*arg); + case PROP_UNSELECTED_COLUMN: + pixbuf->unselected_column = g_value_get_int (value); break; default: @@ -324,27 +329,30 @@ pixbuf_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) /* Get_arg handler for the pixbuf item */ static void -pixbuf_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +pixbuf_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - switch (arg_id) { - case ARG_SELECTED_COLUMN: - GTK_VALUE_INT (*arg) = pixbuf->selected_column; + switch (prop_id) { + case PROP_SELECTED_COLUMN: + g_value_set_int (value, pixbuf->selected_column); break; - case ARG_FOCUSED_COLUMN: - GTK_VALUE_INT (*arg) = pixbuf->focused_column; + case PROP_FOCUSED_COLUMN: + g_value_set_int (value, pixbuf->focused_column); break; - case ARG_UNSELECTED_COLUMN: - GTK_VALUE_INT (*arg) = pixbuf->unselected_column; + case PROP_UNSELECTED_COLUMN: + g_value_set_int (value, pixbuf->unselected_column); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -360,13 +368,13 @@ e_cell_pixbuf_init (GtkObject *object) } static void -e_cell_pixbuf_class_init (GtkObjectClass *object_class) +e_cell_pixbuf_class_init (GObjectClass *object_class) { ECellClass *ecc = (ECellClass *) object_class; - object_class->destroy = pixbuf_destroy; - object_class->set_arg = pixbuf_set_arg; - object_class->get_arg = pixbuf_get_arg; + object_class->dispose = pixbuf_dispose; + object_class->set_property = pixbuf_set_property; + object_class->get_property = pixbuf_get_property; ecc->new_view = pixbuf_new_view; ecc->kill_view = pixbuf_kill_view; @@ -377,34 +385,33 @@ e_cell_pixbuf_class_init (GtkObjectClass *object_class) ecc->print_height = pixbuf_print_height; ecc->max_width = pixbuf_max_width; - parent_class = gtk_type_class (E_CELL_TYPE); - - gtk_object_add_arg_type ("ECellPixbuf::selected_column", - GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_SELECTED_COLUMN); - gtk_object_add_arg_type ("ECellPixbuf::focused_column", - GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_FOCUSED_COLUMN); - gtk_object_add_arg_type ("ECellPixbuf::unselected_column", - GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_UNSELECTED_COLUMN); -} - -GtkType -e_cell_pixbuf_get_type (void) -{ - static guint type = 0; - - if (!type) { - GtkTypeInfo type_info = { - "ECellPixbuf", - sizeof (ECellPixbuf), - sizeof (ECellPixbufClass), - (GtkClassInitFunc) e_cell_pixbuf_class_init, - (GtkObjectInitFunc) e_cell_pixbuf_init, - NULL, NULL, - }; - - type = gtk_type_unique (e_cell_get_type (), &type_info); - } - - return type; + parent_class = g_type_class_ref (PARENT_TYPE); + + g_object_class_install_property (object_class, PROP_SELECTED_COLUMN, + g_param_spec_int ("selected_column", + _("Selected Column"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_FOCUSED_COLUMN, + g_param_spec_int ("focused_column", + _("Focused Column"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_UNSELECTED_COLUMN, + g_param_spec_int ("unselected_column", + _("Unselected Column"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); } +E_MAKE_TYPE (e_cell_pixbuf, + "ECellPixbuf", + ECellPixbuf, + e_cell_pixbuf_class_init, + e_cell_pixbuf_init, + PARENT_TYPE) |