]> Pileus Git - ~andy/gtk/commitdiff
new file, gdatasets implement the object data mechanism from GtkObject. a
authorTim Janik <timj@gtk.org>
Mon, 11 May 1998 00:48:44 +0000 (00:48 +0000)
committerTim Janik <timj@src.gnome.org>
Mon, 11 May 1998 00:48:44 +0000 (00:48 +0000)
Mon May 11 01:44:10 1998  Tim Janik  <timj@gtk.org>

        * gdataset.c: new file, gdatasets implement the object data
        mechanism from GtkObject. a generic data pointer is associated with
        a certain location and a key id.

Mon May 11 02:31:19 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkobject.h:
        * gtk/gtkobject.c:
        (gtk_object_data_try_key):
        (gtk_object_data_force_id): these are now macros substituting the old
        functions. we just use the corresponding g_dataset_* functions for
        key->id associations. (this is to assure unique key<->id associations).

14 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
TODO
glib/ChangeLog
glib/Makefile.am
glib/gdataset.c [new file with mode: 0644]
glib/glib.h
gtk/gtkobject.c
gtk/gtkobject.h

index 01ac53f9a5221759dd81f81bda2560ed8df41b62..88299123cd65abdfcb60cf642a2718d66ff12c55 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Mon May 11 02:31:19 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.h:
+       * gtk/gtkobject.c:
+       (gtk_object_data_try_key):
+       (gtk_object_data_force_id): these are now macros substituting the old
+       functions. we just use the corresponding g_dataset_* functions for
+       key->id associations. (this is to assure unique key<->id associations).
+
 1998-05-10  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkctree.c (gtk_ctree_is_visible): Changed return value
index 01ac53f9a5221759dd81f81bda2560ed8df41b62..88299123cd65abdfcb60cf642a2718d66ff12c55 100644 (file)
@@ -1,3 +1,12 @@
+Mon May 11 02:31:19 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.h:
+       * gtk/gtkobject.c:
+       (gtk_object_data_try_key):
+       (gtk_object_data_force_id): these are now macros substituting the old
+       functions. we just use the corresponding g_dataset_* functions for
+       key->id associations. (this is to assure unique key<->id associations).
+
 1998-05-10  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkctree.c (gtk_ctree_is_visible): Changed return value
index 01ac53f9a5221759dd81f81bda2560ed8df41b62..88299123cd65abdfcb60cf642a2718d66ff12c55 100644 (file)
@@ -1,3 +1,12 @@
+Mon May 11 02:31:19 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.h:
+       * gtk/gtkobject.c:
+       (gtk_object_data_try_key):
+       (gtk_object_data_force_id): these are now macros substituting the old
+       functions. we just use the corresponding g_dataset_* functions for
+       key->id associations. (this is to assure unique key<->id associations).
+
 1998-05-10  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkctree.c (gtk_ctree_is_visible): Changed return value
index 01ac53f9a5221759dd81f81bda2560ed8df41b62..88299123cd65abdfcb60cf642a2718d66ff12c55 100644 (file)
@@ -1,3 +1,12 @@
+Mon May 11 02:31:19 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.h:
+       * gtk/gtkobject.c:
+       (gtk_object_data_try_key):
+       (gtk_object_data_force_id): these are now macros substituting the old
+       functions. we just use the corresponding g_dataset_* functions for
+       key->id associations. (this is to assure unique key<->id associations).
+
 1998-05-10  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkctree.c (gtk_ctree_is_visible): Changed return value
index 01ac53f9a5221759dd81f81bda2560ed8df41b62..88299123cd65abdfcb60cf642a2718d66ff12c55 100644 (file)
@@ -1,3 +1,12 @@
+Mon May 11 02:31:19 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.h:
+       * gtk/gtkobject.c:
+       (gtk_object_data_try_key):
+       (gtk_object_data_force_id): these are now macros substituting the old
+       functions. we just use the corresponding g_dataset_* functions for
+       key->id associations. (this is to assure unique key<->id associations).
+
 1998-05-10  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkctree.c (gtk_ctree_is_visible): Changed return value
