From 68b8639345327b84e0e524d29539e0aefbbfe3a1 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sun, 17 Nov 2002 05:40:18 +0000 Subject: fix c&p typo. 2002-11-16 Chris Toshok * gal/widgets/e-reflow.c (e_reflow_class_init): fix c&p typo. * gal/widgets/e-categories-master-list-dialog.c: switch to GtkDialogism's. * gal/widgets/gal-categories.[ch]: same. * gal/widgets/e-categories-master-list-dialog.glade: libglade-convert. * gal/widgets/e-categories.glade: same. * gal/util/e-text-event-processor.[ch]: subclass this from GObject. * gal/util/e-text-event-processor-emacs-like.[ch]: clean up the gtk cruft a bit. * gal/e-text/e-text.c (_get_tep): remove the _sink call. (e_text_init): same. * gal/e-text/e-text-model.[ch]: subclass this from GObject instead of GtkObject. svn path=/trunk/; revision=18808 --- widgets/misc/e-reflow.c | 2 +- widgets/misc/gal-categories.glade | 341 +++++++++++++++++--------------------- widgets/text/e-text-model.c | 50 +++--- widgets/text/e-text-model.h | 13 +- widgets/text/e-text.c | 2 - 5 files changed, 185 insertions(+), 223 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c index a35744c31b..d92b2335d0 100644 --- a/widgets/misc/e-reflow.c +++ b/widgets/misc/e-reflow.c @@ -1321,7 +1321,7 @@ e_reflow_class_init (EReflowClass *klass) E_REFLOW_MODEL_TYPE, G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_WIDTH, + g_object_class_install_property (object_class, PROP_COLUMN_WIDTH, g_param_spec_double ("column_width", _( "Column width" ), _( "Column width" ), diff --git a/widgets/misc/gal-categories.glade b/widgets/misc/gal-categories.glade index 42141d466d..98286545b3 100644 --- a/widgets/misc/gal-categories.glade +++ b/widgets/misc/gal-categories.glade @@ -1,197 +1,168 @@ - - + + - - categories - categories - - src - pixmaps - C - True - False - False - False - False - False - True - gal-categories.glade.h - + + + no + categories + GTK_WINDOW_TOPLEVEL + no + no + yes + GTK_WIN_POS_NONE - - GnomeDialog - categories - False - categories - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - False - False + + + no + 8 + yes - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - + + + GTK_BUTTONBOX_END + 8 + yes - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - + + + yes + yes + yes + gtk-ok + yes + yes + + - - GtkButton - button3 - True - True - GNOME_STOCK_BUTTON_OK - + + + yes + yes + yes + gtk-cancel + yes + yes + + + + + 0 + no + yes + GTK_PACK_END + + - - GtkButton - button4 - True - True - GNOME_STOCK_BUTTON_CANCEL - - + + + no + 0 + 0 + 5 + 1 + yes - - GtkTable - table-categories - 5 - 1 - False - 0 - 0 - - 0 - True - True - + + + yes + yes + + 0 + yes + yes + + + 0 + 1 + 1 + 2 + 0 + 0 + expand|fill + + + - - GtkEntry - entry-categories - True - True - True - 0 - - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - + + + Item(s) belong to these _categories: + GTK_JUSTIFY_CENTER + no + 0 + 0.5 + 0 + 0 + entry-categories + yes + yes + + + 0 + 1 + 0 + 1 + 0 + 0 + fill + + + - - GtkLabel - label-header - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-categories - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - + + + _Available Categories: + GTK_JUSTIFY_CENTER + no + 0 + 0.5 + 0 + 0 + yes + yes + + + 0 + 1 + 2 + 3 + 0 + 0 + fill + + + - - GtkLabel - label2 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - + + + yes + Edit Master Category List... + GTK_RELIEF_NORMAL + yes + + + 0 + 1 + 4 + 5 + 0 + 0 + expand|fill + fill + + + + + 0 + yes + yes + + - - - GtkButton - button-ecmld - True - - GTK_RELIEF_NORMAL - - 0 - 1 - 4 - 5 - 0 - 0 - True - False - False - False - True - True - - - + + 4 + yes + yes + + - - - + diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c index b7287156f5..0233f14aa7 100644 --- a/widgets/text/e-text-model.c +++ b/widgets/text/e-text-model.c @@ -32,8 +32,6 @@ #include "e-text-model.h" #include "gal/util/e-util.h" -#define CLASS(obj) (E_TEXT_MODEL_CLASS (GTK_OBJECT_GET_CLASS (obj))) - #define MAX_LENGTH (2047) enum { @@ -63,8 +61,8 @@ static void e_text_model_real_insert (ETextModel *model, gint static void e_text_model_real_insert_length (ETextModel *model, gint postion, const gchar *text, gint length); static void e_text_model_real_delete (ETextModel *model, gint postion, gint length); -#define PARENT_TYPE GTK_TYPE_OBJECT -static GtkObject *parent_class; +#define PARENT_TYPE G_TYPE_OBJECT +static GObject *parent_class; @@ -354,8 +352,8 @@ e_text_model_changed (ETextModel *model) While this method could, in theory, do pretty much anything, it is meant for scanning objects and converting substrings into embedded objects. */ - if (CLASS (model)->objectify) - CLASS (model)->objectify (model); + if (E_TEXT_MODEL_GET_CLASS (model)->objectify) + E_TEXT_MODEL_GET_CLASS (model)->objectify (model); g_signal_emit (model, e_text_model_signals[E_TEXT_MODEL_CHANGED], 0); @@ -387,8 +385,8 @@ e_text_model_validate_position (ETextModel *model, gint pos) g_return_val_if_fail (model != NULL, 0); g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); - if (CLASS (model)->validate_pos) - pos = CLASS (model)->validate_pos (model, pos); + if (E_TEXT_MODEL_GET_CLASS (model)->validate_pos) + pos = E_TEXT_MODEL_GET_CLASS (model)->validate_pos (model, pos); return pos; } @@ -399,8 +397,8 @@ e_text_model_get_text (ETextModel *model) g_return_val_if_fail (model != NULL, NULL); g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL); - if (CLASS (model)->get_text) - return CLASS (model)->get_text (model); + if (E_TEXT_MODEL_GET_CLASS (model)->get_text) + return E_TEXT_MODEL_GET_CLASS (model)->get_text (model); return ""; } @@ -411,9 +409,9 @@ e_text_model_get_text_length (ETextModel *model) g_return_val_if_fail (model != NULL, 0); g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); - if (CLASS (model)->get_text_len (model)) { + if (E_TEXT_MODEL_GET_CLASS (model)->get_text_len (model)) { - gint len = CLASS (model)->get_text_len (model); + gint len = E_TEXT_MODEL_GET_CLASS (model)->get_text_len (model); #ifdef PARANOID_DEBUGGING const gchar *str = e_text_model_get_text (model); @@ -437,8 +435,8 @@ e_text_model_set_text (ETextModel *model, const gchar *text) g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); - if (CLASS (model)->set_text) - CLASS (model)->set_text (model, text); + if (E_TEXT_MODEL_GET_CLASS (model)->set_text) + E_TEXT_MODEL_GET_CLASS (model)->set_text (model, text); } void @@ -450,8 +448,8 @@ e_text_model_insert (ETextModel *model, gint position, const gchar *text) if (text == NULL) return; - if (CLASS (model)->insert) - CLASS (model)->insert (model, position, text); + if (E_TEXT_MODEL_GET_CLASS (model)->insert) + E_TEXT_MODEL_GET_CLASS (model)->insert (model, position, text); } void @@ -465,8 +463,8 @@ e_text_model_insert_length (ETextModel *model, gint position, const gchar *text, if (text == NULL || length == 0) return; - if (CLASS (model)->insert_length) - CLASS (model)->insert_length (model, position, text, length); + if (E_TEXT_MODEL_GET_CLASS (model)->insert_length) + E_TEXT_MODEL_GET_CLASS (model)->insert_length (model, position, text, length); } void @@ -509,8 +507,8 @@ e_text_model_delete (ETextModel *model, gint position, gint length) if (length <= 0) return; - if (CLASS (model)->delete) - CLASS (model)->delete (model, position, length); + if (E_TEXT_MODEL_GET_CLASS (model)->delete) + E_TEXT_MODEL_GET_CLASS (model)->delete (model, position, length); } gint @@ -519,8 +517,8 @@ e_text_model_object_count (ETextModel *model) g_return_val_if_fail (model != NULL, 0); g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); - if (CLASS (model)->obj_count) - return CLASS (model)->obj_count (model); + if (E_TEXT_MODEL_GET_CLASS (model)->obj_count) + return E_TEXT_MODEL_GET_CLASS (model)->obj_count (model); return 0; } @@ -534,8 +532,8 @@ e_text_model_get_nth_object (ETextModel *model, gint n, gint *len) if (n < 0 || n >= e_text_model_object_count (model)) return NULL; - if (CLASS (model)->get_nth_obj) - return CLASS (model)->get_nth_obj (model, n, len); + if (E_TEXT_MODEL_GET_CLASS (model)->get_nth_obj) + return E_TEXT_MODEL_GET_CLASS (model)->get_nth_obj (model, n, len); return NULL; } @@ -584,9 +582,9 @@ e_text_model_get_object_at_offset (ETextModel *model, gint offset) return -1; /* If an optimized version has been provided, we use it. */ - if (CLASS (model)->obj_at_offset) { + if (E_TEXT_MODEL_GET_CLASS (model)->obj_at_offset) { - return CLASS (model)->obj_at_offset (model, offset); + return E_TEXT_MODEL_GET_CLASS (model)->obj_at_offset (model, offset); } else { /* If not, we fake it.*/ diff --git a/widgets/text/e-text-model.h b/widgets/text/e-text-model.h index c79376d9d0..2e472ead44 100644 --- a/widgets/text/e-text-model.h +++ b/widgets/text/e-text-model.h @@ -34,6 +34,7 @@ G_BEGIN_DECLS #define E_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_TEXT_MODEL, ETextModelClass)) #define E_IS_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_TEXT_MODEL)) #define E_IS_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_TEXT_MODEL)) +#define E_TEXT_MODEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_TYPE_TEXT_MODEL_TYPE, ETextModelClass)) typedef struct _ETextModel ETextModel; typedef struct _ETextModelClass ETextModelClass; @@ -43,13 +44,13 @@ struct _ETextModelPrivate; typedef gint (*ETextModelReposFn) (gint, gpointer); struct _ETextModel { - GtkObject item; + GObject item; struct _ETextModelPrivate *priv; }; struct _ETextModelClass { - GtkObjectClass parent_class; + GObjectClass parent_class; /* Signal */ void (* changed) (ETextModel *model); @@ -74,7 +75,7 @@ struct _ETextModelClass { gint (* obj_at_offset) (ETextModel *model, gint offset); }; -GtkType e_text_model_get_type (void); +GType e_text_model_get_type (void); ETextModel *e_text_model_new (void); @@ -107,12 +108,6 @@ gint e_text_model_get_object_at_offset (ETextModel *model, gint offset) gint e_text_model_get_object_at_pointer (ETextModel *model, const gchar *c); void e_text_model_activate_nth_object (ETextModel *model, gint n); - - - - - - G_END_DECLS #endif diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 237818f624..937812d0c6 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -1680,7 +1680,6 @@ _get_tep(EText *text) if (!text->tep) { text->tep = e_text_event_processor_emacs_like_new(); g_object_ref (text->tep); - gtk_object_sink (GTK_OBJECT (text->tep)); text->tep_command_id = g_signal_connect (text->tep, "command", @@ -4305,7 +4304,6 @@ e_text_init (EText *text) text->revert = NULL; g_object_ref (text->model); - gtk_object_sink (GTK_OBJECT (text->model)); text->model_changed_signal_id = g_signal_connect (text->model, -- cgit v1.2.3