G_TYPE_FROM_INTERFACE
G_TYPE_INSTANCE_GET_CLASS
G_TYPE_INSTANCE_GET_INTERFACE
+G_TYPE_INSTANCE_GET_PRIVATE
G_TYPE_CHECK_INSTANCE
G_TYPE_CHECK_INSTANCE_CAST
G_TYPE_CHECK_INSTANCE_TYPE
g_type_class_peek
g_type_class_unref
g_type_class_peek_parent
+g_type_class_add_private
g_type_interface_peek
g_type_interface_peek_parent
g_type_children
g_type_check_is_value_type
g_type_check_value
g_type_check_value_holds
+g_type_instance_get_private
g_type_test_flags
g_type_name_from_instance
g_type_name_from_class
@c_type: The corresponding C type of @g_type.
+<!-- ##### MACRO G_TYPE_INSTANCE_GET_PRIVATE ##### -->
+<para>
+Gets the private structure for a particular type.
+The private structure must have been registered in the
+class_init function with g_type_class_add_private().
+</para>
+
+@instance: the instance of a type deriving from @private_type.
+@g_type: the type identifying which private data to retrieve.
+@c_type: The C type for the private structure.
+
<!-- ##### MACRO G_TYPE_CHECK_INSTANCE ##### -->
<para>
@Returns: The parent class of @g_class.
+<!-- ##### FUNCTION g_type_class_add_private ##### -->
+<para>
+Registers a private structure for a instantiatable type;
+when an object is allocated, the private structures for
+the type and and all of its parent types are allocated
+sequentially in the same memory block as the public
+structures. This function should be called in the
+type's class_init() function. The private structure can
+be retrieved using the G_TYPE_INSTANCE_GET_PRIVATE() macro.
+The following example shows attaching a private structure
+<structname>MyObjectPrivate</structname> to an object
+<structname>MyObject</structname> defined in the standard GObject
+fashion.
+</para>
+<programlisting>
+typedef struct _MyObjectPrivate MyObjectPrivate;
+
+struct _MyObjectPrivate {
+ int some_field;
+};
+
+#define MY_OBJECT_GET_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), MY_TYPE_OBJECT, MyObjectPrivate))
+
+static void
+my_object_class_init (MyObjectClass *klass)
+{
+ g_type_class_add_private (klass, sizeof (MyObjectPrivate));
+}
+
+static int
+my_object_get_some_field (MyObject *my_object)
+{
+ MyObjectPrivate *priv = MY_OBJECT_GET_PRIVATE (my_object);
+
+ return priv->some_field;
+}
+</programlisting>
+
+@g_class: class structure for an instantiatable type
+@private_size: size of private structure.
+
<!-- ##### FUNCTION g_type_interface_peek ##### -->
<para>
Returns the #GTypeInterface structure of an interface to which the passed in
@n_prerequisites: location to return the number of prerequisites, or %NULL
@Returns: a newly-allocated zero-terminated array of #GType containing
the prerequisites of @interface_type
-<!-- # Unused Parameters # -->
@Since: 2.2
</para>
-
-
+<!--
+Local variables:
+mode: sgml
+sgml-parent-document: ("../gobject-docs.sgml" "book" "refsect2" "")
+End:
+-->
@maximum: maximum value for the property specified
@default_value: default value for the property specified
@flags: flags for the property specified
-@Returns: a newly created parameter specification
+@Returns: a newly created parameter specification
<!-- ##### FUNCTION g_value_set_double ##### -->
@element_spec: a #GParamSpec describing the elements contained in
arrays of this property, may be %NULL
@flags: flags for the property specified
-@Returns: a newly created parameter specification
+@Returns: a newly created parameter specification