index 01ac53f9a5221759dd81f81bda2560ed8df41b62..88299123cd65abdfcb60cf642a2718d66ff12c55 100644 (file)
@@ -1,3 +1,12 @@
+Mon May 11 02:31:19 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.h:
+       * gtk/gtkobject.c:
+       (gtk_object_data_try_key):
+       (gtk_object_data_force_id): these are now macros substituting the old
+       functions. we just use the corresponding g_dataset_* functions for
+       key->id associations. (this is to assure unique key<->id associations).
+
 1998-05-10  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkctree.c (gtk_ctree_is_visible): Changed return value
index 01ac53f9a5221759dd81f81bda2560ed8df41b62..88299123cd65abdfcb60cf642a2718d66ff12c55 100644 (file)
@@ -1,3 +1,12 @@
+Mon May 11 02:31:19 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.h:
+       * gtk/gtkobject.c:
+       (gtk_object_data_try_key):
+       (gtk_object_data_force_id): these are now macros substituting the old
+       functions. we just use the corresponding g_dataset_* functions for
+       key->id associations. (this is to assure unique key<->id associations).
+
 1998-05-10  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkctree.c (gtk_ctree_is_visible): Changed return value
diff --git a/TODO b/TODO
index d8a8b8e5e47173b69397bc1110d49793d04c198a..b6ff825f813f1f7610863ef68d7d48996b0dbdbb 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,7 @@
+For 1.1.0 release:
+-      remove gtk_object_data_force_id and gtk_object_data_try_key from
+       gtkobject.c
+       
 Bugs:
  * Scrolled windows (GtkList?) get cought in an endless reallocation loop
    under certain (rare) circumstances.
index c4d8d4ff34584bfecc6460d14ebb041e4bfd524d..79e6f36ac583a9e83b400ee485e10139ef669ad6 100644 (file)
@@ -1,3 +1,9 @@
+Mon May 11 01:44:10 1998  Tim Janik  <timj@gtk.org>
+
+       * gdataset.c: new file, gdatasets implement the object data
+       mechanism from GtkObject. a generic data pointer is associated with
+       a certain location and a key id.
+
 Sat May  9 20:08:12 1998  Owen Taylor  <otaylor@gtk.org>
 
         * glib/gmem.c: Experimentally restore GMemChunk
index 68a3f34365704d66507c3e08122bf7596c90fc94..a548effe40dab53ec4616aa7a47b3ad4aaa4a33e 100644 (file)
@@ -7,6 +7,7 @@ lib_LTLIBRARIES = libglib.la
 libglib_la_SOURCES = \
                garray.c        \
                gcache.c        \
+               gdataset.c      \
                gerror.c        \
                ghash.c         \
                glist.c         \
