Make the g_value_set_x_take_ownership() functions "official" part of the

2003-09-12  Matthias Clasen  <maclas@gmx.de>

	Make the g_value_set_x_take_ownership() functions "official"
	part of the API (#100948):

	* gvaluetypes.[hc]: Add g_value_take_string() (synonym to the
	now deprecated g_value_set_string_take_ownership()).

	* gparam.[hc]: Add g_value_take_param() (synonym to the
	now deprecated g_value_set_param_take_ownership()).

	* gobject.[hc]: Add g_value_take_object() (synonym to the
	now deprecated g_value_set_object_take_ownership()).

	* gboxed.[hc]: Add g_value_take_boxed() (synonym to the
	now deprecated g_value_set_boxed_take_ownership()).

	* gobject/gobject-sections.txt: Add new g_value_take_x() functions.

	* gobject/tmpl/param_value_types.sgml: Document new g_value_take_x()
	functions.  (#100948)
This commit is contained in:
Matthias Clasen
2003-09-12 20:11:38 +00:00
committed by Matthias Clasen
parent 7c9f0a10f5
commit c3acb9da0c
12 changed files with 127 additions and 9 deletions

View File

@@ -1,3 +1,20 @@
2003-09-12 Matthias Clasen <maclas@gmx.de>
Make the g_value_set_x_take_ownership() functions "official"
part of the API (#100948):
* gvaluetypes.[hc]: Add g_value_take_string() (synonym to the
now deprecated g_value_set_string_take_ownership()).
* gparam.[hc]: Add g_value_take_param() (synonym to the
now deprecated g_value_set_param_take_ownership()).
* gobject.[hc]: Add g_value_take_object() (synonym to the
now deprecated g_value_set_object_take_ownership()).
* gboxed.[hc]: Add g_value_take_boxed() (synonym to the
now deprecated g_value_set_boxed_take_ownership()).
Tue Sep 2 19:37:21 2003 Tim Janik <timj@gtk.org>
* gtype.[hc]: added support for a "default vtable" per interface,
@@ -72,6 +89,11 @@ Tue Aug 19 01:31:28 2003 Tim Janik <timj@gtk.org>
* gsignal.c: added optimizations to skip NOP signal emissions.
2003-08-08 Matthias Clasen <maclas@gmx.de>
* gobject.c (object_set_property): Improve the wording of the warning for invalid
values. (#117246, Mariano Suarez-Alvarez)
Wed Aug 6 09:57:14 2003 Owen Taylor <otaylor@redhat.com>
* testgobject.c (test_signal_accumulator): Add check

View File

@@ -503,6 +503,13 @@ g_value_set_static_boxed (GValue *value,
void
g_value_set_boxed_take_ownership (GValue *value,
gconstpointer boxed)
{
g_value_take_boxed (value, boxed);
}
void
g_value_take_boxed (GValue *value,
gconstpointer boxed)
{
g_return_if_fail (G_VALUE_HOLDS_BOXED (value));
g_return_if_fail (G_TYPE_IS_VALUE (G_VALUE_TYPE (value)));

View File

@@ -63,9 +63,12 @@ GType g_boxed_type_register_static (const gchar *name,
#define G_TYPE_GSTRING (g_gstring_get_type ())
/* --- internal (marshaller specific) --- */
void g_value_take_boxed (GValue *value,
gconstpointer v_boxed);
#ifndef G_DISABLE_DEPRECATED
void g_value_set_boxed_take_ownership (GValue *value,
gconstpointer v_boxed);
#endif
GType g_closure_get_type (void) G_GNUC_CONST;
GType g_value_get_type (void) G_GNUC_CONST;
GType g_value_array_get_type (void) G_GNUC_CONST;

View File

@@ -1532,6 +1532,13 @@ g_value_set_object (GValue *value,
void
g_value_set_object_take_ownership (GValue *value,
gpointer v_object)
{
g_value_take_object (value, v_object);
}
void
g_value_take_object (GValue *value,
gpointer v_object)
{
g_return_if_fail (G_VALUE_HOLDS_OBJECT (value));

View File

@@ -210,10 +210,12 @@ gulong g_signal_connect_object (gpointer instance,
void g_object_run_dispose (GObject *object);
/* --- marshaller specific --- */
void g_value_take_object (GValue *value,
gpointer v_object);
#ifndef G_DISABLE_DEPRECATED
void g_value_set_object_take_ownership (GValue *value,
gpointer v_object);
#endif
/* --- implementation macros --- */
#define G_OBJECT_WARN_INVALID_PSPEC(object, pname, property_id, pspec) \

View File

@@ -982,6 +982,13 @@ g_value_set_param (GValue *value,
void
g_value_set_param_take_ownership (GValue *value,
GParamSpec *param)
{
g_value_take_param (value, param);
}
void
g_value_take_param (GValue *value,
GParamSpec *param)
{
g_return_if_fail (G_VALUE_HOLDS_PARAM (value));
if (param)

View File

@@ -144,10 +144,12 @@ GParamSpec* g_value_get_param (const GValue *value);
GParamSpec* g_value_dup_param (const GValue *value);
/* --- marshaller specific --- */
void g_value_take_param (GValue *value,
GParamSpec *param);
#ifndef G_DISABLE_DEPRECATED
void g_value_set_param_take_ownership (GValue *value,
GParamSpec *param);
#endif
/* --- convenience functions --- */
typedef struct _GParamSpecTypeInfo GParamSpecTypeInfo;

View File

@@ -762,6 +762,13 @@ g_value_set_static_string (GValue *value,
void
g_value_set_string_take_ownership (GValue *value,
gchar *v_string)
{
g_value_take_string (value, v_string);
}
void
g_value_take_string (GValue *value,
gchar *v_string)
{
g_return_if_fail (G_VALUE_HOLDS_STRING (value));

View File

@@ -97,9 +97,12 @@ GType g_pointer_type_register_static (const gchar *name);
gchar* g_strdup_value_contents (const GValue *value);
/* --- marshaller specific --- */
void g_value_take_string (GValue *value,
gchar *v_string);
#ifndef G_DISABLE_DEPRECATED
void g_value_set_string_take_ownership (GValue *value,
gchar *v_string);
#endif
/* humpf, need a C representable type name for G_TYPE_STRING */