diff options
69 files changed, 4783 insertions, 4140 deletions
diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c index 0f842c5507..5ef4b23a96 100644 --- a/widgets/table/e-cell-checkbox.c +++ b/widgets/table/e-cell-checkbox.c @@ -59,7 +59,7 @@ E_MAKE_TYPE(e_cell_checkbox, "ECellCheckbox", ECellCheckbox, e_cell_checkbox_cla ECell * e_cell_checkbox_new (void) { - ECellCheckbox *eccb = gtk_type_new (e_cell_checkbox_get_type ()); + ECellCheckbox *eccb = g_object_new (E_CELL_CHECKBOX_TYPE, NULL); e_cell_toggle_construct (E_CELL_TOGGLE (eccb), 2, 2, checks); diff --git a/widgets/table/e-cell-checkbox.h b/widgets/table/e-cell-checkbox.h index f77f33c5d8..ab56af27ab 100644 --- a/widgets/table/e-cell-checkbox.h +++ b/widgets/table/e-cell-checkbox.h @@ -28,10 +28,10 @@ G_BEGIN_DECLS #define E_CELL_CHECKBOX_TYPE (e_cell_checkbox_get_type ()) -#define E_CELL_CHECKBOX(o) (GTK_CHECK_CAST ((o), E_CELL_CHECKBOX_TYPE, ECellCheckbox)) -#define E_CELL_CHECKBOX_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_CHECKBOX_TYPE, ECellCheckboxClass)) -#define E_IS_CELL_CHECKBOX(o) (GTK_CHECK_TYPE ((o), E_CELL_CHECKBOX_TYPE)) -#define E_IS_CELL_CHECKBOX_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_CHECKBOX_TYPE)) +#define E_CELL_CHECKBOX(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_CHECKBOX_TYPE, ECellCheckbox)) +#define E_CELL_CHECKBOX_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_CHECKBOX_TYPE, ECellCheckboxClass)) +#define E_IS_CELL_CHECKBOX(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_CHECKBOX_TYPE)) +#define E_IS_CELL_CHECKBOX_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_CHECKBOX_TYPE)) typedef struct { ECellToggle parent; @@ -41,7 +41,7 @@ typedef struct { ECellToggleClass parent_class; } ECellCheckboxClass; -GtkType e_cell_checkbox_get_type (void); +GType e_cell_checkbox_get_type (void); ECell *e_cell_checkbox_new (void); G_END_DECLS diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 1f54952de7..3199e9b917 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -72,9 +72,9 @@ #define E_CELL_COMBO_UTF8_KEY "UTF-8-TEXT" -static void e_cell_combo_class_init (GtkObjectClass *object_class); +static void e_cell_combo_class_init (GObjectClass *object_class); static void e_cell_combo_init (ECellCombo *ecc); -static void e_cell_combo_destroy (GtkObject *object); +static void e_cell_combo_dispose (GObject *object); static gint e_cell_combo_do_popup (ECellPopup *ecp, GdkEvent *event, @@ -115,15 +115,15 @@ E_MAKE_TYPE (e_cell_combo, "ECellCombo", ECellCombo, static void -e_cell_combo_class_init (GtkObjectClass *object_class) +e_cell_combo_class_init (GObjectClass *object_class) { ECellPopupClass *ecpc = (ECellPopupClass *) object_class; - object_class->destroy = e_cell_combo_destroy; + object_class->dispose = e_cell_combo_dispose; ecpc->popup = e_cell_combo_do_popup; - parent_class = gtk_type_class (e_cell_popup_get_type ()); + parent_class = g_type_class_ref (E_CELL_POPUP_TYPE); } @@ -163,19 +163,19 @@ e_cell_combo_init (ECellCombo *ecc) gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window))); gtk_widget_show (ecc->popup_list); - gtk_signal_connect (GTK_OBJECT (ecc->popup_window), - "button_press_event", - GTK_SIGNAL_FUNC (e_cell_combo_button_press), - ecc); + g_signal_connect (ecc->popup_window, + "button_press_event", + G_CALLBACK (e_cell_combo_button_press), + ecc); /* We use connect_after here so the list updates the selection before we hide the popup and update the cell. */ - gtk_signal_connect_after (GTK_OBJECT (ecc->popup_window), - "button_release_event", - GTK_SIGNAL_FUNC (e_cell_combo_button_release), - ecc); - gtk_signal_connect (GTK_OBJECT (ecc->popup_window), - "key_press_event", - GTK_SIGNAL_FUNC (e_cell_combo_key_press), ecc); + g_signal_connect_after (ecc->popup_window, + "button_release_event", + G_CALLBACK (e_cell_combo_button_release), + ecc); + g_signal_connect (ecc->popup_window, + "key_press_event", + G_CALLBACK (e_cell_combo_key_press), ecc); } @@ -189,17 +189,17 @@ e_cell_combo_init (ECellCombo *ecc) ECell * e_cell_combo_new (void) { - ECellCombo *ecc = gtk_type_new (e_cell_combo_get_type ()); + ECellCombo *ecc = g_object_new (E_CELL_COMBO_TYPE, NULL); return (ECell*) ecc; } /* - * GtkObject::destroy method + * GObject::dispose method */ static void -e_cell_combo_destroy (GtkObject *object) +e_cell_combo_dispose (GObject *object) { ECellCombo *ecc = E_CELL_COMBO (object); @@ -207,7 +207,7 @@ e_cell_combo_destroy (GtkObject *object) gtk_widget_destroy (ecc->popup_window); ecc->popup_window = NULL; - GTK_OBJECT_CLASS (parent_class)->destroy (object); + G_OBJECT_CLASS (parent_class)->dispose (object); } @@ -238,9 +238,9 @@ e_cell_combo_set_popdown_strings (ECellCombo *ecc, gtk_widget_show (listitem); gtk_container_add (GTK_CONTAINER (ecc->popup_list), listitem); - gtk_object_set_data_full (GTK_OBJECT (listitem), - E_CELL_COMBO_UTF8_KEY, - g_strdup (utf8_text), g_free); + g_object_set_data_full (G_OBJECT (listitem), + E_CELL_COMBO_UTF8_KEY, + g_strdup (utf8_text), g_free); elem = elem->next; } @@ -306,8 +306,8 @@ e_cell_combo_select_matching_item (ECellCombo *ecc) listitem = GTK_WIDGET (elem->data); /* We need to compare against the UTF-8 text. */ - list_item_text = gtk_object_get_data (GTK_OBJECT (listitem), - E_CELL_COMBO_UTF8_KEY); + list_item_text = g_object_get_data (G_OBJECT (listitem), + E_CELL_COMBO_UTF8_KEY); if (list_item_text && !strcmp (list_item_text, cell_text)) { found = TRUE; @@ -622,8 +622,8 @@ e_cell_combo_update_cell (ECellCombo *ecc) /* Get the text of the selected item. */ listitem = list->selection->data; - text = gtk_object_get_data (GTK_OBJECT (listitem), - E_CELL_COMBO_UTF8_KEY); + text = g_object_get_data (G_OBJECT (listitem), + E_CELL_COMBO_UTF8_KEY); g_return_if_fail (text != NULL); /* Compare it with the existing cell contents. */ diff --git a/widgets/table/e-cell-combo.h b/widgets/table/e-cell-combo.h index 6e64deeb0c..23d5ac26a4 100644 --- a/widgets/table/e-cell-combo.h +++ b/widgets/table/e-cell-combo.h @@ -34,10 +34,10 @@ #include <gal/e-table/e-cell-popup.h> #define E_CELL_COMBO_TYPE (e_cell_combo_get_type ()) -#define E_CELL_COMBO(o) (GTK_CHECK_CAST ((o), E_CELL_COMBO_TYPE, ECellCombo)) -#define E_CELL_COMBO_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_COMBO_TYPE, ECellComboClass)) -#define E_IS_CELL_COMBO(o) (GTK_CHECK_TYPE ((o), E_CELL_COMBO_TYPE)) -#define E_IS_CELL_COMBO_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_COMBO_TYPE)) +#define E_CELL_COMBO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_COMBO_TYPE, ECellCombo)) +#define E_CELL_COMBO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_COMBO_TYPE, ECellComboClass)) +#define E_IS_CELL_COMBO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_COMBO_TYPE)) +#define E_IS_CELL_COMBO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_COMBO_TYPE)) typedef struct { @@ -53,7 +53,7 @@ typedef struct { } ECellComboClass; -GtkType e_cell_combo_get_type (void); +GType e_cell_combo_get_type (void); ECell *e_cell_combo_new (void); /* These must be UTF-8. */ diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index 188d136ce6..2b9c97c955 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -134,7 +134,7 @@ e_cell_date_class_init (GtkObjectClass *object_class) { ECellTextClass *ectc = (ECellTextClass *) object_class; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); ectc->get_text = ecd_get_text; ectc->free_text = ecd_free_text; @@ -172,7 +172,7 @@ e_cell_date_init (GtkObject *object) ECell * e_cell_date_new (const char *fontname, GtkJustification justify) { - ECellDate *ecd = gtk_type_new (e_cell_date_get_type ()); + ECellDate *ecd = g_object_new (E_CELL_DATE_TYPE, NULL); e_cell_text_construct(E_CELL_TEXT(ecd), fontname, justify); diff --git a/widgets/table/e-cell-date.h b/widgets/table/e-cell-date.h index f86eb5a1a5..96d5faa5c3 100644 --- a/widgets/table/e-cell-date.h +++ b/widgets/table/e-cell-date.h @@ -28,10 +28,10 @@ G_BEGIN_DECLS #define E_CELL_DATE_TYPE (e_cell_date_get_type ()) -#define E_CELL_DATE(o) (GTK_CHECK_CAST ((o), E_CELL_DATE_TYPE, ECellDate)) -#define E_CELL_DATE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_DATE_TYPE, ECellDateClass)) -#define E_IS_CELL_DATE(o) (GTK_CHECK_TYPE ((o), E_CELL_DATE_TYPE)) -#define E_IS_CELL_DATE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_DATE_TYPE)) +#define E_CELL_DATE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_DATE_TYPE, ECellDate)) +#define E_CELL_DATE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_DATE_TYPE, ECellDateClass)) +#define E_IS_CELL_DATE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_DATE_TYPE)) +#define E_IS_CELL_DATE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_DATE_TYPE)) typedef struct { ECellText base; @@ -41,7 +41,7 @@ typedef struct { ECellTextClass parent_class; } ECellDateClass; -GtkType e_cell_date_get_type (void); +GType e_cell_date_get_type (void); ECell *e_cell_date_new (const char *fontname, GtkJustification justify); G_END_DECLS diff --git a/widgets/table/e-cell-float.c b/widgets/table/e-cell-float.c index aff6c88cc5..133be063b3 100644 --- a/widgets/table/e-cell-float.c +++ b/widgets/table/e-cell-float.c @@ -56,7 +56,7 @@ e_cell_float_class_init (GtkObjectClass *object_class) { ECellTextClass *ectc = (ECellTextClass *) object_class; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); ectc->get_text = ecf_get_text; ectc->free_text = ecf_free_text; @@ -83,7 +83,7 @@ e_cell_float_init (GtkObject *object) ECell * e_cell_float_new (const char *fontname, GtkJustification justify) { - ECellFloat *ecn = gtk_type_new (e_cell_float_get_type ()); + ECellFloat *ecn = g_object_new (E_CELL_FLOAT_TYPE, NULL); e_cell_text_construct(E_CELL_TEXT(ecn), fontname, justify); diff --git a/widgets/table/e-cell-float.h b/widgets/table/e-cell-float.h index 46223bc271..36874406b2 100644 --- a/widgets/table/e-cell-float.h +++ b/widgets/table/e-cell-float.h @@ -32,10 +32,10 @@ G_BEGIN_DECLS #define E_CELL_FLOAT_TYPE (e_cell_float_get_type ()) -#define E_CELL_FLOAT(o) (GTK_CHECK_CAST ((o), E_CELL_FLOAT_TYPE, ECellFloat)) -#define E_CELL_FLOAT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_FLOAT_TYPE, ECellFloatClass)) -#define E_IS_CELL_FLOAT(o) (GTK_CHECK_TYPE ((o), E_CELL_FLOAT_TYPE)) -#define E_IS_CELL_FLOAT_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_FLOAT_TYPE)) +#define E_CELL_FLOAT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_FLOAT_TYPE, ECellFloat)) +#define E_CELL_FLOAT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_FLOAT_TYPE, ECellFloatClass)) +#define E_IS_CELL_FLOAT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_FLOAT_TYPE)) +#define E_IS_CELL_FLOAT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_FLOAT_TYPE)) typedef struct { ECellText base; @@ -45,7 +45,7 @@ typedef struct { ECellTextClass parent_class; } ECellFloatClass; -GtkType e_cell_float_get_type (void); +GType e_cell_float_get_type (void); ECell *e_cell_float_new (const char *fontname, GtkJustification justify); G_END_DECLS diff --git a/widgets/table/e-cell-number.c b/widgets/table/e-cell-number.c index 36defa3508..8c8887df5a 100644 --- a/widgets/table/e-cell-number.c +++ b/widgets/table/e-cell-number.c @@ -48,7 +48,7 @@ e_cell_number_class_init (GtkObjectClass *object_class) { ECellTextClass *ectc = (ECellTextClass *) object_class; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); ectc->get_text = ecn_get_text; ectc->free_text = ecn_free_text; @@ -75,7 +75,7 @@ e_cell_number_init (GtkObject *object) ECell * e_cell_number_new (const char *fontname, GtkJustification justify) { - ECellNumber *ecn = gtk_type_new (e_cell_number_get_type ()); + ECellNumber *ecn = g_object_new (E_CELL_NUMBER_TYPE, NULL); e_cell_text_construct(E_CELL_TEXT(ecn), fontname, justify); diff --git a/widgets/table/e-cell-number.h b/widgets/table/e-cell-number.h index 026a1ba2e5..3cce1ec412 100644 --- a/widgets/table/e-cell-number.h +++ b/widgets/table/e-cell-number.h @@ -28,10 +28,10 @@ G_BEGIN_DECLS #define E_CELL_NUMBER_TYPE (e_cell_number_get_type ()) -#define E_CELL_NUMBER(o) (GTK_CHECK_CAST ((o), E_CELL_NUMBER_TYPE, ECellNumber)) -#define E_CELL_NUMBER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_NUMBER_TYPE, ECellNumberClass)) -#define E_IS_CELL_NUMBER(o) (GTK_CHECK_TYPE ((o), E_CELL_NUMBER_TYPE)) -#define E_IS_CELL_NUMBER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_NUMBER_TYPE)) +#define E_CELL_NUMBER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_NUMBER_TYPE, ECellNumber)) +#define E_CELL_NUMBER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_NUMBER_TYPE, ECellNumberClass)) +#define E_IS_CELL_NUMBER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_NUMBER_TYPE)) +#define E_IS_CELL_NUMBER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_NUMBER_TYPE)) typedef struct { ECellText base; @@ -41,7 +41,7 @@ typedef struct { ECellTextClass parent_class; } ECellNumberClass; -GtkType e_cell_number_get_type (void); +GType e_cell_number_get_type (void); ECell *e_cell_number_new (const char *fontname, GtkJustification justify); G_END_DECLS diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c index d58a75dd1c..50c3b2cc7a 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/widgets/table/e-cell-pixbuf.c @@ -24,7 +24,9 @@ #include <stdio.h> #include <libgnomecanvas/gnome-canvas.h> #include "e-cell-pixbuf.h" +#include <gal/util/e-i18n.h> +#define PARENT_TYPE E_CELL_TYPE static ECellClass *parent_class; typedef struct _ECellPixbufView ECellPixbufView; @@ -36,11 +38,11 @@ struct _ECellPixbufView { /* Object argument IDs */ enum { - ARG_0, + PROP_0, - ARG_SELECTED_COLUMN, - ARG_FOCUSED_COLUMN, - ARG_UNSELECTED_COLUMN + PROP_SELECTED_COLUMN, + PROP_FOCUSED_COLUMN, + PROP_UNSELECTED_COLUMN }; static int @@ -69,7 +71,7 @@ e_cell_pixbuf_new (void) { ECellPixbuf *ecp; - ecp = gtk_type_new (E_CELL_PIXBUF_TYPE); + ecp = g_object_new (E_CELL_PIXBUF_TYPE, NULL); e_cell_pixbuf_construct (ecp); return (ECell *) ecp; @@ -291,30 +293,33 @@ pixbuf_max_width (ECellView *ecell_view, int model_col, int view_col) } static void -pixbuf_destroy (GtkObject *object) +pixbuf_dispose (GObject *object) { - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->dispose) + (* G_OBJECT_CLASS (parent_class)->dispose) (object); } static void -pixbuf_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +pixbuf_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - switch (arg_id) { - case ARG_SELECTED_COLUMN: - pixbuf->selected_column = GTK_VALUE_INT (*arg); + switch (prop_id) { + case PROP_SELECTED_COLUMN: + pixbuf->selected_column = g_value_get_int (value); break; - case ARG_FOCUSED_COLUMN: - pixbuf->focused_column = GTK_VALUE_INT (*arg); + case PROP_FOCUSED_COLUMN: + pixbuf->focused_column = g_value_get_int (value); break; - case ARG_UNSELECTED_COLUMN: - pixbuf->unselected_column = GTK_VALUE_INT (*arg); + case PROP_UNSELECTED_COLUMN: + pixbuf->unselected_column = g_value_get_int (value); break; default: @@ -324,27 +329,30 @@ pixbuf_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) /* Get_arg handler for the pixbuf item */ static void -pixbuf_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +pixbuf_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - switch (arg_id) { - case ARG_SELECTED_COLUMN: - GTK_VALUE_INT (*arg) = pixbuf->selected_column; + switch (prop_id) { + case PROP_SELECTED_COLUMN: + g_value_set_int (value, pixbuf->selected_column); break; - case ARG_FOCUSED_COLUMN: - GTK_VALUE_INT (*arg) = pixbuf->focused_column; + case PROP_FOCUSED_COLUMN: + g_value_set_int (value, pixbuf->focused_column); break; - case ARG_UNSELECTED_COLUMN: - GTK_VALUE_INT (*arg) = pixbuf->unselected_column; + case PROP_UNSELECTED_COLUMN: + g_value_set_int (value, pixbuf->unselected_column); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -360,13 +368,13 @@ e_cell_pixbuf_init (GtkObject *object) } static void -e_cell_pixbuf_class_init (GtkObjectClass *object_class) +e_cell_pixbuf_class_init (GObjectClass *object_class) { ECellClass *ecc = (ECellClass *) object_class; - object_class->destroy = pixbuf_destroy; - object_class->set_arg = pixbuf_set_arg; - object_class->get_arg = pixbuf_get_arg; + object_class->dispose = pixbuf_dispose; + object_class->set_property = pixbuf_set_property; + object_class->get_property = pixbuf_get_property; ecc->new_view = pixbuf_new_view; ecc->kill_view = pixbuf_kill_view; @@ -377,34 +385,33 @@ e_cell_pixbuf_class_init (GtkObjectClass *object_class) ecc->print_height = pixbuf_print_height; ecc->max_width = pixbuf_max_width; - parent_class = gtk_type_class (E_CELL_TYPE); - - gtk_object_add_arg_type ("ECellPixbuf::selected_column", - GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_SELECTED_COLUMN); - gtk_object_add_arg_type ("ECellPixbuf::focused_column", - GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_FOCUSED_COLUMN); - gtk_object_add_arg_type ("ECellPixbuf::unselected_column", - GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_UNSELECTED_COLUMN); -} - -GtkType -e_cell_pixbuf_get_type (void) -{ - static guint type = 0; - - if (!type) { - GtkTypeInfo type_info = { - "ECellPixbuf", - sizeof (ECellPixbuf), - sizeof (ECellPixbufClass), - (GtkClassInitFunc) e_cell_pixbuf_class_init, - (GtkObjectInitFunc) e_cell_pixbuf_init, - NULL, NULL, - }; - - type = gtk_type_unique (e_cell_get_type (), &type_info); - } - - return type; + parent_class = g_type_class_ref (PARENT_TYPE); + + g_object_class_install_property (object_class, PROP_SELECTED_COLUMN, + g_param_spec_int ("selected_column", + _("Selected Column"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_FOCUSED_COLUMN, + g_param_spec_int ("focused_column", + _("Focused Column"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_UNSELECTED_COLUMN, + g_param_spec_int ("unselected_column", + _("Unselected Column"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); } +E_MAKE_TYPE (e_cell_pixbuf, + "ECellPixbuf", + ECellPixbuf, + e_cell_pixbuf_class_init, + e_cell_pixbuf_init, + PARENT_TYPE) diff --git a/widgets/table/e-cell-pixbuf.h b/widgets/table/e-cell-pixbuf.h index c405752723..2f12521d58 100644 --- a/widgets/table/e-cell-pixbuf.h +++ b/widgets/table/e-cell-pixbuf.h @@ -26,10 +26,10 @@ #include <gal/e-table/e-table.h> #define E_CELL_PIXBUF_TYPE (e_cell_pixbuf_get_type ()) -#define E_CELL_PIXBUF(o) (GTK_CHECK_CAST ((o), E_CELL_PIXBUF_TYPE, ECellPixbuf)) -#define E_CELL_PIXBUF_CLASS(k) (GTK_CHECK_CAST_CLASS ((k), E_CELL_PIXBUF_TYPE, ECellPixbufClass)) -#define E_IS_CELL_PIXBUF(o) (GTK_CHECK_TYPE ((o), E_CELL_PIXBUF_TYPE)) -#define E_IS_CELL_PIXBUF_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_PIXBUF_TYPE)) +#define E_CELL_PIXBUF(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_PIXBUF_TYPE, ECellPixbuf)) +#define E_CELL_PIXBUF_CLASS(k) (G_TYPE_CHECK_INSTANCE_CAST_CLASS ((k), E_CELL_PIXBUF_TYPE, ECellPixbufClass)) +#define E_IS_CELL_PIXBUF(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_PIXBUF_TYPE)) +#define E_IS_CELL_PIXBUF_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_PIXBUF_TYPE)) typedef struct _ECellPixbuf ECellPixbuf; typedef struct _ECellPixbufClass ECellPixbufClass; @@ -46,7 +46,7 @@ struct _ECellPixbufClass { ECellClass parent_class; }; -GtkType e_cell_pixbuf_get_type (void); +GType e_cell_pixbuf_get_type (void); ECell *e_cell_pixbuf_new (void); void e_cell_pixbuf_construct (ECellPixbuf *ecp); diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c index 3e9296bcc5..195b6a7aa3 100644 --- a/widgets/table/e-cell-popup.c +++ b/widgets/table/e-cell-popup.c @@ -139,7 +139,7 @@ e_cell_popup_class_init (GtkObjectClass *object_class) ecc->show_tooltip = ecp_show_tooltip; ecc->get_bg_color = ecp_get_bg_color; - parent_class = gtk_type_class (e_cell_get_type ()); + parent_class = g_type_class_ref (E_CELL_TYPE); } @@ -161,7 +161,7 @@ e_cell_popup_init (ECellPopup *ecp) ECell * e_cell_popup_new (void) { - ECellPopup *ecp = gtk_type_new (e_cell_popup_get_type ()); + ECellPopup *ecp = g_object_new (E_CELL_POPUP_TYPE, NULL); return (ECell*) ecp; } diff --git a/widgets/table/e-cell-popup.h b/widgets/table/e-cell-popup.h index a42a4d4f28..26a7429127 100644 --- a/widgets/table/e-cell-popup.h +++ b/widgets/table/e-cell-popup.h @@ -36,10 +36,10 @@ #include <gal/e-table/e-cell.h> #define E_CELL_POPUP_TYPE (e_cell_popup_get_type ()) -#define E_CELL_POPUP(o) (GTK_CHECK_CAST ((o), E_CELL_POPUP_TYPE, ECellPopup)) -#define E_CELL_POPUP_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_POPUP_TYPE, ECellPopupClass)) -#define E_IS_CELL_POPUP(o) (GTK_CHECK_TYPE ((o), E_CELL_POPUP_TYPE)) -#define E_IS_CELL_POPUP_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_POPUP_TYPE)) +#define E_CELL_POPUP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_POPUP_TYPE, ECellPopup)) +#define E_CELL_POPUP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_POPUP_TYPE, ECellPopupClass)) +#define E_IS_CELL_POPUP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_POPUP_TYPE)) +#define E_IS_CELL_POPUP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_POPUP_TYPE)) typedef struct _ECellPopupView ECellPopupView; @@ -82,7 +82,7 @@ struct _ECellPopupView { }; -GtkType e_cell_popup_get_type (void); +GType e_cell_popup_get_type (void); ECell *e_cell_popup_new (void); /* Get and set the child ECell. */ diff --git a/widgets/table/e-cell-progress.c b/widgets/table/e-cell-progress.c index 6f90a0cb3b..bf7fdd9951 100644 --- a/widgets/table/e-cell-progress.c +++ b/widgets/table/e-cell-progress.c @@ -297,7 +297,7 @@ eprog_max_width (ECellView *ecell_view, int model_col, int view_col) } static void -eprog_destroy (GtkObject *object) +eprog_dispose (GObject *object) { ECellProgress *eprog = E_CELL_PROGRESS (object); @@ -305,15 +305,15 @@ eprog_destroy (GtkObject *object) g_free (eprog->image); g_free (eprog->buffer); - GTK_OBJECT_CLASS (parent_class)->destroy (object); + G_OBJECT_CLASS (parent_class)->dispose (object); } static void -e_cell_progress_class_init (GtkObjectClass *object_class) +e_cell_progress_class_init (GObjectClass *object_class) { ECellClass *ecc = (ECellClass *) object_class; - object_class->destroy = eprog_destroy; + object_class->dispose = eprog_dispose; ecc->new_view = eprog_new_view; ecc->kill_view = eprog_kill_view; @@ -324,7 +324,7 @@ e_cell_progress_class_init (GtkObjectClass *object_class) ecc->height = eprog_height; ecc->max_width = eprog_max_width; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); } E_MAKE_TYPE(e_cell_progress, "ECellProgress", ECellProgress, e_cell_progress_class_init, NULL, PARENT_TYPE); @@ -382,7 +382,7 @@ e_cell_progress_construct (ECellProgress *eprog, int padding, int border, int mi ECell * e_cell_progress_new (int min, int max, int width, int height) { - ECellProgress *eprog = gtk_type_new (e_cell_progress_get_type ()); + ECellProgress *eprog = g_object_new (E_CELL_PROGRESS_TYPE, NULL); e_cell_progress_construct (eprog, 1, 1, min, max, (width<9) ? 9 : width, (height<9) ? 9 : height, 0x00, 0x00, 0x00); diff --git a/widgets/table/e-cell-progress.h b/widgets/table/e-cell-progress.h index f71081016c..01a0d0b504 100644 --- a/widgets/table/e-cell-progress.h +++ b/widgets/table/e-cell-progress.h @@ -32,10 +32,10 @@ G_BEGIN_DECLS #define E_CELL_PROGRESS_TYPE (e_cell_progress_get_type ()) -#define E_CELL_PROGRESS(o) (GTK_CHECK_CAST ((o), E_CELL_PROGRESS_TYPE, ECellProgress)) -#define E_CELL_PROGRESS_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_PROGRESS_TYPE, ECellProgressClass)) -#define E_IS_CELL_PROGRESS(o) (GTK_CHECK_TYPE ((o), E_CELL_PROGRESS_TYPE)) -#define E_IS_CELL_PROGRESS_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_PROGRESS_TYPE)) +#define E_CELL_PROGRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_PROGRESS_TYPE, ECellProgress)) +#define E_CELL_PROGRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_PROGRESS_TYPE, ECellProgressClass)) +#define E_IS_CELL_PROGRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_PROGRESS_TYPE)) +#define E_IS_CELL_PROGRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_PROGRESS_TYPE)) typedef struct { ECell parent; @@ -59,7 +59,7 @@ typedef struct { ECellClass parent_class; } ECellProgressClass; -GtkType e_cell_progress_get_type (void); +GType e_cell_progress_get_type (void); ECell *e_cell_progress_new (int min, int max, int width, int height); void e_cell_progress_construct (ECellProgress *eprog, int padding, int border, int min, int max, int width, int height, guchar red, guchar green, guchar blue); diff --git a/widgets/table/e-cell-size.c b/widgets/table/e-cell-size.c index ff18300e65..a72fc68321 100644 --- a/widgets/table/e-cell-size.c +++ b/widgets/table/e-cell-size.c @@ -61,7 +61,7 @@ e_cell_size_class_init (GtkObjectClass *object_class) { ECellTextClass *ectc = (ECellTextClass *) object_class; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); ectc->get_text = ecd_get_text; ectc->free_text = ecd_free_text; @@ -98,7 +98,7 @@ e_cell_size_init (GtkObject *object) ECell * e_cell_size_new (const char *fontname, GtkJustification justify) { - ECellSize *ecd = gtk_type_new (e_cell_size_get_type ()); + ECellSize *ecd = g_object_new (E_CELL_SIZE_TYPE, NULL); e_cell_text_construct(E_CELL_TEXT(ecd), fontname, justify); diff --git a/widgets/table/e-cell-size.h b/widgets/table/e-cell-size.h index c8c4b40b75..744cc00a98 100644 --- a/widgets/table/e-cell-size.h +++ b/widgets/table/e-cell-size.h @@ -28,10 +28,10 @@ G_BEGIN_DECLS #define E_CELL_SIZE_TYPE (e_cell_size_get_type ()) -#define E_CELL_SIZE(o) (GTK_CHECK_CAST ((o), E_CELL_SIZE_TYPE, ECellSize)) -#define E_CELL_SIZE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_SIZE_TYPE, ECellSizeClass)) -#define E_IS_CELL_SIZE(o) (GTK_CHECK_TYPE ((o), E_CELL_SIZE_TYPE)) -#define E_IS_CELL_SIZE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_SIZE_TYPE)) +#define E_CELL_SIZE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_SIZE_TYPE, ECellSize)) +#define E_CELL_SIZE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_SIZE_TYPE, ECellSizeClass)) +#define E_IS_CELL_SIZE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_SIZE_TYPE)) +#define E_IS_CELL_SIZE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_SIZE_TYPE)) typedef struct { ECellText base; @@ -41,7 +41,7 @@ typedef struct { ECellTextClass parent_class; } ECellSizeClass; -GtkType e_cell_size_get_type (void); +GType e_cell_size_get_type (void); ECell *e_cell_size_new (const char *fontname, GtkJustification justify); G_END_DECLS diff --git a/widgets/table/e-cell-spin-button.c b/widgets/table/e-cell-spin-button.c index 9c11e6c22f..9a0a9ce331 100644 --- a/widgets/table/e-cell-spin-button.c +++ b/widgets/table/e-cell-spin-button.c @@ -42,10 +42,10 @@ #define E_CELL_SPIN_BUTTON_ARROW_WIDTH 16 #define PARENT_TYPE e_cell_get_type () -static void e_cell_spin_button_class_init (GtkObjectClass *klass); +static void e_cell_spin_button_class_init (GObjectClass *klass); static void e_cell_spin_button_init (GtkObject *object); -static void ecsb_destroy (GtkObject *object); +static void ecsb_dispose (GObject *object); /* ECell Functions */ static ECellView * ecsb_new_view (ECell *ecell, @@ -120,12 +120,12 @@ static guint signals[LAST_SIGNAL] = { 0 }; static ECell *parent_class; static void -e_cell_spin_button_class_init (GtkObjectClass *klass) +e_cell_spin_button_class_init (GObjectClass *klass) { ECellClass *ecc = (ECellClass *) klass; ECellSpinButtonClass *ecsbc = (ECellSpinButtonClass *) klass; - klass->destroy = ecsb_destroy; + klass->dispose = ecsb_dispose; ecc->realize = ecsb_realize; ecc->unrealize = ecsb_unrealize; @@ -144,19 +144,18 @@ e_cell_spin_button_class_init (GtkObjectClass *klass) ecsbc->step = NULL; - parent_class = gtk_type_class (E_CELL_TYPE); + parent_class = g_type_class_ref (E_CELL_TYPE); signals[STEP] = - gtk_signal_new ("step", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (klass), - GTK_SIGNAL_OFFSET (ECellSpinButtonClass, step), - e_marshal_NONE__POINTER_INT_INT_INT, - GTK_TYPE_NONE, - 4, GTK_TYPE_POINTER, GTK_TYPE_INT, - GTK_TYPE_INT, GTK_TYPE_INT); - - E_OBJECT_CLASS_ADD_SIGNALS (klass, signals, LAST_SIGNAL); + g_signal_new ("step", + G_OBJECT_CLASS_TYPE (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECellSpinButtonClass, step), + NULL, NULL, + e_marshal_NONE__POINTER_INT_INT_INT, + G_TYPE_NONE, + 4, G_TYPE_POINTER, G_TYPE_INT, + G_TYPE_INT, G_TYPE_INT); } static void @@ -365,20 +364,20 @@ ecsb_event (ECellView *ecv, /* Yep, which one? */ if (event->button.y <= height / 2) { ecsb->up_pressed = TRUE; - gtk_signal_emit (GTK_OBJECT(ecsb), - signals[STEP], - ecv, - STEP_UP, - view_col, - row); + g_signal_emit (ecsb, + signals[STEP], 0, + ecv, + STEP_UP, + view_col, + row); } else { ecsb->down_pressed = TRUE; - gtk_signal_emit (GTK_OBJECT(ecsb), - signals[STEP], - ecv, - STEP_DOWN, - view_col, - row); + g_signal_emit (ecsb, + signals[STEP], 0, + ecv, + STEP_DOWN, + view_col, + row); } e_table_item_redraw_range (eti, @@ -513,7 +512,7 @@ ecsb_show_tooltip (ECellView *ecv, } static void -ecsb_destroy (GtkObject *object) +ecsb_dispose (GObject *object) { ECellSpinButton *mcsp; @@ -522,7 +521,7 @@ ecsb_destroy (GtkObject *object) mcsp = E_CELL_SPIN_BUTTON (object); - GTK_OBJECT_CLASS (parent_class)->destroy (object); + G_OBJECT_CLASS (parent_class)->dispose (object); } ECell * @@ -533,15 +532,15 @@ e_cell_spin_button_new (gint min, { ECellSpinButton *ecsb; - ecsb = gtk_type_new (E_CELL_SPIN_BUTTON_TYPE); + ecsb = g_object_new (E_CELL_SPIN_BUTTON_TYPE, NULL); if (!child_cell) { child_cell = e_cell_number_new (NULL, GTK_JUSTIFY_LEFT); - gtk_signal_connect (GTK_OBJECT (ecsb), "step", - GTK_SIGNAL_FUNC (e_cell_spin_button_step), - NULL); + g_signal_connect (ecsb, "step", + G_CALLBACK (e_cell_spin_button_step), + NULL); } ecsb->child = child_cell; @@ -560,13 +559,13 @@ e_cell_spin_button_new_float (gfloat min, { ECellSpinButton *ecsb; - ecsb = gtk_type_new (E_CELL_SPIN_BUTTON_TYPE); + ecsb = g_object_new (E_CELL_SPIN_BUTTON_TYPE, NULL); if (!child_cell) { child_cell = e_cell_float_new (NULL, GTK_JUSTIFY_LEFT); - gtk_signal_connect (GTK_OBJECT (ecsb), "step", - GTK_SIGNAL_FUNC (e_cell_spin_button_step_float), - NULL); + g_signal_connect (ecsb, "step", + G_CALLBACK (e_cell_spin_button_step_float), + NULL); } ecsb->child = child_cell; diff --git a/widgets/table/e-cell-spin-button.h b/widgets/table/e-cell-spin-button.h index 8ffaab09f1..4326c0429c 100644 --- a/widgets/table/e-cell-spin-button.h +++ b/widgets/table/e-cell-spin-button.h @@ -35,10 +35,10 @@ #include <gal/e-table/e-cell.h> #define E_CELL_SPIN_BUTTON_TYPE (e_cell_spin_button_get_type ()) -#define E_CELL_SPIN_BUTTON(o) (GTK_CHECK_CAST ((o), E_CELL_SPIN_BUTTON_TYPE, ECellSpinButton)) -#define E_CELL_SPIN_BUTTON_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_SPIN_BUTTON_TYPE, ECellSpinButtonClass)) -#define M_IS_CELL_SPIN_BUTTON(o) (GTK_CHECK_TYPE ((o), E_CELL_SPIN_BUTTON_TYPE)) -#define M_IS_CELL_SPIN_BUTTON_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_SPIN_BUTTON_TYPE)) +#define E_CELL_SPIN_BUTTON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_SPIN_BUTTON_TYPE, ECellSpinButton)) +#define E_CELL_SPIN_BUTTON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_SPIN_BUTTON_TYPE, ECellSpinButtonClass)) +#define M_IS_CELL_SPIN_BUTTON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_SPIN_BUTTON_TYPE)) +#define M_IS_CELL_SPIN_BUTTON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_SPIN_BUTTON_TYPE)) typedef union { gint i; @@ -75,7 +75,7 @@ typedef struct { gint row); } ECellSpinButtonClass; -GtkType e_cell_spin_button_get_type (void); +GType e_cell_spin_button_get_type (void); ECell * e_cell_spin_button_new (gint min, gint max, gint step, diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 6c49eabca8..cdccbdf39c 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -77,13 +77,13 @@ struct line { /* Object argument IDs */ enum { - ARG_0, + PROP_0, - ARG_STRIKEOUT_COLUMN, - ARG_BOLD_COLUMN, - ARG_COLOR_COLUMN, - ARG_EDITABLE, - ARG_BG_COLOR_COLUMN + PROP_STRIKEOUT_COLUMN, + PROP_BOLD_COLUMN, + PROP_COLOR_COLUMN, + PROP_EDITABLE, + PROP_BG_COLOR_COLUMN }; @@ -1196,16 +1196,16 @@ tooltip_event (GtkWidget *window, event->button.x = tooltip->cx; event->button.y = tooltip->cy; - gtk_signal_emit_by_name (GTK_OBJECT (tooltip->eti), "event", - event, &ret_val); + g_signal_emit_by_name (tooltip->eti, "event", + event, &ret_val); if (!ret_val) gtk_propagate_event (GTK_WIDGET(GNOME_CANVAS_ITEM(tooltip->eti)->canvas), event); ret_val = TRUE; break; case GDK_KEY_PRESS: e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(tooltip->eti)->canvas)); - gtk_signal_emit_by_name (GTK_OBJECT (tooltip->eti), "event", - event, &ret_val); + g_signal_emit_by_name (tooltip->eti, "event", + event, &ret_val); if (!ret_val) gtk_propagate_event (GTK_WIDGET(GNOME_CANVAS_ITEM(tooltip->eti)->canvas), event); ret_val = TRUE; @@ -1324,8 +1324,8 @@ ect_show_tooltip (ECellView *ecell_view, (double) tooltip_height); gtk_widget_show (canvas); gtk_widget_realize (window); - gtk_signal_connect (GTK_OBJECT (window), "event", - GTK_SIGNAL_FUNC (tooltip_event), tooltip); + g_signal_connect (window, "event", + G_CALLBACK (tooltip_event), tooltip); e_canvas_popup_tooltip (E_CANVAS(text_view->canvas), window, pixel_origin.x + tooltip->x, pixel_origin.y + tooltip->y - 1); @@ -1347,31 +1347,34 @@ ect_finalize (GObject *object) } /* Set_arg handler for the text item */ static void -ect_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +ect_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { ECellText *text; text = E_CELL_TEXT (object); - switch (arg_id) { - case ARG_STRIKEOUT_COLUMN: - text->strikeout_column = GTK_VALUE_INT (*arg); + switch (prop_id) { + case PROP_STRIKEOUT_COLUMN: + text->strikeout_column = g_value_get_int (value); break; - case ARG_BOLD_COLUMN: - text->bold_column = GTK_VALUE_INT (*arg); + case PROP_BOLD_COLUMN: + text->bold_column = g_value_get_int (value); break; - case ARG_COLOR_COLUMN: - text->color_column = GTK_VALUE_INT (*arg); + case PROP_COLOR_COLUMN: + text->color_column = g_value_get_int (value); break; - case ARG_EDITABLE: - text->editable = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE; + case PROP_EDITABLE: + text->editable = g_value_get_boolean (value); break; - case ARG_BG_COLOR_COLUMN: - text->bg_color_column = GTK_VALUE_INT (*arg); + case PROP_BG_COLOR_COLUMN: + text->bg_color_column = g_value_get_int (value); break; default: @@ -1381,35 +1384,38 @@ ect_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) /* Get_arg handler for the text item */ static void -ect_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +ect_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { ECellText *text; text = E_CELL_TEXT (object); - switch (arg_id) { - case ARG_STRIKEOUT_COLUMN: - GTK_VALUE_INT (*arg) = text->strikeout_column; + switch (prop_id) { + case PROP_STRIKEOUT_COLUMN: + g_value_set_int (value, text->strikeout_column); break; - case ARG_BOLD_COLUMN: - GTK_VALUE_INT (*arg) = text->bold_column; + case PROP_BOLD_COLUMN: + g_value_set_int (value, text->bold_column); break; - case ARG_COLOR_COLUMN: - GTK_VALUE_INT (*arg) = text->color_column; + case PROP_COLOR_COLUMN: + g_value_set_int (value, text->color_column); break; - case ARG_EDITABLE: - GTK_VALUE_BOOL (*arg) = text->editable ? TRUE : FALSE; + case PROP_EDITABLE: + g_value_set_boolean (value, text->editable); break; - case ARG_BG_COLOR_COLUMN: - GTK_VALUE_INT (*arg) = text->bg_color_column; + case PROP_BG_COLOR_COLUMN: + g_value_set_int (value, text->bg_color_column); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -1418,11 +1424,11 @@ static char *ellipsis_default = NULL; static gboolean use_ellipsis_default = TRUE; static void -e_cell_text_class_init (GtkObjectClass *object_class) +e_cell_text_class_init (GObjectClass *object_class) { ECellClass *ecc = (ECellClass *) object_class; ECellTextClass *ectc = (ECellTextClass *) object_class; - char *ellipsis_env; + const char *ellipsis_env; G_OBJECT_CLASS (object_class)->finalize = ect_finalize; @@ -1449,21 +1455,45 @@ e_cell_text_class_init (GtkObjectClass *object_class) ectc->free_text = ect_real_free_text; ectc->set_value = ect_real_set_value; - object_class->get_arg = ect_get_arg; - object_class->set_arg = ect_set_arg; - - parent_class = gtk_type_class (PARENT_TYPE); - - gtk_object_add_arg_type ("ECellText::strikeout_column", - GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_STRIKEOUT_COLUMN); - gtk_object_add_arg_type ("ECellText::bold_column", - GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_BOLD_COLUMN); - gtk_object_add_arg_type ("ECellText::color_column", - GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_COLOR_COLUMN); - gtk_object_add_arg_type ("ECellText::editable", - GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_EDITABLE); - gtk_object_add_arg_type ("ECellText::bg_color_column", - GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_BG_COLOR_COLUMN); + object_class->get_property = ect_get_property; + object_class->set_property = ect_set_property; + + parent_class = g_type_class_ref (PARENT_TYPE); + + g_object_class_install_property (object_class, PROP_STRIKEOUT_COLUMN, + g_param_spec_int ("strikeout_column", + _("Strikeout Column"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_BOLD_COLUMN, + g_param_spec_int ("bold_column", + _("Bold Column"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_COLOR_COLUMN, + g_param_spec_int ("color_column", + _("Color Column"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_EDITABLE, + g_param_spec_boolean ("editable", + _("Editable"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_BG_COLOR_COLUMN, + g_param_spec_int ("bg_color_column", + _("BG Color Column"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); if (!clipboard_atom) clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE); @@ -1538,7 +1568,7 @@ e_cell_text_construct (ECellText *cell, const char *fontname, GtkJustification j ECell * e_cell_text_new (const char *fontname, GtkJustification justify) { - ECellText *ect = gtk_type_new (e_cell_text_get_type ()); + ECellText *ect = g_object_new (E_CELL_TEXT_TYPE, NULL); e_cell_text_construct(ect, fontname, justify); @@ -2135,15 +2165,15 @@ static GtkWidget *e_cell_text_view_get_invisible (CellEdit *edit) GDK_SELECTION_TYPE_STRING, E_SELECTION_CLIPBOARD); - gtk_signal_connect (GTK_OBJECT(invisible), "selection_get", - GTK_SIGNAL_FUNC (_selection_get), - edit); - gtk_signal_connect (GTK_OBJECT(invisible), "selection_clear_event", - GTK_SIGNAL_FUNC (_selection_clear_event), - edit); - gtk_signal_connect (GTK_OBJECT(invisible), "selection_received", - GTK_SIGNAL_FUNC (_selection_received), - edit); + g_signal_connect (invisible, "selection_get", + G_CALLBACK (_selection_get), + edit); + g_signal_connect (invisible, "selection_clear_event", + G_CALLBACK (_selection_clear_event), + edit); + g_signal_connect (invisible, "selection_received", + G_CALLBACK (_selection_received), + edit); g_object_weak_ref (G_OBJECT (invisible), invisible_finalize, edit); } @@ -2203,10 +2233,10 @@ _get_tep (CellEdit *edit) edit->tep = e_text_event_processor_emacs_like_new (); g_object_ref (edit->tep); gtk_object_sink (GTK_OBJECT (edit->tep)); - gtk_signal_connect (GTK_OBJECT(edit->tep), - "command", - GTK_SIGNAL_FUNC(e_cell_text_view_command), - (gpointer) edit); + g_signal_connect (edit->tep, + "command", + G_CALLBACK(e_cell_text_view_command), + (gpointer) edit); } } diff --git a/widgets/table/e-cell-text.h b/widgets/table/e-cell-text.h index 6612a0213b..cad1c836a8 100644 --- a/widgets/table/e-cell-text.h +++ b/widgets/table/e-cell-text.h @@ -43,10 +43,10 @@ G_BEGIN_DECLS #define E_CELL_TEXT_TYPE (e_cell_text_get_type ()) -#define E_CELL_TEXT(o) (GTK_CHECK_CAST ((o), E_CELL_TEXT_TYPE, ECellText)) -#define E_CELL_TEXT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_TEXT_TYPE, ECellTextClass)) -#define E_IS_CELL_TEXT(o) (GTK_CHECK_TYPE ((o), E_CELL_TEXT_TYPE)) -#define E_IS_CELL_TEXT_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_TEXT_TYPE)) +#define E_CELL_TEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_TEXT_TYPE, ECellText)) +#define E_CELL_TEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_TEXT_TYPE, ECellTextClass)) +#define E_IS_CELL_TEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_TEXT_TYPE)) +#define E_IS_CELL_TEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_TEXT_TYPE)) typedef struct { ECell parent; @@ -85,7 +85,7 @@ typedef struct { void (*set_value) (ECellText *cell, ETableModel *model, int col, int row, const char *text); } ECellTextClass; -GtkType e_cell_text_get_type (void); +GType e_cell_text_get_type (void); ECell *e_cell_text_new (const char *fontname, GtkJustification justify); ECell *e_cell_text_construct(ECellText *cell, const char *fontname, GtkJustification justify); diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index 26904d284a..469a41bde4 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -430,7 +430,7 @@ e_cell_toggle_class_init (GtkObjectClass *object_class) ecc->max_width = etog_max_width; ecc->style_set = etog_style_set; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); } static void @@ -493,7 +493,7 @@ e_cell_toggle_construct (ECellToggle *etog, int border, int n_states, GdkPixbuf ECell * e_cell_toggle_new (int border, int n_states, GdkPixbuf **images) { - ECellToggle *etog = gtk_type_new (e_cell_toggle_get_type ()); + ECellToggle *etog = g_object_new (E_CELL_TOGGLE_TYPE, NULL); e_cell_toggle_construct (etog, border, n_states, images); diff --git a/widgets/table/e-cell-toggle.h b/widgets/table/e-cell-toggle.h index 3e105773f6..71d9de3883 100644 --- a/widgets/table/e-cell-toggle.h +++ b/widgets/table/e-cell-toggle.h @@ -31,10 +31,10 @@ G_BEGIN_DECLS #define E_CELL_TOGGLE_TYPE (e_cell_toggle_get_type ()) -#define E_CELL_TOGGLE(o) (GTK_CHECK_CAST ((o), E_CELL_TOGGLE_TYPE, ECellToggle)) -#define E_CELL_TOGGLE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_TOGGLE_TYPE, ECellToggleClass)) -#define E_IS_CELL_TOGGLE(o) (GTK_CHECK_TYPE ((o), E_CELL_TOGGLE_TYPE)) -#define E_IS_CELL_TOGGLE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_TOGGLE_TYPE)) +#define E_CELL_TOGGLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_TOGGLE_TYPE, ECellToggle)) +#define E_CELL_TOGGLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_TOGGLE_TYPE, ECellToggleClass)) +#define E_IS_CELL_TOGGLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_TOGGLE_TYPE)) +#define E_IS_CELL_TOGGLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_TOGGLE_TYPE)) typedef struct { ECell parent; @@ -50,7 +50,7 @@ typedef struct { ECellClass parent_class; } ECellToggleClass; -GtkType e_cell_toggle_get_type (void); +GType e_cell_toggle_get_type (void); ECell *e_cell_toggle_new (int border, int n_states, GdkPixbuf **images); void e_cell_toggle_construct (ECellToggle *etog, int border, int n_states, GdkPixbuf **images); diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index 479e7a1a8d..b437b49ac2 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -655,10 +655,10 @@ ect_print_height (ECellView *ecell_view, GnomePrintContext *context, } /* - * GtkObject::destroy method + * GObject::dispose method */ static void -ect_destroy (GtkObject *object) +ect_dispose (GObject *object) { ECellTree *ect = E_CELL_TREE (object); @@ -675,15 +675,15 @@ ect_destroy (GtkObject *object) gdk_pixbuf_unref (ect->closed_pixbuf); ect->closed_pixbuf = NULL; - GTK_OBJECT_CLASS (parent_class)->destroy (object); + G_OBJECT_CLASS (parent_class)->dispose (object); } static void -e_cell_tree_class_init (GtkObjectClass *object_class) +e_cell_tree_class_init (GObjectClass *object_class) { ECellClass *ecc = (ECellClass *) object_class; - object_class->destroy = ect_destroy; + object_class->dispose = ect_dispose; ecc->new_view = ect_new_view; ecc->kill_view = ect_kill_view; @@ -700,7 +700,7 @@ e_cell_tree_class_init (GtkObjectClass *object_class) ecc->show_tooltip = ect_show_tooltip; ecc->get_bg_color = ect_get_bg_color; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); } E_MAKE_TYPE(e_cell_tree, "ECellTree", ECellTree, e_cell_tree_class_init, NULL, PARENT_TYPE) @@ -764,7 +764,7 @@ e_cell_tree_new (GdkPixbuf *open_pixbuf, gboolean draw_lines, ECell *subcell) { - ECellTree *ect = gtk_type_new (e_cell_tree_get_type ()); + ECellTree *ect = g_object_new (E_CELL_TREE_TYPE, NULL); e_cell_tree_construct (ect, open_pixbuf, closed_pixbuf, draw_lines, subcell); diff --git a/widgets/table/e-cell-tree.h b/widgets/table/e-cell-tree.h index daba990be6..13462ee428 100644 --- a/widgets/table/e-cell-tree.h +++ b/widgets/table/e-cell-tree.h @@ -36,10 +36,10 @@ G_BEGIN_DECLS #define E_CELL_TREE_TYPE (e_cell_tree_get_type ()) -#define E_CELL_TREE(o) (GTK_CHECK_CAST ((o), E_CELL_TREE_TYPE, ECellTree)) -#define E_CELL_TREE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_TREE_TYPE, ECellTreeClass)) -#define E_IS_CELL_TREE(o) (GTK_CHECK_TYPE ((o), E_CELL_TREE_TYPE)) -#define E_IS_CELL_TREE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_TREE_TYPE)) +#define E_CELL_TREE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_TREE_TYPE, ECellTree)) +#define E_CELL_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_TREE_TYPE, ECellTreeClass)) +#define E_IS_CELL_TREE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_TREE_TYPE)) +#define E_IS_CELL_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_TREE_TYPE)) typedef struct { ECell parent; @@ -56,7 +56,7 @@ typedef struct { ECellClass parent_class; } ECellTreeClass; -GtkType e_cell_tree_get_type (void); +GType e_cell_tree_get_type (void); ECell *e_cell_tree_new (GdkPixbuf *open_pixbuf, GdkPixbuf *closed_pixbuf, gboolean draw_lines, diff --git a/widgets/table/e-cell-vbox.c b/widgets/table/e-cell-vbox.c index 5e6d651bbe..ab86e307c9 100644 --- a/widgets/table/e-cell-vbox.c +++ b/widgets/table/e-cell-vbox.c @@ -397,10 +397,10 @@ ecv_print_height (ECellView *ecell_view, GnomePrintContext *context, #endif /* - * GtkObject::destroy method + * GObject::dispose method */ static void -ecv_destroy (GtkObject *object) +ecv_dispose (GObject *object) { ECellVbox *ecv = E_CELL_VBOX (object); int i; @@ -413,15 +413,15 @@ ecv_destroy (GtkObject *object) ecv->subcells = NULL; ecv->subcell_count = 0; - GTK_OBJECT_CLASS (parent_class)->destroy (object); + G_OBJECT_CLASS (parent_class)->dispose (object); } static void -e_cell_vbox_class_init (GtkObjectClass *object_class) +e_cell_vbox_class_init (GObjectClass *object_class) { ECellClass *ecc = (ECellClass *) object_class; - object_class->destroy = ecv_destroy; + object_class->dispose = ecv_dispose; ecc->new_view = ecv_new_view; ecc->kill_view = ecv_kill_view; @@ -442,7 +442,7 @@ e_cell_vbox_class_init (GtkObjectClass *object_class) ecc->get_bg_color = ecv_get_bg_color; #endif - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); } static void @@ -468,7 +468,7 @@ E_MAKE_TYPE(e_cell_vbox, "ECellVbox", ECellVbox, e_cell_vbox_class_init, e_cell_ ECell * e_cell_vbox_new (void) { - ECellVbox *ecv = gtk_type_new (e_cell_vbox_get_type ()); + ECellVbox *ecv = g_object_new (E_CELL_VBOX_TYPE, NULL); return (ECell *) ecv; } diff --git a/widgets/table/e-cell-vbox.h b/widgets/table/e-cell-vbox.h index f815d40512..93ddc6d25c 100644 --- a/widgets/table/e-cell-vbox.h +++ b/widgets/table/e-cell-vbox.h @@ -36,10 +36,10 @@ G_BEGIN_DECLS #define E_CELL_VBOX_TYPE (e_cell_vbox_get_type ()) -#define E_CELL_VBOX(o) (GTK_CHECK_CAST ((o), E_CELL_VBOX_TYPE, ECellVbox)) -#define E_CELL_VBOX_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_VBOX_TYPE, ECellVboxClass)) -#define E_IS_CELL_VBOX(o) (GTK_CHECK_TYPE ((o), E_CELL_VBOX_TYPE)) -#define E_IS_CELL_VBOX_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_VBOX_TYPE)) +#define E_CELL_VBOX(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_VBOX_TYPE, ECellVbox)) +#define E_CELL_VBOX_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_VBOX_TYPE, ECellVboxClass)) +#define E_IS_CELL_VBOX(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_VBOX_TYPE)) +#define E_IS_CELL_VBOX_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_VBOX_TYPE)) typedef struct { ECell parent; @@ -53,7 +53,7 @@ typedef struct { ECellClass parent_class; } ECellVboxClass; -GtkType e_cell_vbox_get_type (void); +GType e_cell_vbox_get_type (void); ECell *e_cell_vbox_new (void); void e_cell_vbox_append (ECellVbox *vbox, ECell *subcell, diff --git a/widgets/table/e-cell.c b/widgets/table/e-cell.c index a447bcffbf..8deeaa654c 100644 --- a/widgets/table/e-cell.c +++ b/widgets/table/e-cell.c @@ -26,7 +26,7 @@ #include "e-cell.h" #include "gal/util/e-util.h" -#define PARENT_TYPE gtk_object_get_type () +#define PARENT_TYPE GTK_TYPE_OBJECT #define ECVIEW_EC_CLASS(v) (E_CELL_GET_CLASS (v->ecell)) diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h index d21aeaec60..b6c4e01e71 100644 --- a/widgets/table/e-cell.h +++ b/widgets/table/e-cell.h @@ -34,11 +34,11 @@ G_BEGIN_DECLS #define E_CELL_TYPE (e_cell_get_type ()) -#define E_CELL(o) (GTK_CHECK_CAST ((o), E_CELL_TYPE, ECell)) -#define E_CELL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_TYPE, ECellClass)) -#define E_CELL_GET_CLASS(o) (GTK_CHECK_GET_CLASS((o), E_CELL_TYPE, ECellClass)) -#define E_IS_CELL(o) (GTK_CHECK_TYPE ((o), E_CELL_TYPE)) -#define E_IS_CELL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_TYPE)) +#define E_CELL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_TYPE, ECell)) +#define E_CELL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_TYPE, ECellClass)) +#define E_CELL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_CELL_TYPE, ECellClass)) +#define E_IS_CELL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_TYPE)) +#define E_IS_CELL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_TYPE)) typedef gboolean (*ETableSearchFunc) (gconstpointer haystack, const char *needle); @@ -118,7 +118,7 @@ typedef struct { void (*style_set) (ECellView *ecell_view, GtkStyle *previous_style); } ECellClass; -GtkType e_cell_get_type (void); +GType e_cell_get_type (void); /* View creation methods. */ ECellView *e_cell_new_view (ECell *ecell, diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c index 823fb620be..9acc0ba4fd 100644 --- a/widgets/table/e-table-col.c +++ b/widgets/table/e-table-col.c @@ -24,12 +24,17 @@ #include <config.h> #include "e-table-col.h" #include "gal/util/e-util.h" +#include "gal/util/e-i18n.h" static GObjectClass *parent_class; +enum { + PROP_0, + PROP_COMPARE_COL, +}; static void -etc_finalize (GObject *object) +etc_dispose (GObject *object) { ETableCol *etc = E_TABLE_COL (object); @@ -45,7 +50,36 @@ etc_finalize (GObject *object) g_free (etc->text); etc->text = NULL; - parent_class->finalize (object); + parent_class->dispose (object); +} + +static void +etc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +{ + ETableCol *etc = E_TABLE_COL (object); + + switch (prop_id) { + case PROP_COMPARE_COL: + etc->compare_col = g_value_get_int (value); + break; + default: + break; + } +} + +static void +etc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +{ + ETableCol *etc = E_TABLE_COL (object); + + switch (prop_id) { + case PROP_COMPARE_COL: + g_value_set_int (value, etc->compare_col); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } } static void @@ -53,7 +87,16 @@ e_table_col_class_init (GObjectClass *object_class) { parent_class = g_type_class_peek_parent (object_class); - object_class->finalize = etc_finalize; + object_class->dispose = etc_dispose; + object_class->set_property = etc_set_property; + object_class->get_property = etc_get_property; + + g_object_class_install_property (object_class, PROP_COMPARE_COL, + g_param_spec_int ("compare_col", + _( "Width" ), + "Width", + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); } static void diff --git a/widgets/table/e-table-column.c b/widgets/table/e-table-column.c index 6d8f1c3aef..514a25e74e 100644 --- a/widgets/table/e-table-column.c +++ b/widgets/table/e-table-column.c @@ -32,6 +32,7 @@ enum { static guint etc_signals [LAST_SIGNAL] = { 0, }; +#define PARENT_CLASS GTK_TYPE_OBJECT static GtkObjectClass *e_table_column_parent_class; static void @@ -62,48 +63,31 @@ e_table_column_class_init (GtkObjectClass *object_class) { G_OBJECT_CLASS (object_class)->finalize = e_table_column_finalize; - e_table_column_parent_class = (gtk_type_class (gtk_object_get_type ())); + e_table_column_parent_class = g_type_class_ref (PARENT_CLASS); etc_signals [STRUCTURE_CHANGE] = - gtk_signal_new ("structure_change", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableColumn, structure_change), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("structure_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableColumn, structure_change), + NULL, NULL, + e_marshal_NONE__NONE, + G_TYPE_NONE, 0); etc_signals [DIMENSION_CHANGE] = - gtk_signal_new ("dimension_change", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableColumn, dimension_change), - gtk_marshal_NONE__INT, - GTK_TYPE_NONE, 1, GTK_TYPE_INT); - - E_OBJECT_CLASS_ADD_SIGNALS (object_class, etc_signals, LAST_SIGNAL); + g_signal_new ("dimension_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableColumn, dimension_change), + e_marshal_NONE__INT, + G_TYPE_NONE, 1, G_TYPE_INT); } -GtkType -e_table_column_get_type (void) -{ - static GtkType type = 0; - - if (!type){ - GtkTypeInfo info = { - "ETableColumn", - sizeof (ETableColumn), - sizeof (ETableColumnClass), - (GtkClassInitFunc) e_table_column_class_init, - (GtkObjectInitFunc) NULL, - NULL, /* reserved 1 */ - NULL, /* reserved 2 */ - (GtkClassInitFunc) NULL - }; - - type = gtk_type_unique (gtk_object_get_type (), &info); - } - - return type; -} +E_MAKE_TYPE (e_table_column, + "ETableColumn", + ETableColumn, + e_table_column_class_init, + NULL, + PARENT_TYPE); static void etc_do_insert (ETableColumn *etc, int pos, ETableCol *val) @@ -129,7 +113,7 @@ e_table_column_add_column (ETableColumn *etc, ETableCol *tc, int pos) etc_do_insert (etc, pos, tc); etc->col_count++; - gtk_signal_emit (GTK_OBJECT (etc), etc_signals [STRUCTURE_CHANGE]); + g_signal_emit (etc, etc_signals [STRUCTURE_CHANGE], 0); } ETableCol * @@ -273,7 +257,7 @@ e_table_column_move (ETableColumn *etc, int source_index, int target_index) old = etc->columns [source_index]; etc_do_remove (etc, source_index); etc_do_insert (etc, target_index, old); - gtk_signal_emit (GTK_OBJECT (etc), etc_signals [STRUCTURE_CHANGE]); + g_signal_emit (etc, etc_signals [STRUCTURE_CHANGE], 0); } void @@ -285,7 +269,7 @@ e_table_column_remove (ETableColumn *etc, int idx) g_return_if_fail (idx < etc->col_count); etc_do_remove (etc, idx); - gtk_signal_emit (GTK_OBJECT (etc), etc_signals [STRUCTURE_CHANGE]); + g_signal_emit (etc, etc_signals [STRUCTURE_CHANGE], 0); } void @@ -303,5 +287,5 @@ e_table_column_set_size (ETableColumn *etc, int idx, int size) g_return_if_fail (size > 0); etc->columns [idx]->width = size; - gtk_signal_emit (GTK_OBJECT (etc), etc_signals [SIZE_CHANGE], idx); + g_signal_emit (etc, etc_signals [SIZE_CHANGE], 0, idx); } diff --git a/widgets/table/e-table-config-field.c b/widgets/table/e-table-config-field.c index 020f316643..7c23e10046 100644 --- a/widgets/table/e-table-config-field.c +++ b/widgets/table/e-table-config-field.c @@ -34,7 +34,7 @@ static GtkVBoxClass *etcf_parent_class; static void -etcf_destroy (GtkObject *object) +etcf_dispose (GObject *object) { ETableConfigField *etcf = E_TABLE_CONFIG_FIELD (object); @@ -46,15 +46,15 @@ etcf_destroy (GtkObject *object) g_object_unref (etcf->sort_info); etct->sort_info = NULL; - GTK_OBJECT_CLASS (etcf_parent_class)->destroy (object); + G_OBJECT_CLASS (etcf_parent_class)->dispose (object); } static void -etcf_class_init (GtkObjectClass *klass) +etcf_class_init (GObjectClass *klass) { - etcf_parent_class = gtk_type_class (PARENT_TYPE); + etcf_parent_class = g_type_class_ref (PARENT_TYPE); - klass->destroy = etcf_destroy; + klass->dispose = etcf_dispose; } static void @@ -76,7 +76,7 @@ e_table_config_field_new (ETableSpecification *spec, ETableSortInfo *sort_info, gboolean grouping) { - ETableConfigField *etcf = gtk_type_new (E_TABLE_CONFIG_FIELD_TYPE); + ETableConfigField *etcf = g_object_new (E_TABLE_CONFIG_FIELD_TYPE, NULL); e_table_config_field_construct (etcf, spec, sort_info, grouping); @@ -217,12 +217,12 @@ etcf_setup(ETableConfigField *etcf) gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(etcf->combo)->entry), "None"); } - gtk_signal_connect(GTK_OBJECT(GTK_COMBO(etcf->combo)->entry), "changed", - GTK_SIGNAL_FUNC(changed), etcf); - gtk_signal_connect(GTK_OBJECT(etcf->radio_ascending), "toggled", - GTK_SIGNAL_FUNC(toggled), etcf); - gtk_signal_connect(GTK_OBJECT(etcf->radio_descending), "toggled", - GTK_SIGNAL_FUNC(toggled), etcf); + g_signal_connect(GTK_COMBO(etcf->combo)->entry, "changed", + G_CALLBACK (changed), etcf); + g_signal_connect(etcf->radio_ascending, "toggled", + G_CALLBACK (toggled), etcf); + g_signal_connect(etcf->radio_descending, "toggled", + G_CALLBACK (toggled), etcf); } static ETableConfigField * @@ -271,7 +271,7 @@ e_table_config_field_construct_nth (ETableConfigField *etcf, gtk_box_pack_start(GTK_BOX(internal_vbox2), etcf->radio_descending, FALSE, FALSE, 0); if (n < 3) { - etcf->child_fields = GTK_WIDGET(gtk_type_new (E_TABLE_CONFIG_FIELD_TYPE)); + etcf->child_fields = GTK_WIDGET(g_object_new (E_TABLE_CONFIG_FIELD_TYPE, NULL)); e_table_config_field_construct_nth(E_TABLE_CONFIG_FIELD(etcf->child_fields), spec, sort_info, grouping, n + 1); gtk_box_pack_start(GTK_BOX(etcf), etcf->child_fields, FALSE, FALSE, 0); gtk_widget_show(etcf->child_fields); diff --git a/widgets/table/e-table-config-field.h b/widgets/table/e-table-config-field.h index 2a7a8b308b..bb8f540c4a 100644 --- a/widgets/table/e-table-config-field.h +++ b/widgets/table/e-table-config-field.h @@ -31,10 +31,10 @@ G_BEGIN_DECLS #define E_TABLE_CONFIG_FIELD_TYPE (e_table_config_field_get_type ()) -#define E_TABLE_CONFIG_FIELD(o) (GTK_CHECK_CAST ((o), E_TABLE_CONFIG_FIELD_TYPE, ETableConfigField)) -#define E_TABLE_CONFIG_FIELD_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_CONFIG_FIELD_TYPE, ETableConfigFieldClass)) -#define E_IS_TABLE_CONFIG_FIELD(o) (GTK_CHECK_TYPE ((o), E_TABLE_CONFIG_FIELD_TYPE)) -#define E_IS_TABLE_CONFIG_FIELD_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_CONFIG_FIELD_TYPE)) +#define E_TABLE_CONFIG_FIELD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_CONFIG_FIELD_TYPE, ETableConfigField)) +#define E_TABLE_CONFIG_FIELD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_CONFIG_FIELD_TYPE, ETableConfigFieldClass)) +#define E_IS_TABLE_CONFIG_FIELD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_CONFIG_FIELD_TYPE)) +#define E_IS_TABLE_CONFIG_FIELD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_CONFIG_FIELD_TYPE)) typedef struct { GtkVBox base; @@ -55,7 +55,7 @@ typedef struct { GtkVBoxClass parent_class; } ETableConfigFieldClass; -GtkType e_table_config_field_get_type (void); +GType e_table_config_field_get_type (void); ETableConfigField *e_table_config_field_new (ETableSpecification *spec, ETableSortInfo *sort_info, gboolean grouping); diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index b487613b86..b4eaf53beb 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -63,7 +63,9 @@ config_finalize (GObject *object) { ETableConfig *config = E_TABLE_CONFIG (object); - gtk_object_destroy (GTK_OBJECT (config->state)); + if (config->state) + g_object_unref (config->state); + config->state = NULL; if (config->source_state) g_object_unref (config->source_state); @@ -175,11 +177,11 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) /* * Sorting is set, auto select the text */ - gtk_signal_handler_block ( - GTK_OBJECT (widgets [i].radio_ascending), + g_signal_handler_block ( + widgets [i].radio_ascending, widgets [i].toggled_id); - gtk_signal_handler_block ( - GTK_OBJECT (widgets [i].combo->entry), + g_signal_handler_block ( + widgets [i].combo->entry, widgets [i].changed_id); if (i < count){ @@ -233,11 +235,11 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) /* Set the text */ gtk_combo_text_set_text (widgets [i].combo, text); - gtk_signal_handler_unblock ( - GTK_OBJECT (widgets [i].radio_ascending), + g_signal_handler_unblock ( + widgets [i].radio_ascending, widgets [i].toggled_id); - gtk_signal_handler_unblock ( - GTK_OBJECT (widgets [i].combo->entry), + g_signal_handler_unblock ( + widgets [i].combo->entry, widgets [i].changed_id); } } @@ -366,8 +368,8 @@ config_fields_info_update (ETableConfig *config) static void do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) { - GnomeDialog *dialog; - int button, running = 1; + GtkDialog *dialog; + int response, running = 1; config->temp_state = e_table_state_duplicate (config->state); @@ -380,14 +382,14 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) if (is_sort) - dialog = GNOME_DIALOG (config->dialog_sort); + dialog = GTK_DIALOG (config->dialog_sort); else - dialog = GNOME_DIALOG (config->dialog_group_by); + dialog = GTK_DIALOG (config->dialog_group_by); do { - button = gnome_dialog_run (dialog); - switch (button){ - case 0: + response = gtk_dialog_run (dialog); + switch (response){ + case 0: /* clear fields */ if (is_sort){ e_table_sort_info_sorting_truncate ( config->temp_state->sort_info, 0); @@ -398,8 +400,7 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) update_sort_and_group_config_dialog (config, is_sort); continue; - /* OK */ - case 1: + case GTK_RESPONSE_OK: g_object_unref (config->state); config->state = config->temp_state; config->temp_state = 0; @@ -408,8 +409,7 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) GNOME_PROPERTY_BOX (config->dialog_toplevel)); break; - /* CANCEL */ - case 2: + case GTK_RESPONSE_CANCEL: g_object_unref (config->temp_state); config->temp_state = 0; running = 0; @@ -417,8 +417,8 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) } } while (running); - gnome_dialog_close (GNOME_DIALOG (dialog)); - + gtk_widget_hide (GTK_WIDGET (dialog)); + if (is_sort) config_sort_info_update (config); else @@ -455,7 +455,7 @@ do_fields_config_dialog (ETableConfig *config) } } while (running); - gnome_dialog_close (GNOME_DIALOG (config->dialog_show_fields)); + gtk_widget_hide (GTK_WIDGET (config->dialog_show_fields)); config_fields_info_update (config); } @@ -536,9 +536,10 @@ config_button_group (GtkWidget *widget, ETableConfig *config) } static void -dialog_destroyed (GtkObject *dialog, ETableConfig *config) +dialog_destroyed (gpointer data, GObject *where_object_was) { - gtk_object_destroy (GTK_OBJECT (config)); + ETableConfig *config = data; + g_object_unref (config); } static void @@ -676,14 +677,14 @@ configure_sort_dialog (ETableConfig *config, GladeXML *gui) * After we have runtime modified things, signal connect */ for (i = 0; i < 4; i++){ - config->sort [i].changed_id = gtk_signal_connect ( - GTK_OBJECT (config->sort [i].combo->entry), - "changed", GTK_SIGNAL_FUNC (sort_entry_changed), + config->sort [i].changed_id = g_signal_connect ( + config->sort [i].combo->entry, + "changed", G_CALLBACK (sort_entry_changed), &config->sort [i]); - config->sort [i].toggled_id = gtk_signal_connect ( - GTK_OBJECT (config->sort [i].radio_ascending), - "toggled", GTK_SIGNAL_FUNC (sort_ascending_toggled), + config->sort [i].toggled_id = g_signal_connect ( + config->sort [i].radio_ascending, + "toggled", G_CALLBACK (sort_ascending_toggled), &config->sort [i]); } } @@ -788,14 +789,14 @@ configure_group_dialog (ETableConfig *config, GladeXML *gui) * After we have runtime modified things, signal connect */ for (i = 0; i < 4; i++){ - config->group [i].changed_id = gtk_signal_connect ( - GTK_OBJECT (config->group [i].combo->entry), - "changed", GTK_SIGNAL_FUNC (group_entry_changed), + config->group [i].changed_id = g_signal_connect ( + config->group [i].combo->entry, + "changed", G_CALLBACK (group_entry_changed), &config->group [i]); - config->group [i].toggled_id = gtk_signal_connect ( - GTK_OBJECT (config->group [i].radio_ascending), - "toggled", GTK_SIGNAL_FUNC (group_ascending_toggled), + config->group [i].toggled_id = g_signal_connect ( + config->group [i].radio_ascending, + "toggled", G_CALLBACK (group_ascending_toggled), &config->group [i]); } } @@ -961,14 +962,14 @@ static void configure_fields_dialog (ETableConfig *config, GladeXML *gui) { config->available = e_table_scrolled_get_table (E_TABLE_SCROLLED (glade_xml_get_widget (gui, "custom-available"))); - gtk_object_get (GTK_OBJECT (config->available), - "model", &config->available_model, - NULL); + g_object_get (config->available, + "model", &config->available_model, + NULL); config->shown = e_table_scrolled_get_table (E_TABLE_SCROLLED (glade_xml_get_widget (gui, "custom-shown"))); - gtk_object_get (GTK_OBJECT (config->shown), - "model", &config->shown_model, - NULL); + g_object_get (config->shown, + "model", &config->shown_model, + NULL); connect_button (config, gui, "button-add", GTK_SIGNAL_FUNC (config_button_add)); connect_button (config, gui, "button-remove", GTK_SIGNAL_FUNC (config_button_remove)); @@ -1027,10 +1028,9 @@ setup_gui (ETableConfig *config) configure_sort_dialog (config, gui); configure_group_dialog (config, gui); configure_fields_dialog (config, gui); - - g_signal_connect ( - G_OBJECT (config->dialog_toplevel), "destroy", - G_CALLBACK (dialog_destroyed), config); + + g_object_weak_ref (G_OBJECT (config->dialog_toplevel), + dialog_destroyed, config); g_signal_connect ( G_OBJECT (config->dialog_toplevel), "apply", diff --git a/widgets/table/e-table-config.glade b/widgets/table/e-table-config.glade index 554d72a47a..ee1bb958f5 100644 --- a/widgets/table/e-table-config.glade +++ b/widgets/table/e-table-config.glade @@ -1,1843 +1,2082 @@ <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" > +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> <glade-interface> - <requires lib="gnome" /> - - <widget class="GtkDialog" id="dialog-show-fields"> - <property name="visible">no</property> - <property name="title" translatable="yes">Show Fields</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="modal">no</property> - <property name="allow_shrink">no</property> - <property name="allow_grow">yes</property> - <property name="window-position">GTK_WIN_POS_NONE</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox3"> - <property name="homogeneous">no</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area3"> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="button20"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-ok</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button22"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox2"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkTable" id="table2"> - <property name="homogeneous">yes</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - <property name="n-rows">1</property> - <property name="n-columns">5</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label-available"> - <property name="label" translatable="yes">A_vailable Fields:</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">no</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label-displayed"> - <property name="label" translatable="yes">Sh_ow these fields in order:</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">no</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">5</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table3"> - <property name="homogeneous">yes</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - <property name="n-rows">1</property> - <property name="n-columns">5</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkVBox" id="vbox4"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="Custom" id="custom-available"> - <property name="creation_function">e_table_proxy_etable_available_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Thu, 21 Feb 2002 16:09:53 GMT</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">expand|fill</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox5"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="Custom" id="custom-shown"> - <property name="creation_function">e_table_proxy_etable_shown_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Thu, 21 Feb 2002 16:09:58 GMT</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox4"> - <property name="homogeneous">yes</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="button-up"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Move _Up</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button-down"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Move _Down</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">5</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">expand|fill</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox6"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="button-add"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">_Add -></property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button-remove"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes"><- _Remove</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <placeholder /> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">expand|fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">4</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <widget class="GtkDialog" id="dialog-group-by"> - <property name="visible">no</property> - <property name="title" translatable="yes">Group</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="modal">no</property> - <property name="allow_shrink">no</property> - <property name="allow_grow">yes</property> - <property name="window-position">GTK_WIN_POS_NONE</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox4"> - <property name="homogeneous">no</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area4"> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="button39"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Clear All</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button41"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-ok</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button42"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox24"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox13"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkFrame" id="frame-group-1"> - <property name="label" translatable="yes">Group Items By</property> - <property name="label_xalign">0</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox5"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkVBox" id="vbox7"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="Custom" id="group-combo-1"> - <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Fri, 19 Jan 2001 04:52:09 GMT</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="checkbutton-group-1"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Show field in View</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox8"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkRadioButton" id="radiobutton-ascending-group-1"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Ascending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radiobutton-descending-group-1"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Descending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - <property name="group">radiobutton-ascending-group-1</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label8"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label9"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label10"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox14"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label11"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame-group-2"> - <property name="label" translatable="yes">Then By</property> - <property name="label_xalign">0</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox6"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkVBox" id="vbox9"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="Custom" id="group-combo-2"> - <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Fri, 19 Jan 2001 04:52:14 GMT</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="checkbutton-group-2"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Show field in View</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox10"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkRadioButton" id="radiobutton-ascending-group-2"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Ascending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radiobutton-descending-group-2"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Descending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - <property name="group">radiobutton-ascending-group-2</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label19"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label18"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox15"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label13"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label12"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame-group-3"> - <property name="label" translatable="yes">Then By</property> - <property name="label_xalign">0</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox7"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkVBox" id="vbox11"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="Custom" id="group-combo-3"> - <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Fri, 19 Jan 2001 04:52:18 GMT</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="checkbutton-group-3"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Show field in View</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox12"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkRadioButton" id="radiobutton-ascending-group-3"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Ascending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radiobutton-descending-group-3"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Descending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - <property name="group">radiobutton-ascending-group-3</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label17"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox16"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label14"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label16"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label15"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame-group-4"> - <property name="label" translatable="yes">Then By</property> - <property name="label_xalign">0</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox8"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkVBox" id="vbox13"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="Custom" id="group-combo-4"> - <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Fri, 19 Jan 2001 04:52:21 GMT</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="checkbutton-group-4"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Show field in View</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox14"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkRadioButton" id="radiobutton-ascending-group-4"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Ascending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radiobutton-descending-group-4"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Descending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - <property name="group">radiobutton-ascending-group-4</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">4</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <widget class="GtkDialog" id="dialog-sort"> - <property name="visible">no</property> - <property name="title" translatable="yes">Sort</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="modal">no</property> - <property name="allow_shrink">no</property> - <property name="allow_grow">yes</property> - <property name="window-position">GTK_WIN_POS_NONE</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="vbox15"> - <property name="homogeneous">no</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="hbuttonbox1"> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">8</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="button43"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Clear All</property> - <property name="visible">yes</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button44"> - <property name="can_default">yes</property> - <property name="has_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-ok</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button45"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="visible">yes</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">yes</property> - <property name="use_underline">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table5"> - <property name="homogeneous">no</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - <property name="n-rows">4</property> - <property name="n-columns">1</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkFrame" id="frame-sort-4"> - <property name="label" translatable="yes">Then By</property> - <property name="label_xalign">0</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox9"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkAlignment" id="alignment1"> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">0</property> - <property name="visible">yes</property> - - <child> - <widget class="Custom" id="sort-combo-4"> - <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Tue, 16 Jan 2001 08:33:52 GMT</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox17"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkRadioButton" id="radiobutton-ascending-sort-4"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Ascending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radiobutton-descending-sort-4"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Descending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - <property name="group">radiobutton-ascending-sort-4</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame-sort-3"> - <property name="label" translatable="yes">Then By</property> - <property name="label_xalign">0</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox10"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkAlignment" id="alignment2"> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">0</property> - <property name="visible">yes</property> - - <child> - <widget class="Custom" id="sort-combo-3"> - <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Tue, 16 Jan 2001 05:22:22 GMT</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox19"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkRadioButton" id="radiobutton-ascending-sort-3"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Ascending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radiobutton-descending-sort-3"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Descending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - <property name="group">radiobutton-ascending-sort-3</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame-sort-2"> - <property name="label" translatable="yes">Then By</property> - <property name="label_xalign">0</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox11"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkAlignment" id="alignment3"> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">0</property> - <property name="visible">yes</property> - - <child> - <widget class="Custom" id="sort-combo-2"> - <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Tue, 16 Jan 2001 05:22:15 GMT</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox21"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkRadioButton" id="radiobutton-ascending-sort-2"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Ascending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radiobutton-descending-sort-2"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Descending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - <property name="group">radiobutton-ascending-sort-2</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame-sort-1"> - <property name="label" translatable="yes">Sort Items By</property> - <property name="label_xalign">0</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkHBox" id="hbox12"> - <property name="homogeneous">no</property> - <property name="spacing">6</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkAlignment" id="alignment4"> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">0</property> - <property name="visible">yes</property> - - <child> - <widget class="Custom" id="sort-combo-1"> - <property name="can_focus">yes</property> - <property name="has_focus">yes</property> - <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Tue, 16 Jan 2001 05:22:00 GMT</property> - <property name="visible">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox23"> - <property name="homogeneous">no</property> - <property name="spacing">0</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkRadioButton" id="radiobutton-ascending-sort-1"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Ascending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radiobutton-descending-sort-1"> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">Descending</property> - <property name="active">no</property> - <property name="draw_indicator">yes</property> - <property name="visible">yes</property> - <property name="group">radiobutton-ascending-sort-1</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">4</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> - <widget class="GnomePropertyBox" id="e-table-config"> - <property name="visible">no</property> - <property name="modal">no</property> - <property name="allow_shrink">no</property> - <property name="allow_grow">no</property> - <property name="window-position">GTK_WIN_POS_NONE</property> - - <child internal-child="notebook"> - <widget class="GtkNotebook" id="notebook1"> - <property name="show_tabs">no</property> - <property name="show_border">yes</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">no</property> - <property name="tab_hborder">2</property> - <property name="tab_vborder">2</property> - <property name="enable-popup">no</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkFrame" id="top-frame"> - <property name="border_width">2</property> - <property name="label" translatable="yes">Description</property> - <property name="label_xalign">0</property> - <property name="shadow">GTK_SHADOW_ETCHED_IN</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkTable" id="table1"> - <property name="border_width">2</property> - <property name="homogeneous">no</property> - <property name="row_spacing">2</property> - <property name="column_spacing">4</property> - <property name="n-rows">3</property> - <property name="n-columns">3</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkButton" id="button-sort"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">_Sort...</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="clicked" handler="on_sort_clicked" /> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button-group"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">_Group By...</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="clicked" handler="on_group_by_clicked" /> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label-group"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">yes</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label-sort"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">yes</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button-fields"> - <property name="can_default">yes</property> - <property name="can_focus">yes</property> - <property name="label" translatable="yes">_Fields Shown...</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - - <signal name="clicked" handler="on_group_by_clicked" /> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label-fields"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">yes</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">expand|fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label3"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label4"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label22"> - <property name="label" translatable="yes"></property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_padding">0</property> - <property name="y_padding">0</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label20"> - <property name="label" translatable="yes">label20</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - </widget> +<requires lib="gnome"/> + +<widget class="GtkDialog" id="dialog-show-fields"> + <property name="title" translatable="yes">Show Fields</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area3"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="button20"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-ok</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">-5</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="button22"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">-6</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkTable" id="table2"> + <property name="visible">True</property> + <property name="n_rows">1</property> + <property name="n_columns">5</property> + <property name="homogeneous">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + + <child> + <widget class="GtkLabel" id="label-available"> + <property name="visible">True</property> + <property name="label" translatable="yes">A_vailable Fields:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label-displayed"> + <property name="visible">True</property> + <property name="label" translatable="yes">Sh_ow these fields in order:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">3</property> + <property name="right_attach">5</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options">fill</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkTable" id="table3"> + <property name="visible">True</property> + <property name="n_rows">1</property> + <property name="n_columns">5</property> + <property name="homogeneous">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + + <child> + <widget class="GtkVBox" id="vbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="Custom" id="custom-available"> + <property name="visible">True</property> + <property name="creation_function">e_table_proxy_etable_available_new</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Thu, 21 Feb 2002 16:09:53 GMT</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="Custom" id="custom-shown"> + <property name="visible">True</property> + <property name="creation_function">e_table_proxy_etable_shown_new</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Thu, 21 Feb 2002 16:09:58 GMT</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox4"> + <property name="visible">True</property> + <property name="homogeneous">True</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkButton" id="button-up"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Move _Up</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button-down"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Move _Down</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">3</property> + <property name="right_attach">5</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkButton" id="button-add"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">_Add -></property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button-remove"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"><- _Remove</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +<widget class="GtkDialog" id="dialog-group-by"> + <property name="title" translatable="yes">Group</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area4"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="button39"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Clear All</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">0</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="button41"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-ok</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">-5</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="button42"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">-6</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox24"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="hbox13"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkFrame" id="frame-group-1"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkVBox" id="vbox7"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="Custom" id="group-combo-1"> + <property name="visible">True</property> + <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Fri, 19 Jan 2001 04:52:09 GMT</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton-group-1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Show field in View</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox8"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkRadioButton" id="radiobutton-ascending-group-1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Ascending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radiobutton-descending-group-1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Descending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton-ascending-group-1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Group Items By</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox14"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame-group-2"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkVBox" id="vbox9"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="Custom" id="group-combo-2"> + <property name="visible">True</property> + <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Fri, 19 Jan 2001 04:52:14 GMT</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton-group-2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Show field in View</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox10"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkRadioButton" id="radiobutton-ascending-group-2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Ascending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radiobutton-descending-group-2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Descending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton-ascending-group-2</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes">Then By</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label19"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label18"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox15"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame-group-3"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkHBox" id="hbox7"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkVBox" id="vbox11"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="Custom" id="group-combo-3"> + <property name="visible">True</property> + <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Fri, 19 Jan 2001 04:52:18 GMT</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton-group-3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Show field in View</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox12"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkRadioButton" id="radiobutton-ascending-group-3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Ascending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radiobutton-descending-group-3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Descending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton-ascending-group-3</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="label" translatable="yes">Then By</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox16"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkLabel" id="label14"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label16"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label15"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame-group-4"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkHBox" id="hbox8"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkVBox" id="vbox13"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="Custom" id="group-combo-4"> + <property name="visible">True</property> + <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Fri, 19 Jan 2001 04:52:21 GMT</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton-group-4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Show field in View</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox14"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkRadioButton" id="radiobutton-ascending-group-4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Ascending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radiobutton-descending-group-4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Descending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton-ascending-group-4</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label21"> + <property name="visible">True</property> + <property name="label" translatable="yes">Then By</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +<widget class="GtkDialog" id="dialog-sort"> + <property name="title" translatable="yes">Sort</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="vbox15"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="hbuttonbox1"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="button43"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Clear All</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">0</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="button44"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-ok</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">-5</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="button45"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="response_id">-6</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkTable" id="table5"> + <property name="visible">True</property> + <property name="n_rows">4</property> + <property name="n_columns">1</property> + <property name="homogeneous">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + + <child> + <widget class="GtkFrame" id="frame-sort-4"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkHBox" id="hbox9"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">0</property> + + <child> + <widget class="Custom" id="sort-combo-4"> + <property name="visible">True</property> + <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Tue, 16 Jan 2001 08:33:52 GMT</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox17"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkRadioButton" id="radiobutton-ascending-sort-4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Ascending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radiobutton-descending-sort-4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Descending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton-ascending-sort-4</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label22"> + <property name="visible">True</property> + <property name="label" translatable="yes">Then By</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame-sort-3"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkHBox" id="hbox10"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">0</property> + + <child> + <widget class="Custom" id="sort-combo-3"> + <property name="visible">True</property> + <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Tue, 16 Jan 2001 05:22:22 GMT</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox19"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkRadioButton" id="radiobutton-ascending-sort-3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Ascending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radiobutton-descending-sort-3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Descending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton-ascending-sort-3</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label23"> + <property name="visible">True</property> + <property name="label" translatable="yes">Then By</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame-sort-2"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkHBox" id="hbox11"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">0</property> + + <child> + <widget class="Custom" id="sort-combo-2"> + <property name="visible">True</property> + <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Tue, 16 Jan 2001 05:22:15 GMT</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox21"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkRadioButton" id="radiobutton-ascending-sort-2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Ascending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radiobutton-descending-sort-2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Descending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton-ascending-sort-2</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label24"> + <property name="visible">True</property> + <property name="label" translatable="yes">Then By</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame-sort-1"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkHBox" id="hbox12"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">0</property> + + <child> + <widget class="Custom" id="sort-combo-1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="creation_function">e_table_proxy_gtk_combo_text_new</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Tue, 16 Jan 2001 05:22:00 GMT</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox23"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkRadioButton" id="radiobutton-ascending-sort-1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Ascending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radiobutton-descending-sort-1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Descending</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton-ascending-sort-1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label25"> + <property name="visible">True</property> + <property name="label" translatable="yes">Sort Items By</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options">fill</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +<widget class="GnomePropertyBox" id="e-table-config"> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + + <child internal-child="notebook"> + <widget class="GtkNotebook" id="notebook1"> + <property name="visible">True</property> + <property name="show_tabs">False</property> + <property name="show_border">True</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="tab_hborder">2</property> + <property name="tab_vborder">2</property> + <property name="enable_popup">False</property> + + <child> + <widget class="GtkFrame" id="top-frame"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkTable" id="table1"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">3</property> + <property name="homogeneous">False</property> + <property name="row_spacing">2</property> + <property name="column_spacing">4</property> + + <child> + <widget class="GtkButton" id="button-sort"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">_Sort...</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <signal name="clicked" handler="on_sort_clicked"/> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button-group"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">_Group By...</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <signal name="clicked" handler="on_group_by_clicked"/> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label-group"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label-sort"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button-fields"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">_Fields Shown...</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <signal name="clicked" handler="on_group_by_clicked"/> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label-fields"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label22"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label26"> + <property name="visible">True</property> + <property name="label" translatable="yes">Description</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="label" translatable="yes">label20</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> +</widget> + </glade-interface> diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index e4116f101d..d7e725fd12 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -24,73 +24,71 @@ #include <config.h> #include "e-table-field-chooser-dialog.h" #include "gal/util/e-i18n.h" +#include "gal/util/e-util.h" +#include <gtk/gtkstock.h> static void e_table_field_chooser_dialog_init (ETableFieldChooserDialog *card); static void e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *klass); -static void e_table_field_chooser_dialog_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void e_table_field_chooser_dialog_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void e_table_field_chooser_dialog_destroy (GtkObject *object); -static void e_table_field_chooser_dialog_clicked (GnomeDialog *dialog, gint button); +static void e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_dialog_dispose (GObject *object); +static void e_table_field_chooser_dialog_response (GtkDialog *dialog, gint id); -static GnomeDialogClass *parent_class = NULL; +#define PARENT_TYPE GTK_TYPE_DIALOG +static GtkDialogClass *parent_class = NULL; /* The arguments we take */ enum { - ARG_0, - ARG_DND_CODE, - ARG_FULL_HEADER, - ARG_HEADER + PROP_0, + PROP_DND_CODE, + PROP_FULL_HEADER, + PROP_HEADER }; -GtkType -e_table_field_chooser_dialog_get_type (void) -{ - static GtkType table_field_chooser_dialog_type = 0; - - if (!table_field_chooser_dialog_type) - { - static const GtkTypeInfo table_field_chooser_dialog_info = - { - - "ETableFieldChooserDialog", - sizeof (ETableFieldChooserDialog), - sizeof (ETableFieldChooserDialogClass), - (GtkClassInitFunc) e_table_field_chooser_dialog_class_init, - (GtkObjectInitFunc) e_table_field_chooser_dialog_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - table_field_chooser_dialog_type = gtk_type_unique (gnome_dialog_get_type (), &table_field_chooser_dialog_info); - } - - return table_field_chooser_dialog_type; -} +E_MAKE_TYPE (e_table_field_chooser_dialog, + "ETableFieldChooserDialog", + ETableFieldChooserDialog, + e_table_field_chooser_dialog_class_init, + e_table_field_chooser_dialog_init, + PARENT_TYPE); static void e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *klass) { - GtkObjectClass *object_class; - GnomeDialogClass *dialog_class; - - object_class = (GtkObjectClass*) klass; - dialog_class = GNOME_DIALOG_CLASS (klass); - - parent_class = gtk_type_class (gnome_dialog_get_type ()); - - object_class->destroy = e_table_field_chooser_dialog_destroy; - object_class->set_arg = e_table_field_chooser_dialog_set_arg; - object_class->get_arg = e_table_field_chooser_dialog_get_arg; - - dialog_class->clicked = e_table_field_chooser_dialog_clicked; - - gtk_object_add_arg_type ("ETableFieldChooserDialog::dnd_code", GTK_TYPE_STRING, - GTK_ARG_READWRITE, ARG_DND_CODE); - gtk_object_add_arg_type ("ETableFieldChooserDialog::full_header", GTK_TYPE_OBJECT, - GTK_ARG_READWRITE, ARG_FULL_HEADER); - gtk_object_add_arg_type ("ETableFieldChooserDialog::header", GTK_TYPE_OBJECT, - GTK_ARG_READWRITE, ARG_HEADER); + GObjectClass *object_class; + GtkDialogClass *dialog_class; + + object_class = (GObjectClass*) klass; + dialog_class = GTK_DIALOG_CLASS (klass); + + parent_class = g_type_class_ref (PARENT_TYPE); + + object_class->dispose = e_table_field_chooser_dialog_dispose; + object_class->set_property = e_table_field_chooser_dialog_set_property; + object_class->get_property = e_table_field_chooser_dialog_get_property; + + dialog_class->response = e_table_field_chooser_dialog_response; + + g_object_class_install_property (object_class, PROP_DND_CODE, + g_param_spec_string ("dnd_code", + _("DnD code"), + /*_( */"XXX blurb" /*)*/, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_FULL_HEADER, + g_param_spec_object ("full_header", + _("Full Header"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_HEADER_TYPE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_HEADER, + g_param_spec_object ("header", + _("Header"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_HEADER_TYPE, + G_PARAM_READWRITE)); } static void @@ -103,22 +101,21 @@ e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_choos e_table_field_chooser_dialog->full_header = NULL; e_table_field_chooser_dialog->header = NULL; - gnome_dialog_append_buttons(GNOME_DIALOG(e_table_field_chooser_dialog), - GTK_STOCK_CLOSE, - NULL); + gtk_dialog_add_button(GTK_DIALOG(e_table_field_chooser_dialog), + GTK_STOCK_CLOSE, GTK_RESPONSE_OK); gtk_window_set_policy(GTK_WINDOW(e_table_field_chooser_dialog), FALSE, TRUE, FALSE); widget = e_table_field_chooser_new(); e_table_field_chooser_dialog->etfc = E_TABLE_FIELD_CHOOSER(widget); - gtk_object_set(GTK_OBJECT(widget), - "dnd_code", e_table_field_chooser_dialog->dnd_code, - "full_header", e_table_field_chooser_dialog->full_header, - "header", e_table_field_chooser_dialog->header, - NULL); + g_object_set(widget, + "dnd_code", e_table_field_chooser_dialog->dnd_code, + "full_header", e_table_field_chooser_dialog->full_header, + "header", e_table_field_chooser_dialog->header, + NULL); - gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(e_table_field_chooser_dialog)->vbox), + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(e_table_field_chooser_dialog)->vbox), widget, TRUE, TRUE, 0); gtk_widget_show(GTK_WIDGET(widget)); @@ -129,16 +126,17 @@ e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_choos GtkWidget* e_table_field_chooser_dialog_new (void) { - GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_table_field_chooser_dialog_get_type ())); + GtkWidget *widget = g_object_new (E_TABLE_FIELD_CHOOSER_DIALOG_TYPE, NULL); return widget; } static void -e_table_field_chooser_dialog_destroy (GtkObject *object) +e_table_field_chooser_dialog_dispose (GObject *object) { ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object); - g_free (etfcd->dnd_code); + if (etfcd->dnd_code) + g_free (etfcd->dnd_code); etfcd->dnd_code = NULL; if (etfcd->full_header) @@ -148,48 +146,50 @@ e_table_field_chooser_dialog_destroy (GtkObject *object) if (etfcd->header) g_object_unref (etfcd->header); etfcd->header = NULL; + + G_OBJECT_CLASS (parent_class)->dispose (object); } static void -e_table_field_chooser_dialog_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG(object); - switch (arg_id){ - case ARG_DND_CODE: + switch (prop_id){ + case PROP_DND_CODE: g_free(etfcd->dnd_code); - etfcd->dnd_code = g_strdup(GTK_VALUE_STRING (*arg)); + etfcd->dnd_code = g_strdup(g_value_get_string (value)); if (etfcd->etfc) - gtk_object_set(GTK_OBJECT(etfcd->etfc), - "dnd_code", etfcd->dnd_code, - NULL); + g_object_set(etfcd->etfc, + "dnd_code", etfcd->dnd_code, + NULL); break; - case ARG_FULL_HEADER: + case PROP_FULL_HEADER: if (etfcd->full_header) g_object_unref (etfcd->full_header); - if (GTK_VALUE_OBJECT(*arg)) - etfcd->full_header = E_TABLE_HEADER(GTK_VALUE_OBJECT(*arg)); + if (g_value_get_object (value)) + etfcd->full_header = E_TABLE_HEADER(g_value_get_object (value)); else etfcd->full_header = NULL; if (etfcd->full_header) g_object_ref (etfcd->full_header); if (etfcd->etfc) - gtk_object_set(GTK_OBJECT(etfcd->etfc), - "full_header", etfcd->full_header, - NULL); + g_object_set(etfcd->etfc, + "full_header", etfcd->full_header, + NULL); break; - case ARG_HEADER: + case PROP_HEADER: if (etfcd->header) g_object_unref (etfcd->header); - if (GTK_VALUE_OBJECT(*arg)) - etfcd->header = E_TABLE_HEADER(GTK_VALUE_OBJECT(*arg)); + if (g_value_get_object (value)) + etfcd->header = E_TABLE_HEADER(g_value_get_object (value)); else etfcd->header = NULL; if (etfcd->header) g_object_ref (etfcd->header); if (etfcd->etfc) - gtk_object_set(GTK_OBJECT(etfcd->etfc), - "header", etfcd->header, - NULL); + g_object_set(etfcd->etfc, + "header", etfcd->header, + NULL); break; default: break; @@ -197,28 +197,28 @@ e_table_field_chooser_dialog_set_arg (GtkObject *object, GtkArg *arg, guint arg_ } static void -e_table_field_chooser_dialog_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG(object); - switch (arg_id) { - case ARG_DND_CODE: - GTK_VALUE_STRING (*arg) = g_strdup (etfcd->dnd_code); + switch (prop_id) { + case PROP_DND_CODE: + g_value_set_string (value, g_strdup (etfcd->dnd_code)); break; - case ARG_FULL_HEADER: - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(etfcd->full_header); + case PROP_FULL_HEADER: + g_value_set_object (value, etfcd->full_header); break; - case ARG_HEADER: - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(etfcd->header); + case PROP_HEADER: + g_value_set_object (value, etfcd->header); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void -e_table_field_chooser_dialog_clicked (GnomeDialog *dialog, int button) +e_table_field_chooser_dialog_response (GtkDialog *dialog, int id) { - if (button == 0) - gnome_dialog_close(dialog); + if (id == GTK_RESPONSE_OK) + gtk_widget_destroy (GTK_WIDGET (dialog)); } diff --git a/widgets/table/e-table-field-chooser-dialog.h b/widgets/table/e-table-field-chooser-dialog.h index 10843e579c..83fd5d3738 100644 --- a/widgets/table/e-table-field-chooser-dialog.h +++ b/widgets/table/e-table-field-chooser-dialog.h @@ -24,7 +24,7 @@ #ifndef __E_TABLE_FIELD_CHOOSER_DIALOG_H__ #define __E_TABLE_FIELD_CHOOSER_DIALOG_H__ -#include <libgnomeui/gnome-dialog.h> +#include <gtk/gtkdialog.h> #include <gal/e-table/e-table-field-chooser.h> #include <gal/e-table/e-table-header.h> @@ -42,10 +42,10 @@ extern "C" { */ #define E_TABLE_FIELD_CHOOSER_DIALOG_TYPE (e_table_field_chooser_dialog_get_type ()) -#define E_TABLE_FIELD_CHOOSER_DIALOG(obj) (GTK_CHECK_CAST ((obj), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE, ETableFieldChooserDialog)) -#define E_TABLE_FIELD_CHOOSER_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE, ETableFieldChooserDialogClass)) -#define E_IS_TABLE_FIELD_CHOOSER_DIALOG(obj) (GTK_CHECK_TYPE ((obj), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE)) -#define E_IS_TABLE_FIELD_CHOOSER_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE)) +#define E_TABLE_FIELD_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE, ETableFieldChooserDialog)) +#define E_TABLE_FIELD_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE, ETableFieldChooserDialogClass)) +#define E_IS_TABLE_FIELD_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE)) +#define E_IS_TABLE_FIELD_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE)) typedef struct _ETableFieldChooserDialog ETableFieldChooserDialog; @@ -53,7 +53,7 @@ typedef struct _ETableFieldChooserDialogClass ETableFieldChooserDialogClass; struct _ETableFieldChooserDialog { - GnomeDialog parent; + GtkDialog parent; /* item specific fields */ ETableFieldChooser *etfc; @@ -64,12 +64,12 @@ struct _ETableFieldChooserDialog struct _ETableFieldChooserDialogClass { - GnomeDialogClass parent_class; + GtkDialogClass parent_class; }; GtkWidget *e_table_field_chooser_dialog_new(void); -GtkType e_table_field_chooser_dialog_get_type (void); +GType e_table_field_chooser_dialog_get_type (void); #ifdef __cplusplus } diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index b385ea32c9..cfc73fc102 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -31,6 +31,7 @@ #include <libgnomecanvas/gnome-canvas-rect-ellipse.h> #include <gdk-pixbuf/gdk-pixbuf.h> +#include "gal/util/e-i18n.h" #include "gal/util/e-util.h" #include "gal/util/e-xml-utils.h" #include "gal/widgets/e-canvas.h" @@ -63,16 +64,16 @@ static void etfci_drop_table_header (ETableFieldChooserItem *etfci); static void etfci_drop_full_header (ETableFieldChooserItem *etfci); enum { - ARG_0, - ARG_FULL_HEADER, - ARG_HEADER, - ARG_DND_CODE, - ARG_WIDTH, - ARG_HEIGHT + PROP_0, + PROP_FULL_HEADER, + PROP_HEADER, + PROP_DND_CODE, + PROP_WIDTH, + PROP_HEIGHT }; static void -etfci_destroy (GtkObject *object) +etfci_dispose (GObject *object) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); @@ -87,8 +88,8 @@ etfci_destroy (GtkObject *object) gdk_font_unref(etfci->font); etfci->font = NULL; - if (GTK_OBJECT_CLASS (etfci_parent_class)->destroy) - (*GTK_OBJECT_CLASS (etfci_parent_class)->destroy) (object); + if (G_OBJECT_CLASS (etfci_parent_class)->dispose) + (*G_OBJECT_CLASS (etfci_parent_class)->dispose) (object); } static gint @@ -108,7 +109,7 @@ etfci_find_button (ETableFieldChooserItem *etfci, double loc) ecol = e_table_header_get_column (etfci->combined_header, i); if (ecol->disabled) continue; - height += e_table_header_compute_height (ecol, style, etfci->font); + height += e_table_header_compute_height (ecol, GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas)); if (height > loc) return i; } @@ -172,7 +173,7 @@ etfci_reflow (GnomeCanvasItem *item, gint flags) ecol = e_table_header_get_column (etfci->combined_header, i); if (ecol->disabled) continue; - height += e_table_header_compute_height (ecol, style, etfci->font); + height += e_table_header_compute_height (ecol, GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas)); } etfci->height = height; @@ -234,16 +235,16 @@ etfci_font_load (ETableFieldChooserItem *etfci) static void etfci_drop_full_header (ETableFieldChooserItem *etfci) { - GtkObject *header; + GObject *header; if (!etfci->full_header) return; - header = GTK_OBJECT (etfci->full_header); + header = G_OBJECT (etfci->full_header); if (etfci->full_header_structure_change_id) - gtk_signal_disconnect (header, etfci->full_header_structure_change_id); + g_signal_handler_disconnect (header, etfci->full_header_structure_change_id); if (etfci->full_header_dimension_change_id) - gtk_signal_disconnect (header, etfci->full_header_dimension_change_id); + g_signal_handler_disconnect (header, etfci->full_header_dimension_change_id); etfci->full_header_structure_change_id = 0; etfci->full_header_dimension_change_id = 0; @@ -272,28 +273,28 @@ etfci_add_full_header (ETableFieldChooserItem *etfci, ETableHeader *header) etfci->full_header = header; g_object_ref (etfci->full_header); - etfci->full_header_structure_change_id = gtk_signal_connect ( - GTK_OBJECT (header), "structure_change", - GTK_SIGNAL_FUNC(full_header_structure_changed), etfci); - etfci->full_header_dimension_change_id = gtk_signal_connect ( - GTK_OBJECT (header), "dimension_change", - GTK_SIGNAL_FUNC(full_header_dimension_changed), etfci); + etfci->full_header_structure_change_id = g_signal_connect ( + header, "structure_change", + G_CALLBACK(full_header_structure_changed), etfci); + etfci->full_header_dimension_change_id = g_signal_connect ( + header, "dimension_change", + G_CALLBACK(full_header_dimension_changed), etfci); e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); } static void etfci_drop_table_header (ETableFieldChooserItem *etfci) { - GtkObject *header; + GObject *header; if (!etfci->header) return; - header = GTK_OBJECT (etfci->header); + header = G_OBJECT (etfci->header); if (etfci->table_header_structure_change_id) - gtk_signal_disconnect (header, etfci->table_header_structure_change_id); + g_signal_handler_disconnect (header, etfci->table_header_structure_change_id); if (etfci->table_header_dimension_change_id) - gtk_signal_disconnect (header, etfci->table_header_dimension_change_id); + g_signal_handler_disconnect (header, etfci->table_header_dimension_change_id); etfci->table_header_structure_change_id = 0; etfci->table_header_dimension_change_id = 0; @@ -322,71 +323,71 @@ etfci_add_table_header (ETableFieldChooserItem *etfci, ETableHeader *header) etfci->header = header; g_object_ref (etfci->header); - etfci->table_header_structure_change_id = gtk_signal_connect ( - GTK_OBJECT (header), "structure_change", - GTK_SIGNAL_FUNC(table_header_structure_changed), etfci); - etfci->table_header_dimension_change_id = gtk_signal_connect ( - GTK_OBJECT (header), "dimension_change", - GTK_SIGNAL_FUNC(table_header_dimension_changed), etfci); + etfci->table_header_structure_change_id = g_signal_connect ( + header, "structure_change", + G_CALLBACK(table_header_structure_changed), etfci); + etfci->table_header_dimension_change_id = g_signal_connect ( + header, "dimension_change", + G_CALLBACK(table_header_dimension_changed), etfci); e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); } static void -etfci_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +etfci_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GnomeCanvasItem *item; ETableFieldChooserItem *etfci; - item = GNOME_CANVAS_ITEM (o); - etfci = E_TABLE_FIELD_CHOOSER_ITEM (o); + item = GNOME_CANVAS_ITEM (object); + etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); - switch (arg_id){ - case ARG_FULL_HEADER: + switch (prop_id){ + case PROP_FULL_HEADER: etfci_drop_full_header (etfci); - if (GTK_VALUE_OBJECT (*arg)) - etfci_add_full_header (etfci, E_TABLE_HEADER(GTK_VALUE_OBJECT (*arg))); + if (g_value_get_object (value)) + etfci_add_full_header (etfci, E_TABLE_HEADER(g_value_get_object (value))); break; - case ARG_HEADER: + case PROP_HEADER: etfci_drop_table_header (etfci); - if (GTK_VALUE_OBJECT (*arg)) - etfci_add_table_header (etfci, E_TABLE_HEADER(GTK_VALUE_OBJECT (*arg))); + if (g_value_get_object (value)) + etfci_add_table_header (etfci, E_TABLE_HEADER(g_value_get_object (value))); break; - case ARG_DND_CODE: + case PROP_DND_CODE: g_free(etfci->dnd_code); - etfci->dnd_code = g_strdup(GTK_VALUE_STRING (*arg)); + etfci->dnd_code = g_strdup(g_value_get_string (value)); break; - case ARG_WIDTH: - etfci->width = GTK_VALUE_DOUBLE (*arg); + case PROP_WIDTH: + etfci->width = g_value_get_double (value); gnome_canvas_item_request_update(item); break; } } static void -etfci_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) +etfci_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GnomeCanvasItem *item; ETableFieldChooserItem *etfci; - item = GNOME_CANVAS_ITEM (o); - etfci = E_TABLE_FIELD_CHOOSER_ITEM (o); + item = GNOME_CANVAS_ITEM (object); + etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); - switch (arg_id){ + switch (prop_id){ - case ARG_DND_CODE: - GTK_VALUE_STRING (*arg) = g_strdup (etfci->dnd_code); + case PROP_DND_CODE: + g_value_set_string (value, g_strdup (etfci->dnd_code)); break; - case ARG_WIDTH: - GTK_VALUE_DOUBLE (*arg) = etfci->width; + case PROP_WIDTH: + g_value_set_double (value, etfci->width); break; - case ARG_HEIGHT: - GTK_VALUE_DOUBLE (*arg) = etfci->height; + case PROP_HEIGHT: + g_value_set_double (value, etfci->height); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -432,12 +433,12 @@ etfci_realize (GnomeCanvasItem *item) if (!etfci->font) etfci_font_load (etfci); - etfci->drag_end_id = gtk_signal_connect ( - GTK_OBJECT (item->canvas), "drag_end", - GTK_SIGNAL_FUNC (etfci_drag_end), etfci); - etfci->drag_data_get_id = gtk_signal_connect ( - GTK_OBJECT (item->canvas), "drag_data_get", - GTK_SIGNAL_FUNC (etfci_drag_data_get), etfci); + etfci->drag_end_id = g_signal_connect ( + item->canvas, "drag_end", + G_CALLBACK (etfci_drag_end), etfci); + etfci->drag_data_get_id = g_signal_connect ( + item->canvas, "drag_data_get", + G_CALLBACK (etfci_drag_data_get), etfci); e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); } @@ -450,9 +451,9 @@ etfci_unrealize (GnomeCanvasItem *item) gdk_font_unref (etfci->font); etfci->font = NULL; - gtk_signal_disconnect (GTK_OBJECT (item->canvas), etfci->drag_end_id); + g_signal_handler_disconnect (item->canvas, etfci->drag_end_id); etfci->drag_end_id = 0; - gtk_signal_disconnect (GTK_OBJECT (item->canvas), etfci->drag_data_get_id); + g_signal_handler_disconnect (item->canvas, etfci->drag_data_get_id); etfci->drag_data_get_id = 0; if (GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->unrealize) @@ -487,7 +488,7 @@ etfci_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int widt if (ecol->disabled) continue; - y2 += e_table_header_compute_height (ecol, style, etfci->font); + y2 += e_table_header_compute_height (ecol, GTK_WIDGET (canvas)); if (y1 > (y + height)) break; @@ -496,7 +497,7 @@ etfci_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int widt continue; e_table_header_draw_button (drawable, ecol, - style, etfci->font, state, + style, state, GTK_WIDGET (canvas), -x, y1 - y, width, height, @@ -562,11 +563,11 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, double x, doub context = gtk_drag_begin (widget, list, GDK_ACTION_MOVE, 1, event); g_free(etfci_drag_types[0].target); - button_height = e_table_header_compute_height (ecol, widget->style, etfci->font); + button_height = e_table_header_compute_height (ecol, widget); pixmap = gdk_pixmap_new (widget->window, etfci->width, button_height, -1); e_table_header_draw_button (pixmap, ecol, - widget->style, etfci->font, GTK_WIDGET_STATE (widget), + widget->style, GTK_WIDGET_STATE (widget), widget, 0, 0, etfci->width, button_height, @@ -623,15 +624,15 @@ etfci_event (GnomeCanvasItem *item, GdkEvent *e) } static void -etfci_class_init (GtkObjectClass *object_class) +etfci_class_init (GObjectClass *object_class) { GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class; - etfci_parent_class = gtk_type_class (PARENT_OBJECT_TYPE); + etfci_parent_class = g_type_class_ref (PARENT_OBJECT_TYPE); - object_class->destroy = etfci_destroy; - object_class->set_arg = etfci_set_arg; - object_class->get_arg = etfci_get_arg; + object_class->dispose = etfci_dispose; + object_class->set_property = etfci_set_property; + object_class->get_property = etfci_get_property; item_class->update = etfci_update; item_class->realize = etfci_realize; @@ -639,17 +640,41 @@ etfci_class_init (GtkObjectClass *object_class) item_class->draw = etfci_draw; item_class->point = etfci_point; item_class->event = etfci_event; - - gtk_object_add_arg_type ("ETableFieldChooserItem::dnd_code", GTK_TYPE_STRING, - GTK_ARG_READWRITE, ARG_DND_CODE); - gtk_object_add_arg_type ("ETableFieldChooserItem::full_header", GTK_TYPE_OBJECT, - GTK_ARG_WRITABLE, ARG_FULL_HEADER); - gtk_object_add_arg_type ("ETableFieldChooserItem::header", GTK_TYPE_OBJECT, - GTK_ARG_WRITABLE, ARG_HEADER); - gtk_object_add_arg_type ("ETableFieldChooserItem::width", GTK_TYPE_DOUBLE, - GTK_ARG_READWRITE, ARG_WIDTH); - gtk_object_add_arg_type ("ETableFieldChooserItem::height", GTK_TYPE_DOUBLE, - GTK_ARG_READABLE, ARG_HEIGHT); + + g_object_class_install_property (object_class, PROP_DND_CODE, + g_param_spec_string ("dnd_code", + _("DnD code"), + /*_( */"XXX blurb" /*)*/, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_FULL_HEADER, + g_param_spec_object ("full_header", + _("Full Header"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_HEADER_TYPE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_HEADER, + g_param_spec_object ("header", + _("Header"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_HEADER_TYPE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_WIDTH, + g_param_spec_double ("width", + _("Width"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXDOUBLE, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_HEIGHT, + g_param_spec_double ("height", + _("Height"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXDOUBLE, 0, + G_PARAM_READABLE)); } static void @@ -678,26 +703,9 @@ etfci_init (GnomeCanvasItem *item) e_canvas_item_set_reflow_callback(item, etfci_reflow); } -GtkType -e_table_field_chooser_item_get_type (void) -{ - static GtkType type = 0; - - if (!type){ - GtkTypeInfo info = { - "ETableFieldChooserItem", - sizeof (ETableFieldChooserItem), - sizeof (ETableFieldChooserItemClass), - (GtkClassInitFunc) etfci_class_init, - (GtkObjectInitFunc) etfci_init, - NULL, /* reserved 1 */ - NULL, /* reserved 2 */ - (GtkClassInitFunc) NULL - }; - - type = gtk_type_unique (PARENT_OBJECT_TYPE, &info); - } - - return type; -} - +E_MAKE_TYPE (e_table_field_chooser_item, + "ETableFieldChooserItem", + ETableFieldChooserItem, + etfci_class_init, + etfci_init, + PARENT_OBJECT_TYPE); diff --git a/widgets/table/e-table-field-chooser-item.h b/widgets/table/e-table-field-chooser-item.h index 8db4587955..2ed37d37f1 100644 --- a/widgets/table/e-table-field-chooser-item.h +++ b/widgets/table/e-table-field-chooser-item.h @@ -31,10 +31,10 @@ G_BEGIN_DECLS #define E_TABLE_FIELD_CHOOSER_ITEM_TYPE (e_table_field_chooser_item_get_type ()) -#define E_TABLE_FIELD_CHOOSER_ITEM(o) (GTK_CHECK_CAST ((o), E_TABLE_FIELD_CHOOSER_ITEM_TYPE, ETableFieldChooserItem)) -#define E_TABLE_FIELD_CHOOSER_ITEM_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_FIELD_CHOOSER_ITEM_TYPE, ETableFieldChooserItemClass)) -#define E_IS_TABLE_FIELD_CHOOSER_ITEM(o) (GTK_CHECK_TYPE ((o), E_TABLE_FIELD_CHOOSER_ITEM_TYPE)) -#define E_IS_TABLE_FIELD_CHOOSER_ITEM_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_FIELD_CHOOSER_ITEM_TYPE)) +#define E_TABLE_FIELD_CHOOSER_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_FIELD_CHOOSER_ITEM_TYPE, ETableFieldChooserItem)) +#define E_TABLE_FIELD_CHOOSER_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_FIELD_CHOOSER_ITEM_TYPE, ETableFieldChooserItemClass)) +#define E_IS_TABLE_FIELD_CHOOSER_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_FIELD_CHOOSER_ITEM_TYPE)) +#define E_IS_TABLE_FIELD_CHOOSER_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_FIELD_CHOOSER_ITEM_TYPE)) typedef struct { GnomeCanvasItem parent; @@ -68,7 +68,7 @@ typedef struct { GnomeCanvasItemClass parent_class; } ETableFieldChooserItemClass; -GtkType e_table_field_chooser_item_get_type (void); +GType e_table_field_chooser_item_get_type (void); G_END_DECLS diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index 4bbdd251a8..7020e22262 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -28,70 +28,70 @@ #include <libgnomecanvas/gnome-canvas-rect-ellipse.h> #include "e-table-field-chooser.h" #include "e-table-field-chooser-item.h" +#include <gal/util/e-i18n.h> +#include <gal/util/e-util.h> static void e_table_field_chooser_init (ETableFieldChooser *card); static void e_table_field_chooser_class_init (ETableFieldChooserClass *klass); -static void e_table_field_chooser_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void e_table_field_chooser_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void e_table_field_chooser_destroy (GtkObject *object); +static void e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_dispose (GObject *object); +#define PARENT_TYPE GTK_TYPE_VBOX static GtkVBoxClass *parent_class = NULL; /* The arguments we take */ enum { - ARG_0, - ARG_FULL_HEADER, - ARG_HEADER, - ARG_DND_CODE + PROP_0, + PROP_FULL_HEADER, + PROP_HEADER, + PROP_DND_CODE }; -GtkType -e_table_field_chooser_get_type (void) -{ - static GtkType table_field_chooser_type = 0; - - if (!table_field_chooser_type) - { - static const GtkTypeInfo table_field_chooser_info = - { - "ETableFieldChooser", - sizeof (ETableFieldChooser), - sizeof (ETableFieldChooserClass), - (GtkClassInitFunc) e_table_field_chooser_class_init, - (GtkObjectInitFunc) e_table_field_chooser_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - table_field_chooser_type = gtk_type_unique (gtk_vbox_get_type (), &table_field_chooser_info); - } - - return table_field_chooser_type; -} +E_MAKE_TYPE (e_table_field_chooser, + "ETableFieldChooser", + ETableFieldChooser, + e_table_field_chooser_class_init, + e_table_field_chooser_init, + PARENT_TYPE); static void e_table_field_chooser_class_init (ETableFieldChooserClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; GtkVBoxClass *vbox_class; - object_class = (GtkObjectClass*) klass; + object_class = (GObjectClass*) klass; vbox_class = (GtkVBoxClass *) klass; glade_gnome_init(); - parent_class = gtk_type_class (gtk_vbox_get_type ()); - - object_class->set_arg = e_table_field_chooser_set_arg; - object_class->get_arg = e_table_field_chooser_get_arg; - object_class->destroy = e_table_field_chooser_destroy; - gtk_object_add_arg_type ("ETableFieldChooser::dnd_code", GTK_TYPE_STRING, - GTK_ARG_READWRITE, ARG_DND_CODE); - gtk_object_add_arg_type ("ETableFieldChooser::full_header", GTK_TYPE_OBJECT, - GTK_ARG_READWRITE, ARG_FULL_HEADER); - gtk_object_add_arg_type ("ETableFieldChooser::header", GTK_TYPE_OBJECT, - GTK_ARG_READWRITE, ARG_HEADER); + parent_class = g_type_class_ref (GTK_TYPE_VBOX); + + object_class->set_property = e_table_field_chooser_set_property; + object_class->get_property = e_table_field_chooser_get_property; + object_class->dispose = e_table_field_chooser_dispose; + + g_object_class_install_property (object_class, PROP_DND_CODE, + g_param_spec_string ("dnd_code", + _("DnD code"), + /*_( */"XXX blurb" /*)*/, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_FULL_HEADER, + g_param_spec_object ("full_header", + _("Full Header"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_HEADER_TYPE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_HEADER, + g_param_spec_object ("header", + _("Header"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_HEADER_TYPE, + G_PARAM_READWRITE)); } static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, ETableFieldChooser *etfc) @@ -101,9 +101,9 @@ static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, ETab gnome_canvas_item_set( etfc->item, "width", (double) allocation->width, NULL ); - gtk_object_get(GTK_OBJECT(etfc->item), - "height", &height, - NULL); + g_object_get(etfc->item, + "height", &height, + NULL); height = MAX(height, allocation->height); gnome_canvas_set_scroll_region(GNOME_CANVAS( etfc->canvas ), 0, 0, allocation->width - 1, height - 1); gnome_canvas_item_set( etfc->rect, @@ -115,9 +115,9 @@ static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, ETab static void resize(GnomeCanvas *canvas, ETableFieldChooser *etfc) { double height; - gtk_object_get(GTK_OBJECT(etfc->item), - "height", &height, - NULL); + g_object_get(etfc->item, + "height", &height, + NULL); height = MAX(height, etfc->last_alloc.height); @@ -165,25 +165,25 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) "dnd_code", etfc->dnd_code, NULL ); - gtk_signal_connect( GTK_OBJECT( etfc->canvas ), "reflow", - GTK_SIGNAL_FUNC( resize ), - etfc); + g_signal_connect( etfc->canvas, "reflow", + G_CALLBACK ( resize ), + etfc); gnome_canvas_set_scroll_region ( GNOME_CANVAS( etfc->canvas ), 0, 0, 100, 100 ); /* Connect the signals */ - gtk_signal_connect (GTK_OBJECT (etfc->canvas), "size_allocate", - GTK_SIGNAL_FUNC (allocate_callback), - etfc); + g_signal_connect (etfc->canvas, "size_allocate", + G_CALLBACK (allocate_callback), + etfc); gtk_widget_pop_colormap (); gtk_widget_show(widget); } static void -e_table_field_chooser_destroy (GtkObject *object) +e_table_field_chooser_dispose (GObject *object) { ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER(object); @@ -202,58 +202,58 @@ e_table_field_chooser_destroy (GtkObject *object) g_object_unref (etfc->gui); etfc->gui = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->dispose) + (* G_OBJECT_CLASS (parent_class)->dispose) (object); } GtkWidget* e_table_field_chooser_new (void) { - GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_table_field_chooser_get_type ())); + GtkWidget *widget = GTK_WIDGET (g_object_new (E_TABLE_FIELD_CHOOSER_TYPE, NULL)); return widget; } static void -e_table_field_chooser_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER(object); - switch (arg_id){ - case ARG_DND_CODE: + switch (prop_id){ + case PROP_DND_CODE: g_free(etfc->dnd_code); - etfc->dnd_code = g_strdup(GTK_VALUE_STRING (*arg)); + etfc->dnd_code = g_strdup(g_value_get_string(value)); if (etfc->item) - gtk_object_set(GTK_OBJECT(etfc->item), - "dnd_code", etfc->dnd_code, - NULL); + g_object_set(etfc->item, + "dnd_code", etfc->dnd_code, + NULL); break; - case ARG_FULL_HEADER: + case PROP_FULL_HEADER: if (etfc->full_header) g_object_unref (etfc->full_header); - if (GTK_VALUE_OBJECT(*arg)) - etfc->full_header = E_TABLE_HEADER(GTK_VALUE_OBJECT(*arg)); + if (g_value_get_object (value)) + etfc->full_header = E_TABLE_HEADER(g_value_get_object (value)); else etfc->full_header = NULL; if (etfc->full_header) g_object_ref (etfc->full_header); if (etfc->item) - gtk_object_set(GTK_OBJECT(etfc->item), - "full_header", etfc->full_header, - NULL); + g_object_set(etfc->item, + "full_header", etfc->full_header, + NULL); break; - case ARG_HEADER: + case PROP_HEADER: if (etfc->header) g_object_unref (etfc->header); - if (GTK_VALUE_OBJECT(*arg)) - etfc->header = E_TABLE_HEADER(GTK_VALUE_OBJECT(*arg)); + if (g_value_get_object (value)) + etfc->header = E_TABLE_HEADER(g_value_get_object (value)); else etfc->header = NULL; if (etfc->header) g_object_ref (etfc->header); if (etfc->item) - gtk_object_set(GTK_OBJECT(etfc->item), - "header", etfc->header, - NULL); + g_object_set(etfc->item, + "header", etfc->header, + NULL); break; default: break; @@ -261,22 +261,22 @@ e_table_field_chooser_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) } static void -e_table_field_chooser_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER(object); - switch (arg_id) { - case ARG_DND_CODE: - GTK_VALUE_STRING (*arg) = g_strdup (etfc->dnd_code); + switch (prop_id) { + case PROP_DND_CODE: + g_value_set_string (value, g_strdup (etfc->dnd_code)); break; - case ARG_FULL_HEADER: - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(etfc->full_header); + case PROP_FULL_HEADER: + g_value_set_object (value, etfc->full_header); break; - case ARG_HEADER: - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(etfc->header); + case PROP_HEADER: + g_value_set_object (value, etfc->header); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } diff --git a/widgets/table/e-table-field-chooser.h b/widgets/table/e-table-field-chooser.h index d422e74f9b..65efeeedbe 100644 --- a/widgets/table/e-table-field-chooser.h +++ b/widgets/table/e-table-field-chooser.h @@ -39,10 +39,10 @@ G_BEGIN_DECLS */ #define E_TABLE_FIELD_CHOOSER_TYPE (e_table_field_chooser_get_type ()) -#define E_TABLE_FIELD_CHOOSER(obj) (GTK_CHECK_CAST ((obj), E_TABLE_FIELD_CHOOSER_TYPE, ETableFieldChooser)) -#define E_TABLE_FIELD_CHOOSER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TABLE_FIELD_CHOOSER_TYPE, ETableFieldChooserClass)) -#define E_IS_TABLE_FIELD_CHOOSER(obj) (GTK_CHECK_TYPE ((obj), E_TABLE_FIELD_CHOOSER_TYPE)) -#define E_IS_TABLE_FIELD_CHOOSER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TABLE_FIELD_CHOOSER_TYPE)) +#define E_TABLE_FIELD_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TABLE_FIELD_CHOOSER_TYPE, ETableFieldChooser)) +#define E_TABLE_FIELD_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TABLE_FIELD_CHOOSER_TYPE, ETableFieldChooserClass)) +#define E_IS_TABLE_FIELD_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TABLE_FIELD_CHOOSER_TYPE)) +#define E_IS_TABLE_FIELD_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TABLE_FIELD_CHOOSER_TYPE)) typedef struct _ETableFieldChooser ETableFieldChooser; @@ -72,7 +72,7 @@ struct _ETableFieldChooserClass GtkWidget *e_table_field_chooser_new(void); -GtkType e_table_field_chooser_get_type (void); +GType e_table_field_chooser_get_type (void); G_END_DECLS diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 9f477ff941..7b8df0db5b 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -44,19 +44,19 @@ static GnomeCanvasGroupClass *etgc_parent_class; /* The arguments we take */ enum { - ARG_0, - ARG_HEIGHT, - ARG_WIDTH, - ARG_MINIMUM_WIDTH, - ARG_FROZEN, - ARG_TABLE_ALTERNATING_ROW_COLORS, - ARG_TABLE_HORIZONTAL_DRAW_GRID, - ARG_TABLE_VERTICAL_DRAW_GRID, - ARG_TABLE_DRAW_FOCUS, - ARG_CURSOR_MODE, - ARG_SELECTION_MODEL, - ARG_LENGTH_THRESHOLD, - ARG_UNIFORM_ROW_HEIGHT + PROP_0, + PROP_HEIGHT, + PROP_WIDTH, + PROP_MINIMUM_WIDTH, + PROP_FROZEN, + PROP_TABLE_ALTERNATING_ROW_COLORS, + PROP_TABLE_HORIZONTAL_DRAW_GRID, + PROP_TABLE_VERTICAL_DRAW_GRID, + PROP_TABLE_DRAW_FOCUS, + PROP_CURSOR_MODE, + PROP_SELECTION_MODEL, + PROP_LENGTH_THRESHOLD, + PROP_UNIFORM_ROW_HEIGHT }; typedef struct { @@ -103,7 +103,7 @@ e_table_group_container_list_free (ETableGroupContainer *etgc) } static void -etgc_destroy (GtkObject *object) +etgc_dispose (GObject *object) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object); @@ -129,7 +129,7 @@ etgc_destroy (GtkObject *object) e_table_group_container_list_free (etgc); - GTK_OBJECT_CLASS (etgc_parent_class)->destroy (object); + G_OBJECT_CLASS (etgc_parent_class)->dispose (object); } /** @@ -196,7 +196,7 @@ e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header g_return_val_if_fail (parent != NULL, NULL); - etgc = gtk_type_new (e_table_group_container_get_type ()); + etgc = g_object_new (E_TABLE_GROUP_CONTAINER_TYPE, NULL); e_table_group_container_construct (parent, etgc, full_header, header, model, sort_info, n); @@ -451,20 +451,20 @@ create_child_node (ETableGroupContainer *etgc, void *val) "minimum_width", etgc->minimum_width - GROUP_INDENT, NULL); - gtk_signal_connect (GTK_OBJECT (child), "cursor_change", - GTK_SIGNAL_FUNC (child_cursor_change), etgc); - gtk_signal_connect (GTK_OBJECT (child), "cursor_activated", - GTK_SIGNAL_FUNC (child_cursor_activated), etgc); - gtk_signal_connect (GTK_OBJECT (child), "double_click", - GTK_SIGNAL_FUNC (child_double_click), etgc); - gtk_signal_connect (GTK_OBJECT (child), "right_click", - GTK_SIGNAL_FUNC (child_right_click), etgc); - gtk_signal_connect (GTK_OBJECT (child), "click", - GTK_SIGNAL_FUNC (child_click), etgc); - gtk_signal_connect (GTK_OBJECT (child), "key_press", - GTK_SIGNAL_FUNC (child_key_press), etgc); - gtk_signal_connect (GTK_OBJECT (child), "start_drag", - GTK_SIGNAL_FUNC (child_start_drag), etgc); + g_signal_connect (child, "cursor_change", + G_CALLBACK (child_cursor_change), etgc); + g_signal_connect (child, "cursor_activated", + G_CALLBACK (child_cursor_activated), etgc); + g_signal_connect (child, "double_click", + G_CALLBACK (child_double_click), etgc); + g_signal_connect (child, "right_click", + G_CALLBACK (child_right_click), etgc); + g_signal_connect (child, "click", + G_CALLBACK (child_click), etgc); + g_signal_connect (child, "key_press", + G_CALLBACK (child_key_press), etgc); + g_signal_connect (child, "start_drag", + G_CALLBACK (child_start_drag), etgc); child_node->child = child; child_node->key = e_table_model_duplicate_value (etg->model, etgc->ecol->col_idx, val); child_node->string = e_table_model_value_to_string (etg->model, etgc->ecol->col_idx, val); @@ -731,112 +731,112 @@ static void etgc_thaw (ETableGroup *etg) } static void -etgc_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +etgc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object); GList *list; - switch (arg_id) { - case ARG_FROZEN: - if (GTK_VALUE_BOOL (*arg)) + switch (prop_id) { + case PROP_FROZEN: + if (g_value_get_boolean (value)) etg->frozen = TRUE; else { etg->frozen = FALSE; etgc_thaw (etg); } break; - case ARG_MINIMUM_WIDTH: - case ARG_WIDTH: - etgc->minimum_width = GTK_VALUE_DOUBLE(*arg); + case PROP_MINIMUM_WIDTH: + case PROP_WIDTH: + etgc->minimum_width = g_value_get_double (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; - gtk_object_set (GTK_OBJECT(child_node->child), - "minimum_width", etgc->minimum_width - GROUP_INDENT, - NULL); + g_object_set (child_node->child, + "minimum_width", etgc->minimum_width - GROUP_INDENT, + NULL); } break; - case ARG_LENGTH_THRESHOLD: - etgc->length_threshold = GTK_VALUE_INT (*arg); + case PROP_LENGTH_THRESHOLD: + etgc->length_threshold = g_value_get_int (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; - gtk_object_set (GTK_OBJECT(child_node->child), - "length_threshold", GTK_VALUE_INT (*arg), - NULL); + g_object_set (child_node->child, + "length_threshold", etgc->length_threshold, + NULL); } break; - case ARG_UNIFORM_ROW_HEIGHT: - etgc->uniform_row_height = GTK_VALUE_BOOL (*arg); + case PROP_UNIFORM_ROW_HEIGHT: + etgc->uniform_row_height = g_value_get_boolean (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; - gtk_object_set (GTK_OBJECT(child_node->child), - "uniform_row_height", GTK_VALUE_BOOL (*arg), - NULL); + g_object_set (child_node->child, + "uniform_row_height", etgc->uniform_row_height, + NULL); } break; - case ARG_SELECTION_MODEL: + case PROP_SELECTION_MODEL: if (etgc->selection_model) g_object_unref (etgc->selection_model); - etgc->selection_model = E_SELECTION_MODEL(GTK_VALUE_OBJECT (*arg)); + etgc->selection_model = E_SELECTION_MODEL(g_value_get_object (value)); if (etgc->selection_model) g_object_ref (etgc->selection_model); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; - gtk_object_set (GTK_OBJECT(child_node->child), - "selection_model", etgc->selection_model, - NULL); + g_object_set (child_node->child, + "selection_model", etgc->selection_model, + NULL); } break; - case ARG_TABLE_ALTERNATING_ROW_COLORS: - etgc->alternating_row_colors = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_ALTERNATING_ROW_COLORS: + etgc->alternating_row_colors = g_value_get_boolean (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; - gtk_object_set (GTK_OBJECT(child_node->child), - "alternating_row_colors", GTK_VALUE_BOOL (*arg), - NULL); + g_object_set (child_node->child, + "alternating_row_colors", etgc->alternating_row_colors, + NULL); } break; - case ARG_TABLE_HORIZONTAL_DRAW_GRID: - etgc->horizontal_draw_grid = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_HORIZONTAL_DRAW_GRID: + etgc->horizontal_draw_grid = g_value_get_boolean (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; - gtk_object_set (GTK_OBJECT(child_node->child), - "horizontal_draw_grid", GTK_VALUE_BOOL (*arg), - NULL); + g_object_set (child_node->child, + "horizontal_draw_grid", etgc->horizontal_draw_grid, + NULL); } break; - case ARG_TABLE_VERTICAL_DRAW_GRID: - etgc->vertical_draw_grid = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_VERTICAL_DRAW_GRID: + etgc->vertical_draw_grid = g_value_get_boolean (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; - gtk_object_set (GTK_OBJECT(child_node->child), - "vertical_draw_grid", GTK_VALUE_BOOL (*arg), - NULL); + g_object_set (child_node->child, + "vertical_draw_grid", etgc->vertical_draw_grid, + NULL); } break; - case ARG_TABLE_DRAW_FOCUS: - etgc->draw_focus = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_DRAW_FOCUS: + etgc->draw_focus = g_value_get_boolean (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; - gtk_object_set (GTK_OBJECT(child_node->child), - "drawfocus", GTK_VALUE_BOOL (*arg), - NULL); + g_object_set (child_node->child, + "drawfocus", etgc->draw_focus, + NULL); } break; - case ARG_CURSOR_MODE: - etgc->cursor_mode = GTK_VALUE_INT (*arg); + case PROP_CURSOR_MODE: + etgc->cursor_mode = g_value_get_int (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; - gtk_object_set (GTK_OBJECT(child_node->child), - "cursor_mode", GTK_VALUE_INT (*arg), - NULL); + g_object_set (child_node->child, + "cursor_mode", etgc->cursor_mode, + NULL); } break; default: @@ -845,48 +845,48 @@ etgc_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) } static void -etgc_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +etgc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object); - switch (arg_id) { - case ARG_FROZEN: - GTK_VALUE_BOOL (*arg) = etg->frozen; + switch (prop_id) { + case PROP_FROZEN: + g_value_set_boolean (value, etg->frozen); break; - case ARG_HEIGHT: - GTK_VALUE_DOUBLE (*arg) = etgc->height; + case PROP_HEIGHT: + g_value_set_double (value, etgc->height); break; - case ARG_WIDTH: - GTK_VALUE_DOUBLE (*arg) = etgc->width; + case PROP_WIDTH: + g_value_set_double (value, etgc->width); break; - case ARG_MINIMUM_WIDTH: - GTK_VALUE_DOUBLE(*arg) = etgc->minimum_width; + case PROP_MINIMUM_WIDTH: + g_value_set_double (value, etgc->minimum_width); break; - case ARG_UNIFORM_ROW_HEIGHT: - GTK_VALUE_BOOL(*arg) = etgc->uniform_row_height; + case PROP_UNIFORM_ROW_HEIGHT: + g_value_set_boolean (value, etgc->uniform_row_height); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void -etgc_class_init (GtkObjectClass *object_class) +etgc_class_init (GObjectClass *object_class) { GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class; ETableGroupClass *e_group_class = E_TABLE_GROUP_CLASS(object_class); - object_class->destroy = etgc_destroy; - object_class->set_arg = etgc_set_arg; - object_class->get_arg = etgc_get_arg; + object_class->dispose = etgc_dispose; + object_class->set_property = etgc_set_property; + object_class->get_property = etgc_get_property; item_class->event = etgc_event; item_class->realize = etgc_realize; item_class->unrealize = etgc_unrealize; - etgc_parent_class = gtk_type_class (PARENT_TYPE); + etgc_parent_class = g_type_class_ref (PARENT_TYPE); e_group_class->add = etgc_add; e_group_class->add_array = etgc_add_array; @@ -901,31 +901,89 @@ etgc_class_init (GtkObjectClass *object_class) e_group_class->compute_location = etgc_compute_location; e_group_class->get_cell_geometry = etgc_get_cell_geometry; - gtk_object_add_arg_type ("ETableGroupContainer::alternating_row_colors", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_ALTERNATING_ROW_COLORS); - gtk_object_add_arg_type ("ETableGroupContainer::horizontal_draw_grid", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_HORIZONTAL_DRAW_GRID); - gtk_object_add_arg_type ("ETableGroupContainer::vertical_draw_grid", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_VERTICAL_DRAW_GRID); - gtk_object_add_arg_type ("ETableGroupContainer::drawfocus", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_DRAW_FOCUS); - gtk_object_add_arg_type ("ETableGroupContainer::cursor_mode", GTK_TYPE_INT, - GTK_ARG_WRITABLE, ARG_CURSOR_MODE); - gtk_object_add_arg_type ("ETableGroupContainer::selection_model", E_SELECTION_MODEL_TYPE, - GTK_ARG_WRITABLE, ARG_SELECTION_MODEL); - gtk_object_add_arg_type ("ETableGroupContainer::length_threshold", GTK_TYPE_INT, - GTK_ARG_WRITABLE, ARG_LENGTH_THRESHOLD); - gtk_object_add_arg_type ("ETableGroupContainer::uniform_row_height", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_UNIFORM_ROW_HEIGHT); - - gtk_object_add_arg_type ("ETableGroupContainer::frozen", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_FROZEN); - gtk_object_add_arg_type ("ETableGroupContainer::height", GTK_TYPE_DOUBLE, - GTK_ARG_READABLE, ARG_HEIGHT); - gtk_object_add_arg_type ("ETableGroupContainer::width", GTK_TYPE_DOUBLE, - GTK_ARG_READWRITE, ARG_WIDTH); - gtk_object_add_arg_type ("ETableGroupContainer::minimum_width", GTK_TYPE_DOUBLE, - GTK_ARG_READWRITE, ARG_MINIMUM_WIDTH); + g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS, + g_param_spec_boolean ("alternating_row_colors", + _( "Alternating Row Colors" ), + _( "Alternating Row Colors" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID, + g_param_spec_boolean ("horizontal_draw_grid", + _( "Horizontal Draw Grid" ), + _( "Horizontal Draw Grid" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID, + g_param_spec_boolean ("vertical_draw_grid", + _( "Vertical Draw Grid" ), + _( "Vertical Draw Grid" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS, + g_param_spec_boolean ("drawfocus", + _( "Draw focus" ), + _( "Draw focus" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_CURSOR_MODE, + g_param_spec_int ("cursor_mode", + _( "Cursor mode" ), + _( "Cursor mode" ), + E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_SELECTION_MODEL, + g_param_spec_object ("selection_model", + _( "Selection model" ), + _( "Selection model" ), + E_SELECTION_MODEL_TYPE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD, + g_param_spec_int ("length_threshold", + _( "Length Threshold" ), + _( "Length Threshold" ), + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT, + g_param_spec_boolean ("uniform_row_height", + _( "Uniform row height" ), + _( "Uniform row height" ), + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_FROZEN, + g_param_spec_boolean ("frozen", + _( "Frozen" ), + _( "Frozen" ), + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_HEIGHT, + g_param_spec_double ("height", + _( "Height" ), + _( "Height" ), + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_WIDTH, + g_param_spec_double ("width", + _( "Width" ), + _( "Width" ), + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH, + g_param_spec_double ("minimum_width", + _( "Minimum width" ), + _( "Minimum Width" ), + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); } static void @@ -934,9 +992,9 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(item); gboolean frozen; - gtk_object_get (GTK_OBJECT(etgc), - "frozen", &frozen, - NULL); + g_object_get (etgc, + "frozen", &frozen, + NULL); if (frozen) return; @@ -968,9 +1026,9 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; ETableGroup *child = child_node->child; - gtk_object_get (GTK_OBJECT(child), - "width", &item_width, - NULL); + g_object_get (child, + "width", &item_width, + NULL); if (item_width > running_width) running_width = item_width; @@ -978,9 +1036,9 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) for ( list = etgc->children; list; list = g_list_next (list)){ ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; ETableGroup *child = child_node->child; - gtk_object_get (GTK_OBJECT(child), - "height", &item_height, - NULL); + g_object_get (child, + "height", &item_height, + NULL); e_canvas_item_move_absolute (GNOME_CANVAS_ITEM(child_node->text), GROUP_INDENT, @@ -1248,7 +1306,7 @@ static gboolean e_table_group_container_data_left (EPrintable *ep, ETGCPrintContext *groupcontext) { - gtk_signal_emit_stop_by_name(GTK_OBJECT(ep), "data_left"); + g_signal_stop_emission_by_name(ep, "data_left"); return groupcontext->child != NULL; } @@ -1284,7 +1342,7 @@ e_table_group_container_height (EPrintable *ep, g_object_ref (child_printable); else { if (!child) { - gtk_signal_emit_stop_by_name(GTK_OBJECT(ep), "height"); + g_signal_stop_emission_by_name(ep, "height"); return 0; } else { child_node = child->data; @@ -1326,7 +1384,7 @@ e_table_group_container_height (EPrintable *ep, } if (child_printable) g_object_unref (child_printable); - gtk_signal_emit_stop_by_name(GTK_OBJECT(ep), "height"); + g_signal_stop_emission_by_name(ep, "height"); return height; } @@ -1352,7 +1410,7 @@ e_table_group_container_will_fit (EPrintable *ep, g_object_ref (child_printable); else { if (!child) { - gtk_signal_emit_stop_by_name(GTK_OBJECT(ep), "will_fit"); + g_signal_stop_emission_by_name(ep, "will_fit"); return will_fit; } else { child_node = child->data; @@ -1396,14 +1454,17 @@ e_table_group_container_will_fit (EPrintable *ep, if (child_printable) g_object_unref (child_printable); - gtk_signal_emit_stop_by_name(GTK_OBJECT(ep), "will_fit"); + g_signal_stop_emission_by_name(ep, "will_fit"); return will_fit; } static void -e_table_group_container_printable_destroy (GtkObject *object, - ETGCPrintContext *groupcontext) +e_table_group_container_printable_destroy (gpointer data, + GObject *where_object_was) + { + ETGCPrintContext *groupcontext = data; + g_object_unref (groupcontext->etgc); if (groupcontext->child_printable) g_object_ref (groupcontext->child_printable); @@ -1423,30 +1484,29 @@ etgc_get_printable (ETableGroup *etg) groupcontext->child = etgc->children; groupcontext->child_printable = NULL; - gtk_signal_connect (GTK_OBJECT(printable), - "print_page", - GTK_SIGNAL_FUNC(e_table_group_container_print_page), - groupcontext); - gtk_signal_connect (GTK_OBJECT(printable), - "data_left", - GTK_SIGNAL_FUNC(e_table_group_container_data_left), - groupcontext); - gtk_signal_connect (GTK_OBJECT(printable), - "reset", - GTK_SIGNAL_FUNC(e_table_group_container_reset), - groupcontext); - gtk_signal_connect (GTK_OBJECT(printable), - "height", - GTK_SIGNAL_FUNC(e_table_group_container_height), - groupcontext); - gtk_signal_connect (GTK_OBJECT(printable), - "will_fit", - GTK_SIGNAL_FUNC(e_table_group_container_will_fit), - groupcontext); - gtk_signal_connect (GTK_OBJECT(printable), - "destroy", - GTK_SIGNAL_FUNC(e_table_group_container_printable_destroy), - groupcontext); + g_signal_connect (printable, + "print_page", + G_CALLBACK(e_table_group_container_print_page), + groupcontext); + g_signal_connect (printable, + "data_left", + G_CALLBACK(e_table_group_container_data_left), + groupcontext); + g_signal_connect (printable, + "reset", + G_CALLBACK(e_table_group_container_reset), + groupcontext); + g_signal_connect (printable, + "height", + G_CALLBACK(e_table_group_container_height), + groupcontext); + g_signal_connect (printable, + "will_fit", + G_CALLBACK(e_table_group_container_will_fit), + groupcontext); + g_object_weak_ref (G_OBJECT (printable), + e_table_group_container_printable_destroy, + groupcontext); return printable; } diff --git a/widgets/table/e-table-group-container.h b/widgets/table/e-table-group-container.h index fd5c2c348d..b094167c09 100644 --- a/widgets/table/e-table-group-container.h +++ b/widgets/table/e-table-group-container.h @@ -33,10 +33,10 @@ G_BEGIN_DECLS #define E_TABLE_GROUP_CONTAINER_TYPE (e_table_group_container_get_type ()) -#define E_TABLE_GROUP_CONTAINER(o) (GTK_CHECK_CAST ((o), E_TABLE_GROUP_CONTAINER_TYPE, ETableGroupContainer)) -#define E_TABLE_GROUP_CONTAINER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_GROUP_CONTAINER_TYPE, ETableGroupContainerClass)) -#define E_IS_TABLE_GROUP_CONTAINER(o) (GTK_CHECK_TYPE ((o), E_TABLE_GROUP_CONTAINER_TYPE)) -#define E_IS_TABLE_GROUP_CONTAINER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_GROUP_CONTAINER_TYPE)) +#define E_TABLE_GROUP_CONTAINER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_GROUP_CONTAINER_TYPE, ETableGroupContainer)) +#define E_TABLE_GROUP_CONTAINER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_GROUP_CONTAINER_TYPE, ETableGroupContainerClass)) +#define E_IS_TABLE_GROUP_CONTAINER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_GROUP_CONTAINER_TYPE)) +#define E_IS_TABLE_GROUP_CONTAINER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_GROUP_CONTAINER_TYPE)) typedef struct { ETableGroup group; @@ -91,7 +91,7 @@ void e_table_group_container_construct (GnomeCanvasGroup *parent, ETable ETableHeader *header, ETableModel *model, ETableSortInfo *sort_info, int n); -GtkType e_table_group_container_get_type (void); +GType e_table_group_container_get_type (void); G_END_DECLS diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index cd9bfa775a..e580fc89fc 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -29,6 +29,7 @@ #include "e-table-sorted-variable.h" #include "e-table-sorted.h" #include "gal/util/e-util.h" +#include "gal/util/e-i18n.h" #include "gal/widgets/e-canvas.h" #define PARENT_TYPE e_table_group_get_type () @@ -37,26 +38,23 @@ static GnomeCanvasGroupClass *etgl_parent_class; /* The arguments we take */ enum { - ARG_0, - ARG_HEIGHT, - ARG_WIDTH, - ARG_MINIMUM_WIDTH, - ARG_FROZEN, - ARG_TABLE_ALTERNATING_ROW_COLORS, - ARG_TABLE_HORIZONTAL_DRAW_GRID, - ARG_TABLE_VERTICAL_DRAW_GRID, - ARG_TABLE_DRAW_FOCUS, - ARG_CURSOR_MODE, - ARG_LENGTH_THRESHOLD, - ARG_SELECTION_MODEL, - ARG_UNIFORM_ROW_HEIGHT + PROP_0, + PROP_HEIGHT, + PROP_WIDTH, + PROP_MINIMUM_WIDTH, + PROP_FROZEN, + PROP_TABLE_ALTERNATING_ROW_COLORS, + PROP_TABLE_HORIZONTAL_DRAW_GRID, + PROP_TABLE_VERTICAL_DRAW_GRID, + PROP_TABLE_DRAW_FOCUS, + PROP_CURSOR_MODE, + PROP_LENGTH_THRESHOLD, + PROP_SELECTION_MODEL, + PROP_UNIFORM_ROW_HEIGHT }; -static void etgl_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void etgl_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); - static void -etgl_destroy (GtkObject *object) +etgl_dispose (GObject *object) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF(object); @@ -67,26 +65,26 @@ etgl_destroy (GtkObject *object) if (etgl->item) { if (etgl->etgl_cursor_change_id != 0) - gtk_signal_disconnect (GTK_OBJECT (etgl->item), - etgl->etgl_cursor_change_id); + g_signal_handler_disconnect (etgl->item, + etgl->etgl_cursor_change_id); if (etgl->etgl_cursor_activated_id != 0) - gtk_signal_disconnect (GTK_OBJECT (etgl->item), - etgl->etgl_cursor_activated_id); + g_signal_handler_disconnect (etgl->item, + etgl->etgl_cursor_activated_id); if (etgl->etgl_double_click_id != 0) - gtk_signal_disconnect (GTK_OBJECT (etgl->item), - etgl->etgl_double_click_id); + g_signal_handler_disconnect (etgl->item, + etgl->etgl_double_click_id); if (etgl->etgl_right_click_id != 0) - gtk_signal_disconnect (GTK_OBJECT (etgl->item), - etgl->etgl_right_click_id); + g_signal_handler_disconnect (etgl->item, + etgl->etgl_right_click_id); if (etgl->etgl_click_id != 0) - gtk_signal_disconnect (GTK_OBJECT (etgl->item), - etgl->etgl_click_id); + g_signal_handler_disconnect (etgl->item, + etgl->etgl_click_id); if (etgl->etgl_key_press_id != 0) - gtk_signal_disconnect (GTK_OBJECT (etgl->item), - etgl->etgl_key_press_id); + g_signal_handler_disconnect (etgl->item, + etgl->etgl_key_press_id); if (etgl->etgl_start_drag_id != 0) - gtk_signal_disconnect (GTK_OBJECT (etgl->item), - etgl->etgl_start_drag_id); + g_signal_handler_disconnect (etgl->item, + etgl->etgl_start_drag_id); etgl->etgl_cursor_change_id = 0; etgl->etgl_cursor_activated_id = 0; @@ -105,8 +103,8 @@ etgl_destroy (GtkObject *object) etgl->selection_model = NULL; } - if (GTK_OBJECT_CLASS (etgl_parent_class)->destroy) - GTK_OBJECT_CLASS (etgl_parent_class)->destroy (object); + if (G_OBJECT_CLASS (etgl_parent_class)->dispose) + G_OBJECT_CLASS (etgl_parent_class)->dispose (object); } static void @@ -155,7 +153,7 @@ e_table_group_leaf_new (GnomeCanvasGroup *parent, g_return_val_if_fail (parent != NULL, NULL); - etgl = gtk_type_new (e_table_group_leaf_get_type ()); + etgl = g_object_new (E_TABLE_GROUP_LEAF_TYPE, NULL); e_table_group_leaf_construct (parent, etgl, full_header, header, model, sort_info); @@ -234,12 +232,12 @@ etgl_reflow (GnomeCanvasItem *item, gint flags) { ETableGroupLeaf *leaf = E_TABLE_GROUP_LEAF(item); - gtk_object_get(GTK_OBJECT(leaf->item), - "height", &leaf->height, - NULL); - gtk_object_get(GTK_OBJECT(leaf->item), - "width", &leaf->width, - NULL); + g_object_get(leaf->item, + "height", &leaf->height, + NULL); + g_object_get(leaf->item, + "width", &leaf->width, + NULL); e_canvas_item_request_parent_reflow (item); } @@ -268,35 +266,35 @@ etgl_realize (GnomeCanvasItem *item) "uniform_row_height", etgl->uniform_row_height, NULL)); - etgl->etgl_cursor_change_id = gtk_signal_connect (GTK_OBJECT(etgl->item), - "cursor_change", - GTK_SIGNAL_FUNC(etgl_cursor_change), - etgl); - etgl->etgl_cursor_activated_id = gtk_signal_connect (GTK_OBJECT(etgl->item), - "cursor_activated", - GTK_SIGNAL_FUNC(etgl_cursor_activated), - etgl); - etgl->etgl_double_click_id = gtk_signal_connect (GTK_OBJECT(etgl->item), - "double_click", - GTK_SIGNAL_FUNC(etgl_double_click), - etgl); - - etgl->etgl_right_click_id = gtk_signal_connect (GTK_OBJECT(etgl->item), - "right_click", - GTK_SIGNAL_FUNC(etgl_right_click), - etgl); - etgl->etgl_click_id = gtk_signal_connect (GTK_OBJECT(etgl->item), - "click", - GTK_SIGNAL_FUNC(etgl_click), - etgl); - etgl->etgl_key_press_id = gtk_signal_connect (GTK_OBJECT(etgl->item), - "key_press", - GTK_SIGNAL_FUNC(etgl_key_press), - etgl); - etgl->etgl_start_drag_id = gtk_signal_connect (GTK_OBJECT(etgl->item), - "start_drag", - GTK_SIGNAL_FUNC(etgl_start_drag), - etgl); + etgl->etgl_cursor_change_id = g_signal_connect (etgl->item, + "cursor_change", + G_CALLBACK(etgl_cursor_change), + etgl); + etgl->etgl_cursor_activated_id = g_signal_connect (etgl->item, + "cursor_activated", + G_CALLBACK(etgl_cursor_activated), + etgl); + etgl->etgl_double_click_id = g_signal_connect (etgl->item, + "double_click", + G_CALLBACK(etgl_double_click), + etgl); + + etgl->etgl_right_click_id = g_signal_connect (etgl->item, + "right_click", + G_CALLBACK(etgl_right_click), + etgl); + etgl->etgl_click_id = g_signal_connect (etgl->item, + "click", + G_CALLBACK(etgl_click), + etgl); + etgl->etgl_key_press_id = g_signal_connect (etgl->item, + "key_press", + G_CALLBACK(etgl_key_press), + etgl); + etgl->etgl_start_drag_id = g_signal_connect (etgl->item, + "start_drag", + G_CALLBACK(etgl_start_drag), + etgl); e_canvas_item_request_reflow(item); } @@ -415,40 +413,36 @@ etgl_get_cell_geometry (ETableGroup *etg, int *row, int *col, int *x, int *y, in } static void -etgl_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +etgl_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object); - switch (arg_id) { - case ARG_FROZEN: - if (GTK_VALUE_BOOL (*arg)) - etg->frozen = TRUE; - else { - etg->frozen = FALSE; - } + switch (prop_id) { + case PROP_FROZEN: + etg->frozen = g_value_get_boolean (value); break; - case ARG_MINIMUM_WIDTH: - case ARG_WIDTH: - etgl->minimum_width = GTK_VALUE_DOUBLE(*arg); + case PROP_MINIMUM_WIDTH: + case PROP_WIDTH: + etgl->minimum_width = g_value_get_double (value); if (etgl->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), "minimum_width", etgl->minimum_width, NULL); } break; - case ARG_LENGTH_THRESHOLD: - etgl->length_threshold = GTK_VALUE_INT (*arg); + case PROP_LENGTH_THRESHOLD: + etgl->length_threshold = g_value_get_int (value); if (etgl->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), - "length_threshold", GTK_VALUE_INT (*arg), + "length_threshold", etgl->length_threshold, NULL); } break; - case ARG_SELECTION_MODEL: + case PROP_SELECTION_MODEL: if (etgl->selection_model) g_object_unref(etgl->selection_model); - etgl->selection_model = E_SELECTION_MODEL(GTK_VALUE_POINTER (*arg)); + etgl->selection_model = E_SELECTION_MODEL(g_value_get_object (value)); if (etgl->selection_model) { g_object_ref(etgl->selection_model); } @@ -459,8 +453,8 @@ etgl_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) } break; - case ARG_UNIFORM_ROW_HEIGHT: - etgl->uniform_row_height = GTK_VALUE_BOOL (*arg); + case PROP_UNIFORM_ROW_HEIGHT: + etgl->uniform_row_height = g_value_get_boolean (value); if (etgl->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), "uniform_row_height", etgl->uniform_row_height, @@ -468,48 +462,48 @@ etgl_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) } break; - case ARG_TABLE_ALTERNATING_ROW_COLORS: - etgl->alternating_row_colors = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_ALTERNATING_ROW_COLORS: + etgl->alternating_row_colors = g_value_get_boolean (value); if (etgl->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), - "alternating_row_colors", GTK_VALUE_BOOL (*arg), + "alternating_row_colors", etgl->alternating_row_colors, NULL); } break; - case ARG_TABLE_HORIZONTAL_DRAW_GRID: - etgl->horizontal_draw_grid = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_HORIZONTAL_DRAW_GRID: + etgl->horizontal_draw_grid = g_value_get_boolean (value); if (etgl->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), - "horizontal_draw_grid", GTK_VALUE_BOOL (*arg), + "horizontal_draw_grid", etgl->horizontal_draw_grid, NULL); } break; - case ARG_TABLE_VERTICAL_DRAW_GRID: - etgl->vertical_draw_grid = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_VERTICAL_DRAW_GRID: + etgl->vertical_draw_grid = g_value_get_boolean (value); if (etgl->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), - "vertical_draw_grid", GTK_VALUE_BOOL (*arg), + "vertical_draw_grid", etgl->vertical_draw_grid, NULL); } break; - case ARG_TABLE_DRAW_FOCUS: - etgl->draw_focus = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_DRAW_FOCUS: + etgl->draw_focus = g_value_get_boolean (value); if (etgl->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), - "drawfocus", GTK_VALUE_BOOL (*arg), - NULL); + "drawfocus", etgl->draw_focus, + NULL); } break; - case ARG_CURSOR_MODE: - etgl->cursor_mode = GTK_VALUE_INT (*arg); + case PROP_CURSOR_MODE: + etgl->cursor_mode = g_value_get_int (value); if (etgl->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), - "cursor_mode", GTK_VALUE_INT (*arg), - NULL); + "cursor_mode", etgl->cursor_mode, + NULL); } break; default: @@ -518,45 +512,45 @@ etgl_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) } static void -etgl_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +etgl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object); - switch (arg_id) { - case ARG_FROZEN: - GTK_VALUE_BOOL (*arg) = etg->frozen; + switch (prop_id) { + case PROP_FROZEN: + g_value_set_boolean (value, etg->frozen); break; - case ARG_HEIGHT: - GTK_VALUE_DOUBLE (*arg) = etgl->height; + case PROP_HEIGHT: + g_value_set_double (value, etgl->height); break; - case ARG_WIDTH: - GTK_VALUE_DOUBLE (*arg) = etgl->width; + case PROP_WIDTH: + g_value_set_double (value, etgl->width); break; - case ARG_MINIMUM_WIDTH: - GTK_VALUE_DOUBLE (*arg) = etgl->minimum_width; + case PROP_MINIMUM_WIDTH: + g_value_set_double (value, etgl->minimum_width); break; - case ARG_UNIFORM_ROW_HEIGHT: - GTK_VALUE_BOOL (*arg) = etgl->uniform_row_height; + case PROP_UNIFORM_ROW_HEIGHT: + g_value_set_boolean (value, etgl->uniform_row_height); default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void -etgl_class_init (GtkObjectClass *object_class) +etgl_class_init (GObjectClass *object_class) { GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class; ETableGroupClass *e_group_class = E_TABLE_GROUP_CLASS(object_class); - object_class->destroy = etgl_destroy; - object_class->set_arg = etgl_set_arg; - object_class->get_arg = etgl_get_arg; + object_class->dispose = etgl_dispose; + object_class->set_property = etgl_set_property; + object_class->get_property = etgl_get_property; item_class->realize = etgl_realize; - etgl_parent_class = gtk_type_class (PARENT_TYPE); + etgl_parent_class = g_type_class_ref (PARENT_TYPE); e_group_class->add = etgl_add; e_group_class->add_array = etgl_add_array; @@ -571,31 +565,89 @@ etgl_class_init (GtkObjectClass *object_class) e_group_class->compute_location = etgl_compute_location; e_group_class->get_cell_geometry = etgl_get_cell_geometry; - gtk_object_add_arg_type ("ETableGroupLeaf::alternating_row_colors", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_ALTERNATING_ROW_COLORS); - gtk_object_add_arg_type ("ETableGroupLeaf::horizontal_draw_grid", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_HORIZONTAL_DRAW_GRID); - gtk_object_add_arg_type ("ETableGroupLeaf::vertical_draw_grid", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_VERTICAL_DRAW_GRID); - gtk_object_add_arg_type ("ETableGroupLeaf::drawfocus", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_DRAW_FOCUS); - gtk_object_add_arg_type ("ETableGroupLeaf::cursor_mode", GTK_TYPE_INT, - GTK_ARG_WRITABLE, ARG_CURSOR_MODE); - gtk_object_add_arg_type ("ETableGroupLeaf::length_threshold", GTK_TYPE_INT, - GTK_ARG_WRITABLE, ARG_LENGTH_THRESHOLD); - gtk_object_add_arg_type ("ETableGroupLeaf::selection_model", E_SELECTION_MODEL_TYPE, - GTK_ARG_WRITABLE, ARG_SELECTION_MODEL); - - gtk_object_add_arg_type ("ETableGroupLeaf::height", GTK_TYPE_DOUBLE, - GTK_ARG_READABLE, ARG_HEIGHT); - gtk_object_add_arg_type ("ETableGroupLeaf::width", GTK_TYPE_DOUBLE, - GTK_ARG_READWRITE, ARG_WIDTH); - gtk_object_add_arg_type ("ETableGroupLeaf::minimum_width", GTK_TYPE_DOUBLE, - GTK_ARG_READWRITE, ARG_MINIMUM_WIDTH); - gtk_object_add_arg_type ("ETableGroupLeaf::frozen", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_FROZEN); - gtk_object_add_arg_type ("ETableGroupLeaf::uniform_row_height", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_UNIFORM_ROW_HEIGHT); + g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS, + g_param_spec_boolean ("alternating_row_colors", + _( "Alternating Row Colors" ), + _( "Alternating Row Colors" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID, + g_param_spec_boolean ("horizontal_draw_grid", + _( "Horizontal Draw Grid" ), + _( "Horizontal Draw Grid" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID, + g_param_spec_boolean ("vertical_draw_grid", + _( "Vertical Draw Grid" ), + _( "Vertical Draw Grid" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS, + g_param_spec_boolean ("drawfocus", + _( "Draw focus" ), + _( "Draw focus" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_CURSOR_MODE, + g_param_spec_int ("cursor_mode", + _( "Cursor mode" ), + _( "Cursor mode" ), + E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD, + g_param_spec_int ("length_threshold", + _( "Length Threshold" ), + _( "Length Threshold" ), + 0, G_MAXINT, 0, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_SELECTION_MODEL, + g_param_spec_object ("selection_model", + _( "Selection model" ), + _( "Selection model" ), + E_SELECTION_MODEL_TYPE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_HEIGHT, + g_param_spec_double ("height", + _( "Height" ), + _( "Height" ), + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_WIDTH, + g_param_spec_double ("width", + _( "Width" ), + _( "Width" ), + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH, + g_param_spec_double ("minimum_width", + _( "Minimum width" ), + _( "Minimum Width" ), + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_FROZEN, + g_param_spec_boolean ("frozen", + _( "Frozen" ), + _( "Frozen" ), + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT, + g_param_spec_boolean ("uniform_row_height", + _( "Uniform row height" ), + _( "Uniform row height" ), + FALSE, + G_PARAM_READWRITE)); } static void diff --git a/widgets/table/e-table-group-leaf.h b/widgets/table/e-table-group-leaf.h index a6a5e54a53..74fdfd8c03 100644 --- a/widgets/table/e-table-group-leaf.h +++ b/widgets/table/e-table-group-leaf.h @@ -32,10 +32,10 @@ G_BEGIN_DECLS #define E_TABLE_GROUP_LEAF_TYPE (e_table_group_leaf_get_type ()) -#define E_TABLE_GROUP_LEAF(o) (GTK_CHECK_CAST ((o), E_TABLE_GROUP_LEAF_TYPE, ETableGroupLeaf)) -#define E_TABLE_GROUP_LEAF_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_GROUP_LEAF_TYPE, ETableGroupLeafClass)) -#define E_IS_TABLE_GROUP_LEAF(o) (GTK_CHECK_TYPE ((o), E_TABLE_GROUP_LEAF_TYPE)) -#define E_IS_TABLE_GROUP_LEAF_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_GROUP_LEAF_TYPE)) +#define E_TABLE_GROUP_LEAF(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_GROUP_LEAF_TYPE, ETableGroupLeaf)) +#define E_TABLE_GROUP_LEAF_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_GROUP_LEAF_TYPE, ETableGroupLeafClass)) +#define E_IS_TABLE_GROUP_LEAF(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_GROUP_LEAF_TYPE)) +#define E_IS_TABLE_GROUP_LEAF_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_GROUP_LEAF_TYPE)) typedef struct { ETableGroup group; @@ -81,7 +81,7 @@ ETableGroup *e_table_group_leaf_new (GnomeCanvasGroup *parent, ETableHeader *header, ETableModel *model, ETableSortInfo *sort_info); -GtkType e_table_group_leaf_get_type (void); +GType e_table_group_leaf_get_type (void); G_END_DECLS diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c index b529297b62..f787f67ca7 100644 --- a/widgets/table/e-table-group.c +++ b/widgets/table/e-table-group.c @@ -50,10 +50,9 @@ enum { static guint etg_signals [LAST_SIGNAL] = { 0, }; static gboolean etg_get_focus (ETableGroup *etg); -static void etg_destroy (GtkObject *object); static void -etg_destroy (GtkObject *object) +etg_dispose (GObject *object) { ETableGroup *etg = E_TABLE_GROUP(object); @@ -72,8 +71,8 @@ etg_destroy (GtkObject *object) etg->model = NULL; } - if (GTK_OBJECT_CLASS (etg_parent_class)->destroy) - GTK_OBJECT_CLASS (etg_parent_class)->destroy (object); + if (G_OBJECT_CLASS (etg_parent_class)->dispose) + G_OBJECT_CLASS (etg_parent_class)->dispose (object); } /** @@ -422,9 +421,9 @@ e_table_group_cursor_change (ETableGroup *e_table_group, gint row) g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); - gtk_signal_emit (GTK_OBJECT (e_table_group), - etg_signals [CURSOR_CHANGE], - row); + g_signal_emit (e_table_group, + etg_signals [CURSOR_CHANGE], 0, + row); } /** @@ -440,9 +439,9 @@ e_table_group_cursor_activated (ETableGroup *e_table_group, gint row) g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); - gtk_signal_emit (GTK_OBJECT (e_table_group), - etg_signals [CURSOR_ACTIVATED], - row); + g_signal_emit (e_table_group, + etg_signals [CURSOR_ACTIVATED], 0, + row); } /** @@ -460,9 +459,9 @@ e_table_group_double_click (ETableGroup *e_table_group, gint row, gint col, GdkE g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); - gtk_signal_emit (GTK_OBJECT (e_table_group), - etg_signals [DOUBLE_CLICK], - row, col, event); + g_signal_emit (e_table_group, + etg_signals [DOUBLE_CLICK], 0, + row, col, event); } /** @@ -482,9 +481,9 @@ e_table_group_right_click (ETableGroup *e_table_group, gint row, gint col, GdkEv g_return_val_if_fail (e_table_group != NULL, 0); g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), 0); - gtk_signal_emit (GTK_OBJECT (e_table_group), - etg_signals [RIGHT_CLICK], - row, col, event, &return_val); + g_signal_emit (e_table_group, + etg_signals [RIGHT_CLICK], 0, + row, col, event, &return_val); return return_val; } @@ -506,9 +505,9 @@ e_table_group_click (ETableGroup *e_table_group, gint row, gint col, GdkEvent *e g_return_val_if_fail (e_table_group != NULL, 0); g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), 0); - gtk_signal_emit (GTK_OBJECT (e_table_group), - etg_signals [CLICK], - row, col, event, &return_val); + g_signal_emit (e_table_group, + etg_signals [CLICK], 0, + row, col, event, &return_val); return return_val; } @@ -530,9 +529,9 @@ e_table_group_key_press (ETableGroup *e_table_group, gint row, gint col, GdkEven g_return_val_if_fail (e_table_group != NULL, 0); g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), 0); - gtk_signal_emit (GTK_OBJECT (e_table_group), - etg_signals [KEY_PRESS], - row, col, event, &return_val); + g_signal_emit (e_table_group, + etg_signals [KEY_PRESS], 0, + row, col, event, &return_val); return return_val; } @@ -554,9 +553,9 @@ e_table_group_start_drag (ETableGroup *e_table_group, gint row, gint col, GdkEve g_return_val_if_fail (e_table_group != NULL, 0); g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), 0); - gtk_signal_emit (GTK_OBJECT (e_table_group), - etg_signals [START_DRAG], - row, col, event, &return_val); + g_signal_emit (e_table_group, + etg_signals [START_DRAG], 0, + row, col, event, &return_val); return return_val; } @@ -608,12 +607,12 @@ etg_get_focus (ETableGroup *etg) } static void -etg_class_init (GtkObjectClass *object_class) +etg_class_init (GObjectClass *object_class) { GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class; ETableGroupClass *klass = (ETableGroupClass *) object_class; - object_class->destroy = etg_destroy; + object_class->dispose = etg_dispose; item_class->event = etg_event; @@ -638,69 +637,74 @@ etg_class_init (GtkObjectClass *object_class) klass->compute_location = NULL; klass->get_cell_geometry = NULL; - etg_parent_class = gtk_type_class (PARENT_TYPE); + etg_parent_class = g_type_class_ref (PARENT_TYPE); etg_signals [CURSOR_CHANGE] = - gtk_signal_new ("cursor_change", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableGroupClass, cursor_change), - gtk_marshal_NONE__INT, - GTK_TYPE_NONE, 1, GTK_TYPE_INT); + g_signal_new ("cursor_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, cursor_change), + NULL, NULL, + e_marshal_NONE__INT, + G_TYPE_NONE, 1, G_TYPE_INT); etg_signals [CURSOR_ACTIVATED] = - gtk_signal_new ("cursor_activated", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableGroupClass, cursor_activated), - gtk_marshal_NONE__INT, - GTK_TYPE_NONE, 1, GTK_TYPE_INT); + g_signal_new ("cursor_activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, cursor_activated), + NULL, NULL, + e_marshal_NONE__INT, + G_TYPE_NONE, 1, G_TYPE_INT); etg_signals [DOUBLE_CLICK] = - gtk_signal_new ("double_click", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableGroupClass, double_click), - e_marshal_NONE__INT_INT_BOXED, - GTK_TYPE_NONE, 3, GTK_TYPE_INT, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("double_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, double_click), + NULL, NULL, + e_marshal_NONE__INT_INT_BOXED, + G_TYPE_NONE, 3, G_TYPE_INT, + G_TYPE_INT, GDK_TYPE_EVENT); etg_signals [RIGHT_CLICK] = - gtk_signal_new ("right_click", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableGroupClass, right_click), - e_marshal_INT__INT_INT_BOXED, - GTK_TYPE_INT, 3, GTK_TYPE_INT, GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("right_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, right_click), + NULL, NULL, + e_marshal_INT__INT_INT_BOXED, + G_TYPE_INT, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); etg_signals [CLICK] = - gtk_signal_new ("click", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableGroupClass, click), - e_marshal_INT__INT_INT_BOXED, - GTK_TYPE_INT, 3, GTK_TYPE_INT, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, click), + NULL, NULL, + e_marshal_INT__INT_INT_BOXED, + G_TYPE_INT, 3, G_TYPE_INT, + G_TYPE_INT, GDK_TYPE_EVENT); etg_signals [KEY_PRESS] = - gtk_signal_new ("key_press", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableGroupClass, key_press), - e_marshal_INT__INT_INT_BOXED, - GTK_TYPE_INT, 3, GTK_TYPE_INT, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("key_press", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, key_press), + NULL, NULL, + e_marshal_INT__INT_INT_BOXED, + G_TYPE_INT, 3, G_TYPE_INT, + G_TYPE_INT, GDK_TYPE_EVENT); etg_signals [START_DRAG] = - gtk_signal_new ("start_drag", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableGroupClass, start_drag), - e_marshal_INT__INT_INT_BOXED, - GTK_TYPE_INT, 3, GTK_TYPE_INT, - GTK_TYPE_INT, GDK_TYPE_EVENT); - - E_OBJECT_CLASS_ADD_SIGNALS (object_class, etg_signals, LAST_SIGNAL); + g_signal_new ("start_drag", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, start_drag), + NULL, NULL, + e_marshal_INT__INT_INT_BOXED, + G_TYPE_INT, 3, G_TYPE_INT, + G_TYPE_INT, GDK_TYPE_EVENT); } E_MAKE_TYPE (e_table_group, "ETableGroup", ETableGroup, etg_class_init, NULL, PARENT_TYPE) diff --git a/widgets/table/e-table-group.h b/widgets/table/e-table-group.h index 8457e4e4f7..2ecd34efe1 100644 --- a/widgets/table/e-table-group.h +++ b/widgets/table/e-table-group.h @@ -35,10 +35,10 @@ G_BEGIN_DECLS #define E_TABLE_GROUP_TYPE (e_table_group_get_type ()) -#define E_TABLE_GROUP(o) (GTK_CHECK_CAST ((o), E_TABLE_GROUP_TYPE, ETableGroup)) -#define E_TABLE_GROUP_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_GROUP_TYPE, ETableGroupClass)) -#define E_IS_TABLE_GROUP(o) (GTK_CHECK_TYPE ((o), E_TABLE_GROUP_TYPE)) -#define E_IS_TABLE_GROUP_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_GROUP_TYPE)) +#define E_TABLE_GROUP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_GROUP_TYPE, ETableGroup)) +#define E_TABLE_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_GROUP_TYPE, ETableGroupClass)) +#define E_IS_TABLE_GROUP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_GROUP_TYPE)) +#define E_IS_TABLE_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_GROUP_TYPE)) typedef struct { GnomeCanvasGroup group; @@ -166,7 +166,7 @@ gint e_table_group_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event); -GtkType e_table_group_get_type (void); +GType e_table_group_get_type (void); typedef void (*ETableGroupLeafFn) (void *e_table_item, void *closure); void e_table_group_apply_to_leafs (ETableGroup *etg, diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index a74fa4aabb..d3a95b1802 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -94,14 +94,14 @@ static GdkPixmap *remove_col_pixmap, *remove_col_mask; static GdkPixmap *add_col_pixmap, *add_col_mask; enum { - ARG_0, - ARG_TABLE_HEADER, - ARG_FULL_HEADER, - ARG_DND_CODE, - ARG_TABLE_FONTSET, - ARG_SORT_INFO, - ARG_TABLE, - ARG_TREE + PROP_0, + PROP_TABLE_HEADER, + PROP_FULL_HEADER, + PROP_DND_CODE, + PROP_TABLE_FONTSET, + PROP_SORT_INFO, + PROP_TABLE, + PROP_TREE }; enum { @@ -115,7 +115,7 @@ static void scroll_off (ETableHeaderItem *ethi); static void scroll_on (ETableHeaderItem *ethi, guint scroll_direction); static void -ethi_destroy (GtkObject *object){ +ethi_dispose (GObject *object){ ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (object); ethi_drop_table_header (ethi); @@ -129,9 +129,9 @@ ethi_destroy (GtkObject *object){ if (ethi->sort_info) { if (ethi->sort_info_changed_id) - g_signal_handler_disconnect (G_OBJECT(ethi->sort_info), ethi->sort_info_changed_id); + g_signal_handler_disconnect (ethi->sort_info, ethi->sort_info_changed_id); if (ethi->group_info_changed_id) - g_signal_handler_disconnect (G_OBJECT(ethi->sort_info), ethi->group_info_changed_id); + g_signal_handler_disconnect (ethi->sort_info, ethi->group_info_changed_id); g_object_unref (ethi->sort_info); ethi->sort_info = NULL; } @@ -144,8 +144,8 @@ ethi_destroy (GtkObject *object){ g_object_unref (ethi->config); ethi->config = NULL; - if (GTK_OBJECT_CLASS (ethi_parent_class)->destroy) - (*GTK_OBJECT_CLASS (ethi_parent_class)->destroy) (object); + if (G_OBJECT_CLASS (ethi_parent_class)->dispose) + (*G_OBJECT_CLASS (ethi_parent_class)->dispose) (object); } static int @@ -170,7 +170,8 @@ e_table_header_item_get_height (ETableHeaderItem *ethi) ETableCol *ecol = e_table_header_get_column (eth, col); int height; - height = e_table_header_compute_height (ecol, style, ethi->font); + height = e_table_header_compute_height (ecol, + GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas)); if (height > maxheight) maxheight = height; @@ -239,7 +240,7 @@ ethi_font_set (ETableHeaderItem *ethi, GdkFont *font) } static void -ethi_font_load (ETableHeaderItem *ethi, char *fontname) +ethi_font_load (ETableHeaderItem *ethi, const char *fontname) { GdkFont *font = NULL; @@ -293,10 +294,10 @@ ethi_add_table_header (ETableHeaderItem *ethi, ETableHeader *header) ethi->height = e_table_header_item_get_height (ethi); ethi->structure_change_id = g_signal_connect ( - G_OBJECT (header), "structure_change", + header, "structure_change", G_CALLBACK (structure_changed), ethi); ethi->dimension_change_id = g_signal_connect ( - G_OBJECT (header), "dimension_change", + header, "dimension_change", G_CALLBACK (dimension_changed), ethi); e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(ethi)); gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi)); @@ -309,70 +310,73 @@ ethi_sort_info_changed (ETableSortInfo *sort_info, ETableHeaderItem *ethi) } static void -ethi_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +ethi_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; ETableHeaderItem *ethi; - item = GNOME_CANVAS_ITEM (o); - ethi = E_TABLE_HEADER_ITEM (o); + item = GNOME_CANVAS_ITEM (object); + ethi = E_TABLE_HEADER_ITEM (object); - switch (arg_id){ - case ARG_TABLE_HEADER: + switch (prop_id){ + case PROP_TABLE_HEADER: ethi_drop_table_header (ethi); - ethi_add_table_header (ethi, E_TABLE_HEADER(GTK_VALUE_POINTER (*arg))); + ethi_add_table_header (ethi, E_TABLE_HEADER(g_value_get_object (value))); break; - case ARG_FULL_HEADER: + case PROP_FULL_HEADER: if (ethi->full_header) g_object_unref(ethi->full_header); - ethi->full_header = E_TABLE_HEADER(GTK_VALUE_POINTER (*arg)); + ethi->full_header = E_TABLE_HEADER(g_value_get_object (value)); if (ethi->full_header) g_object_ref(ethi->full_header); break; - case ARG_DND_CODE: + case PROP_DND_CODE: g_free(ethi->dnd_code); - ethi->dnd_code = g_strdup (GTK_VALUE_STRING (*arg)); + ethi->dnd_code = g_strdup (g_value_get_string (value)); break; - case ARG_TABLE_FONTSET: - ethi_font_load (ethi, GTK_VALUE_STRING (*arg)); + case PROP_TABLE_FONTSET: + ethi_font_load (ethi, g_value_get_string (value)); break; - case ARG_SORT_INFO: + case PROP_SORT_INFO: if (ethi->sort_info){ if (ethi->sort_info_changed_id) g_signal_handler_disconnect ( - G_OBJECT(ethi->sort_info), + ethi->sort_info, ethi->sort_info_changed_id); if (ethi->group_info_changed_id) g_signal_handler_disconnect ( - G_OBJECT(ethi->sort_info), + ethi->sort_info, ethi->group_info_changed_id); g_object_unref (ethi->sort_info); } - ethi->sort_info = GTK_VALUE_POINTER (*arg); + ethi->sort_info = g_value_get_object (value); g_object_ref (ethi->sort_info); ethi->sort_info_changed_id = g_signal_connect ( - G_OBJECT(ethi->sort_info), "sort_info_changed", + ethi->sort_info, "sort_info_changed", G_CALLBACK (ethi_sort_info_changed), ethi); ethi->group_info_changed_id = g_signal_connect ( - G_OBJECT(ethi->sort_info), "group_info_changed", + ethi->sort_info, "group_info_changed", G_CALLBACK(ethi_sort_info_changed), ethi); break; - case ARG_TABLE: - if (GTK_VALUE_OBJECT(*arg)) - ethi->table = E_TABLE(GTK_VALUE_OBJECT(*arg)); + case PROP_TABLE: + if (g_value_get_object (value)) + ethi->table = E_TABLE(g_value_get_object (value)); else ethi->table = NULL; break; - case ARG_TREE: - if (GTK_VALUE_OBJECT(*arg)) - ethi->tree = E_TREE(GTK_VALUE_OBJECT(*arg)); + case PROP_TREE: + if (g_value_get_object (value)) + ethi->tree = E_TREE(g_value_get_object (value)); else ethi->tree = NULL; break; @@ -381,21 +385,24 @@ ethi_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) } static void -ethi_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) +ethi_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { ETableHeaderItem *ethi; - ethi = E_TABLE_HEADER_ITEM (o); + ethi = E_TABLE_HEADER_ITEM (object); - switch (arg_id){ - case ARG_FULL_HEADER: - GTK_VALUE_POINTER (*arg) = G_OBJECT (ethi->full_header); + switch (prop_id){ + case PROP_FULL_HEADER: + g_value_set_object (value, ethi->full_header); break; - case ARG_DND_CODE: - GTK_VALUE_STRING (*arg) = g_strdup (ethi->dnd_code); + case PROP_DND_CODE: + g_value_set_string (value, g_strdup (ethi->dnd_code)); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -718,7 +725,7 @@ ethi_drag_motion (GtkWidget *widget, GdkDragContext *context, gdk_drag_status (context, 0, time); - droptype = gdk_atom_name (GPOINTER_TO_INT (context->targets->data)); + droptype = gdk_atom_name (GDK_POINTER_TO_ATOM (context->targets->data)); headertype = g_strdup_printf ("%s-%s", TARGET_ETABLE_COL_TYPE, ethi->dnd_code); @@ -909,20 +916,20 @@ ethi_realize (GnomeCanvasItem *item) g_free(ethi_drop_types[0].target); /* Drop signals */ - ethi->drag_motion_id = gtk_signal_connect (GTK_OBJECT (item->canvas), "drag_motion", - GTK_SIGNAL_FUNC (ethi_drag_motion), ethi); - ethi->drag_leave_id = gtk_signal_connect (GTK_OBJECT (item->canvas), "drag_leave", - GTK_SIGNAL_FUNC (ethi_drag_leave), ethi); - ethi->drag_drop_id = gtk_signal_connect (GTK_OBJECT (item->canvas), "drag_drop", - GTK_SIGNAL_FUNC (ethi_drag_drop), ethi); - ethi->drag_data_received_id = gtk_signal_connect (GTK_OBJECT (item->canvas), "drag_data_received", - GTK_SIGNAL_FUNC (ethi_drag_data_received), ethi); + ethi->drag_motion_id = g_signal_connect (item->canvas, "drag_motion", + G_CALLBACK (ethi_drag_motion), ethi); + ethi->drag_leave_id = g_signal_connect (item->canvas, "drag_leave", + G_CALLBACK (ethi_drag_leave), ethi); + ethi->drag_drop_id = g_signal_connect (item->canvas, "drag_drop", + G_CALLBACK (ethi_drag_drop), ethi); + ethi->drag_data_received_id = g_signal_connect (item->canvas, "drag_data_received", + G_CALLBACK (ethi_drag_data_received), ethi); /* Drag signals */ - ethi->drag_end_id = gtk_signal_connect (GTK_OBJECT (item->canvas), "drag_end", - GTK_SIGNAL_FUNC (ethi_drag_end), ethi); - ethi->drag_data_get_id = gtk_signal_connect (GTK_OBJECT (item->canvas), "drag_data_get", - GTK_SIGNAL_FUNC (ethi_drag_data_get), ethi); + ethi->drag_end_id = g_signal_connect (item->canvas, "drag_end", + G_CALLBACK (ethi_drag_end), ethi); + ethi->drag_data_get_id = g_signal_connect (item->canvas, "drag_data_get", + G_CALLBACK (ethi_drag_data_get), ethi); } @@ -933,13 +940,13 @@ ethi_unrealize (GnomeCanvasItem *item) gdk_font_unref (ethi->font); - gtk_signal_disconnect (GTK_OBJECT (item->canvas), ethi->drag_motion_id); - gtk_signal_disconnect (GTK_OBJECT (item->canvas), ethi->drag_leave_id); - gtk_signal_disconnect (GTK_OBJECT (item->canvas), ethi->drag_drop_id); - gtk_signal_disconnect (GTK_OBJECT (item->canvas), ethi->drag_data_received_id); + g_signal_handler_disconnect (item->canvas, ethi->drag_motion_id); + g_signal_handler_disconnect (item->canvas, ethi->drag_leave_id); + g_signal_handler_disconnect (item->canvas, ethi->drag_drop_id); + g_signal_handler_disconnect (item->canvas, ethi->drag_data_received_id); - gtk_signal_disconnect (GTK_OBJECT (item->canvas), ethi->drag_end_id); - gtk_signal_disconnect (GTK_OBJECT (item->canvas), ethi->drag_data_get_id); + g_signal_handler_disconnect (item->canvas, ethi->drag_end_id); + g_signal_handler_disconnect (item->canvas, ethi->drag_data_get_id); gtk_drag_dest_unset (GTK_WIDGET (item->canvas)); @@ -1006,7 +1013,7 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width continue; e_table_header_draw_button (drawable, ecol, - GTK_WIDGET (canvas)->style, ethi->font, + GTK_WIDGET (canvas)->style, GTK_WIDGET_STATE (canvas), GTK_WIDGET (canvas), x1 - x, -y, @@ -1198,7 +1205,7 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) e_table_header_draw_button ( pixmap, ecol, - widget->style, ethi->font, + widget->style, GTK_WIDGET_STATE (widget), widget, 0, 0, @@ -1371,11 +1378,11 @@ static void ethi_popup_field_chooser(GtkWidget *widget, EthiHeaderInfo *info) { GtkWidget *etfcd = e_table_field_chooser_dialog_new(); - gtk_object_set(GTK_OBJECT(etfcd), - "full_header", info->ethi->full_header, - "header", info->ethi->eth, - "dnd_code", info->ethi->dnd_code, - NULL); + g_object_set(etfcd, + "full_header", info->ethi->full_header, + "header", info->ethi->eth, + "dnd_code", info->ethi->dnd_code, + NULL); gtk_widget_show(etfcd); } @@ -1390,9 +1397,9 @@ ethi_popup_best_fit(GtkWidget *widget, EthiHeaderInfo *info) ETableHeaderItem *ethi = info->ethi; int width; - gtk_signal_emit_by_name (GTK_OBJECT (ethi->eth), - "request_width", - info->col, &width); + g_signal_emit_by_name (ethi->eth, + "request_width", + info->col, &width); /* Add 10 to stop it from "..."ing */ e_table_header_set_size (ethi->eth, info->col, width + 10); @@ -1406,8 +1413,9 @@ ethi_popup_format_columns(GtkWidget *widget, EthiHeaderInfo *info) } static void -config_destroyed (GtkObject *object, ETableHeaderItem *ethi) +config_destroyed (gpointer data, GObject *where_object_was) { + ETableHeaderItem *ethi = data; ethi->config = NULL; } @@ -1445,9 +1453,8 @@ ethi_popup_customize_view(GtkWidget *widget, EthiHeaderInfo *info) ethi->config = e_table_config_new ( _("Customize Current View"), spec, state); - g_signal_connect ( - ethi->config, "destroy", - G_CALLBACK (config_destroyed), ethi); + g_object_weak_ref (G_OBJECT (ethi->config), + config_destroyed, ethi); g_signal_connect ( ethi->config, "changed", G_CALLBACK (apply_changes), ethi); @@ -1464,21 +1471,21 @@ free_popup_info (GtkWidget *w, EthiHeaderInfo *info) /* Bit 2 is disabled if not "sortable". */ /* Bit 4 is disabled if we don't have a pointer to our table object. */ static EPopupMenu ethi_context_menu [] = { - E_POPUP_ITEM (N_("Sort Ascending"), GTK_SIGNAL_FUNC(ethi_popup_sort_ascending), 2), - E_POPUP_ITEM (N_("Sort Descending"), GTK_SIGNAL_FUNC(ethi_popup_sort_descending), 2), - E_POPUP_ITEM (N_("Unsort"), GTK_SIGNAL_FUNC(ethi_popup_unsort), 0), + E_POPUP_ITEM (N_("Sort Ascending"), G_CALLBACK(ethi_popup_sort_ascending), 2), + E_POPUP_ITEM (N_("Sort Descending"), G_CALLBACK(ethi_popup_sort_descending), 2), + E_POPUP_ITEM (N_("Unsort"), G_CALLBACK(ethi_popup_unsort), 0), E_POPUP_SEPARATOR, - E_POPUP_ITEM (N_("Group By This Field"), GTK_SIGNAL_FUNC(ethi_popup_group_field), 16), - E_POPUP_ITEM (N_("Group By Box"), GTK_SIGNAL_FUNC(ethi_popup_group_box), 128), + E_POPUP_ITEM (N_("Group By This Field"), G_CALLBACK(ethi_popup_group_field), 16), + E_POPUP_ITEM (N_("Group By Box"), G_CALLBACK(ethi_popup_group_box), 128), E_POPUP_SEPARATOR, - E_POPUP_ITEM (N_("Remove This Column"), GTK_SIGNAL_FUNC(ethi_popup_remove_column), 8), - E_POPUP_ITEM (N_("Add a Column..."), GTK_SIGNAL_FUNC(ethi_popup_field_chooser), 0), + E_POPUP_ITEM (N_("Remove This Column"), G_CALLBACK(ethi_popup_remove_column), 8), + E_POPUP_ITEM (N_("Add a Column..."), G_CALLBACK(ethi_popup_field_chooser), 0), E_POPUP_SEPARATOR, - E_POPUP_ITEM (N_("Alignment"), GTK_SIGNAL_FUNC(ethi_popup_alignment), 128), - E_POPUP_ITEM (N_("Best Fit"), GTK_SIGNAL_FUNC(ethi_popup_best_fit), 2), - E_POPUP_ITEM (N_("Format Columns..."), GTK_SIGNAL_FUNC(ethi_popup_format_columns), 128), + E_POPUP_ITEM (N_("Alignment"), G_CALLBACK(ethi_popup_alignment), 128), + E_POPUP_ITEM (N_("Best Fit"), G_CALLBACK(ethi_popup_best_fit), 2), + E_POPUP_ITEM (N_("Format Columns..."), G_CALLBACK(ethi_popup_format_columns), 128), E_POPUP_SEPARATOR, - E_POPUP_ITEM (N_("Customize Current View..."), GTK_SIGNAL_FUNC(ethi_popup_customize_view), 4), + E_POPUP_ITEM (N_("Customize Current View..."), G_CALLBACK(ethi_popup_customize_view), 4), E_POPUP_TERMINATOR }; @@ -1499,16 +1506,16 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + 128, info, E_I18N_DOMAIN); - gtk_signal_connect (GTK_OBJECT (popup), "selection-done", - GTK_SIGNAL_FUNC (free_popup_info), info); + g_signal_connect (popup, "selection-done", + G_CALLBACK (free_popup_info), info); e_popup_menu (popup, (GdkEvent *) event); } static void ethi_button_pressed (ETableHeaderItem *ethi, GdkEventButton *event) { - gtk_signal_emit (GTK_OBJECT (ethi), - ethi_signals [BUTTON_PRESSED], event); + g_signal_emit (ethi, + ethi_signals [BUTTON_PRESSED], 0, event); } static void @@ -1673,9 +1680,9 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) break; else { int width = 0; - gtk_signal_emit_by_name (GTK_OBJECT (ethi->eth), - "request_width", - (int)ethi->resize_col, &width); + g_signal_emit_by_name (ethi->eth, + "request_width", + (int)ethi->resize_col, &width); /* Add 10 to stop it from "..."ing */ e_table_header_set_size (ethi->eth, ethi->resize_col, width + 10); @@ -1710,15 +1717,15 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) } static void -ethi_class_init (GtkObjectClass *object_class) +ethi_class_init (GObjectClass *object_class) { GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class; - ethi_parent_class = gtk_type_class (PARENT_OBJECT_TYPE); + ethi_parent_class = g_type_class_ref (PARENT_OBJECT_TYPE); - object_class->destroy = ethi_destroy; - object_class->set_arg = ethi_set_arg; - object_class->get_arg = ethi_get_arg; + object_class->dispose = ethi_dispose; + object_class->set_property = ethi_set_property; + object_class->get_property = ethi_get_property; item_class->update = ethi_update; item_class->realize = ethi_realize; @@ -1726,21 +1733,55 @@ ethi_class_init (GtkObjectClass *object_class) item_class->draw = ethi_draw; item_class->point = ethi_point; item_class->event = ethi_event; - - gtk_object_add_arg_type ("ETableHeaderItem::ETableHeader", G_TYPE_OBJECT, - GTK_ARG_WRITABLE, ARG_TABLE_HEADER); - gtk_object_add_arg_type ("ETableHeaderItem::full_header", G_TYPE_OBJECT, - GTK_ARG_READWRITE, ARG_FULL_HEADER); - gtk_object_add_arg_type ("ETableHeaderItem::dnd_code", GTK_TYPE_STRING, - 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", G_TYPE_OBJECT, - GTK_ARG_WRITABLE, ARG_SORT_INFO); - gtk_object_add_arg_type ("ETableHeaderItem::table", GTK_TYPE_OBJECT, - GTK_ARG_WRITABLE, ARG_TABLE); - gtk_object_add_arg_type ("ETableHeaderItem::tree", E_TREE_TYPE, - GTK_ARG_WRITABLE, ARG_TREE); + + g_object_class_install_property (object_class, PROP_DND_CODE, + g_param_spec_string ("dnd_code", + _("DnD code"), + /*_( */"XXX blurb" /*)*/, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_TABLE_FONTSET, + g_param_spec_string ("fontset", + _("Fontset"), + /*_( */"XXX blurb" /*)*/, + NULL, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_FULL_HEADER, + g_param_spec_object ("full_header", + _("Full Header"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_HEADER_TYPE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_TABLE_HEADER, + g_param_spec_object ("ETableHeader", + _("Header"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_HEADER_TYPE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_SORT_INFO, + g_param_spec_object ("sort_info", + _("Sort Info"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_SORT_INFO_TYPE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE, + g_param_spec_object ("table", + _("Table"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_TYPE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TREE, + g_param_spec_object ("tree", + _("Tree"), + /*_( */"XXX blurb" /*)*/, + E_TREE_TYPE, + G_PARAM_WRITABLE)); /* * Create our pixmaps for DnD @@ -1755,14 +1796,13 @@ ethi_class_init (GtkObjectClass *object_class) &add_col_mask, NULL, add_col_xpm); ethi_signals [BUTTON_PRESSED] = - gtk_signal_new ("button_pressed", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableHeaderItemClass, button_pressed), - e_marshal_NONE__BOXED, - GTK_TYPE_NONE, 1, GDK_TYPE_EVENT); - - E_OBJECT_CLASS_ADD_SIGNALS (object_class, ethi_signals, LAST_SIGNAL); + g_signal_new ("button_pressed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableHeaderItemClass, button_pressed), + NULL, NULL, + e_marshal_NONE__BOXED, + G_TYPE_NONE, 1, GDK_TYPE_EVENT); } static void @@ -1790,26 +1830,9 @@ ethi_init (GnomeCanvasItem *item) ethi->tree = NULL; } -GtkType -e_table_header_item_get_type (void) -{ - static GtkType type = 0; - - if (!type){ - GtkTypeInfo info = { - "ETableHeaderItem", - sizeof (ETableHeaderItem), - sizeof (ETableHeaderItemClass), - (GtkClassInitFunc) ethi_class_init, - (GtkObjectInitFunc) ethi_init, - NULL, /* reserved 1 */ - NULL, /* reserved 2 */ - (GtkClassInitFunc) NULL - }; - - type = gtk_type_unique (PARENT_OBJECT_TYPE, &info); - } - - return type; -} - +E_MAKE_TYPE (e_table_header_item, + "ETableHeaderItem", + ETableHeaderItem, + ethi_class_init, + ethi_init, + PARENT_OBJECT_TYPE) diff --git a/widgets/table/e-table-header-item.h b/widgets/table/e-table-header-item.h index 594ede0e7a..3eebddeefc 100644 --- a/widgets/table/e-table-header-item.h +++ b/widgets/table/e-table-header-item.h @@ -35,10 +35,10 @@ G_BEGIN_DECLS #define E_TABLE_HEADER_ITEM_TYPE (e_table_header_item_get_type ()) -#define E_TABLE_HEADER_ITEM(o) (GTK_CHECK_CAST ((o), E_TABLE_HEADER_ITEM_TYPE, ETableHeaderItem)) -#define E_TABLE_HEADER_ITEM_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_HEADER_ITEM_TYPE, ETableHeaderItemClass)) -#define E_IS_TABLE_HEADER_ITEM(o) (GTK_CHECK_TYPE ((o), E_TABLE_HEADER_ITEM_TYPE)) -#define E_IS_TABLE_HEADER_ITEM_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_HEADER_ITEM_TYPE)) +#define E_TABLE_HEADER_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_HEADER_ITEM_TYPE, ETableHeaderItem)) +#define E_TABLE_HEADER_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_HEADER_ITEM_TYPE, ETableHeaderItemClass)) +#define E_IS_TABLE_HEADER_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_HEADER_ITEM_TYPE)) +#define E_IS_TABLE_HEADER_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_HEADER_ITEM_TYPE)) typedef struct { GnomeCanvasItem parent; @@ -107,7 +107,7 @@ typedef struct { void (*button_pressed) (ETableHeaderItem *ethi, GdkEventButton *button); } ETableHeaderItemClass; -GtkType e_table_header_item_get_type (void); +GType e_table_header_item_get_type (void); G_END_DECLS diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index 60cc9f9e32..20c1529a23 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -38,32 +38,58 @@ +static PangoLayout* +build_header_layout (GtkWidget *widget, const char *str) +{ + PangoLayout *layout; + + layout = gtk_widget_create_pango_layout (widget, str); + +#ifdef FROB_FONT_DESC + { + PangoFontDescription *desc; + desc = pango_font_description_copy (gtk_widget_get_style (widget)->font_desc); + pango_font_description_set_size (desc, + pango_font_description_get_size (desc) * 1.2); + + pango_font_description_set_weight (desc, PANGO_WEIGHT_BOLD); + pango_layout_set_font_description (layout, desc); + + pango_font_description_free (desc); + } +#endif + + return layout; +} + /** * e_table_header_compute_height: * @ecol: Table column description. - * @style: Style for the button's bevel. - * @font: Font for the button's text, or NULL if no font is available. + * @widget: The widget from which to build the PangoLayout. * * Computes the minimum height required for a table header button. * * Return value: The height of the button, in pixels. **/ double -e_table_header_compute_height (ETableCol *ecol, GtkStyle *style, GdkFont *font) +e_table_header_compute_height (ETableCol *ecol, GtkWidget *widget) { int ythick; int height; + PangoLayout *layout; + PangoRectangle ink_rect; g_return_val_if_fail (ecol != NULL, -1); g_return_val_if_fail (E_IS_TABLE_COL (ecol), -1); - g_return_val_if_fail (style != NULL, -1); + g_return_val_if_fail (GTK_IS_WIDGET (widget), -1); - ythick = style->ythickness; + ythick = gtk_widget_get_style (widget)->ythickness; - if (font) - height = font->ascent + font->descent; - else - height = 16; /* FIXME: default? */ + layout = build_header_layout (widget, ecol->text); + + pango_layout_get_pixel_extents (layout, &ink_rect, NULL); + + height = PANGO_DESCENT (ink_rect) - PANGO_ASCENT (ink_rect); if (ecol->is_pixbuf) { g_assert (ecol->pixbuf != NULL); @@ -74,6 +100,8 @@ e_table_header_compute_height (ETableCol *ecol, GtkStyle *style, GdkFont *font) height += 2 * (ythick + HEADER_PADDING); + g_object_unref (layout); + return height; } @@ -196,6 +224,134 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, return pixmap; } + +/* Computes the length of a string that needs to be trimmed for elision */ +static int +compute_elision_length (GtkWidget *widget, const char *str, int max_width) +{ + int len; + int l = 0, left, right; + PangoLayout *layout = build_header_layout (widget, str); + PangoRectangle ink_rect; + + len = strlen (str); + + if (len <= 0) + return 0; + + left = 0; + right = len; + + while (left < right) { + l = (left + right) / 2; + + pango_layout_set_text (layout, str, l); + + pango_layout_get_pixel_extents (layout, &ink_rect, NULL); + + if (PANGO_RBEARING (ink_rect) < max_width) + left = l + 1; + else if (PANGO_RBEARING (ink_rect) > max_width) + right = l; + else { + g_object_unref (layout); + return l; + } + } + + g_object_unref (layout); + + if (PANGO_RBEARING (ink_rect) > max_width) + return MAX (0, l - 1); + else + return l; + + return l; +} + +/* Default width of the elision arrow in pixels */ +#define ARROW_WIDTH 4 + +/** + * e_table_draw_elided_string: + * @drawable: Destination drawable. + * @font: Font for the text. + * @gc: GC to use for drawing. + * @x: X insertion point for the string. + * @y: Y insertion point for the string's baseline. + * @str: String to draw. + * @max_width: Maximum width in which the string must fit. + * @center: Whether to center the string in the available area if it does fit. + * + * Draws a string, possibly trimming it so that it fits inside the specified + * maximum width. If it does not fit, an elision indicator is drawn after the + * last character that does fit. + **/ +static void +e_table_draw_elided_string (GdkDrawable *drawable, GdkGC *gc, GtkWidget *widget, + int x, int y, const char *str, int max_width, gboolean center) +{ + PangoLayout *layout; + PangoRectangle ink_rect; + + g_return_if_fail (drawable != NULL); + g_return_if_fail (gc != NULL); + g_return_if_fail (str != NULL); + g_return_if_fail (max_width >= 0); + + layout = build_header_layout (widget, str); + + pango_layout_get_pixel_extents (layout, &ink_rect, NULL); + + if (PANGO_RBEARING (ink_rect) <= max_width) { + int xpos; + + if (center) + xpos = x + (max_width - ink_rect.width) / 2; + else + xpos = x; + + gdk_draw_layout (drawable, gc, + xpos, y, + layout); + } else { + int arrow_width; + int len; + int i; + + if (max_width < ARROW_WIDTH + 1) + arrow_width = max_width - 1; + else + arrow_width = ARROW_WIDTH; + + len = compute_elision_length (widget, str, max_width - arrow_width - 1); + + pango_layout_set_text (layout, str, len); + + gdk_draw_layout (drawable, gc, + x, y, + layout); + + pango_layout_get_pixel_extents (layout, &ink_rect, NULL); + + y -= PANGO_ASCENT (ink_rect); + + for (i = 0; i < arrow_width; i++) { + int h; + + h = 2 * i + 1; + + gdk_draw_line (drawable, gc, + x + PANGO_RBEARING(ink_rect) + arrow_width - i, + y + (PANGO_ASCENT (ink_rect) + PANGO_DESCENT (ink_rect) - h) / 2, + x + PANGO_RBEARING (ink_rect) + arrow_width - i, + y + (PANGO_ASCENT (ink_rect) + PANGO_DESCENT (ink_rect) - h) / 2 + h - 1); + } + } + + g_object_unref (layout); +} + static GtkWidget *g_label; /** @@ -203,7 +359,6 @@ static GtkWidget *g_label; * @drawable: Destination drawable. * @ecol: Table column for the header information. * @style: Style to use for drawing the button. - * @font: Font for the button's text. * @state: State of the table widget. * @widget: The table widget. * @gc: GC to use for drawing. @@ -219,7 +374,7 @@ static GtkWidget *g_label; **/ void e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, - GtkStyle *style, GdkFont *font, GtkStateType state, + GtkStyle *style, GtkStateType state, GtkWidget *widget, int x, int y, int width, int height, int button_width, int button_height, @@ -235,7 +390,6 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, g_return_if_fail (ecol != NULL); g_return_if_fail (E_IS_TABLE_COL (ecol)); g_return_if_fail (style != NULL); - g_return_if_fail (font != NULL); g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (button_width > 0 && button_height > 0); @@ -307,8 +461,6 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, /* Pixbuf or label */ - text = e_utf8_to_gtk_string (widget, ecol->text); - if (ecol->is_pixbuf) { int pwidth, pheight; int clip_width, clip_height; @@ -326,20 +478,28 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, xpos = inner_x; if (inner_width - pwidth > 11) { - int rbearing; - int width; + PangoLayout *layout; + PangoRectangle ink_rect; int ypos; - gdk_string_extents (font, text, NULL, &rbearing, &width, NULL, NULL); - if (rbearing < inner_width - (pwidth + 1)) { - xpos = inner_x + (inner_width - width - (pwidth + 1)) / 2; + /* really sucks to generate another + PangoLayout here when we turn around and + make one in draw_elided_string */ + + layout = build_header_layout (widget, ecol->text); + pango_layout_get_pixel_extents (layout, &ink_rect, NULL); + + if (PANGO_RBEARING (ink_rect) < inner_width - (pwidth + 1)) { + xpos = inner_x + (inner_width - ink_rect.width - (pwidth + 1)) / 2; } - ypos = inner_y + (inner_height - font->ascent - font->descent) / 2 + font->ascent; + ypos = inner_y; - e_table_draw_elided_string (drawable, font, gc, + e_table_draw_elided_string (drawable, gc, widget, xpos + pwidth + 1, ypos, - text, inner_width - (xpos - inner_x), FALSE); + ecol->text, inner_width - (xpos - inner_x), FALSE); + + g_object_unref (layout); } pixmap = make_composite_pixmap (drawable, gc, @@ -358,118 +518,10 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, } else { int ypos; - ypos = inner_y + (inner_height - font->ascent - font->descent) / 2 + font->ascent; + ypos = inner_y; - e_table_draw_elided_string (drawable, font, gc, + e_table_draw_elided_string (drawable, gc, widget, inner_x, ypos, - text, inner_width, TRUE); - } - g_free (text); -} - -/* Computes the length of a string that needs to be trimmed for elision */ -static int -compute_elision_length (GdkFont *font, const char *str, int max_width) -{ - int len; - int l = 0, left, right; - int rbearing; - - len = strlen (str); - - if (len <= 0) - return 0; - - left = 0; - right = len; - - while (left < right) { - l = (left + right) / 2; - gdk_text_extents (font, str, l, NULL, &rbearing, NULL, NULL, NULL); - - if (rbearing < max_width) - left = l + 1; - else if (rbearing > max_width) - right = l; - else - return l; - } - - if (rbearing > max_width) - return MAX (0, l - 1); - else - return l; -} - -/* Default width of the elision arrow in pixels */ -#define ARROW_WIDTH 4 - -/** - * e_table_draw_elided_string: - * @drawable: Destination drawable. - * @font: Font for the text. - * @gc: GC to use for drawing. - * @x: X insertion point for the string. - * @y: Y insertion point for the string's baseline. - * @str: String to draw. - * @max_width: Maximum width in which the string must fit. - * @center: Whether to center the string in the available area if it does fit. - * - * Draws a string, possibly trimming it so that it fits inside the specified - * maximum width. If it does not fit, an elision indicator is drawn after the - * last character that does fit. - **/ -void -e_table_draw_elided_string (GdkDrawable *drawable, GdkFont *font, GdkGC *gc, - int x, int y, const char *str, int max_width, gboolean center) -{ - int rbearing; - int width; - - g_return_if_fail (drawable != NULL); - g_return_if_fail (font != NULL); - g_return_if_fail (gc != NULL); - g_return_if_fail (str != NULL); - g_return_if_fail (max_width >= 0); - - gdk_string_extents (font, str, NULL, &rbearing, &width, NULL, NULL); - - if (rbearing <= max_width) { - int xpos; - - if (center) - xpos = x + (max_width - width) / 2; - else - xpos = x; - - gdk_draw_string (drawable, font, gc, xpos, y, str); - } else { - int arrow_width; - int len; - int i; - - if (max_width < ARROW_WIDTH + 1) - arrow_width = max_width - 1; - else - arrow_width = ARROW_WIDTH; - - len = compute_elision_length (font, str, max_width - arrow_width - 1); - gdk_draw_text (drawable, font, gc, x, y, str, len); - - gdk_text_extents (font, str, len, NULL, &rbearing, NULL, NULL, NULL); - - y -= font->ascent; - - for (i = 0; i < arrow_width; i++) { - int h; - - h = 2 * i + 1; - - gdk_draw_line (drawable, gc, - x + rbearing + arrow_width - i, - y + (font->ascent + font->descent - h) / 2, - x + rbearing + arrow_width - i, - y + (font->ascent + font->descent - h) / 2 + h - 1); - } + ecol->text, inner_width, TRUE); } } diff --git a/widgets/table/e-table-header-utils.h b/widgets/table/e-table-header-utils.h index 50166010e5..38defa9261 100644 --- a/widgets/table/e-table-header-utils.h +++ b/widgets/table/e-table-header-utils.h @@ -32,14 +32,12 @@ extern "C" { #endif /* __cplusplus */ -double e_table_header_compute_height (ETableCol *ecol, - GtkStyle *style, - GdkFont *font); +double e_table_header_compute_height (ETableCol *ecol, + GtkWidget *widget); double e_table_header_width_extras (GtkStyle *style); void e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, GtkStyle *style, - GdkFont *font, GtkStateType state, GtkWidget *widget, int x, @@ -49,15 +47,6 @@ void e_table_header_draw_button (GdkDrawable *drawable, int button_width, int button_height, ETableColArrow arrow); -void e_table_draw_elided_string (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - int x, - int y, - const char *str, - int max_width, - gboolean center); - #ifdef __cplusplus } diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 9ee72e94a3..d810d61bd1 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -189,7 +189,7 @@ eth_group_info_changed(ETableSortInfo *info, ETableHeader *eth) } static void -eth_set_prop (GObject *object, guint prop_id, const GValue *val, GParamSpec *pspec) +eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec *pspec) { ETableHeader *eth = E_TABLE_HEADER (object); @@ -223,7 +223,7 @@ eth_set_prop (GObject *object, guint prop_id, const GValue *val, GParamSpec *psp } static void -eth_get_prop (GObject *object, guint prop_id, GValue *val, GParamSpec *pspec) +eth_get_property (GObject *object, guint prop_id, GValue *val, GParamSpec *pspec) { ETableHeader *eth = E_TABLE_HEADER (object); @@ -249,8 +249,8 @@ e_table_header_class_init (GObjectClass *object_class) ETableHeaderClass *klass = E_TABLE_HEADER_CLASS (object_class); object_class->finalize = eth_finalize; - object_class->set_property = eth_set_prop; - object_class->get_property = eth_get_prop; + object_class->set_property = eth_set_property; + object_class->get_property = eth_get_property; e_table_header_parent_class = g_type_class_peek_parent (object_class); diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index a8c9259d2d..f518b1e238 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -80,22 +80,22 @@ enum { static guint eti_signals [LAST_SIGNAL] = { 0, }; enum { - ARG_0, - ARG_TABLE_HEADER, - ARG_TABLE_MODEL, - ARG_SELECTION_MODEL, - ARG_TABLE_ALTERNATING_ROW_COLORS, - ARG_TABLE_HORIZONTAL_DRAW_GRID, - ARG_TABLE_VERTICAL_DRAW_GRID, - ARG_TABLE_DRAW_FOCUS, - ARG_CURSOR_MODE, - ARG_LENGTH_THRESHOLD, - ARG_CURSOR_ROW, - ARG_UNIFORM_ROW_HEIGHT, + PROP_0, + PROP_TABLE_HEADER, + PROP_TABLE_MODEL, + PROP_SELECTION_MODEL, + PROP_TABLE_ALTERNATING_ROW_COLORS, + PROP_TABLE_HORIZONTAL_DRAW_GRID, + PROP_TABLE_VERTICAL_DRAW_GRID, + PROP_TABLE_DRAW_FOCUS, + PROP_CURSOR_MODE, + PROP_LENGTH_THRESHOLD, + PROP_CURSOR_ROW, + PROP_UNIFORM_ROW_HEIGHT, - ARG_MINIMUM_WIDTH, - ARG_WIDTH, - ARG_HEIGHT + PROP_MINIMUM_WIDTH, + PROP_WIDTH, + PROP_HEIGHT }; #define DOUBLE_CLICK_TIME 250 @@ -1384,10 +1384,10 @@ eti_add_header_model (ETableItem *eti, ETableHeader *header) } /* - * GtkObject::destroy method + * GObject::dispose method */ static void -eti_destroy (GtkObject *object) +eti_dispose (GObject *object) { ETableItem *eti = E_TABLE_ITEM (object); @@ -1423,80 +1423,80 @@ eti_destroy (GtkObject *object) eti->tooltip = NULL; } - if (GTK_OBJECT_CLASS (eti_parent_class)->destroy) - (*GTK_OBJECT_CLASS (eti_parent_class)->destroy) (object); + if (G_OBJECT_CLASS (eti_parent_class)->dispose) + (*G_OBJECT_CLASS (eti_parent_class)->dispose) (object); } static void -eti_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GnomeCanvasItem *item; ETableItem *eti; int cursor_col; - item = GNOME_CANVAS_ITEM (o); - eti = E_TABLE_ITEM (o); + item = GNOME_CANVAS_ITEM (object); + eti = E_TABLE_ITEM (object); - switch (arg_id){ - case ARG_TABLE_HEADER: + switch (prop_id){ + case PROP_TABLE_HEADER: eti_remove_header_model (eti); - eti_add_header_model (eti, E_TABLE_HEADER(GTK_VALUE_OBJECT (*arg))); + eti_add_header_model (eti, E_TABLE_HEADER(g_value_get_object (value))); break; - case ARG_TABLE_MODEL: + case PROP_TABLE_MODEL: eti_remove_table_model (eti); - eti_add_table_model (eti, E_TABLE_MODEL(GTK_VALUE_OBJECT (*arg))); + eti_add_table_model (eti, E_TABLE_MODEL(g_value_get_object (value))); break; - case ARG_SELECTION_MODEL: + case PROP_SELECTION_MODEL: eti_remove_selection_model (eti); - if (GTK_VALUE_OBJECT (*arg)) - eti_add_selection_model (eti, E_SELECTION_MODEL(GTK_VALUE_OBJECT (*arg))); + if (g_value_get_object (value)) + eti_add_selection_model (eti, E_SELECTION_MODEL(g_value_get_object(value))); break; - case ARG_LENGTH_THRESHOLD: - eti->length_threshold = GTK_VALUE_INT (*arg); + case PROP_LENGTH_THRESHOLD: + eti->length_threshold = g_value_get_int (value); break; - case ARG_TABLE_ALTERNATING_ROW_COLORS: - eti->alternating_row_colors = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_ALTERNATING_ROW_COLORS: + eti->alternating_row_colors = g_value_get_boolean (value); break; - case ARG_TABLE_HORIZONTAL_DRAW_GRID: - eti->horizontal_draw_grid = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_HORIZONTAL_DRAW_GRID: + eti->horizontal_draw_grid = g_value_get_boolean (value); break; - case ARG_TABLE_VERTICAL_DRAW_GRID: - eti->vertical_draw_grid = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_VERTICAL_DRAW_GRID: + eti->vertical_draw_grid = g_value_get_boolean (value); break; - case ARG_TABLE_DRAW_FOCUS: - eti->draw_focus = GTK_VALUE_BOOL (*arg); + case PROP_TABLE_DRAW_FOCUS: + eti->draw_focus = g_value_get_boolean (value); break; - case ARG_CURSOR_MODE: - eti->cursor_mode = GTK_VALUE_INT (*arg); + case PROP_CURSOR_MODE: + eti->cursor_mode = g_value_get_int (value); break; - case ARG_MINIMUM_WIDTH: - case ARG_WIDTH: - if ((eti->minimum_width == eti->width && GTK_VALUE_DOUBLE (*arg) > eti->width) || - GTK_VALUE_DOUBLE (*arg) < eti->width) { + case PROP_MINIMUM_WIDTH: + case PROP_WIDTH: + if ((eti->minimum_width == eti->width && g_value_get_double(value) > eti->width) || + g_value_get_double(value) < eti->width) { eti->needs_compute_width = 1; e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(eti)); } - eti->minimum_width = GTK_VALUE_DOUBLE (*arg); + eti->minimum_width = g_value_get_double (value); break; - case ARG_CURSOR_ROW: + case PROP_CURSOR_ROW: g_object_get(eti->selection, "cursor_col", &cursor_col, NULL); - e_table_item_focus (eti, cursor_col != -1 ? cursor_col : 0, view_to_model_row(eti, GTK_VALUE_INT (*arg)), 0); + e_table_item_focus (eti, cursor_col != -1 ? cursor_col : 0, view_to_model_row(eti, g_value_get_int (value)), 0); break; - case ARG_UNIFORM_ROW_HEIGHT: - if (eti->uniform_row_height != GTK_VALUE_BOOL (*arg)) { - eti->uniform_row_height = GTK_VALUE_BOOL (*arg); + case PROP_UNIFORM_ROW_HEIGHT: + if (eti->uniform_row_height != g_value_get_boolean (value)) { + eti->uniform_row_height = g_value_get_boolean (value); if (GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) { free_height_cache(eti); eti->needs_compute_height = 1; @@ -1512,36 +1512,36 @@ eti_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) } static void -eti_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) +eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GnomeCanvasItem *item; ETableItem *eti; int row; - item = GNOME_CANVAS_ITEM (o); - eti = E_TABLE_ITEM (o); + item = GNOME_CANVAS_ITEM (object); + eti = E_TABLE_ITEM (object); - switch (arg_id){ - case ARG_WIDTH: - GTK_VALUE_DOUBLE (*arg) = eti->width; + switch (prop_id){ + case PROP_WIDTH: + g_value_set_double (value, eti->width); break; - case ARG_HEIGHT: - GTK_VALUE_DOUBLE (*arg) = eti->height; + case PROP_HEIGHT: + g_value_set_double (value, eti->height); break; - case ARG_MINIMUM_WIDTH: - GTK_VALUE_DOUBLE (*arg) = eti->minimum_width; + case PROP_MINIMUM_WIDTH: + g_value_set_double (value, eti->minimum_width); break; - case ARG_CURSOR_ROW: + case PROP_CURSOR_ROW: g_object_get(eti->selection, "cursor_row", &row, NULL); - GTK_VALUE_INT (*arg) = model_to_view_row(eti, row); + g_value_set_int (value, model_to_view_row(eti, row)); break; - case ARG_UNIFORM_ROW_HEIGHT: - GTK_VALUE_BOOL (*arg) = eti->uniform_row_height; + case PROP_UNIFORM_ROW_HEIGHT: + g_value_set_boolean (value, eti->uniform_row_height); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -1663,17 +1663,17 @@ eti_realize (GnomeCanvasItem *item) gdk_gc_set_fill (eti->focus_gc, GDK_OPAQUE_STIPPLED); eti->hadjustment_change_id = - gtk_signal_connect(GTK_OBJECT(gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas))), "changed", - GTK_SIGNAL_FUNC (adjustment_changed), eti); + g_signal_connect (gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)), "changed", + G_CALLBACK (adjustment_changed), eti); eti->hadjustment_value_change_id = - gtk_signal_connect(GTK_OBJECT(gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas))), "value_changed", - GTK_SIGNAL_FUNC (adjustment_changed), eti); + g_signal_connect (gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)), "value_changed", + G_CALLBACK (adjustment_changed), eti); eti->vadjustment_change_id = - gtk_signal_connect(GTK_OBJECT(gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas))), "changed", - GTK_SIGNAL_FUNC (adjustment_changed), eti); + g_signal_connect (gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), "changed", + G_CALLBACK (adjustment_changed), eti); eti->vadjustment_value_change_id = - gtk_signal_connect(GTK_OBJECT(gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas))), "value_changed", - GTK_SIGNAL_FUNC (adjustment_changed), eti); + g_signal_connect (gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), "value_changed", + G_CALLBACK (adjustment_changed), eti); if (eti->cell_views == NULL) eti_attach_cell_views (eti); @@ -1751,14 +1751,14 @@ eti_unrealize (GnomeCanvasItem *item) eti->height = 0; - gtk_signal_disconnect(GTK_OBJECT(gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas))), - eti->hadjustment_change_id); - gtk_signal_disconnect(GTK_OBJECT(gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas))), - eti->hadjustment_value_change_id); - gtk_signal_disconnect(GTK_OBJECT(gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas))), - eti->vadjustment_change_id); - gtk_signal_disconnect(GTK_OBJECT(gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas))), - eti->vadjustment_value_change_id); + g_signal_handler_disconnect(gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)), + eti->hadjustment_change_id); + g_signal_handler_disconnect(gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)), + eti->hadjustment_value_change_id); + g_signal_handler_disconnect(gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), + eti->vadjustment_change_id); + g_signal_handler_disconnect(gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), + eti->vadjustment_value_change_id); if (GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->unrealize) (*GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->unrealize)(item); @@ -1864,8 +1864,6 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, return; } - last_row = row; - if (first_row == -1) return; @@ -2278,8 +2276,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (return_val) return TRUE; - gtk_signal_emit (GTK_OBJECT (eti), eti_signals [CLICK], - row, view_to_model_col(eti, col), &button, &return_val); + g_signal_emit (eti, eti_signals [CLICK], 0, + row, view_to_model_col(eti, col), &button, &return_val); if (return_val) { eti->click_count = 0; @@ -2343,8 +2341,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) e_selection_model_right_click_down(E_SELECTION_MODEL (eti->selection), view_to_model_row(eti, row), view_to_model_col(eti, col), 0); - gtk_signal_emit (GTK_OBJECT (eti), eti_signals [RIGHT_CLICK], - row, view_to_model_col(eti, col), e, &return_val); + g_signal_emit (eti, eti_signals [RIGHT_CLICK], 0, + row, view_to_model_col(eti, col), e, &return_val); if (!return_val) e_selection_model_right_click_up(E_SELECTION_MODEL (eti->selection)); break; @@ -2495,8 +2493,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } if (model_row != -1 && model_col != -1) { - gtk_signal_emit (GTK_OBJECT (eti), eti_signals [DOUBLE_CLICK], - model_row, model_col, e); + g_signal_emit (eti, eti_signals [DOUBLE_CLICK], 0, + model_row, model_col, e); } } break; @@ -2514,8 +2512,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) gint drag_handled; eti->maybe_in_drag = 0; - gtk_signal_emit (GTK_OBJECT (eti), eti_signals [START_DRAG], - eti->drag_row, eti->drag_col, e, &drag_handled); + g_signal_emit (eti, eti_signals [START_DRAG], 0, + eti->drag_row, eti->drag_col, e, &drag_handled); if (drag_handled) eti->in_drag = 1; else @@ -2590,8 +2588,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) break; } - gtk_signal_emit (GTK_OBJECT (eti), eti_signals [KEY_PRESS], - model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit (eti, eti_signals [KEY_PRESS], 0, + model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); if ((!return_val) && eti->cursor_mode != E_CURSOR_LINE && cursor_col != view_to_model_col(eti, 0)) eti_cursor_move_left (eti); return_val = 1; @@ -2604,8 +2602,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) break; } - gtk_signal_emit (GTK_OBJECT (eti), eti_signals [KEY_PRESS], - model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit (eti, eti_signals [KEY_PRESS], 0, + model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); if ((!return_val) && eti->cursor_mode != E_CURSOR_LINE && cursor_col != view_to_model_col(eti, eti->cols - 1)) eti_cursor_move_right (eti); return_val = 1; @@ -2682,8 +2680,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR); #endif } - gtk_signal_emit (GTK_OBJECT (eti), eti_signals [KEY_PRESS], - model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit (eti, eti_signals [KEY_PRESS], 0, + model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); if (!return_val) return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; @@ -2724,8 +2722,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } } if (!eti_editing (eti)){ - gtk_signal_emit (GTK_OBJECT (eti), eti_signals [KEY_PRESS], - model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit (eti, eti_signals [KEY_PRESS], 0, + model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); if (!return_val) e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); } else { @@ -2832,16 +2830,16 @@ eti_style_set (ETableItem *eti, GtkStyle *previous_style) } static void -eti_class_init (GtkObjectClass *object_class) +eti_class_init (GObjectClass *object_class) { GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class; ETableItemClass *eti_class = (ETableItemClass *) object_class; - eti_parent_class = gtk_type_class (PARENT_OBJECT_TYPE); + eti_parent_class = g_type_class_ref (PARENT_OBJECT_TYPE); - object_class->destroy = eti_destroy; - object_class->set_arg = eti_set_arg; - object_class->get_arg = eti_get_arg; + object_class->dispose = eti_dispose; + object_class->set_property = eti_set_property; + object_class->get_property = eti_get_property; item_class->update = eti_update; item_class->realize = eti_realize; @@ -2859,130 +2857,187 @@ eti_class_init (GtkObjectClass *object_class) eti_class->start_drag = NULL; eti_class->style_set = eti_style_set; - gtk_object_add_arg_type ("ETableItem::ETableHeader", E_TABLE_HEADER_TYPE, - GTK_ARG_WRITABLE, ARG_TABLE_HEADER); - gtk_object_add_arg_type ("ETableItem::ETableModel", E_TABLE_MODEL_TYPE, - GTK_ARG_WRITABLE, ARG_TABLE_MODEL); - gtk_object_add_arg_type ("ETableItem::selection_model", E_SELECTION_MODEL_TYPE, - GTK_ARG_WRITABLE, ARG_SELECTION_MODEL); - gtk_object_add_arg_type ("ETableItem::alternating_row_colors", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_ALTERNATING_ROW_COLORS); - gtk_object_add_arg_type ("ETableItem::horizontal_draw_grid", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_HORIZONTAL_DRAW_GRID); - gtk_object_add_arg_type ("ETableItem::vertical_draw_grid", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_VERTICAL_DRAW_GRID); - gtk_object_add_arg_type ("ETableItem::drawfocus", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_TABLE_DRAW_FOCUS); - gtk_object_add_arg_type ("ETableItem::cursor_mode", GTK_TYPE_INT, - GTK_ARG_WRITABLE, ARG_CURSOR_MODE); - gtk_object_add_arg_type ("ETableItem::length_threshold", GTK_TYPE_INT, - GTK_ARG_WRITABLE, ARG_LENGTH_THRESHOLD); - - gtk_object_add_arg_type ("ETableItem::minimum_width", GTK_TYPE_DOUBLE, - GTK_ARG_READWRITE, ARG_MINIMUM_WIDTH); - gtk_object_add_arg_type ("ETableItem::width", GTK_TYPE_DOUBLE, - GTK_ARG_READWRITE, ARG_WIDTH); - gtk_object_add_arg_type ("ETableItem::height", GTK_TYPE_DOUBLE, - GTK_ARG_READABLE, ARG_HEIGHT); - gtk_object_add_arg_type ("ETableItem::cursor_row", GTK_TYPE_INT, - GTK_ARG_READWRITE, ARG_CURSOR_ROW); - gtk_object_add_arg_type ("ETableItem::uniform_row_height", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_UNIFORM_ROW_HEIGHT); + g_object_class_install_property (object_class, PROP_TABLE_HEADER, + g_param_spec_object ("ETableHeader", + _( "Table header" ), + _( "Table header" ), + E_TABLE_HEADER_TYPE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_MODEL, + g_param_spec_object ("ETableModel", + _( "Table model" ), + _( "Table model" ), + E_TABLE_MODEL_TYPE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_SELECTION_MODEL, + g_param_spec_object ("selection_model", + _( "Selection model" ), + _( "Selection model" ), + E_SELECTION_MODEL_TYPE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS, + g_param_spec_boolean ("alternating_row_colors", + _( "Alternating Row Colors" ), + _( "Alternating Row Colors" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID, + g_param_spec_boolean ("horizontal_draw_grid", + _( "Horizontal Draw Grid" ), + _( "Horizontal Draw Grid" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID, + g_param_spec_boolean ("vertical_draw_grid", + _( "Vertical Draw Grid" ), + _( "Vertical Draw Grid" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS, + g_param_spec_boolean ("drawfocus", + _( "Draw focus" ), + _( "Draw focus" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_CURSOR_MODE, + g_param_spec_int ("cursor_mode", + _( "Cursor mode" ), + _( "Cursor mode" ), + E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD, + g_param_spec_int ("length_threshold", + _( "Length Threshold" ), + _( "Length Threshold" ), + 0, G_MAXINT, 0, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH, + g_param_spec_double ("minimum_width", + _( "Minimum width" ), + _( "Minimum Width" ), + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_WIDTH, + g_param_spec_double ("width", + _( "Width" ), + _( "Width" ), + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + g_object_class_install_property (object_class, PROP_HEIGHT, + g_param_spec_double ("height", + _( "Height" ), + _( "Height" ), + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_CURSOR_ROW, + g_param_spec_int ("cursor_row", + _( "Cursor row" ), + _( "Cursor row" ), + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT, + g_param_spec_boolean ("uniform_row_height", + _( "Uniform row height" ), + _( "Uniform row height" ), + FALSE, + G_PARAM_READWRITE)); eti_signals [CURSOR_CHANGE] = - gtk_signal_new ("cursor_change", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableItemClass, cursor_change), - gtk_marshal_NONE__INT, - GTK_TYPE_NONE, 1, GTK_TYPE_INT); + g_signal_new ("cursor_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, cursor_change), + NULL, NULL, + e_marshal_NONE__INT, + G_TYPE_NONE, 1, G_TYPE_INT); eti_signals [CURSOR_ACTIVATED] = - gtk_signal_new ("cursor_activated", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableItemClass, cursor_activated), - e_marshal_NONE__INT, - GTK_TYPE_NONE, 1, GTK_TYPE_INT); + g_signal_new ("cursor_activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, cursor_activated), + NULL, NULL, + e_marshal_NONE__INT, + G_TYPE_NONE, 1, G_TYPE_INT); eti_signals [DOUBLE_CLICK] = - gtk_signal_new ("double_click", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableItemClass, double_click), - e_marshal_NONE__INT_INT_BOXED, - GTK_TYPE_NONE, 3, GTK_TYPE_INT, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("double_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, double_click), + NULL, NULL, + e_marshal_NONE__INT_INT_BOXED, + G_TYPE_NONE, 3, G_TYPE_INT, + G_TYPE_INT, GDK_TYPE_EVENT); eti_signals [START_DRAG] = - gtk_signal_new ("start_drag", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableItemClass, start_drag), - e_marshal_INT__INT_INT_BOXED, - GTK_TYPE_INT, 3, GTK_TYPE_INT, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("start_drag", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, start_drag), + NULL, NULL, + e_marshal_INT__INT_INT_BOXED, + G_TYPE_INT, 3, G_TYPE_INT, + G_TYPE_INT, GDK_TYPE_EVENT); eti_signals [RIGHT_CLICK] = - gtk_signal_new ("right_click", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableItemClass, right_click), - e_marshal_INT__INT_INT_BOXED, - GTK_TYPE_INT, 3, GTK_TYPE_INT, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("right_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, right_click), + NULL, NULL, + e_marshal_INT__INT_INT_BOXED, + G_TYPE_INT, 3, G_TYPE_INT, + G_TYPE_INT, GDK_TYPE_EVENT); eti_signals [CLICK] = - gtk_signal_new ("click", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableItemClass, click), - e_marshal_INT__INT_INT_BOXED, - GTK_TYPE_INT, 3, GTK_TYPE_INT, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, click), + NULL, NULL, + e_marshal_INT__INT_INT_BOXED, + G_TYPE_INT, 3, G_TYPE_INT, + G_TYPE_INT, GDK_TYPE_EVENT); eti_signals [KEY_PRESS] = - gtk_signal_new ("key_press", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableItemClass, key_press), - e_marshal_INT__INT_INT_BOXED, - GTK_TYPE_INT, 3, GTK_TYPE_INT, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("key_press", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, key_press), + NULL, NULL, + e_marshal_INT__INT_INT_BOXED, + G_TYPE_INT, 3, G_TYPE_INT, + G_TYPE_INT, GDK_TYPE_EVENT); eti_signals [STYLE_SET] = - gtk_signal_new ("style_set", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETableItemClass, style_set), - gtk_marshal_NONE__OBJECT, - GTK_TYPE_NONE, 1, GTK_TYPE_STYLE); - - E_OBJECT_CLASS_ADD_SIGNALS (object_class, eti_signals, LAST_SIGNAL); -} - -GtkType -e_table_item_get_type (void) -{ - static GtkType type = 0; - - if (!type){ - GtkTypeInfo info = { - "ETableItem", - sizeof (ETableItem), - sizeof (ETableItemClass), - (GtkClassInitFunc) eti_class_init, - (GtkObjectInitFunc) eti_init, - NULL, /* reserved 1 */ - NULL, /* reserved 2 */ - (GtkClassInitFunc) NULL - }; - - type = gtk_type_unique (PARENT_OBJECT_TYPE, &info); - } - - return type; -} + g_signal_new ("style_set", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, style_set), + NULL, NULL, + e_marshal_NONE__OBJECT, + G_TYPE_NONE, 1, GTK_TYPE_STYLE); +} + +E_MAKE_TYPE (e_table_item, + "ETableItem", + ETableItem, + eti_class_init, + eti_init, + PARENT_OBJECT_TYPE) /** * e_table_item_set_cursor: @@ -3074,8 +3129,8 @@ eti_cursor_change (ESelectionModel *selection, int row, int col, ETableItem *eti e_canvas_item_grab_focus(GNOME_CANVAS_ITEM(eti), FALSE); if (eti_editing(eti)) e_table_item_leave_edit_(eti); - gtk_signal_emit (GTK_OBJECT (eti), eti_signals [CURSOR_CHANGE], - view_row); + g_signal_emit (eti, eti_signals [CURSOR_CHANGE], 0, + view_row); e_table_item_redraw_row (eti, view_row); @@ -3109,8 +3164,8 @@ eti_cursor_activated (ESelectionModel *selection, int row, int col, ETableItem * e_table_item_leave_edit_(eti); if (view_row != -1) - gtk_signal_emit (GTK_OBJECT (eti), eti_signals [CURSOR_ACTIVATED], - view_row); + g_signal_emit (eti, eti_signals [CURSOR_ACTIVATED], 0, + view_row); } static void @@ -3412,7 +3467,7 @@ e_table_item_data_left (EPrintable *ep, ETableItem *item = itemcontext->item; int rows_printed = itemcontext->rows_printed; - gtk_signal_emit_stop_by_name(GTK_OBJECT(ep), "data_left"); + g_signal_stop_emission_by_name(ep, "data_left"); return rows_printed < item->rows; } @@ -3469,7 +3524,7 @@ e_table_item_height (EPrintable *ep, if (max_height != -1 && (!quantize) && yd > max_height) yd = max_height; - gtk_signal_emit_stop_by_name(GTK_OBJECT(ep), "height"); + g_signal_stop_emission_by_name(ep, "height"); return yd; } @@ -3519,14 +3574,16 @@ e_table_item_will_fit (EPrintable *ep, g_free (widths); - gtk_signal_emit_stop_by_name(GTK_OBJECT(ep), "will_fit"); + g_signal_stop_emission_by_name(ep, "will_fit"); return ret_val; } static void -e_table_item_printable_destroy (GtkObject *object, - ETableItemPrintContext *itemcontext) +e_table_item_printable_destroy (gpointer data, + GObject *where_object_was) { + ETableItemPrintContext *itemcontext = data; + g_object_unref(itemcontext->item); g_free(itemcontext); } @@ -3551,30 +3608,29 @@ e_table_item_get_printable (ETableItem *item) g_object_ref(item); itemcontext->rows_printed = 0; - gtk_signal_connect (GTK_OBJECT(printable), - "print_page", - GTK_SIGNAL_FUNC(e_table_item_print_page), - itemcontext); - gtk_signal_connect (GTK_OBJECT(printable), - "data_left", - GTK_SIGNAL_FUNC(e_table_item_data_left), - itemcontext); - gtk_signal_connect (GTK_OBJECT(printable), - "reset", - GTK_SIGNAL_FUNC(e_table_item_reset), - itemcontext); - gtk_signal_connect (GTK_OBJECT(printable), - "height", - GTK_SIGNAL_FUNC(e_table_item_height), - itemcontext); - gtk_signal_connect (GTK_OBJECT(printable), - "will_fit", - GTK_SIGNAL_FUNC(e_table_item_will_fit), - itemcontext); - gtk_signal_connect (GTK_OBJECT(printable), - "destroy", - GTK_SIGNAL_FUNC(e_table_item_printable_destroy), - itemcontext); + g_signal_connect (printable, + "print_page", + G_CALLBACK(e_table_item_print_page), + itemcontext); + g_signal_connect (printable, + "data_left", + G_CALLBACK(e_table_item_data_left), + itemcontext); + g_signal_connect (printable, + "reset", + G_CALLBACK(e_table_item_reset), + itemcontext); + g_signal_connect (printable, + "height", + G_CALLBACK(e_table_item_height), + itemcontext); + g_signal_connect (printable, + "will_fit", + G_CALLBACK(e_table_item_will_fit), + itemcontext); + g_object_weak_ref (G_OBJECT (printable), + e_table_item_printable_destroy, + itemcontext); return printable; } diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h index e9044590d5..2c4a362278 100644 --- a/widgets/table/e-table-item.h +++ b/widgets/table/e-table-item.h @@ -36,10 +36,10 @@ G_BEGIN_DECLS #define E_TABLE_ITEM_TYPE (e_table_item_get_type ()) -#define E_TABLE_ITEM(o) (GTK_CHECK_CAST ((o), E_TABLE_ITEM_TYPE, ETableItem)) -#define E_TABLE_ITEM_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_ITEM_TYPE, ETableItemClass)) -#define E_IS_TABLE_ITEM(o) (GTK_CHECK_TYPE ((o), E_TABLE_ITEM_TYPE)) -#define E_IS_TABLE_ITEM_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_ITEM_TYPE)) +#define E_TABLE_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_ITEM_TYPE, ETableItem)) +#define E_TABLE_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_ITEM_TYPE, ETableItemClass)) +#define E_IS_TABLE_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_ITEM_TYPE)) +#define E_IS_TABLE_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_ITEM_TYPE)) typedef struct { GnomeCanvasItem parent; @@ -179,7 +179,7 @@ typedef struct { gint (*start_drag) (ETableItem *eti, int row, int col, GdkEvent *event); void (*style_set) (ETableItem *eti, GtkStyle *previous_style); } ETableItemClass; -GtkType e_table_item_get_type (void); +GType e_table_item_get_type (void); /* diff --git a/widgets/table/e-table-scrolled.c b/widgets/table/e-table-scrolled.c index 080c685d6e..4731ee45bc 100644 --- a/widgets/table/e-table-scrolled.c +++ b/widgets/table/e-table-scrolled.c @@ -33,6 +33,7 @@ #include "e-table.h" #include "e-table-scrolled.h" +#include "gal/util/e-i18n.h" #define COLUMN_HEADER_HEIGHT 16 @@ -41,8 +42,8 @@ static GtkObjectClass *parent_class; enum { - ARG_0, - ARG_TABLE + PROP_0, + PROP_TABLE }; static void @@ -56,7 +57,7 @@ e_table_scrolled_init (GtkObject *object) GTK_WIDGET_SET_FLAGS (ets, GTK_CAN_FOCUS); - ets->table = gtk_type_new(e_table_get_type()); + ets->table = g_object_new (E_TABLE_TYPE, NULL); e_scroll_frame_set_policy (scroll_frame, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); e_scroll_frame_set_shadow_type (scroll_frame, GTK_SHADOW_IN); @@ -161,16 +162,16 @@ e_table_scrolled_get_table (ETableScrolled *ets) } static void -ets_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) +ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - ETableScrolled *ets = E_TABLE_SCROLLED (o); - - switch (arg_id){ - case ARG_TABLE: - if (ets->table) - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(ets->table); - else - GTK_VALUE_OBJECT (*arg) = NULL; + ETableScrolled *ets = E_TABLE_SCROLLED (object); + + switch (prop_id){ + case PROP_TABLE: + g_value_set_object (value, ets->table); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -200,24 +201,28 @@ ets_focus (GtkWidget *container, GtkDirectionType direction) static void e_table_scrolled_class_init (ETableScrolledClass *class) { - GtkObjectClass *object_class; + GObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; - object_class = (GtkObjectClass *) class; + object_class = (GObjectClass *) class; widget_class = (GtkWidgetClass *) class; container_class = (GtkContainerClass *) class; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); - object_class->get_arg = ets_get_arg; + object_class->get_property = ets_get_property; widget_class->grab_focus = ets_grab_focus; widget_class->focus = ets_focus; - gtk_object_add_arg_type ("ETableScrolled::table", GTK_TYPE_OBJECT, - GTK_ARG_READABLE, ARG_TABLE); + g_object_class_install_property (object_class, PROP_TABLE, + g_param_spec_object ("table", + _( "Table" ), + _( "Table" ), + E_TABLE_TYPE, + G_PARAM_READABLE)); } E_MAKE_TYPE(e_table_scrolled, "ETableScrolled", ETableScrolled, e_table_scrolled_class_init, e_table_scrolled_init, PARENT_TYPE) diff --git a/widgets/table/e-table-scrolled.h b/widgets/table/e-table-scrolled.h index 58241f25b6..08ba85b4a5 100644 --- a/widgets/table/e-table-scrolled.h +++ b/widgets/table/e-table-scrolled.h @@ -31,10 +31,10 @@ G_BEGIN_DECLS #define E_TABLE_SCROLLED_TYPE (e_table_scrolled_get_type ()) -#define E_TABLE_SCROLLED(o) (GTK_CHECK_CAST ((o), E_TABLE_SCROLLED_TYPE, ETableScrolled)) -#define E_TABLE_SCROLLED_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_SCROLLED_TYPE, ETableScrolledClass)) -#define E_IS_TABLE_SCROLLED(o) (GTK_CHECK_TYPE ((o), E_TABLE_SCROLLED_TYPE)) -#define E_IS_TABLE_SCROLLED_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_SCROLLED_TYPE)) +#define E_TABLE_SCROLLED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SCROLLED_TYPE, ETableScrolled)) +#define E_TABLE_SCROLLED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SCROLLED_TYPE, ETableScrolledClass)) +#define E_IS_TABLE_SCROLLED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SCROLLED_TYPE)) +#define E_IS_TABLE_SCROLLED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SCROLLED_TYPE)) typedef struct { EScrollFrame parent; @@ -46,7 +46,7 @@ typedef struct { EScrollFrameClass parent_class; } ETableScrolledClass; -GtkType e_table_scrolled_get_type (void); +GType e_table_scrolled_get_type (void); ETableScrolled *e_table_scrolled_construct (ETableScrolled *ets, ETableModel *etm, diff --git a/widgets/table/e-table-utils.c b/widgets/table/e-table-utils.c index b896ae3944..579ba25dc9 100644 --- a/widgets/table/e-table-utils.c +++ b/widgets/table/e-table-utils.c @@ -114,9 +114,9 @@ et_col_spec_to_col (ETableColumnSpecification *col_spec, g_free (title); } if (col && col_spec->compare_col != col_spec->model_col) - gtk_object_set (GTK_OBJECT (col), - "compare_col", col_spec->compare_col, - NULL); + g_object_set (col, + "compare_col", col_spec->compare_col, + NULL); return col; } diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index 40a34fdc27..6b68e3f033 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -95,12 +95,12 @@ enum { }; enum { - ARG_0, - ARG_LENGTH_THRESHOLD, - ARG_MODEL, - ARG_UNIFORM_ROW_HEIGHT, - ARG_ALWAYS_SEARCH, - ARG_USE_CLICK_TO_ADD + PROP_0, + PROP_LENGTH_THRESHOLD, + PROP_MODEL, + PROP_UNIFORM_ROW_HEIGHT, + PROP_ALWAYS_SEARCH, + PROP_USE_CLICK_TO_ADD }; enum { @@ -301,7 +301,7 @@ connect_header (ETable *e_table, ETableState *state) } static void -et_destroy (GtkObject *object) +et_dispose (GObject *object) { ETable *et = E_TABLE (object); @@ -395,7 +395,7 @@ et_destroy (GtkObject *object) g_free(et->domain); et->domain = NULL; - (*parent_class->destroy)(object); + (*G_OBJECT_CLASS (parent_class)->dispose)(object); } static void @@ -689,10 +689,10 @@ table_canvas_reflow_idle (ETable *e_table) gdouble oldheight, oldwidth; GtkAllocation *alloc = &(GTK_WIDGET (e_table->table_canvas)->allocation); - gtk_object_get (GTK_OBJECT (e_table->canvas_vbox), - "height", &height, - "width", &width, - NULL); + g_object_get (e_table->canvas_vbox, + "height", &height, + "width", &width, + NULL); item_height = height; height = MAX ((int)height, alloc->height); width = MAX((int)width, alloc->width); @@ -722,15 +722,15 @@ table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, width = alloc->width; g_value_set_double (val, width); - gtk_object_get (GTK_OBJECT (e_table->canvas_vbox), - "height", &height, - NULL); + g_object_get (e_table->canvas_vbox, + "height", &height, + NULL); item_height = height; height = MAX ((int)height, alloc->height); - gtk_object_set (GTK_OBJECT (e_table->canvas_vbox), - "width", width, - NULL); + g_object_set (e_table->canvas_vbox, + "width", width, + NULL); g_object_set_property (G_OBJECT (e_table->header), "width", val); g_free (val); if (e_table->reflow_idle_id) @@ -999,9 +999,9 @@ changed_idle (gpointer data) if (et->group) gtk_object_destroy (GTK_OBJECT (et->group)); et_build_groups(et); - gtk_object_set (GTK_OBJECT (et->canvas_vbox), - "width", (double) GTK_WIDGET (et->table_canvas)->allocation.width, - NULL); + g_object_set (et->canvas_vbox, + "width", (double) GTK_WIDGET (et->table_canvas)->allocation.width, + NULL); if (GTK_WIDGET_REALIZED(et->table_canvas)) table_canvas_size_allocate (GTK_WIDGET(et->table_canvas), >K_WIDGET(et->table_canvas)->allocation, et); @@ -1262,15 +1262,15 @@ e_table_set_state_object(ETable *e_table, ETableState *state) "sort_info", e_table->sort_info, NULL); if (e_table->header_item) - gtk_object_set(GTK_OBJECT(e_table->header_item), - "ETableHeader", e_table->header, - "sort_info", e_table->sort_info, - NULL); + g_object_set(e_table->header_item, + "ETableHeader", e_table->header, + "sort_info", e_table->sort_info, + NULL); if (e_table->click_to_add) - gtk_object_set(GTK_OBJECT(e_table->click_to_add), - "header", e_table->header, - NULL); - + g_object_set(e_table->click_to_add, + "header", e_table->header, + NULL); + e_table->need_rebuild = TRUE; if (!e_table->rebuild_idle_id) e_table->rebuild_idle_id = g_idle_add_full (20, changed_idle, e_table, NULL); @@ -1692,7 +1692,7 @@ e_table_new (ETableModel *etm, ETableExtras *ete, const char *spec, const char * g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); g_return_val_if_fail(spec != NULL, NULL); - e_table = gtk_type_new (e_table_get_type ()); + e_table = g_object_new (E_TABLE_TYPE, NULL); e_table = e_table_construct (e_table, etm, ete, spec, state); @@ -1729,7 +1729,7 @@ e_table_new_from_spec_file (ETableModel *etm, ETableExtras *ete, const char *spe g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); g_return_val_if_fail(spec_fn != NULL, NULL); - e_table = gtk_type_new (e_table_get_type ()); + e_table = g_object_new (E_TABLE_TYPE, NULL); e_table = e_table_construct_from_spec_file (e_table, etm, ete, spec_fn, state_fn); @@ -2037,22 +2037,25 @@ e_table_commit_click_to_add (ETable *table) } static void -et_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) +et_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { - ETable *etable = E_TABLE (o); + ETable *etable = E_TABLE (object); - switch (arg_id){ - case ARG_MODEL: - GTK_VALUE_OBJECT (*arg) = (GtkObject *) etable->model; + switch (prop_id){ + case PROP_MODEL: + g_value_set_object (value, etable->model); break; - case ARG_UNIFORM_ROW_HEIGHT: - GTK_VALUE_BOOL (*arg) = etable->uniform_row_height; + case PROP_UNIFORM_ROW_HEIGHT: + g_value_set_boolean (value, etable->uniform_row_height); break; - case ARG_ALWAYS_SEARCH: - GTK_VALUE_BOOL (*arg) = etable->always_search; + case PROP_ALWAYS_SEARCH: + g_value_set_boolean (value, etable->always_search); break; - case ARG_USE_CLICK_TO_ADD: - GTK_VALUE_BOOL (*arg) = etable->use_click_to_add; + case PROP_USE_CLICK_TO_ADD: + g_value_set_boolean (value, etable->use_click_to_add); break; default: break; @@ -2065,39 +2068,42 @@ typedef struct { } bool_closure; static void -et_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +et_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { - ETable *etable = E_TABLE (o); + ETable *etable = E_TABLE (object); - switch (arg_id){ - case ARG_LENGTH_THRESHOLD: - etable->length_threshold = GTK_VALUE_INT (*arg); + switch (prop_id){ + case PROP_LENGTH_THRESHOLD: + etable->length_threshold = g_value_get_int (value); if (etable->group) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etable->group), - "length_threshold", GTK_VALUE_INT (*arg), + "length_threshold", etable->length_threshold, NULL); } break; - case ARG_UNIFORM_ROW_HEIGHT: - etable->uniform_row_height = GTK_VALUE_BOOL (*arg); + case PROP_UNIFORM_ROW_HEIGHT: + etable->uniform_row_height = g_value_get_boolean (value); if (etable->group) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etable->group), - "uniform_row_height", GTK_VALUE_BOOL (*arg), + "uniform_row_height", etable->uniform_row_height, NULL); } break; - case ARG_ALWAYS_SEARCH: - if (etable->always_search == GTK_VALUE_BOOL (*arg)) + case PROP_ALWAYS_SEARCH: + if (etable->always_search == g_value_get_boolean (value)) return; - etable->always_search = GTK_VALUE_BOOL (*arg); + etable->always_search = g_value_get_boolean (value); clear_current_search_col (etable); break; - case ARG_USE_CLICK_TO_ADD: - if (etable->use_click_to_add == GTK_VALUE_BOOL (*arg)) + case PROP_USE_CLICK_TO_ADD: + if (etable->use_click_to_add == g_value_get_boolean (value)) return; - etable->use_click_to_add = GTK_VALUE_BOOL (*arg); + etable->use_click_to_add = g_value_get_boolean (value); clear_current_search_col (etable); if (etable->use_click_to_add) { @@ -2976,20 +2982,20 @@ et_drag_data_received(GtkWidget *widget, static void e_table_class_init (ETableClass *class) { - GtkObjectClass *object_class; + GObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; - object_class = (GtkObjectClass *) class; + object_class = (GObjectClass *) class; widget_class = (GtkWidgetClass *) class; container_class = (GtkContainerClass *) class; parent_class = g_type_class_peek_parent (class); - object_class->destroy = et_destroy; - G_OBJECT_CLASS (object_class)->finalize = et_finalize; - object_class->set_arg = et_set_arg; - object_class->get_arg = et_get_arg; + object_class->dispose = et_dispose; + object_class->finalize = et_finalize; + object_class->set_property = et_set_property; + object_class->get_property = et_get_property; widget_class->grab_focus = et_grab_focus; widget_class->unrealize = et_unrealize; @@ -3229,16 +3235,40 @@ e_table_class_init (ETableClass *class) e_marshal_NONE__OBJECT_OBJECT, G_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT); - gtk_object_add_arg_type ("ETable::length_threshold", GTK_TYPE_INT, - GTK_ARG_WRITABLE, ARG_LENGTH_THRESHOLD); - gtk_object_add_arg_type ("ETable::uniform_row_height", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_UNIFORM_ROW_HEIGHT); - gtk_object_add_arg_type ("ETable::always_search", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_ALWAYS_SEARCH); - gtk_object_add_arg_type ("ETable::use_click_to_add", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_USE_CLICK_TO_ADD); - gtk_object_add_arg_type ("ETable::model", E_TABLE_MODEL_TYPE, - GTK_ARG_READABLE, ARG_MODEL); + g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD, + g_param_spec_int ("length_threshold", + _("Length Threshold"), + /*_( */"XXX blurb" /*)*/, + 0, G_MAXINT, 0, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT, + g_param_spec_boolean ("uniform_row_height", + _("Uniform row height"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_ALWAYS_SEARCH, + g_param_spec_boolean ("always_search", + _("Always Search"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_USE_CLICK_TO_ADD, + g_param_spec_boolean ("use_click_to_add", + _("Use click to add"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_MODEL, + g_param_spec_object ("model", + _("Model"), + /*_( */"XXX blurb" /*)*/, + E_TABLE_MODEL_TYPE, + G_PARAM_READABLE)); } E_MAKE_TYPE(e_table, "ETable", ETable, e_table_class_init, e_table_init, PARENT_TYPE) diff --git a/widgets/table/e-table.h b/widgets/table/e-table.h index 175c8d58db..f025318905 100644 --- a/widgets/table/e-table.h +++ b/widgets/table/e-table.h @@ -45,10 +45,10 @@ G_BEGIN_DECLS #define E_TABLE_TYPE (e_table_get_type ()) -#define E_TABLE(o) (GTK_CHECK_CAST ((o), E_TABLE_TYPE, ETable)) -#define E_TABLE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_TYPE, ETableClass)) -#define E_IS_TABLE(o) (GTK_CHECK_TYPE ((o), E_TABLE_TYPE)) -#define E_IS_TABLE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_TYPE)) +#define E_TABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_TYPE, ETable)) +#define E_TABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_TYPE, ETableClass)) +#define E_IS_TABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_TYPE)) +#define E_IS_TABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_TYPE)) typedef struct _ETableDragSourceSite ETableDragSourceSite; @@ -226,7 +226,7 @@ typedef struct { guint info, guint time); } ETableClass; -GtkType e_table_get_type (void); +GType e_table_get_type (void); ETable *e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, diff --git a/widgets/table/e-tree-memory-callbacks.h b/widgets/table/e-tree-memory-callbacks.h index 7d8f38cec0..0f75fa98be 100644 --- a/widgets/table/e-tree-memory-callbacks.h +++ b/widgets/table/e-tree-memory-callbacks.h @@ -32,10 +32,10 @@ extern "C" { #endif /* __cplusplus */ #define E_TREE_MEMORY_CALLBACKS_TYPE (e_tree_memory_callbacks_get_type ()) -#define E_TREE_MEMORY_CALLBACKS(o) (GTK_CHECK_CAST ((o), E_TREE_MEMORY_CALLBACKS_TYPE, ETreeMemoryCallbacks)) -#define E_TREE_MEMORY_CALLBACKS_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TREE_MEMORY_CALLBACKS_TYPE, ETreeMemoryCallbacksClass)) -#define E_IS_TREE_MEMORY_CALLBACKS(o) (GTK_CHECK_TYPE ((o), E_TREE_MEMORY_CALLBACKS_TYPE)) -#define E_IS_TREE_MEMORY_CALLBACKS_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TREE_MEMORY_CALLBACKS_TYPE)) +#define E_TREE_MEMORY_CALLBACKS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_MEMORY_CALLBACKS_TYPE, ETreeMemoryCallbacks)) +#define E_TREE_MEMORY_CALLBACKS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_MEMORY_CALLBACKS_TYPE, ETreeMemoryCallbacksClass)) +#define E_IS_TREE_MEMORY_CALLBACKS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_MEMORY_CALLBACKS_TYPE)) +#define E_IS_TREE_MEMORY_CALLBACKS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_MEMORY_CALLBACKS_TYPE)) typedef GdkPixbuf* (*ETreeMemoryCallbacksIconAtFn) (ETreeModel *etree, ETreePath path, void *model_data); @@ -88,7 +88,7 @@ typedef struct { ETreeMemoryClass parent_class; } ETreeMemoryCallbacksClass; -GtkType e_tree_memory_callbacks_get_type (void); +GType e_tree_memory_callbacks_get_type (void); ETreeModel *e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at, diff --git a/widgets/table/e-tree-scrolled.c b/widgets/table/e-tree-scrolled.c index f788a909f8..72d4da70f9 100644 --- a/widgets/table/e-tree-scrolled.c +++ b/widgets/table/e-tree-scrolled.c @@ -31,6 +31,7 @@ #include <libxml/parser.h> #include <libxml/xmlmemory.h> #include <gal/util/e-util.h> +#include <gal/util/e-i18n.h> #include "e-tree-scrolled.h" @@ -41,8 +42,8 @@ static GtkObjectClass *parent_class; enum { - ARG_0, - ARG_TREE + PROP_0, + PROP_TREE }; static void @@ -56,7 +57,7 @@ e_tree_scrolled_init (GtkObject *object) GTK_WIDGET_SET_FLAGS (ets, GTK_CAN_FOCUS); - ets->tree = gtk_type_new(e_tree_get_type()); + ets->tree = g_object_new (E_TREE_TYPE, NULL); e_scroll_frame_set_policy (scroll_frame, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); e_scroll_frame_set_shadow_type (scroll_frame, GTK_SHADOW_IN); @@ -160,16 +161,16 @@ e_tree_scrolled_get_tree (ETreeScrolled *ets) } static void -ets_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) +ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - ETreeScrolled *ets = E_TREE_SCROLLED (o); - - switch (arg_id){ - case ARG_TREE: - if (ets->tree) - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(ets->tree); - else - GTK_VALUE_OBJECT (*arg) = NULL; + ETreeScrolled *ets = E_TREE_SCROLLED (object); + + switch (prop_id){ + case PROP_TREE: + g_value_set_object (value, ets->tree); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -199,24 +200,28 @@ ets_focus (GtkWidget *container, GtkDirectionType direction) static void e_tree_scrolled_class_init (ETreeScrolledClass *class) { - GtkObjectClass *object_class; + GObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; - object_class = (GtkObjectClass *) class; + object_class = (GObjectClass *) class; widget_class = (GtkWidgetClass *) class; container_class = (GtkContainerClass *) class; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); - object_class->get_arg = ets_get_arg; + object_class->get_property = ets_get_property; widget_class->grab_focus = ets_grab_focus; widget_class->focus = ets_focus; - gtk_object_add_arg_type ("ETreeScrolled::tree", GTK_TYPE_OBJECT, - GTK_ARG_READABLE, ARG_TREE); + g_object_class_install_property (object_class, PROP_TREE, + g_param_spec_object ("tree", + _( "Tree" ), + _( "Tree" ), + E_TREE_TYPE, + G_PARAM_READABLE)); } E_MAKE_TYPE(e_tree_scrolled, "ETreeScrolled", ETreeScrolled, e_tree_scrolled_class_init, e_tree_scrolled_init, PARENT_TYPE) diff --git a/widgets/table/e-tree-scrolled.h b/widgets/table/e-tree-scrolled.h index b528042eed..5802562d14 100644 --- a/widgets/table/e-tree-scrolled.h +++ b/widgets/table/e-tree-scrolled.h @@ -31,10 +31,10 @@ G_BEGIN_DECLS #define E_TREE_SCROLLED_TYPE (e_tree_scrolled_get_type ()) -#define E_TREE_SCROLLED(o) (GTK_CHECK_CAST ((o), E_TREE_SCROLLED_TYPE, ETreeScrolled)) -#define E_TREE_SCROLLED_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TREE_SCROLLED_TYPE, ETreeScrolledClass)) -#define E_IS_TREE_SCROLLED(o) (GTK_CHECK_TYPE ((o), E_TREE_SCROLLED_TYPE)) -#define E_IS_TREE_SCROLLED_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TREE_SCROLLED_TYPE)) +#define E_TREE_SCROLLED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_SCROLLED_TYPE, ETreeScrolled)) +#define E_TREE_SCROLLED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_SCROLLED_TYPE, ETreeScrolledClass)) +#define E_IS_TREE_SCROLLED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_SCROLLED_TYPE)) +#define E_IS_TREE_SCROLLED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_SCROLLED_TYPE)) typedef struct { EScrollFrame parent; @@ -46,7 +46,7 @@ typedef struct { EScrollFrameClass parent_class; } ETreeScrolledClass; -GtkType e_tree_scrolled_get_type (void); +GType e_tree_scrolled_get_type (void); ETreeScrolled *e_tree_scrolled_construct (ETreeScrolled *ets, ETreeModel *etm, diff --git a/widgets/table/e-tree-sorted-variable.c b/widgets/table/e-tree-sorted-variable.c index 1086ee90aa..bb73b8b776 100644 --- a/widgets/table/e-tree-sorted-variable.c +++ b/widgets/table/e-tree-sorted-variable.c @@ -65,16 +65,16 @@ etsv_dispose (GObject *object) etsv->table_model_changed_id = 0; #if 0 - gtk_signal_disconnect (GTK_OBJECT (etss->source), - etsv->table_model_row_changed_id); - gtk_signal_disconnect (GTK_OBJECT (etss->source), - etsv->table_model_cell_changed_id); + g_signal_handler_disconnect (etss->source, + etsv->table_model_row_changed_id); + g_signal_handler_disconnect (etss->source, + etsv->table_model_cell_changed_id); etsv->table_model_row_changed_id = 0; etsv->table_model_cell_changed_id = 0; #endif if (etsv->sort_info_changed_id) - g_signal_handler_disconnect (G_OBJECT (etsv->sort_info), + g_signal_handler_disconnect (etsv->sort_info, etsv->sort_info_changed_id); etsv->sort_info_changed_id = 0; @@ -150,7 +150,7 @@ etsv_insert_idle(ETreeSortedVariable *etsv) ETableModel * e_tree_sorted_variable_new (ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) { - ETreeSortedVariable *etsv = gtk_type_new (E_TREE_SORTED_VARIABLE_TYPE); + ETreeSortedVariable *etsv = g_object_new (E_TREE_SORTED_VARIABLE_TYPE, NULL); ETreeSortedVariable *etsv = E_TABLE_SUBSET_VARIABLE (etsv); if (e_table_subset_variable_construct (etsv, source) == NULL){ @@ -163,15 +163,15 @@ e_tree_sorted_variable_new (ETreeModel *source, ETableHeader *full_header, ETabl etsv->full_header = full_header; g_object_ref(etsv->full_header); - etsv->table_model_changed_id = g_signal_connect (G_OBJECT (source), "model_changed", + etsv->table_model_changed_id = g_signal_connect (source, "model_changed", G_CALLBACK (etsv_proxy_model_changed), etsv); #if 0 - etsv->table_model_row_changed_id = gtk_signal_connect (GTK_OBJECT (source), "model_row_changed", - GTK_SIGNAL_FUNC (etsv_proxy_model_row_changed), etsv); - etsv->table_model_cell_changed_id = gtk_signal_connect (GTK_OBJECT (source), "model_cell_changed", - GTK_SIGNAL_FUNC (etsv_proxy_model_cell_changed), etsv); + etsv->table_model_row_changed_id = g_signal_connect (source, "model_row_changed", + G_CALLBACK (etsv_proxy_model_row_changed), etsv); + etsv->table_model_cell_changed_id = g_signal_connect (source, "model_cell_changed", + G_CALLBACK (etsv_proxy_model_cell_changed), etsv); #endif - etsv->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", + etsv->sort_info_changed_id = g_signal_connect (sort_info, "sort_info_changed", G_CALLBACK (etsv_sort_info_changed), etsv); return E_TABLE_MODEL(etsv); diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 4b6f78f4d0..2456c373ec 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -32,6 +32,7 @@ #include <gal/util/e-i18n.h> #include <gal/util/e-util.h> +#include <gal/util/e-marshal.h> #include <gal/widgets/e-canvas.h> #include <gal/widgets/e-canvas-background.h> @@ -52,6 +53,7 @@ #include <gal/e-table/e-tree-table-adapter.h> #include "e-tree.h" +#include "gal/util/e-marshal.h" #define COLUMN_HEADER_HEIGHT 16 @@ -93,14 +95,14 @@ enum { }; enum { - ARG_0, - ARG_LENGTH_THRESHOLD, - ARG_HORIZONTAL_DRAW_GRID, - ARG_VERTICAL_DRAW_GRID, - ARG_DRAW_FOCUS, - ARG_ETTA, - ARG_UNIFORM_ROW_HEIGHT, - ARG_ALWAYS_SEARCH + PROP_0, + PROP_LENGTH_THRESHOLD, + PROP_HORIZONTAL_DRAW_GRID, + PROP_VERTICAL_DRAW_GRID, + PROP_DRAW_FOCUS, + PROP_ETTA, + PROP_UNIFORM_ROW_HEIGHT, + PROP_ALWAYS_SEARCH }; enum { @@ -376,7 +378,7 @@ connect_header (ETree *e_tree, ETableState *state) } static void -et_destroy (GtkObject *object) +et_dispose (GObject *object) { ETree *et = E_TREE (object); @@ -384,11 +386,11 @@ et_destroy (GtkObject *object) if (et->priv->search) { if (et->priv->search_search_id) - g_signal_handler_disconnect (G_OBJECT (et->priv->search), - et->priv->search_search_id); + g_signal_handler_disconnect (et->priv->search, + et->priv->search_search_id); if (et->priv->search_accept_id) - g_signal_handler_disconnect (G_OBJECT (et->priv->search), - et->priv->search_accept_id); + g_signal_handler_disconnect (et->priv->search, + et->priv->search_accept_id); g_object_unref (et->priv->search); } @@ -429,8 +431,8 @@ et_destroy (GtkObject *object) et->priv = NULL; } - if (parent_class->destroy) - parent_class->destroy (object); + if (G_OBJECT_CLASS (parent_class)->dispose) + G_OBJECT_CLASS (parent_class)->dispose (object); } static void @@ -520,9 +522,9 @@ et_search_accept (ETableSearch *search, ETree *et) if (col == NULL) return; - gtk_object_get(GTK_OBJECT(et->priv->selection), - "cursor_row", &cursor, - NULL); + g_object_get(et->priv->selection, + "cursor_row", &cursor, + NULL); e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->priv->selection), cursor, col->col_idx, 0); } @@ -706,9 +708,9 @@ e_tree_setup_header (ETree *e_tree) g_free(pointer); - gtk_signal_connect ( - GTK_OBJECT (e_tree->priv->header_canvas), "size_allocate", - GTK_SIGNAL_FUNC (header_canvas_size_allocate), e_tree); + g_signal_connect ( + e_tree->priv->header_canvas, "size_allocate", + G_CALLBACK (header_canvas_size_allocate), e_tree); gtk_widget_set_usize (GTK_WIDGET (e_tree->priv->header_canvas), -1, E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height); @@ -722,10 +724,10 @@ tree_canvas_reflow_idle (ETree *e_tree) gdouble oldheight, oldwidth; GtkAllocation *alloc = &(GTK_WIDGET (e_tree->priv->table_canvas)->allocation); - gtk_object_get (GTK_OBJECT (e_tree->priv->item), - "height", &height, - "width", &width, - NULL); + g_object_get (e_tree->priv->item, + "height", &height, + "width", &width, + NULL); item_height = height; height = MAX ((int)height, alloc->height); width = MAX((int)width, alloc->width); @@ -755,15 +757,15 @@ tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, width = alloc->width; g_value_set_double (val, width); - gtk_object_get (GTK_OBJECT (e_tree->priv->item), - "height", &height, - NULL); + g_object_get (e_tree->priv->item, + "height", &height, + NULL); item_height = height; height = MAX ((int)height, alloc->height); - gtk_object_set (GTK_OBJECT (e_tree->priv->item), - "width", width, - NULL); + g_object_set (e_tree->priv->item, + "width", width, + NULL); g_object_set_property (G_OBJECT (e_tree->priv->header), "width", val); g_free (val); if (e_tree->priv->reflow_idle_id) @@ -783,9 +785,9 @@ item_cursor_change (ETableItem *eti, int row, ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); path = e_tree_sorted_view_to_model_path(et->priv->sorted, path); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [CURSOR_CHANGE], - row, path); + g_signal_emit (et, + et_signals [CURSOR_CHANGE], 0, + row, path); } static void @@ -794,9 +796,9 @@ item_cursor_activated (ETableItem *eti, int row, ETree *et) ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); if (path) path = e_tree_sorted_view_to_model_path(et->priv->sorted, path); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [CURSOR_ACTIVATED], - row, path); + g_signal_emit (et, + et_signals [CURSOR_ACTIVATED], 0, + row, path); d(g_print("%s: Emitted CURSOR_ACTIVATED signal on row: %d and path: 0x%p\n", __FUNCTION__, row, path)); } @@ -805,9 +807,9 @@ item_double_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et { ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); path = e_tree_sorted_view_to_model_path(et->priv->sorted, path); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [DOUBLE_CLICK], - row, path, col, event); + g_signal_emit (et, + et_signals [DOUBLE_CLICK], 0, + row, path, col, event); } static gint @@ -816,9 +818,9 @@ item_right_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) int return_val = 0; ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); path = e_tree_sorted_view_to_model_path(et->priv->sorted, path); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [RIGHT_CLICK], - row, path, col, event, &return_val); + g_signal_emit (et, + et_signals [RIGHT_CLICK], 0, + row, path, col, event, &return_val); return return_val; } @@ -828,9 +830,9 @@ item_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) int return_val = 0; ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); path = e_tree_sorted_view_to_model_path(et->priv->sorted, path); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [CLICK], - row, path, col, event, &return_val); + g_signal_emit (et, + et_signals [CLICK], 0, + row, path, col, event, &return_val); return return_val; } @@ -915,9 +917,9 @@ item_key_press (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) } path = e_tree_table_adapter_node_at_row(et->priv->etta, row); path = e_tree_sorted_view_to_model_path(et->priv->sorted, path); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [KEY_PRESS], - row, path, col, event, &return_val); + g_signal_emit (et, + et_signals [KEY_PRESS], 0, + row, path, col, event, &return_val); break; } return return_val; @@ -932,9 +934,9 @@ item_start_drag (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) path = e_tree_table_adapter_node_at_row(et->priv->etta, row); path = e_tree_sorted_view_to_model_path(et->priv->sorted, path); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [START_DRAG], - row, path, col, event, &return_val); + g_signal_emit (et, + et_signals [START_DRAG], 0, + row, path, col, event, &return_val); return return_val; } @@ -942,15 +944,15 @@ item_start_drag (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) static void et_selection_model_selection_changed (ETableSelectionModel *etsm, ETree *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [SELECTION_CHANGE]); + g_signal_emit (et, + et_signals [SELECTION_CHANGE], 0); } static void et_selection_model_selection_row_changed (ETableSelectionModel *etsm, int row, ETree *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [SELECTION_CHANGE]); + g_signal_emit (et, + et_signals [SELECTION_CHANGE], 0); } static void @@ -970,20 +972,20 @@ et_build_item (ETree *et) "uniform_row_height", et->priv->uniform_row_height, NULL); - gtk_signal_connect (GTK_OBJECT (et->priv->item), "cursor_change", - GTK_SIGNAL_FUNC (item_cursor_change), et); - gtk_signal_connect (GTK_OBJECT (et->priv->item), "cursor_activated", - GTK_SIGNAL_FUNC (item_cursor_activated), et); - gtk_signal_connect (GTK_OBJECT (et->priv->item), "double_click", - GTK_SIGNAL_FUNC (item_double_click), et); - gtk_signal_connect (GTK_OBJECT (et->priv->item), "right_click", - GTK_SIGNAL_FUNC (item_right_click), et); - gtk_signal_connect (GTK_OBJECT (et->priv->item), "click", - GTK_SIGNAL_FUNC (item_click), et); - gtk_signal_connect (GTK_OBJECT (et->priv->item), "key_press", - GTK_SIGNAL_FUNC (item_key_press), et); - gtk_signal_connect (GTK_OBJECT (et->priv->item), "start_drag", - GTK_SIGNAL_FUNC (item_start_drag), et); + g_signal_connect (et->priv->item, "cursor_change", + G_CALLBACK (item_cursor_change), et); + g_signal_connect (et->priv->item, "cursor_activated", + G_CALLBACK (item_cursor_activated), et); + g_signal_connect (et->priv->item, "double_click", + G_CALLBACK (item_double_click), et); + g_signal_connect (et->priv->item, "right_click", + G_CALLBACK (item_right_click), et); + g_signal_connect (et->priv->item, "click", + G_CALLBACK (item_click), et); + g_signal_connect (et->priv->item, "key_press", + G_CALLBACK (item_key_press), et); + g_signal_connect (et->priv->item, "start_drag", + G_CALLBACK (item_start_drag), et); } static void @@ -999,9 +1001,9 @@ static gint white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETree *e_tree) { int return_val = 0; - gtk_signal_emit (GTK_OBJECT (e_tree), - et_signals [WHITE_SPACE_EVENT], - event, &return_val); + g_signal_emit (e_tree, + et_signals [WHITE_SPACE_EVENT], 0, + event, &return_val); return return_val; } @@ -1059,43 +1061,43 @@ static void e_tree_setup_table (ETree *e_tree) { e_tree->priv->table_canvas = GNOME_CANVAS (e_canvas_new ()); - gtk_signal_connect ( - GTK_OBJECT (e_tree->priv->table_canvas), "size_allocate", - GTK_SIGNAL_FUNC (tree_canvas_size_allocate), e_tree); - gtk_signal_connect ( - GTK_OBJECT (e_tree->priv->table_canvas), "focus_in_event", - GTK_SIGNAL_FUNC (table_canvas_focus_event_cb), e_tree); - gtk_signal_connect ( - GTK_OBJECT (e_tree->priv->table_canvas), "focus_out_event", - GTK_SIGNAL_FUNC (table_canvas_focus_event_cb), e_tree); - - gtk_signal_connect ( - GTK_OBJECT (e_tree->priv->table_canvas), "drag_begin", - GTK_SIGNAL_FUNC (et_drag_begin), e_tree); - gtk_signal_connect ( - GTK_OBJECT (e_tree->priv->table_canvas), "drag_end", - GTK_SIGNAL_FUNC (et_drag_end), e_tree); - gtk_signal_connect ( - GTK_OBJECT (e_tree->priv->table_canvas), "drag_data_get", - GTK_SIGNAL_FUNC (et_drag_data_get), e_tree); - gtk_signal_connect ( - GTK_OBJECT (e_tree->priv->table_canvas), "drag_data_delete", - GTK_SIGNAL_FUNC (et_drag_data_delete), e_tree); - gtk_signal_connect ( - GTK_OBJECT (e_tree), "drag_motion", - GTK_SIGNAL_FUNC (et_drag_motion), e_tree); - gtk_signal_connect ( - GTK_OBJECT (e_tree), "drag_leave", - GTK_SIGNAL_FUNC (et_drag_leave), e_tree); - gtk_signal_connect ( - GTK_OBJECT (e_tree), "drag_drop", - GTK_SIGNAL_FUNC (et_drag_drop), e_tree); - gtk_signal_connect ( - GTK_OBJECT (e_tree), "drag_data_received", - GTK_SIGNAL_FUNC (et_drag_data_received), e_tree); - - gtk_signal_connect (GTK_OBJECT(e_tree->priv->table_canvas), "reflow", - GTK_SIGNAL_FUNC (tree_canvas_reflow), e_tree); + g_signal_connect ( + e_tree->priv->table_canvas, "size_allocate", + G_CALLBACK (tree_canvas_size_allocate), e_tree); + g_signal_connect ( + e_tree->priv->table_canvas, "focus_in_event", + G_CALLBACK (table_canvas_focus_event_cb), e_tree); + g_signal_connect ( + e_tree->priv->table_canvas, "focus_out_event", + G_CALLBACK (table_canvas_focus_event_cb), e_tree); + + g_signal_connect ( + e_tree->priv->table_canvas, "drag_begin", + G_CALLBACK (et_drag_begin), e_tree); + g_signal_connect ( + e_tree->priv->table_canvas, "drag_end", + G_CALLBACK (et_drag_end), e_tree); + g_signal_connect ( + e_tree->priv->table_canvas, "drag_data_get", + G_CALLBACK (et_drag_data_get), e_tree); + g_signal_connect ( + e_tree->priv->table_canvas, "drag_data_delete", + G_CALLBACK (et_drag_data_delete), e_tree); + g_signal_connect ( + e_tree, "drag_motion", + G_CALLBACK (et_drag_motion), e_tree); + g_signal_connect ( + e_tree, "drag_leave", + G_CALLBACK (et_drag_leave), e_tree); + g_signal_connect ( + e_tree, "drag_drop", + G_CALLBACK (et_drag_drop), e_tree); + g_signal_connect ( + e_tree, "drag_data_received", + G_CALLBACK (et_drag_data_received), e_tree); + + g_signal_connect (e_tree->priv->table_canvas, "reflow", + G_CALLBACK (tree_canvas_reflow), e_tree); gtk_widget_show (GTK_WIDGET (e_tree->priv->table_canvas)); @@ -1105,14 +1107,14 @@ e_tree_setup_table (ETree *e_tree) "fill_color_gdk", >K_WIDGET(e_tree->priv->table_canvas)->style->base[GTK_STATE_NORMAL], NULL); - gtk_signal_connect (GTK_OBJECT (e_tree->priv->white_item), "event", - GTK_SIGNAL_FUNC (white_item_event), e_tree); - gtk_signal_connect ( - GTK_OBJECT(e_tree->priv->table_canvas), "realize", - GTK_SIGNAL_FUNC(et_canvas_realize), e_tree); - gtk_signal_connect ( - GTK_OBJECT(gnome_canvas_root (e_tree->priv->table_canvas)), "event", - GTK_SIGNAL_FUNC(et_canvas_root_event), e_tree); + g_signal_connect (e_tree->priv->white_item, "event", + G_CALLBACK (white_item_event), e_tree); + g_signal_connect ( + e_tree->priv->table_canvas, "realize", + G_CALLBACK(et_canvas_realize), e_tree); + g_signal_connect ( + gnome_canvas_root (e_tree->priv->table_canvas), "event", + G_CALLBACK(et_canvas_root_event), e_tree); et_build_item(e_tree); } @@ -1151,15 +1153,15 @@ e_tree_set_state_object(ETree *e_tree, ETableState *state) g_free (val); if (e_tree->priv->header_item) - gtk_object_set(GTK_OBJECT(e_tree->priv->header_item), - "ETableHeader", e_tree->priv->header, - "sort_info", e_tree->priv->sort_info, - NULL); + g_object_set(e_tree->priv->header_item, + "ETableHeader", e_tree->priv->header, + "sort_info", e_tree->priv->sort_info, + NULL); if (e_tree->priv->item) - gtk_object_set(GTK_OBJECT(e_tree->priv->item), - "ETableHeader", e_tree->priv->header, - NULL); + g_object_set(e_tree->priv->item, + "ETableHeader", e_tree->priv->header, + NULL); if (e_tree->priv->sorted) e_tree_sorted_set_sort_info (e_tree->priv->sorted, e_tree->priv->sort_info); @@ -1351,19 +1353,19 @@ et_table_rows_deleted (ETableModel *table_model, int row, int count, ETree *et) static void et_connect_to_etta (ETree *et) { - et->priv->table_model_change_id = g_signal_connect (G_OBJECT (et->priv->etta), "model_changed", + et->priv->table_model_change_id = g_signal_connect (et->priv->etta, "model_changed", G_CALLBACK (et_table_model_changed), et); - et->priv->table_row_change_id = g_signal_connect (G_OBJECT (et->priv->etta), "model_row_changed", + et->priv->table_row_change_id = g_signal_connect (et->priv->etta, "model_row_changed", G_CALLBACK (et_table_row_changed), et); - et->priv->table_cell_change_id = g_signal_connect (G_OBJECT (et->priv->etta), "model_cell_changed", + et->priv->table_cell_change_id = g_signal_connect (et->priv->etta, "model_cell_changed", G_CALLBACK (et_table_cell_changed), et); - et->priv->table_rows_inserted_id = g_signal_connect (G_OBJECT (et->priv->etta), "model_rows_inserted", + et->priv->table_rows_inserted_id = g_signal_connect (et->priv->etta, "model_rows_inserted", G_CALLBACK (et_table_rows_inserted), et); - et->priv->table_rows_deleted_id = g_signal_connect (G_OBJECT (et->priv->etta), "model_rows_deleted", + et->priv->table_rows_deleted_id = g_signal_connect (et->priv->etta, "model_rows_deleted", G_CALLBACK (et_table_rows_deleted), et); } @@ -1597,7 +1599,7 @@ e_tree_new (ETreeModel *etm, ETableExtras *ete, const char *spec, const char *st g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); g_return_val_if_fail(spec != NULL, NULL); - e_tree = gtk_type_new (e_tree_get_type ()); + e_tree = g_object_new (E_TREE_TYPE, NULL); ret_val = e_tree_construct (e_tree, etm, ete, spec, state); @@ -1638,7 +1640,7 @@ e_tree_new_from_spec_file (ETreeModel *etm, ETableExtras *ete, const char *spec_ g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); g_return_val_if_fail(spec_fn != NULL, NULL); - e_tree = gtk_type_new (e_tree_get_type ()); + e_tree = g_object_new (E_TREE_TYPE, NULL); ret_val = e_tree_construct_from_spec_file (e_tree, etm, ete, spec_fn, state_fn); @@ -1670,9 +1672,9 @@ e_tree_set_cursor (ETree *e_tree, ETreePath path) if (row == -1) return; - gtk_object_set(GTK_OBJECT(e_tree->priv->selection), - "cursor_row", row, - NULL); + g_object_set(e_tree->priv->selection, + "cursor_row", row, + NULL); #endif } @@ -1687,9 +1689,9 @@ e_tree_get_cursor (ETree *e_tree) g_return_val_if_fail(e_tree != NULL, NULL); g_return_val_if_fail(E_IS_TREE(e_tree), NULL); - gtk_object_get(GTK_OBJECT(e_tree->priv->selection), - "cursor_row", &row, - NULL); + g_object_get(e_tree->priv->selection, + "cursor_row", &row, + NULL); if (row == -1) return NULL; path = e_tree_table_adapter_node_at_row(E_TREE_TABLE_ADAPTER(e_tree->priv->etta), row); @@ -1772,23 +1774,25 @@ e_tree_get_printable (ETree *e_tree) } static void -et_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) +et_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { - ETree *etree = E_TREE (o); + ETree *etree = E_TREE (object); - switch (arg_id){ - case ARG_ETTA: - if (etree->priv->item) { - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (etree->priv->etta); - } + switch (prop_id){ + case PROP_ETTA: + g_value_set_object (value, etree->priv->etta); break; - case ARG_UNIFORM_ROW_HEIGHT: - GTK_VALUE_BOOL (*arg) = etree->priv->uniform_row_height; + case PROP_UNIFORM_ROW_HEIGHT: + g_value_set_boolean (value, etree->priv->uniform_row_height); break; - case ARG_ALWAYS_SEARCH: - GTK_VALUE_BOOL (*arg) = etree->priv->always_search; + case PROP_ALWAYS_SEARCH: + g_value_set_boolean (value, etree->priv->always_search); break; default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -1799,60 +1803,63 @@ typedef struct { } bool_closure; static void -et_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +et_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { - ETree *etree = E_TREE (o); + ETree *etree = E_TREE (object); - switch (arg_id){ - case ARG_LENGTH_THRESHOLD: - etree->priv->length_threshold = GTK_VALUE_INT (*arg); + switch (prop_id){ + case PROP_LENGTH_THRESHOLD: + etree->priv->length_threshold = g_value_get_int (value); if (etree->priv->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item), - "length_threshold", GTK_VALUE_INT (*arg), + "length_threshold", etree->priv->length_threshold, NULL); } break; - case ARG_HORIZONTAL_DRAW_GRID: - etree->priv->horizontal_draw_grid = GTK_VALUE_BOOL (*arg); + case PROP_HORIZONTAL_DRAW_GRID: + etree->priv->horizontal_draw_grid = g_value_get_boolean (value); if (etree->priv->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item), - "horizontal_draw_grid", GTK_VALUE_BOOL (*arg), + "horizontal_draw_grid", etree->priv->horizontal_draw_grid, NULL); } break; - case ARG_VERTICAL_DRAW_GRID: - etree->priv->vertical_draw_grid = GTK_VALUE_BOOL (*arg); + case PROP_VERTICAL_DRAW_GRID: + etree->priv->vertical_draw_grid = g_value_get_boolean (value); if (etree->priv->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item), - "vertical_draw_grid", GTK_VALUE_BOOL (*arg), + "vertical_draw_grid", etree->priv->vertical_draw_grid, NULL); } break; - case ARG_DRAW_FOCUS: - etree->priv->draw_focus = GTK_VALUE_BOOL (*arg); + case PROP_DRAW_FOCUS: + etree->priv->draw_focus = g_value_get_boolean (value); if (etree->priv->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item), - "draw_focus", GTK_VALUE_BOOL (*arg), + "drawfocus", etree->priv->draw_focus, NULL); } break; - case ARG_UNIFORM_ROW_HEIGHT: - etree->priv->uniform_row_height = GTK_VALUE_BOOL (*arg); + case PROP_UNIFORM_ROW_HEIGHT: + etree->priv->uniform_row_height = g_value_get_boolean (value); if (etree->priv->item) { gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item), - "uniform_row_height", GTK_VALUE_BOOL (*arg), + "uniform_row_height", etree->priv->uniform_row_height, NULL); } break; - case ARG_ALWAYS_SEARCH: - if (etree->priv->always_search == GTK_VALUE_BOOL (*arg)) + case PROP_ALWAYS_SEARCH: + if (etree->priv->always_search == g_value_get_boolean (value)) return; - etree->priv->always_search = GTK_VALUE_BOOL (*arg); + etree->priv->always_search = g_value_get_boolean (value); clear_current_search_col (etree); break; } @@ -1872,14 +1879,16 @@ set_scroll_adjustments (ETree *tree, gtk_adjustment_changed(hadjustment); } - gtk_layout_set_hadjustment (GTK_LAYOUT(tree->priv->table_canvas), - hadjustment); - gtk_layout_set_vadjustment (GTK_LAYOUT(tree->priv->table_canvas), - vadjustment); - - if (tree->priv->header_canvas != NULL) - gtk_layout_set_hadjustment (GTK_LAYOUT(tree->priv->header_canvas), + if (tree->priv) { + gtk_layout_set_hadjustment (GTK_LAYOUT(tree->priv->table_canvas), hadjustment); + gtk_layout_set_vadjustment (GTK_LAYOUT(tree->priv->table_canvas), + vadjustment); + + if (tree->priv->header_canvas != NULL) + gtk_layout_set_hadjustment (GTK_LAYOUT(tree->priv->header_canvas), + hadjustment); + } } gint @@ -2586,12 +2595,12 @@ et_drag_begin (GtkWidget *widget, GdkDragContext *context, ETree *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_BEGIN], - et->priv->drag_row, - et->priv->drag_path, - et->priv->drag_col, - context); + g_signal_emit (et, + et_signals [TREE_DRAG_BEGIN], 0, + et->priv->drag_row, + et->priv->drag_path, + et->priv->drag_col, + context); } static void @@ -2599,12 +2608,12 @@ et_drag_end (GtkWidget *widget, GdkDragContext *context, ETree *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_END], - et->priv->drag_row, - et->priv->drag_path, - et->priv->drag_col, - context); + g_signal_emit (et, + et_signals [TREE_DRAG_END], 0, + et->priv->drag_row, + et->priv->drag_path, + et->priv->drag_col, + context); } static void @@ -2615,15 +2624,15 @@ et_drag_data_get(GtkWidget *widget, guint time, ETree *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_DATA_GET], - et->priv->drag_row, - et->priv->drag_path, - et->priv->drag_col, - context, - selection_data, - info, - time); + g_signal_emit (et, + et_signals [TREE_DRAG_DATA_GET], 0, + et->priv->drag_row, + et->priv->drag_path, + et->priv->drag_col, + context, + selection_data, + info, + time); } static void @@ -2631,12 +2640,12 @@ et_drag_data_delete(GtkWidget *widget, GdkDragContext *context, ETree *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_DATA_DELETE], - et->priv->drag_row, - et->priv->drag_path, - et->priv->drag_col, - context); + g_signal_emit (et, + et_signals [TREE_DRAG_DATA_DELETE], 0, + et->priv->drag_row, + et->priv->drag_path, + et->priv->drag_col, + context); } static gboolean @@ -2661,13 +2670,13 @@ do_drag_motion(ETree *et, &row, &col); if (row != et->priv->drop_row && col != et->priv->drop_col) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_LEAVE], - et->priv->drop_row, - et->priv->drop_path, - et->priv->drop_col, - context, - time); + g_signal_emit (et, + et_signals [TREE_DRAG_LEAVE], 0, + et->priv->drop_row, + et->priv->drop_path, + et->priv->drop_col, + context, + time); } path = e_tree_table_adapter_node_at_row(et->priv->etta, row); @@ -2676,16 +2685,16 @@ do_drag_motion(ETree *et, et->priv->drop_row = row; et->priv->drop_path = path; et->priv->drop_col = col; - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_MOTION], - et->priv->drop_row, - et->priv->drop_path, - et->priv->drop_col, - context, - x, - y, - time, - &ret_val); + g_signal_emit (et, + et_signals [TREE_DRAG_MOTION], 0, + et->priv->drop_row, + et->priv->drop_path, + et->priv->drop_col, + context, + x, + y, + time, + &ret_val); return ret_val; } @@ -2864,13 +2873,13 @@ et_drag_leave(GtkWidget *widget, guint time, ETree *et) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_LEAVE], - et->priv->drop_row, - et->priv->drop_path, - et->priv->drop_col, - context, - time); + g_signal_emit (et, + et_signals [TREE_DRAG_LEAVE], 0, + et->priv->drop_row, + et->priv->drop_path, + et->priv->drop_col, + context, + time); et->priv->drop_row = -1; et->priv->drop_col = -1; @@ -2953,38 +2962,38 @@ et_drag_drop(GtkWidget *widget, path = e_tree_sorted_view_to_model_path(et->priv->sorted, sorted_path); if (row != et->priv->drop_row && col != et->priv->drop_row) { - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_LEAVE], - et->priv->drop_row, - et->priv->drop_path, - et->priv->drop_col, - context, - time); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_MOTION], - row, - path, - col, - context, - x, - y, - time, - &ret_val); + g_signal_emit (et, + et_signals [TREE_DRAG_LEAVE], 0, + et->priv->drop_row, + et->priv->drop_path, + et->priv->drop_col, + context, + time); + g_signal_emit (et, + et_signals [TREE_DRAG_MOTION], 0, + row, + path, + col, + context, + x, + y, + time, + &ret_val); } et->priv->drop_row = row; et->priv->drop_path = path; et->priv->drop_col = col; - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_DROP], - et->priv->drop_row, - et->priv->drop_path, - et->priv->drop_col, - context, - x, - y, - time, - &ret_val); + g_signal_emit (et, + et_signals [TREE_DRAG_DROP], 0, + et->priv->drop_row, + et->priv->drop_path, + et->priv->drop_col, + context, + x, + y, + time, + &ret_val); et->priv->drop_row = -1; et->priv->drop_path = NULL; @@ -3017,35 +3026,35 @@ et_drag_data_received(GtkWidget *widget, &col); path = e_tree_table_adapter_node_at_row(et->priv->etta, row); path = e_tree_sorted_view_to_model_path(et->priv->sorted, path); - gtk_signal_emit (GTK_OBJECT (et), - et_signals [TREE_DRAG_DATA_RECEIVED], - row, - path, - col, - context, - x, - y, - selection_data, - info, - time); + g_signal_emit (et, + et_signals [TREE_DRAG_DATA_RECEIVED], 0, + row, + path, + col, + context, + x, + y, + selection_data, + info, + time); } static void e_tree_class_init (ETreeClass *class) { - GtkObjectClass *object_class; + GObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; - object_class = (GtkObjectClass *) class; + object_class = (GObjectClass *) class; widget_class = (GtkWidgetClass *) class; container_class = (GtkContainerClass *) class; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); - object_class->destroy = et_destroy; - object_class->set_arg = et_set_arg; - object_class->get_arg = et_get_arg; + object_class->dispose = et_dispose; + object_class->set_property = et_set_property; + object_class->get_property = et_get_property; widget_class->grab_focus = et_grab_focus; widget_class->unrealize = et_unrealize; @@ -3074,222 +3083,270 @@ e_tree_class_init (ETreeClass *class) class->tree_drag_data_received = NULL; et_signals [CURSOR_CHANGE] = - gtk_signal_new ("cursor_change", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, cursor_change), - e_marshal_NONE__INT_POINTER, - GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_POINTER); + g_signal_new ("cursor_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, cursor_change), + NULL, NULL, + e_marshal_NONE__INT_POINTER, + G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER); et_signals [CURSOR_ACTIVATED] = - gtk_signal_new ("cursor_activated", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, cursor_activated), - e_marshal_NONE__INT_POINTER, - GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_POINTER); + g_signal_new ("cursor_activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, cursor_activated), + NULL, NULL, + e_marshal_NONE__INT_POINTER, + G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER); et_signals [SELECTION_CHANGE] = - gtk_signal_new ("selection_change", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, selection_change), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("selection_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, selection_change), + NULL, NULL, + e_marshal_NONE__NONE, + G_TYPE_NONE, 0); et_signals [DOUBLE_CLICK] = - gtk_signal_new ("double_click", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, double_click), - e_marshal_NONE__INT_POINTER_INT_BOXED, - GTK_TYPE_NONE, 4, GTK_TYPE_INT, - GTK_TYPE_POINTER, GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("double_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, double_click), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_BOXED, + G_TYPE_NONE, 4, G_TYPE_INT, + G_TYPE_POINTER, G_TYPE_INT, GDK_TYPE_EVENT); et_signals [RIGHT_CLICK] = - gtk_signal_new ("right_click", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, right_click), - e_marshal_INT__INT_POINTER_INT_BOXED, - GTK_TYPE_INT, 4, GTK_TYPE_INT, GTK_TYPE_POINTER, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("right_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, right_click), + NULL, NULL, + e_marshal_INT__INT_POINTER_INT_BOXED, + G_TYPE_INT, 4, G_TYPE_INT, G_TYPE_POINTER, + G_TYPE_INT, GDK_TYPE_EVENT); et_signals [CLICK] = - gtk_signal_new ("click", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, click), - e_marshal_INT__INT_POINTER_INT_BOXED, - GTK_TYPE_INT, 4, GTK_TYPE_INT, GTK_TYPE_POINTER, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, click), + NULL, NULL, + e_marshal_INT__INT_POINTER_INT_BOXED, + G_TYPE_INT, 4, G_TYPE_INT, G_TYPE_POINTER, + G_TYPE_INT, GDK_TYPE_EVENT); et_signals [KEY_PRESS] = - gtk_signal_new ("key_press", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, key_press), - e_marshal_INT__INT_POINTER_INT_BOXED, - GTK_TYPE_INT, 4, GTK_TYPE_INT, GTK_TYPE_POINTER, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("key_press", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, key_press), + NULL, NULL, + e_marshal_INT__INT_POINTER_INT_BOXED, + G_TYPE_INT, 4, G_TYPE_INT, G_TYPE_POINTER, + G_TYPE_INT, GDK_TYPE_EVENT); et_signals [START_DRAG] = - gtk_signal_new ("start_drag", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, start_drag), - e_marshal_NONE__INT_POINTER_INT_BOXED, - GTK_TYPE_NONE, 4, GTK_TYPE_INT, GTK_TYPE_POINTER, - GTK_TYPE_INT, GDK_TYPE_EVENT); + g_signal_new ("start_drag", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, start_drag), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_BOXED, + G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_POINTER, + G_TYPE_INT, GDK_TYPE_EVENT); et_signals [STATE_CHANGE] = - gtk_signal_new ("state_change", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, state_change), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("state_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, state_change), + NULL, NULL, + e_marshal_NONE__NONE, + G_TYPE_NONE, 0); et_signals [WHITE_SPACE_EVENT] = - gtk_signal_new ("white_space_event", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, white_space_event), - gtk_marshal_INT__POINTER, - GTK_TYPE_INT, 1, GDK_TYPE_EVENT); + g_signal_new ("white_space_event", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, white_space_event), + NULL, NULL, + e_marshal_INT__POINTER, + G_TYPE_INT, 1, GDK_TYPE_EVENT); et_signals[TREE_DRAG_BEGIN] = - gtk_signal_new ("tree_drag_begin", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, tree_drag_begin), - e_marshal_NONE__INT_POINTER_INT_BOXED, - GTK_TYPE_NONE, 4, - GTK_TYPE_INT, - GTK_TYPE_POINTER, - GTK_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT); + g_signal_new ("tree_drag_begin", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_begin), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_BOXED, + G_TYPE_NONE, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT); et_signals[TREE_DRAG_END] = - gtk_signal_new ("tree_drag_end", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, tree_drag_end), - e_marshal_NONE__INT_POINTER_INT_BOXED, - GTK_TYPE_NONE, 4, - GTK_TYPE_INT, - GTK_TYPE_POINTER, - GTK_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT); + g_signal_new ("tree_drag_end", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_end), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_BOXED, + G_TYPE_NONE, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT); et_signals[TREE_DRAG_DATA_GET] = - gtk_signal_new ("tree_drag_data_get", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, tree_drag_data_get), - e_marshal_NONE__INT_POINTER_INT_OBJECT_BOXED_UINT_UINT, - GTK_TYPE_NONE, 7, - GTK_TYPE_INT, - GTK_TYPE_POINTER, - GTK_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT, - GTK_TYPE_SELECTION_DATA, - GTK_TYPE_UINT, - GTK_TYPE_UINT); + g_signal_new ("tree_drag_data_get", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_data_get), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_OBJECT_BOXED_UINT_UINT, + G_TYPE_NONE, 7, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT, + GTK_TYPE_SELECTION_DATA, + G_TYPE_UINT, + G_TYPE_UINT); et_signals[TREE_DRAG_DATA_DELETE] = - gtk_signal_new ("tree_drag_data_delete", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, tree_drag_data_delete), - e_marshal_NONE__INT_POINTER_INT_OBJECT, - GTK_TYPE_NONE, 4, - GTK_TYPE_INT, - GTK_TYPE_POINTER, - GTK_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT); - + g_signal_new ("tree_drag_data_delete", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_data_delete), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_OBJECT, + G_TYPE_NONE, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT); + et_signals[TREE_DRAG_LEAVE] = - gtk_signal_new ("tree_drag_leave", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, tree_drag_leave), - e_marshal_NONE__INT_POINTER_INT_OBJECT_UINT, - GTK_TYPE_NONE, 5, - GTK_TYPE_INT, - GTK_TYPE_POINTER, - GTK_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT, - GTK_TYPE_UINT); + g_signal_new ("tree_drag_leave", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_leave), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_OBJECT_UINT, + G_TYPE_NONE, 5, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT, + G_TYPE_UINT); et_signals[TREE_DRAG_MOTION] = - gtk_signal_new ("tree_drag_motion", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, tree_drag_motion), - e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT, - GTK_TYPE_BOOL, 7, - GTK_TYPE_INT, - GTK_TYPE_POINTER, - GTK_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT, - GTK_TYPE_INT, - GTK_TYPE_INT, - GTK_TYPE_UINT); + g_signal_new ("tree_drag_motion", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_motion), + NULL, NULL, + e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT, + G_TYPE_BOOLEAN, 7, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT, + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_UINT); et_signals[TREE_DRAG_DROP] = - gtk_signal_new ("tree_drag_drop", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, tree_drag_drop), - e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT, - GTK_TYPE_BOOL, 7, - GTK_TYPE_INT, - GTK_TYPE_POINTER, - GTK_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT, - GTK_TYPE_INT, - GTK_TYPE_INT, - GTK_TYPE_UINT); + g_signal_new ("tree_drag_drop", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_drop), + NULL, NULL, + e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT, + G_TYPE_BOOLEAN, 7, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT, + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_UINT); et_signals[TREE_DRAG_DATA_RECEIVED] = - gtk_signal_new ("tree_drag_data_received", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, tree_drag_data_received), - e_marshal_NONE__INT_POINTER_INT_OBJECT_INT_INT_BOXED_UINT_UINT, - GTK_TYPE_NONE, 9, - GTK_TYPE_INT, - GTK_TYPE_POINTER, - GTK_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT, - GTK_TYPE_INT, - GTK_TYPE_INT, - GTK_TYPE_SELECTION_DATA, - GTK_TYPE_UINT, - GTK_TYPE_UINT); - - E_OBJECT_CLASS_ADD_SIGNALS (object_class, et_signals, LAST_SIGNAL); + g_signal_new ("tree_drag_data_received", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_data_received), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_OBJECT_INT_INT_BOXED_UINT_UINT, + G_TYPE_NONE, 9, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT, + G_TYPE_INT, + G_TYPE_INT, + GTK_TYPE_SELECTION_DATA, + G_TYPE_UINT, + G_TYPE_UINT); class->set_scroll_adjustments = set_scroll_adjustments; widget_class->set_scroll_adjustments_signal = - gtk_signal_new ("set_scroll_adjustments", - GTK_RUN_LAST, - E_OBJECT_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (ETreeClass, set_scroll_adjustments), - e_marshal_NONE__POINTER_POINTER, - GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, - GTK_TYPE_ADJUSTMENT); - - gtk_object_add_arg_type ("ETree::length_threshold", GTK_TYPE_INT, - GTK_ARG_WRITABLE, ARG_LENGTH_THRESHOLD); - gtk_object_add_arg_type ("ETree::horizontal_draw_grid", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_HORIZONTAL_DRAW_GRID); - gtk_object_add_arg_type ("ETree::vertical_draw_grid", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_VERTICAL_DRAW_GRID); - gtk_object_add_arg_type ("ETree::draw_focus", GTK_TYPE_BOOL, - GTK_ARG_WRITABLE, ARG_DRAW_FOCUS); - gtk_object_add_arg_type ("ETree::ETreeTableAdapter", GTK_TYPE_OBJECT, - GTK_ARG_READABLE, ARG_ETTA); - gtk_object_add_arg_type ("ETree::uniform_row_height", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_UNIFORM_ROW_HEIGHT); - gtk_object_add_arg_type ("ETree::always_search", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_ALWAYS_SEARCH); + g_signal_new ("set_scroll_adjustments", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, set_scroll_adjustments), + NULL, NULL, + e_marshal_NONE__POINTER_POINTER, + G_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, + GTK_TYPE_ADJUSTMENT); + + g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD, + g_param_spec_int ("length_threshold", + _( "Length Threshold" ), + _( "Length Threshold" ), + 0, G_MAXINT, 0, + G_PARAM_WRITABLE)); + g_object_class_install_property (object_class, PROP_HORIZONTAL_DRAW_GRID, + g_param_spec_boolean ("horizontal_draw_grid", + _( "Horizontal Draw Grid" ), + _( "Horizontal Draw Grid" ), + FALSE, + G_PARAM_WRITABLE)); + g_object_class_install_property (object_class, PROP_VERTICAL_DRAW_GRID, + g_param_spec_boolean ("vertical_draw_grid", + _( "Vertical Draw Grid" ), + _( "Vertical Draw Grid" ), + FALSE, + G_PARAM_WRITABLE)); + g_object_class_install_property (object_class, PROP_DRAW_FOCUS, + g_param_spec_boolean ("drawfocus", + _( "Draw focus" ), + _( "Draw focus" ), + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property (object_class, PROP_ETTA, + g_param_spec_object ("ETreeTableAdapter", + _( "ETree table adapter" ), + _( "ETree table adapter" ), + E_TREE_TABLE_ADAPTER_TYPE, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT, + g_param_spec_boolean ("uniform_row_height", + _( "Uniform row height" ), + _( "Uniform row height" ), + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_ALWAYS_SEARCH, + g_param_spec_boolean ("always_search", + _( "Always search" ), + _( "Always search" ), + FALSE, + G_PARAM_READWRITE)); } E_MAKE_TYPE(e_tree, "ETree", ETree, e_tree_class_init, e_tree_init, PARENT_TYPE) diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h index c66311b1c3..21a755fb3a 100644 --- a/widgets/table/e-tree.h +++ b/widgets/table/e-tree.h @@ -45,10 +45,10 @@ G_BEGIN_DECLS #define E_TREE_TYPE (e_tree_get_type ()) -#define E_TREE(o) (GTK_CHECK_CAST ((o), E_TREE_TYPE, ETree)) -#define E_TREE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TREE_TYPE, ETreeClass)) -#define E_IS_TREE(o) (GTK_CHECK_TYPE ((o), E_TREE_TYPE)) -#define E_IS_TREE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TREE_TYPE)) +#define E_TREE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_TYPE, ETree)) +#define E_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_TYPE, ETreeClass)) +#define E_IS_TREE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_TYPE)) +#define E_IS_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_TYPE)) typedef struct _ETreeDragSourceSite ETreeDragSourceSite; typedef struct ETreePriv ETreePriv; @@ -136,7 +136,7 @@ typedef struct { guint time); } ETreeClass; -GtkType e_tree_get_type (void); +GType e_tree_get_type (void); ETree *e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, diff --git a/widgets/table/test-check.c b/widgets/table/test-check.c index 2c0c4f72e9..7fe4c126e6 100644 --- a/widgets/table/test-check.c +++ b/widgets/table/test-check.c @@ -193,8 +193,8 @@ check_test (void) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); canvas = e_canvas_new (); - gtk_signal_connect (GTK_OBJECT (canvas), "size_allocate", - GTK_SIGNAL_FUNC (set_canvas_size), NULL); + g_signal_connect (canvas, "size_allocate", + G_CALLBACK (set_canvas_size), NULL); gtk_container_add (GTK_CONTAINER (window), canvas); gtk_widget_show_all (window); diff --git a/widgets/table/test-cols.c b/widgets/table/test-cols.c index 6fd0059f4b..e4873633e5 100644 --- a/widgets/table/test-cols.c +++ b/widgets/table/test-cols.c @@ -212,8 +212,8 @@ multi_cols_test (void) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); canvas = e_canvas_new (); - gtk_signal_connect (GTK_OBJECT (canvas), "size_allocate", - GTK_SIGNAL_FUNC (set_canvas_size), NULL); + g_signal_connect (canvas, "size_allocate", + G_CALLBACK (set_canvas_size), NULL); gtk_container_add (GTK_CONTAINER (window), canvas); gtk_widget_show_all (window); diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c index 9ef77c6c2d..b44b62bf42 100644 --- a/widgets/table/test-table.c +++ b/widgets/table/test-table.c @@ -303,8 +303,8 @@ table_browser_test (void) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); canvas = e_canvas_new (); - gtk_signal_connect (GTK_OBJECT (canvas), "size_allocate", - GTK_SIGNAL_FUNC (set_canvas_size), NULL); + g_signal_connect (canvas, "size_allocate", + G_CALLBACK (set_canvas_size), NULL); gtk_container_add (GTK_CONTAINER (window), canvas); gtk_widget_show_all (window); @@ -359,8 +359,8 @@ toggle_grid (void *nothing, ETable *etable) { static gboolean shown; - gtk_object_get (GTK_OBJECT (etable), "drawgrid", &shown, NULL); - gtk_object_set (GTK_OBJECT (etable), "drawgrid", !shown, NULL); + g_object_get (etable, "drawgrid", &shown, NULL); + g_object_set (etable, "drawgrid", !shown, NULL); } static void @@ -411,17 +411,17 @@ compare=\"string\"/>\n", i, column_labels[i]); e_table = e_table_new (e_table_model, NULL, spec->str, state); /* This makes value_at not called just to determine row height. */ - gtk_object_set (GTK_OBJECT (e_table), - "uniform_row_height", 1, - NULL); + g_object_set (e_table, + "uniform_row_height", 1, + NULL); g_string_free (spec, TRUE); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); frame = gtk_frame_new (NULL); #ifdef BIT_ROT - gtk_signal_connect (GTK_OBJECT(e_table), "row_selection", - GTK_SIGNAL_FUNC(row_selection_test), NULL); + g_signal_connect (e_table, "row_selection", + G_CALLBACK(row_selection_test), NULL); #endif vbox = gtk_vbox_new (FALSE, 0); @@ -434,13 +434,13 @@ compare=\"string\"/>\n", i, column_labels[i]); * gadgets */ button = gtk_button_new_with_label ("Save spec"); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (save_spec), e_table); + g_signal_connect (button, "clicked", + G_CALLBACK (save_spec), e_table); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); bhide = gtk_button_new_with_label ("Toggle Grid"); - gtk_signal_connect (GTK_OBJECT (bhide), "clicked", - GTK_SIGNAL_FUNC (toggle_grid), e_table); + g_signal_connect (bhide, "clicked", + G_CALLBACk (toggle_grid), e_table); gtk_box_pack_start (GTK_BOX (vbox), bhide, FALSE, FALSE, 0); #endif |