Commit 40d62d0d authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

More convenient data-setting functions

2000-11-20  Havoc Pennington  <hp@redhat.com>

	* gobject.c (g_object_get_data)
	(g_object_set_data)
	(g_object_set_data_full)
	(g_object_steal_data): More convenient data-setting functions
parent 399ad0b8
2000-11-20 Havoc Pennington <hp@redhat.com>
* gobject.c (g_object_get_data)
(g_object_set_data)
(g_object_set_data_full)
(g_object_steal_data): More convenient data-setting functions
Wed Nov 15 20:58:05 2000 Owen Taylor <otaylor@redhat.com>
* gtypemodule.c (g_type_module_use): If loading the
......
......@@ -795,6 +795,56 @@ g_object_steal_qdata (GObject *object,
return g_datalist_id_remove_no_notify (&object->qdata, quark);
}
gpointer
g_object_get_data (GObject *object,
const gchar *key)
{
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
g_return_val_if_fail (key != NULL, NULL);
return g_object_get_qdata (object,
g_quark_try_string (key));
}
void
g_object_set_data (GObject *object,
const gchar *key,
gpointer data)
{
g_return_if_fail (G_IS_OBJECT (object));
g_return_if_fail (key != NULL);
g_object_set_qdata (object,
g_quark_from_string (key),
data);
}
void
g_object_set_data_full (GObject *object,
const gchar *key,
gpointer data,
GDestroyNotify destroy)
{
g_return_if_fail (G_IS_OBJECT (object));
g_return_if_fail (key != NULL);
g_object_set_qdata_full (object,
g_quark_from_string (key),
data,
destroy);
}
gpointer
g_object_steal_data (GObject *object,
const gchar *key)
{
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
g_return_val_if_fail (key != NULL, NULL);
return g_object_steal_qdata (object,
g_quark_try_string (key));
}
static void
g_value_object_init (GValue *value)
{
......
......@@ -149,6 +149,17 @@ void g_object_set_qdata_full (GObject *object,
GDestroyNotify destroy);
gpointer g_object_steal_qdata (GObject *object,
GQuark quark);
gpointer g_object_get_data (GObject *object,
const gchar *key);
void g_object_set_data (GObject *object,
const gchar *key,
gpointer data);
void g_object_set_data_full (GObject *object,
const gchar *key,
gpointer data,
GDestroyNotify destroy);
gpointer g_object_steal_data (GObject *object,
const gchar *key);
void g_object_watch_closure (GObject *object,
GClosure *closure);
GClosure* g_cclosure_new_object (GCallback callback_func,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment