aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-memory-store.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-03-12 06:51:50 +0800
committerChris Lahey <clahey@src.gnome.org>2002-03-12 06:51:50 +0800
commite94b86c4b5d7fa2d431d2dbbca0c29ef5e48a7e6 (patch)
tree0243389d5889b83af49e14b354cbb3c43d1bf2bd /widgets/table/e-table-memory-store.c
parentb24b3e4ecdf17d041662d2dd71d084c63e8ab58d (diff)
downloadgsoc2013-evolution-e94b86c4b5d7fa2d431d2dbbca0c29ef5e48a7e6.tar
gsoc2013-evolution-e94b86c4b5d7fa2d431d2dbbca0c29ef5e48a7e6.tar.gz
gsoc2013-evolution-e94b86c4b5d7fa2d431d2dbbca0c29ef5e48a7e6.tar.bz2
gsoc2013-evolution-e94b86c4b5d7fa2d431d2dbbca0c29ef5e48a7e6.tar.lz
gsoc2013-evolution-e94b86c4b5d7fa2d431d2dbbca0c29ef5e48a7e6.tar.xz
gsoc2013-evolution-e94b86c4b5d7fa2d431d2dbbca0c29ef5e48a7e6.tar.zst
gsoc2013-evolution-e94b86c4b5d7fa2d431d2dbbca0c29ef5e48a7e6.zip
Added a pixbuf column type.
2002-03-11 Christopher James Lahey <clahey@ximian.com> * e-table-memory-store.c, e-table-memory-store.h (E_TABLE_MEMORY_STORE_PIXBUF): Added a pixbuf column type. * e-table-specification.c, e-table-specification.h: Added horizontal-resize attribute. * e-table.c, e-table.h: Handle horizontal_resize. svn path=/trunk/; revision=16108
Diffstat (limited to 'widgets/table/e-table-memory-store.c')
-rw-r--r--widgets/table/e-table-memory-store.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c
index 276bb99104..5cf59a7033 100644
--- a/widgets/table/e-table-memory-store.c
+++ b/widgets/table/e-table-memory-store.c
@@ -41,6 +41,9 @@ duplicate_value (ETableMemoryStore *etms, int col, const void *val)
switch (etms->priv->columns[col].type) {
case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING:
return g_strdup (val);
+ case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF:
+ gdk_pixbuf_ref ((GdkPixbuf *) val);
+ return (GdkPixbuf *) val;
case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM:
if (etms->priv->columns[col].custom.duplicate_value)
return etms->priv->columns[col].custom.duplicate_value (E_TABLE_MODEL (etms), col, val, NULL);
@@ -103,6 +106,9 @@ etms_free_value (ETableModel *etm, int col, void *value)
case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING:
g_free (value);
break;
+ case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF:
+ gdk_pixbuf_unref (value);
+ break;
case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM:
if (etms->priv->columns[col].custom.free_value)
etms->priv->columns[col].custom.free_value (E_TABLE_MODEL (etms), col, value, NULL);
@@ -120,6 +126,8 @@ etms_initialize_value (ETableModel *etm, int col)
switch (etms->priv->columns[col].type) {
case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING:
return g_strdup ("");
+ case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF:
+ return NULL;
case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM:
if (etms->priv->columns[col].custom.initialize_value)
return etms->priv->columns[col].custom.initialize_value (E_TABLE_MODEL (etms), col, NULL);
@@ -138,6 +146,8 @@ etms_value_is_empty (ETableModel *etm, int col, const void *value)
switch (etms->priv->columns[col].type) {
case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING:
return !(value && *(char *) value);
+ case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF:
+ return value == NULL;
case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM:
if (etms->priv->columns[col].custom.value_is_empty)
return etms->priv->columns[col].custom.value_is_empty (E_TABLE_MODEL (etms), col, value, NULL);
@@ -156,6 +166,8 @@ etms_value_to_string (ETableModel *etm, int col, const void *value)
switch (etms->priv->columns[col].type) {
case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING:
return g_strdup (value);
+ case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF:
+ return g_strdup ("");
case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM:
if (etms->priv->columns[col].custom.value_is_empty)
return etms->priv->columns[col].custom.value_to_string (E_TABLE_MODEL (etms), col, value, NULL);