2000-11-11 01:03:57 +01:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
2001-09-10 20:03:31 +02:00
|
|
|
GBoxed
|
2000-11-11 01:03:57 +01:00
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2002-11-23 23:57:35 +01:00
|
|
|
A mechanism to wrap opaque C structures registered by the type system
|
2000-11-11 01:03:57 +01:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
2005-05-09 07:25:21 +02:00
|
|
|
GBoxed is a generic wrapper mechanism for arbitrary C structures. The only
|
|
|
|
thing the type system needs to know about the structures is how to copy and
|
|
|
|
free them, beyond that they are treated as opaque chunks of memory.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Boxed types are useful for simple value-holder structures like rectangles or
|
|
|
|
points. They can also be used for wrapping structures defined in non-GObject
|
|
|
|
based libraries.
|
2000-11-11 01:03:57 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
2001-09-10 20:03:31 +02:00
|
|
|
#GParamSpecBoxed, g_param_spec_boxed()
|
2000-11-11 01:03:57 +01:00
|
|
|
</para>
|
|
|
|
|
2005-05-05 16:57:29 +02:00
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
2000-11-11 01:03:57 +01:00
|
|
|
<!-- ##### USER_FUNCTION GBoxedCopyFunc ##### -->
|
|
|
|
<para>
|
2001-09-10 20:03:31 +02:00
|
|
|
This function is provided by the user and should produce a copy of the passed
|
|
|
|
in boxed structure.
|
2000-11-11 01:03:57 +01:00
|
|
|
</para>
|
|
|
|
|
2001-09-10 20:03:31 +02:00
|
|
|
@boxed: The boxed structure to be copied.
|
|
|
|
@Returns: The newly created copy of the boxed structure.
|
2000-11-11 01:03:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### USER_FUNCTION GBoxedFreeFunc ##### -->
|
|
|
|
<para>
|
2001-09-10 20:03:31 +02:00
|
|
|
This function is provided by the user and should free the boxed
|
|
|
|
structure passed.
|
2000-11-11 01:03:57 +01:00
|
|
|
</para>
|
|
|
|
|
2001-09-10 20:03:31 +02:00
|
|
|
@boxed: The boxed structure to be freed.
|
2000-11-11 01:03:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_boxed_copy ##### -->
|
|
|
|
<para>
|
2001-09-10 20:03:31 +02:00
|
|
|
Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
|
2000-11-11 01:03:57 +01:00
|
|
|
</para>
|
|
|
|
|
2001-09-10 20:03:31 +02:00
|
|
|
@boxed_type: The type of @src_boxed.
|
|
|
|
@src_boxed: The boxed structure to be copied.
|
|
|
|
@Returns: The newly created copy of the boxed structure.
|
2000-11-11 01:03:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_boxed_free ##### -->
|
|
|
|
<para>
|
2001-09-10 20:03:31 +02:00
|
|
|
Free the boxed structure @boxed which is of type @boxed_type.
|
2000-11-11 01:03:57 +01:00
|
|
|
</para>
|
|
|
|
|
2001-09-10 20:03:31 +02:00
|
|
|
@boxed_type: The type of @boxed.
|
|
|
|
@boxed: The boxed structure to be freed.
|
2000-11-11 01:03:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION g_boxed_type_register_static ##### -->
|
|
|
|
<para>
|
2001-09-10 20:03:31 +02:00
|
|
|
This function creates a new %G_TYPE_BOXED derived type id for a new
|
|
|
|
boxed type with name @name. Boxed type handling functions have to be
|
|
|
|
provided to copy and free opaque boxed structures of this type.
|
2000-11-11 01:03:57 +01:00
|
|
|
</para>
|
|
|
|
|
2001-09-10 20:03:31 +02:00
|
|
|
@name: Name of the new boxed type.
|
|
|
|
@boxed_copy: Boxed structure copy function.
|
|
|
|
@boxed_free: Boxed structure free function.
|
|
|
|
@Returns: New %G_TYPE_BOXED derived type id for @name.
|
2000-11-11 01:03:57 +01:00
|
|
|
|
|
|
|
|
2001-11-14 02:08:19 +01:00
|
|
|
<!-- ##### FUNCTION g_pointer_type_register_static ##### -->
|
|
|
|
<para>
|
2003-10-18 01:33:03 +02:00
|
|
|
Creates a new %G_TYPE_POINTER derived type id for a new
|
|
|
|
pointer type with name @name.
|
2001-11-14 02:08:19 +01:00
|
|
|
</para>
|
|
|
|
|
2003-10-18 01:33:03 +02:00
|
|
|
@name: the name of the new pointer type.
|
|
|
|
@Returns: a new %G_TYPE_POINTER derived type id for @name.
|
2001-11-14 02:08:19 +01:00
|
|
|
|
|
|
|
|
2005-04-29 20:33:41 +02:00
|
|
|
<!-- ##### MACRO G_TYPE_DATE ##### -->
|
|
|
|
<para>
|
|
|
|
The #GType for #GDate.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-11-22 19:54:47 +01:00
|
|
|
<!-- ##### MACRO G_TYPE_GSTRING ##### -->
|
|
|
|
<para>
|
2002-12-09 20:06:42 +01:00
|
|
|
The #GType for #GString.
|
2001-11-22 19:54:47 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-01-09 23:39:55 +01:00
|
|
|
<!-- ##### MACRO G_TYPE_STRV ##### -->
|
|
|
|
<para>
|
|
|
|
The #GType for a boxed type holding a %NULL-terminated array of strings.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The code fragments in the following example show the use of a property of
|
|
|
|
type #G_TYPE_STRV with g_object_class_install_property(), g_object_set()
|
|
|
|
and g_object_get().
|
|
|
|
</para>
|
|
|
|
<informalexample><programlisting>
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_AUTHORS,
|
|
|
|
g_param_spec_boxed ("authors",
|
|
|
|
_("Authors"),
|
|
|
|
_("List of authors"),
|
|
|
|
G_TYPE_STRV,
|
|
|
|
G_PARAM_READWRITE));
|
|
|
|
|
|
|
|
|
|
|
|
gchar *authors[] = { "Owen", "Tim", NULL };
|
|
|
|
g_object_set (obj, "authors", authors, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
gchar *writers[];
|
|
|
|
g_object_get (obj, "authors", &writers, NULL);
|
|
|
|
/* do something with writers */
|
|
|
|
g_strfreev (writers);
|
|
|
|
</programlisting></informalexample>
|
|
|
|
|
|
|
|
@Since: 2.4
|
|
|
|
|
2004-01-10 01:34:26 +01:00
|
|
|
|
2004-01-09 23:39:55 +01:00
|
|
|
<!-- ##### TYPEDEF GStrv ##### -->
|
|
|
|
<para>
|
|
|
|
A C representable type name for #G_TYPE_STRV.
|
|
|
|
</para>
|
|
|
|
|
2004-01-10 01:34:26 +01:00
|
|
|
|