mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
Migrating docs.
* docs/reference/gobject/tmpl/gboxed.sgml: * gobject/gboxed.c: * gobject/gboxed.h: * gobject/gvaluetypes.c: Migrating docs. svn path=/trunk/; revision=7065
This commit is contained in:
@@ -33,8 +33,25 @@ G_BEGIN_DECLS
|
||||
|
||||
|
||||
/* --- typedefs --- */
|
||||
typedef gpointer (*GBoxedCopyFunc) (gpointer boxed);
|
||||
typedef void (*GBoxedFreeFunc) (gpointer boxed);
|
||||
/**
|
||||
* GBoxedCopyFunc:
|
||||
* @boxed: The boxed structure to be copied.
|
||||
*
|
||||
* This function is provided by the user and should produce a copy of the passed
|
||||
* in boxed structure.
|
||||
*
|
||||
* Returns: The newly created copy of the boxed structure.
|
||||
*/
|
||||
typedef gpointer (*GBoxedCopyFunc) (gpointer boxed);
|
||||
|
||||
/**
|
||||
* GBoxedFreeFunc:
|
||||
* @boxed: The boxed structure to be freed.
|
||||
*
|
||||
* This function is provided by the user and should free the boxed
|
||||
* structure passed.
|
||||
*/
|
||||
typedef void (*GBoxedFreeFunc) (gpointer boxed);
|
||||
|
||||
|
||||
/* --- prototypes --- */
|
||||
@@ -60,11 +77,66 @@ GType g_boxed_type_register_static (const gchar *name,
|
||||
#define G_TYPE_CLOSURE (g_closure_get_type ())
|
||||
#define G_TYPE_VALUE (g_value_get_type ())
|
||||
#define G_TYPE_VALUE_ARRAY (g_value_array_get_type ())
|
||||
/**
|
||||
* G_TYPE_DATE:
|
||||
*
|
||||
* The #GType for #GDate.
|
||||
*/
|
||||
#define G_TYPE_DATE (g_date_get_type ())
|
||||
/**
|
||||
* G_TYPE_STRV:
|
||||
*
|
||||
* The #GType for a boxed type holding a %NULL-terminated array of strings.
|
||||
*
|
||||
* 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().
|
||||
*
|
||||
* |[
|
||||
* 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);
|
||||
* ]|
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
#define G_TYPE_STRV (g_strv_get_type ())
|
||||
/**
|
||||
* G_TYPE_GSTRING:
|
||||
*
|
||||
* The #GType for #GString.
|
||||
*/
|
||||
#define G_TYPE_GSTRING (g_gstring_get_type ())
|
||||
#define G_TYPE_HASH_TABLE (g_hash_table_get_type ())
|
||||
#define G_TYPE_REGEX (g_regex_get_type ())
|
||||
/**
|
||||
* G_TYPE_HASH_TABLE:
|
||||
*
|
||||
* The #GType for a boxed type holding a #GHashTable reference.
|
||||
*
|
||||
* Since: 2.10
|
||||
*/
|
||||
#define G_TYPE_HASH_TABLE (g_hash_table_get_type ())
|
||||
/**
|
||||
* G_TYPE_REGEX:
|
||||
*
|
||||
* The #GType for a boxed type holding a #GRegex reference.
|
||||
*
|
||||
* Since: 2.14
|
||||
*/
|
||||
#define G_TYPE_REGEX (g_regex_get_type ())
|
||||
|
||||
|
||||
void g_value_take_boxed (GValue *value,
|
||||
@@ -82,6 +154,11 @@ GType g_gstring_get_type (void) G_GNUC_CONST;
|
||||
GType g_hash_table_get_type (void) G_GNUC_CONST;
|
||||
GType g_regex_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/**
|
||||
* GStrv:
|
||||
*
|
||||
* A C representable type name for #G_TYPE_STRV.
|
||||
*/
|
||||
typedef gchar** GStrv;
|
||||
|
||||
G_END_DECLS
|
||||
|
Reference in New Issue
Block a user