diff options
author | Christopher James Lahey <clahey@ximian.com> | 2002-03-16 07:16:01 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2002-03-16 07:16:01 +0800 |
commit | 88a322f15d8ce9c152cce75630b302b8b3ca1c08 (patch) | |
tree | 6aaa3c7ba15024c4f3e1fe1d47aea1c3f6746484 /widgets/misc/e-canvas.c | |
parent | f8f95421a6e00884da54c9da66d6c0b0edc00e29 (diff) | |
download | gsoc2013-evolution-88a322f15d8ce9c152cce75630b302b8b3ca1c08.tar.gz gsoc2013-evolution-88a322f15d8ce9c152cce75630b302b8b3ca1c08.tar.zst gsoc2013-evolution-88a322f15d8ce9c152cce75630b302b8b3ca1c08.zip |
Check for a style_set signal on all the contained GnomeCanvasItems.
2002-03-15 Christopher James Lahey <clahey@ximian.com>
* gal/widgets/e-canvas.c (e_canvas_style_set): Check for a
style_set signal on all the contained GnomeCanvasItems.
From gal/e-table/ChangeLog:
2002-03-15 Christopher James Lahey <clahey@ximian.com>
* e-cell-toggle.c: Clear the pixmap cache in e_cell_style_set.
* e-cell.c, e-cell.h (e_cell_style_set): Added this virtual
method.
* e-table-item.c, e-table-item.h: Call e_cell_style_set in out
style_set signal.
svn path=/trunk/; revision=16180
Diffstat (limited to 'widgets/misc/e-canvas.c')
-rw-r--r-- | widgets/misc/e-canvas.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 0b9c00261a..7afdd21073 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -44,6 +44,9 @@ static gint e_canvas_focus_in (GtkWidget *widget, static gint e_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event); +static void e_canvas_style_set (GtkWidget *widget, + GtkStyle *previous_style); + static int emit_event (GnomeCanvas *canvas, GdkEvent *event); static GnomeCanvasClass *parent_class = NULL; @@ -101,6 +104,7 @@ e_canvas_class_init (ECanvasClass *klass) widget_class->button_release_event = e_canvas_button; widget_class->focus_in_event = e_canvas_focus_in; widget_class->focus_out_event = e_canvas_focus_out; + widget_class->style_set = e_canvas_style_set; widget_class->realize = e_canvas_realize; widget_class->unrealize = e_canvas_unrealize; @@ -667,6 +671,32 @@ e_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event) } static void +ec_style_set_recursive (GnomeCanvasItem *item, GtkStyle *previous_style) +{ + guint signal_id = gtk_signal_lookup ("style_set", GTK_OBJECT_TYPE (item)); + if (signal_id >= 1) { + GtkSignalQuery *query = gtk_signal_query (signal_id); + if (query->return_val == GTK_TYPE_NONE && query->nparams == 1 && query->params[0] == GTK_TYPE_STYLE) { + gtk_signal_emit (GTK_OBJECT (item), signal_id, previous_style); + } + g_free (query); + } + + if (GNOME_IS_CANVAS_GROUP (item) ) { + GList *items = GNOME_CANVAS_GROUP (item)->item_list; + for (; items; items = items->next) + ec_style_set_recursive (items->data, previous_style); + } +} + +static void +e_canvas_style_set (GtkWidget *widget, GtkStyle *previous_style) +{ + ec_style_set_recursive (GNOME_CANVAS_ITEM (gnome_canvas_root (GNOME_CANVAS (widget))), previous_style); +} + + +static void e_canvas_realize (GtkWidget *widget) { gint width, height; |