diff options
author | Christopher James Lahey <clahey@ximian.com> | 2002-02-13 21:03:48 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2002-02-13 21:03:48 +0800 |
commit | 9c5cceeeb803194ebc6ae450b038e4041c582afd (patch) | |
tree | 5fcfef60528973efc0ad67e56166a917069dd2fd | |
parent | 926cc83a341feadd27be90c183b0346691f82363 (diff) | |
download | gsoc2013-evolution-9c5cceeeb803194ebc6ae450b038e4041c582afd.tar.gz gsoc2013-evolution-9c5cceeeb803194ebc6ae450b038e4041c582afd.tar.zst gsoc2013-evolution-9c5cceeeb803194ebc6ae450b038e4041c582afd.zip |
New signal for when the width of the column changes.
2002-02-13 Christopher James Lahey <clahey@ximian.com>
* gal/widgets/e-reflow.c, gal/widgets/e-reflow.h
(column_width_changed): New signal for when the width of the
column changes.
* gal/util/e-util.c, gal/util/e-util.h (e_marshal_NONE__DOUBLE):
New marshaller.
From gal/menus/ChangeLog:
2002-02-13 Christopher James Lahey <clahey@ximian.com>
* gal-view-etable.c (detach_table): Set
view->table_state_changed_id to 0.
(detach_tree): Set view->tree_state_changed_id to 0.
svn path=/trunk/; revision=15705
-rw-r--r-- | e-util/e-util.c | 18 | ||||
-rw-r--r-- | e-util/e-util.h | 4 | ||||
-rw-r--r-- | widgets/menus/gal-view-etable.c | 2 | ||||
-rw-r--r-- | widgets/misc/e-reflow.c | 21 | ||||
-rw-r--r-- | widgets/misc/e-reflow.h | 1 |
5 files changed, 46 insertions, 0 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c index 6d4b5e915a..2916a2d18b 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -816,6 +816,24 @@ e_marshal_INT__OBJECT_POINTER (GtkObject *object, func_data); } +typedef void (*GtkSignal_NONE__DOUBLE) (GtkObject *, + gdouble, + gpointer user_data); +void +e_marshal_NONE__DOUBLE (GtkObject *object, + GtkSignalFunc func, + gpointer func_data, + GtkArg *args) +{ + GtkSignal_NONE__DOUBLE rfunc; + + rfunc = (GtkSignal_NONE__DOUBLE) func; + + (*rfunc) (object, + GTK_VALUE_DOUBLE (args[0]), + func_data); +} + gchar** e_strsplit (const gchar *string, const gchar *delimiter, diff --git a/e-util/e-util.h b/e-util/e-util.h index 623300f8a1..37b9a75b9f 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -273,6 +273,10 @@ void e_marshal_INT__OBJECT_POINTER (GtkO GtkSignalFunc func, gpointer func_data, GtkArg *args); +void e_marshal_NONE__DOUBLE (GtkObject *object, + GtkSignalFunc func, + gpointer func_data, + GtkArg *args); #ifdef __cplusplus diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c index 87351866bd..f81482435d 100644 --- a/widgets/menus/gal-view-etable.c +++ b/widgets/menus/gal-view-etable.c @@ -38,6 +38,7 @@ detach_table (GalViewEtable *view) if (view->table_state_changed_id) { gtk_signal_disconnect (GTK_OBJECT (view->table), view->table_state_changed_id); + view->table_state_changed_id = 0; } gtk_object_unref (GTK_OBJECT (view->table)); view->table = NULL; @@ -51,6 +52,7 @@ detach_tree (GalViewEtable *view) if (view->tree_state_changed_id) { gtk_signal_disconnect (GTK_OBJECT (view->tree), view->tree_state_changed_id); + view->tree_state_changed_id = 0; } gtk_object_unref (GTK_OBJECT (view->tree)); view->tree = NULL; diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c index ed83956232..f628dec126 100644 --- a/widgets/misc/e-reflow.c +++ b/widgets/misc/e-reflow.c @@ -68,6 +68,7 @@ enum { enum { SELECTION_EVENT, + COLUMN_WIDTH_CHANGED, LAST_SIGNAL }; @@ -569,6 +570,12 @@ disconnect_set_adjustment (EReflow *reflow) } } +static void +column_width_changed (EReflow *reflow) +{ + gtk_signal_emit (GTK_OBJECT (reflow), signals[COLUMN_WIDTH_CHANGED], reflow->column_width); +} + @@ -606,6 +613,7 @@ e_reflow_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) case ARG_COLUMN_WIDTH: if (reflow->column_width != GTK_VALUE_INT (*arg)) { GtkAdjustment *adjustment = gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)); + double old_width = reflow->column_width; reflow->column_width = GTK_VALUE_INT (*arg); adjustment->step_increment = (reflow->column_width + E_REFLOW_FULL_GUTTER) / 2; @@ -616,6 +624,9 @@ e_reflow_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) reflow->need_column_resize = TRUE; gnome_canvas_item_request_update(item); + + if (old_width != reflow->column_width) + column_width_changed (reflow); } break; } @@ -874,6 +885,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) gtk_adjustment_changed(adjustment); e_reflow_resize_children(item); e_canvas_item_request_reflow(item); + column_width_changed (reflow); } reflow->need_column_resize = TRUE; gnome_canvas_item_request_update(item); @@ -1262,6 +1274,14 @@ e_reflow_class_init (EReflowClass *klass) e_marshal_INT__OBJECT_POINTER, GTK_TYPE_INT, 2, GTK_TYPE_OBJECT, GTK_TYPE_GDK_EVENT); + signals [COLUMN_WIDTH_CHANGED] = + gtk_signal_new ("column_width_changed", + GTK_RUN_LAST, + E_OBJECT_CLASS_TYPE (object_class), + GTK_SIGNAL_OFFSET (EReflowClass, column_width_changed), + e_marshal_NONE__DOUBLE, + GTK_TYPE_NONE, 1, GTK_TYPE_DOUBLE); + E_OBJECT_CLASS_ADD_SIGNALS (object_class, signals, LAST_SIGNAL); object_class->set_arg = e_reflow_set_arg; @@ -1277,6 +1297,7 @@ e_reflow_class_init (EReflowClass *klass) item_class->point = e_reflow_point; klass->selection_event = e_reflow_selection_event_real; + klass->column_width_changed = NULL; } static void diff --git a/widgets/misc/e-reflow.h b/widgets/misc/e-reflow.h index 5b699431cc..0aed25945c 100644 --- a/widgets/misc/e-reflow.h +++ b/widgets/misc/e-reflow.h @@ -121,6 +121,7 @@ struct _EReflowClass GnomeCanvasGroupClass parent_class; int (*selection_event) (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event); + void (*column_width_changed) (EReflow *reflow, double width); }; /* |