aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-03-16 07:16:01 +0800
committerChris Lahey <clahey@src.gnome.org>2002-03-16 07:16:01 +0800
commit88a322f15d8ce9c152cce75630b302b8b3ca1c08 (patch)
tree6aaa3c7ba15024c4f3e1fe1d47aea1c3f6746484 /widgets/table
parentf8f95421a6e00884da54c9da66d6c0b0edc00e29 (diff)
downloadgsoc2013-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/table')
-rw-r--r--widgets/table/e-cell-toggle.c16
-rw-r--r--widgets/table/e-cell.c7
-rw-r--r--widgets/table/e-cell.h5
-rw-r--r--widgets/table/e-table-item.c23
-rw-r--r--widgets/table/e-table-item.h1
5 files changed, 52 insertions, 0 deletions
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
index a42d7dbd1a..0961b077ba 100644
--- a/widgets/table/e-cell-toggle.c
+++ b/widgets/table/e-cell-toggle.c
@@ -322,6 +322,21 @@ etog_max_width (ECellView *ecell_view, int model_col, int view_col)
}
static void
+etog_style_set (ECellView *ecell_view, GtkStyle *previous_style)
+{
+ ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell);
+ ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
+ int i;
+
+ for (i = 0; i < toggle->n_states * CACHE_SEQ_COUNT; i++) {
+ if (toggle_view->pixmap_cache[i]) {
+ gdk_pixmap_unref (toggle_view->pixmap_cache[i]);
+ toggle_view->pixmap_cache[i] = NULL;
+ }
+ }
+}
+
+static void
etog_destroy (GtkObject *object)
{
ECellToggle *etog = E_CELL_TOGGLE (object);
@@ -353,6 +368,7 @@ e_cell_toggle_class_init (GtkObjectClass *object_class)
ecc->event = etog_event;
ecc->height = etog_height;
ecc->max_width = etog_max_width;
+ ecc->style_set = etog_style_set;
parent_class = gtk_type_class (PARENT_TYPE);
}
diff --git a/widgets/table/e-cell.c b/widgets/table/e-cell.c
index 729207b32f..b440370fb3 100644
--- a/widgets/table/e-cell.c
+++ b/widgets/table/e-cell.c
@@ -489,4 +489,11 @@ e_cell_get_bg_color(ECellView *ecell_view, int row)
else
return NULL;
}
+
+void
+e_cell_style_set(ECellView *ecell_view, GtkStyle *previous_style)
+{
+ if (ECVIEW_EC_CLASS(ecell_view)->style_set)
+ ECVIEW_EC_CLASS(ecell_view)->style_set (ecell_view, previous_style);
+}
diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h
index d0f0f196a3..bc04f32f58 100644
--- a/widgets/table/e-cell.h
+++ b/widgets/table/e-cell.h
@@ -113,6 +113,8 @@ typedef struct {
int (*max_width_by_row) (ECellView *ecell_view, int model_col, int view_col, int row);
void (*show_tooltip) (ECellView *ecell_view, int model_col, int view_col, int row, int col_width, ETableTooltip *tooltip);
gchar *(*get_bg_color) (ECellView *ecell_view, int row);
+
+ void (*style_set) (ECellView *ecell_view, GtkStyle *previous_style);
} ECellClass;
GtkType e_cell_get_type (void);
@@ -172,6 +174,9 @@ void e_cell_show_tooltip (ECellView *ecell_view,
ETableTooltip *tooltip);
gchar *e_cell_get_bg_color (ECellView *ecell_view,
int row);
+void e_cell_style_set (ECellView *ecell_view,
+ GtkStyle *previous_style);
+
void e_cell_focus (ECellView *ecell_view,
int model_col,
int view_col,
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 3ecc547a04..754234868e 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -69,6 +69,7 @@ enum {
CLICK,
KEY_PRESS,
START_DRAG,
+ STYLE_SET,
LAST_SIGNAL
};
@@ -2756,6 +2757,19 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
}
static void
+eti_style_set (ETableItem *eti, GtkStyle *previous_style)
+{
+ if (eti->cell_views_realized) {
+ int i;
+ int n_cells = eti->n_cells;
+
+ for (i = 0; i < n_cells; i++) {
+ e_cell_style_set (eti->cell_views[i], previous_style);
+ }
+ }
+}
+
+static void
eti_class_init (GtkObjectClass *object_class)
{
GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class;
@@ -2781,6 +2795,7 @@ eti_class_init (GtkObjectClass *object_class)
eti_class->click = NULL;
eti_class->key_press = NULL;
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);
@@ -2868,6 +2883,14 @@ eti_class_init (GtkObjectClass *object_class)
e_marshal_INT__INT_INT_POINTER,
GTK_TYPE_INT, 3, GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_GDK_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__POINTER,
+ GTK_TYPE_NONE, 1, GTK_TYPE_STYLE);
+
E_OBJECT_CLASS_ADD_SIGNALS (object_class, eti_signals, LAST_SIGNAL);
}
diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h
index 272753effe..793379b837 100644
--- a/widgets/table/e-table-item.h
+++ b/widgets/table/e-table-item.h
@@ -177,6 +177,7 @@ typedef struct {
gint (*click) (ETableItem *eti, int row, int col, GdkEvent *event);
gint (*key_press) (ETableItem *eti, int row, int col, GdkEvent *event);
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);