diff --git a/glib/gdataset.c b/glib/gdataset.c
new file mode 100644 (file)
index 0000000..86a5bfb
--- /dev/null
@@ -0,0 +1,339 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * gdataset.c: Generic dataset mechanism, similar to GtkObject data.
+ * Copyright (C) 1998 Tim Janik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+#include       "glib.h"
+
+
+
+/* --- defines --- */
+#define        G_DATASET_ID_BLOCK_SIZE                 (1024)
+#define        G_DATASET_MEM_CHUNK_PREALLOC            (512)
+#define        G_DATASET_DATA_MEM_CHUNK_PREALLOC       (1024)
+
+
+/* --- structures --- */
+typedef struct _GDatasetData GDatasetData;
+typedef struct _GDataset GDataset;
+struct _GDatasetData
+{
+  GDatasetData *next;
+  guint id;
+  gpointer data;
+  GDestroyNotify destroy_func;
+};
+struct _GDataset
+{
+  gpointer location;
+  GDatasetData *data_list;
+};
+
+
+/* --- prototypes --- */
+static inline GDataset*        g_dataset_lookup        (const gpointer dataset_location);
+static inline void     g_dataset_destroy_i     (GDataset       *dataset);
+static void            g_dataset_initialize    (void);
+static guint*          g_dataset_id_new        (void);
+
+
+/* --- variables --- */
+static GHashTable *g_dataset_location_ht = NULL;
+static GHashTable *g_dataset_key_ht = NULL;
+static GDataset *g_dataset_cached = NULL;
+static GMemChunk *g_dataset_mem_chunk = NULL;
+static GMemChunk *g_dataset_data_mem_chunk = NULL;
+static guint *g_dataset_id_block = NULL;
+static guint g_dataset_id_index = G_DATASET_ID_BLOCK_SIZE + 1;
+
+
+/* --- functions --- */
+static inline GDataset*
+g_dataset_lookup (const gpointer       dataset_location)
+{
+  register GDataset *dataset;
+  
+  if (g_dataset_cached && g_dataset_cached->location == dataset_location)
+    return g_dataset_cached;
+  
+  if (!g_dataset_location_ht)
+    g_dataset_initialize ();
+  
+  dataset = g_hash_table_lookup (g_dataset_location_ht, dataset_location);
+  if (dataset)
+    g_dataset_cached = dataset;
+  
+  return dataset;
+}
+
+static inline void
+g_dataset_destroy_i (GDataset *dataset)
+{
+  register GDatasetData *list;
+  
+  if (dataset == g_dataset_cached)
+    g_dataset_cached = NULL;
+  g_hash_table_remove (g_dataset_location_ht, dataset->location);
+  
+  list = dataset->data_list;
+  g_mem_chunk_free (g_dataset_mem_chunk, dataset);
+  
+  while (list)
+    {
+      register GDatasetData *prev;
+      
+      prev = list;
+      list = prev->next;
+      
+      if (prev->destroy_func)
+       prev->destroy_func (prev->data);
+      
+      g_mem_chunk_free (g_dataset_data_mem_chunk, prev);
+    }
+}
+
+void
+g_dataset_destroy (const gpointer  dataset_location)
+{
+  register GDataset *dataset;
+  
+  g_return_if_fail (dataset_location != NULL);
+  
+  dataset = g_dataset_lookup (dataset_location);
+  if (dataset)
+    g_dataset_destroy_i (dataset);
+}
+
+void
+g_dataset_id_set_destroy (const gpointer  dataset_location,
+                         guint           key_id,
+                         GDestroyNotify  destroy_func)
+{
+  g_return_if_fail (dataset_location != NULL);
+  
+  if (key_id)
+    {
+      register GDataset *dataset;
+      
+      dataset = g_dataset_lookup (dataset_location);
+      if (dataset)
+       {
+         register GDatasetData *list;
+         
+         list = dataset->data_list;
+         while (list)
+           {
+             if (list->id == key_id)
+               {
+                 list->destroy_func = destroy_func;
+                 return;
+               }
+           }
+       }
+    }
+}
+
+gpointer
+g_dataset_id_get_data (const gpointer  dataset_location,
+                      guint           key_id)
+{
+  g_return_val_if_fail (dataset_location != NULL, NULL);
+  
+  if (key_id)
+    {
+      register GDataset *dataset;
+      
+      dataset = g_dataset_lookup (dataset_location);
+      if (dataset)
+       {
+         register GDatasetData *list;
+         
+         for (list = dataset->data_list; list; list = list->next)
+           if (list->id == key_id)
+             return list->data;
+       }
+    }
+  
+  return NULL;
+}
+
+void
+g_dataset_id_set_data_full (const gpointer  dataset_location,
+                           guint           key_id,
+                           gpointer        data,
+                           GDestroyNotify  destroy_func)
+{
+  register GDataset *dataset;
+  register GDatasetData *list;
+  
+  g_return_if_fail (dataset_location != NULL);
+  g_return_if_fail (key_id > 0);
+  
+  dataset = g_dataset_lookup (dataset_location);
+  if (!dataset)
+    {
+      dataset = g_chunk_new (GDataset, g_dataset_mem_chunk);
+      dataset->location = dataset_location;
+      dataset->data_list = NULL;
+      g_hash_table_insert (g_dataset_location_ht, dataset->location, dataset);
+    }
+  
+  list = dataset->data_list;
+  if (!data)
+    {
+      register GDatasetData *prev;
+      
+      prev = NULL;
+      while (list)
+       {
+         if (list->id == key_id)
+           {
+             if (prev)
+               prev->next = list->next;
+             else
+               {
+                 dataset->data_list = list->next;
+                 
+                 if (!dataset->data_list)
+                   g_dataset_destroy_i (dataset);
+               }
+             
+             /* we need to have unlinked before invoking the destroy function
+              */
+             if (list->destroy_func)
+               list->destroy_func (list->data);
+             
+             g_mem_chunk_free (g_dataset_data_mem_chunk, list);
+             break;
+           }
+         
+         prev = list;
+         list = list->next;
+       }
+    }
+  else
+    {
+      register GDatasetData *prev;
+      
+      prev = NULL;
+      while (list)
+       {
+         if (list->id == key_id)
+           {
+             if (prev)
+               prev->next = list->next;
+             else
+               dataset->data_list = list->next;
+             
+             /* we need to have unlinked before invoking the destroy function
+              */
+             if (list->destroy_func)
+               list->destroy_func (list->data);
+             
+             break;
+           }
+         
+         prev = list;
+         list = list->next;
+       }
+      
+      if (!list)
+       list = g_chunk_new (GDatasetData, g_dataset_data_mem_chunk);
+      list->next = dataset->data_list;
+      list->id = key_id;
+      list->data = data;
+      list->destroy_func = destroy_func;
+      dataset->data_list = list;
+    }
+}
+
+guint
+g_dataset_try_key (const gchar    *key)
+{
+  register guint *id;
+  g_return_val_if_fail (key != NULL, 0);
+  
+  if (g_dataset_key_ht)
+    {
+      id = g_hash_table_lookup (g_dataset_key_ht, (gpointer) key);
+      
+      if (id)
+       return *id;
+    }
+  
+  return 0;
+}
+
+guint
+g_dataset_force_id (const gchar    *key)
+{
+  register guint *id;
+  
+  g_return_val_if_fail (key != NULL, 0);
+  
+  if (!g_dataset_key_ht)
+    g_dataset_initialize ();
+  
+  id = g_hash_table_lookup (g_dataset_key_ht, (gpointer) key);
+  if (!id)
+    {
+      id = g_dataset_id_new ();
+      g_hash_table_insert (g_dataset_key_ht, g_strdup (key), id);
+    }
+  
+  return *id;
+}
+
+static void
+g_dataset_initialize (void)
+{
+  if (!g_dataset_location_ht)
+    {
+      g_dataset_location_ht = g_hash_table_new (g_direct_hash, NULL);
+      g_dataset_key_ht = g_hash_table_new (g_str_hash, g_str_equal);
+      g_dataset_cached = NULL;
+      g_dataset_mem_chunk =
+       g_mem_chunk_new ("GDataset MemChunk",
+                        sizeof (GDataset),
+                        sizeof (GDataset) * G_DATASET_MEM_CHUNK_PREALLOC,
+                        G_ALLOC_AND_FREE);
+      g_dataset_data_mem_chunk =
+       g_mem_chunk_new ("GDatasetData MemChunk",
+                        sizeof (GDatasetData),
+                        sizeof (GDatasetData) * G_DATASET_DATA_MEM_CHUNK_PREALLOC,
+                        G_ALLOC_AND_FREE);
+    }
+}
+
+static guint*
+g_dataset_id_new (void)
+{
+  static guint seq_id = 1;
+  register guint *id;
+  
+  if (g_dataset_id_index >= G_DATASET_ID_BLOCK_SIZE)
+    {
+      g_dataset_id_block = g_new (guint, G_DATASET_ID_BLOCK_SIZE);
+      g_dataset_id_index = 0;
+    }
+  
+  id = &g_dataset_id_block[g_dataset_id_index++];
+  *id = seq_id++;
+  
+  return id;
+}
index d38253e2cb337ad768f3cf80bb0f9d2aae9ac4aa..b2d1183d7f61390131ce9e6f810e06c964a579db 100644 (file)
@@ -397,7 +397,8 @@ typedef void                (*GPrintFunc)           (gchar    *str);
 typedef void           (*GScannerMsgFunc)      (GScanner *scanner,
                                                 gchar    *message,
                                                 gint      error);
