diff options
Diffstat (limited to 'widgets')
24 files changed, 563 insertions, 767 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; diff --git a/widgets/table/e-table-col.h b/widgets/table/e-table-col.h index dfeed6707c..8f2369c76a 100644 --- a/widgets/table/e-table-col.h +++ b/widgets/table/e-table-col.h @@ -27,15 +27,14 @@ #include <gdk-pixbuf/gdk-pixbuf.h> #include <gal/e-table/e-cell.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define E_TABLE_COL_TYPE (e_table_col_get_type ()) -#define E_TABLE_COL(o) (GTK_CHECK_CAST ((o), E_TABLE_COL_TYPE, ETableCol)) -#define E_TABLE_COL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_COL_TYPE, ETableColClass)) -#define E_IS_TABLE_COL(o) (GTK_CHECK_TYPE ((o), E_TABLE_COL_TYPE)) -#define E_IS_TABLE_COL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_COL_TYPE)) +#define E_TABLE_COL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_COL_TYPE, ETableCol)) +#define E_TABLE_COL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_COL_TYPE, ETableColClass)) +#define E_IS_TABLE_COL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_COL_TYPE)) +#define E_IS_TABLE_COL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_COL_TYPE)) +#define E_TABLE_COL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_COL_TYPE, ETableColClass)) typedef enum { E_TABLE_COL_ARROW_NONE = 0, @@ -47,7 +46,7 @@ typedef enum { * Information about a single column */ typedef struct { - GtkObject base; + GObject base; char *text; GdkPixbuf *pixbuf; int min_width; @@ -72,10 +71,10 @@ typedef struct { } ETableCol; typedef struct { - GtkObjectClass parent_class; + GObjectClass parent_class; } ETableColClass; -GtkType e_table_col_get_type (void); +GType e_table_col_get_type (void); ETableCol *e_table_col_new (int col_idx, const char *text, double expansion, @@ -95,13 +94,8 @@ ETableCol *e_table_col_new_with_pixbuf (int col_idx, gboolean resizable, gboolean disabled, int priority); -void e_table_col_destroy (ETableCol *etc); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* _E_TABLE_COL_H_ */ diff --git a/widgets/table/e-table-column-specification.c b/widgets/table/e-table-column-specification.c index 2ee2833e63..2e992414d5 100644 --- a/widgets/table/e-table-column-specification.c +++ b/widgets/table/e-table-column-specification.c @@ -23,16 +23,13 @@ #include <config.h> #include <stdlib.h> -#include <gtk/gtksignal.h> #include <libxml/parser.h> #include <libxml/xmlmemory.h> #include "gal/util/e-xml-utils.h" #include "gal/util/e-util.h" #include "e-table-column-specification.h" -#define PARENT_TYPE (gtk_object_get_type()) - -static GtkObjectClass *etcs_parent_class; +static GObjectClass *etcs_parent_class; static void free_strings (ETableColumnSpecification *etcs) @@ -50,21 +47,21 @@ free_strings (ETableColumnSpecification *etcs) } static void -etcs_destroy (GtkObject *object) +etcs_finalize (GObject *object) { ETableColumnSpecification *etcs = E_TABLE_COLUMN_SPECIFICATION (object); free_strings(etcs); - GTK_OBJECT_CLASS (etcs_parent_class)->destroy (object); + etcs_parent_class->finalize (object); } static void -etcs_class_init (GtkObjectClass *klass) +etcs_class_init (GObjectClass *klass) { - etcs_parent_class = gtk_type_class (PARENT_TYPE); + etcs_parent_class = g_type_class_peek_parent (klass); - klass->destroy = etcs_destroy; + klass->finalize = etcs_finalize; } static void @@ -86,12 +83,12 @@ etcs_init (ETableColumnSpecification *specification) specification->priority = 0; } -E_MAKE_TYPE(e_table_column_specification, "ETableColumnSpecification", ETableColumnSpecification, etcs_class_init, etcs_init, PARENT_TYPE) +E_MAKE_TYPE(e_table_column_specification, "ETableColumnSpecification", ETableColumnSpecification, etcs_class_init, etcs_init, G_TYPE_OBJECT) ETableColumnSpecification * e_table_column_specification_new (void) { - ETableColumnSpecification *etcs = gtk_type_new (E_TABLE_COLUMN_SPECIFICATION_TYPE); + ETableColumnSpecification *etcs = g_object_new (E_TABLE_COLUMN_SPECIFICATION_TYPE, NULL); return (ETableColumnSpecification *) etcs; } diff --git a/widgets/table/e-table-column-specification.h b/widgets/table/e-table-column-specification.h index 2641eb82df..6bf5623398 100644 --- a/widgets/table/e-table-column-specification.h +++ b/widgets/table/e-table-column-specification.h @@ -25,22 +25,20 @@ #define _E_TABLE_COLUMN_SPECIFICATION_H_ #include <glib.h> -#include <gtk/gtkobject.h> +#include <glib-object.h> #include <libxml/tree.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS #define E_TABLE_COLUMN_SPECIFICATION_TYPE (e_table_column_specification_get_type ()) -#define E_TABLE_COLUMN_SPECIFICATION(o) (GTK_CHECK_CAST ((o), E_TABLE_COLUMN_SPECIFICATION_TYPE, ETableColumnSpecification)) -#define E_TABLE_COLUMN_SPECIFICATION_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_COLUMN_SPECIFICATION_TYPE, ETableColumnSpecificationClass)) -#define E_IS_TABLE_COLUMN_SPECIFICATION(o) (GTK_CHECK_TYPE ((o), E_TABLE_COLUMN_SPECIFICATION_TYPE)) -#define E_IS_TABLE_COLUMN_SPECIFICATION_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_COLUMN_SPECIFICATION_TYPE)) +#define E_TABLE_COLUMN_SPECIFICATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_COLUMN_SPECIFICATION_TYPE, ETableColumnSpecification)) +#define E_TABLE_COLUMN_SPECIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_COLUMN_SPECIFICATION_TYPE, ETableColumnSpecificationClass)) +#define E_IS_TABLE_COLUMN_SPECIFICATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_COLUMN_SPECIFICATION_TYPE)) +#define E_IS_TABLE_COLUMN_SPECIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_COLUMN_SPECIFICATION_TYPE)) +#define E_TABLE_COLUMN_SPECIFICATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_COLUMN_SPECIFICATION_TYPE, ETableColumnSpecificationClass)) typedef struct { - GtkObject base; + GObject base; int model_col; int compare_col; char *title; @@ -58,10 +56,10 @@ typedef struct { } ETableColumnSpecification; typedef struct { - GtkObjectClass parent_class; + GObjectClass parent_class; } ETableColumnSpecificationClass; -GtkType e_table_column_specification_get_type (void); +GType e_table_column_specification_get_type (void); ETableColumnSpecification *e_table_column_specification_new (void); @@ -70,8 +68,6 @@ void e_table_column_specification_load_from_node (ETableC xmlNode *e_table_column_specification_save_to_node (ETableColumnSpecification *state, xmlNode *parent); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* _E_TABLE_COLUMN_SPECIFICATION_H_ */ diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 9d7354e38b..f1a8f791af 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -36,7 +36,6 @@ #include <gtk/gtkentry.h> #include <gtk/gtklabel.h> #include <gtk/gtknotebook.h> -#include <gtk/gtksignal.h> #include <gtk/gtktogglebutton.h> #include <libgnomeui/gnome-dialog.h> #include <libgnomeui/gnome-propertybox.h> @@ -50,20 +49,13 @@ #include <e-table-memory-store.h> -#define PARENT_TYPE (gtk_object_get_type()) - -static GtkObjectClass *config_parent_class; +static GObjectClass *config_parent_class; enum { CHANGED, LAST_SIGNAL }; -enum { - ARG_0, - ARG_STATE -}; - static guint e_table_config_signals [LAST_SIGNAL] = { 0, }; static void @@ -74,11 +66,11 @@ config_finalize (GObject *object) gtk_object_destroy (GTK_OBJECT (config->state)); if (config->source_state) - gtk_object_unref (GTK_OBJECT (config->source_state)); + g_object_unref (config->source_state); config->source_state = NULL; if (config->source_spec) - gtk_object_unref (GTK_OBJECT (config->source_spec)); + g_object_unref (config->source_spec); config->source_spec = NULL; g_free (config->header); @@ -90,22 +82,7 @@ config_finalize (GObject *object) g_free (config->domain); config->domain = NULL; - G_OBJECT_CLASS (config_parent_class)->finalize (object); -} - -static void -config_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) -{ - ETableConfig *config = E_TABLE_CONFIG (o); - - switch (arg_id){ - case ARG_STATE: - GTK_VALUE_OBJECT (*arg) = (GtkObject *) config->state; - break; - - default: - break; - } + config_parent_class->finalize (object); } static void @@ -115,35 +92,28 @@ e_table_config_changed (ETableConfig *config, ETableState *state) g_return_if_fail (E_IS_TABLE_CONFIG (config)); - gtk_signal_emit(GTK_OBJECT(config), - e_table_config_signals [CHANGED], - state); + g_signal_emit(G_OBJECT(config), e_table_config_signals [CHANGED], 0, state); } static void -config_class_init (GtkObjectClass *object_class) +config_class_init (GObjectClass *object_class) { ETableConfigClass *klass = E_TABLE_CONFIG_CLASS(object_class); - config_parent_class = gtk_type_class (PARENT_TYPE); + config_parent_class = g_type_class_peek_parent (klass); klass->changed = NULL; - object_class->get_arg = config_get_arg; - G_OBJECT_CLASS (object_class)->finalize = config_finalize; + object_class->finalize = config_finalize; e_table_config_signals [CHANGED] = - gtk_signal_new ("changed", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableConfigClass, changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - - E_OBJECT_CLASS_ADD_SIGNALS (object_class, e_table_config_signals, LAST_SIGNAL); - - gtk_object_add_arg_type ("ETableConfig::state", E_TABLE_STATE_TYPE, - GTK_ARG_READABLE, ARG_STATE); + g_signal_new ("changed", + E_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableConfigClass, changed), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); glade_gnome_init (); } @@ -430,7 +400,7 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) /* OK */ case 1: - gtk_object_unref (GTK_OBJECT (config->state)); + g_object_unref (config->state); config->state = config->temp_state; config->temp_state = 0; running = 0; @@ -440,7 +410,7 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) /* CANCEL */ case 2: - gtk_object_unref (GTK_OBJECT (config->temp_state)); + g_object_unref (config->temp_state); config->temp_state = 0; running = 0; break; @@ -469,7 +439,7 @@ do_fields_config_dialog (ETableConfig *config) switch (button){ /* OK */ case 0: - gtk_object_unref (GTK_OBJECT (config->state)); + g_object_unref (config->state); config->state = config->temp_state; config->temp_state = 0; running = 0; @@ -479,7 +449,7 @@ do_fields_config_dialog (ETableConfig *config) /* CANCEL */ case 1: - gtk_object_unref (GTK_OBJECT (config->temp_state)); + g_object_unref (config->temp_state); config->temp_state = 0; running = 0; break; @@ -609,8 +579,8 @@ connect_button (ETableConfig *config, GladeXML *gui, const char *widget_name, Gt GtkWidget *button = glade_xml_get_widget (gui, widget_name); if (button) { - gtk_signal_connect (GTK_OBJECT (button), "clicked", - cback, config); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (cback), config); } } @@ -1022,7 +992,7 @@ setup_gui (ETableConfig *config) gui = glade_xml_new (ETABLE_GLADEDIR "/e-table-config-no-group.glade", NULL, E_I18N_DOMAIN); } - gtk_object_unref (GTK_OBJECT (global_store)); + g_object_unref (global_store); config->dialog_toplevel = glade_xml_get_widget ( gui, "e-table-config"); @@ -1059,15 +1029,15 @@ setup_gui (ETableConfig *config) configure_group_dialog (config, gui); configure_fields_dialog (config, gui); - gtk_signal_connect ( - GTK_OBJECT (config->dialog_toplevel), "destroy", - GTK_SIGNAL_FUNC (dialog_destroyed), config); + g_signal_connect ( + G_OBJECT (config->dialog_toplevel), "destroy", + G_CALLBACK (dialog_destroyed), config); - gtk_signal_connect ( - GTK_OBJECT (config->dialog_toplevel), "apply", - GTK_SIGNAL_FUNC (dialog_apply), config); + g_signal_connect ( + G_OBJECT (config->dialog_toplevel), "apply", + G_CALLBACK (dialog_apply), config); - gtk_object_unref (GTK_OBJECT (gui)); + g_object_unref (gui); } static void @@ -1093,8 +1063,8 @@ e_table_config_construct (ETableConfig *config, config->source_state = state; config->header = g_strdup (header); - gtk_object_ref (GTK_OBJECT (config->source_spec)); - gtk_object_ref (GTK_OBJECT (config->source_state)); + g_object_ref (config->source_spec); + g_object_ref (config->source_state); config->state = e_table_state_duplicate (state); @@ -1134,10 +1104,10 @@ e_table_config_new (const char *header, ETableSpecification *spec, ETableState *state) { - ETableConfig *config = gtk_type_new (E_TABLE_CONFIG_TYPE); + ETableConfig *config = g_object_new (E_TABLE_CONFIG_TYPE, NULL); if (e_table_config_construct (config, header, spec, state) == NULL){ - gtk_object_destroy (GTK_OBJECT (config)); + g_object_unref (config); return NULL; } @@ -1157,4 +1127,4 @@ e_table_config_raise (ETableConfig *config) gdk_window_raise (GTK_WIDGET (config->dialog_toplevel)->window); } -E_MAKE_TYPE(e_table_config, "ETableConfig", ETableConfig, config_class_init, config_init, PARENT_TYPE) +E_MAKE_TYPE(e_table_config, "ETableConfig", ETableConfig, config_class_init, config_init, G_TYPE_OBJECT) diff --git a/widgets/table/e-table-config.h b/widgets/table/e-table-config.h index 9c52895d94..f385814f28 100644 --- a/widgets/table/e-table-config.h +++ b/widgets/table/e-table-config.h @@ -35,10 +35,11 @@ G_BEGIN_DECLS #define E_TABLE_CONFIG_TYPE (e_table_config_get_type ()) -#define E_TABLE_CONFIG(o) (GTK_CHECK_CAST ((o), E_TABLE_CONFIG_TYPE, ETableConfig)) -#define E_TABLE_CONFIG_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_CONFIG_TYPE, ETableConfigClass)) -#define E_IS_TABLE_CONFIG(o) (GTK_CHECK_TYPE ((o), E_TABLE_CONFIG_TYPE)) -#define E_IS_TABLE_CONFIG_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_CONFIG_TYPE)) +#define E_TABLE_CONFIG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_CONFIG_TYPE, ETableConfig)) +#define E_TABLE_CONFIG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_CONFIG_TYPE, ETableConfigClass)) +#define E_IS_TABLE_CONFIG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_CONFIG_TYPE)) +#define E_IS_TABLE_CONFIG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_CONFIG_TYPE)) +#define E_TABLE_CONFIG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_CONFIG_TYPE, ETableConfigClass)) typedef struct { GtkComboText *combo; @@ -52,7 +53,7 @@ typedef struct { typedef struct { - GtkObject parent; + GObject parent; char *header; @@ -90,13 +91,13 @@ typedef struct { } ETableConfig; typedef struct { - GtkObjectClass parent_class; + GObjectClass parent_class; /* Signals */ void (*changed) (ETableConfig *config); } ETableConfigClass; -GtkType e_table_config_get_type (void); +GType e_table_config_get_type (void); ETableConfig *e_table_config_new (const char *header, ETableSpecification *spec, ETableState *state); diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index 32f3a82913..cd9bfa775a 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -61,7 +61,7 @@ etgl_destroy (GtkObject *object) ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF(object); if (etgl->ets) { - gtk_object_unref (GTK_OBJECT(etgl->ets)); + g_object_unref (etgl->ets); etgl->ets = NULL; } @@ -101,7 +101,7 @@ etgl_destroy (GtkObject *object) } if (etgl->selection_model) { - gtk_object_unref (GTK_OBJECT(etgl->selection_model)); + g_object_unref (etgl->selection_model); etgl->selection_model = NULL; } @@ -128,8 +128,6 @@ e_table_group_leaf_construct (GnomeCanvasGroup *parent, full_header, sort_info)); - gtk_object_ref (GTK_OBJECT (etgl->ets)); - gtk_object_sink (GTK_OBJECT (etgl->ets)); e_table_group_construct (parent, E_TABLE_GROUP (etgl), full_header, header, model); } @@ -449,10 +447,10 @@ etgl_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) break; case ARG_SELECTION_MODEL: if (etgl->selection_model) - gtk_object_unref(GTK_OBJECT(etgl->selection_model)); - etgl->selection_model = E_SELECTION_MODEL(GTK_VALUE_OBJECT (*arg)); + g_object_unref(etgl->selection_model); + etgl->selection_model = E_SELECTION_MODEL(GTK_VALUE_POINTER (*arg)); if (etgl->selection_model) { - gtk_object_ref(GTK_OBJECT(etgl->selection_model)); + g_object_ref(etgl->selection_model); } if (etgl->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c index 7182dcfce6..b529297b62 100644 --- a/widgets/table/e-table-group.c +++ b/widgets/table/e-table-group.c @@ -58,17 +58,17 @@ etg_destroy (GtkObject *object) ETableGroup *etg = E_TABLE_GROUP(object); if (etg->header) { - g_object_unref (G_OBJECT(etg->header)); + g_object_unref (etg->header); etg->header = NULL; } if (etg->full_header) { - g_object_unref (G_OBJECT(etg->full_header)); + g_object_unref (etg->full_header); etg->full_header = NULL; } if (etg->model) { - gtk_object_unref (GTK_OBJECT(etg->model)); + g_object_unref (etg->model); etg->model = NULL; } @@ -130,11 +130,11 @@ e_table_group_construct (GnomeCanvasGroup *parent, ETableModel *model) { etg->full_header = full_header; - g_object_ref (G_OBJECT(etg->full_header)); + g_object_ref (etg->full_header); etg->header = header; - g_object_ref (G_OBJECT(etg->header)); + g_object_ref (etg->header); etg->model = model; - gtk_object_ref (GTK_OBJECT(etg->model)); + g_object_ref (etg->model); gnome_canvas_item_construct (GNOME_CANVAS_ITEM (etg), parent, 0, NULL); } diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index b2d8cdde2a..0d2d7375a0 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -129,10 +129,10 @@ ethi_destroy (GtkObject *object){ if (ethi->sort_info) { if (ethi->sort_info_changed_id) - gtk_signal_disconnect (GTK_OBJECT(ethi->sort_info), ethi->sort_info_changed_id); + g_signal_handler_disconnect (G_OBJECT(ethi->sort_info), ethi->sort_info_changed_id); if (ethi->group_info_changed_id) - gtk_signal_disconnect (GTK_OBJECT(ethi->sort_info), ethi->group_info_changed_id); - gtk_object_unref (GTK_OBJECT(ethi->sort_info)); + g_signal_handler_disconnect (G_OBJECT(ethi->sort_info), ethi->group_info_changed_id); + g_object_unref (ethi->sort_info); ethi->sort_info = NULL; } @@ -141,7 +141,7 @@ ethi_destroy (GtkObject *object){ ethi->full_header = NULL; if (ethi->config) - gtk_object_destroy (GTK_OBJECT (ethi->config)); + g_object_unref (ethi->config); ethi->config = NULL; if (GTK_OBJECT_CLASS (ethi_parent_class)->destroy) @@ -325,10 +325,10 @@ ethi_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) case ARG_FULL_HEADER: if (ethi->full_header) - g_object_unref(G_OBJECT(ethi->full_header)); + g_object_unref(ethi->full_header); ethi->full_header = E_TABLE_HEADER(GTK_VALUE_POINTER (*arg)); if (ethi->full_header) - g_object_ref(G_OBJECT(ethi->full_header)); + g_object_ref(ethi->full_header); break; case ARG_DND_CODE: @@ -343,26 +343,26 @@ ethi_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) case ARG_SORT_INFO: if (ethi->sort_info){ if (ethi->sort_info_changed_id) - gtk_signal_disconnect ( - GTK_OBJECT(ethi->sort_info), + g_signal_handler_disconnect ( + G_OBJECT(ethi->sort_info), ethi->sort_info_changed_id); if (ethi->group_info_changed_id) - gtk_signal_disconnect ( - GTK_OBJECT(ethi->sort_info), + g_signal_handler_disconnect ( + G_OBJECT(ethi->sort_info), ethi->group_info_changed_id); - gtk_object_unref (GTK_OBJECT(ethi->sort_info)); + g_object_unref (G_OBJECT(ethi->sort_info)); } ethi->sort_info = GTK_VALUE_POINTER (*arg); - gtk_object_ref (GTK_OBJECT(ethi->sort_info)); + g_object_ref (ethi->sort_info); ethi->sort_info_changed_id = - gtk_signal_connect ( - GTK_OBJECT(ethi->sort_info), "sort_info_changed", - GTK_SIGNAL_FUNC(ethi_sort_info_changed), ethi); + g_signal_connect ( + G_OBJECT(ethi->sort_info), "sort_info_changed", + G_CALLBACK (ethi_sort_info_changed), ethi); ethi->group_info_changed_id = - gtk_signal_connect ( - GTK_OBJECT(ethi->sort_info), "group_info_changed", - GTK_SIGNAL_FUNC(ethi_sort_info_changed), ethi); + g_signal_connect ( + G_OBJECT(ethi->sort_info), "group_info_changed", + G_CALLBACK(ethi_sort_info_changed), ethi); break; case ARG_TABLE: if (GTK_VALUE_OBJECT(*arg)) @@ -696,14 +696,14 @@ context_destroyed (gpointer data) ethi->last_drop_context = NULL; scroll_off (ethi); - gtk_object_unref (GTK_OBJECT (ethi)); + g_object_unref (ethi); } static void context_connect (ETableHeaderItem *ethi, GdkDragContext *context) { if (g_dataset_get_data (context, "e-table-header-item") == NULL) { - gtk_object_ref (GTK_OBJECT (ethi)); + g_object_ref (ethi); g_dataset_set_data_full (context, "e-table-header-item", ethi, context_destroyed); } } @@ -1735,7 +1735,7 @@ ethi_class_init (GtkObjectClass *object_class) GTK_ARG_READWRITE, ARG_DND_CODE); gtk_object_add_arg_type ("ETableHeaderItem::fontset", GTK_TYPE_STRING, GTK_ARG_WRITABLE, ARG_TABLE_FONTSET); - gtk_object_add_arg_type ("ETableHeaderItem::sort_info", GTK_TYPE_OBJECT, + gtk_object_add_arg_type ("ETableHeaderItem::sort_info", G_TYPE_OBJECT, GTK_ARG_WRITABLE, ARG_SORT_INFO); gtk_object_add_arg_type ("ETableHeaderItem::table", GTK_TYPE_OBJECT, GTK_ARG_WRITABLE, ARG_TABLE); diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index e76bef6bd5..9ee72e94a3 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -135,7 +135,7 @@ static void eth_do_remove (ETableHeader *eth, int idx, gboolean do_unref) { if (do_unref) - gtk_object_unref (GTK_OBJECT (eth->columns [idx])); + g_object_unref (eth->columns [idx]); memmove (ð->columns [idx], ð->columns [idx+1], sizeof (ETableCol *) * (eth->col_count - idx - 1)); @@ -151,9 +151,9 @@ eth_finalize (GObject *object) if (eth->sort_info) { if (eth->sort_info_group_change_id) - g_signal_handler_disconnect(GTK_OBJECT(eth->sort_info), + g_signal_handler_disconnect(G_OBJECT(eth->sort_info), eth->sort_info_group_change_id); - gtk_object_unref(GTK_OBJECT(eth->sort_info)); + g_object_unref(eth->sort_info); eth->sort_info = NULL; } @@ -205,12 +205,12 @@ eth_set_prop (GObject *object, guint prop_id, const GValue *val, GParamSpec *psp case PROP_SORT_INFO: if (eth->sort_info) { if (eth->sort_info_group_change_id) - g_signal_handler_disconnect(GTK_OBJECT(eth->sort_info), eth->sort_info_group_change_id); - g_object_unref (G_OBJECT(eth->sort_info)); + g_signal_handler_disconnect(G_OBJECT(eth->sort_info), eth->sort_info_group_change_id); + g_object_unref (eth->sort_info); } eth->sort_info = E_TABLE_SORT_INFO(g_value_get_object (val)); if (eth->sort_info) { - g_object_ref(G_OBJECT(eth->sort_info)); + g_object_ref(eth->sort_info); eth->sort_info_group_change_id = g_signal_connect(G_OBJECT(eth->sort_info), "group_info_changed", G_CALLBACK(eth_group_info_changed), eth); @@ -393,8 +393,7 @@ e_table_header_add_column (ETableHeader *eth, ETableCol *tc, int pos) /* * We are the primary owners of the column */ - gtk_object_ref (GTK_OBJECT (tc)); - gtk_object_sink (GTK_OBJECT (tc)); + g_object_ref (tc); eth_do_insert (eth, pos, tc); @@ -522,7 +521,7 @@ e_table_header_get_index_at (ETableHeader *eth, int x_offset) * contained in the ETableHeader @eth. Note that every * returned ETableCol in the array has been referenced, to release * this information you need to g_free the buffer returned - * and you need to gtk_object_unref every element returned + * and you need to g_object_unref every element returned */ ETableCol ** e_table_header_get_columns (ETableHeader *eth) @@ -538,7 +537,7 @@ e_table_header_get_columns (ETableHeader *eth) ret [eth->col_count] = NULL; for (i = 0; i < eth->col_count; i++) { - gtk_object_ref(GTK_OBJECT(ret[i])); + g_object_ref(ret[i]); } return ret; diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index e4d2767ea5..0781c6332e 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -26,7 +26,6 @@ #include <string.h> #include <gdk/gdkkeysyms.h> -#include <gtk/gtksignal.h> #include "gal/util/e-util.h" @@ -190,19 +189,19 @@ add_model(ETableSelectionModel *etsm, ETableModel *model) { etsm->model = model; if (model) { - gtk_object_ref(GTK_OBJECT(model)); - etsm->model_pre_change_id = gtk_signal_connect(GTK_OBJECT(model), "model_pre_change", - GTK_SIGNAL_FUNC(model_pre_change), etsm); - etsm->model_changed_id = gtk_signal_connect(GTK_OBJECT(model), "model_changed", - GTK_SIGNAL_FUNC(model_changed), etsm); - etsm->model_row_changed_id = gtk_signal_connect(GTK_OBJECT(model), "model_row_changed", - GTK_SIGNAL_FUNC(model_row_changed), etsm); - etsm->model_cell_changed_id = gtk_signal_connect(GTK_OBJECT(model), "model_cell_changed", - GTK_SIGNAL_FUNC(model_cell_changed), etsm); - etsm->model_rows_inserted_id = gtk_signal_connect(GTK_OBJECT(model), "model_rows_inserted", - GTK_SIGNAL_FUNC(model_rows_inserted), etsm); - etsm->model_rows_deleted_id = gtk_signal_connect(GTK_OBJECT(model), "model_rows_deleted", - GTK_SIGNAL_FUNC(model_rows_deleted), etsm); + g_object_ref(model); + etsm->model_pre_change_id = g_signal_connect(G_OBJECT(model), "model_pre_change", + G_CALLBACK(model_pre_change), etsm); + etsm->model_changed_id = g_signal_connect(G_OBJECT(model), "model_changed", + G_CALLBACK(model_changed), etsm); + etsm->model_row_changed_id = g_signal_connect(G_OBJECT(model), "model_row_changed", + G_CALLBACK(model_row_changed), etsm); + etsm->model_cell_changed_id = g_signal_connect(G_OBJECT(model), "model_cell_changed", + G_CALLBACK(model_cell_changed), etsm); + etsm->model_rows_inserted_id = g_signal_connect(G_OBJECT(model), "model_rows_inserted", + G_CALLBACK(model_rows_inserted), etsm); + etsm->model_rows_deleted_id = g_signal_connect(G_OBJECT(model), "model_rows_deleted", + G_CALLBACK(model_rows_deleted), etsm); } e_selection_model_array_confirm_row_count(E_SELECTION_MODEL_ARRAY(etsm)); } @@ -211,20 +210,20 @@ inline static void drop_model(ETableSelectionModel *etsm) { if (etsm->model) { - gtk_signal_disconnect(GTK_OBJECT(etsm->model), - etsm->model_pre_change_id); - gtk_signal_disconnect(GTK_OBJECT(etsm->model), - etsm->model_changed_id); - gtk_signal_disconnect(GTK_OBJECT(etsm->model), - etsm->model_row_changed_id); - gtk_signal_disconnect(GTK_OBJECT(etsm->model), - etsm->model_cell_changed_id); - gtk_signal_disconnect(GTK_OBJECT(etsm->model), - etsm->model_rows_inserted_id); - gtk_signal_disconnect(GTK_OBJECT(etsm->model), - etsm->model_rows_deleted_id); - - gtk_object_unref(GTK_OBJECT(etsm->model)); + g_signal_handler_disconnect(G_OBJECT(etsm->model), + etsm->model_pre_change_id); + g_signal_handler_disconnect(G_OBJECT(etsm->model), + etsm->model_changed_id); + g_signal_handler_disconnect(G_OBJECT(etsm->model), + etsm->model_row_changed_id); + g_signal_handler_disconnect(G_OBJECT(etsm->model), + etsm->model_cell_changed_id); + g_signal_handler_disconnect(G_OBJECT(etsm->model), + etsm->model_rows_inserted_id); + g_signal_handler_disconnect(G_OBJECT(etsm->model), + etsm->model_rows_deleted_id); + + g_object_unref(etsm->model); } etsm->model = NULL; } @@ -254,10 +253,10 @@ etsm_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) switch (arg_id){ case ARG_MODEL: - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(etsm->model); + GTK_VALUE_POINTER (*arg) = GTK_OBJECT(etsm->model); break; case ARG_HEADER: - GTK_VALUE_OBJECT (*arg) = (GtkObject *)etsm->eth; + GTK_VALUE_POINTER (*arg) = (GtkObject *)etsm->eth; break; } } @@ -270,10 +269,10 @@ etsm_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) switch (arg_id){ case ARG_MODEL: drop_model(etsm); - add_model(etsm, GTK_VALUE_OBJECT (*arg) ? E_TABLE_MODEL(GTK_VALUE_OBJECT (*arg)) : NULL); + add_model(etsm, GTK_VALUE_POINTER (*arg) ? E_TABLE_MODEL(GTK_VALUE_POINTER (*arg)) : NULL); break; case ARG_HEADER: - etsm->eth = (ETableHeader *)GTK_VALUE_OBJECT (*arg); + etsm->eth = (ETableHeader *)GTK_VALUE_POINTER (*arg); break; } } @@ -305,7 +304,7 @@ e_table_selection_model_class_init (ETableSelectionModelClass *klass) esma_class->get_row_count = etsm_get_row_count; - gtk_object_add_arg_type ("ETableSelectionModel::model", GTK_TYPE_OBJECT, + gtk_object_add_arg_type ("ETableSelectionModel::model", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_MODEL); gtk_object_add_arg_type ("ETableSelectionModel::header", E_TABLE_HEADER_TYPE, GTK_ARG_READWRITE, ARG_HEADER); diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index de9e7be4ea..991222d8ff 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -25,17 +25,13 @@ #include "e-table-sort-info.h" -#include <gtk/gtksignal.h> #include "gal/util/e-util.h" #include "gal/util/e-xml-utils.h" #include <string.h> -#define ETM_CLASS(e) ((ETableSortInfoClass *)((GtkObject *)e)->klass) +#define ETM_CLASS(e) (E_TABLE_SORT_INFO_GET_CLASS (e)) -#define PARENT_TYPE gtk_object_get_type () - - -static GtkObjectClass *e_table_sort_info_parent_class; +static GObjectClass *e_table_sort_info_parent_class; enum { SORT_INFO_CHANGED, @@ -46,11 +42,9 @@ enum { static guint e_table_sort_info_signals [LAST_SIGNAL] = { 0, }; static void -etsi_destroy (GtkObject *object) +etsi_finalize (GObject *object) { - ETableSortInfo *etsi; - - etsi = E_TABLE_SORT_INFO (object); + ETableSortInfo *etsi = E_TABLE_SORT_INFO (object); if (etsi->groupings) g_free(etsi->groupings); @@ -60,14 +54,12 @@ etsi_destroy (GtkObject *object) g_free(etsi->sortings); etsi->sortings = NULL; - GTK_OBJECT_CLASS (e_table_sort_info_parent_class)->destroy (object); + G_OBJECT_CLASS (e_table_sort_info_parent_class)->finalize (object); } static void e_table_sort_info_init (ETableSortInfo *info) { - GTK_OBJECT_UNSET_FLAGS (GTK_OBJECT (info), GTK_FLOATING); - info->group_count = 0; info->groupings = NULL; info->sort_count = 0; @@ -81,38 +73,36 @@ e_table_sort_info_init (ETableSortInfo *info) static void e_table_sort_info_class_init (ETableSortInfoClass *klass) { - GtkObjectClass *object_class; + GObjectClass * object_class = G_OBJECT_CLASS (klass); - e_table_sort_info_parent_class = gtk_type_class (gtk_object_get_type ()); + e_table_sort_info_parent_class = g_type_class_peek_parent (klass); - object_class = GTK_OBJECT_CLASS(klass); - - object_class->destroy = etsi_destroy; + object_class->finalize = etsi_finalize; e_table_sort_info_signals [SORT_INFO_CHANGED] = - gtk_signal_new ("sort_info_changed", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableSortInfoClass, sort_info_changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("sort_info_changed", + E_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableSortInfoClass, sort_info_changed), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); e_table_sort_info_signals [GROUP_INFO_CHANGED] = - gtk_signal_new ("group_info_changed", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableSortInfoClass, group_info_changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("group_info_changed", + E_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableSortInfoClass, group_info_changed), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); klass->sort_info_changed = NULL; klass->group_info_changed = NULL; - - E_OBJECT_CLASS_ADD_SIGNALS (object_class, e_table_sort_info_signals, LAST_SIGNAL); } E_MAKE_TYPE(e_table_sort_info, "ETableSortInfo", ETableSortInfo, - e_table_sort_info_class_init, e_table_sort_info_init, PARENT_TYPE) + e_table_sort_info_class_init, e_table_sort_info_init, G_TYPE_OBJECT) static void e_table_sort_info_sort_info_changed (ETableSortInfo *info) @@ -123,8 +113,7 @@ e_table_sort_info_sort_info_changed (ETableSortInfo *info) if (info->frozen) { info->sort_info_changed = 1; } else { - gtk_signal_emit (GTK_OBJECT (info), - e_table_sort_info_signals [SORT_INFO_CHANGED]); + g_signal_emit (G_OBJECT (info), e_table_sort_info_signals [SORT_INFO_CHANGED], 0); } } @@ -137,8 +126,7 @@ e_table_sort_info_group_info_changed (ETableSortInfo *info) if (info->frozen) { info->group_info_changed = 1; } else { - gtk_signal_emit (GTK_OBJECT (info), - e_table_sort_info_signals [GROUP_INFO_CHANGED]); + g_signal_emit (G_OBJECT (info), e_table_sort_info_signals [GROUP_INFO_CHANGED], 0); } } @@ -356,7 +344,7 @@ e_table_sort_info_sorting_set_nth (ETableSortInfo *info, int n, ETableSortColu ETableSortInfo * e_table_sort_info_new (void) { - return gtk_type_new (e_table_sort_info_get_type ()); + return g_object_new (E_TABLE_SORT_INFO_TYPE, NULL); } /** @@ -407,8 +395,7 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, e_table_sort_info_sorting_set_nth(info, i++, column); } } - gtk_signal_emit (GTK_OBJECT (info), - e_table_sort_info_signals [SORT_INFO_CHANGED]); + g_signal_emit (G_OBJECT (info), e_table_sort_info_signals [SORT_INFO_CHANGED], 0); } diff --git a/widgets/table/e-table-sort-info.h b/widgets/table/e-table-sort-info.h index 7a398fbb85..4710fbd453 100644 --- a/widgets/table/e-table-sort-info.h +++ b/widgets/table/e-table-sort-info.h @@ -24,18 +24,17 @@ #ifndef _E_TABLE_SORT_INFO_H_ #define _E_TABLE_SORT_INFO_H_ -#include <gtk/gtkobject.h> +#include <glib-object.h> #include <libxml/tree.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define E_TABLE_SORT_INFO_TYPE (e_table_sort_info_get_type ()) -#define E_TABLE_SORT_INFO(o) (GTK_CHECK_CAST ((o), E_TABLE_SORT_INFO_TYPE, ETableSortInfo)) -#define E_TABLE_SORT_INFO_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_SORT_INFO_TYPE, ETableSortInfoClass)) -#define E_IS_TABLE_SORT_INFO(o) (GTK_CHECK_TYPE ((o), E_TABLE_SORT_INFO_TYPE)) -#define E_IS_TABLE_SORT_INFO_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_SORT_INFO_TYPE)) +#define E_TABLE_SORT_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SORT_INFO_TYPE, ETableSortInfo)) +#define E_TABLE_SORT_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SORT_INFO_TYPE, ETableSortInfoClass)) +#define E_IS_TABLE_SORT_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SORT_INFO_TYPE)) +#define E_IS_TABLE_SORT_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SORT_INFO_TYPE)) +#define E_TABLE_SORT_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SORT_INFO_TYPE, ETableSortInfoClass)) typedef struct _ETableSortColumn ETableSortColumn; @@ -45,7 +44,7 @@ struct _ETableSortColumn { }; typedef struct { - GtkObject base; + GObject base; gint group_count; ETableSortColumn *groupings; @@ -60,7 +59,7 @@ typedef struct { } ETableSortInfo; typedef struct { - GtkObjectClass parent_class; + GObjectClass parent_class; /* * Signals @@ -69,7 +68,7 @@ typedef struct { void (*group_info_changed) (ETableSortInfo *info); } ETableSortInfoClass; -GtkType e_table_sort_info_get_type (void); +GType e_table_sort_info_get_type (void); void e_table_sort_info_freeze (ETableSortInfo *info); void e_table_sort_info_thaw (ETableSortInfo *info); @@ -103,8 +102,6 @@ void e_table_sort_info_set_can_group (ETableSortInfo *info, gboolean can_group); gboolean e_table_sort_info_get_can_group (ETableSortInfo *info); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* _E_TABLE_SORT_INFO_H_ */ diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c index 0062e03699..a5b5acb8cf 100644 --- a/widgets/table/e-table-sorted.c +++ b/widgets/table/e-table-sorted.c @@ -23,7 +23,6 @@ #include <config.h> #include <stdlib.h> -#include <gtk/gtksignal.h> #include <string.h> #include "gal/util/e-util.h" #include "e-table-sorted.h" @@ -31,8 +30,6 @@ #define d(x) -#define PARENT_TYPE E_TABLE_SUBSET_TYPE - #define INCREMENT_AMOUNT 100 /* maximum insertions between an idle event that we will do without scheduling an idle sort */ @@ -49,7 +46,7 @@ static void ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *sour static void ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, int row, int count); static void -ets_destroy (GtkObject *object) +ets_dispose (GObject *object) { ETableSorted *ets = E_TABLE_SORTED (object); @@ -62,25 +59,25 @@ ets_destroy (GtkObject *object) ets->insert_idle_id = 0; if (ets->sort_info) { - gtk_signal_disconnect (GTK_OBJECT (ets->sort_info), - ets->sort_info_changed_id); - gtk_object_unref(GTK_OBJECT(ets->sort_info)); + g_signal_handler_disconnect (G_OBJECT (ets->sort_info), + ets->sort_info_changed_id); + g_object_unref(ets->sort_info); ets->sort_info = NULL; } if (ets->full_header) - g_object_unref(G_OBJECT(ets->full_header)); + g_object_unref(ets->full_header); ets->full_header = NULL; - GTK_OBJECT_CLASS (ets_parent_class)->destroy (object); + G_OBJECT_CLASS (ets_parent_class)->dispose (object); } static void -ets_class_init (GtkObjectClass *object_class) +ets_class_init (GObjectClass *object_class) { ETableSubsetClass *etss_class = E_TABLE_SUBSET_CLASS(object_class); - ets_parent_class = gtk_type_class (PARENT_TYPE); + ets_parent_class = g_type_class_peek_parent (object_class); etss_class->proxy_model_changed = ets_proxy_model_changed; etss_class->proxy_model_row_changed = ets_proxy_model_row_changed; @@ -88,7 +85,7 @@ ets_class_init (GtkObjectClass *object_class) etss_class->proxy_model_rows_inserted = ets_proxy_model_rows_inserted; etss_class->proxy_model_rows_deleted = ets_proxy_model_rows_deleted; - object_class->destroy = ets_destroy; + object_class->dispose = ets_dispose; } static void @@ -103,16 +100,16 @@ ets_init (ETableSorted *ets) ets->insert_count = 0; } -E_MAKE_TYPE(e_table_sorted, "ETableSorted", ETableSorted, ets_class_init, ets_init, PARENT_TYPE) +E_MAKE_TYPE(e_table_sorted, "ETableSorted", ETableSorted, ets_class_init, ets_init, E_TABLE_SUBSET_TYPE) static gboolean ets_sort_idle(ETableSorted *ets) { - gtk_object_ref(GTK_OBJECT(ets)); + g_object_ref(ets); ets_sort(ets); ets->sort_idle_id = 0; ets->insert_count = 0; - gtk_object_unref(GTK_OBJECT(ets)); + g_object_unref(ets); return FALSE; } @@ -127,26 +124,26 @@ ets_insert_idle(ETableSorted *ets) ETableModel * e_table_sorted_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) { - ETableSorted *ets = gtk_type_new (E_TABLE_SORTED_TYPE); + ETableSorted *ets = g_object_new (E_TABLE_SORTED_TYPE, NULL); ETableSubset *etss = E_TABLE_SUBSET (ets); if (ets_parent_class->proxy_model_pre_change) (ets_parent_class->proxy_model_pre_change) (etss, source); if (e_table_subset_construct (etss, source, 0) == NULL){ - gtk_object_unref (GTK_OBJECT (ets)); + g_object_unref (ets); return NULL; } ets->sort_info = sort_info; - gtk_object_ref(GTK_OBJECT(ets->sort_info)); + g_object_ref(ets->sort_info); ets->full_header = full_header; - g_object_ref(G_OBJECT(ets->full_header)); + g_object_ref(ets->full_header); ets_proxy_model_changed(etss, source); - ets->sort_info_changed_id = gtk_signal_connect (GTK_OBJECT (sort_info), "sort_info_changed", - GTK_SIGNAL_FUNC (ets_sort_info_changed), ets); + ets->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); return E_TABLE_MODEL(ets); } diff --git a/widgets/table/e-table-sorted.h b/widgets/table/e-table-sorted.h index 80c7507acc..bbee7534a3 100644 --- a/widgets/table/e-table-sorted.h +++ b/widgets/table/e-table-sorted.h @@ -24,21 +24,20 @@ #ifndef _E_TABLE_SORTED_H_ #define _E_TABLE_SORTED_H_ -#include <gtk/gtkobject.h> +#include <glib-object.h> #include <gal/e-table/e-table-model.h> #include <gal/e-table/e-table-subset.h> #include <gal/e-table/e-table-sort-info.h> #include <gal/e-table/e-table-header.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define E_TABLE_SORTED_TYPE (e_table_sorted_get_type ()) -#define E_TABLE_SORTED(o) (GTK_CHECK_CAST ((o), E_TABLE_SORTED_TYPE, ETableSorted)) -#define E_TABLE_SORTED_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_SORTED_TYPE, ETableSortedClass)) -#define E_IS_TABLE_SORTED(o) (GTK_CHECK_TYPE ((o), E_TABLE_SORTED_TYPE)) -#define E_IS_TABLE_SORTED_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_SORTED_TYPE)) +#define E_TABLE_SORTED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SORTED_TYPE, ETableSorted)) +#define E_TABLE_SORTED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SORTED_TYPE, ETableSortedClass)) +#define E_IS_TABLE_SORTED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SORTED_TYPE)) +#define E_IS_TABLE_SORTED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SORTED_TYPE)) +#define E_TABLE_SORTED_GET_CLASS(o) (G_TYPE_CHECK_CLASS_CAST((o), E_TABLE_SORTED_TYPE, ETableSortedClass)) typedef struct { ETableSubset base; @@ -58,11 +57,9 @@ typedef struct { ETableSubsetClass parent_class; } ETableSortedClass; -GtkType e_table_sorted_get_type (void); +GType e_table_sorted_get_type (void); ETableModel *e_table_sorted_new (ETableModel *etm, ETableHeader *header, ETableSortInfo *sort_info); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* _E_TABLE_SORTED_H_ */ diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c index 673969b752..92f9d022a5 100644 --- a/widgets/table/e-table-sorter.c +++ b/widgets/table/e-table-sorter.c @@ -24,7 +24,6 @@ #include <config.h> #include <stdlib.h> #include <string.h> -#include <gtk/gtksignal.h> #include "gal/util/e-util.h" #include "e-table-sorter.h" @@ -63,20 +62,20 @@ ets_destroy (GtkObject *object) { ETableSorter *ets = E_TABLE_SORTER (object); - gtk_signal_disconnect (GTK_OBJECT (ets->source), - ets->table_model_changed_id); - gtk_signal_disconnect (GTK_OBJECT (ets->source), - ets->table_model_row_changed_id); - gtk_signal_disconnect (GTK_OBJECT (ets->source), - ets->table_model_cell_changed_id); - gtk_signal_disconnect (GTK_OBJECT (ets->source), - ets->table_model_rows_inserted_id); - gtk_signal_disconnect (GTK_OBJECT (ets->source), - ets->table_model_rows_deleted_id); - gtk_signal_disconnect (GTK_OBJECT (ets->sort_info), - ets->sort_info_changed_id); - gtk_signal_disconnect (GTK_OBJECT (ets->sort_info), - ets->group_info_changed_id); + g_signal_handler_disconnect (G_OBJECT (ets->source), + ets->table_model_changed_id); + g_signal_handler_disconnect (G_OBJECT (ets->source), + ets->table_model_row_changed_id); + g_signal_handler_disconnect (G_OBJECT (ets->source), + ets->table_model_cell_changed_id); + g_signal_handler_disconnect (G_OBJECT (ets->source), + ets->table_model_rows_inserted_id); + g_signal_handler_disconnect (G_OBJECT (ets->source), + ets->table_model_rows_deleted_id); + g_signal_handler_disconnect (G_OBJECT (ets->sort_info), + ets->sort_info_changed_id); + g_signal_handler_disconnect (G_OBJECT (ets->sort_info), + ets->group_info_changed_id); ets->table_model_changed_id = 0; ets->table_model_row_changed_id = 0; @@ -87,15 +86,15 @@ ets_destroy (GtkObject *object) ets->group_info_changed_id = 0; if (ets->sort_info) - gtk_object_unref(GTK_OBJECT(ets->sort_info)); + g_object_unref(ets->sort_info); ets->sort_info = NULL; if (ets->full_header) - g_object_unref(G_OBJECT(ets->full_header)); + g_object_unref(ets->full_header); ets->full_header = NULL; if (ets->source) - gtk_object_unref(GTK_OBJECT(ets->source)); + g_object_unref(ets->source); ets->source = NULL; GTK_OBJECT_CLASS (parent_class)->destroy (object); @@ -110,18 +109,18 @@ ets_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) case ARG_SORT_INFO: if (ets->sort_info) { if (ets->sort_info_changed_id) - gtk_signal_disconnect(GTK_OBJECT(ets->sort_info), ets->sort_info_changed_id); + g_signal_handler_disconnect(G_OBJECT(ets->sort_info), ets->sort_info_changed_id); if (ets->group_info_changed_id) - gtk_signal_disconnect(GTK_OBJECT(ets->sort_info), ets->group_info_changed_id); - gtk_object_unref(GTK_OBJECT(ets->sort_info)); + g_signal_handler_disconnect(G_OBJECT(ets->sort_info), ets->group_info_changed_id); + g_object_unref(ets->sort_info); } - ets->sort_info = E_TABLE_SORT_INFO(GTK_VALUE_OBJECT (*arg)); - gtk_object_ref(GTK_OBJECT(ets->sort_info)); - ets->sort_info_changed_id = gtk_signal_connect (GTK_OBJECT (ets->sort_info), "sort_info_changed", - GTK_SIGNAL_FUNC (ets_sort_info_changed), ets); - ets->group_info_changed_id = gtk_signal_connect (GTK_OBJECT (ets->sort_info), "group_info_changed", - GTK_SIGNAL_FUNC (ets_sort_info_changed), ets); + ets->sort_info = E_TABLE_SORT_INFO(GTK_VALUE_POINTER (*arg)); + g_object_ref(ets->sort_info); + ets->sort_info_changed_id = g_signal_connect (G_OBJECT (ets->sort_info), "sort_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); + ets->group_info_changed_id = g_signal_connect (G_OBJECT (ets->sort_info), "group_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); ets_clean (ets); break; @@ -136,7 +135,7 @@ ets_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) ETableSorter *ets = E_TABLE_SORTER (object); switch (arg_id) { case ARG_SORT_INFO: - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(ets->sort_info); + GTK_VALUE_POINTER (*arg) = G_OBJECT(ets->sort_info); break; } } @@ -147,7 +146,7 @@ ets_class_init (ETableSorterClass *klass) GtkObjectClass *object_class = GTK_OBJECT_CLASS(klass); ESorterClass *sorter_class = E_SORTER_CLASS(klass); - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_peek_parent (klass); object_class->destroy = ets_destroy; object_class->set_arg = ets_set_arg; @@ -159,7 +158,7 @@ ets_class_init (ETableSorterClass *klass) sorter_class->get_sorted_to_model_array = ets_get_sorted_to_model_array ; sorter_class->needs_sorting = ets_needs_sorting ; - gtk_object_add_arg_type ("ETableSorter::sort_info", GTK_TYPE_OBJECT, + gtk_object_add_arg_type ("ETableSorter::sort_info", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_SORT_INFO); } @@ -189,26 +188,26 @@ e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortIn ETableSorter *ets = gtk_type_new (E_TABLE_SORTER_TYPE); ets->sort_info = sort_info; - gtk_object_ref(GTK_OBJECT(ets->sort_info)); + g_object_ref(ets->sort_info); ets->full_header = full_header; - g_object_ref(G_OBJECT(ets->full_header)); + g_object_ref(ets->full_header); ets->source = source; - gtk_object_ref(GTK_OBJECT(ets->source)); - - ets->table_model_changed_id = gtk_signal_connect (GTK_OBJECT (source), "model_changed", - GTK_SIGNAL_FUNC (ets_model_changed), ets); - ets->table_model_row_changed_id = gtk_signal_connect (GTK_OBJECT (source), "model_row_changed", - GTK_SIGNAL_FUNC (ets_model_row_changed), ets); - ets->table_model_cell_changed_id = gtk_signal_connect (GTK_OBJECT (source), "model_cell_changed", - GTK_SIGNAL_FUNC (ets_model_cell_changed), ets); - ets->table_model_rows_inserted_id = gtk_signal_connect (GTK_OBJECT (source), "model_rows_inserted", - GTK_SIGNAL_FUNC (ets_model_rows_inserted), ets); - ets->table_model_rows_deleted_id = gtk_signal_connect (GTK_OBJECT (source), "model_rows_deleted", - GTK_SIGNAL_FUNC (ets_model_rows_deleted), ets); - ets->sort_info_changed_id = gtk_signal_connect (GTK_OBJECT (sort_info), "sort_info_changed", - GTK_SIGNAL_FUNC (ets_sort_info_changed), ets); - ets->group_info_changed_id = gtk_signal_connect (GTK_OBJECT (sort_info), "group_info_changed", - GTK_SIGNAL_FUNC (ets_sort_info_changed), ets); + g_object_ref(ets->source); + + ets->table_model_changed_id = g_signal_connect (G_OBJECT (source), "model_changed", + G_CALLBACK (ets_model_changed), ets); + ets->table_model_row_changed_id = g_signal_connect (G_OBJECT (source), "model_row_changed", + G_CALLBACK (ets_model_row_changed), ets); + ets->table_model_cell_changed_id = g_signal_connect (G_OBJECT (source), "model_cell_changed", + G_CALLBACK (ets_model_cell_changed), ets); + ets->table_model_rows_inserted_id = g_signal_connect (G_OBJECT (source), "model_rows_inserted", + G_CALLBACK (ets_model_rows_inserted), ets); + ets->table_model_rows_deleted_id = g_signal_connect (G_OBJECT (source), "model_rows_deleted", + G_CALLBACK (ets_model_rows_deleted), ets); + ets->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); + ets->group_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "group_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); return ets; } diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c index 6c1b4d7b04..c77f4a5995 100644 --- a/widgets/table/e-table-specification.c +++ b/widgets/table/e-table-specification.c @@ -45,14 +45,14 @@ etsp_finalize (GObject *object) if (etsp->columns) { for (i = 0; etsp->columns[i]; i++) { - gtk_object_unref (GTK_OBJECT (etsp->columns[i])); + g_object_unref (etsp->columns[i]); } g_free (etsp->columns); etsp->columns = NULL; } if (etsp->state) - gtk_object_unref (GTK_OBJECT (etsp->state)); + g_object_unref (etsp->state); etsp->state = NULL; g_free (etsp->click_to_add_message); @@ -234,11 +234,11 @@ e_table_specification_load_from_node (ETableSpecification *specification, } if (specification->state) - gtk_object_unref (GTK_OBJECT (specification->state)); + g_object_unref (specification->state); specification->state = NULL; if (specification->columns) { for (i = 0; specification->columns[i]; i++) { - gtk_object_unref (GTK_OBJECT (specification->columns[i])); + g_object_unref (specification->columns[i]); } g_free (specification->columns); } @@ -248,8 +248,7 @@ e_table_specification_load_from_node (ETableSpecification *specification, if (!strcmp (children->name, "ETableColumn")) { ETableColumnSpecification *col_spec = e_table_column_specification_new (); - gtk_object_ref (GTK_OBJECT (col_spec)); - gtk_object_sink (GTK_OBJECT (col_spec)); + g_object_ref (col_spec); e_table_column_specification_load_from_node (col_spec, children); list = g_list_append (list, col_spec); } else if (specification->state == NULL && !strcmp (children->name, "ETableState")) { diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c index 64b911f38f..9dd1020430 100644 --- a/widgets/table/e-table-state.c +++ b/widgets/table/e-table-state.c @@ -28,8 +28,6 @@ #include <stdlib.h> #include <string.h> -#include <gtk/gtksignal.h> -#include <gtk/gtkobject.h> #include <libxml/parser.h> #include <libxml/xmlmemory.h> #include "gal/util/e-util.h" @@ -37,14 +35,25 @@ #include "e-table-state.h" -#define PARENT_TYPE (gtk_object_get_type()) - #define STATE_VERSION 0.1 -static GtkObjectClass *etst_parent_class; +static GObjectClass *etst_parent_class; static void -etst_destroy (GtkObject *object) +etst_dispose (GObject *object) +{ + ETableState *etst = E_TABLE_STATE (object); + + if (etst->sort_info) { + g_object_unref (etst->sort_info); + etst->sort_info = NULL; + } + + G_OBJECT_CLASS (etst_parent_class)->dispose (object); +} + +static void +etst_finalize (GObject *object) { ETableState *etst = E_TABLE_STATE (object); @@ -58,40 +67,32 @@ etst_destroy (GtkObject *object) etst->expansions = NULL; } - if (etst->sort_info) { - gtk_object_unref (GTK_OBJECT (etst->sort_info)); - etst->sort_info = NULL; - } - - GTK_OBJECT_CLASS (etst_parent_class)->destroy (object); + G_OBJECT_CLASS (etst_parent_class)->finalize (object); } static void -etst_class_init (GtkObjectClass *klass) +etst_class_init (GObjectClass *klass) { - etst_parent_class = gtk_type_class (PARENT_TYPE); + etst_parent_class = g_type_class_peek_parent (klass); - klass->destroy = etst_destroy; + klass->dispose = etst_dispose; + klass->finalize = etst_finalize; } static void etst_init (ETableState *state) { - GTK_OBJECT_UNSET_FLAGS (GTK_OBJECT (state), GTK_FLOATING); - state->columns = NULL; state->expansions = NULL; state->sort_info = e_table_sort_info_new(); } -E_MAKE_TYPE(e_table_state, "ETableState", ETableState, etst_class_init, etst_init, PARENT_TYPE) +E_MAKE_TYPE(e_table_state, "ETableState", ETableState, etst_class_init, etst_init, G_TYPE_OBJECT) ETableState * e_table_state_new (void) { - ETableState *etst = gtk_type_new (E_TABLE_STATE_TYPE); - - return (ETableState *) etst; + return (ETableState *) g_object_new (E_TABLE_STATE_TYPE, NULL); } ETableState * @@ -160,7 +161,7 @@ e_table_state_load_from_node (ETableState *state, node, "state-version", STATE_VERSION); if (state->sort_info) - gtk_object_unref (GTK_OBJECT(state->sort_info)); + g_object_unref (state->sort_info); state->sort_info = NULL; children = node->xmlChildrenNode; diff --git a/widgets/table/e-table-state.h b/widgets/table/e-table-state.h index 0532ba3771..47e0c7b9b8 100644 --- a/widgets/table/e-table-state.h +++ b/widgets/table/e-table-state.h @@ -24,23 +24,21 @@ #ifndef _E_TABLE_STATE_H_ #define _E_TABLE_STATE_H_ -#include <gtk/gtkobject.h> +#include <glib-object.h> #include <libxml/tree.h> #include <gal/e-table/e-table-sort-info.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS #define E_TABLE_STATE_TYPE (e_table_state_get_type ()) -#define E_TABLE_STATE(o) (GTK_CHECK_CAST ((o), E_TABLE_STATE_TYPE, ETableState)) -#define E_TABLE_STATE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_STATE_TYPE, ETableStateClass)) -#define E_IS_TABLE_STATE(o) (GTK_CHECK_TYPE ((o), E_TABLE_STATE_TYPE)) -#define E_IS_TABLE_STATE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_STATE_TYPE)) +#define E_TABLE_STATE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_STATE_TYPE, ETableState)) +#define E_TABLE_STATE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_STATE_TYPE, ETableStateClass)) +#define E_IS_TABLE_STATE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_STATE_TYPE)) +#define E_IS_TABLE_STATE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_STATE_TYPE)) +#define E_TABLE_STATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_STATE_TYPE, ETableStateClass)) typedef struct { - GtkObject base; + GObject base; ETableSortInfo *sort_info; int col_count; @@ -49,10 +47,10 @@ typedef struct { } ETableState; typedef struct { - GtkObjectClass parent_class; + GObjectClass parent_class; } ETableStateClass; -GtkType e_table_state_get_type (void); +GType e_table_state_get_type (void); ETableState *e_table_state_new (void); ETableState *e_table_state_vanilla (int col_count); @@ -71,8 +69,6 @@ xmlNode *e_table_state_save_to_node (ETableState *state, xmlNode *parent); ETableState *e_table_state_duplicate (ETableState *state); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* _E_TABLE_STATE_H_ */ diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index 16ff83d3f3..efe6529806 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -24,18 +24,13 @@ #include <config.h> #include <stdlib.h> #include <string.h> -#include <gtk/gtksignal.h> #include "gal/util/e-util.h" #include "e-table-subset-variable.h" -#define ETSSV_CLASS(e) ((ETableSubsetVariableClass *)(GTK_OBJECT_GET_CLASS (e))) - -#define PARENT_TYPE E_TABLE_SUBSET_TYPE +#define ETSSV_CLASS(e) (E_TABLE_SUBSET_VARIABLE_GET_CLASS (e)) #define INCREMENT_AMOUNT 10 -static ETableSubsetClass *etssv_parent_class; - static void etssv_add (ETableSubsetVariable *etssv, gint row) @@ -119,10 +114,9 @@ etssv_remove (ETableSubsetVariable *etssv, } static void -etssv_class_init (GtkObjectClass *object_class) +etssv_class_init (GObjectClass *object_class) { ETableSubsetVariableClass *klass = E_TABLE_SUBSET_VARIABLE_CLASS(object_class); - etssv_parent_class = gtk_type_class (PARENT_TYPE); klass->add = etssv_add; klass->add_array = etssv_add_array; @@ -130,7 +124,7 @@ etssv_class_init (GtkObjectClass *object_class) klass->remove = etssv_remove; } -E_MAKE_TYPE(e_table_subset_variable, "ETableSubsetVariable", ETableSubsetVariable, etssv_class_init, NULL, PARENT_TYPE) +E_MAKE_TYPE(e_table_subset_variable, "ETableSubsetVariable", ETableSubsetVariable, etssv_class_init, NULL, E_TABLE_SUBSET_TYPE) ETableModel * e_table_subset_variable_construct (ETableSubsetVariable *etssv, @@ -146,10 +140,10 @@ e_table_subset_variable_construct (ETableSubsetVariable *etssv, ETableModel * e_table_subset_variable_new (ETableModel *source) { - ETableSubsetVariable *etssv = gtk_type_new (E_TABLE_SUBSET_VARIABLE_TYPE); + ETableSubsetVariable *etssv = g_object_new (E_TABLE_SUBSET_VARIABLE_TYPE, NULL); if (e_table_subset_variable_construct (etssv, source) == NULL){ - gtk_object_unref (GTK_OBJECT (etssv)); + g_object_unref (etssv); return NULL; } diff --git a/widgets/table/e-table-subset-variable.h b/widgets/table/e-table-subset-variable.h index eae291b1d2..2dc0914f9b 100644 --- a/widgets/table/e-table-subset-variable.h +++ b/widgets/table/e-table-subset-variable.h @@ -24,18 +24,17 @@ #ifndef _E_TABLE_SUBSET_VARIABLE_H_ #define _E_TABLE_SUBSET_VARIABLE_H_ -#include <gtk/gtkobject.h> +#include <glib-object.h> #include <gal/e-table/e-table-subset.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define E_TABLE_SUBSET_VARIABLE_TYPE (e_table_subset_variable_get_type ()) -#define E_TABLE_SUBSET_VARIABLE(o) (GTK_CHECK_CAST ((o), E_TABLE_SUBSET_VARIABLE_TYPE, ETableSubsetVariable)) -#define E_TABLE_SUBSET_VARIABLE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_SUBSET_VARIABLE_TYPE, ETableSubsetVariableClass)) -#define E_IS_TABLE_SUBSET_VARIABLE(o) (GTK_CHECK_TYPE ((o), E_TABLE_SUBSET_VARIABLE_TYPE)) -#define E_IS_TABLE_SUBSET_VARIABLE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_SUBSET_VARIABLE_TYPE)) +#define E_TABLE_SUBSET_VARIABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SUBSET_VARIABLE_TYPE, ETableSubsetVariable)) +#define E_TABLE_SUBSET_VARIABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SUBSET_VARIABLE_TYPE, ETableSubsetVariableClass)) +#define E_IS_TABLE_SUBSET_VARIABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SUBSET_VARIABLE_TYPE)) +#define E_IS_TABLE_SUBSET_VARIABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SUBSET_VARIABLE_TYPE)) +#define E_TABLE_SUBSET_VARIABLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SUBSET_VARIABLE_TYPE, ETableSubsetVariableClass)) typedef struct { ETableSubset base; @@ -56,7 +55,7 @@ typedef struct { gint row); } ETableSubsetVariableClass; -GtkType e_table_subset_variable_get_type (void); +GType e_table_subset_variable_get_type (void); ETableModel *e_table_subset_variable_new (ETableModel *etm); ETableModel *e_table_subset_variable_construct (ETableSubsetVariable *etssv, ETableModel *source); @@ -77,10 +76,7 @@ void e_table_subset_variable_decrement (ETableSubsetVariable *ets, gint amount); void e_table_subset_variable_set_allocation (ETableSubsetVariable *ets, gint total); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* _E_TABLE_SUBSET_VARIABLE_H_ */ diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index fe1c0c3962..d4a2415f13 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -24,7 +24,6 @@ #include <config.h> #include <stdlib.h> -#include <gtk/gtksignal.h> #include "gal/util/e-util.h" #include "e-table-subset.h" @@ -36,12 +35,11 @@ static void etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel static void etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, int row, int count); static void etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, int row, int count); -#define PARENT_TYPE E_TABLE_MODEL_TYPE #define d(x) static ETableModelClass *etss_parent_class; -#define ETSS_CLASS(object) (E_TABLE_SUBSET_CLASS(GTK_OBJECT_GET_CLASS(object))) +#define ETSS_CLASS(object) (E_TABLE_SUBSET_GET_CLASS(object)) static gint etss_get_view_row (ETableSubset *etss, int row) @@ -81,27 +79,27 @@ etss_get_view_row (ETableSubset *etss, int row) } static void -etss_destroy (GtkObject *object) +etss_dispose (GObject *object) { ETableSubset *etss = E_TABLE_SUBSET (object); if (etss->source) { - gtk_signal_disconnect (GTK_OBJECT (etss->source), - etss->table_model_pre_change_id); - gtk_signal_disconnect (GTK_OBJECT (etss->source), - etss->table_model_no_change_id); - gtk_signal_disconnect (GTK_OBJECT (etss->source), - etss->table_model_changed_id); - gtk_signal_disconnect (GTK_OBJECT (etss->source), - etss->table_model_row_changed_id); - gtk_signal_disconnect (GTK_OBJECT (etss->source), - etss->table_model_cell_changed_id); - gtk_signal_disconnect (GTK_OBJECT (etss->source), - etss->table_model_rows_inserted_id); - gtk_signal_disconnect (GTK_OBJECT (etss->source), - etss->table_model_rows_deleted_id); - - gtk_object_unref (GTK_OBJECT (etss->source)); + g_signal_handler_disconnect (G_OBJECT (etss->source), + etss->table_model_pre_change_id); + g_signal_handler_disconnect (G_OBJECT (etss->source), + etss->table_model_no_change_id); + g_signal_handler_disconnect (G_OBJECT (etss->source), + etss->table_model_changed_id); + g_signal_handler_disconnect (G_OBJECT (etss->source), + etss->table_model_row_changed_id); + g_signal_handler_disconnect (G_OBJECT (etss->source), + etss->table_model_cell_changed_id); + g_signal_handler_disconnect (G_OBJECT (etss->source), + etss->table_model_rows_inserted_id); + g_signal_handler_disconnect (G_OBJECT (etss->source), + etss->table_model_rows_deleted_id); + + g_object_unref (etss->source); etss->source = NULL; etss->table_model_changed_id = 0; @@ -111,10 +109,18 @@ etss_destroy (GtkObject *object) etss->table_model_rows_deleted_id = 0; } + G_OBJECT_CLASS (etss_parent_class)->dispose (object); +} + +static void +etss_finalize (GObject *object) +{ + ETableSubset *etss = E_TABLE_SUBSET (object); + g_free (etss->map_table); etss->map_table = NULL; - GTK_OBJECT_CLASS (etss_parent_class)->destroy (object); + G_OBJECT_CLASS (etss_parent_class)->finalize (object); } static int @@ -226,14 +232,15 @@ etss_value_to_string (ETableModel *etm, int col, const void *value) } static void -etss_class_init (GtkObjectClass *object_class) +etss_class_init (GObjectClass *object_class) { ETableSubsetClass *klass = (ETableSubsetClass *) object_class; ETableModelClass *table_class = (ETableModelClass *) object_class; - etss_parent_class = gtk_type_class (PARENT_TYPE); + etss_parent_class = g_type_class_peek_parent (klass); - object_class->destroy = etss_destroy; + object_class->dispose = etss_dispose; + object_class->finalize = etss_finalize; table_class->column_count = etss_column_count; table_class->row_count = etss_row_count; @@ -267,7 +274,7 @@ etss_init (ETableSubset *etss) etss->last_access = 0; } -E_MAKE_TYPE(e_table_subset, "ETableSubset", ETableSubset, etss_class_init, etss_init, PARENT_TYPE) +E_MAKE_TYPE(e_table_subset, "ETableSubset", ETableSubset, etss_class_init, etss_init, E_TABLE_MODEL_TYPE) static void etss_proxy_model_pre_change_real (ETableSubset *etss, ETableModel *etm) @@ -383,26 +390,26 @@ e_table_subset_construct (ETableSubset *etss, ETableModel *source, int nvals) etss->map_table = buffer; etss->n_map = nvals; etss->source = source; - gtk_object_ref (GTK_OBJECT (source)); + g_object_ref (source); /* Init */ for (i = 0; i < nvals; i++) etss->map_table [i] = i; - etss->table_model_pre_change_id = gtk_signal_connect (GTK_OBJECT (source), "model_pre_change", - GTK_SIGNAL_FUNC (etss_proxy_model_pre_change), etss); - etss->table_model_no_change_id = gtk_signal_connect (GTK_OBJECT (source), "model_no_change", - GTK_SIGNAL_FUNC (etss_proxy_model_no_change), etss); - etss->table_model_changed_id = gtk_signal_connect (GTK_OBJECT (source), "model_changed", - GTK_SIGNAL_FUNC (etss_proxy_model_changed), etss); - etss->table_model_row_changed_id = gtk_signal_connect (GTK_OBJECT (source), "model_row_changed", - GTK_SIGNAL_FUNC (etss_proxy_model_row_changed), etss); - etss->table_model_cell_changed_id = gtk_signal_connect (GTK_OBJECT (source), "model_cell_changed", - GTK_SIGNAL_FUNC (etss_proxy_model_cell_changed), etss); - etss->table_model_rows_inserted_id = gtk_signal_connect (GTK_OBJECT (source), "model_rows_inserted", - GTK_SIGNAL_FUNC (etss_proxy_model_rows_inserted), etss); - etss->table_model_rows_deleted_id = gtk_signal_connect (GTK_OBJECT (source), "model_rows_deleted", - GTK_SIGNAL_FUNC (etss_proxy_model_rows_deleted), etss); + etss->table_model_pre_change_id = g_signal_connect (G_OBJECT (source), "model_pre_change", + G_CALLBACK (etss_proxy_model_pre_change), etss); + etss->table_model_no_change_id = g_signal_connect (G_OBJECT (source), "model_no_change", + G_CALLBACK (etss_proxy_model_no_change), etss); + etss->table_model_changed_id = g_signal_connect (G_OBJECT (source), "model_changed", + G_CALLBACK (etss_proxy_model_changed), etss); + etss->table_model_row_changed_id = g_signal_connect (G_OBJECT (source), "model_row_changed", + G_CALLBACK (etss_proxy_model_row_changed), etss); + etss->table_model_cell_changed_id = g_signal_connect (G_OBJECT (source), "model_cell_changed", + G_CALLBACK (etss_proxy_model_cell_changed), etss); + etss->table_model_rows_inserted_id = g_signal_connect (G_OBJECT (source), "model_rows_inserted", + G_CALLBACK (etss_proxy_model_rows_inserted), etss); + etss->table_model_rows_deleted_id = g_signal_connect (G_OBJECT (source), "model_rows_deleted", + G_CALLBACK (etss_proxy_model_rows_deleted), etss); return E_TABLE_MODEL (etss); } @@ -410,18 +417,19 @@ e_table_subset_construct (ETableSubset *etss, ETableModel *source, int nvals) ETableModel * e_table_subset_new (ETableModel *source, const int nvals) { - ETableSubset *etss = gtk_type_new (E_TABLE_SUBSET_TYPE); + ETableSubset *etss = g_object_new (E_TABLE_SUBSET_TYPE, NULL); if (e_table_subset_construct (etss, source, nvals) == NULL){ - gtk_object_unref (GTK_OBJECT (etss)); + g_object_unref (etss); return NULL; } return (ETableModel *) etss; } -int e_table_subset_model_to_view_row (ETableSubset *ets, - int model_row) +int +e_table_subset_model_to_view_row (ETableSubset *ets, + int model_row) { int i; for (i = 0; i < ets->n_map; i++) { @@ -431,8 +439,9 @@ int e_table_subset_model_to_view_row (ETableSubset *ets, return -1; } -int e_table_subset_view_to_model_row (ETableSubset *ets, - int view_row) +int +e_table_subset_view_to_model_row (ETableSubset *ets, + int view_row) { if (view_row >= 0 && view_row < ets->n_map) return ets->map_table[view_row]; diff --git a/widgets/table/e-table-subset.h b/widgets/table/e-table-subset.h index d677583249..25036d1416 100644 --- a/widgets/table/e-table-subset.h +++ b/widgets/table/e-table-subset.h @@ -25,18 +25,17 @@ #ifndef _E_TABLE_SUBSET_H_ #define _E_TABLE_SUBSET_H_ -#include <gtk/gtkobject.h> +#include <glib-object.h> #include <gal/e-table/e-table-model.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define E_TABLE_SUBSET_TYPE (e_table_subset_get_type ()) -#define E_TABLE_SUBSET(o) (GTK_CHECK_CAST ((o), E_TABLE_SUBSET_TYPE, ETableSubset)) -#define E_TABLE_SUBSET_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_SUBSET_TYPE, ETableSubsetClass)) -#define E_IS_TABLE_SUBSET(o) (GTK_CHECK_TYPE ((o), E_TABLE_SUBSET_TYPE)) -#define E_IS_TABLE_SUBSET_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_SUBSET_TYPE)) +#define E_TABLE_SUBSET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SUBSET_TYPE, ETableSubset)) +#define E_TABLE_SUBSET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SUBSET_TYPE, ETableSubsetClass)) +#define E_IS_TABLE_SUBSET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SUBSET_TYPE)) +#define E_IS_TABLE_SUBSET_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SUBSET_TYPE)) +#define E_TABLE_SUBSET_GET_CLASS(o) (G_TYPE_CHECK_CLASS_CAST((o), E_TABLE_SUBSET_TYPE, ETableSubsetClass)) typedef struct { ETableModel base; @@ -68,7 +67,7 @@ typedef struct { void (*proxy_model_rows_deleted) (ETableSubset *etss, ETableModel *etm, int row, int count); } ETableSubsetClass; -GtkType e_table_subset_get_type (void); +GType e_table_subset_get_type (void); ETableModel *e_table_subset_new (ETableModel *etm, int n_vals); ETableModel *e_table_subset_construct (ETableSubset *ets, @@ -84,9 +83,7 @@ ETableModel *e_table_subset_get_toplevel (ETableSubset *table_model); void e_table_subset_print_debugging (ETableSubset *table_model); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* _E_TABLE_SUBSET_H_ */ diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index a97e291bfe..0eed9b8db8 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -170,20 +170,20 @@ et_disconnect_model (ETable *et) return; if (et->table_model_change_id != 0) - gtk_signal_disconnect (GTK_OBJECT (et->model), - et->table_model_change_id); + g_signal_handler_disconnect (G_OBJECT (et->model), + et->table_model_change_id); if (et->table_row_change_id != 0) - gtk_signal_disconnect (GTK_OBJECT (et->model), - et->table_row_change_id); + g_signal_handler_disconnect (G_OBJECT (et->model), + et->table_row_change_id); if (et->table_cell_change_id != 0) - gtk_signal_disconnect (GTK_OBJECT (et->model), - et->table_cell_change_id); + g_signal_handler_disconnect (G_OBJECT (et->model), + et->table_cell_change_id); if (et->table_rows_inserted_id != 0) - gtk_signal_disconnect (GTK_OBJECT (et->model), - et->table_rows_inserted_id); + g_signal_handler_disconnect (G_OBJECT (et->model), + et->table_rows_inserted_id); if (et->table_rows_deleted_id != 0) - gtk_signal_disconnect (GTK_OBJECT (et->model), - et->table_rows_deleted_id); + g_signal_handler_disconnect (G_OBJECT (et->model), + et->table_rows_deleted_id); et->table_model_change_id = 0; et->table_row_change_id = 0; @@ -195,8 +195,7 @@ et_disconnect_model (ETable *et) static void e_table_state_change (ETable *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [STATE_CHANGE]); + g_signal_emit (G_OBJECT (et), et_signals [STATE_CHANGE], 0); } #define CHECK_HORIZONTAL(et) if ((et)->horizontal_scrolling || (et)->horizontal_resize) e_table_header_update_horizontal (et->header); @@ -278,7 +277,7 @@ disconnect_header (ETable *e_table) g_signal_handler_disconnect (G_OBJECT (e_table->header), e_table->dimension_change_id); - g_object_unref(G_OBJECT(e_table->header)); + g_object_unref(e_table->header); e_table->header = NULL; } @@ -315,19 +314,19 @@ et_destroy (GtkObject *object) if (et->search_accept_id) g_signal_handler_disconnect (G_OBJECT (et->search), et->search_accept_id); - g_object_unref (G_OBJECT (et->search)); + g_object_unref (et->search); et->search = NULL; } if (et->group_info_change_id) { - gtk_signal_disconnect (GTK_OBJECT (et->sort_info), - et->group_info_change_id); + g_signal_handler_disconnect (G_OBJECT (et->sort_info), + et->group_info_change_id); et->group_info_change_id = 0; } if (et->sort_info_change_id) { - gtk_signal_disconnect (GTK_OBJECT (et->sort_info), - et->sort_info_change_id); + g_signal_handler_disconnect (G_OBJECT (et->sort_info), + et->sort_info_change_id); et->sort_info_change_id = 0; } @@ -341,32 +340,32 @@ et_destroy (GtkObject *object) disconnect_header (et); if (et->model) { - gtk_object_unref (GTK_OBJECT (et->model)); + g_object_unref (et->model); et->model = NULL; } if (et->full_header) { - g_object_unref (G_OBJECT (et->full_header)); + g_object_unref (et->full_header); et->full_header = NULL; } if (et->sort_info) { - gtk_object_unref (GTK_OBJECT (et->sort_info)); + g_object_unref (et->sort_info); et->sort_info = NULL; } if (et->sorter) { - gtk_object_unref (GTK_OBJECT (et->sorter)); + g_object_unref (et->sorter); et->sorter = NULL; } if (et->selection) { - gtk_object_unref (GTK_OBJECT (et->selection)); + g_object_unref (et->selection); et->selection = NULL; } if (et->spec) { - g_object_unref (G_OBJECT (et->spec)); + g_object_unref (et->spec); et->spec = NULL; } @@ -674,9 +673,9 @@ e_table_setup_header (ETable *e_table) g_free(pointer); - gtk_signal_connect ( - GTK_OBJECT (e_table->header_canvas), "size_allocate", - GTK_SIGNAL_FUNC (header_canvas_size_allocate), e_table); + g_signal_connect ( + G_OBJECT (e_table->header_canvas), "size_allocate", + G_CALLBACK (header_canvas_size_allocate), e_table); gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -2, E_TABLE_HEADER_ITEM (e_table->header_item)->height); @@ -763,9 +762,7 @@ group_cursor_change (ETableGroup *etg, int row, ETable *et) old_cursor_loc = et->cursor_loc; et->cursor_loc = E_TABLE_CURSOR_LOC_TABLE; - gtk_signal_emit (GTK_OBJECT (et), - et_signals [CURSOR_CHANGE], - row); + g_signal_emit (G_OBJECT (et), et_signals [CURSOR_CHANGE], 0, row); if (old_cursor_loc == E_TABLE_CURSOR_LOC_ETCTA && et->click_to_add) e_table_click_to_add_commit(E_TABLE_CLICK_TO_ADD(et->click_to_add)); @@ -774,26 +771,20 @@ group_cursor_change (ETableGroup *etg, int row, ETable *et) static void group_cursor_activated (ETableGroup *etg, int row, ETable *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [CURSOR_ACTIVATED], - row); + g_signal_emit (G_OBJECT (et), et_signals [CURSOR_ACTIVATED], 0, row); } static void group_double_click (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [DOUBLE_CLICK], - row, col, event); + g_signal_emit (G_OBJECT (et), et_signals [DOUBLE_CLICK], 0, row, col, event); } static gint group_right_click (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et) { int return_val = 0; - gtk_signal_emit (GTK_OBJECT (et), - et_signals [RIGHT_CLICK], - row, col, event, &return_val); + g_signal_emit (G_OBJECT (et), et_signals [RIGHT_CLICK], 0, row, col, event, &return_val); return return_val; } @@ -801,9 +792,7 @@ static gint group_click (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et) { int return_val = 0; - gtk_signal_emit (GTK_OBJECT (et), - et_signals [CLICK], - row, col, event, &return_val); + g_signal_emit (G_OBJECT (et), et_signals [CLICK], 0, row, col, event, &return_val); return return_val; } @@ -858,9 +847,8 @@ group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et (key->keyval >= GDK_A && key->keyval <= GDK_Z) || (key->keyval >= GDK_0 && key->keyval <= GDK_9))) e_table_search_input_character (et->search, key->keyval); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [KEY_PRESS], - row, col, event, &return_val); + g_signal_emit (G_OBJECT (et), et_signals [KEY_PRESS], 0, + row, col, event, &return_val); break; } return return_val; @@ -870,9 +858,8 @@ static gint group_start_drag (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et) { int return_val = 0; - gtk_signal_emit (GTK_OBJECT (et), - et_signals [START_DRAG], - row, col, event, &return_val); + g_signal_emit (G_OBJECT (et), et_signals [START_DRAG], 0, + row, col, event, &return_val); return return_val; } @@ -962,40 +949,40 @@ et_build_groups (ETable *et) "selection_model", et->selection, NULL); - gtk_signal_connect (GTK_OBJECT (et->group), "cursor_change", - GTK_SIGNAL_FUNC (group_cursor_change), et); - gtk_signal_connect (GTK_OBJECT (et->group), "cursor_activated", - GTK_SIGNAL_FUNC (group_cursor_activated), et); - gtk_signal_connect (GTK_OBJECT (et->group), "double_click", - GTK_SIGNAL_FUNC (group_double_click), et); - gtk_signal_connect (GTK_OBJECT (et->group), "right_click", - GTK_SIGNAL_FUNC (group_right_click), et); - gtk_signal_connect (GTK_OBJECT (et->group), "click", - GTK_SIGNAL_FUNC (group_click), et); - gtk_signal_connect (GTK_OBJECT (et->group), "key_press", - GTK_SIGNAL_FUNC (group_key_press), et); - gtk_signal_connect (GTK_OBJECT (et->group), "start_drag", - GTK_SIGNAL_FUNC (group_start_drag), et); + g_signal_connect (G_OBJECT (et->group), "cursor_change", + G_CALLBACK (group_cursor_change), et); + g_signal_connect (G_OBJECT (et->group), "cursor_activated", + G_CALLBACK (group_cursor_activated), et); + g_signal_connect (G_OBJECT (et->group), "double_click", + G_CALLBACK (group_double_click), et); + g_signal_connect (G_OBJECT (et->group), "right_click", + G_CALLBACK (group_right_click), et); + g_signal_connect (G_OBJECT (et->group), "click", + G_CALLBACK (group_click), et); + g_signal_connect (G_OBJECT (et->group), "key_press", + G_CALLBACK (group_key_press), et); + g_signal_connect (G_OBJECT (et->group), "start_drag", + G_CALLBACK (group_start_drag), et); if (!(et->is_grouped) && was_grouped) et_disconnect_model (et); if (et->is_grouped && (!was_grouped)) { - et->table_model_change_id = gtk_signal_connect (GTK_OBJECT (et->model), "model_changed", - GTK_SIGNAL_FUNC (et_table_model_changed), et); + et->table_model_change_id = g_signal_connect (G_OBJECT (et->model), "model_changed", + G_CALLBACK (et_table_model_changed), et); - et->table_row_change_id = gtk_signal_connect (GTK_OBJECT (et->model), "model_row_changed", - GTK_SIGNAL_FUNC (et_table_row_changed), et); + et->table_row_change_id = g_signal_connect (G_OBJECT (et->model), "model_row_changed", + G_CALLBACK (et_table_row_changed), et); - et->table_cell_change_id = gtk_signal_connect (GTK_OBJECT (et->model), "model_cell_changed", - GTK_SIGNAL_FUNC (et_table_cell_changed), et); + et->table_cell_change_id = g_signal_connect (G_OBJECT (et->model), "model_cell_changed", + G_CALLBACK (et_table_cell_changed), et); - et->table_rows_inserted_id = gtk_signal_connect (GTK_OBJECT (et->model), "model_rows_inserted", - GTK_SIGNAL_FUNC (et_table_rows_inserted), et); + et->table_rows_inserted_id = g_signal_connect (G_OBJECT (et->model), "model_rows_inserted", + G_CALLBACK (et_table_rows_inserted), et); - et->table_rows_deleted_id = gtk_signal_connect (GTK_OBJECT (et->model), "model_rows_deleted", - GTK_SIGNAL_FUNC (et_table_rows_deleted), et); + et->table_rows_deleted_id = g_signal_connect (G_OBJECT (et->model), "model_rows_deleted", + G_CALLBACK (et_table_rows_deleted), et); } @@ -1044,9 +1031,8 @@ static gint white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETable *e_table) { int return_val = 0; - gtk_signal_emit (GTK_OBJECT (e_table), - et_signals [WHITE_SPACE_EVENT], - event, &return_val); + g_signal_emit (GTK_OBJECT (e_table), et_signals [WHITE_SPACE_EVENT], 0, + event, &return_val); return return_val; } @@ -1134,43 +1120,43 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h ETableModel *model) { e_table->table_canvas = GNOME_CANVAS (e_canvas_new ()); - gtk_signal_connect ( - GTK_OBJECT (e_table->table_canvas), "size_allocate", - GTK_SIGNAL_FUNC (table_canvas_size_allocate), e_table); - gtk_signal_connect ( - GTK_OBJECT (e_table->table_canvas), "focus_in_event", - GTK_SIGNAL_FUNC (table_canvas_focus_event_cb), e_table); - gtk_signal_connect ( - GTK_OBJECT (e_table->table_canvas), "focus_out_event", - GTK_SIGNAL_FUNC (table_canvas_focus_event_cb), e_table); - - gtk_signal_connect ( - GTK_OBJECT (e_table), "drag_begin", - GTK_SIGNAL_FUNC (et_drag_begin), e_table); - gtk_signal_connect ( - GTK_OBJECT (e_table), "drag_end", - GTK_SIGNAL_FUNC (et_drag_end), e_table); - gtk_signal_connect ( - GTK_OBJECT (e_table), "drag_data_get", - GTK_SIGNAL_FUNC (et_drag_data_get), e_table); - gtk_signal_connect ( - GTK_OBJECT (e_table), "drag_data_delete", - GTK_SIGNAL_FUNC (et_drag_data_delete), e_table); - gtk_signal_connect ( - GTK_OBJECT (e_table), "drag_motion", - GTK_SIGNAL_FUNC (et_drag_motion), e_table); - gtk_signal_connect ( - GTK_OBJECT (e_table), "drag_leave", - GTK_SIGNAL_FUNC (et_drag_leave), e_table); - gtk_signal_connect ( - GTK_OBJECT (e_table), "drag_drop", - GTK_SIGNAL_FUNC (et_drag_drop), e_table); - gtk_signal_connect ( - GTK_OBJECT (e_table), "drag_data_received", - GTK_SIGNAL_FUNC (et_drag_data_received), e_table); - - gtk_signal_connect (GTK_OBJECT(e_table->table_canvas), "reflow", - GTK_SIGNAL_FUNC (table_canvas_reflow), e_table); + g_signal_connect ( + G_OBJECT (e_table->table_canvas), "size_allocate", + G_CALLBACK (table_canvas_size_allocate), e_table); + g_signal_connect ( + G_OBJECT (e_table->table_canvas), "focus_in_event", + G_CALLBACK (table_canvas_focus_event_cb), e_table); + g_signal_connect ( + G_OBJECT (e_table->table_canvas), "focus_out_event", + G_CALLBACK (table_canvas_focus_event_cb), e_table); + + g_signal_connect ( + G_OBJECT (e_table), "drag_begin", + G_CALLBACK (et_drag_begin), e_table); + g_signal_connect ( + G_OBJECT (e_table), "drag_end", + G_CALLBACK (et_drag_end), e_table); + g_signal_connect ( + G_OBJECT (e_table), "drag_data_get", + G_CALLBACK (et_drag_data_get), e_table); + g_signal_connect ( + G_OBJECT (e_table), "drag_data_delete", + G_CALLBACK (et_drag_data_delete), e_table); + g_signal_connect ( + G_OBJECT (e_table), "drag_motion", + G_CALLBACK (et_drag_motion), e_table); + g_signal_connect ( + G_OBJECT (e_table), "drag_leave", + G_CALLBACK (et_drag_leave), e_table); + g_signal_connect ( + G_OBJECT (e_table), "drag_drop", + G_CALLBACK (et_drag_drop), e_table); + g_signal_connect ( + G_OBJECT (e_table), "drag_data_received", + G_CALLBACK (et_drag_data_received), e_table); + + g_signal_connect (G_OBJECT(e_table->table_canvas), "reflow", + G_CALLBACK (table_canvas_reflow), e_table); gtk_widget_show (GTK_WIDGET (e_table->table_canvas)); @@ -1181,14 +1167,14 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h "fill_color_gdk", >K_WIDGET(e_table->table_canvas)->style->base[GTK_STATE_NORMAL], NULL); - gtk_signal_connect (GTK_OBJECT (e_table->white_item), "event", - GTK_SIGNAL_FUNC (white_item_event), e_table); + g_signal_connect (G_OBJECT (e_table->white_item), "event", + G_CALLBACK (white_item_event), e_table); - gtk_signal_connect (GTK_OBJECT(e_table->table_canvas), "realize", - GTK_SIGNAL_FUNC(et_canvas_realize), e_table); + g_signal_connect (G_OBJECT(e_table->table_canvas), "realize", + G_CALLBACK(et_canvas_realize), e_table); - gtk_signal_connect (GTK_OBJECT(gnome_canvas_root (e_table->table_canvas)), "event", - GTK_SIGNAL_FUNC(et_canvas_root_event), e_table); + g_signal_connect (G_OBJECT(gnome_canvas_root (e_table->table_canvas)), "event", + G_CALLBACK(et_canvas_root_event), e_table); e_table->canvas_vbox = gnome_canvas_item_new( gnome_canvas_root(e_table->table_canvas), @@ -1216,9 +1202,9 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h E_CANVAS_VBOX(e_table->canvas_vbox), e_table->click_to_add); - gtk_signal_connect ( - GTK_OBJECT (e_table->click_to_add), "cursor_change", - GTK_SIGNAL_FUNC(click_to_add_cursor_change), e_table); + g_signal_connect ( + G_OBJECT (e_table->click_to_add), "cursor_change", + G_CALLBACK (click_to_add_cursor_change), e_table); } } @@ -1251,26 +1237,22 @@ e_table_set_state_object(ETable *e_table, ETableState *state) if (e_table->sort_info) { if (e_table->group_info_change_id) - gtk_signal_disconnect (GTK_OBJECT (e_table->sort_info), - e_table->group_info_change_id); + g_signal_handler_disconnect (G_OBJECT (e_table->sort_info), + e_table->group_info_change_id); if (e_table->sort_info_change_id) - gtk_signal_disconnect (GTK_OBJECT (e_table->sort_info), - e_table->sort_info_change_id); - gtk_object_unref(GTK_OBJECT(e_table->sort_info)); + g_signal_handler_disconnect (G_OBJECT (e_table->sort_info), + e_table->sort_info_change_id); + g_object_unref(e_table->sort_info); } if (state->sort_info) { e_table->sort_info = e_table_sort_info_duplicate(state->sort_info); e_table_sort_info_set_can_group (e_table->sort_info, e_table->allow_grouping); e_table->group_info_change_id = - gtk_signal_connect (GTK_OBJECT (e_table->sort_info), - "group_info_changed", - GTK_SIGNAL_FUNC (group_info_changed), - e_table); + g_signal_connect (G_OBJECT (e_table->sort_info), "group_info_changed", + G_CALLBACK (group_info_changed), e_table); e_table->sort_info_change_id = - gtk_signal_connect (GTK_OBJECT (e_table->sort_info), - "sort_info_changed", - GTK_SIGNAL_FUNC (sort_info_changed), - e_table); + g_signal_connect (G_OBJECT (e_table->sort_info), "sort_info_changed", + G_CALLBACK (sort_info_changed), e_table); } else e_table->sort_info = NULL; @@ -1318,7 +1300,7 @@ e_table_set_state (ETable *e_table, if (state->col_count > 0) e_table_set_state_object(e_table, state); - gtk_object_unref(GTK_OBJECT(state)); + g_object_unref(state); } /** @@ -1345,7 +1327,7 @@ e_table_load_state (ETable *e_table, if (state->col_count > 0) e_table_set_state_object(e_table, state); - gtk_object_unref(GTK_OBJECT(state)); + g_object_unref(state); } /** @@ -1367,7 +1349,7 @@ e_table_get_state_object (ETable *e_table) state = e_table_state_new(); state->sort_info = e_table->sort_info; - gtk_object_ref(GTK_OBJECT(state->sort_info)); + g_object_ref(state->sort_info); state->col_count = e_table_header_count (e_table->header); @@ -1406,7 +1388,7 @@ gchar *e_table_get_state (ETable *e_table state = e_table_get_state_object(e_table); string = e_table_state_save_to_string(state); - gtk_object_unref(GTK_OBJECT(state)); + g_object_unref(state); return string; } @@ -1427,21 +1409,19 @@ e_table_save_state (ETable *e_table, state = e_table_get_state_object(e_table); e_table_state_save_to_file(state, filename); - gtk_object_unref(GTK_OBJECT(state)); + g_object_unref(state); } static void et_selection_model_selection_changed (ETableGroup *etg, ETable *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [SELECTION_CHANGE]); + g_signal_emit (G_OBJECT (et), et_signals [SELECTION_CHANGE], 0); } static void et_selection_model_selection_row_changed (ETableGroup *etg, int row, ETable *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [SELECTION_CHANGE]); + g_signal_emit (G_OBJECT (et), et_signals [SELECTION_CHANGE], 0); } static ETable * @@ -1454,10 +1434,10 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, g_value_init (val, G_TYPE_OBJECT); if (ete) - g_object_ref(G_OBJECT(ete)); + g_object_ref(ete); else { ete = e_table_extras_new(); - g_object_ref(G_OBJECT(ete)); + g_object_ref(ete); } e_table->domain = g_strdup (specification->domain); @@ -1473,7 +1453,7 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, e_table->draw_focus = specification->draw_focus; e_table->cursor_mode = specification->cursor_mode; e_table->full_header = e_table_spec_to_full_header(specification, ete); - g_object_ref (G_OBJECT (e_table->full_header)); + g_object_ref (e_table->full_header); col_count = e_table_header_count (e_table->full_header); for (i = 0; i < col_count; i++) { @@ -1486,7 +1466,7 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, } e_table->model = etm; - gtk_object_ref (GTK_OBJECT (etm)); + g_object_ref (etm); gtk_widget_push_colormap (gdk_rgb_get_cmap ()); @@ -1496,16 +1476,16 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, e_table->allow_grouping = specification->allow_grouping; e_table->sort_info = state->sort_info; - gtk_object_ref (GTK_OBJECT (state->sort_info)); + g_object_ref (state->sort_info); e_table_sort_info_set_can_group (e_table->sort_info, e_table->allow_grouping); e_table->group_info_change_id = - gtk_signal_connect (GTK_OBJECT (e_table->sort_info), "group_info_changed", - GTK_SIGNAL_FUNC (group_info_changed), e_table); + g_signal_connect (G_OBJECT (e_table->sort_info), "group_info_changed", + G_CALLBACK (group_info_changed), e_table); e_table->sort_info_change_id = - gtk_signal_connect (GTK_OBJECT (e_table->sort_info), "sort_info_changed", - GTK_SIGNAL_FUNC (sort_info_changed), e_table); + g_signal_connect (G_OBJECT (e_table->sort_info), "sort_info_changed", + G_CALLBACK (sort_info_changed), e_table); g_value_set_object (val, e_table->sort_info); @@ -1513,7 +1493,7 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, g_free (val); e_table->sorter = e_table_sorter_new(etm, e_table->full_header, e_table->sort_info); - gtk_object_ref (GTK_OBJECT (e_table->sorter)); + g_object_ref (e_table->sorter); gtk_object_sink (GTK_OBJECT (e_table->sorter)); gtk_object_set (GTK_OBJECT (e_table->selection), @@ -1524,10 +1504,10 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, "header", e_table->header, NULL); - gtk_signal_connect(GTK_OBJECT(e_table->selection), "selection_changed", - GTK_SIGNAL_FUNC(et_selection_model_selection_changed), e_table); - gtk_signal_connect(GTK_OBJECT(e_table->selection), "selection_row_changed", - GTK_SIGNAL_FUNC(et_selection_model_selection_row_changed), e_table); + g_signal_connect(G_OBJECT(e_table->selection), "selection_changed", + G_CALLBACK (et_selection_model_selection_changed), e_table); + g_signal_connect(G_OBJECT(e_table->selection), "selection_row_changed", + G_CALLBACK (et_selection_model_selection_row_changed), e_table); if (!specification->no_headers) { e_table_setup_header (e_table); @@ -1558,7 +1538,7 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, gtk_widget_pop_colormap (); - g_object_unref(G_OBJECT(ete)); + g_object_unref(ete); return e_table; } @@ -1591,35 +1571,33 @@ e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); g_return_val_if_fail(spec_str != NULL, NULL); - gtk_object_ref (GTK_OBJECT (etm)); - gtk_object_sink (GTK_OBJECT (etm)); + g_object_ref (etm); specification = e_table_specification_new(); - g_object_ref (G_OBJECT (specification)); + g_object_ref (specification); if (!e_table_specification_load_from_string(specification, spec_str)) { - g_object_unref(G_OBJECT(specification)); + g_object_unref(specification); return NULL; } if (state_str) { state = e_table_state_new(); - gtk_object_ref (GTK_OBJECT (state)); - gtk_object_sink (GTK_OBJECT (state)); + g_object_ref (state); e_table_state_load_from_string(state, state_str); if (state->col_count <= 0) { - gtk_object_unref(GTK_OBJECT(state)); + g_object_unref(state); state = specification->state; - gtk_object_ref(GTK_OBJECT(state)); + g_object_ref(state); } } else { state = specification->state; - gtk_object_ref(GTK_OBJECT(state)); + g_object_ref(state); } e_table = et_real_construct (e_table, etm, ete, specification, state); e_table->spec = specification; - gtk_object_unref(GTK_OBJECT(state)); + g_object_unref(state); return e_table; } @@ -1655,31 +1633,31 @@ e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtra specification = e_table_specification_new(); if (!e_table_specification_load_from_file(specification, spec_fn)) { - g_object_unref(G_OBJECT(specification)); + g_object_unref(specification); return NULL; } if (state_fn) { state = e_table_state_new(); if (!e_table_state_load_from_file(state, state_fn)) { - gtk_object_unref(GTK_OBJECT(state)); + g_object_unref(state); state = specification->state; - gtk_object_ref(GTK_OBJECT(state)); + g_object_ref(state); } if (state->col_count <= 0) { - gtk_object_unref(GTK_OBJECT(state)); + g_object_unref(state); state = specification->state; - gtk_object_ref(GTK_OBJECT(state)); + g_object_ref(state); } } else { state = specification->state; - gtk_object_ref(GTK_OBJECT(state)); + g_object_ref(state); } e_table = et_real_construct (e_table, etm, ete, specification, state); e_table->spec = specification; - gtk_object_unref(GTK_OBJECT(state)); + g_object_unref(state); return e_table; } @@ -2139,8 +2117,8 @@ et_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) e_canvas_vbox_add_item_start (E_CANVAS_VBOX(etable->canvas_vbox), etable->click_to_add); - gtk_signal_connect (GTK_OBJECT (etable->click_to_add), "cursor_change", - GTK_SIGNAL_FUNC(click_to_add_cursor_change), etable); + g_signal_connect (G_OBJECT (etable->click_to_add), "cursor_change", + G_CALLBACK (click_to_add_cursor_change), etable); } else { gtk_object_destroy (GTK_OBJECT (etable->click_to_add)); etable->click_to_add = NULL; @@ -2732,11 +2710,8 @@ et_drag_begin (GtkWidget *widget, GdkDragContext *context, ETable *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_BEGIN], - et->drag_row, - et->drag_col, - context); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_BEGIN], 0, + et->drag_row, et->drag_col, context); } static void @@ -2744,11 +2719,8 @@ et_drag_end (GtkWidget *widget, GdkDragContext *context, ETable *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_END], - et->drag_row, - et->drag_col, - context); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_END], 0, + et->drag_row, et->drag_col, context); } static void @@ -2759,14 +2731,9 @@ et_drag_data_get(GtkWidget *widget, guint time, ETable *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_DATA_GET], - et->drag_row, - et->drag_col, - context, - selection_data, - info, - time); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DATA_GET], 0, + et->drag_row, et->drag_col, context, selection_data, + info, time); } static void @@ -2774,11 +2741,8 @@ et_drag_data_delete(GtkWidget *widget, GdkDragContext *context, ETable *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_DATA_DELETE], - et->drag_row, - et->drag_col, - context); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DATA_DELETE], 0, + et->drag_row, et->drag_col, context); } static gboolean @@ -2800,24 +2764,13 @@ do_drag_motion(ETable *et, e_table_get_cell_at (et, x, y, &row, &col); if (row != et->drop_row && col != et->drop_row) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_LEAVE], - et->drop_row, - et->drop_col, - context, - time); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_LEAVE], 0, + et->drop_row, et->drop_col, context, time); } et->drop_row = row; et->drop_col = col; - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_MOTION], - et->drop_row, - et->drop_col, - context, - x, - y, - time, - &ret_val); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_MOTION], 0, + et->drop_row, et->drop_col, context, x, y, time, &ret_val); return ret_val; } @@ -2896,14 +2849,14 @@ context_destroyed (gpointer data) et->last_drop_context = NULL; scroll_off (et); } - gtk_object_unref (GTK_OBJECT (et)); + g_object_unref (et); } static void context_connect (ETable *et, GdkDragContext *context) { if (g_dataset_get_data (context, "e-table") == NULL) { - gtk_object_ref (GTK_OBJECT (et)); + g_object_ref (et); g_dataset_set_data_full (context, "e-table", et, context_destroyed); } } @@ -2914,12 +2867,8 @@ et_drag_leave(GtkWidget *widget, guint time, ETable *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_LEAVE], - et->drop_row, - et->drop_col, - context, - time); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_LEAVE], 0, + et->drop_row, et->drop_col, context, time); et->drop_row = -1; et->drop_col = -1; @@ -2987,33 +2936,15 @@ et_drag_drop(GtkWidget *widget, e_table_get_cell_at (et, x, y, &row, &col); if (row != et->drop_row && col != et->drop_row) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_LEAVE], - et->drop_row, - et->drop_col, - context, - time); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_MOTION], - row, - col, - context, - x, - y, - time, - &ret_val); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_LEAVE], 0, + et->drop_row, et->drop_col, context, time); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_MOTION], 0, + row, col, context, x, y, time, &ret_val); } et->drop_row = row; et->drop_col = col; - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_DROP], - et->drop_row, - et->drop_col, - context, - x, - y, - time, - &ret_val); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DROP], 0, + et->drop_row, et->drop_col, context, x, y, time, &ret_val); et->drop_row = -1; et->drop_col = -1; @@ -3039,16 +2970,8 @@ et_drag_data_received(GtkWidget *widget, e_table_get_cell_at (et, x, y, &row, &col); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TABLE_DRAG_DATA_RECEIVED], - row, - col, - context, - x, - y, - selection_data, - info, - time); + g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DATA_RECEIVED], 0, + row, col, context, x, y, selection_data, info, time); } static void @@ -3062,7 +2985,7 @@ e_table_class_init (ETableClass *class) widget_class = (GtkWidgetClass *) class; container_class = (GtkContainerClass *) class; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_peek_parent (class); object_class->destroy = et_destroy; G_OBJECT_CLASS (object_class)->finalize = et_finalize; |