aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-col.c
diff options
context:
space:
mode:
authorMike Kestner <mkestner@ximian.com>2002-11-06 06:53:40 +0800
committerMike Kestner <mkestner@src.gnome.org>2002-11-06 06:53:40 +0800
commit9b97a17eb728152cebe16d53d842c950a85b3505 (patch)
tree2ccddb671fdb7826e36a67b4e8b3bccebd7cb483 /widgets/table/e-table-col.c
parentc7f67942ca864e5d158102eab7f26f6285a05b05 (diff)
downloadgsoc2013-evolution-9b97a17eb728152cebe16d53d842c950a85b3505.tar.gz
gsoc2013-evolution-9b97a17eb728152cebe16d53d842c950a85b3505.tar.zst
gsoc2013-evolution-9b97a17eb728152cebe16d53d842c950a85b3505.zip
GObjectify GObjectify GObjectify use GObject api for models use GObject
2002-11-05 Mike Kestner <mkestner@ximian.com> * e-table-col.[ch] : GObjectify * e-table-column-specification.[ch] : GObjectify * e-table-config.[ch] : GObjectify * e-table-group-leaf.c : use GObject api for models * e-table-group.c : use GObject api for models * e-table-header-item.c : use GObject api for models * e-table-header.c : use GObject api for models * e-table-selection-model.c : use GObject api for models * e-table-sort-info.[ch] : GObjectify * e-table-sorted.[ch] : GObjectify * e-table-sorter.c : use GObject api for models * e-table-specification.c : use GObject api for models * e-table-state.[ch] : GObjectify * e-table-subset-variable.[ch] : GObjectify * e-table-subset.[ch] : GObjectify * e-table.c : use GObject api for models svn path=/trunk/; revision=18571
Diffstat (limited to 'widgets/table/e-table-col.c')
-rw-r--r--widgets/table/e-table-col.c68
1 files changed, 9 insertions, 59 deletions
diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c
index bf538280c6..823fb620be 100644
--- a/widgets/table/e-table-col.c
+++ b/widgets/table/e-table-col.c
@@ -22,29 +22,19 @@
*/
#include <config.h>
-#include <gtk/gtkobject.h>
-#include <gtk/gtksignal.h>
#include "e-table-col.h"
#include "gal/util/e-util.h"
-#define PARENT_TYPE (gtk_object_get_type ())
-
static GObjectClass *parent_class;
-enum {
- ARG_0,
- ARG_SORTABLE,
- ARG_COMPARE_COL
-};
-
static void
etc_finalize (GObject *object)
{
ETableCol *etc = E_TABLE_COL (object);
if (etc->ecell)
- gtk_object_unref (GTK_OBJECT(etc->ecell));
+ g_object_unref (etc->ecell);
etc->ecell = NULL;
if (etc->pixbuf)
@@ -59,51 +49,11 @@ etc_finalize (GObject *object)
}
static void
-etc_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- ETableCol *etc = E_TABLE_COL (o);
-
- switch (arg_id){
- case ARG_SORTABLE:
- etc->sortable = GTK_VALUE_BOOL(*arg);
- break;
- case ARG_COMPARE_COL:
- etc->compare_col = GTK_VALUE_INT(*arg);
- break;
- }
-}
-
-static void
-etc_get_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- ETableCol *etc = E_TABLE_COL (o);
-
- switch (arg_id){
- case ARG_SORTABLE:
- GTK_VALUE_BOOL(*arg) = etc->sortable;
- break;
- case ARG_COMPARE_COL:
- GTK_VALUE_INT(*arg) = etc->compare_col;
- break;
- default:
- arg->type = GTK_TYPE_INVALID;
- break;
- }
-}
-
-static void
-e_table_col_class_init (GtkObjectClass *object_class)
+e_table_col_class_init (GObjectClass *object_class)
{
- parent_class = gtk_type_class (PARENT_TYPE);
- object_class->get_arg = etc_get_arg;
- object_class->set_arg = etc_set_arg;
-
- G_OBJECT_CLASS (object_class)->finalize = etc_finalize;
+ parent_class = g_type_class_peek_parent (object_class);
- gtk_object_add_arg_type ("ETableCol::sortable",
- GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_SORTABLE);
- gtk_object_add_arg_type ("ETableCol::compare_col",
- GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_COMPARE_COL);
+ object_class->finalize = etc_finalize;
}
static void
@@ -116,7 +66,7 @@ e_table_col_init (ETableCol *etc)
etc->priority = 0;
}
-E_MAKE_TYPE(e_table_col, "ETableCol", ETableCol, e_table_col_class_init, e_table_col_init, PARENT_TYPE)
+E_MAKE_TYPE(e_table_col, "ETableCol", ETableCol, e_table_col_class_init, e_table_col_init, G_TYPE_OBJECT)
/**
* e_table_col_new:
@@ -157,7 +107,7 @@ e_table_col_new (int col_idx, const char *text, double expansion, int min_width,
g_return_val_if_fail (compare != NULL, NULL);
g_return_val_if_fail (text != NULL, NULL);
- etc = gtk_type_new (E_TABLE_COL_TYPE);
+ etc = g_object_new (E_TABLE_COL_TYPE, NULL);
etc->is_pixbuf = FALSE;
@@ -175,7 +125,7 @@ e_table_col_new (int col_idx, const char *text, double expansion, int min_width,
etc->selected = 0;
etc->resizable = resizable;
- gtk_object_ref (GTK_OBJECT(etc->ecell));
+ g_object_ref (etc->ecell);
return etc;
}
@@ -218,7 +168,7 @@ e_table_col_new_with_pixbuf (int col_idx, const char *text, GdkPixbuf *pixbuf, d
g_return_val_if_fail (compare != NULL, NULL);
g_return_val_if_fail (pixbuf != NULL, NULL);
- etc = gtk_type_new (E_TABLE_COL_TYPE);
+ etc = g_object_new (E_TABLE_COL_TYPE, NULL);
etc->is_pixbuf = TRUE;
@@ -236,7 +186,7 @@ e_table_col_new_with_pixbuf (int col_idx, const char *text, GdkPixbuf *pixbuf, d
etc->selected = 0;
etc->resizable = resizable;
- gtk_object_ref (GTK_OBJECT(etc->ecell));
+ g_object_ref (etc->ecell);
gdk_pixbuf_ref (etc->pixbuf);
return etc;