-  
+typedef void           (*GDestroyNotify)       (gpointer  data);
+
 
 struct _GList
 {
@@ -817,6 +818,30 @@ guint g_str_hash  (const gpointer v);
 guint g_direct_hash (gpointer key);
 
 
+/* Associated Data
+ */
+void     g_dataset_destroy             (const gpointer  dataset_location);
+guint    g_dataset_try_key             (const gchar    *key);
+guint    g_dataset_force_id            (const gchar    *key);
+gpointer  g_dataset_id_get_data                (const gpointer  dataset_location,
+                                        guint           key_id);
+void     g_dataset_id_set_data_full    (const gpointer  dataset_location,
+                                        guint           key_id,
+                                        gpointer        data,
+                                        GDestroyNotify  destroy_func);
+void     g_dataset_id_set_destroy      (const gpointer  dataset_location,
+                                        guint           key_id,
+                                        GDestroyNotify  destroy_func);
+
+#define          g_dataset_id_set_data(l,k,d)  G_STMT_START{g_dataset_id_set_data_full((l),(k),(d),NULL);}G_STMT_END
+#define          g_dataset_id_remove_data(l,k) G_STMT_START{g_dataset_id_set_data((l),(k),NULL);}G_STMT_END
+#define          g_dataset_get_data(l,k)       (g_dataset_id_get_data((l),g_dataset_try_key(k)))
+#define          g_dataset_set_data_full(l,k,d,f) G_STMT_START{g_dataset_id_set_data_full((l),g_dataset_force_id(k),(d),(f));}G_STMT_END
+#define          g_dataset_set_destroy(l,k,f)  G_STMT_START{g_dataset_id_set_destroy((l),g_dataset_force_id(k),(f));}G_STMT_END
+#define          g_dataset_set_data(l,k,d)     G_STMT_START{g_dataset_set_data_full((l),(k),(d),NULL);}G_STMT_END
+#define          g_dataset_remove_data(l,k)    G_STMT_START{g_dataset_set_data((l),(k),NULL);}G_STMT_END
+
+
 /* GScanner: Flexible lexical scanner for general purpose.
  */
 
index 61644ce04c461fed459626ac10a67639e52e84c5..df718d432c1e3927d80001cb4a934896b9eb688b 100644 (file)
@@ -74,8 +74,6 @@ static void           gtk_object_real_destroy  (GtkObject      *object);
 static void           gtk_object_finalize      (GtkObject      *object);
 static void           gtk_object_notify_weaks  (GtkObject      *object);
 
-static guint*         gtk_object_data_id_alloc (void);
-
 GtkArg*               gtk_object_collect_args  (guint   *nargs,
                                                va_list  args1,
                                                va_list  args2);
@@ -89,9 +87,6 @@ static guint user_data_key_id = 0;
 static const gchar *weakrefs_key = "gtk-weakrefs";
 static guint weakrefs_key_id = 0;
 
-static GHashTable *object_data_ht = NULL;
-static GSList *object_data_id_list = NULL;
-static guint object_data_id_index = 0;
 static GtkObjectData *gtk_object_data_free_list = NULL;
 
 #define GTK_OBJECT_DATA_DESTROY( odata )       { \
@@ -1094,26 +1089,6 @@ gtk_object_set_data_full (GtkObject        *object,
   gtk_object_set_data_by_id_full (object, gtk_object_data_force_id (key), data, destroy);
 }
 
-guint
-gtk_object_data_force_id (const gchar     *key)
-{
-  guint *id;
-
-  g_return_val_if_fail (key != NULL, 0);
-
-  if (!object_data_ht)
-    object_data_ht = g_hash_table_new (g_str_hash, g_str_equal);
-
-  id = g_hash_table_lookup (object_data_ht, (gpointer) key);
-  if (!id)
-    {
-      id = gtk_object_data_id_alloc ();
-      g_hash_table_insert (object_data_ht, g_strdup (key), id);
-    }
-
-  return *id;
-}
-
 gpointer
 gtk_object_get_data_by_id (GtkObject   *object,
                           guint        data_id)
@@ -1152,23 +1127,6 @@ gtk_object_get_data (GtkObject   *object,
   return NULL;
 }
 
-guint
-gtk_object_data_try_key (const gchar     *key)
-{
-  g_return_val_if_fail (key != NULL, 0);
-
-  if (object_data_ht)
-    {
-      guint *id;
-
-      id = g_hash_table_lookup (object_data_ht, (gpointer) key);
-      if (id)
-       return *id;
-    }
-
-  return 0;
-}
-
 void
 gtk_object_remove_data_by_id (GtkObject   *object,
                              guint        data_id)
@@ -1190,28 +1148,6 @@ gtk_object_remove_data (GtkObject   *object,
     gtk_object_set_data_by_id_full (object, id, NULL, NULL);
 }
 
-static guint*
-gtk_object_data_id_alloc (void)
-{
-  static guint next_id = 1;
-  guint *ids;
-
-  if (!object_data_id_list ||
-      (object_data_id_index == GTK_OBJECT_DATA_ID_BLOCK_SIZE))
-    {
-      ids = g_new (guint, GTK_OBJECT_DATA_ID_BLOCK_SIZE);
-      object_data_id_index = 0;
-      object_data_id_list = g_slist_prepend (object_data_id_list, ids);
-    }
-  else
-    {
-      ids = object_data_id_list->data;
-    }
-
-  ids[object_data_id_index] = next_id++;
-  return &ids[object_data_id_index++];
-}
-
 /*****************************************
  * gtk_object_set_user_data:
  *
@@ -1625,3 +1561,18 @@ gtk_trace_referencing (gpointer    *o,
 }
 #endif /* G_ENABLE_DEBUG */
 
+/* these functions are just in place to preserve binary compatibility,
+ * they should be removed when releasing 1.1.0
+ */
+#undef gtk_object_data_force_id
+#undef gtk_object_data_try_key
+guint
+gtk_object_data_force_id (const gchar     *key)
+{
+  return g_dataset_force_id (key);
+}
+guint
+gtk_object_data_try_key (const gchar     *key)
+{
+  return g_dataset_try_key (key);
+}
index 323b69fcab844582ca2fa135f472e3129cba737b..96aa84439381dc571e1b5e56a1829bd634d0efa4 100644 (file)
@@ -336,8 +336,8 @@ gpointer gtk_object_get_data_by_id  (GtkObject           *object,
                                     guint            data_id);
 void  gtk_object_remove_data_by_id  (GtkObject      *object,
                                     guint            data_id);
-guint gtk_object_data_try_key      (const gchar     *key);
-guint gtk_object_data_force_id     (const gchar     *key);
+#define        gtk_object_data_try_key     g_dataset_try_key
+#define        gtk_object_data_force_id    g_dataset_force_id
 
 /* Set the "user_data" object data field of "object". It should
  *  be noted that this is no different than calling 'gtk_object_set_data'