diff options
author | Christopher James Lahey <clahey@ximian.com> | 2002-03-13 06:14:56 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2002-03-13 06:14:56 +0800 |
commit | 5020c3bd9a2b87eca463118f31fdb75ff44caa46 (patch) | |
tree | b74d936bf5153b0e9b3ab1917a21de365a74f9b7 /widgets/table | |
parent | 8e2b17bcabade3677153bcad36028b34a2f1f77b (diff) | |
download | gsoc2013-evolution-5020c3bd9a2b87eca463118f31fdb75ff44caa46.tar gsoc2013-evolution-5020c3bd9a2b87eca463118f31fdb75ff44caa46.tar.gz gsoc2013-evolution-5020c3bd9a2b87eca463118f31fdb75ff44caa46.tar.bz2 gsoc2013-evolution-5020c3bd9a2b87eca463118f31fdb75ff44caa46.tar.lz gsoc2013-evolution-5020c3bd9a2b87eca463118f31fdb75ff44caa46.tar.xz gsoc2013-evolution-5020c3bd9a2b87eca463118f31fdb75ff44caa46.tar.zst gsoc2013-evolution-5020c3bd9a2b87eca463118f31fdb75ff44caa46.zip |
Added support for E_TABLE_MEMORY_STORE_OBJECT which represents a column
2002-03-12 Christopher James Lahey <clahey@ximian.com>
* e-table-memory-store.c, e-table-memory-store.h: Added support
for E_TABLE_MEMORY_STORE_OBJECT which represents a column storing
a GtkObject.
svn path=/trunk/; revision=16132
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-table-memory-store.c | 15 | ||||
-rw-r--r-- | widgets/table/e-table-memory-store.h | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c index 67c1292119..078f49b1fc 100644 --- a/widgets/table/e-table-memory-store.c +++ b/widgets/table/e-table-memory-store.c @@ -43,8 +43,12 @@ duplicate_value (ETableMemoryStore *etms, int col, const void *val) return g_strdup (val); case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF: if (val) - gdk_pixbuf_ref ((GdkPixbuf *) val); - return (GdkPixbuf *) val; + gdk_pixbuf_ref ((void *) val); + return (void *) val; + case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT: + if (val) + gtk_object_ref ((void *) val); + return (void *) 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); @@ -111,6 +115,10 @@ etms_free_value (ETableModel *etm, int col, void *value) if (value) gdk_pixbuf_unref (value); break; + case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT: + if (value) + gtk_object_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); @@ -131,6 +139,7 @@ etms_initialize_value (ETableModel *etm, int col) case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF: return NULL; case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM: + case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT: if (etms->priv->columns[col].custom.initialize_value) return etms->priv->columns[col].custom.initialize_value (E_TABLE_MODEL (etms), col, NULL); break; @@ -151,6 +160,7 @@ etms_value_is_empty (ETableModel *etm, int col, const void *value) case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF: return value == NULL; case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM: + case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT: 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); break; @@ -171,6 +181,7 @@ etms_value_to_string (ETableModel *etm, int col, const void *value) case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF: return g_strdup (""); case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM: + case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT: 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); break; diff --git a/widgets/table/e-table-memory-store.h b/widgets/table/e-table-memory-store.h index 49f37ba201..60bd037758 100644 --- a/widgets/table/e-table-memory-store.h +++ b/widgets/table/e-table-memory-store.h @@ -41,6 +41,7 @@ typedef enum { E_TABLE_MEMORY_STORE_COLUMN_TYPE_INTEGER, E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING, E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF, + E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT, E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM } ETableMemoryStoreColumnType; @@ -66,6 +67,9 @@ typedef struct { #define E_TABLE_MEMORY_STORE_CUSTOM(editable, duplicate, free, initialize, empty, string) \ { E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM, \ { (duplicate), (free), (initialize), (empty), (string) }, editable } +#define E_TABLE_MEMORY_STORE_OBJECT(editable, initialize, empty, string) \ + { E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM, \ + { NULL, NULL, (initialize), (empty), (string) }, editable } typedef struct _ETableMemoryStorePrivate ETableMemoryStorePrivate; |