| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>Type Information</title> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> |
| <link rel="home" href="index.html" title="GObject Reference Manual"> |
| <link rel="up" href="rn01.html" title="API Reference"> |
| <link rel="prev" href="rn01.html" title="API Reference"> |
| <link rel="next" href="GTypePlugin.html" title="GTypePlugin"> |
| <meta name="generator" content="GTK-Doc V1.14 (XML mode)"> |
| <link rel="stylesheet" href="style.css" type="text/css"> |
| </head> |
| <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> |
| <tr valign="middle"> |
| <td><a accesskey="p" href="rn01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> |
| <td><a accesskey="u" href="rn01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> |
| <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> |
| <th width="100%" align="center">GObject Reference Manual</th> |
| <td><a accesskey="n" href="GTypePlugin.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> |
| </tr> |
| <tr><td colspan="5" class="shortcuts"> |
| <a href="#gobject-Type-Information.synopsis" class="shortcut">Top</a> |
| | |
| <a href="#gobject-Type-Information.description" class="shortcut">Description</a> |
| </td></tr> |
| </table> |
| <div class="refentry" title="Type Information"> |
| <a name="gobject-Type-Information"></a><div class="titlepage"></div> |
| <div class="refnamediv"><table width="100%"><tr> |
| <td valign="top"> |
| <h2><span class="refentrytitle"><a name="gobject-Type-Information.top_of_page"></a>Type Information</span></h2> |
| <p>Type Information — The GLib Runtime type identification and |
| management system</p> |
| </td> |
| <td valign="top" align="right"></td> |
| </tr></table></div> |
| <div class="refsynopsisdiv" title="Synopsis"> |
| <a name="gobject-Type-Information.synopsis"></a><h2>Synopsis</h2> |
| <pre class="synopsis"> |
| #include <glib-object.h> |
| |
| typedef <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a>; |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-FUNDAMENTAL:CAPS" title="G_TYPE_FUNDAMENTAL()">G_TYPE_FUNDAMENTAL</a> (type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-FUNDAMENTAL-MAX:CAPS" title="G_TYPE_FUNDAMENTAL_MAX">G_TYPE_FUNDAMENTAL_MAX</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-MAKE-FUNDAMENTAL:CAPS" title="G_TYPE_MAKE_FUNDAMENTAL()">G_TYPE_MAKE_FUNDAMENTAL</a> (x) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-ABSTRACT:CAPS" title="G_TYPE_IS_ABSTRACT()">G_TYPE_IS_ABSTRACT</a> (type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-DERIVED:CAPS" title="G_TYPE_IS_DERIVED()">G_TYPE_IS_DERIVED</a> (type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-FUNDAMENTAL:CAPS" title="G_TYPE_IS_FUNDAMENTAL()">G_TYPE_IS_FUNDAMENTAL</a> (type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-VALUE-TYPE:CAPS" title="G_TYPE_IS_VALUE_TYPE()">G_TYPE_IS_VALUE_TYPE</a> (type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-HAS-VALUE-TABLE:CAPS" title="G_TYPE_HAS_VALUE_TABLE()">G_TYPE_HAS_VALUE_TABLE</a> (type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-CLASSED:CAPS" title="G_TYPE_IS_CLASSED()">G_TYPE_IS_CLASSED</a> (type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-INSTANTIATABLE:CAPS" title="G_TYPE_IS_INSTANTIATABLE()">G_TYPE_IS_INSTANTIATABLE</a> (type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-DERIVABLE:CAPS" title="G_TYPE_IS_DERIVABLE()">G_TYPE_IS_DERIVABLE</a> (type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-DEEP-DERIVABLE:CAPS" title="G_TYPE_IS_DEEP_DERIVABLE()">G_TYPE_IS_DEEP_DERIVABLE</a> (type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-INTERFACE:CAPS" title="G_TYPE_IS_INTERFACE()">G_TYPE_IS_INTERFACE</a> (type) |
| <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="GTypeInterface">GTypeInterface</a>; |
| <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance">GTypeInstance</a>; |
| <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass">GTypeClass</a>; |
| <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo">GTypeInfo</a>; |
| <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="GTypeFundamentalInfo">GTypeFundamentalInfo</a>; |
| <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="GInterfaceInfo">GInterfaceInfo</a>; |
| <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable">GTypeValueTable</a>; |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-FROM-INSTANCE:CAPS" title="G_TYPE_FROM_INSTANCE()">G_TYPE_FROM_INSTANCE</a> (instance) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-FROM-CLASS:CAPS" title="G_TYPE_FROM_CLASS()">G_TYPE_FROM_CLASS</a> (g_class) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-FROM-INTERFACE:CAPS" title="G_TYPE_FROM_INTERFACE()">G_TYPE_FROM_INTERFACE</a> (g_iface) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-INSTANCE-GET-CLASS:CAPS" title="G_TYPE_INSTANCE_GET_CLASS()">G_TYPE_INSTANCE_GET_CLASS</a> (instance, |
| g_type, |
| c_type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-INSTANCE-GET-INTERFACE:CAPS" title="G_TYPE_INSTANCE_GET_INTERFACE()">G_TYPE_INSTANCE_GET_INTERFACE</a> (instance, |
| g_type, |
| c_type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-INSTANCE-GET-PRIVATE:CAPS" title="G_TYPE_INSTANCE_GET_PRIVATE()">G_TYPE_INSTANCE_GET_PRIVATE</a> (instance, |
| g_type, |
| c_type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-INSTANCE:CAPS" title="G_TYPE_CHECK_INSTANCE()">G_TYPE_CHECK_INSTANCE</a> (instance) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-INSTANCE-CAST:CAPS" title="G_TYPE_CHECK_INSTANCE_CAST()">G_TYPE_CHECK_INSTANCE_CAST</a> (instance, |
| g_type, |
| c_type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-INSTANCE-TYPE:CAPS" title="G_TYPE_CHECK_INSTANCE_TYPE()">G_TYPE_CHECK_INSTANCE_TYPE</a> (instance, |
| g_type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-CLASS-CAST:CAPS" title="G_TYPE_CHECK_CLASS_CAST()">G_TYPE_CHECK_CLASS_CAST</a> (g_class, |
| g_type, |
| c_type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-CLASS-TYPE:CAPS" title="G_TYPE_CHECK_CLASS_TYPE()">G_TYPE_CHECK_CLASS_TYPE</a> (g_class, |
| g_type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-VALUE:CAPS" title="G_TYPE_CHECK_VALUE()">G_TYPE_CHECK_VALUE</a> (value) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-VALUE-TYPE:CAPS" title="G_TYPE_CHECK_VALUE_TYPE()">G_TYPE_CHECK_VALUE_TYPE</a> (value, |
| g_type) |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-FLAG-RESERVED-ID-BIT:CAPS" title="G_TYPE_FLAG_RESERVED_ID_BIT">G_TYPE_FLAG_RESERVED_ID_BIT</a> |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-init" title="g_type_init ()">g_type_init</a> (<em class="parameter"><code><span class="type">void</span></code></em>); |
| enum <a class="link" href="gobject-Type-Information.html#GTypeDebugFlags" title="enum GTypeDebugFlags">GTypeDebugFlags</a>; |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-init-with-debug-flags" title="g_type_init_with_debug_flags ()">g_type_init_with_debug_flags</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeDebugFlags" title="enum GTypeDebugFlags"><span class="type">GTypeDebugFlags</span></a> debug_flags</code></em>); |
| const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="gobject-Type-Information.html#g-type-name" title="g_type_name ()">g_type_name</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>); |
| <a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a> <a class="link" href="gobject-Type-Information.html#g-type-qname" title="g_type_qname ()">g_type_qname</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> <a class="link" href="gobject-Type-Information.html#g-type-from-name" title="g_type_from_name ()">g_type_from_name</a> (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> <a class="link" href="gobject-Type-Information.html#g-type-parent" title="g_type_parent ()">g_type_parent</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gobject-Type-Information.html#g-type-depth" title="g_type_depth ()">g_type_depth</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> <a class="link" href="gobject-Type-Information.html#g-type-next-base" title="g_type_next_base ()">g_type_next_base</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> leaf_type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> root_type</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gobject-Type-Information.html#g-type-is-a" title="g_type_is_a ()">g_type_is_a</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> is_a_type</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="gobject-Type-Information.html#g-type-class-ref" title="g_type_class_ref ()">g_type_class_ref</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="gobject-Type-Information.html#g-type-class-peek" title="g_type_class_peek ()">g_type_class_peek</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="gobject-Type-Information.html#g-type-class-peek-static" title="g_type_class_peek_static ()">g_type_class_peek_static</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-class-unref" title="g_type_class_unref ()">g_type_class_unref</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="gobject-Type-Information.html#g-type-class-peek-parent" title="g_type_class_peek_parent ()">g_type_class_peek_parent</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-class-add-private" title="g_type_class_add_private ()">g_type_class_add_private</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> private_size</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-add-class-private" title="g_type_add_class_private ()">g_type_add_class_private</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> class_type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> private_size</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="gobject-Type-Information.html#g-type-interface-peek" title="g_type_interface_peek ()">g_type_interface_peek</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> instance_class</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> iface_type</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="gobject-Type-Information.html#g-type-interface-peek-parent" title="g_type_interface_peek_parent ()">g_type_interface_peek_parent</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="gobject-Type-Information.html#g-type-default-interface-ref" title="g_type_default_interface_ref ()">g_type_default_interface_ref</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> g_type</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="gobject-Type-Information.html#g-type-default-interface-peek" title="g_type_default_interface_peek ()">g_type_default_interface_peek</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> g_type</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-default-interface-unref" title="g_type_default_interface_unref ()">g_type_default_interface_unref</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>* <a class="link" href="gobject-Type-Information.html#g-type-children" title="g_type_children ()">g_type_children</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_children</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>* <a class="link" href="gobject-Type-Information.html#g-type-interfaces" title="g_type_interfaces ()">g_type_interfaces</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_interfaces</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>* <a class="link" href="gobject-Type-Information.html#g-type-interface-prerequisites" title="g_type_interface_prerequisites ()">g_type_interface_prerequisites</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_prerequisites</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-set-qdata" title="g_type_set_qdata ()">g_type_set_qdata</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> quark</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="gobject-Type-Information.html#g-type-get-qdata" title="g_type_get_qdata ()">g_type_get_qdata</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> quark</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-query" title="g_type_query ()">g_type_query</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeQuery" title="GTypeQuery"><span class="type">GTypeQuery</span></a> *query</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GTypeQuery" title="GTypeQuery">GTypeQuery</a>; |
| <span class="returnvalue">void</span> (<a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()">*GBaseInitFunc</a>) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>); |
| <span class="returnvalue">void</span> (<a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()">*GBaseFinalizeFunc</a>) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>); |
| <span class="returnvalue">void</span> (<a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()">*GClassInitFunc</a>) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> class_data</code></em>); |
| <span class="returnvalue">void</span> (<a class="link" href="gobject-Type-Information.html#GClassFinalizeFunc" title="GClassFinalizeFunc ()">*GClassFinalizeFunc</a>) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> class_data</code></em>); |
| <span class="returnvalue">void</span> (<a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()">*GInstanceInitFunc</a>) (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> *instance</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>); |
| <span class="returnvalue">void</span> (<a class="link" href="gobject-Type-Information.html#GInterfaceInitFunc" title="GInterfaceInitFunc ()">*GInterfaceInitFunc</a>) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> iface_data</code></em>); |
| <span class="returnvalue">void</span> (<a class="link" href="gobject-Type-Information.html#GInterfaceFinalizeFunc" title="GInterfaceFinalizeFunc ()">*GInterfaceFinalizeFunc</a>) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> iface_data</code></em>); |
| <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (<a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()">*GTypeClassCacheFunc</a>) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> *g_class</code></em>); |
| enum <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags">GTypeFlags</a>; |
| enum <a class="link" href="gobject-Type-Information.html#GTypeFundamentalFlags" title="enum GTypeFundamentalFlags">GTypeFundamentalFlags</a>; |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()">g_type_register_static</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>, |
| <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>, |
| <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> *info</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> <a class="link" href="gobject-Type-Information.html#g-type-register-static-simple" title="g_type_register_static_simple ()">g_type_register_static_simple</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>, |
| <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> class_size</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><span class="type">GClassInitFunc</span></a> class_init</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> instance_size</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()"><span class="type">GInstanceInitFunc</span></a> instance_init</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> <a class="link" href="gobject-Type-Information.html#g-type-register-dynamic" title="g_type_register_dynamic ()">g_type_register_dynamic</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>, |
| <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>, |
| <em class="parameter"><code><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> *plugin</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> <a class="link" href="gobject-Type-Information.html#g-type-register-fundamental" title="g_type_register_fundamental ()">g_type_register_fundamental</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type_id</code></em>, |
| <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>, |
| <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> *info</code></em>, |
| <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> *finfo</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-add-interface-static" title="g_type_add_interface_static ()">g_type_add_interface_static</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>, |
| <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> *info</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-add-interface-dynamic" title="g_type_add_interface_dynamic ()">g_type_add_interface_dynamic</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>, |
| <em class="parameter"><code><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> *plugin</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-interface-add-prerequisite" title="g_type_interface_add_prerequisite ()">g_type_interface_add_prerequisite</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> prerequisite_type</code></em>); |
| <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="returnvalue">GTypePlugin</span></a>* <a class="link" href="gobject-Type-Information.html#g-type-get-plugin" title="g_type_get_plugin ()">g_type_get_plugin</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>); |
| <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="returnvalue">GTypePlugin</span></a>* <a class="link" href="gobject-Type-Information.html#g-type-interface-get-plugin" title="g_type_interface_get_plugin ()">g_type_interface_get_plugin</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> <a class="link" href="gobject-Type-Information.html#g-type-fundamental-next" title="g_type_fundamental_next ()">g_type_fundamental_next</a> (<em class="parameter"><code><span class="type">void</span></code></em>); |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> <a class="link" href="gobject-Type-Information.html#g-type-fundamental" title="g_type_fundamental ()">g_type_fundamental</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type_id</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="returnvalue">GTypeInstance</span></a>* <a class="link" href="gobject-Type-Information.html#g-type-create-instance" title="g_type_create_instance ()">g_type_create_instance</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-free-instance" title="g_type_free_instance ()">g_type_free_instance</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> *instance</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-add-class-cache-func" title="g_type_add_class_cache_func ()">g_type_add_class_cache_func</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> cache_func</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-remove-class-cache-func" title="g_type_remove_class_cache_func ()">g_type_remove_class_cache_func</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> cache_func</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-class-unref-uncached" title="g_type_class_unref_uncached ()">g_type_class_unref_uncached</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()">g_type_add_interface_check</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()"><span class="type">GTypeInterfaceCheckFunc</span></a> check_func</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="gobject-Type-Information.html#g-type-remove-interface-check" title="g_type_remove_interface_check ()">g_type_remove_interface_check</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()"><span class="type">GTypeInterfaceCheckFunc</span></a> check_func</code></em>); |
| <span class="returnvalue">void</span> (<a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()">*GTypeInterfaceCheckFunc</a>) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>); |
| <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="returnvalue">GTypeValueTable</span></a>* <a class="link" href="gobject-Type-Information.html#g-type-value-table-peek" title="g_type_value_table_peek ()">g_type_value_table_peek</a> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>); |
| #define <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()">G_DEFINE_TYPE</a> (TN, |
| t_n, |
| T_P) |
| #define <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-CODE:CAPS" title="G_DEFINE_TYPE_WITH_CODE()">G_DEFINE_TYPE_WITH_CODE</a> (TN, |
| t_n, |
| T_P, |
| _C_) |
| #define <a class="link" href="gobject-Type-Information.html#G-DEFINE-ABSTRACT-TYPE:CAPS" title="G_DEFINE_ABSTRACT_TYPE()">G_DEFINE_ABSTRACT_TYPE</a> (TN, |
| t_n, |
| T_P) |
| #define <a class="link" href="gobject-Type-Information.html#G-DEFINE-ABSTRACT-TYPE-WITH-CODE:CAPS" title="G_DEFINE_ABSTRACT_TYPE_WITH_CODE()">G_DEFINE_ABSTRACT_TYPE_WITH_CODE</a> (TN, |
| t_n, |
| T_P, |
| _C_) |
| #define <a class="link" href="gobject-Type-Information.html#G-DEFINE-INTERFACE:CAPS" title="G_DEFINE_INTERFACE()">G_DEFINE_INTERFACE</a> (TN, |
| t_n, |
| T_P) |
| #define <a class="link" href="gobject-Type-Information.html#G-DEFINE-INTERFACE-WITH-CODE:CAPS" title="G_DEFINE_INTERFACE_WITH_CODE()">G_DEFINE_INTERFACE_WITH_CODE</a> (TN, |
| t_n, |
| T_P, |
| _C_) |
| #define <a class="link" href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS" title="G_IMPLEMENT_INTERFACE()">G_IMPLEMENT_INTERFACE</a> (TYPE_IFACE, |
| iface_init) |
| #define <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()">G_DEFINE_TYPE_EXTENDED</a> (TN, |
| t_n, |
| T_P, |
| _f_, |
| _C_) |
| |
| |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID">G_TYPE_INVALID</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-NONE:CAPS" title="G_TYPE_NONE">G_TYPE_NONE</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-INTERFACE:CAPS" title="G_TYPE_INTERFACE">G_TYPE_INTERFACE</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-CHAR:CAPS" title="G_TYPE_CHAR">G_TYPE_CHAR</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-UCHAR:CAPS" title="G_TYPE_UCHAR">G_TYPE_UCHAR</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-BOOLEAN:CAPS" title="G_TYPE_BOOLEAN">G_TYPE_BOOLEAN</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-INT:CAPS" title="G_TYPE_INT">G_TYPE_INT</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-UINT:CAPS" title="G_TYPE_UINT">G_TYPE_UINT</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-LONG:CAPS" title="G_TYPE_LONG">G_TYPE_LONG</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-ULONG:CAPS" title="G_TYPE_ULONG">G_TYPE_ULONG</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-INT64:CAPS" title="G_TYPE_INT64">G_TYPE_INT64</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-UINT64:CAPS" title="G_TYPE_UINT64">G_TYPE_UINT64</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-ENUM:CAPS" title="G_TYPE_ENUM">G_TYPE_ENUM</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-FLAGS:CAPS" title="G_TYPE_FLAGS">G_TYPE_FLAGS</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-FLOAT:CAPS" title="G_TYPE_FLOAT">G_TYPE_FLOAT</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-DOUBLE:CAPS" title="G_TYPE_DOUBLE">G_TYPE_DOUBLE</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-STRING:CAPS" title="G_TYPE_STRING">G_TYPE_STRING</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-POINTER:CAPS" title="G_TYPE_POINTER">G_TYPE_POINTER</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-BOXED:CAPS" title="G_TYPE_BOXED">G_TYPE_BOXED</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-PARAM:CAPS" title="G_TYPE_PARAM">G_TYPE_PARAM</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-OBJECT:CAPS" title="G_TYPE_OBJECT">G_TYPE_OBJECT</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-GTYPE:CAPS" title="G_TYPE_GTYPE">G_TYPE_GTYPE</a> |
| |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-RESERVED-GLIB-FIRST:CAPS" title="G_TYPE_RESERVED_GLIB_FIRST">G_TYPE_RESERVED_GLIB_FIRST</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-RESERVED-GLIB-LAST:CAPS" title="G_TYPE_RESERVED_GLIB_LAST">G_TYPE_RESERVED_GLIB_LAST</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-RESERVED-BSE-FIRST:CAPS" title="G_TYPE_RESERVED_BSE_FIRST">G_TYPE_RESERVED_BSE_FIRST</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-RESERVED-BSE-LAST:CAPS" title="G_TYPE_RESERVED_BSE_LAST">G_TYPE_RESERVED_BSE_LAST</a> |
| #define <a class="link" href="gobject-Type-Information.html#G-TYPE-RESERVED-USER-FIRST:CAPS" title="G_TYPE_RESERVED_USER_FIRST">G_TYPE_RESERVED_USER_FIRST</a> |
| </pre> |
| </div> |
| <div class="refsect1" title="Description"> |
| <a name="gobject-Type-Information.description"></a><h2>Description</h2> |
| <p> |
| The GType API is the foundation of the GObject system. It provides the |
| facilities for registering and managing all fundamental data types, |
| user-defined object and interface types. Before using any GType |
| or GObject functions, <a class="link" href="gobject-Type-Information.html#g-type-init" title="g_type_init ()"><code class="function">g_type_init()</code></a> must be called to initialize the |
| type system. |
| </p> |
| <p> |
| For type creation and registration purposes, all types fall into one of |
| two categories: static or dynamic. Static types are never loaded or |
| unloaded at run-time as dynamic types may be. Static types are created |
| with <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()"><code class="function">g_type_register_static()</code></a> that gets type specific information passed |
| in via a <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> structure. |
| Dynamic types are created with <a class="link" href="gobject-Type-Information.html#g-type-register-dynamic" title="g_type_register_dynamic ()"><code class="function">g_type_register_dynamic()</code></a> which takes a |
| <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure instead. The remaining type information (the |
| <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> structure) is retrieved during runtime through <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> |
| and the g_type_plugin_*() API. |
| These registration functions are usually called only once from a |
| function whose only purpose is to return the type identifier for a |
| specific class. Once the type (or class or interface) is registered, |
| it may be instantiated, inherited, or implemented depending on exactly |
| what sort of type it is. |
| There is also a third registration function for registering fundamental |
| types called <a class="link" href="gobject-Type-Information.html#g-type-register-fundamental" title="g_type_register_fundamental ()"><code class="function">g_type_register_fundamental()</code></a> which requires both a <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> |
| structure and a <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> structure but it is seldom used |
| since most fundamental types are predefined rather than user-defined. |
| </p> |
| <p> |
| A final word about type names. |
| Such an identifier needs to be at least three characters long. There is no |
| upper length limit. The first character needs to be a letter (a-z or A-Z) |
| or an underscore '_'. Subsequent characters can be letters, numbers or |
| any of '-_+'. |
| </p> |
| </div> |
| <div class="refsect1" title="Details"> |
| <a name="gobject-Type-Information.details"></a><h2>Details</h2> |
| <div class="refsect2" title="GType"> |
| <a name="GType"></a><h3>GType</h3> |
| <p> |
| A numerical value which represents the unique identifier of a registered |
| type. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_FUNDAMENTAL()"> |
| <a name="G-TYPE-FUNDAMENTAL:CAPS"></a><h3>G_TYPE_FUNDAMENTAL()</h3> |
| <pre class="programlisting">#define G_TYPE_FUNDAMENTAL(type) (g_type_fundamental (type)) |
| </pre> |
| <p> |
| The fundamental type which is the ancestor of <em class="parameter"><code>type</code></em>. |
| Fundamental types are types that serve as ultimate bases for the derived types, |
| thus they are the roots of distinct inheritance hierarchies. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_FUNDAMENTAL_MAX"> |
| <a name="G-TYPE-FUNDAMENTAL-MAX:CAPS"></a><h3>G_TYPE_FUNDAMENTAL_MAX</h3> |
| <pre class="programlisting">#define G_TYPE_FUNDAMENTAL_MAX (255 << G_TYPE_FUNDAMENTAL_SHIFT) |
| </pre> |
| <p> |
| An integer constant that represents the number of identifiers reserved |
| for types that are assigned at compile-time. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_MAKE_FUNDAMENTAL()"> |
| <a name="G-TYPE-MAKE-FUNDAMENTAL:CAPS"></a><h3>G_TYPE_MAKE_FUNDAMENTAL()</h3> |
| <pre class="programlisting">#define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) |
| </pre> |
| <p> |
| Get the type ID for the fundamental type number <em class="parameter"><code>x</code></em>. |
| Use <a class="link" href="gobject-Type-Information.html#g-type-fundamental-next" title="g_type_fundamental_next ()"><code class="function">g_type_fundamental_next()</code></a> instead of this macro to create new fundamental |
| types. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td> |
| <td>the fundamental type number. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the GType |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_IS_ABSTRACT()"> |
| <a name="G-TYPE-IS-ABSTRACT:CAPS"></a><h3>G_TYPE_IS_ABSTRACT()</h3> |
| <pre class="programlisting">#define G_TYPE_IS_ABSTRACT(type) (g_type_test_flags ((type), G_TYPE_FLAG_ABSTRACT)) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>type</code></em> is an abstract type. An abstract type can not be |
| instantiated and is normally used as an abstract base class for |
| derived classes. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_IS_DERIVED()"> |
| <a name="G-TYPE-IS-DERIVED:CAPS"></a><h3>G_TYPE_IS_DERIVED()</h3> |
| <pre class="programlisting">#define G_TYPE_IS_DERIVED(type) ((type) > G_TYPE_FUNDAMENTAL_MAX) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>type</code></em> is derived (or in object-oriented terminology: |
| inherited) from another type (this holds true for all non-fundamental |
| types). |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_IS_FUNDAMENTAL()"> |
| <a name="G-TYPE-IS-FUNDAMENTAL:CAPS"></a><h3>G_TYPE_IS_FUNDAMENTAL()</h3> |
| <pre class="programlisting">#define G_TYPE_IS_FUNDAMENTAL(type) ((type) <= G_TYPE_FUNDAMENTAL_MAX) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>type</code></em> is a fundamental type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_IS_VALUE_TYPE()"> |
| <a name="G-TYPE-IS-VALUE-TYPE:CAPS"></a><h3>G_TYPE_IS_VALUE_TYPE()</h3> |
| <pre class="programlisting">#define G_TYPE_IS_VALUE_TYPE(type) (g_type_check_is_value_type (type)) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>type</code></em> is a value type and can be used with <a class="link" href="gobject-Generic-values.html#g-value-init" title="g_value_init ()"><code class="function">g_value_init()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_HAS_VALUE_TABLE()"> |
| <a name="G-TYPE-HAS-VALUE-TABLE:CAPS"></a><h3>G_TYPE_HAS_VALUE_TABLE()</h3> |
| <pre class="programlisting">#define G_TYPE_HAS_VALUE_TABLE(type) (g_type_value_table_peek (type) != NULL) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>type</code></em> has a <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="type">GTypeValueTable</span></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_IS_CLASSED()"> |
| <a name="G-TYPE-IS-CLASSED:CAPS"></a><h3>G_TYPE_IS_CLASSED()</h3> |
| <pre class="programlisting">#define G_TYPE_IS_CLASSED(type) (g_type_test_flags ((type), G_TYPE_FLAG_CLASSED)) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>type</code></em> is a classed type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_IS_INSTANTIATABLE()"> |
| <a name="G-TYPE-IS-INSTANTIATABLE:CAPS"></a><h3>G_TYPE_IS_INSTANTIATABLE()</h3> |
| <pre class="programlisting">#define G_TYPE_IS_INSTANTIATABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_INSTANTIATABLE)) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>type</code></em> can be instantiated. Instantiation is the |
| process of creating an instance (object) of this type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_IS_DERIVABLE()"> |
| <a name="G-TYPE-IS-DERIVABLE:CAPS"></a><h3>G_TYPE_IS_DERIVABLE()</h3> |
| <pre class="programlisting">#define G_TYPE_IS_DERIVABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_DERIVABLE)) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>type</code></em> is a derivable type. A derivable type can |
| be used as the base class of a flat (single-level) class hierarchy. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_IS_DEEP_DERIVABLE()"> |
| <a name="G-TYPE-IS-DEEP-DERIVABLE:CAPS"></a><h3>G_TYPE_IS_DEEP_DERIVABLE()</h3> |
| <pre class="programlisting">#define G_TYPE_IS_DEEP_DERIVABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_DEEP_DERIVABLE)) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>type</code></em> is a deep derivable type. A deep derivable type |
| can be used as the base class of a deep (multi-level) class hierarchy. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_IS_INTERFACE()"> |
| <a name="G-TYPE-IS-INTERFACE:CAPS"></a><h3>G_TYPE_IS_INTERFACE()</h3> |
| <pre class="programlisting">#define G_TYPE_IS_INTERFACE(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_INTERFACE) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>type</code></em> is an interface type. |
| An interface type provides a pure API, the implementation |
| of which is provided by another type (which is then said to conform |
| to the interface). GLib interfaces are somewhat analogous to Java |
| interfaces and C++ classes containing only pure virtual functions, |
| with the difference that GType interfaces are not derivable (but see |
| <a class="link" href="gobject-Type-Information.html#g-type-interface-add-prerequisite" title="g_type_interface_add_prerequisite ()"><code class="function">g_type_interface_add_prerequisite()</code></a> for an alternative). |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GTypeInterface"> |
| <a name="GTypeInterface"></a><h3>GTypeInterface</h3> |
| <pre class="programlisting">typedef struct { |
| } GTypeInterface; |
| </pre> |
| <p> |
| An opaque structure used as the base of all interface types. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="GTypeInstance"> |
| <a name="GTypeInstance"></a><h3>GTypeInstance</h3> |
| <pre class="programlisting">typedef struct { |
| } GTypeInstance; |
| </pre> |
| <p> |
| An opaque structure used as the base of all type instances. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="GTypeClass"> |
| <a name="GTypeClass"></a><h3>GTypeClass</h3> |
| <pre class="programlisting">typedef struct { |
| } GTypeClass; |
| </pre> |
| <p> |
| An opaque structure used as the base of all classes. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="GTypeInfo"> |
| <a name="GTypeInfo"></a><h3>GTypeInfo</h3> |
| <pre class="programlisting">typedef struct { |
| /* interface types, classed types, instantiated types */ |
| guint16 class_size; |
| |
| GBaseInitFunc base_init; |
| GBaseFinalizeFunc base_finalize; |
| |
| /* interface types, classed types, instantiated types */ |
| GClassInitFunc class_init; |
| GClassFinalizeFunc class_finalize; |
| gconstpointer class_data; |
| |
| /* instantiated types */ |
| guint16 instance_size; |
| guint16 n_preallocs; |
| GInstanceInitFunc instance_init; |
| |
| /* value handling */ |
| const GTypeValueTable *value_table; |
| } GTypeInfo; |
| </pre> |
| <p> |
| This structure is used to provide the type system with the information |
| required to initialize and destruct (finalize) a type's class and |
| its instances. |
| The initialized structure is passed to the <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()"><code class="function">g_type_register_static()</code></a> function |
| (or is copied into the provided <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> structure in the |
| <a class="link" href="GTypePlugin.html#g-type-plugin-complete-type-info" title="g_type_plugin_complete_type_info ()"><code class="function">g_type_plugin_complete_type_info()</code></a>). The type system will perform a deep |
| copy of this structure, so its memory does not need to be persistent |
| across invocation of <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()"><code class="function">g_type_register_static()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> <em class="structfield"><code><a name="GTypeInfo.class-size"></a>class_size</code></em>;</span></p></td> |
| <td>Size of the class structure (required for interface, classed and instantiatable types). |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><span class="type">GBaseInitFunc</span></a> <em class="structfield"><code><a name="GTypeInfo.base-init"></a>base_init</code></em>;</span></p></td> |
| <td>Location of the base initialization function (optional). |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()"><span class="type">GBaseFinalizeFunc</span></a> <em class="structfield"><code><a name="GTypeInfo.base-finalize"></a>base_finalize</code></em>;</span></p></td> |
| <td>Location of the base finalization function (optional). |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><span class="type">GClassInitFunc</span></a> <em class="structfield"><code><a name="GTypeInfo.class-init"></a>class_init</code></em>;</span></p></td> |
| <td>Location of the class initialization function for |
| classed and instantiatable types. Location of the default vtable |
| inititalization function for interface types. (optional) This function |
| is used both to fill in virtual functions in the class or default vtable, |
| and to do type-specific setup such as registering signals and object |
| properties. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GClassFinalizeFunc" title="GClassFinalizeFunc ()"><span class="type">GClassFinalizeFunc</span></a> <em class="structfield"><code><a name="GTypeInfo.class-finalize"></a>class_finalize</code></em>;</span></p></td> |
| <td>Location of the class finalization function for |
| classed and instantiatable types. Location fo the default vtable |
| finalization function for interface types. (optional) |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> <em class="structfield"><code><a name="GTypeInfo.class-data"></a>class_data</code></em>;</span></p></td> |
| <td>User-supplied data passed to the class init/finalize functions. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> <em class="structfield"><code><a name="GTypeInfo.instance-size"></a>instance_size</code></em>;</span></p></td> |
| <td>Size of the instance (object) structure (required for instantiatable types only). |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> <em class="structfield"><code><a name="GTypeInfo.n-preallocs"></a>n_preallocs</code></em>;</span></p></td> |
| <td>Prior to GLib 2.10, it specified the number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching). Since GLib 2.10, it is ignored, since instances are allocated with the <a href="./../glib/glib/glib-Memory-Slices.html">slice allocator</a> now. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()"><span class="type">GInstanceInitFunc</span></a> <em class="structfield"><code><a name="GTypeInfo.instance-init"></a>instance_init</code></em>;</span></p></td> |
| <td>Location of the instance initialization function (optional, for instantiatable types only). |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term">const <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="type">GTypeValueTable</span></a> *<em class="structfield"><code><a name="GTypeInfo.value-table"></a>value_table</code></em>;</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="type">GTypeValueTable</span></a> function table for generic handling of GValues of this type (usually only |
| useful for fundamental types). |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GTypeFundamentalInfo"> |
| <a name="GTypeFundamentalInfo"></a><h3>GTypeFundamentalInfo</h3> |
| <pre class="programlisting">typedef struct { |
| GTypeFundamentalFlags type_flags; |
| } GTypeFundamentalInfo; |
| </pre> |
| <p> |
| A structure that provides information to the type system which is |
| used specifically for managing fundamental types. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GTypeFundamentalFlags" title="enum GTypeFundamentalFlags"><span class="type">GTypeFundamentalFlags</span></a> <em class="structfield"><code><a name="GTypeFundamentalInfo.type-flags"></a>type_flags</code></em>;</span></p></td> |
| <td> |
| <a class="link" href="gobject-Type-Information.html#GTypeFundamentalFlags" title="enum GTypeFundamentalFlags"><span class="type">GTypeFundamentalFlags</span></a> describing the characteristics of the fundamental type |
| </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GInterfaceInfo"> |
| <a name="GInterfaceInfo"></a><h3>GInterfaceInfo</h3> |
| <pre class="programlisting">typedef struct { |
| GInterfaceInitFunc interface_init; |
| GInterfaceFinalizeFunc interface_finalize; |
| gpointer interface_data; |
| } GInterfaceInfo; |
| </pre> |
| <p> |
| A structure that provides information to the type system which is |
| used specifically for managing interface types. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GInterfaceInitFunc" title="GInterfaceInitFunc ()"><span class="type">GInterfaceInitFunc</span></a> <em class="structfield"><code><a name="GInterfaceInfo.interface-init"></a>interface_init</code></em>;</span></p></td> |
| <td>location of the interface initialization function |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GInterfaceFinalizeFunc" title="GInterfaceFinalizeFunc ()"><span class="type">GInterfaceFinalizeFunc</span></a> <em class="structfield"><code><a name="GInterfaceInfo.interface-finalize"></a>interface_finalize</code></em>;</span></p></td> |
| <td>location of the interface finalization function |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="GInterfaceInfo.interface-data"></a>interface_data</code></em>;</span></p></td> |
| <td>user-supplied data passed to the interface init/finalize functions |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GTypeValueTable"> |
| <a name="GTypeValueTable"></a><h3>GTypeValueTable</h3> |
| <pre class="programlisting">typedef struct { |
| void (*value_init) (GValue *value); |
| void (*value_free) (GValue *value); |
| void (*value_copy) (const GValue *src_value, |
| GValue *dest_value); |
| /* varargs functionality (optional) */ |
| gpointer (*value_peek_pointer) (const GValue *value); |
| gchar *collect_format; |
| gchar* (*collect_value) (GValue *value, |
| guint n_collect_values, |
| GTypeCValue *collect_values, |
| guint collect_flags); |
| gchar *lcopy_format; |
| gchar* (*lcopy_value) (const GValue *value, |
| guint n_collect_values, |
| GTypeCValue *collect_values, |
| guint collect_flags); |
| } GTypeValueTable; |
| </pre> |
| <p> |
| The <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="type">GTypeValueTable</span></a> provides the functions required by the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> implementation, |
| to serve as a container for values of a type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.value-init"></a>value_init</code></em> ()</span></p></td> |
| <td>Default initialize <em class="parameter"><code>values</code></em> contents by poking values |
| directly into the value->data array. The data array of |
| the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> passed into this function was zero-filled |
| with <code class="function"><code class="function">memset()</code></code>, so no care has to |
| be taken to free any |
| old contents. E.g. for the implementation of a string |
| value that may never be <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the implementation might |
| look like: |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="normal">value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">""</span><span class="symbol">);</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.value-free"></a>value_free</code></em> ()</span></p></td> |
| <td>Free any old contents that might be left in the |
| data array of the passed in <em class="parameter"><code>value</code></em>. No resources may |
| remain allocated through the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> contents after |
| this function returns. E.g. for our above string type: |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="comment">// only free strings without a specific flag for static storage</span> |
| <span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!(</span><span class="normal">value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">1</span><span class="symbol">].</span><span class="normal">v_uint </span><span class="symbol">&</span><span class="normal"> G_VALUE_NOCOPY_CONTENTS</span><span class="symbol">))</span> |
| <span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-Memory-Allocation.html#g-free">g_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.value-copy"></a>value_copy</code></em> ()</span></p></td> |
| <td> |
| <em class="parameter"><code>dest_value</code></em> is a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> with zero-filled data section |
| and <em class="parameter"><code>src_value</code></em> is a properly setup <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> of same or |
| derived type. |
| The purpose of this function is to copy the contents of |
| <em class="parameter"><code>src_value</code></em> into <em class="parameter"><code>dest_value</code></em> in a way, that even after |
| <em class="parameter"><code>src_value</code></em> has been freed, the contents of <em class="parameter"><code>dest_value</code></em> |
| remain valid. String type example: |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="normal">dest_value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">src_value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.value-peek-pointer"></a>value_peek_pointer</code></em> ()</span></p></td> |
| <td>If the value contents fit into a pointer, such as objects |
| or strings, return this pointer, so the caller can peek at |
| the current contents. To extend on our above string example: |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="keyword">return</span><span class="normal"> value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GTypeValueTable.collect-format"></a>collect_format</code></em>;</span></p></td> |
| <td>A string format describing how to collect the contents of |
| this value bit-by-bit. Each character in the format represents |
| an argument to be collected, and the characters themselves indicate |
| the type of the argument. Currently supported arguments are: |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"></span></p></td> |
| <td><p> |
| 'i' - Integers. passed as collect_values[].v_int. |
| </p></td> |
| </tr> |
| <tr> |
| <td><p><span class="term"></span></p></td> |
| <td><p> |
| 'l' - Longs. passed as collect_values[].v_long. |
| </p></td> |
| </tr> |
| <tr> |
| <td><p><span class="term"></span></p></td> |
| <td><p> |
| 'd' - Doubles. passed as collect_values[].v_double. |
| </p></td> |
| </tr> |
| <tr> |
| <td><p><span class="term"></span></p></td> |
| <td><p> |
| 'p' - Pointers. passed as collect_values[].v_pointer. |
| </p></td> |
| </tr> |
| </tbody> |
| </table></div> |
| It should be noted that for variable argument list construction, |
| ANSI C promotes every type smaller than an integer to an int, and |
| floats to doubles. So for collection of short int or char, 'i' |
| needs to be used, and for collection of floats 'd'. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.collect-value"></a>collect_value</code></em> ()</span></p></td> |
| <td>The <code class="function">collect_value()</code> function is responsible for converting the |
| values collected from a variable argument list into contents |
| suitable for storage in a GValue. This function should setup |
| <em class="parameter"><code>value</code></em> similar to <code class="function">value_init()</code>; e.g. for a string value that |
| does not allow <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> pointers, it needs to either spew an error, |
| or do an implicit conversion by storing an empty string. |
| The <em class="parameter"><code>value</code></em> passed in to this function has a zero-filled data |
| array, so just like for <code class="function">value_init()</code> it is guaranteed to not |
| contain any old contents that might need freeing. |
| <em class="parameter"><code>n_collect_values</code></em> is exactly the string length of <em class="parameter"><code>collect_format</code></em>, |
| and <em class="parameter"><code>collect_values</code></em> is an array of unions <a class="link" href="gobject-Varargs-Value-Collection.html#GTypeCValue" title="union GTypeCValue"><span class="type">GTypeCValue</span></a> with |
| length <em class="parameter"><code>n_collect_values</code></em>, containing the collected values |
| according to <em class="parameter"><code>collect_format</code></em>. |
| <em class="parameter"><code>collect_flags</code></em> is an argument provided as a hint by the caller. |
| It may contain the flag <code class="literal">G_VALUE_NOCOPY_CONTENTS</code> indicating, |
| that the collected value contents may be considered "static" |
| for the duration of the <em class="parameter"><code>value</code></em> lifetime. |
| Thus an extra copy of the contents stored in <em class="parameter"><code>collect_values</code></em> is |
| not required for assignment to <em class="parameter"><code>value</code></em>. |
| For our above string example, we continue with: |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="normal">collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">)</span> |
| <span class="normal"> value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">""</span><span class="symbol">);</span> |
| <span class="keyword">else</span><span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_flags </span><span class="symbol">&</span><span class="normal"> G_VALUE_NOCOPY_CONTENTS</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span> |
| <span class="normal"> </span><span class="comment">// keep a flag for the value_free() implementation to not free this string</span> |
| <span class="normal"> value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">1</span><span class="symbol">].</span><span class="normal">v_uint </span><span class="symbol">=</span><span class="normal"> G_VALUE_NOCOPY_CONTENTS</span><span class="symbol">;</span> |
| <span class="cbracket">}</span> |
| <span class="keyword">else</span> |
| <span class="normal"> value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span> |
| <span class="keyword">return</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| It should be noted, that it is generally a bad idea to follow the |
| <span class="type">G_VALUE_NOCOPY_CONTENTS</span> hint for reference counted types. Due to |
| reentrancy requirements and reference count assertions performed |
| by the <span class="type">GSignal</span> code, reference counts should always be incremented |
| for reference counted contents stored in the value->data array. |
| To deviate from our string example for a moment, and taking a look |
| at an exemplary implementation for <code class="function">collect_value()</code> of <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>: |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> <a href="gobject-The-Base-Object-Type.html#GObject">GObject</a> </span><span class="symbol">*</span><span class="normal">object </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gobject-The-Base-Object-Type.html#G-OBJECT:CAPS">G_OBJECT</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span> |
| <span class="normal"> </span><span class="comment">// never honour G_VALUE_NOCOPY_CONTENTS for ref-counted types</span> |
| <span class="normal"> value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gobject-The-Base-Object-Type.html#g-object-ref">g_object_ref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">object</span><span class="symbol">);</span> |
| <span class="normal"> </span><span class="keyword">return</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span> |
| <span class="cbracket">}</span> |
| <span class="keyword">else</span> |
| <span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup-printf">g_strdup_printf</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Object passed as invalid NULL pointer"</span><span class="symbol">);</span> |
| <span class="cbracket">}</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| The reference count for valid objects is always incremented, |
| regardless of <em class="parameter"><code>collect_flags</code></em>. For invalid objects, the example |
| returns a newly allocated string without altering <em class="parameter"><code>value</code></em>. |
| Upon success, <code class="function">collect_value()</code> needs to return <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. If, however, |
| an error condition occurred, <code class="function">collect_value()</code> may spew an |
| error by returning a newly allocated non-<a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> string, giving |
| a suitable description of the error condition. |
| The calling code makes no assumptions about the <em class="parameter"><code>value</code></em> |
| contents being valid upon error returns, <em class="parameter"><code>value</code></em> |
| is simply thrown away without further freeing. As such, it is |
| a good idea to not allocate <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> contents, prior to returning |
| an error, however, <code class="function">collect_values()</code> is not obliged to return |
| a correctly setup <em class="parameter"><code>value</code></em> for error returns, simply because |
| any non-<a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> return is considered a fatal condition so further |
| program behaviour is undefined. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GTypeValueTable.lcopy-format"></a>lcopy_format</code></em>;</span></p></td> |
| <td>Format description of the arguments to collect for <em class="parameter"><code>lcopy_value</code></em>, |
| analogous to <em class="parameter"><code>collect_format</code></em>. Usually, <em class="parameter"><code>lcopy_format</code></em> string consists |
| only of 'p's to provide <code class="function">lcopy_value()</code> with pointers to storage locations. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="structfield"><code><a name="GTypeValueTable.lcopy-value"></a>lcopy_value</code></em> ()</span></p></td> |
| <td>This function is responsible for storing the <em class="parameter"><code>value</code></em> contents into |
| arguments passed through a variable argument list which got |
| collected into <em class="parameter"><code>collect_values</code></em> according to <em class="parameter"><code>lcopy_format</code></em>. |
| <em class="parameter"><code>n_collect_values</code></em> equals the string length of <em class="parameter"><code>lcopy_format</code></em>, |
| and <em class="parameter"><code>collect_flags</code></em> may contain <code class="literal">G_VALUE_NOCOPY_CONTENTS</code>. |
| In contrast to <code class="function">collect_value()</code>, <code class="function">lcopy_value()</code> is obliged to |
| always properly support <code class="literal">G_VALUE_NOCOPY_CONTENTS</code>. |
| Similar to <code class="function">collect_value()</code> the function may prematurely abort |
| by returning a newly allocated string describing an error condition. |
| To complete the string example: |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="normal"><a href="./../glib/glib/glib-Basic-Types.html#gchar">gchar</a> </span><span class="symbol">**</span><span class="normal">string_p </span><span class="symbol">=</span><span class="normal"> collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span> |
| <span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="normal">string_p</span><span class="symbol">)</span> |
| <span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup-printf">g_strdup_printf</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"string location passed as NULL"</span><span class="symbol">);</span> |
| <span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_flags </span><span class="symbol">&</span><span class="normal"> G_VALUE_NOCOPY_CONTENTS</span><span class="symbol">)</span> |
| <span class="normal"> </span><span class="symbol">*</span><span class="normal">string_p </span><span class="symbol">=</span><span class="normal"> value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span> |
| <span class="keyword">else</span> |
| <span class="normal"> </span><span class="symbol">*</span><span class="normal">string_p </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| And an illustrative version of <code class="function">lcopy_value()</code> for |
| reference-counted types: |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="normal"><a href="gobject-The-Base-Object-Type.html#GObject">GObject</a> </span><span class="symbol">**</span><span class="normal">object_p </span><span class="symbol">=</span><span class="normal"> collect_values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span> |
| <span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="normal">object_p</span><span class="symbol">)</span> |
| <span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup-printf">g_strdup_printf</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"object location passed as NULL"</span><span class="symbol">);</span> |
| <span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="normal">value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">)</span> |
| <span class="normal"> </span><span class="symbol">*</span><span class="normal">object_p </span><span class="symbol">=</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span> |
| <span class="keyword">else</span><span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">collect_flags </span><span class="symbol">&</span><span class="normal"> G_VALUE_NOCOPY_CONTENTS</span><span class="symbol">)</span><span class="normal"> </span><span class="comment">// always honour</span> |
| <span class="normal"> </span><span class="symbol">*</span><span class="normal">object_p </span><span class="symbol">=</span><span class="normal"> value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">;</span> |
| <span class="keyword">else</span> |
| <span class="normal"> </span><span class="symbol">*</span><span class="normal">object_p </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gobject-The-Base-Object-Type.html#g-object-ref">g_object_ref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">-></span><span class="normal">data</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">].</span><span class="normal">v_pointer</span><span class="symbol">);</span> |
| <span class="keyword">return</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_FROM_INSTANCE()"> |
| <a name="G-TYPE-FROM-INSTANCE:CAPS"></a><h3>G_TYPE_FROM_INSTANCE()</h3> |
| <pre class="programlisting">#define G_TYPE_FROM_INSTANCE(instance) (G_TYPE_FROM_CLASS (((GTypeInstance*) (instance))->g_class)) |
| </pre> |
| <p> |
| Get the type identifier from a given <em class="parameter"><code>instance</code></em> structure. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td> |
| <td>Location of a valid <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_FROM_CLASS()"> |
| <a name="G-TYPE-FROM-CLASS:CAPS"></a><h3>G_TYPE_FROM_CLASS()</h3> |
| <pre class="programlisting">#define G_TYPE_FROM_CLASS(g_class) (((GTypeClass*) (g_class))->g_type) |
| </pre> |
| <p> |
| Get the type identifier from a given <em class="parameter"><code>class</code></em> structure. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>Location of a valid <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_FROM_INTERFACE()"> |
| <a name="G-TYPE-FROM-INTERFACE:CAPS"></a><h3>G_TYPE_FROM_INTERFACE()</h3> |
| <pre class="programlisting">#define G_TYPE_FROM_INTERFACE(g_iface) (((GTypeInterface*) (g_iface))->g_type) |
| </pre> |
| <p> |
| Get the type identifier from a given <em class="parameter"><code>interface</code></em> structure. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td> |
| <td>Location of a valid <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="GTypeInterface"><span class="type">GTypeInterface</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_INSTANCE_GET_CLASS()"> |
| <a name="G-TYPE-INSTANCE-GET-CLASS:CAPS"></a><h3>G_TYPE_INSTANCE_GET_CLASS()</h3> |
| <pre class="programlisting">#define G_TYPE_INSTANCE_GET_CLASS(instance, g_type, c_type) (_G_TYPE_IGC ((instance), (g_type), c_type)) |
| </pre> |
| <p> |
| Get the class structure of a given <em class="parameter"><code>instance</code></em>, casted |
| to a specified ancestor type <em class="parameter"><code>g_type</code></em> of the instance. |
| </p> |
| <p> |
| Note that while calling a <a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()"><code class="function">GInstanceInitFunc()</code></a>, the class pointer gets |
| modified, so it might not always return the expected pointer. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td> |
| <td>Location of the <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the class to be returned. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td> |
| <td>The C type of the class structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to the class structure |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_INSTANCE_GET_INTERFACE()"> |
| <a name="G-TYPE-INSTANCE-GET-INTERFACE:CAPS"></a><h3>G_TYPE_INSTANCE_GET_INTERFACE()</h3> |
| <pre class="programlisting">#define G_TYPE_INSTANCE_GET_INTERFACE(instance, g_type, c_type) (_G_TYPE_IGI ((instance), (g_type), c_type)) |
| </pre> |
| <p> |
| Get the interface structure for interface <em class="parameter"><code>g_type</code></em> of a given <em class="parameter"><code>instance</code></em>. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td> |
| <td>Location of the <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the interface to be returned. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td> |
| <td>The C type of the interface structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to the interface structure |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_INSTANCE_GET_PRIVATE()"> |
| <a name="G-TYPE-INSTANCE-GET-PRIVATE:CAPS"></a><h3>G_TYPE_INSTANCE_GET_PRIVATE()</h3> |
| <pre class="programlisting">#define G_TYPE_INSTANCE_GET_PRIVATE(instance, g_type, c_type) ((c_type*) g_type_instance_get_private ((GTypeInstance*) (instance), (g_type))) |
| </pre> |
| <p> |
| Gets the private structure for a particular type. |
| The private structure must have been registered in the |
| class_init function with <a class="link" href="gobject-Type-Information.html#g-type-class-add-private" title="g_type_class_add_private ()"><code class="function">g_type_class_add_private()</code></a>. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td> |
| <td>the instance of a type deriving from <em class="parameter"><code>private_type</code></em>. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td> |
| <td>the type identifying which private data to retrieve. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td> |
| <td>The C type for the private structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to the private data structure. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_CHECK_INSTANCE()"> |
| <a name="G-TYPE-CHECK-INSTANCE:CAPS"></a><h3>G_TYPE_CHECK_INSTANCE()</h3> |
| <pre class="programlisting">#define G_TYPE_CHECK_INSTANCE(instance) (_G_TYPE_CHI ((GTypeInstance*) (instance))) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>instance</code></em> is a valid <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> structure, |
| otherwise issues a warning and returns <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td> |
| <td>Location of a <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_CHECK_INSTANCE_CAST()"> |
| <a name="G-TYPE-CHECK-INSTANCE-CAST:CAPS"></a><h3>G_TYPE_CHECK_INSTANCE_CAST()</h3> |
| <pre class="programlisting">#define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| </pre> |
| <p> |
| Checks that <em class="parameter"><code>instance</code></em> is an instance of the type identified by <em class="parameter"><code>g_type</code></em> |
| and issues a warning if this is not the case. Returns <em class="parameter"><code>instance</code></em> casted |
| to a pointer to <em class="parameter"><code>c_type</code></em>. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td> |
| <td>Location of a <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td> |
| <td>The type to be returned. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td> |
| <td>The corresponding C type of <em class="parameter"><code>g_type</code></em>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_CHECK_INSTANCE_TYPE()"> |
| <a name="G-TYPE-CHECK-INSTANCE-TYPE:CAPS"></a><h3>G_TYPE_CHECK_INSTANCE_TYPE()</h3> |
| <pre class="programlisting">#define G_TYPE_CHECK_INSTANCE_TYPE(instance, g_type) (_G_TYPE_CIT ((instance), (g_type))) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>instance</code></em> is an instance of the type identified by <em class="parameter"><code>g_type</code></em>. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td> |
| <td>Location of a <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td> |
| <td>The type to be checked |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_CHECK_CLASS_CAST()"> |
| <a name="G-TYPE-CHECK-CLASS-CAST:CAPS"></a><h3>G_TYPE_CHECK_CLASS_CAST()</h3> |
| <pre class="programlisting">#define G_TYPE_CHECK_CLASS_CAST(g_class, g_type, c_type) (_G_TYPE_CCC ((g_class), (g_type), c_type)) |
| </pre> |
| <p> |
| Checks that <em class="parameter"><code>g_class</code></em> is a class structure of the type identified by <em class="parameter"><code>g_type</code></em> |
| and issues a warning if this is not the case. Returns <em class="parameter"><code>g_class</code></em> casted |
| to a pointer to <em class="parameter"><code>c_type</code></em>. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>Location of a <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td> |
| <td>The type to be returned. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c_type</code></em> :</span></p></td> |
| <td>The corresponding C type of class structure of <em class="parameter"><code>g_type</code></em>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_CHECK_CLASS_TYPE()"> |
| <a name="G-TYPE-CHECK-CLASS-TYPE:CAPS"></a><h3>G_TYPE_CHECK_CLASS_TYPE()</h3> |
| <pre class="programlisting">#define G_TYPE_CHECK_CLASS_TYPE(g_class, g_type) (_G_TYPE_CCT ((g_class), (g_type))) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>g_class</code></em> is a class structure of the type identified by |
| <em class="parameter"><code>g_type</code></em>. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>Location of a <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td> |
| <td>The type to be checked. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_CHECK_VALUE()"> |
| <a name="G-TYPE-CHECK-VALUE:CAPS"></a><h3>G_TYPE_CHECK_VALUE()</h3> |
| <pre class="programlisting">#define G_TYPE_CHECK_VALUE(value) (_G_TYPE_CHV ((value))) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>value</code></em> has been initialized to hold values |
| of a value type. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> |
| <td>a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_CHECK_VALUE_TYPE()"> |
| <a name="G-TYPE-CHECK-VALUE-TYPE:CAPS"></a><h3>G_TYPE_CHECK_VALUE_TYPE()</h3> |
| <pre class="programlisting">#define G_TYPE_CHECK_VALUE_TYPE(value, g_type) (_G_TYPE_CVH ((value), (g_type))) |
| </pre> |
| <p> |
| Checks if <em class="parameter"><code>value</code></em> has been initialized to hold values |
| of type <em class="parameter"><code>g_type</code></em>. |
| </p> |
| <p> |
| This macro should only be used in type implementations. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> |
| <td>a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td> |
| <td>The type to be checked. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_FLAG_RESERVED_ID_BIT"> |
| <a name="G-TYPE-FLAG-RESERVED-ID-BIT:CAPS"></a><h3>G_TYPE_FLAG_RESERVED_ID_BIT</h3> |
| <pre class="programlisting">#define G_TYPE_FLAG_RESERVED_ID_BIT ((GType) (1 << 0)) |
| </pre> |
| <p> |
| A bit in the type number that's supposed to be left untouched. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_init ()"> |
| <a name="g-type-init"></a><h3>g_type_init ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_init (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> |
| <p> |
| Prior to any use of the type system, <a class="link" href="gobject-Type-Information.html#g-type-init" title="g_type_init ()"><code class="function">g_type_init()</code></a> has to be called |
| to initialize the type system and assorted other code portions |
| (such as the various fundamental type implementations or the signal |
| system). |
| </p> |
| <p> |
| Since version 2.24 this also initializes the thread system |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="enum GTypeDebugFlags"> |
| <a name="GTypeDebugFlags"></a><h3>enum GTypeDebugFlags</h3> |
| <pre class="programlisting">typedef enum /*< skip >*/ |
| { |
| G_TYPE_DEBUG_NONE = 0, |
| G_TYPE_DEBUG_OBJECTS = 1 << 0, |
| G_TYPE_DEBUG_SIGNALS = 1 << 1, |
| G_TYPE_DEBUG_MASK = 0x03 |
| } GTypeDebugFlags; |
| </pre> |
| <p> |
| The <span class="type">GTypeDebugFlags</span> enumeration values can be passed to |
| <a class="link" href="gobject-Type-Information.html#g-type-init-with-debug-flags" title="g_type_init_with_debug_flags ()"><code class="function">g_type_init_with_debug_flags()</code></a> to trigger debugging messages during runtime. |
| Note that the messages can also be triggered by setting the |
| <code class="envar">GOBJECT_DEBUG</code> environment variable to a ':'-separated list of |
| "objects" and "signals". |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><a name="G-TYPE-DEBUG-NONE:CAPS"></a><span class="term"><code class="literal">G_TYPE_DEBUG_NONE</code></span></p></td> |
| <td>Print no messages. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-TYPE-DEBUG-OBJECTS:CAPS"></a><span class="term"><code class="literal">G_TYPE_DEBUG_OBJECTS</code></span></p></td> |
| <td>Print messages about object bookkeeping. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-TYPE-DEBUG-SIGNALS:CAPS"></a><span class="term"><code class="literal">G_TYPE_DEBUG_SIGNALS</code></span></p></td> |
| <td>Print messages about signal emissions. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-TYPE-DEBUG-MASK:CAPS"></a><span class="term"><code class="literal">G_TYPE_DEBUG_MASK</code></span></p></td> |
| <td>Mask covering all debug flags. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_init_with_debug_flags ()"> |
| <a name="g-type-init-with-debug-flags"></a><h3>g_type_init_with_debug_flags ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_init_with_debug_flags (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeDebugFlags" title="enum GTypeDebugFlags"><span class="type">GTypeDebugFlags</span></a> debug_flags</code></em>);</pre> |
| <p> |
| Similar to <a class="link" href="gobject-Type-Information.html#g-type-init" title="g_type_init ()"><code class="function">g_type_init()</code></a>, but additionally sets debug flags. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><em class="parameter"><code>debug_flags</code></em> :</span></p></td> |
| <td>Bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeDebugFlags" title="enum GTypeDebugFlags"><span class="type">GTypeDebugFlags</span></a> values for |
| debugging purposes. |
| </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_name ()"> |
| <a name="g-type-name"></a><h3>g_type_name ()</h3> |
| <pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* g_type_name (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre> |
| <p> |
| Get the unique name that is assigned to a type ID. Note that this |
| function (like all other GType API) cannot cope with invalid type |
| IDs. <a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID"><code class="literal">G_TYPE_INVALID</code></a> may be passed to this function, as may be any |
| other validly registered type ID, but randomized type IDs should |
| not be passed in and will most likely lead to a crash. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>Type to return name for. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> Static type name or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_qname ()"> |
| <a name="g-type-qname"></a><h3>g_type_qname ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a> g_type_qname (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre> |
| <p> |
| Get the corresponding quark of the type IDs name. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>Type to return quark of type name for. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The type names quark or 0. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_from_name ()"> |
| <a name="g-type-from-name"></a><h3>g_type_from_name ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> g_type_from_name (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre> |
| <p> |
| Lookup the type ID from a given type name, returning 0 if no type |
| has been registered under this name (this is the preferred method |
| to find out by name whether a specific type has been registered |
| yet). |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td> |
| <td>Type name to lookup. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> Corresponding type ID or 0. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_parent ()"> |
| <a name="g-type-parent"></a><h3>g_type_parent ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> g_type_parent (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre> |
| <p> |
| Return the direct parent type of the passed in type. If the passed |
| in type has no parent, i.e. is a fundamental type, 0 is returned. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>The derived type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The parent type. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_depth ()"> |
| <a name="g-type-depth"></a><h3>g_type_depth ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> g_type_depth (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre> |
| <p> |
| Returns the length of the ancestry of the passed in type. This |
| includes the type itself, so that e.g. a fundamental type has depth 1. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The depth of <em class="parameter"><code>type</code></em>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_next_base ()"> |
| <a name="g-type-next-base"></a><h3>g_type_next_base ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> g_type_next_base (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> leaf_type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> root_type</code></em>);</pre> |
| <p> |
| Given a <em class="parameter"><code>leaf_type</code></em> and a <em class="parameter"><code>root_type</code></em> which is contained in its |
| anchestry, return the type that <em class="parameter"><code>root_type</code></em> is the immediate parent |
| of. In other words, this function determines the type that is |
| derived directly from <em class="parameter"><code>root_type</code></em> which is also a base class of |
| <em class="parameter"><code>leaf_type</code></em>. Given a root type and a leaf type, this function can |
| be used to determine the types and order in which the leaf type is |
| descended from the root type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>leaf_type</code></em> :</span></p></td> |
| <td>Descendant of <em class="parameter"><code>root_type</code></em> and the type to be returned. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>root_type</code></em> :</span></p></td> |
| <td>Immediate parent of the returned type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> Immediate child of <em class="parameter"><code>root_type</code></em> and anchestor of <em class="parameter"><code>leaf_type</code></em>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_is_a ()"> |
| <a name="g-type-is-a"></a><h3>g_type_is_a ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_type_is_a (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> is_a_type</code></em>);</pre> |
| <p> |
| If <em class="parameter"><code>is_a_type</code></em> is a derivable type, check whether <em class="parameter"><code>type</code></em> is a |
| descendant of <em class="parameter"><code>is_a_type</code></em>. If <em class="parameter"><code>is_a_type</code></em> is an interface, check |
| whether <em class="parameter"><code>type</code></em> conforms to it. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>Type to check anchestry for. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>is_a_type</code></em> :</span></p></td> |
| <td>Possible anchestor of <em class="parameter"><code>type</code></em> or interface <em class="parameter"><code>type</code></em> could conform to. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>type</code></em> is_a <em class="parameter"><code>is_a_type</code></em> holds true. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_class_ref ()"> |
| <a name="g-type-class-ref"></a><h3>g_type_class_ref ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> g_type_class_ref (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre> |
| <p> |
| Increments the reference count of the class structure belonging to |
| <em class="parameter"><code>type</code></em>. This function will demand-create the class if it doesn't |
| exist already. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>Type ID of a classed type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure for the given type ID. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_class_peek ()"> |
| <a name="g-type-class-peek"></a><h3>g_type_class_peek ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> g_type_class_peek (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre> |
| <p> |
| This function is essentially the same as <a class="link" href="gobject-Type-Information.html#g-type-class-ref" title="g_type_class_ref ()"><code class="function">g_type_class_ref()</code></a>, except that |
| the classes reference count isn't incremented. As a consequence, this function |
| may return <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the class of the type passed in does not currently |
| exist (hasn't been referenced before). |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>Type ID of a classed type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure for the given type ID or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> |
| if the class does not currently exist. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_class_peek_static ()"> |
| <a name="g-type-class-peek-static"></a><h3>g_type_class_peek_static ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> g_type_class_peek_static (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre> |
| <p> |
| A more efficient version of <a class="link" href="gobject-Type-Information.html#g-type-class-peek" title="g_type_class_peek ()"><code class="function">g_type_class_peek()</code></a> which works only for |
| static types. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>Type ID of a classed type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure for the given type ID or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> |
| if the class does not currently exist or is dynamically loaded. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_class_unref ()"> |
| <a name="g-type-class-unref"></a><h3>g_type_class_unref ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_class_unref (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre> |
| <p> |
| Decrements the reference count of the class structure being passed in. |
| Once the last reference count of a class has been released, classes |
| may be finalized by the type system, so further dereferencing of a |
| class pointer after <a class="link" href="gobject-Type-Information.html#g-type-class-unref" title="g_type_class_unref ()"><code class="function">g_type_class_unref()</code></a> are invalid. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure to unreference. |
| </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_class_peek_parent ()"> |
| <a name="g-type-class-peek-parent"></a><h3>g_type_class_peek_parent ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> g_type_class_peek_parent (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre> |
| <p> |
| This is a convenience function often needed in class initializers. |
| It returns the class structure of the immediate parent type of the |
| class passed in. Since derived classes hold a reference count on |
| their parent classes as long as they are instantiated, the returned |
| class will always exist. This function is essentially equivalent |
| to: |
| </p> |
| <p> |
| </p> |
| <pre class="programlisting"> |
| g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class))); |
| </pre> |
| <p> |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure to retrieve the parent class for. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The parent class of <em class="parameter"><code>g_class</code></em>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_class_add_private ()"> |
| <a name="g-type-class-add-private"></a><h3>g_type_class_add_private ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_class_add_private (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> private_size</code></em>);</pre> |
| <p> |
| Registers a private structure for an instantiatable type; |
| when an object is allocated, the private structures for |
| the type 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 <code class="function">class_init()</code> function. The private structure can |
| be retrieved using the <a class="link" href="gobject-Type-Information.html#G-TYPE-INSTANCE-GET-PRIVATE:CAPS" title="G_TYPE_INSTANCE_GET_PRIVATE()"><code class="function">G_TYPE_INSTANCE_GET_PRIVATE()</code></a> macro. |
| The following example shows attaching a private structure |
| <span class="structname">MyObjectPrivate</span> to an object |
| <span class="structname">MyObject</span> defined in the standard GObject |
| fashion. |
| type's <code class="function">class_init()</code> function. |
| </p> |
| <p> |
| </p> |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
| 13 |
| 14 |
| 15 |
| 16 |
| 17 |
| 18 |
| 19 |
| 20 |
| 21 |
| 22 |
| 23 |
| 24 |
| 25 |
| 26 |
| 27 |
| 28 |
| 29 |
| 30 |
| 31 |
| 32 |
| 33 |
| 34</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="classname">_MyObject</span><span class="normal"> MyObject</span><span class="symbol">;</span> |
| <span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="classname">_MyObjectPrivate</span><span class="normal"> MyObjectPrivate</span><span class="symbol">;</span> |
| |
| <span class="keyword">struct</span><span class="normal"> </span><span class="classname">_MyObject</span><span class="normal"> </span><span class="cbracket">{</span> |
| <span class="normal"> <a href="gobject-The-Base-Object-Type.html#GObject">GObject</a> parent</span><span class="symbol">;</span> |
| |
| <span class="normal"> MyObjectPrivate </span><span class="symbol">*</span><span class="normal">priv</span><span class="symbol">;</span> |
| <span class="cbracket">}</span><span class="symbol">;</span> |
| |
| <span class="keyword">struct</span><span class="normal"> </span><span class="classname">_MyObjectPrivate</span><span class="normal"> </span><span class="cbracket">{</span> |
| <span class="normal"> </span><span class="type">int</span><span class="normal"> some_field</span><span class="symbol">;</span> |
| <span class="cbracket">}</span><span class="symbol">;</span> |
| |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span> |
| <span class="function">my_object_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">MyObjectClass </span><span class="symbol">*</span><span class="normal">klass</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> </span><span class="function"><a href="gobject-Type-Information.html#g-type-class-add-private">g_type_class_add_private</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">klass</span><span class="symbol">,</span><span class="normal"> </span><span class="keyword">sizeof</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">MyObjectPrivate</span><span class="symbol">));</span> |
| <span class="cbracket">}</span> |
| |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span> |
| <span class="function">my_object_init</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">MyObject </span><span class="symbol">*</span><span class="normal">my_object</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> my_object</span><span class="symbol">-></span><span class="normal">priv </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gobject-Type-Information.html#G-TYPE-INSTANCE-GET-PRIVATE:CAPS">G_TYPE_INSTANCE_GET_PRIVATE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">my_object</span><span class="symbol">,</span> |
| <span class="normal"> MY_TYPE_OBJECT</span><span class="symbol">,</span> |
| <span class="normal"> MyObjectPrivate</span><span class="symbol">);</span> |
| <span class="cbracket">}</span> |
| |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">int</span> |
| <span class="function">my_object_get_some_field</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">MyObject </span><span class="symbol">*</span><span class="normal">my_object</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> MyObjectPrivate </span><span class="symbol">*</span><span class="normal">priv </span><span class="symbol">=</span><span class="normal"> my_object</span><span class="symbol">-></span><span class="normal">priv</span><span class="symbol">;</span> |
| |
| <span class="normal"> </span><span class="keyword">return</span><span class="normal"> priv</span><span class="symbol">-></span><span class="normal">some_field</span><span class="symbol">;</span> |
| <span class="cbracket">}</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p> |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>class structure for an instantiatable type |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>private_size</code></em> :</span></p></td> |
| <td>size of private structure. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_add_class_private ()"> |
| <a name="g-type-add-class-private"></a><h3>g_type_add_class_private ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_add_class_private (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> class_type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> private_size</code></em>);</pre> |
| <p> |
| Registers a private class structure for a classed type; |
| when the class is allocated, the private structures for |
| the class 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 <code class="function">get_type()</code> function after the type is registered. |
| The private structure can be retrieved using the |
| <code class="function">G_TYPE_CLASS_GET_PRIVATE()</code> macro. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>class_type</code></em> :</span></p></td> |
| <td>GType of an classed type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>private_size</code></em> :</span></p></td> |
| <td>size of private structure. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.24</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_interface_peek ()"> |
| <a name="g-type-interface-peek"></a><h3>g_type_interface_peek ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> g_type_interface_peek (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> instance_class</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> iface_type</code></em>);</pre> |
| <p> |
| Returns the <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="GTypeInterface"><span class="type">GTypeInterface</span></a> structure of an interface to which the |
| passed in class conforms. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance_class</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>iface_type</code></em> :</span></p></td> |
| <td>An interface ID which this class conforms to. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The GTypeInterface structure of iface_type if implemented |
| by <em class="parameter"><code>instance_class</code></em>, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> otherwise |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_interface_peek_parent ()"> |
| <a name="g-type-interface-peek-parent"></a><h3>g_type_interface_peek_parent ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> g_type_interface_peek_parent (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>);</pre> |
| <p> |
| Returns the corresponding <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="GTypeInterface"><span class="type">GTypeInterface</span></a> structure of the parent type |
| of the instance type to which <em class="parameter"><code>g_iface</code></em> belongs. This is useful when |
| deriving the implementation of an interface from the parent type and |
| then possibly overriding some methods. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="GTypeInterface"><span class="type">GTypeInterface</span></a> structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The corresponding <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="GTypeInterface"><span class="type">GTypeInterface</span></a> structure of the parent |
| type of the instance type to which <em class="parameter"><code>g_iface</code></em> belongs, or |
| <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the parent type doesn't conform to the interface. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_default_interface_ref ()"> |
| <a name="g-type-default-interface-ref"></a><h3>g_type_default_interface_ref ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> g_type_default_interface_ref (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> g_type</code></em>);</pre> |
| <p> |
| Increments the reference count for the interface type <em class="parameter"><code>g_type</code></em>, |
| and returns the default interface vtable for the type. |
| </p> |
| <p> |
| If the type is not currently in use, then the default vtable |
| for the type will be created and initalized by calling |
| the base interface init and default vtable init functions for |
| the type (the @<em class="structfield"><code>base_init</code></em> |
| and <em class="structfield"><code>class_init</code></em> members of <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a>). |
| Calling <a class="link" href="gobject-Type-Information.html#g-type-default-interface-ref" title="g_type_default_interface_ref ()"><code class="function">g_type_default_interface_ref()</code></a> is useful when you |
| want to make sure that signals and properties for an interface |
| have been installed. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td> |
| <td>an interface type |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the default vtable for the interface; call |
| <a class="link" href="gobject-Type-Information.html#g-type-default-interface-unref" title="g_type_default_interface_unref ()"><code class="function">g_type_default_interface_unref()</code></a> when you are done using |
| the interface. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_default_interface_peek ()"> |
| <a name="g-type-default-interface-peek"></a><h3>g_type_default_interface_peek ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> g_type_default_interface_peek (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> g_type</code></em>);</pre> |
| <p> |
| If the interface type <em class="parameter"><code>g_type</code></em> is currently in use, returns its |
| default interface vtable. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td> |
| <td>an interface type |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the default vtable for the interface, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> |
| if the type is not currently in use. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_default_interface_unref ()"> |
| <a name="g-type-default-interface-unref"></a><h3>g_type_default_interface_unref ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_default_interface_unref (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>);</pre> |
| <p> |
| Decrements the reference count for the type corresponding to the |
| interface default vtable <em class="parameter"><code>g_iface</code></em>. If the type is dynamic, then |
| when no one is using the interface and all references have |
| been released, the finalize function for the interface's default |
| vtable (the <em class="structfield"><code>class_finalize</code></em> member of |
| <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a>) will be called. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td> |
| <td>the default vtable structure for a interface, as |
| returned by <a class="link" href="gobject-Type-Information.html#g-type-default-interface-ref" title="g_type_default_interface_ref ()"><code class="function">g_type_default_interface_ref()</code></a> |
| </td> |
| </tr></tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_children ()"> |
| <a name="g-type-children"></a><h3>g_type_children ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>* g_type_children (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_children</code></em>);</pre> |
| <p> |
| Return a newly allocated and 0-terminated array of type IDs, listing the |
| child types of <em class="parameter"><code>type</code></em>. The return value has to be <a href="./../glib/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>ed after use. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>The parent type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>n_children</code></em> :</span></p></td> |
| <td>Optional <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> pointer to contain the number of child types. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> Newly allocated and 0-terminated array of child types. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_interfaces ()"> |
| <a name="g-type-interfaces"></a><h3>g_type_interfaces ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>* g_type_interfaces (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_interfaces</code></em>);</pre> |
| <p> |
| Return a newly allocated and 0-terminated array of type IDs, listing the |
| interface types that <em class="parameter"><code>type</code></em> conforms to. The return value has to be |
| <a href="./../glib/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>ed after use. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>The type to list interface types for. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>n_interfaces</code></em> :</span></p></td> |
| <td>Optional <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> pointer to contain the number of |
| interface types. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> Newly allocated and 0-terminated array of interface types. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_interface_prerequisites ()"> |
| <a name="g-type-interface-prerequisites"></a><h3>g_type_interface_prerequisites ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a>* g_type_interface_prerequisites (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_prerequisites</code></em>);</pre> |
| <p> |
| Returns the prerequisites of an interfaces type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td> |
| <td>an interface type |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>n_prerequisites</code></em> :</span></p></td> |
| <td>location to return the number of prerequisites, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a newly-allocated zero-terminated array of <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> containing |
| the prerequisites of <em class="parameter"><code>interface_type</code></em> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.2</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_set_qdata ()"> |
| <a name="g-type-set-qdata"></a><h3>g_type_set_qdata ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_set_qdata (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> quark</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre> |
| <p> |
| Attaches arbitrary data to a type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>quark</code></em> :</span></p></td> |
| <td>a <a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identify the data |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td> |
| <td>the data |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_get_qdata ()"> |
| <a name="g-type-get-qdata"></a><h3>g_type_get_qdata ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> g_type_get_qdata (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> quark</code></em>);</pre> |
| <p> |
| Obtains data which has previously been attached to <em class="parameter"><code>type</code></em> |
| with <a class="link" href="gobject-Type-Information.html#g-type-set-qdata" title="g_type_set_qdata ()"><code class="function">g_type_set_qdata()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>quark</code></em> :</span></p></td> |
| <td>a <a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identify the data |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the data, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no data was found |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_query ()"> |
| <a name="g-type-query"></a><h3>g_type_query ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_query (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeQuery" title="GTypeQuery"><span class="type">GTypeQuery</span></a> *query</code></em>);</pre> |
| <p> |
| Queries the type system for information about a specific type. |
| This function will fill in a user-provided structure to hold |
| type-specific information. If an invalid <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> is passed in, the |
| <em class="parameter"><code>type</code></em> member of the <a class="link" href="gobject-Type-Information.html#GTypeQuery" title="GTypeQuery"><span class="type">GTypeQuery</span></a> is 0. All members filled into the |
| <a class="link" href="gobject-Type-Information.html#GTypeQuery" title="GTypeQuery"><span class="type">GTypeQuery</span></a> structure should be considered constant and have to be |
| left untouched. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of a static, classed type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>query</code></em> :</span></p></td> |
| <td>A user provided structure that is filled in with constant values |
| upon success. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GTypeQuery"> |
| <a name="GTypeQuery"></a><h3>GTypeQuery</h3> |
| <pre class="programlisting">typedef struct { |
| GType type; |
| const gchar *type_name; |
| guint class_size; |
| guint instance_size; |
| } GTypeQuery; |
| </pre> |
| <p> |
| A structure holding information for a specific type. It is |
| filled in by the <a class="link" href="gobject-Type-Information.html#g-type-query" title="g_type_query ()"><code class="function">g_type_query()</code></a> function. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> <em class="structfield"><code><a name="GTypeQuery.type"></a>type</code></em>;</span></p></td> |
| <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of the type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GTypeQuery.type-name"></a>type_name</code></em>;</span></p></td> |
| <td>the name of the type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GTypeQuery.class-size"></a>class_size</code></em>;</span></p></td> |
| <td>the size of the class structure. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GTypeQuery.instance-size"></a>instance_size</code></em>;</span></p></td> |
| <td>the size of the instance structure. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GBaseInitFunc ()"> |
| <a name="GBaseInitFunc"></a><h3>GBaseInitFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> (*GBaseInitFunc) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre> |
| <p> |
| A callback function used by the type system to do base initialization |
| of the class structures of derived types. It is called as part of the |
| initialization process of all derived classes and should reallocate |
| or reset all dynamic class members copied over from the parent class. |
| For example, class members (such as strings) that are not sufficiently |
| handled by a plain memory copy of the parent class into the derived class |
| have to be altered. See <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> for a discussion of the class |
| intialization process. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure to initialize. |
| </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GBaseFinalizeFunc ()"> |
| <a name="GBaseFinalizeFunc"></a><h3>GBaseFinalizeFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> (*GBaseFinalizeFunc) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre> |
| <p> |
| A callback function used by the type system to finalize those portions |
| of a derived types class structure that were setup from the corresponding |
| <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> function. Class finalization basically works the inverse |
| way in which class intialization is performed. |
| See <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> for a discussion of the class intialization process. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure to finalize. |
| </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GClassInitFunc ()"> |
| <a name="GClassInitFunc"></a><h3>GClassInitFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> (*GClassInitFunc) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> class_data</code></em>);</pre> |
| <p> |
| A callback function used by the type system to initialize the class |
| of a specific type. This function should initialize all static class |
| members. |
| The initialization process of a class involves: |
| </p> |
| <div class="itemizedlist"><ul class="itemizedlist" type="disc"> |
| <li class="listitem"><p> |
| 1 - Copying common members from the parent class over to the |
| derived class structure. |
| </p></li> |
| <li class="listitem"><p> |
| 2 - Zero initialization of the remaining members not copied |
| over from the parent class. |
| </p></li> |
| <li class="listitem"><p> |
| 3 - Invocation of the <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> initializers of all parent |
| types and the class' type. |
| </p></li> |
| <li class="listitem"><p> |
| 4 - Invocation of the class' <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> initializer. |
| </p></li> |
| </ul></div> |
| <p> |
| Since derived classes are partially initialized through a memory copy |
| of the parent class, the general rule is that <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> and |
| <a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()"><code class="function">GBaseFinalizeFunc()</code></a> should take care of necessary reinitialization |
| and release of those class members that were introduced by the type |
| that specified these <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a>/<a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()"><code class="function">GBaseFinalizeFunc()</code></a>. |
| <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> should only care about initializing static |
| class members, while dynamic class members (such as allocated strings |
| or reference counted resources) are better handled by a <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> |
| for this type, so proper initialization of the dynamic class members |
| is performed for class initialization of derived types as well. |
| An example may help to correspond the intend of the different class |
| initializers: |
| </p> |
| <p> |
| </p> |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
| 13 |
| 14 |
| 15 |
| 16 |
| 17 |
| 18 |
| 19 |
| 20 |
| 21 |
| 22 |
| 23 |
| 24 |
| 25 |
| 26 |
| 27 |
| 28 |
| 29 |
| 30 |
| 31 |
| 32 |
| 33 |
| 34 |
| 35 |
| 36 |
| 37 |
| 38 |
| 39 |
| 40 |
| 41</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="cbracket">{</span> |
| <span class="normal"> <a href="gobject-The-Base-Object-Type.html#GObjectClass">GObjectClass</a> parent_class</span><span class="symbol">;</span> |
| <span class="normal"> <a href="./../glib/glib/glib-Basic-Types.html#gint">gint</a> static_integer</span><span class="symbol">;</span> |
| <span class="normal"> <a href="./../glib/glib/glib-Basic-Types.html#gchar">gchar</a> </span><span class="symbol">*</span><span class="normal">dynamic_string</span><span class="symbol">;</span> |
| <span class="cbracket">}</span><span class="normal"> TypeAClass</span><span class="symbol">;</span> |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span> |
| <span class="function">type_a_base_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TypeAClass </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> class</span><span class="symbol">-></span><span class="normal">dynamic_string </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-String-Utility-Functions.html#g-strdup">g_strdup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"some string"</span><span class="symbol">);</span> |
| <span class="cbracket">}</span> |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span> |
| <span class="function">type_a_base_class_finalize</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TypeAClass </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-Memory-Allocation.html#g-free">g_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">class</span><span class="symbol">-></span><span class="normal">dynamic_string</span><span class="symbol">);</span> |
| <span class="cbracket">}</span> |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span> |
| <span class="function">type_a_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TypeAClass </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> class</span><span class="symbol">-></span><span class="normal">static_integer </span><span class="symbol">=</span><span class="normal"> </span><span class="number">42</span><span class="symbol">;</span> |
| <span class="cbracket">}</span> |
| |
| <span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="cbracket">{</span> |
| <span class="normal"> TypeAClass parent_class</span><span class="symbol">;</span> |
| <span class="normal"> <a href="./../glib/glib/glib-Basic-Types.html#gfloat">gfloat</a> static_float</span><span class="symbol">;</span> |
| <span class="normal"> <a href="./../glib/glib/glib-Strings.html#GString">GString</a> </span><span class="symbol">*</span><span class="normal">dynamic_gstring</span><span class="symbol">;</span> |
| <span class="cbracket">}</span><span class="normal"> TypeBClass</span><span class="symbol">;</span> |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span> |
| <span class="function">type_b_base_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TypeBClass </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> class</span><span class="symbol">-></span><span class="normal">dynamic_gstring </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-Strings.html#g-string-new">g_string_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"some other string"</span><span class="symbol">);</span> |
| <span class="cbracket">}</span> |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span> |
| <span class="function">type_b_base_class_finalize</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TypeBClass </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-Strings.html#g-string-free">g_string_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">class</span><span class="symbol">-></span><span class="normal">dynamic_gstring</span><span class="symbol">);</span> |
| <span class="cbracket">}</span> |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span> |
| <span class="function">type_b_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TypeBClass </span><span class="symbol">*</span><span class="normal">class</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> class</span><span class="symbol">-></span><span class="normal">static_float </span><span class="symbol">=</span><span class="normal"> </span><span class="number">3.14159265358979323846</span><span class="symbol">;</span> |
| <span class="cbracket">}</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p> |
| Initialization of TypeBClass will first cause initialization of |
| TypeAClass (derived classes reference their parent classes, see |
| <a class="link" href="gobject-Type-Information.html#g-type-class-ref" title="g_type_class_ref ()"><code class="function">g_type_class_ref()</code></a> on this). |
| Initialization of TypeAClass roughly involves zero-initializing its fields, |
| then calling its <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> <code class="function">type_a_base_class_init()</code> to allocate |
| its dynamic members (dynamic_string), and finally calling its <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> |
| <code class="function">type_a_class_init()</code> to initialize its static members (static_integer). |
| The first step in the initialization process of TypeBClass is then |
| a plain memory copy of the contents of TypeAClass into TypeBClass and |
| zero-initialization of the remaining fields in TypeBClass. |
| The dynamic members of TypeAClass within TypeBClass now need |
| reinitialization which is performed by calling <code class="function">type_a_base_class_init()</code> |
| with an argument of TypeBClass. |
| After that, the <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> of TypeBClass, <code class="function">type_b_base_class_init()</code> |
| is called to allocate the dynamic members of TypeBClass (dynamic_gstring), |
| and finally the <a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><code class="function">GClassInitFunc()</code></a> of TypeBClass, <code class="function">type_b_class_init()</code>, |
| is called to complete the initialization process with the static members |
| (static_float). |
| Corresponding finalization counter parts to the <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> functions |
| have to be provided to release allocated resources at class finalization |
| time. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure to initialize. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>class_data</code></em> :</span></p></td> |
| <td>The <em class="parameter"><code>class_data</code></em> member supplied via the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> structure. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GClassFinalizeFunc ()"> |
| <a name="GClassFinalizeFunc"></a><h3>GClassFinalizeFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> (*GClassFinalizeFunc) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> class_data</code></em>);</pre> |
| <p> |
| A callback function used by the type system to finalize a class. |
| This function is rarely needed, as dynamically allocated class resources |
| should be handled by <a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()"><code class="function">GBaseInitFunc()</code></a> and <a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()"><code class="function">GBaseFinalizeFunc()</code></a>. |
| Also, specification of a <a class="link" href="gobject-Type-Information.html#GClassFinalizeFunc" title="GClassFinalizeFunc ()"><code class="function">GClassFinalizeFunc()</code></a> in the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> |
| structure of a static type is invalid, because classes of static types |
| will never be finalized (they are artificially kept alive when their |
| reference count drops to zero). |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure to finalize. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>class_data</code></em> :</span></p></td> |
| <td>The <em class="parameter"><code>class_data</code></em> member supplied via the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> structure. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GInstanceInitFunc ()"> |
| <a name="GInstanceInitFunc"></a><h3>GInstanceInitFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> (*GInstanceInitFunc) (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> *instance</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre> |
| <p> |
| A callback function used by the type system to initialize a new |
| instance of a type. This function initializes all instance members and |
| allocates any resources required by it. |
| Initialization of a derived instance involves calling all its parent |
| types instance initializers, so the class member of the instance |
| is altered during its initialization to always point to the class that |
| belongs to the type the current initializer was introduced for. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td> |
| <td>The instance to initialize. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>The class of the type the instance is created for. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GInterfaceInitFunc ()"> |
| <a name="GInterfaceInitFunc"></a><h3>GInterfaceInitFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> (*GInterfaceInitFunc) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> iface_data</code></em>);</pre> |
| <p> |
| A callback function used by the type system to initialize a new |
| interface. This function should initialize all internal data and |
| allocate any resources required by the interface. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td> |
| <td>The interface structure to initialize. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>iface_data</code></em> :</span></p></td> |
| <td>The <em class="parameter"><code>interface_data</code></em> supplied via the <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> structure. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GInterfaceFinalizeFunc ()"> |
| <a name="GInterfaceFinalizeFunc"></a><h3>GInterfaceFinalizeFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> (*GInterfaceFinalizeFunc) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> iface_data</code></em>);</pre> |
| <p> |
| A callback function used by the type system to finalize an interface. |
| This function should destroy any internal data and release any resources |
| allocated by the corresponding <a class="link" href="gobject-Type-Information.html#GInterfaceInitFunc" title="GInterfaceInitFunc ()"><code class="function">GInterfaceInitFunc()</code></a> function. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td> |
| <td>The interface structure to finalize. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>iface_data</code></em> :</span></p></td> |
| <td>The <em class="parameter"><code>interface_data</code></em> supplied via the <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> structure. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="GTypeClassCacheFunc ()"> |
| <a name="GTypeClassCacheFunc"></a><h3>GTypeClassCacheFunc ()</h3> |
| <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (*GTypeClassCacheFunc) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> *g_class</code></em>);</pre> |
| <p> |
| A callback function which is called when the reference count of a class |
| drops to zero. It may use <a class="link" href="gobject-Type-Information.html#g-type-class-ref" title="g_type_class_ref ()"><code class="function">g_type_class_ref()</code></a> to prevent the class from |
| being freed. You should not call <a class="link" href="gobject-Type-Information.html#g-type-class-unref" title="g_type_class_unref ()"><code class="function">g_type_class_unref()</code></a> from a |
| <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> function to prevent infinite recursion, use |
| <a class="link" href="gobject-Type-Information.html#g-type-class-unref-uncached" title="g_type_class_unref_uncached ()"><code class="function">g_type_class_unref_uncached()</code></a> instead. |
| </p> |
| <p> |
| The functions have to check the class id passed in to figure |
| whether they actually want to cache the class of this type, since all |
| classes are routed through the same <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> chain. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>cache_data</code></em> :</span></p></td> |
| <td>data that was given to the <a class="link" href="gobject-Type-Information.html#g-type-add-class-cache-func" title="g_type_add_class_cache_func ()"><code class="function">g_type_add_class_cache_func()</code></a> call |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure which is unreferenced |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop further <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a>s from being |
| called, <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to continue. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="enum GTypeFlags"> |
| <a name="GTypeFlags"></a><h3>enum GTypeFlags</h3> |
| <pre class="programlisting">typedef enum /*< skip >*/ |
| { |
| G_TYPE_FLAG_ABSTRACT = (1 << 4), |
| G_TYPE_FLAG_VALUE_ABSTRACT = (1 << 5) |
| } GTypeFlags; |
| </pre> |
| <p> |
| Bit masks used to check or determine characteristics of a type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><a name="G-TYPE-FLAG-ABSTRACT:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_ABSTRACT</code></span></p></td> |
| <td>Indicates an abstract type. No instances can be |
| created for an abstract type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-TYPE-FLAG-VALUE-ABSTRACT:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_VALUE_ABSTRACT</code></span></p></td> |
| <td>Indicates an abstract value type, i.e. a type |
| that introduces a value table, but can't be used for |
| <a class="link" href="gobject-Generic-values.html#g-value-init" title="g_value_init ()"><code class="function">g_value_init()</code></a>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="enum GTypeFundamentalFlags"> |
| <a name="GTypeFundamentalFlags"></a><h3>enum GTypeFundamentalFlags</h3> |
| <pre class="programlisting">typedef enum /*< skip >*/ |
| { |
| G_TYPE_FLAG_CLASSED = (1 << 0), |
| G_TYPE_FLAG_INSTANTIATABLE = (1 << 1), |
| G_TYPE_FLAG_DERIVABLE = (1 << 2), |
| G_TYPE_FLAG_DEEP_DERIVABLE = (1 << 3) |
| } GTypeFundamentalFlags; |
| </pre> |
| <p> |
| Bit masks used to check or determine specific characteristics of a |
| fundamental type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><a name="G-TYPE-FLAG-CLASSED:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_CLASSED</code></span></p></td> |
| <td>Indicates a classed type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-TYPE-FLAG-INSTANTIATABLE:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_INSTANTIATABLE</code></span></p></td> |
| <td>Indicates an instantiable type (implies classed). |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-TYPE-FLAG-DERIVABLE:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_DERIVABLE</code></span></p></td> |
| <td>Indicates a flat derivable type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-TYPE-FLAG-DEEP-DERIVABLE:CAPS"></a><span class="term"><code class="literal">G_TYPE_FLAG_DEEP_DERIVABLE</code></span></p></td> |
| <td>Indicates a deep derivable type (implies derivable). |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_register_static ()"> |
| <a name="g-type-register-static"></a><h3>g_type_register_static ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> g_type_register_static (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>, |
| <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>, |
| <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> *info</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);</pre> |
| <p> |
| Registers <em class="parameter"><code>type_name</code></em> as the name of a new static type derived from |
| <em class="parameter"><code>parent_type</code></em>. The type system uses the information contained in the |
| <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> structure pointed to by <em class="parameter"><code>info</code></em> to manage the type and its |
| instances (if not abstract). The value of <em class="parameter"><code>flags</code></em> determines the nature |
| (e.g. abstract or not) of the type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>parent_type</code></em> :</span></p></td> |
| <td>Type from which this type will be derived. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td> |
| <td>0-terminated string used as the name of the new type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> structure for this type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td> |
| <td>Bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The new type identifier. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_register_static_simple ()"> |
| <a name="g-type-register-static-simple"></a><h3>g_type_register_static_simple ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> g_type_register_static_simple (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>, |
| <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> class_size</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()"><span class="type">GClassInitFunc</span></a> class_init</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> instance_size</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()"><span class="type">GInstanceInitFunc</span></a> instance_init</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);</pre> |
| <p> |
| Registers <em class="parameter"><code>type_name</code></em> as the name of a new static type derived from |
| <em class="parameter"><code>parent_type</code></em>. The value of <em class="parameter"><code>flags</code></em> determines the nature (e.g. |
| abstract or not) of the type. It works by filling a <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> |
| struct and calling <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()"><code class="function">g_type_register_static()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>parent_type</code></em> :</span></p></td> |
| <td>Type from which this type will be derived. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td> |
| <td>0-terminated string used as the name of the new type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>class_size</code></em> :</span></p></td> |
| <td>Size of the class structure (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a>) |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>class_init</code></em> :</span></p></td> |
| <td>Location of the class initialization function (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a>) |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance_size</code></em> :</span></p></td> |
| <td>Size of the instance structure (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a>) |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance_init</code></em> :</span></p></td> |
| <td>Location of the instance initialization function (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a>) |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td> |
| <td>Bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The new type identifier. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.12</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_register_dynamic ()"> |
| <a name="g-type-register-dynamic"></a><h3>g_type_register_dynamic ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> g_type_register_dynamic (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> parent_type</code></em>, |
| <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>, |
| <em class="parameter"><code><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> *plugin</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);</pre> |
| <p> |
| Registers <em class="parameter"><code>type_name</code></em> as the name of a new dynamic type derived from |
| <em class="parameter"><code>parent_type</code></em>. The type system uses the information contained in the |
| <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure pointed to by <em class="parameter"><code>plugin</code></em> to manage the type and its |
| instances (if not abstract). The value of <em class="parameter"><code>flags</code></em> determines the nature |
| (e.g. abstract or not) of the type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>parent_type</code></em> :</span></p></td> |
| <td>Type from which this type will be derived. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td> |
| <td>0-terminated string used as the name of the new type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>plugin</code></em> :</span></p></td> |
| <td>The <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure to retrieve the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> from. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td> |
| <td>Bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The new type identifier or <a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID"><span class="type">G_TYPE_INVALID</span></a> if registration failed. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_register_fundamental ()"> |
| <a name="g-type-register-fundamental"></a><h3>g_type_register_fundamental ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> g_type_register_fundamental (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type_id</code></em>, |
| <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>, |
| <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> *info</code></em>, |
| <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> *finfo</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> flags</code></em>);</pre> |
| <p> |
| Registers <em class="parameter"><code>type_id</code></em> as the predefined identifier and <em class="parameter"><code>type_name</code></em> as the |
| name of a fundamental type. The type system uses the information |
| contained in the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> structure pointed to by <em class="parameter"><code>info</code></em> and the |
| <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> structure pointed to by <em class="parameter"><code>finfo</code></em> to manage the |
| type and its instances. The value of <em class="parameter"><code>flags</code></em> determines additional |
| characteristics of the fundamental type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type_id</code></em> :</span></p></td> |
| <td>A predefined type identifier. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td> |
| <td>0-terminated string used as the name of the new type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> structure for this type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>finfo</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> structure for this type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td> |
| <td>Bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The predefined type identifier. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_add_interface_static ()"> |
| <a name="g-type-add-interface-static"></a><h3>g_type_add_interface_static ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_add_interface_static (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>, |
| <em class="parameter"><code>const <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> *info</code></em>);</pre> |
| <p> |
| Adds the static <em class="parameter"><code>interface_type</code></em> to <em class="parameter"><code>instantiable_type</code></em>. The information |
| contained in the <span class="type">GTypeInterfaceInfo</span> structure pointed to by <em class="parameter"><code>info</code></em> |
| is used to manage the relationship. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance_type</code></em> :</span></p></td> |
| <td> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an instantiable type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td> |
| <td> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> structure for this |
| (<em class="parameter"><code>instance_type</code></em>, <em class="parameter"><code>interface_type</code></em>) combination. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_add_interface_dynamic ()"> |
| <a name="g-type-add-interface-dynamic"></a><h3>g_type_add_interface_dynamic ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_add_interface_dynamic (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>, |
| <em class="parameter"><code><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> *plugin</code></em>);</pre> |
| <p> |
| Adds the dynamic <em class="parameter"><code>interface_type</code></em> to <em class="parameter"><code>instantiable_type</code></em>. The information |
| contained in the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure pointed to by <em class="parameter"><code>plugin</code></em> |
| is used to manage the relationship. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance_type</code></em> :</span></p></td> |
| <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an instantiable type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td> |
| <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>plugin</code></em> :</span></p></td> |
| <td>the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure to retrieve the <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> from. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_interface_add_prerequisite ()"> |
| <a name="g-type-interface-add-prerequisite"></a><h3>g_type_interface_add_prerequisite ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_interface_add_prerequisite (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> prerequisite_type</code></em>);</pre> |
| <p> |
| Adds <em class="parameter"><code>prerequisite_type</code></em> to the list of prerequisites of <em class="parameter"><code>interface_type</code></em>. |
| This means that any type implementing <em class="parameter"><code>interface_type</code></em> must also implement |
| <em class="parameter"><code>prerequisite_type</code></em>. Prerequisites can be thought of as an alternative to |
| interface derivation (which GType doesn't support). An interface can have |
| at most one instantiatable prerequisite type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td> |
| <td> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>prerequisite_type</code></em> :</span></p></td> |
| <td> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface or instantiatable type. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_get_plugin ()"> |
| <a name="g-type-get-plugin"></a><h3>g_type_get_plugin ()</h3> |
| <pre class="programlisting"><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="returnvalue">GTypePlugin</span></a>* g_type_get_plugin (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre> |
| <p> |
| Returns the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure for <em class="parameter"><code>type</code></em> or |
| <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>type</code></em> does not have a <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> to retrieve the plugin for. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The corresponding plugin if <em class="parameter"><code>type</code></em> is a dynamic type, |
| <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> otherwise. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_interface_get_plugin ()"> |
| <a name="g-type-interface-get-plugin"></a><h3>g_type_interface_get_plugin ()</h3> |
| <pre class="programlisting"><a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="returnvalue">GTypePlugin</span></a>* g_type_interface_get_plugin (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> instance_type</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> interface_type</code></em>);</pre> |
| <p> |
| Returns the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure for the dynamic interface |
| <em class="parameter"><code>interface_type</code></em> which has been added to <em class="parameter"><code>instance_type</code></em>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if |
| <em class="parameter"><code>interface_type</code></em> has not been added to <em class="parameter"><code>instance_type</code></em> or does not |
| have a <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> structure. See <a class="link" href="gobject-Type-Information.html#g-type-add-interface-dynamic" title="g_type_add_interface_dynamic ()"><code class="function">g_type_add_interface_dynamic()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>instance_type</code></em> :</span></p></td> |
| <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an instantiatable type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>interface_type</code></em> :</span></p></td> |
| <td>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="type">GTypePlugin</span></a> for the dynamic interface <em class="parameter"><code>interface_type</code></em> |
| of <em class="parameter"><code>instance_type</code></em>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_fundamental_next ()"> |
| <a name="g-type-fundamental-next"></a><h3>g_type_fundamental_next ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> g_type_fundamental_next (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> |
| <p> |
| Returns the next free fundamental type id which can be used to |
| register a new fundamental type with <a class="link" href="gobject-Type-Information.html#g-type-register-fundamental" title="g_type_register_fundamental ()"><code class="function">g_type_register_fundamental()</code></a>. |
| The returned type ID represents the highest currently registered |
| fundamental type identifier. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> The nextmost fundamental type ID to be registered, |
| or 0 if the type system ran out of fundamental type IDs. |
| </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_fundamental ()"> |
| <a name="g-type-fundamental"></a><h3>g_type_fundamental ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> g_type_fundamental (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type_id</code></em>);</pre> |
| <p> |
| Internal function, used to extract the fundamental type ID portion. |
| use <a class="link" href="gobject-Type-Information.html#G-TYPE-FUNDAMENTAL:CAPS" title="G_TYPE_FUNDAMENTAL()"><code class="function">G_TYPE_FUNDAMENTAL()</code></a> instead. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type_id</code></em> :</span></p></td> |
| <td>valid type ID |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> fundamental type ID |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_create_instance ()"> |
| <a name="g-type-create-instance"></a><h3>g_type_create_instance ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="returnvalue">GTypeInstance</span></a>* g_type_create_instance (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre> |
| <p> |
| Creates and initializes an instance of <em class="parameter"><code>type</code></em> if <em class="parameter"><code>type</code></em> is valid and |
| can be instantiated. The type system only performs basic allocation |
| and structure setups for instances: actual instance creation should |
| happen through functions supplied by the type's fundamental type |
| implementation. So use of <a class="link" href="gobject-Type-Information.html#g-type-create-instance" title="g_type_create_instance ()"><code class="function">g_type_create_instance()</code></a> is reserved for |
| implementators of fundamental types only. E.g. instances of the |
| <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> hierarchy should be created via <a class="link" href="gobject-The-Base-Object-Type.html#g-object-new" title="g_object_new ()"><code class="function">g_object_new()</code></a> and |
| <span class="emphasis"><em>never</em></span> directly through |
| <a class="link" href="gobject-Type-Information.html#g-type-create-instance" title="g_type_create_instance ()"><code class="function">g_type_create_instance()</code></a> which doesn't handle things like singleton |
| objects or object construction. Note: Do <span class="emphasis"><em>not</em></span> |
| use this function, unless you're implementing a fundamental |
| type. Also language bindings should <span class="emphasis"><em>not</em></span> use |
| this function but <a class="link" href="gobject-The-Base-Object-Type.html#g-object-new" title="g_object_new ()"><code class="function">g_object_new()</code></a> instead. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>An instantiatable type to create an instance for. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> An allocated and initialized instance, subject to further |
| treatment by the fundamental type implementation. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_free_instance ()"> |
| <a name="g-type-free-instance"></a><h3>g_type_free_instance ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_free_instance (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="GTypeInstance"><span class="type">GTypeInstance</span></a> *instance</code></em>);</pre> |
| <p> |
| Frees an instance of a type, returning it to the instance pool for |
| the type, if there is one. |
| </p> |
| <p> |
| Like <a class="link" href="gobject-Type-Information.html#g-type-create-instance" title="g_type_create_instance ()"><code class="function">g_type_create_instance()</code></a>, this function is reserved for |
| implementors of fundamental types. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td> |
| <td>an instance of a type. |
| </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_add_class_cache_func ()"> |
| <a name="g-type-add-class-cache-func"></a><h3>g_type_add_class_cache_func ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_add_class_cache_func (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> cache_func</code></em>);</pre> |
| <p> |
| Adds a <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> to be called before the reference count of a |
| class goes from one to zero. This can be used to prevent premature class |
| destruction. All installed <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> functions will be chained |
| until one of them returns <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>. The functions have to check the class id |
| passed in to figure whether they actually want to cache the class of this |
| type, since all classes are routed through the same <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> |
| chain. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>cache_data</code></em> :</span></p></td> |
| <td>data to be passed to <em class="parameter"><code>cache_func</code></em> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>cache_func</code></em> :</span></p></td> |
| <td>a <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_remove_class_cache_func ()"> |
| <a name="g-type-remove-class-cache-func"></a><h3>g_type_remove_class_cache_func ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_remove_class_cache_func (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cache_data</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> cache_func</code></em>);</pre> |
| <p> |
| Removes a previously installed <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a>. The cache |
| maintained by <em class="parameter"><code>cache_func</code></em> has to be empty when calling |
| <a class="link" href="gobject-Type-Information.html#g-type-remove-class-cache-func" title="g_type_remove_class_cache_func ()"><code class="function">g_type_remove_class_cache_func()</code></a> to avoid leaks. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>cache_data</code></em> :</span></p></td> |
| <td>data that was given when adding <em class="parameter"><code>cache_func</code></em> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>cache_func</code></em> :</span></p></td> |
| <td>a <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_class_unref_uncached ()"> |
| <a name="g-type-class-unref-uncached"></a><h3>g_type_class_unref_uncached ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_class_unref_uncached (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>);</pre> |
| <p> |
| A variant of <a class="link" href="gobject-Type-Information.html#g-type-class-unref" title="g_type_class_unref ()"><code class="function">g_type_class_unref()</code></a> for use in <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a> |
| implementations. It unreferences a class without consulting the chain |
| of <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a>s, avoiding the recursion which would occur |
| otherwise. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><em class="parameter"><code>g_class</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="GTypeClass"><span class="type">GTypeClass</span></a> structure to unreference. |
| </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_add_interface_check ()"> |
| <a name="g-type-add-interface-check"></a><h3>g_type_add_interface_check ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_add_interface_check (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()"><span class="type">GTypeInterfaceCheckFunc</span></a> check_func</code></em>);</pre> |
| <p> |
| Adds a function to be called after an interface vtable is |
| initialized for any class (i.e. after the <em class="parameter"><code>interface_init</code></em> member of |
| <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> has been called). |
| </p> |
| <p> |
| This function is useful when you want to check an invariant that |
| depends on the interfaces of a class. For instance, the |
| implementation of <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> uses this facility to check that an |
| object implements all of the properties that are defined on its |
| interfaces. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>check_data</code></em> :</span></p></td> |
| <td>data to pass to <em class="parameter"><code>check_func</code></em> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>check_func</code></em> :</span></p></td> |
| <td>function to be called after each interface |
| is initialized. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_remove_interface_check ()"> |
| <a name="g-type-remove-interface-check"></a><h3>g_type_remove_interface_check ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_type_remove_interface_check (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>, |
| <em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()"><span class="type">GTypeInterfaceCheckFunc</span></a> check_func</code></em>);</pre> |
| <p> |
| Removes an interface check function added with |
| <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()"><code class="function">g_type_add_interface_check()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>check_data</code></em> :</span></p></td> |
| <td>callback data passed to <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()"><code class="function">g_type_add_interface_check()</code></a> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>check_func</code></em> :</span></p></td> |
| <td>callback function passed to <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()"><code class="function">g_type_add_interface_check()</code></a> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="GTypeInterfaceCheckFunc ()"> |
| <a name="GTypeInterfaceCheckFunc"></a><h3>GTypeInterfaceCheckFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> (*GTypeInterfaceCheckFunc) (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>, |
| <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>);</pre> |
| <p> |
| A callback called after an interface vtable is initialized. |
| See <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()"><code class="function">g_type_add_interface_check()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>check_data</code></em> :</span></p></td> |
| <td>data passed to <a class="link" href="gobject-Type-Information.html#g-type-add-interface-check" title="g_type_add_interface_check ()"><code class="function">g_type_add_interface_check()</code></a>. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>g_iface</code></em> :</span></p></td> |
| <td>the interface that has been initialized |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_type_value_table_peek ()"> |
| <a name="g-type-value-table-peek"></a><h3>g_type_value_table_peek ()</h3> |
| <pre class="programlisting"><a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="returnvalue">GTypeValueTable</span></a>* g_type_value_table_peek (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> type</code></em>);</pre> |
| <p> |
| Returns the location of the <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with <em class="parameter"><code>type</code></em>. |
| <span class="emphasis"><em>Note that this function should only be used from source code |
| that implements or has internal knowledge of the implementation of |
| <em class="parameter"><code>type</code></em>.</em></span> |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> |
| <td>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> Location of the <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with <em class="parameter"><code>type</code></em> or |
| <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with <em class="parameter"><code>type</code></em>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_DEFINE_TYPE()"> |
| <a name="G-DEFINE-TYPE:CAPS"></a><h3>G_DEFINE_TYPE()</h3> |
| <pre class="programlisting">#define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {}) |
| </pre> |
| <p> |
| A convenience macro for type implementations, which declares a |
| class initialization function, an instance initialization function (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="GTypeInfo"><span class="type">GTypeInfo</span></a> for information about |
| these) and a static variable named <em class="parameter"><code>t_n</code></em>_parent_class pointing to the parent class. Furthermore, it defines |
| a *_get_type() function. See <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for an example. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td> |
| <td>The name of the new type, in Camel case. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td> |
| <td>The name of the new type, in lowercase, with words |
| separated by '_'. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_DEFINE_TYPE_WITH_CODE()"> |
| <a name="G-DEFINE-TYPE-WITH-CODE:CAPS"></a><h3>G_DEFINE_TYPE_WITH_CODE()</h3> |
| <pre class="programlisting">#define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() |
| </pre> |
| <p> |
| A convenience macro for type implementations. |
| Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()"><code class="function">G_DEFINE_TYPE()</code></a>, but allows you to insert custom code into the |
| *_get_type() function, e.g. interface implementations via <a class="link" href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS" title="G_IMPLEMENT_INTERFACE()"><code class="function">G_IMPLEMENT_INTERFACE()</code></a>. |
| See <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for an example. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td> |
| <td>The name of the new type, in Camel case. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td> |
| <td>The name of the new type in lowercase, with words separated by '_'. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>_C_</code></em> :</span></p></td> |
| <td>Custom code that gets inserted in the *_get_type() function. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_DEFINE_ABSTRACT_TYPE()"> |
| <a name="G-DEFINE-ABSTRACT-TYPE:CAPS"></a><h3>G_DEFINE_ABSTRACT_TYPE()</h3> |
| <pre class="programlisting">#define G_DEFINE_ABSTRACT_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, {}) |
| </pre> |
| <p> |
| A convenience macro for type implementations. |
| Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()"><code class="function">G_DEFINE_TYPE()</code></a>, but defines an abstract type. |
| See <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for an example. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td> |
| <td>The name of the new type, in Camel case. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td> |
| <td>The name of the new type, in lowercase, with words |
| separated by '_'. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_DEFINE_ABSTRACT_TYPE_WITH_CODE()"> |
| <a name="G-DEFINE-ABSTRACT-TYPE-WITH-CODE:CAPS"></a><h3>G_DEFINE_ABSTRACT_TYPE_WITH_CODE()</h3> |
| <pre class="programlisting">#define G_DEFINE_ABSTRACT_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() |
| </pre> |
| <p> |
| A convenience macro for type implementations. |
| Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-CODE:CAPS" title="G_DEFINE_TYPE_WITH_CODE()"><code class="function">G_DEFINE_TYPE_WITH_CODE()</code></a>, but defines an abstract type and allows you to |
| insert custom code into the *_get_type() function, e.g. interface implementations |
| via <a class="link" href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS" title="G_IMPLEMENT_INTERFACE()"><code class="function">G_IMPLEMENT_INTERFACE()</code></a>. See <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for an example. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td> |
| <td>The name of the new type, in Camel case. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td> |
| <td>The name of the new type, in lowercase, with words |
| separated by '_'. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>_C_</code></em> :</span></p></td> |
| <td>Custom code that gets inserted in the @<code class="function">type_name_get_type()</code> function. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_DEFINE_INTERFACE()"> |
| <a name="G-DEFINE-INTERFACE:CAPS"></a><h3>G_DEFINE_INTERFACE()</h3> |
| <pre class="programlisting">#define G_DEFINE_INTERFACE(TN, t_n, T_P) G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, ;) |
| </pre> |
| <p> |
| A convenience macro for <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="GTypeInterface"><span class="type">GTypeInterface</span></a> definitions, which declares |
| a default vtable initialization function and defines a *_get_type() |
| function. |
| </p> |
| <p> |
| The macro expects the interface initialization function to have the |
| name <code class="literal">t_n ## _default_init</code>, and the interface |
| structure to have the name <code class="literal">TN ## Interface</code>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td> |
| <td>The name of the new type, in Camel case. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td> |
| <td>The name of the new type, in lowercase, with words separated by '_'. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the prerequisite type for the interface, or 0 |
| (<a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID"><code class="literal">G_TYPE_INVALID</code></a>) for no prerequisite type. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.24</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_DEFINE_INTERFACE_WITH_CODE()"> |
| <a name="G-DEFINE-INTERFACE-WITH-CODE:CAPS"></a><h3>G_DEFINE_INTERFACE_WITH_CODE()</h3> |
| <pre class="programlisting">#define G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_INTERFACE_EXTENDED_BEGIN(TN, t_n, T_P) {_C_;} _G_DEFINE_INTERFACE_EXTENDED_END() |
| </pre> |
| <p> |
| A convenience macro for <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="GTypeInterface"><span class="type">GTypeInterface</span></a> definitions. Similar to |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-INTERFACE:CAPS" title="G_DEFINE_INTERFACE()"><code class="function">G_DEFINE_INTERFACE()</code></a>, but allows you to insert custom code into the |
| *_get_type() function, e.g. additional interface implementations |
| via <a class="link" href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS" title="G_IMPLEMENT_INTERFACE()"><code class="function">G_IMPLEMENT_INTERFACE()</code></a>, or additional prerequisite types. See |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for a similar example using |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-CODE:CAPS" title="G_DEFINE_TYPE_WITH_CODE()"><code class="function">G_DEFINE_TYPE_WITH_CODE()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td> |
| <td>The name of the new type, in Camel case. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td> |
| <td>The name of the new type, in lowercase, with words separated by '_'. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the prerequisite type for the interface, or 0 |
| (<a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID"><code class="literal">G_TYPE_INVALID</code></a>) for no prerequisite type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>_C_</code></em> :</span></p></td> |
| <td>Custom code that gets inserted in the *_get_type() function. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.24</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_IMPLEMENT_INTERFACE()"> |
| <a name="G-IMPLEMENT-INTERFACE:CAPS"></a><h3>G_IMPLEMENT_INTERFACE()</h3> |
| <pre class="programlisting">#define G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init)</pre> |
| <p> |
| A convenience macro to ease interface addition in the <em class="parameter"><code>_C_</code></em> section |
| of <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-CODE:CAPS" title="G_DEFINE_TYPE_WITH_CODE()"><code class="function">G_DEFINE_TYPE_WITH_CODE()</code></a> or <a class="link" href="gobject-Type-Information.html#G-DEFINE-ABSTRACT-TYPE-WITH-CODE:CAPS" title="G_DEFINE_ABSTRACT_TYPE_WITH_CODE()"><code class="function">G_DEFINE_ABSTRACT_TYPE_WITH_CODE()</code></a>. |
| See <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()"><code class="function">G_DEFINE_TYPE_EXTENDED()</code></a> for an example. |
| </p> |
| <p> |
| Note that this macro can only be used together with the G_DEFINE_TYPE_* |
| macros, since it depends on variable names from those macros. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>TYPE_IFACE</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the interface to add |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>iface_init</code></em> :</span></p></td> |
| <td>The interface init function |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_DEFINE_TYPE_EXTENDED()"> |
| <a name="G-DEFINE-TYPE-EXTENDED:CAPS"></a><h3>G_DEFINE_TYPE_EXTENDED()</h3> |
| <pre class="programlisting">#define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() |
| </pre> |
| <p> |
| The most general convenience macro for type implementations, on which |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()"><code class="function">G_DEFINE_TYPE()</code></a>, etc are based. |
| </p> |
| <p> |
| </p> |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="function"><a href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS">G_DEFINE_TYPE_EXTENDED</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkGadget</span><span class="symbol">,</span> |
| <span class="normal"> gtk_gadget</span><span class="symbol">,</span> |
| <span class="normal"> GTK_TYPE_WIDGET</span><span class="symbol">,</span> |
| <span class="normal"> </span><span class="number">0</span><span class="symbol">,</span> |
| <span class="normal"> </span><span class="function"><a href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS">G_IMPLEMENT_INTERFACE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TYPE_GIZMO</span><span class="symbol">,</span> |
| <span class="normal"> gtk_gadget_gizmo_init</span><span class="symbol">));</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p> |
| expands to |
| </p> |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
| 13 |
| 14 |
| 15 |
| 16 |
| 17 |
| 18 |
| 19 |
| 20 |
| 21 |
| 22 |
| 23 |
| 24 |
| 25 |
| 26 |
| 27 |
| 28 |
| 29 |
| 30 |
| 31 |
| 32 |
| 33</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> </span><span class="type">void</span><span class="normal"> </span><span class="function">gtk_gadget_init</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkGadget </span><span class="symbol">*</span><span class="normal">self</span><span class="symbol">);</span> |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span><span class="normal"> </span><span class="function">gtk_gadget_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkGadgetClass </span><span class="symbol">*</span><span class="normal">klass</span><span class="symbol">);</span> |
| <span class="keyword">static</span><span class="normal"> <a href="./../glib/glib/glib-Basic-Types.html#gpointer">gpointer</a> gtk_gadget_parent_class </span><span class="symbol">=</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span> |
| <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span><span class="normal"> </span><span class="function">gtk_gadget_class_intern_init</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="./../glib/glib/glib-Basic-Types.html#gpointer">gpointer</a> klass</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> gtk_gadget_parent_class </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gobject-Type-Information.html#g-type-class-peek-parent">g_type_class_peek_parent</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">klass</span><span class="symbol">);</span> |
| <span class="normal"> </span><span class="function">gtk_gadget_class_init</span><span class="normal"> </span><span class="symbol">((</span><span class="normal">GtkGadgetClass</span><span class="symbol">*)</span><span class="normal"> klass</span><span class="symbol">);</span> |
| <span class="cbracket">}</span> |
| |
| <span class="normal"><a href="gobject-Type-Information.html#GType">GType</a></span> |
| <span class="function">gtk_gadget_get_type</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> </span><span class="keyword">static</span><span class="normal"> </span><span class="keyword">volatile</span><span class="normal"> <a href="./../glib/glib/glib-Basic-Types.html#gsize">gsize</a> g_define_type_id__volatile </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span> |
| <span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="./../glib/glib/glib-Threads.html#g-once-init-enter">g_once_init_enter</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">g_define_type_id__volatile</span><span class="symbol">))</span> |
| <span class="normal"> </span><span class="cbracket">{</span> |
| <span class="normal"> <a href="gobject-Type-Information.html#GType">GType</a> g_define_type_id </span><span class="symbol">=</span> |
| <span class="normal"> </span><span class="function"><a href="gobject-Type-Information.html#g-type-register-static-simple">g_type_register_static_simple</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GTK_TYPE_WIDGET</span><span class="symbol">,</span> |
| <span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-Quarks.html#g-intern-static-string">g_intern_static_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"GtkGadget"</span><span class="symbol">),</span> |
| <span class="normal"> </span><span class="keyword">sizeof</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkGadgetClass</span><span class="symbol">),</span> |
| <span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gobject-Type-Information.html#GClassInitFunc">GClassInitFunc</a></span><span class="symbol">)</span><span class="normal"> gtk_gadget_class_intern_init</span><span class="symbol">,</span> |
| <span class="normal"> </span><span class="keyword">sizeof</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkGadget</span><span class="symbol">),</span> |
| <span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gobject-Type-Information.html#GInstanceInitFunc">GInstanceInitFunc</a></span><span class="symbol">)</span><span class="normal"> gtk_gadget_init</span><span class="symbol">,</span> |
| <span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gobject-Type-Information.html#GTypeFlags">GTypeFlags</a></span><span class="symbol">)</span><span class="normal"> flags</span><span class="symbol">);</span> |
| <span class="normal"> </span><span class="cbracket">{</span> |
| <span class="normal"> </span><span class="keyword">static</span><span class="normal"> </span><span class="keyword">const</span><span class="normal"> <a href="gobject-Type-Information.html#GInterfaceInfo">GInterfaceInfo</a> g_implement_interface_info </span><span class="symbol">=</span><span class="normal"> </span><span class="cbracket">{</span> |
| <span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gobject-Type-Information.html#GInterfaceInitFunc">GInterfaceInitFunc</a></span><span class="symbol">)</span><span class="normal"> gtk_gadget_gizmo_init</span> |
| <span class="normal"> </span><span class="cbracket">}</span><span class="symbol">;</span> |
| <span class="normal"> </span><span class="function"><a href="gobject-Type-Information.html#g-type-add-interface-static">g_type_add_interface_static</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">g_define_type_id</span><span class="symbol">,</span><span class="normal"> TYPE_GIZMO</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">g_implement_interface_info</span><span class="symbol">);</span> |
| <span class="normal"> </span><span class="cbracket">}</span> |
| <span class="normal"> </span><span class="function"><a href="./../glib/glib/glib-Threads.html#g-once-init-leave">g_once_init_leave</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">g_define_type_id__volatile</span><span class="symbol">,</span><span class="normal"> g_define_type_id</span><span class="symbol">);</span> |
| <span class="normal"> </span><span class="cbracket">}</span> |
| <span class="normal"> </span><span class="keyword">return</span><span class="normal"> g_define_type_id__volatile</span><span class="symbol">;</span> |
| <span class="cbracket">}</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p> |
| The only pieces which have to be manually provided are the definitions of |
| the instance and class structure and the definitions of the instance and |
| class init functions. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>TN</code></em> :</span></p></td> |
| <td>The name of the new type, in Camel case. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>t_n</code></em> :</span></p></td> |
| <td>The name of the new type, in lowercase, with words |
| separated by '_'. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>T_P</code></em> :</span></p></td> |
| <td>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>_f_</code></em> :</span></p></td> |
| <td> |
| <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> to pass to <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()"><code class="function">g_type_register_static()</code></a> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>_C_</code></em> :</span></p></td> |
| <td>Custom code that gets inserted in the *_get_type() function. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_INVALID"> |
| <a name="G-TYPE-INVALID:CAPS"></a><h3>G_TYPE_INVALID</h3> |
| <pre class="programlisting">#define G_TYPE_INVALID G_TYPE_MAKE_FUNDAMENTAL (0) |
| </pre> |
| <p> |
| An invalid <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> used as error return value in some functions which return |
| a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_NONE"> |
| <a name="G-TYPE-NONE:CAPS"></a><h3>G_TYPE_NONE</h3> |
| <pre class="programlisting">#define G_TYPE_NONE G_TYPE_MAKE_FUNDAMENTAL (1) |
| </pre> |
| <p> |
| A fundamental type which is used as a replacement for the C |
| <code class="literal">void</code> return type. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_INTERFACE"> |
| <a name="G-TYPE-INTERFACE:CAPS"></a><h3>G_TYPE_INTERFACE</h3> |
| <pre class="programlisting">#define G_TYPE_INTERFACE G_TYPE_MAKE_FUNDAMENTAL (2) |
| </pre> |
| <p> |
| The fundamental type from which all interfaces are derived. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_CHAR"> |
| <a name="G-TYPE-CHAR:CAPS"></a><h3>G_TYPE_CHAR</h3> |
| <pre class="programlisting">#define G_TYPE_CHAR G_TYPE_MAKE_FUNDAMENTAL (3) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>. |
| The type designated by G_TYPE_CHAR is unconditionally an 8-bit signed integer. |
| This may or may not be the same type a the C type "gchar". |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_UCHAR"> |
| <a name="G-TYPE-UCHAR:CAPS"></a><h3>G_TYPE_UCHAR</h3> |
| <pre class="programlisting">#define G_TYPE_UCHAR G_TYPE_MAKE_FUNDAMENTAL (4) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_BOOLEAN"> |
| <a name="G-TYPE-BOOLEAN:CAPS"></a><h3>G_TYPE_BOOLEAN</h3> |
| <pre class="programlisting">#define G_TYPE_BOOLEAN G_TYPE_MAKE_FUNDAMENTAL (5) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_INT"> |
| <a name="G-TYPE-INT:CAPS"></a><h3>G_TYPE_INT</h3> |
| <pre class="programlisting">#define G_TYPE_INT G_TYPE_MAKE_FUNDAMENTAL (6) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_UINT"> |
| <a name="G-TYPE-UINT:CAPS"></a><h3>G_TYPE_UINT</h3> |
| <pre class="programlisting">#define G_TYPE_UINT G_TYPE_MAKE_FUNDAMENTAL (7) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_LONG"> |
| <a name="G-TYPE-LONG:CAPS"></a><h3>G_TYPE_LONG</h3> |
| <pre class="programlisting">#define G_TYPE_LONG G_TYPE_MAKE_FUNDAMENTAL (8) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#glong"><span class="type">glong</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_ULONG"> |
| <a name="G-TYPE-ULONG:CAPS"></a><h3>G_TYPE_ULONG</h3> |
| <pre class="programlisting">#define G_TYPE_ULONG G_TYPE_MAKE_FUNDAMENTAL (9) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_INT64"> |
| <a name="G-TYPE-INT64:CAPS"></a><h3>G_TYPE_INT64</h3> |
| <pre class="programlisting">#define G_TYPE_INT64 G_TYPE_MAKE_FUNDAMENTAL (10) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_UINT64"> |
| <a name="G-TYPE-UINT64:CAPS"></a><h3>G_TYPE_UINT64</h3> |
| <pre class="programlisting">#define G_TYPE_UINT64 G_TYPE_MAKE_FUNDAMENTAL (11) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_ENUM"> |
| <a name="G-TYPE-ENUM:CAPS"></a><h3>G_TYPE_ENUM</h3> |
| <pre class="programlisting">#define G_TYPE_ENUM G_TYPE_MAKE_FUNDAMENTAL (12) |
| </pre> |
| <p> |
| The fundamental type from which all enumeration types are derived. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_FLAGS"> |
| <a name="G-TYPE-FLAGS:CAPS"></a><h3>G_TYPE_FLAGS</h3> |
| <pre class="programlisting">#define G_TYPE_FLAGS G_TYPE_MAKE_FUNDAMENTAL (13) |
| </pre> |
| <p> |
| The fundamental type from which all flags types are derived. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_FLOAT"> |
| <a name="G-TYPE-FLOAT:CAPS"></a><h3>G_TYPE_FLOAT</h3> |
| <pre class="programlisting">#define G_TYPE_FLOAT G_TYPE_MAKE_FUNDAMENTAL (14) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_DOUBLE"> |
| <a name="G-TYPE-DOUBLE:CAPS"></a><h3>G_TYPE_DOUBLE</h3> |
| <pre class="programlisting">#define G_TYPE_DOUBLE G_TYPE_MAKE_FUNDAMENTAL (15) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_STRING"> |
| <a name="G-TYPE-STRING:CAPS"></a><h3>G_TYPE_STRING</h3> |
| <pre class="programlisting">#define G_TYPE_STRING G_TYPE_MAKE_FUNDAMENTAL (16) |
| </pre> |
| <p> |
| The fundamental type corresponding to nul-terminated C strings. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_POINTER"> |
| <a name="G-TYPE-POINTER:CAPS"></a><h3>G_TYPE_POINTER</h3> |
| <pre class="programlisting">#define G_TYPE_POINTER G_TYPE_MAKE_FUNDAMENTAL (17) |
| </pre> |
| <p> |
| The fundamental type corresponding to <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_BOXED"> |
| <a name="G-TYPE-BOXED:CAPS"></a><h3>G_TYPE_BOXED</h3> |
| <pre class="programlisting">#define G_TYPE_BOXED G_TYPE_MAKE_FUNDAMENTAL (18) |
| </pre> |
| <p> |
| The fundamental type from which all boxed types are derived. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_PARAM"> |
| <a name="G-TYPE-PARAM:CAPS"></a><h3>G_TYPE_PARAM</h3> |
| <pre class="programlisting">#define G_TYPE_PARAM G_TYPE_MAKE_FUNDAMENTAL (19) |
| </pre> |
| <p> |
| The fundamental type from which all <a class="link" href="gobject-GParamSpec.html#GParamSpec" title="GParamSpec"><span class="type">GParamSpec</span></a> types are derived. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_OBJECT"> |
| <a name="G-TYPE-OBJECT:CAPS"></a><h3>G_TYPE_OBJECT</h3> |
| <pre class="programlisting">#define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) |
| </pre> |
| <p> |
| The fundamental type for <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_GTYPE"> |
| <a name="G-TYPE-GTYPE:CAPS"></a><h3>G_TYPE_GTYPE</h3> |
| <pre class="programlisting">#define G_TYPE_GTYPE (g_gtype_get_type()) |
| </pre> |
| <p> |
| The type for <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_RESERVED_GLIB_FIRST"> |
| <a name="G-TYPE-RESERVED-GLIB-FIRST:CAPS"></a><h3>G_TYPE_RESERVED_GLIB_FIRST</h3> |
| <pre class="programlisting">#define G_TYPE_RESERVED_GLIB_FIRST (21) |
| </pre> |
| <p> |
| First fundamental type number to create a new fundamental type id with |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-MAKE-FUNDAMENTAL:CAPS" title="G_TYPE_MAKE_FUNDAMENTAL()"><code class="function">G_TYPE_MAKE_FUNDAMENTAL()</code></a> reserved for GLib. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_RESERVED_GLIB_LAST"> |
| <a name="G-TYPE-RESERVED-GLIB-LAST:CAPS"></a><h3>G_TYPE_RESERVED_GLIB_LAST</h3> |
| <pre class="programlisting">#define G_TYPE_RESERVED_GLIB_LAST (31) |
| </pre> |
| <p> |
| Last fundamental type number reserved for GLib. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_RESERVED_BSE_FIRST"> |
| <a name="G-TYPE-RESERVED-BSE-FIRST:CAPS"></a><h3>G_TYPE_RESERVED_BSE_FIRST</h3> |
| <pre class="programlisting">#define G_TYPE_RESERVED_BSE_FIRST (32) |
| </pre> |
| <p> |
| First fundamental type number to create a new fundamental type id with |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-MAKE-FUNDAMENTAL:CAPS" title="G_TYPE_MAKE_FUNDAMENTAL()"><code class="function">G_TYPE_MAKE_FUNDAMENTAL()</code></a> reserved for BSE. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_RESERVED_BSE_LAST"> |
| <a name="G-TYPE-RESERVED-BSE-LAST:CAPS"></a><h3>G_TYPE_RESERVED_BSE_LAST</h3> |
| <pre class="programlisting">#define G_TYPE_RESERVED_BSE_LAST (48) |
| </pre> |
| <p> |
| Last fundamental type number reserved for BSE. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="G_TYPE_RESERVED_USER_FIRST"> |
| <a name="G-TYPE-RESERVED-USER-FIRST:CAPS"></a><h3>G_TYPE_RESERVED_USER_FIRST</h3> |
| <pre class="programlisting">#define G_TYPE_RESERVED_USER_FIRST (49) |
| </pre> |
| <p> |
| First available fundamental type number to create new fundamental |
| type id with <a class="link" href="gobject-Type-Information.html#G-TYPE-MAKE-FUNDAMENTAL:CAPS" title="G_TYPE_MAKE_FUNDAMENTAL()"><code class="function">G_TYPE_MAKE_FUNDAMENTAL()</code></a>. |
| </p> |
| </div> |
| </div> |
| </div> |
| <div class="footer"> |
| <hr> |
| Generated by GTK-Doc V1.14</div> |
| </body> |
| </html> |