diff options
author | Chris Toshok <toshok@ximian.com> | 2002-11-17 13:40:18 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-11-17 13:40:18 +0800 |
commit | 68b8639345327b84e0e524d29539e0aefbbfe3a1 (patch) | |
tree | 0f2a3eb2bac9b8c3ac78d5f85c3441f1268b9aa1 /widgets | |
parent | a01751b83a74b5f9f42e5f960b2cdb20e546133b (diff) | |
download | gsoc2013-evolution-68b8639345327b84e0e524d29539e0aefbbfe3a1.tar gsoc2013-evolution-68b8639345327b84e0e524d29539e0aefbbfe3a1.tar.gz gsoc2013-evolution-68b8639345327b84e0e524d29539e0aefbbfe3a1.tar.bz2 gsoc2013-evolution-68b8639345327b84e0e524d29539e0aefbbfe3a1.tar.lz gsoc2013-evolution-68b8639345327b84e0e524d29539e0aefbbfe3a1.tar.xz gsoc2013-evolution-68b8639345327b84e0e524d29539e0aefbbfe3a1.tar.zst gsoc2013-evolution-68b8639345327b84e0e524d29539e0aefbbfe3a1.zip |
fix c&p typo.
2002-11-16 Chris Toshok <toshok@ximian.com>
* 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
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/e-reflow.c | 2 | ||||
-rw-r--r-- | widgets/misc/gal-categories.glade | 341 | ||||
-rw-r--r-- | widgets/text/e-text-model.c | 50 | ||||
-rw-r--r-- | widgets/text/e-text-model.h | 13 | ||||
-rw-r--r-- | widgets/text/e-text.c | 2 |
5 files changed, 185 insertions, 223 deletions
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 @@ -<?xml version="1.0"?> -<GTK-Interface> +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" > -<project> - <name>categories</name> - <program_name>categories</program_name> - <directory></directory> - <source_directory>src</source_directory> - <pixmaps_directory>pixmaps</pixmaps_directory> - <language>C</language> - <gnome_support>True</gnome_support> - <gettext_support>False</gettext_support> - <output_main_file>False</output_main_file> - <output_support_files>False</output_support_files> - <output_build_files>False</output_build_files> - <backup_source_files>False</backup_source_files> - <output_translatable_strings>True</output_translatable_strings> - <translatable_strings_file>gal-categories.glade.h</translatable_strings_file> -</project> +<glade-interface> + <widget class="GtkDialog" id="categories"> + <property name="visible">no</property> + <property name="title" translatable="yes">categories</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> -<widget> - <class>GnomeDialog</class> - <name>categories</name> - <visible>False</visible> - <title>categories</title> - <type>GTK_WINDOW_TOPLEVEL</type> - <position>GTK_WIN_POS_NONE</position> - <modal>False</modal> - <allow_shrink>False</allow_shrink> - <allow_grow>True</allow_grow> - <auto_shrink>False</auto_shrink> - <auto_close>False</auto_close> - <hide_on_close>False</hide_on_close> + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox1"> + <property name="homogeneous">no</property> + <property name="spacing">8</property> + <property name="visible">yes</property> - <widget> - <class>GtkVBox</class> - <child_name>GnomeDialog:vbox</child_name> - <name>dialog-vbox1</name> - <homogeneous>False</homogeneous> - <spacing>8</spacing> - <child> - <padding>4</padding> - <expand>True</expand> - <fill>True</fill> - </child> + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area1"> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <property name="spacing">8</property> + <property name="visible">yes</property> - <widget> - <class>GtkHButtonBox</class> - <child_name>GnomeDialog:action_area</child_name> - <name>dialog-action_area1</name> - <layout_style>GTK_BUTTONBOX_END</layout_style> - <spacing>8</spacing> - <child_min_width>85</child_min_width> - <child_min_height>27</child_min_height> - <child_ipad_x>7</child_ipad_x> - <child_ipad_y>0</child_ipad_y> - <child> - <padding>0</padding> - <expand>False</expand> - <fill>True</fill> - <pack>GTK_PACK_END</pack> - </child> + <child> + <widget class="GtkButton" id="button3"> + <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> - <widget> - <class>GtkButton</class> - <name>button3</name> - <can_default>True</can_default> - <can_focus>True</can_focus> - <stock_button>GNOME_STOCK_BUTTON_OK</stock_button> - </widget> + <child> + <widget class="GtkButton" id="button4"> + <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> - <widget> - <class>GtkButton</class> - <name>button4</name> - <can_default>True</can_default> - <can_focus>True</can_focus> - <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button> - </widget> - </widget> + <child> + <widget class="GtkTable" id="table-categories"> + <property name="homogeneous">no</property> + <property name="row_spacing">0</property> + <property name="column_spacing">0</property> + <property name="n-rows">5</property> + <property name="n-columns">1</property> + <property name="visible">yes</property> - <widget> - <class>GtkTable</class> - <name>table-categories</name> - <rows>5</rows> - <columns>1</columns> - <homogeneous>False</homogeneous> - <row_spacing>0</row_spacing> - <column_spacing>0</column_spacing> - <child> - <padding>0</padding> - <expand>True</expand> - <fill>True</fill> - </child> + <child> + <widget class="GtkEntry" id="entry-categories"> + <property name="can_focus">yes</property> + <property name="editable">yes</property> + <property name="text" translatable="yes"></property> + <property name="max-length">0</property> + <property name="visibility">yes</property> + <property name="visible">yes</property> + </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"></property> + </packing> + </child> - <widget> - <class>GtkEntry</class> - <name>entry-categories</name> - <can_focus>True</can_focus> - <editable>True</editable> - <text_visible>True</text_visible> - <text_max_length>0</text_max_length> - <text></text> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>1</top_attach> - <bottom_attach>2</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>True</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> + <child> + <widget class="GtkLabel" id="label-header"> + <property name="label" translatable="yes">Item(s) belong to these _categories:</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="mnemonic_widget">entry-categories</property> + <property name="visible">yes</property> + <property name="use_underline">yes</property> + </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> - <widget> - <class>GtkLabel</class> - <name>label-header</name> - <label>Item(s) belong to these _categories:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - <focus_target>entry-categories</focus_target> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>0</top_attach> - <bottom_attach>1</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> + <child> + <widget class="GtkLabel" id="label2"> + <property name="label" translatable="yes">_Available Categories:</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> + <property name="use_underline">yes</property> + </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> - <widget> - <class>GtkLabel</class> - <name>label2</name> - <label>_Available Categories:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>2</top_attach> - <bottom_attach>3</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> + <child> + <widget class="GtkButton" id="button-ecmld"> + <property name="can_focus">yes</property> + <property name="label" translatable="yes">Edit Master Category List...</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="visible">yes</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</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> - - <widget> - <class>GtkButton</class> - <name>button-ecmld</name> - <can_focus>True</can_focus> - <label>Edit Master Category List...</label> - <relief>GTK_RELIEF_NORMAL</relief> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>4</top_attach> - <bottom_attach>5</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>True</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>True</yfill> - </child> - </widget> - </widget> + <packing> + <property name="padding">4</property> + <property name="expand">yes</property> + <property name="fill">yes</property> + </packing> + </child> </widget> -</widget> - -</GTK-Interface> +</glade-interface> 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, |