| <!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: GObject Reference Manual</title> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> |
| <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.25.1 (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="5"><tr valign="middle"> |
| <td width="100%" align="left" class="shortcuts"> |
| <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> |
| <a href="#gobject-Type-Information.description" class="shortcut">Description</a></span> |
| </td> |
| <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> |
| <td><a accesskey="u" href="rn01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> |
| <td><a accesskey="p" href="rn01.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> |
| <td><a accesskey="n" href="GTypePlugin.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> |
| </tr></table> |
| <div class="refentry"> |
| <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 class="gallery_image" valign="top" align="right"></td> |
| </tr></table></div> |
| <div class="refsect1"> |
| <a name="gobject-Type-Information.functions"></a><h2>Functions</h2> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="functions_return"> |
| <col class="functions_name"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-FUNDAMENTAL:CAPS" title="G_TYPE_FUNDAMENTAL()">G_TYPE_FUNDAMENTAL</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-MAKE-FUNDAMENTAL:CAPS" title="G_TYPE_MAKE_FUNDAMENTAL()">G_TYPE_MAKE_FUNDAMENTAL</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-ABSTRACT:CAPS" title="G_TYPE_IS_ABSTRACT()">G_TYPE_IS_ABSTRACT</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-DERIVED:CAPS" title="G_TYPE_IS_DERIVED()">G_TYPE_IS_DERIVED</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-FUNDAMENTAL:CAPS" title="G_TYPE_IS_FUNDAMENTAL()">G_TYPE_IS_FUNDAMENTAL</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-CLASSED:CAPS" title="G_TYPE_IS_CLASSED()">G_TYPE_IS_CLASSED</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-INSTANTIATABLE:CAPS" title="G_TYPE_IS_INSTANTIATABLE()">G_TYPE_IS_INSTANTIATABLE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-DERIVABLE:CAPS" title="G_TYPE_IS_DERIVABLE()">G_TYPE_IS_DERIVABLE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-IS-INTERFACE:CAPS" title="G_TYPE_IS_INTERFACE()">G_TYPE_IS_INTERFACE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-FROM-INSTANCE:CAPS" title="G_TYPE_FROM_INSTANCE()">G_TYPE_FROM_INSTANCE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-FROM-CLASS:CAPS" title="G_TYPE_FROM_CLASS()">G_TYPE_FROM_CLASS</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-FROM-INTERFACE:CAPS" title="G_TYPE_FROM_INTERFACE()">G_TYPE_FROM_INTERFACE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-CLASS-GET-PRIVATE:CAPS" title="G_TYPE_CLASS_GET_PRIVATE()">G_TYPE_CLASS_GET_PRIVATE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-INSTANCE:CAPS" title="G_TYPE_CHECK_INSTANCE()">G_TYPE_CHECK_INSTANCE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-INSTANCE-FUNDAMENTAL-TYPE:CAPS" title="G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE()">G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-CHECK-VALUE:CAPS" title="G_TYPE_CHECK_VALUE()">G_TYPE_CHECK_VALUE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-init" title="g_type_init ()">g_type_init</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-name" title="g_type_name ()">g_type_name</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-qname" title="g_type_qname ()">g_type_qname</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-from-name" title="g_type_from_name ()">g_type_from_name</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-parent" title="g_type_parent ()">g_type_parent</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-depth" title="g_type_depth ()">g_type_depth</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-next-base" title="g_type_next_base ()">g_type_next_base</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-is-a" title="g_type_is_a ()">g_type_is_a</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-class-ref" title="g_type_class_ref ()">g_type_class_ref</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-class-peek" title="g_type_class_peek ()">g_type_class_peek</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-class-unref" title="g_type_class_unref ()">g_type_class_unref</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-interface-peek" title="g_type_interface_peek ()">g_type_interface_peek</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-children" title="g_type_children ()">g_type_children</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-interfaces" title="g_type_interfaces ()">g_type_interfaces</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-interface-prerequisites" title="g_type_interface_prerequisites ()">g_type_interface_prerequisites</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-set-qdata" title="g_type_set_qdata ()">g_type_set_qdata</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-get-qdata" title="g_type_get_qdata ()">g_type_get_qdata</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-query" title="g_type_query ()">g_type_query</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="gobject-Type-Information.html#GBaseInitFunc" title="GBaseInitFunc ()">*GBaseInitFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="gobject-Type-Information.html#GBaseFinalizeFunc" title="GBaseFinalizeFunc ()">*GBaseFinalizeFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="gobject-Type-Information.html#GClassInitFunc" title="GClassInitFunc ()">*GClassInitFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="gobject-Type-Information.html#GClassFinalizeFunc" title="GClassFinalizeFunc ()">*GClassFinalizeFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="gobject-Type-Information.html#GInstanceInitFunc" title="GInstanceInitFunc ()">*GInstanceInitFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="gobject-Type-Information.html#GInterfaceInitFunc" title="GInterfaceInitFunc ()">*GInterfaceInitFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="gobject-Type-Information.html#GInterfaceFinalizeFunc" title="GInterfaceFinalizeFunc ()">*GInterfaceFinalizeFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()">*GTypeClassCacheFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-register-static" title="g_type_register_static ()">g_type_register_static</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-register-dynamic" title="g_type_register_dynamic ()">g_type_register_dynamic</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-register-fundamental" title="g_type_register_fundamental ()">g_type_register_fundamental</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="returnvalue">GTypePlugin</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-get-plugin" title="g_type_get_plugin ()">g_type_get_plugin</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GTypePlugin.html" title="GTypePlugin"><span class="returnvalue">GTypePlugin</span></a> * |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-fundamental-next" title="g_type_fundamental_next ()">g_type_fundamental_next</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="returnvalue">GType</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-fundamental" title="g_type_fundamental ()">g_type_fundamental</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="returnvalue">GTypeInstance</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-create-instance" title="g_type_create_instance ()">g_type_create_instance</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-free-instance" title="g_type_free_instance ()">g_type_free_instance</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="gobject-Type-Information.html#GTypeInterfaceCheckFunc" title="GTypeInterfaceCheckFunc ()">*GTypeInterfaceCheckFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="returnvalue">GTypeValueTable</span></a> * |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-ensure" title="g_type_ensure ()">g_type_ensure</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-get-type-registration-serial" title="g_type_get_type_registration_serial ()">g_type_get_type_registration_serial</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">int</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#g-type-get-instance-count" title="g_type_get_instance_count ()">g_type_get_instance_count</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DECLARE-FINAL-TYPE:CAPS" title="G_DECLARE_FINAL_TYPE()">G_DECLARE_FINAL_TYPE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DECLARE-DERIVABLE-TYPE:CAPS" title="G_DECLARE_DERIVABLE_TYPE()">G_DECLARE_DERIVABLE_TYPE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DECLARE-INTERFACE:CAPS" title="G_DECLARE_INTERFACE()">G_DECLARE_INTERFACE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()">G_DEFINE_TYPE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-PRIVATE:CAPS" title="G_DEFINE_TYPE_WITH_PRIVATE()">G_DEFINE_TYPE_WITH_PRIVATE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-ABSTRACT-TYPE:CAPS" title="G_DEFINE_ABSTRACT_TYPE()">G_DEFINE_ABSTRACT_TYPE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-ABSTRACT-TYPE-WITH-PRIVATE:CAPS" title="G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE()">G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-ADD-PRIVATE:CAPS" title="G_ADD_PRIVATE()">G_ADD_PRIVATE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-PRIVATE-OFFSET:CAPS" title="G_PRIVATE_OFFSET()">G_PRIVATE_OFFSET</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-PRIVATE-FIELD:CAPS" title="G_PRIVATE_FIELD()">G_PRIVATE_FIELD</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-PRIVATE-FIELD-P:CAPS" title="G_PRIVATE_FIELD_P()">G_PRIVATE_FIELD_P</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-INTERFACE:CAPS" title="G_DEFINE_INTERFACE()">G_DEFINE_INTERFACE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <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><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS" title="G_IMPLEMENT_INTERFACE()">G_IMPLEMENT_INTERFACE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-EXTENDED:CAPS" title="G_DEFINE_TYPE_EXTENDED()">G_DEFINE_TYPE_EXTENDED</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-BOXED-TYPE:CAPS" title="G_DEFINE_BOXED_TYPE()">G_DEFINE_BOXED_TYPE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-BOXED-TYPE-WITH-CODE:CAPS" title="G_DEFINE_BOXED_TYPE_WITH_CODE()">G_DEFINE_BOXED_TYPE_WITH_CODE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-POINTER-TYPE:CAPS" title="G_DEFINE_POINTER_TYPE()">G_DEFINE_POINTER_TYPE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="gobject-Type-Information.html#G-DEFINE-POINTER-TYPE-WITH-CODE:CAPS" title="G_DEFINE_POINTER_TYPE_WITH_CODE()">G_DEFINE_POINTER_TYPE_WITH_CODE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="gobject-Type-Information.other"></a><h2>Types and Values</h2> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="name"> |
| <col class="description"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="typedef_keyword">typedef</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-FUNDAMENTAL-MAX:CAPS" title="G_TYPE_FUNDAMENTAL_MAX">G_TYPE_FUNDAMENTAL_MAX</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface">GTypeInterface</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance">GTypeInstance</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass">GTypeClass</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo">GTypeInfo</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="struct GTypeFundamentalInfo">GTypeFundamentalInfo</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo">GInterfaceInfo</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable">GTypeValueTable</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><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></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">enum</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GTypeDebugFlags" title="enum GTypeDebugFlags">GTypeDebugFlags</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GTypeQuery" title="struct GTypeQuery">GTypeQuery</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">enum</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags">GTypeFlags</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">enum</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#GTypeFundamentalFlags" title="enum GTypeFundamentalFlags">GTypeFundamentalFlags</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-INVALID:CAPS" title="G_TYPE_INVALID">G_TYPE_INVALID</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-NONE:CAPS" title="G_TYPE_NONE">G_TYPE_NONE</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-INTERFACE:CAPS" title="G_TYPE_INTERFACE">G_TYPE_INTERFACE</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-CHAR:CAPS" title="G_TYPE_CHAR">G_TYPE_CHAR</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-UCHAR:CAPS" title="G_TYPE_UCHAR">G_TYPE_UCHAR</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-BOOLEAN:CAPS" title="G_TYPE_BOOLEAN">G_TYPE_BOOLEAN</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-INT:CAPS" title="G_TYPE_INT">G_TYPE_INT</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-UINT:CAPS" title="G_TYPE_UINT">G_TYPE_UINT</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-LONG:CAPS" title="G_TYPE_LONG">G_TYPE_LONG</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-ULONG:CAPS" title="G_TYPE_ULONG">G_TYPE_ULONG</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-INT64:CAPS" title="G_TYPE_INT64">G_TYPE_INT64</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-UINT64:CAPS" title="G_TYPE_UINT64">G_TYPE_UINT64</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-ENUM:CAPS" title="G_TYPE_ENUM">G_TYPE_ENUM</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-FLAGS:CAPS" title="G_TYPE_FLAGS">G_TYPE_FLAGS</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-FLOAT:CAPS" title="G_TYPE_FLOAT">G_TYPE_FLOAT</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-DOUBLE:CAPS" title="G_TYPE_DOUBLE">G_TYPE_DOUBLE</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-STRING:CAPS" title="G_TYPE_STRING">G_TYPE_STRING</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-POINTER:CAPS" title="G_TYPE_POINTER">G_TYPE_POINTER</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-BOXED:CAPS" title="G_TYPE_BOXED">G_TYPE_BOXED</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-PARAM:CAPS" title="G_TYPE_PARAM">G_TYPE_PARAM</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-OBJECT:CAPS" title="G_TYPE_OBJECT">G_TYPE_OBJECT</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-GTYPE:CAPS" title="G_TYPE_GTYPE">G_TYPE_GTYPE</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-VARIANT:CAPS" title="G_TYPE_VARIANT">G_TYPE_VARIANT</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><a class="link" href="gobject-Type-Information.html#G-TYPE-CHECKSUM:CAPS" title="G_TYPE_CHECKSUM">G_TYPE_CHECKSUM</a></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><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></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><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></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><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></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><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></td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"><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></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="gobject-Type-Information.includes"></a><h2>Includes</h2> |
| <pre class="synopsis">#include <glib-object.h> |
| </pre> |
| </div> |
| <div class="refsect1"> |
| <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.</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="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure.</p> |
| <p>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="struct 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.</p> |
| <p>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.</p> |
| <p>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="struct GTypeInfo"><span class="type">GTypeInfo</span></a> |
| structure and a <a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="struct 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>Type instance and class structs are limited to a total of 64 KiB, |
| including all parent types. Similarly, type instances' private data |
| (as created by <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>) are limited to a total of |
| 64 KiB. If a type instance needs a large static buffer, allocate it |
| separately (typically by using <a href="../glib-Arrays.html#GArray"><span class="type">GArray</span></a> or <a href="../glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a>) and put a pointer |
| to the buffer in the structure.</p> |
| <p>As mentioned in the <a class="link" href="gtype-conventions.html" title="Conventions">GType conventions</a>, type names must |
| be at least three characters long. There is no upper length limit. The first |
| character must 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"> |
| <a name="gobject-Type-Information.functions_details"></a><h2>Functions</h2> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-FUNDAMENTAL.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-MAKE-FUNDAMENTAL.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>x</p></td> |
| <td class="parameter_description"><p>the fundamental type number.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-MAKE-FUNDAMENTAL.returns"></a><h4>Returns</h4> |
| <p> the GType</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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 cannot be |
| instantiated and is normally used as an abstract base class for |
| derived classes.</p> |
| <div class="refsect3"> |
| <a name="G-TYPE-IS-ABSTRACT.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-IS-ABSTRACT.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-IS-DERIVED.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-IS-DERIVED.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-IS-FUNDAMENTAL.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-IS-FUNDAMENTAL.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-IS-VALUE-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-IS-VALUE-TYPE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a>.</p> |
| <div class="refsect3"> |
| <a name="G-TYPE-HAS-VALUE-TABLE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-HAS-VALUE-TABLE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-IS-CLASSED.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-IS-CLASSED.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-IS-INSTANTIATABLE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-IS-INSTANTIATABLE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-IS-DERIVABLE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-IS-DERIVABLE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-IS-DEEP-DERIVABLE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-IS-DEEP-DERIVABLE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-IS-INTERFACE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-IS-INTERFACE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-FROM-INSTANCE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>instance</p></td> |
| <td class="parameter_description"><p>Location of a valid <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-FROM-INSTANCE.returns"></a><h4>Returns</h4> |
| <p> the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-FROM-CLASS.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p>Location of a valid <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-FROM-CLASS.returns"></a><h4>Returns</h4> |
| <p> the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-FROM-INTERFACE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_iface</p></td> |
| <td class="parameter_description"><p>Location of a valid <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface"><span class="type">GTypeInterface</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-FROM-INTERFACE.returns"></a><h4>Returns</h4> |
| <p> the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-INSTANCE-GET-CLASS.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance</p></td> |
| <td class="parameter_description"><p>Location of the <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the class to be returned</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>c_type</p></td> |
| <td class="parameter_description"><p>The C type of the class structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-INSTANCE-GET-CLASS.returns"></a><h4>Returns</h4> |
| <p> a pointer to the class structure</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-INSTANCE-GET-INTERFACE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance</p></td> |
| <td class="parameter_description"><p>Location of the <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the interface to be returned</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>c_type</p></td> |
| <td class="parameter_description"><p>The C type of the interface structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-INSTANCE-GET-INTERFACE.returns"></a><h4>Returns</h4> |
| <p> a pointer to the interface structure</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-INSTANCE-GET-PRIVATE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance</p></td> |
| <td class="parameter_description"><p>the instance of a type deriving from <em class="parameter"><code>private_type</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>the type identifying which private data to retrieve</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>c_type</p></td> |
| <td class="parameter_description"><p>The C type for the private structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-INSTANCE-GET-PRIVATE.returns"></a><h4>Returns</h4> |
| <p> a pointer to the private data structure. </p> |
| <p><span class="annotation">[<acronym title="NULL must not be passed as the value in, out, in-out; or as a return value."><span class="acronym">not nullable</span></acronym>]</span></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-TYPE-CLASS-GET-PRIVATE:CAPS"></a><h3>G_TYPE_CLASS_GET_PRIVATE()</h3> |
| <pre class="programlisting">#define G_TYPE_CLASS_GET_PRIVATE(klass, g_type, c_type) ((c_type*) g_type_class_get_private ((GTypeClass*) (klass), (g_type))) |
| </pre> |
| <p>Gets the private class structure for a particular type. |
| The private structure must have been registered in the |
| <code class="function">get_type()</code> function with <a class="link" href="gobject-Type-Information.html#g-type-add-class-private" title="g_type_add_class_private ()"><code class="function">g_type_add_class_private()</code></a>.</p> |
| <p>This macro should only be used in type implementations.</p> |
| <div class="refsect3"> |
| <a name="G-TYPE-CLASS-GET-PRIVATE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>klass</p></td> |
| <td class="parameter_description"><p>the class of a type deriving from <em class="parameter"><code>private_type</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>the type identifying which private data to retrieve</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>c_type</p></td> |
| <td class="parameter_description"><p>The C type for the private structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-CLASS-GET-PRIVATE.returns"></a><h4>Returns</h4> |
| <p> a pointer to the private data structure. </p> |
| <p><span class="annotation">[<acronym title="NULL must not be passed as the value in, out, in-out; or as a return value."><span class="acronym">not nullable</span></acronym>]</span></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-24.html#api-index-2.24">2.24</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure, |
| otherwise issues a warning and returns <a href="../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="refsect3"> |
| <a name="G-TYPE-CHECK-INSTANCE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>instance</p></td> |
| <td class="parameter_description"><p>Location of a <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-CHECK-INSTANCE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-CHECK-INSTANCE-CAST.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance</p></td> |
| <td class="parameter_description"><p>Location of a <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>The type to be returned</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>c_type</p></td> |
| <td class="parameter_description"><p>The corresponding C type of <em class="parameter"><code>g_type</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-CHECK-INSTANCE-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance</p></td> |
| <td class="parameter_description"><p>Location of a <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>The type to be checked</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-CHECK-INSTANCE-TYPE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-TYPE-CHECK-INSTANCE-FUNDAMENTAL-TYPE:CAPS"></a><h3>G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE()</h3> |
| <pre class="programlisting">#define G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE(instance, g_type) (_G_TYPE_CIFT ((instance), (g_type))) |
| </pre> |
| <p>Checks if <em class="parameter"><code>instance</code></em> |
| is an instance of the fundamental 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="refsect3"> |
| <a name="G-TYPE-CHECK-INSTANCE-FUNDAMENTAL-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance</p></td> |
| <td class="parameter_description"><p>Location of a <a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> structure.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>The fundamental type to be checked</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-CHECK-INSTANCE-FUNDAMENTAL-TYPE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-CHECK-CLASS-CAST.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p>Location of a <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>The type to be returned</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>c_type</p></td> |
| <td class="parameter_description"><p>The corresponding C type of class structure of <em class="parameter"><code>g_type</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-CHECK-CLASS-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p>Location of a <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>The type to be checked</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-CHECK-CLASS-TYPE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-CHECK-VALUE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>value</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-CHECK-VALUE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-TYPE-CHECK-VALUE-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>value</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>The type to be checked</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="G-TYPE-CHECK-VALUE-TYPE.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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> |
| <div class="warning"> |
| <p><code class="literal">g_type_init</code> has been deprecated since version 2.36 and should not be used in newly-written code.</p> |
| <p>the type system is now initialised automatically</p> |
| </div> |
| <p>This function used to initialise the type system. Since GLib 2.36, |
| the type system is initialised automatically and this function does |
| nothing.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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> |
| <div class="warning"> |
| <p><code class="literal">g_type_init_with_debug_flags</code> has been deprecated since version 2.36 and should not be used in newly-written code.</p> |
| <p>the type system is now initialised automatically</p> |
| </div> |
| <p>This function used to initialise the type system with debugging |
| flags. Since GLib 2.36, the type system is initialised automatically |
| and this function does nothing.</p> |
| <p>If you need to enable debugging features, use the GOBJECT_DEBUG |
| environment variable.</p> |
| <div class="refsect3"> |
| <a name="g-type-init-with-debug-flags.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>debug_flags</p></td> |
| <td class="parameter_description"><p>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</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-name"></a><h3>g_type_name ()</h3> |
| <pre class="programlisting">const <a href="../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="refsect3"> |
| <a name="g-type-name.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>type to return name for</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-name.returns"></a><h4>Returns</h4> |
| <p> static type name or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-qname"></a><h3>g_type_qname ()</h3> |
| <pre class="programlisting"><a href="../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="refsect3"> |
| <a name="g-type-qname.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>type to return quark of type name for</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-qname.returns"></a><h4>Returns</h4> |
| <p> the type names quark or 0</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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="refsect3"> |
| <a name="g-type-from-name.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>name</p></td> |
| <td class="parameter_description"><p>type name to lookup</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-from-name.returns"></a><h4>Returns</h4> |
| <p> corresponding type ID or 0</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="g-type-parent.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>the derived type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-parent.returns"></a><h4>Returns</h4> |
| <p> the parent type</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-depth"></a><h3>g_type_depth ()</h3> |
| <pre class="programlisting"><a href="../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="refsect3"> |
| <a name="g-type-depth.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-depth.returns"></a><h4>Returns</h4> |
| <p> the depth of <em class="parameter"><code>type</code></em> |
| </p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="g-type-next-base.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>leaf_type</p></td> |
| <td class="parameter_description"><p>descendant of <em class="parameter"><code>root_type</code></em> |
| and the type to be returned</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>root_type</p></td> |
| <td class="parameter_description"><p>immediate parent of the returned type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-next-base.returns"></a><h4>Returns</h4> |
| <p> immediate child of <em class="parameter"><code>root_type</code></em> |
| and anchestor of <em class="parameter"><code>leaf_type</code></em> |
| </p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-is-a"></a><h3>g_type_is_a ()</h3> |
| <pre class="programlisting"><a href="../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="refsect3"> |
| <a name="g-type-is-a.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>type to check anchestry for</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>is_a_type</p></td> |
| <td class="parameter_description"><p>possible anchestor of <em class="parameter"><code>type</code></em> |
| or interface that <em class="parameter"><code>type</code></em> |
| could conform to</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-is-a.returns"></a><h4>Returns</h4> |
| <p> <a href="../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> |
| </p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-class-ref"></a><h3>g_type_class_ref ()</h3> |
| <pre class="programlisting"><a href="../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="refsect3"> |
| <a name="g-type-class-ref.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>type ID of a classed type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-class-ref.returns"></a><h4>Returns</h4> |
| <p> the <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> |
| structure for the given type ID. </p> |
| <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-class-peek"></a><h3>g_type_class_peek ()</h3> |
| <pre class="programlisting"><a href="../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-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="refsect3"> |
| <a name="g-type-class-peek.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>type ID of a classed type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-class-peek.returns"></a><h4>Returns</h4> |
| <p> the <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> |
| structure for the given type ID or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the class does not |
| currently exist. </p> |
| <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-class-peek-static"></a><h3>g_type_class_peek_static ()</h3> |
| <pre class="programlisting"><a href="../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="refsect3"> |
| <a name="g-type-class-peek-static.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>type ID of a classed type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-class-peek-static.returns"></a><h4>Returns</h4> |
| <p> the <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> |
| structure for the given type ID or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the class does not |
| currently exist or is dynamically loaded. </p> |
| <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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="refsect3"> |
| <a name="g-type-class-unref.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to unref. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-class-peek-parent"></a><h3>g_type_class_peek_parent ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| g_type_class_peek_parent (<em class="parameter"><code><a href="../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.</p> |
| <p>This function is essentially equivalent to: |
| g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)))</p> |
| <div class="refsect3"> |
| <a name="g-type-class-peek-parent.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p> the <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to |
| retrieve the parent class for. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-class-peek-parent.returns"></a><h4>Returns</h4> |
| <p> the parent class |
| of <em class="parameter"><code>g_class</code></em> |
| . </p> |
| <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>, |
| <em class="parameter"><code><a href="../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.</p> |
| <p>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, and are zero-filled.</p> |
| <p>Note that the accumulated size of the private structures of |
| a type and all its parent types cannot exceed 64 KiB.</p> |
| <p>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.</p> |
| <p>The following example shows attaching a private structure |
| MyObjectPrivate to an object MyObject defined in the standard |
| GObject fashion in the type's <code class="function">class_init()</code> function.</p> |
| <p>Note the use of a structure member "priv" to avoid the overhead |
| of repeatedly calling <code class="function">MY_OBJECT_GET_PRIVATE()</code>.</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</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"> </span><span class="usertype">GObject</span><span class="normal"> parent</span><span class="symbol">;</span> |
| |
| <span class="normal"> </span><span class="usertype">MyObjectPrivate</span><span class="normal"> </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="usertype">MyObjectClass</span><span class="normal"> </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="usertype">MyObject</span><span class="normal"> </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="normal"> </span><span class="comment">// my_object->priv->some_field will be automatically initialised to 0</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="usertype">MyObject</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">my_object</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> </span><span class="usertype">MyObjectPrivate</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">priv</span><span class="symbol">;</span> |
| |
| <span class="normal"> </span><span class="function"><a href="../glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">MY_IS_OBJECT</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">my_object</span><span class="symbol">),</span><span class="normal"> </span><span class="number">0</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="refsect3"> |
| <a name="g-type-class-add-private.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p> class structure for an instantiatable |
| type. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>private_size</p></td> |
| <td class="parameter_description"><p>size of private structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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, and are zero-filled.</p> |
| <p>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 |
| <a class="link" href="gobject-Type-Information.html#G-TYPE-CLASS-GET-PRIVATE:CAPS" title="G_TYPE_CLASS_GET_PRIVATE()"><code class="function">G_TYPE_CLASS_GET_PRIVATE()</code></a> macro.</p> |
| <div class="refsect3"> |
| <a name="g-type-add-class-private.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>class_type</p></td> |
| <td class="parameter_description"><p>GType of an classed type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>private_size</p></td> |
| <td class="parameter_description"><p>size of private structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-24.html#api-index-2.24">2.24</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-interface-peek"></a><h3>g_type_interface_peek ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| g_type_interface_peek (<em class="parameter"><code><a href="../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="struct GTypeInterface"><span class="type">GTypeInterface</span></a> structure of an interface to which the |
| passed in class conforms.</p> |
| <div class="refsect3"> |
| <a name="g-type-interface-peek.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance_class</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>iface_type</p></td> |
| <td class="parameter_description"><p>an interface ID which this class conforms to</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-interface-peek.returns"></a><h4>Returns</h4> |
| <p> the <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface"><span class="type">GTypeInterface</span></a> |
| structure of <em class="parameter"><code>iface_type</code></em> |
| if implemented by <em class="parameter"><code>instance_class</code></em> |
| , <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> |
| otherwise. </p> |
| <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeInterface][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-interface-peek-parent"></a><h3>g_type_interface_peek_parent ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| g_type_interface_peek_parent (<em class="parameter"><code><a href="../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="struct 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="refsect3"> |
| <a name="g-type-interface-peek-parent.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_iface</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct GTypeInterface"><span class="type">GTypeInterface</span></a> structure. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeInterface]</span></td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-interface-peek-parent.returns"></a><h4>Returns</h4> |
| <p> the |
| corresponding <a class="link" href="gobject-Type-Information.html#GTypeInterface" title="struct 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-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the parent |
| type doesn't conform to the interface. </p> |
| <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeInterface]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-default-interface-ref"></a><h3>g_type_default_interface_ref ()</h3> |
| <pre class="programlisting"><a href="../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="parameter"><code>base_init</code></em> |
| and <em class="parameter"><code>class_init</code></em> |
| members of <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct 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="refsect3"> |
| <a name="g-type-default-interface-ref.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>an interface type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-default-interface-ref.returns"></a><h4>Returns</h4> |
| <p> 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. </p> |
| <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeInterface][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-default-interface-peek"></a><h3>g_type_default_interface_peek ()</h3> |
| <pre class="programlisting"><a href="../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="refsect3"> |
| <a name="g-type-default-interface-peek.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_type</p></td> |
| <td class="parameter_description"><p>an interface type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-default-interface-peek.returns"></a><h4>Returns</h4> |
| <p> the default |
| vtable for the interface, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the type is not currently |
| in use. </p> |
| <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeInterface][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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="parameter"><code>class_finalize</code></em> |
| member of <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>) will be called.</p> |
| <div class="refsect3"> |
| <a name="g-type-default-interface-unref.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_iface</p></td> |
| <td class="parameter_description"><p> 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>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeInterface]</span></td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-type-children.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>the parent type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>n_children</p></td> |
| <td class="parameter_description"><p> location to store the length of |
| the returned array, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-children.returns"></a><h4>Returns</h4> |
| <p> Newly allocated |
| and 0-terminated array of child types, free with <a href="../glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>. </p> |
| <p><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_children][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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.</p> |
| <div class="refsect3"> |
| <a name="g-type-interfaces.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>the type to list interface types for</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>n_interfaces</p></td> |
| <td class="parameter_description"><p> location to store the length of |
| the returned array, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-interfaces.returns"></a><h4>Returns</h4> |
| <p> Newly allocated |
| and 0-terminated array of interface types, free with <a href="../glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>. </p> |
| <p><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_interfaces][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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="refsect3"> |
| <a name="g-type-interface-prerequisites.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>interface_type</p></td> |
| <td class="parameter_description"><p>an interface type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>n_prerequisites</p></td> |
| <td class="parameter_description"><p> location to return the number |
| of prerequisites, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-interface-prerequisites.returns"></a><h4>Returns</h4> |
| <p> 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> |
| . </p> |
| <p><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_prerequisites][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Quarks.html#GQuark"><span class="type">GQuark</span></a> quark</code></em>, |
| <em class="parameter"><code><a href="../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="refsect3"> |
| <a name="g-type-set-qdata.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>quark</p></td> |
| <td class="parameter_description"><p>a <a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identify the data</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>data</p></td> |
| <td class="parameter_description"><p>the data</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-get-qdata"></a><h3>g_type_get_qdata ()</h3> |
| <pre class="programlisting"><a href="../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-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> |
| <p>Note that this does not take subtyping into account; data |
| attached to one type 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> cannot |
| be retrieved from a subtype using <a class="link" href="gobject-Type-Information.html#g-type-get-qdata" title="g_type_get_qdata ()"><code class="function">g_type_get_qdata()</code></a>.</p> |
| <div class="refsect3"> |
| <a name="g-type-get-qdata.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>quark</p></td> |
| <td class="parameter_description"><p>a <a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identify the data</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-get-qdata.returns"></a><h4>Returns</h4> |
| <p> the data, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no data was found. </p> |
| <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="struct 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="struct GTypeQuery"><span class="type">GTypeQuery</span></a> is 0. All members filled into the |
| <a class="link" href="gobject-Type-Information.html#GTypeQuery" title="struct GTypeQuery"><span class="type">GTypeQuery</span></a> structure should be considered constant and have to be |
| left untouched.</p> |
| <div class="refsect3"> |
| <a name="g-type-query.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of a static, classed type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>query</p></td> |
| <td class="parameter_description"><p> a user provided structure that is |
| filled in with constant values upon success. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GBaseInitFunc"></a><h3>GBaseInitFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| <span class="c_punctuation">(</span>*GBaseInitFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../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 |
| initialization process.</p> |
| <div class="refsect3"> |
| <a name="GBaseInitFunc.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p> The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to initialize. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GBaseFinalizeFunc"></a><h3>GBaseFinalizeFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| <span class="c_punctuation">(</span>*GBaseFinalizeFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../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 initialization 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 initialization process.</p> |
| <div class="refsect3"> |
| <a name="GBaseFinalizeFunc.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p> The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to finalize. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GClassInitFunc"></a><h3>GClassInitFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| <span class="c_punctuation">(</span>*GClassInitFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>, |
| <em class="parameter"><code><a href="../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.</p> |
| <p>The initialization process of a class involves:</p> |
| <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
| <li class="listitem"><p>Copying common members from the parent class over to the |
| derived class structure.</p></li> |
| <li class="listitem"><p>Zero initialization of the remaining members not copied |
| over from the parent class.</p></li> |
| <li class="listitem"><p>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>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.</p> |
| <p>An example may help to correspond the intend of the different class |
| initializers:</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"> </span><span class="usertype">GObjectClass</span><span class="normal"> parent_class</span><span class="symbol">;</span> |
| <span class="normal"> </span><span class="usertype">gint</span><span class="normal"> static_integer</span><span class="symbol">;</span> |
| <span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </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="usertype">TypeAClass</span><span class="normal"> </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-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="usertype">TypeAClass</span><span class="normal"> </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-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="usertype">TypeAClass</span><span class="normal"> </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"> </span><span class="usertype">TypeAClass</span><span class="normal"> parent_class</span><span class="symbol">;</span> |
| <span class="normal"> </span><span class="usertype">gfloat</span><span class="normal"> static_float</span><span class="symbol">;</span> |
| <span class="normal"> </span><span class="usertype">GString</span><span class="normal"> </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="usertype">TypeBClass</span><span class="normal"> </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-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="usertype">TypeBClass</span><span class="normal"> </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-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="usertype">TypeBClass</span><span class="normal"> </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).</p> |
| <p>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.</p> |
| <p>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).</p> |
| <p>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="refsect3"> |
| <a name="GClassInitFunc.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p> The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to initialize. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>class_data</p></td> |
| <td class="parameter_description"><p>The <em class="parameter"><code>class_data</code></em> |
| member supplied via the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GClassFinalizeFunc"></a><h3>GClassFinalizeFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| <span class="c_punctuation">(</span>*GClassFinalizeFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_class</code></em>, |
| <em class="parameter"><code><a href="../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="struct 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="refsect3"> |
| <a name="GClassFinalizeFunc.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p> The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to finalize. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>class_data</p></td> |
| <td class="parameter_description"><p>The <em class="parameter"><code>class_data</code></em> |
| member supplied via the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GInstanceInitFunc"></a><h3>GInstanceInitFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| <span class="c_punctuation">(</span>*GInstanceInitFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="gobject-Type-Information.html#GTypeInstance" title="struct GTypeInstance"><span class="type">GTypeInstance</span></a> *instance</code></em>, |
| <em class="parameter"><code><a href="../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.</p> |
| <p>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> |
| <p>The extended members of <em class="parameter"><code>instance</code></em> |
| are guaranteed to have been filled with |
| zeros before this function is called.</p> |
| <div class="refsect3"> |
| <a name="GInstanceInitFunc.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance</p></td> |
| <td class="parameter_description"><p>The instance to initialize</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p> The class of the type the instance is |
| created for. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GInterfaceInitFunc"></a><h3>GInterfaceInitFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| <span class="c_punctuation">(</span>*GInterfaceInitFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>, |
| <em class="parameter"><code><a href="../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> |
| <p>The members of <em class="parameter"><code>iface_data</code></em> |
| are guaranteed to have been filled with |
| zeros before this function is called.</p> |
| <div class="refsect3"> |
| <a name="GInterfaceInitFunc.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>g_iface</p></td> |
| <td class="parameter_description"><p> The interface structure to initialize. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeInterface]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>iface_data</p></td> |
| <td class="parameter_description"><p>The <em class="parameter"><code>interface_data</code></em> |
| supplied via the <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GInterfaceFinalizeFunc"></a><h3>GInterfaceFinalizeFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| <span class="c_punctuation">(</span>*GInterfaceFinalizeFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> g_iface</code></em>, |
| <em class="parameter"><code><a href="../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="refsect3"> |
| <a name="GInterfaceFinalizeFunc.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>g_iface</p></td> |
| <td class="parameter_description"><p> The interface structure to finalize. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeInterface]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>iface_data</p></td> |
| <td class="parameter_description"><p>The <em class="parameter"><code>interface_data</code></em> |
| supplied via the <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GTypeClassCacheFunc"></a><h3>GTypeClassCacheFunc ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| <span class="c_punctuation">(</span>*GTypeClassCacheFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../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="struct 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="refsect3"> |
| <a name="GTypeClassCacheFunc.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>cache_data</p></td> |
| <td class="parameter_description"><p>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</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p> The <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure which is |
| unreferenced. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="GTypeClassCacheFunc.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop further <a href="gobject-Type-Information.html#GTypeClassCacheFunc"><span class="type">GTypeClassCacheFuncs</span></a> from being |
| called, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to continue</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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="struct 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="struct 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="refsect3"> |
| <a name="g-type-register-static.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>parent_type</p></td> |
| <td class="parameter_description"><p>type from which this type will be derived</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>type_name</p></td> |
| <td class="parameter_description"><p>0-terminated string used as the name of the new type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>info</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure for this type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>flags</p></td> |
| <td class="parameter_description"><p>bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-register-static.returns"></a><h4>Returns</h4> |
| <p> the new type identifier</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type_name</code></em>, |
| <em class="parameter"><code><a href="../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-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="struct 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> |
| <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> |
| <div class="refsect3"> |
| <a name="g-type-register-static-simple.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>parent_type</p></td> |
| <td class="parameter_description"><p>type from which this type will be derived</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>type_name</p></td> |
| <td class="parameter_description"><p>0-terminated string used as the name of the new type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>class_size</p></td> |
| <td class="parameter_description"><p>size of the class structure (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>)</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>class_init</p></td> |
| <td class="parameter_description"><p>location of the class initialization function (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>)</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>instance_size</p></td> |
| <td class="parameter_description"><p>size of the instance structure (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>)</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>instance_init</p></td> |
| <td class="parameter_description"><p>location of the instance initialization function (see <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a>)</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>flags</p></td> |
| <td class="parameter_description"><p>bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-register-static-simple.returns"></a><h4>Returns</h4> |
| <p> the new type identifier</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-12.html#api-index-2.12">2.12</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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="refsect3"> |
| <a name="g-type-register-dynamic.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>parent_type</p></td> |
| <td class="parameter_description"><p>type from which this type will be derived</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>type_name</p></td> |
| <td class="parameter_description"><p>0-terminated string used as the name of the new type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>plugin</p></td> |
| <td class="parameter_description"><p><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="struct GTypeInfo"><span class="type">GTypeInfo</span></a> from</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>flags</p></td> |
| <td class="parameter_description"><p>bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-register-dynamic.returns"></a><h4>Returns</h4> |
| <p> 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</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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="struct 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="struct 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. If <em class="parameter"><code>type_id</code></em> |
| is already registered, or a |
| type named <em class="parameter"><code>type_name</code></em> |
| is already registered, the behaviour is undefined. |
| The type system uses the information contained in the <a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct 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="struct 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="refsect3"> |
| <a name="g-type-register-fundamental.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>type_id</p></td> |
| <td class="parameter_description"><p>a predefined type identifier</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>type_name</p></td> |
| <td class="parameter_description"><p>0-terminated string used as the name of the new type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>info</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GTypeInfo" title="struct GTypeInfo"><span class="type">GTypeInfo</span></a> structure for this type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>finfo</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GTypeFundamentalInfo" title="struct GTypeFundamentalInfo"><span class="type">GTypeFundamentalInfo</span></a> structure for this type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>flags</p></td> |
| <td class="parameter_description"><p>bitwise combination of <a class="link" href="gobject-Type-Information.html#GTypeFlags" title="enum GTypeFlags"><span class="type">GTypeFlags</span></a> values</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-register-fundamental.returns"></a><h4>Returns</h4> |
| <p> the predefined type identifier</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="struct 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 <a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> structure |
| pointed to by <em class="parameter"><code>info</code></em> |
| is used to manage the relationship.</p> |
| <div class="refsect3"> |
| <a name="g-type-add-interface-static.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance_type</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an instantiable type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>interface_type</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>info</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GInterfaceInfo" title="struct 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</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="g-type-add-interface-dynamic.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance_type</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an instantiable type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>interface_type</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>plugin</p></td> |
| <td class="parameter_description"><p><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="struct GInterfaceInfo"><span class="type">GInterfaceInfo</span></a> from</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="g-type-interface-add-prerequisite.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>interface_type</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>prerequisite_type</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of an interface or instantiatable type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-type-get-plugin.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> to retrieve the plugin for</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-get-plugin.returns"></a><h4>Returns</h4> |
| <p> the corresponding plugin |
| if <em class="parameter"><code>type</code></em> |
| is a dynamic type, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> otherwise. </p> |
| <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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="refsect3"> |
| <a name="g-type-interface-get-plugin.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>instance_type</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of an instantiatable type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>interface_type</p></td> |
| <td class="parameter_description"><p><a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of an interface type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-interface-get-plugin.returns"></a><h4>Returns</h4> |
| <p> 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> |
| . </p> |
| <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="g-type-fundamental-next.returns"></a><h4>Returns</h4> |
| <p> the next available fundamental type ID to be registered, |
| or 0 if the type system ran out of fundamental type IDs</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="g-type-fundamental.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type_id</p></td> |
| <td class="parameter_description"><p>valid type ID</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-fundamental.returns"></a><h4>Returns</h4> |
| <p> fundamental type ID</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="struct 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 never |
| 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.</p> |
| <p>The extended members of the returned instance are guaranteed to be filled |
| with zeros.</p> |
| <p>Note: Do not use this function, unless you're implementing a |
| fundamental type. Also language bindings should not 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> |
| <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> |
| <div class="refsect3"> |
| <a name="g-type-create-instance.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>an instantiatable type to create an instance for</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-create-instance.returns"></a><h4>Returns</h4> |
| <p> an allocated and initialized instance, subject to further |
| treatment by the fundamental type implementation</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="struct 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="refsect3"> |
| <a name="g-type-free-instance.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>instance</p></td> |
| <td class="parameter_description"><p>an instance of a type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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-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> |
| <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> |
| <div class="refsect3"> |
| <a name="g-type-add-class-cache-func.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>cache_data</p></td> |
| <td class="parameter_description"><p>data to be passed to <em class="parameter"><code>cache_func</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>cache_func</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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> |
| <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> |
| <div class="refsect3"> |
| <a name="g-type-remove-class-cache-func.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>cache_data</p></td> |
| <td class="parameter_description"><p>data that was given when adding <em class="parameter"><code>cache_func</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>cache_func</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="gobject-Type-Information.html#GTypeClassCacheFunc" title="GTypeClassCacheFunc ()"><span class="type">GTypeClassCacheFunc</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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 href="gobject-Type-Information.html#GTypeClassCacheFunc"><span class="type">GTypeClassCacheFuncs</span></a>, avoiding the recursion which would occur |
| otherwise.</p> |
| <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> |
| <div class="refsect3"> |
| <a name="g-type-class-unref-uncached.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>g_class</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="gobject-Type-Information.html#GTypeClass" title="struct GTypeClass"><span class="type">GTypeClass</span></a> structure to unref. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeClass]</span></td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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="struct 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> |
| <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> |
| <div class="refsect3"> |
| <a name="g-type-add-interface-check.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>check_data</p></td> |
| <td class="parameter_description"><p>data to pass to <em class="parameter"><code>check_func</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>check_func</p></td> |
| <td class="parameter_description"><p>function to be called after each interface |
| is initialized</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-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> |
| <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> |
| <div class="refsect3"> |
| <a name="g-type-remove-interface-check.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>check_data</p></td> |
| <td class="parameter_description"><p>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></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>check_func</p></td> |
| <td class="parameter_description"><p>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></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GTypeInterfaceCheckFunc"></a><h3>GTypeInterfaceCheckFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| <span class="c_punctuation">(</span>*GTypeInterfaceCheckFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> check_data</code></em>, |
| <em class="parameter"><code><a href="../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="refsect3"> |
| <a name="GTypeInterfaceCheckFunc.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>check_data</p></td> |
| <td class="parameter_description"><p>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></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>g_iface</p></td> |
| <td class="parameter_description"><p> the interface that has been |
| initialized. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.TypeInterface]</span></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="struct 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="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with <em class="parameter"><code>type</code></em> |
| .</p> |
| <p>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> |
| .</p> |
| <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> |
| <div class="refsect3"> |
| <a name="g-type-value-table-peek.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-value-table-peek.returns"></a><h4>Returns</h4> |
| <p> location of the <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with <em class="parameter"><code>type</code></em> |
| or |
| <a href="../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="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with <em class="parameter"><code>type</code></em> |
| </p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-ensure"></a><h3>g_type_ensure ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_type_ensure (<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>Ensures that the indicated <em class="parameter"><code>type</code></em> |
| has been registered with the |
| type system, and its <code class="function">_class_init()</code> method has been run.</p> |
| <p>In theory, simply calling the type's <code class="function">_get_type()</code> method (or using |
| the corresponding macro) is supposed take care of this. However, |
| <code class="function">_get_type()</code> methods are often marked <a href="../glib-Miscellaneous-Macros.html#G-GNUC-CONST:CAPS"><code class="literal">G_GNUC_CONST</code></a> for performance |
| reasons, even though this is technically incorrect (since |
| <a href="../glib-Miscellaneous-Macros.html#G-GNUC-CONST:CAPS"><code class="literal">G_GNUC_CONST</code></a> requires that the function not have side effects, |
| which <code class="function">_get_type()</code> methods do on the first call). As a result, if |
| you write a bare call to a <code class="function">_get_type()</code> macro, it may get optimized |
| out by the compiler. Using <a class="link" href="gobject-Type-Information.html#g-type-ensure" title="g_type_ensure ()"><code class="function">g_type_ensure()</code></a> guarantees that the |
| type's <code class="function">_get_type()</code> method is called.</p> |
| <div class="refsect3"> |
| <a name="g-type-ensure.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-34.html#api-index-2.34">2.34</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-get-type-registration-serial"></a><h3>g_type_get_type_registration_serial ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> |
| g_type_get_type_registration_serial (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> |
| <p>Returns an opaque serial number that represents the state of the set |
| of registered types. Any time a type is registered this serial changes, |
| which means you can cache information based on type lookups (such as |
| <a class="link" href="gobject-Type-Information.html#g-type-from-name" title="g_type_from_name ()"><code class="function">g_type_from_name()</code></a>) and know if the cache is still valid at a later |
| time by comparing the current serial with the one at the type lookup.</p> |
| <div class="refsect3"> |
| <a name="g-type-get-type-registration-serial.returns"></a><h4>Returns</h4> |
| <p> An unsigned int, representing the state of type registrations</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-36.html#api-index-2.36">2.36</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-type-get-instance-count"></a><h3>g_type_get_instance_count ()</h3> |
| <pre class="programlisting"><span class="returnvalue">int</span> |
| g_type_get_instance_count (<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 number of instances allocated of the particular type; |
| this is only available if GLib is built with debugging support and |
| the instance_count debug flag is set (by setting the GOBJECT_DEBUG |
| variable to include instance-count).</p> |
| <div class="refsect3"> |
| <a name="g-type-get-instance-count.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-type-get-instance-count.returns"></a><h4>Returns</h4> |
| <p> the number of instances allocated of the given type; |
| if instance counts are not available, returns 0.</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-44.html#api-index-2.44">2.44</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-DECLARE-FINAL-TYPE:CAPS"></a><h3>G_DECLARE_FINAL_TYPE()</h3> |
| <pre class="programlisting">#define G_DECLARE_FINAL_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName)</pre> |
| <p>A convenience macro for emitting the usual declarations in the header file for a type which is not (at the |
| present time) intended to be subclassed.</p> |
| <p>You might use it in a header as follows:</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</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="preproc">#ifndef</span><span class="normal"> _myapp_window_h_</span> |
| <span class="preproc">#define</span><span class="normal"> _myapp_window_h_</span> |
| |
| <span class="preproc">#include</span><span class="normal"> </span><span class="string"><gtk/gtk.h></span> |
| |
| <span class="preproc">#define</span><span class="normal"> </span><span class="usertype">MY_APP_TYPE_WINDOW</span><span class="normal"> </span><span class="function">my_app_window_get_type</span><span class="normal"> </span><span class="symbol">()</span> |
| <span class="function"><a href="gobject-Type-Information.html#G-DECLARE-FINAL-TYPE:CAPS">G_DECLARE_FINAL_TYPE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">MyAppWindow</span><span class="symbol">,</span><span class="normal"> my_app_window</span><span class="symbol">,</span><span class="normal"> MY_APP</span><span class="symbol">,</span><span class="normal"> WINDOW</span><span class="symbol">,</span><span class="normal"> <a href="http://developer.gnome.org/gtk3/GtkWindow.html#GtkWindow-struct">GtkWindow</a></span><span class="symbol">)</span> |
| |
| <span class="normal">MyAppWindow </span><span class="symbol">*</span><span class="normal"> </span><span class="function">my_app_window_new</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">);</span> |
| |
| <span class="symbol">...</span> |
| |
| <span class="preproc">#endif</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p></p> |
| <p>This results in the following things happening:</p> |
| <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
| <li class="listitem"><p>the usual <code class="function">my_app_window_get_type()</code> function is declared with a return type of <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p></li> |
| <li class="listitem"><p>the MyAppWindow types is defined as a typedef of struct _MyAppWindow. The struct itself is not |
| defined and should be defined from the .c file before <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()"><code class="function">G_DEFINE_TYPE()</code></a> is used.</p></li> |
| <li class="listitem"><p>the <code class="function">MY_APP_WINDOW()</code> cast is emitted as static inline function along with the <code class="function">MY_APP_IS_WINDOW()</code> type |
| checking function</p></li> |
| <li class="listitem"><p>the MyAppWindowClass type is defined as a struct containing GtkWindowClass. This is done for the |
| convenience of the person defining the type and should not be considered to be part of the ABI. In |
| particular, without a firm declaration of the instance structure, it is not possible to subclass the type |
| and therefore the fact that the size of the class structure is exposed is not a concern and it can be |
| freely changed at any point in the future.</p></li> |
| <li class="listitem"><p>g_autoptr() support being added for your type, based on the type of your parent class</p></li> |
| </ul></div> |
| <p>You can only use this function if your parent type also supports <a href="../glib-Miscellaneous-Macros.html#g-autoptr"><code class="function">g_autoptr()</code></a>.</p> |
| <p>Because the type macro (MY_APP_TYPE_WINDOW in the above example) is not a callable, you must continue to |
| manually define this as a macro for yourself.</p> |
| <p>The declaration of the <code class="function">_get_type()</code> function is the first thing emitted by the macro. This allows this macro |
| to be used in the usual way with export control and API versioning macros.</p> |
| <p>If you want to declare your own class structure, use <a class="link" href="gobject-Type-Information.html#G-DECLARE-DERIVABLE-TYPE:CAPS" title="G_DECLARE_DERIVABLE_TYPE()"><code class="function">G_DECLARE_DERIVABLE_TYPE()</code></a>.</p> |
| <p>If you are writing a library, it is important to note that it is possible to convert a type from using |
| <a class="link" href="gobject-Type-Information.html#G-DECLARE-FINAL-TYPE:CAPS" title="G_DECLARE_FINAL_TYPE()"><code class="function">G_DECLARE_FINAL_TYPE()</code></a> to <a class="link" href="gobject-Type-Information.html#G-DECLARE-DERIVABLE-TYPE:CAPS" title="G_DECLARE_DERIVABLE_TYPE()"><code class="function">G_DECLARE_DERIVABLE_TYPE()</code></a> without breaking API or ABI. As a precaution, you |
| should therefore use <a class="link" href="gobject-Type-Information.html#G-DECLARE-FINAL-TYPE:CAPS" title="G_DECLARE_FINAL_TYPE()"><code class="function">G_DECLARE_FINAL_TYPE()</code></a> until you are sure that it makes sense for your class to be |
| subclassed. Once a class structure has been exposed it is not possible to change its size or remove or |
| reorder items without breaking the API and/or ABI.</p> |
| <div class="refsect3"> |
| <a name="G-DECLARE-FINAL-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>ModuleObjName</p></td> |
| <td class="parameter_description"><p>The name of the new type, in camel case (like GtkWidget)</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>module_obj_name</p></td> |
| <td class="parameter_description"><p>The name of the new type in lowercase, with words |
| separated by '_' (like 'gtk_widget')</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>MODULE</p></td> |
| <td class="parameter_description"><p>The name of the module, in all caps (like 'GTK')</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>OBJ_NAME</p></td> |
| <td class="parameter_description"><p>The bare name of the type, in all caps (like 'WIDGET')</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>ParentName</p></td> |
| <td class="parameter_description"><p>the name of the parent type, in camel case (like GtkWidget)</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-44.html#api-index-2.44">2.44</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-DECLARE-DERIVABLE-TYPE:CAPS"></a><h3>G_DECLARE_DERIVABLE_TYPE()</h3> |
| <pre class="programlisting">#define G_DECLARE_DERIVABLE_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName)</pre> |
| <p>A convenience macro for emitting the usual declarations in the header file for a type which will is intended |
| to be subclassed.</p> |
| <p>You might use it in a header as follows:</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</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="preproc">#ifndef</span><span class="normal"> _gtk_frobber_h_</span> |
| <span class="preproc">#define</span><span class="normal"> _gtk_frobber_h_</span> |
| |
| <span class="preproc">#define</span><span class="normal"> </span><span class="usertype">GTK_TYPE_FROBBER</span><span class="normal"> </span><span class="function">gtk_frobber_get_type</span><span class="normal"> </span><span class="symbol">()</span> |
| <span class="normal">GDK_AVAILABLE_IN_3_12</span> |
| <span class="function"><a href="gobject-Type-Information.html#G-DECLARE-DERIVABLE-TYPE:CAPS">G_DECLARE_DERIVABLE_TYPE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkFrobber</span><span class="symbol">,</span><span class="normal"> gtk_frobber</span><span class="symbol">,</span><span class="normal"> GTK</span><span class="symbol">,</span><span class="normal"> FROBBER</span><span class="symbol">,</span><span class="normal"> <a href="http://developer.gnome.org/gtk3/GtkWidget.html#GtkWidget-struct">GtkWidget</a></span><span class="symbol">)</span> |
| |
| <span class="keyword">struct</span><span class="normal"> </span><span class="classname">_GtkFrobberClass</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> </span><span class="usertype">GtkWidgetClass</span><span class="normal"> parent_class</span><span class="symbol">;</span> |
| |
| <span class="normal"> </span><span class="type">void</span><span class="normal"> </span><span class="symbol">(*</span><span class="normal"> handle_frob</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkFrobber</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">frobber</span><span class="symbol">,</span> |
| <span class="normal"> </span><span class="usertype">guint</span><span class="normal"> n_frobs</span><span class="symbol">);</span> |
| |
| <span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> padding</span><span class="symbol">[</span><span class="number">12</span><span class="symbol">];</span> |
| <span class="cbracket">}</span><span class="symbol">;</span> |
| |
| <span class="normal"><a href="http://developer.gnome.org/gtk3/GtkWidget.html#GtkWidget-struct">GtkWidget</a> </span><span class="symbol">*</span><span class="normal"> </span><span class="function">gtk_frobber_new</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">);</span> |
| |
| <span class="symbol">...</span> |
| |
| <span class="preproc">#endif</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p></p> |
| <p>This results in the following things happening:</p> |
| <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
| <li class="listitem"><p>the usual <code class="function">gtk_frobber_get_type()</code> function is declared with a return type of <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p></li> |
| <li class="listitem"><p>the GtkFrobber struct is created with GtkWidget as the first and only item. You are expected to use |
| a private structure from your .c file to store your instance variables.</p></li> |
| <li class="listitem"><p>the GtkFrobberClass type is defined as a typedef to struct _GtkFrobberClass, which is left undefined. |
| You should do this from the header file directly after you use the macro.</p></li> |
| <li class="listitem"><p>the <code class="function">GTK_FROBBER()</code> and <code class="function">GTK_FROBBER_CLASS()</code> casts are emitted as static inline functions along with |
| the <code class="function">GTK_IS_FROBBER()</code> and <code class="function">GTK_IS_FROBBER_CLASS()</code> type checking functions and <code class="function">GTK_FROBBER_GET_CLASS()</code> |
| function.</p></li> |
| <li class="listitem"><p>g_autoptr() support being added for your type, based on the type of your parent class</p></li> |
| </ul></div> |
| <p>You can only use this function if your parent type also supports <a href="../glib-Miscellaneous-Macros.html#g-autoptr"><code class="function">g_autoptr()</code></a>.</p> |
| <p>Because the type macro (GTK_TYPE_FROBBER in the above example) is not a callable, you must continue to |
| manually define this as a macro for yourself.</p> |
| <p>The declaration of the <code class="function">_get_type()</code> function is the first thing emitted by the macro. This allows this macro |
| to be used in the usual way with export control and API versioning macros.</p> |
| <p>If you are writing a library, it is important to note that it is possible to convert a type from using |
| <a class="link" href="gobject-Type-Information.html#G-DECLARE-FINAL-TYPE:CAPS" title="G_DECLARE_FINAL_TYPE()"><code class="function">G_DECLARE_FINAL_TYPE()</code></a> to <a class="link" href="gobject-Type-Information.html#G-DECLARE-DERIVABLE-TYPE:CAPS" title="G_DECLARE_DERIVABLE_TYPE()"><code class="function">G_DECLARE_DERIVABLE_TYPE()</code></a> without breaking API or ABI. As a precaution, you |
| should therefore use <a class="link" href="gobject-Type-Information.html#G-DECLARE-FINAL-TYPE:CAPS" title="G_DECLARE_FINAL_TYPE()"><code class="function">G_DECLARE_FINAL_TYPE()</code></a> until you are sure that it makes sense for your class to be |
| subclassed. Once a class structure has been exposed it is not possible to change its size or remove or |
| reorder items without breaking the API and/or ABI. If you want to declare your own class structure, use |
| <a class="link" href="gobject-Type-Information.html#G-DECLARE-DERIVABLE-TYPE:CAPS" title="G_DECLARE_DERIVABLE_TYPE()"><code class="function">G_DECLARE_DERIVABLE_TYPE()</code></a>. If you want to declare a class without exposing the class or instance |
| structures, use <a class="link" href="gobject-Type-Information.html#G-DECLARE-FINAL-TYPE:CAPS" title="G_DECLARE_FINAL_TYPE()"><code class="function">G_DECLARE_FINAL_TYPE()</code></a>.</p> |
| <p>If you must use <a class="link" href="gobject-Type-Information.html#G-DECLARE-DERIVABLE-TYPE:CAPS" title="G_DECLARE_DERIVABLE_TYPE()"><code class="function">G_DECLARE_DERIVABLE_TYPE()</code></a> you should be sure to include some padding at the bottom of your |
| class structure to leave space for the addition of future virtual functions.</p> |
| <div class="refsect3"> |
| <a name="G-DECLARE-DERIVABLE-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>ModuleObjName</p></td> |
| <td class="parameter_description"><p>The name of the new type, in camel case (like GtkWidget)</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>module_obj_name</p></td> |
| <td class="parameter_description"><p>The name of the new type in lowercase, with words |
| separated by '_' (like 'gtk_widget')</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>MODULE</p></td> |
| <td class="parameter_description"><p>The name of the module, in all caps (like 'GTK')</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>OBJ_NAME</p></td> |
| <td class="parameter_description"><p>The bare name of the type, in all caps (like 'WIDGET')</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>ParentName</p></td> |
| <td class="parameter_description"><p>the name of the parent type, in camel case (like GtkWidget)</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-44.html#api-index-2.44">2.44</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-DECLARE-INTERFACE:CAPS"></a><h3>G_DECLARE_INTERFACE()</h3> |
| <pre class="programlisting">#define G_DECLARE_INTERFACE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, PrerequisiteName)</pre> |
| <p>A convenience macro for emitting the usual declarations in the header file for a GInterface type.</p> |
| <p>You might use it in a header as follows:</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</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="preproc">#ifndef</span><span class="normal"> _my_model_h_</span> |
| <span class="preproc">#define</span><span class="normal"> _my_model_h_</span> |
| |
| <span class="preproc">#define</span><span class="normal"> </span><span class="usertype">MY_TYPE_MODEL</span><span class="normal"> </span><span class="function">my_model_get_type</span><span class="normal"> </span><span class="symbol">()</span> |
| <span class="normal">GDK_AVAILABLE_IN_3_12</span> |
| <span class="function"><a href="gobject-Type-Information.html#G-DECLARE-INTERFACE:CAPS">G_DECLARE_INTERFACE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">MyModel</span><span class="symbol">,</span><span class="normal"> my_model</span><span class="symbol">,</span><span class="normal"> MY</span><span class="symbol">,</span><span class="normal"> MODEL</span><span class="symbol">,</span><span class="normal"> <a href="gobject-The-Base-Object-Type.html#GObject-struct">GObject</a></span><span class="symbol">)</span> |
| |
| <span class="keyword">struct</span><span class="normal"> </span><span class="classname">_MyModelInterface</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> </span><span class="usertype">GTypeInterface</span><span class="normal"> g_iface</span><span class="symbol">;</span> |
| |
| <span class="normal"> </span><span class="function"><a href="../glib-Basic-Types.html#gpointer">gpointer</a></span><span class="normal"> </span><span class="symbol">(*</span><span class="normal"> get_item</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">MyModel</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">model</span><span class="symbol">);</span> |
| <span class="cbracket">}</span><span class="symbol">;</span> |
| |
| <span class="usertype">gpointer</span><span class="normal"> </span><span class="function">my_model_get_item</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">MyModel</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">model</span><span class="symbol">);</span> |
| |
| <span class="symbol">...</span> |
| |
| <span class="preproc">#endif</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p></p> |
| <p>This results in the following things happening:</p> |
| <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
| <li class="listitem"><p>the usual <code class="function">my_model_get_type()</code> function is declared with a return type of <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a></p></li> |
| <li class="listitem"><p>the MyModelInterface type is defined as a typedef to struct _MyModelInterface, |
| which is left undefined. You should do this from the header file directly after |
| you use the macro.</p></li> |
| <li class="listitem"><p>the <code class="function">MY_MODEL()</code> cast is emitted as static inline functions along with |
| the <code class="function">MY_IS_MODEL()</code> type checking function and <code class="function">MY_MODEL_GET_IFACE()</code> function.</p></li> |
| <li class="listitem"><p>g_autoptr() support being added for your type, based on your prerequisite type.</p></li> |
| </ul></div> |
| <p>You can only use this function if your prerequisite type also supports <a href="../glib-Miscellaneous-Macros.html#g-autoptr"><code class="function">g_autoptr()</code></a>.</p> |
| <p>Because the type macro (MY_TYPE_MODEL in the above example) is not a callable, you must continue to |
| manually define this as a macro for yourself.</p> |
| <p>The declaration of the <code class="function">_get_type()</code> function is the first thing emitted by the macro. This allows this macro |
| to be used in the usual way with export control and API versioning macros.</p> |
| <div class="refsect3"> |
| <a name="G-DECLARE-INTERFACE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>ModuleObjName</p></td> |
| <td class="parameter_description"><p>The name of the new type, in camel case (like GtkWidget)</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>module_obj_name</p></td> |
| <td class="parameter_description"><p>The name of the new type in lowercase, with words |
| separated by '_' (like 'gtk_widget')</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>MODULE</p></td> |
| <td class="parameter_description"><p>The name of the module, in all caps (like 'GTK')</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>OBJ_NAME</p></td> |
| <td class="parameter_description"><p>The bare name of the type, in all caps (like 'WIDGET')</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>PrerequisiteName</p></td> |
| <td class="parameter_description"><p>the name of the prerequisite type, in camel case (like GtkWidget)</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-44.html#api-index-2.44">2.44</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="struct GTypeInfo"><span class="type">GTypeInfo</span></a> |
| for information about these) and a static variable named <code class="literal">t_n_parent_class</code> |
| 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="refsect3"> |
| <a name="G-DEFINE-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TN</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>t_n</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words |
| separated by '_'.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>T_P</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-DEFINE-TYPE-WITH-PRIVATE:CAPS"></a><h3>G_DEFINE_TYPE_WITH_PRIVATE()</h3> |
| <pre class="programlisting">#define G_DEFINE_TYPE_WITH_PRIVATE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, G_ADD_PRIVATE (TN)) |
| </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="struct GTypeInfo"><span class="type">GTypeInfo</span></a> |
| for information about these), a static variable named <code class="literal">t_n_parent_class</code> |
| pointing to the parent class, and adds private instance data to the type. |
| 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> |
| <p>Note that private structs added with this macros must have a struct |
| name of the form <em class="parameter"><code>TN</code></em> |
| Private.</p> |
| <div class="refsect3"> |
| <a name="G-DEFINE-TYPE-WITH-PRIVATE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TN</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>t_n</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words |
| separated by '_'.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>T_P</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-DEFINE-TYPE-WITH-CODE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TN</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>t_n</p></td> |
| <td class="parameter_description"><p>The name of the new type in lowercase, with words separated by '_'.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>T_P</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>_C_</p></td> |
| <td class="parameter_description"><p>Custom code that gets inserted in the *_get_type() function.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-DEFINE-ABSTRACT-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TN</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>t_n</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words |
| separated by '_'.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>T_P</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-DEFINE-ABSTRACT-TYPE-WITH-PRIVATE:CAPS"></a><h3>G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE()</h3> |
| <pre class="programlisting">#define G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, G_ADD_PRIVATE (TN)) |
| </pre> |
| <p>Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-PRIVATE:CAPS" title="G_DEFINE_TYPE_WITH_PRIVATE()"><code class="function">G_DEFINE_TYPE_WITH_PRIVATE()</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="refsect3"> |
| <a name="G-DEFINE-ABSTRACT-TYPE-WITH-PRIVATE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TN</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>t_n</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words |
| separated by '_'.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>T_P</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="G-DEFINE-ABSTRACT-TYPE-WITH-CODE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TN</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>t_n</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words |
| separated by '_'.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>T_P</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>_C_</p></td> |
| <td class="parameter_description"><p>Custom code that gets inserted in the <em class="parameter"><code><code class="function">type_name_get_type()</code></code></em> |
| function.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-ADD-PRIVATE:CAPS"></a><h3>G_ADD_PRIVATE()</h3> |
| <pre class="programlisting">#define G_ADD_PRIVATE(TypeName)</pre> |
| <p>A convenience macro to ease adding private data to instances of a new type |
| 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>.</p> |
| <p>For instance:</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</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">_MyObjectClass</span><span class="normal"> MyObjectClass</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="cbracket">{</span> |
| <span class="normal"> </span><span class="usertype">gint</span><span class="normal"> foo</span><span class="symbol">;</span> |
| <span class="normal"> </span><span class="usertype">gint</span><span class="normal"> bar</span><span class="symbol">;</span> |
| <span class="cbracket">}</span><span class="normal"> MyObjectPrivate</span><span class="symbol">;</span> |
| |
| <span class="function"><a href="gobject-Type-Information.html#G-DEFINE-TYPE-WITH-CODE:CAPS">G_DEFINE_TYPE_WITH_CODE</a></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="normal"> <a href="gobject-Type-Information.html#G-TYPE-OBJECT:CAPS">G_TYPE_OBJECT</a></span><span class="symbol">,</span> |
| <span class="normal"> </span><span class="function"><a href="gobject-Type-Information.html#G-ADD-PRIVATE:CAPS">G_ADD_PRIVATE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">MyObject</span><span class="symbol">))</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p></p> |
| <p>Will add MyObjectPrivate as the private data to any instance of the MyObject |
| type.</p> |
| <p>G_DEFINE_TYPE_* macros will automatically create a private function |
| based on the arguments to this macro, which can be used to safely |
| retrieve the private data from an instance of the type; for instance:</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</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="normal"><a href="../glib-Basic-Types.html#gint">gint</a></span> |
| <span class="function">my_object_get_foo</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">MyObject</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">obj</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> </span><span class="usertype">MyObjectPrivate</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">priv </span><span class="symbol">=</span><span class="normal"> </span><span class="function">my_object_get_instance_private</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">obj</span><span class="symbol">);</span> |
| |
| <span class="normal"> </span><span class="function"><a href="../glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">MY_IS_OBJECT</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">obj</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">return</span><span class="normal"> priv</span><span class="symbol">-></span><span class="normal">foo</span><span class="symbol">;</span> |
| <span class="cbracket">}</span> |
| |
| <span class="type">void</span> |
| <span class="function">my_object_set_bar</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">MyObject</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">obj</span><span class="symbol">,</span> |
| <span class="normal"> </span><span class="usertype">gint</span><span class="normal"> bar</span><span class="symbol">)</span> |
| <span class="cbracket">{</span> |
| <span class="normal"> </span><span class="usertype">MyObjectPrivate</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">priv </span><span class="symbol">=</span><span class="normal"> </span><span class="function">my_object_get_instance_private</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">obj</span><span class="symbol">);</span> |
| |
| <span class="normal"> </span><span class="function"><a href="../glib-Warnings-and-Assertions.html#g-return-if-fail">g_return_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">MY_IS_OBJECT</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">obj</span><span class="symbol">));</span> |
| |
| <span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">priv</span><span class="symbol">-></span><span class="normal">bar </span><span class="symbol">!=</span><span class="normal"> bar</span><span class="symbol">)</span> |
| <span class="normal"> priv</span><span class="symbol">-></span><span class="normal">bar </span><span class="symbol">=</span><span class="normal"> bar</span><span class="symbol">;</span> |
| <span class="cbracket">}</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p></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> |
| <p>Also note that private structs added with these macros must have a struct |
| name of the form <code class="literal">TypeNamePrivate</code>.</p> |
| <p>It is safe to call _get_instance_private on <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> or invalid object since |
| it's only adding an offset to the instance pointer. In that case the returned |
| pointer must not be dereferenced.</p> |
| <div class="refsect3"> |
| <a name="G-ADD-PRIVATE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>TypeName</p></td> |
| <td class="parameter_description"><p>the name of the type in CamelCase</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-PRIVATE-OFFSET:CAPS"></a><h3>G_PRIVATE_OFFSET()</h3> |
| <pre class="programlisting">#define G_PRIVATE_OFFSET(TypeName, field)</pre> |
| <p>Evaluates to the offset of the <em class="parameter"><code>field</code></em> |
| inside the instance private data |
| structure for <em class="parameter"><code>TypeName</code></em> |
| .</p> |
| <p>Note that this macro can only be used together with the G_DEFINE_TYPE_* |
| and <a class="link" href="gobject-Type-Information.html#G-ADD-PRIVATE:CAPS" title="G_ADD_PRIVATE()"><code class="function">G_ADD_PRIVATE()</code></a> macros, since it depends on variable names from |
| those macros.</p> |
| <div class="refsect3"> |
| <a name="G-PRIVATE-OFFSET.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TypeName</p></td> |
| <td class="parameter_description"><p>the name of the type in CamelCase</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>field</p></td> |
| <td class="parameter_description"><p>the name of the field in the private data structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-PRIVATE-FIELD:CAPS"></a><h3>G_PRIVATE_FIELD()</h3> |
| <pre class="programlisting">#define G_PRIVATE_FIELD(TypeName, inst, field_type, field_name)</pre> |
| <p>Evaluates to the <em class="parameter"><code>field_name</code></em> |
| inside the <em class="parameter"><code>inst</code></em> |
| private data |
| structure for <em class="parameter"><code>TypeName</code></em> |
| .</p> |
| <p>Note that this macro can only be used together with the G_DEFINE_TYPE_* |
| and <a class="link" href="gobject-Type-Information.html#G-ADD-PRIVATE:CAPS" title="G_ADD_PRIVATE()"><code class="function">G_ADD_PRIVATE()</code></a> macros, since it depends on variable names from |
| those macros.</p> |
| <div class="refsect3"> |
| <a name="G-PRIVATE-FIELD.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TypeName</p></td> |
| <td class="parameter_description"><p>the name of the type in CamelCase</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>inst</p></td> |
| <td class="parameter_description"><p>the instance of <em class="parameter"><code>TypeName</code></em> |
| you wish to access</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>field_type</p></td> |
| <td class="parameter_description"><p>the type of the field in the private data structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>field_name</p></td> |
| <td class="parameter_description"><p>the name of the field in the private data structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-PRIVATE-FIELD-P:CAPS"></a><h3>G_PRIVATE_FIELD_P()</h3> |
| <pre class="programlisting">#define G_PRIVATE_FIELD_P(TypeName, inst, field_name)</pre> |
| <p>Evaluates to a pointer to the <em class="parameter"><code>field_name</code></em> |
| inside the <em class="parameter"><code>inst</code></em> |
| private data |
| structure for <em class="parameter"><code>TypeName</code></em> |
| .</p> |
| <p>Note that this macro can only be used together with the G_DEFINE_TYPE_* |
| and <a class="link" href="gobject-Type-Information.html#G-ADD-PRIVATE:CAPS" title="G_ADD_PRIVATE()"><code class="function">G_ADD_PRIVATE()</code></a> macros, since it depends on variable names from |
| those macros.</p> |
| <div class="refsect3"> |
| <a name="G-PRIVATE-FIELD-P.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TypeName</p></td> |
| <td class="parameter_description"><p>the name of the type in CamelCase</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>inst</p></td> |
| <td class="parameter_description"><p>the instance of <em class="parameter"><code>TypeName</code></em> |
| you wish to access</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>field_name</p></td> |
| <td class="parameter_description"><p>the name of the field in the private data structure</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="struct 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="refsect3"> |
| <a name="G-DEFINE-INTERFACE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TN</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>t_n</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words separated by '_'.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>T_P</p></td> |
| <td class="parameter_description"><p>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.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-24.html#api-index-2.24">2.24</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="struct 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="refsect3"> |
| <a name="G-DEFINE-INTERFACE-WITH-CODE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TN</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>t_n</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words separated by '_'.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>T_P</p></td> |
| <td class="parameter_description"><p>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.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>_C_</p></td> |
| <td class="parameter_description"><p>Custom code that gets inserted in the *_get_type() function.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-24.html#api-index-2.24">2.24</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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 <code class="literal">_C_</code> 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="refsect3"> |
| <a name="G-IMPLEMENT-INTERFACE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TYPE_IFACE</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the interface to add</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>iface_init</p></td> |
| <td class="parameter_description"><p>The interface init function</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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> |
| <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="usertype">GtkGadget</span><span class="normal"> </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="usertype">GtkGadgetClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">klass</span><span class="symbol">);</span> |
| <span class="keyword">static</span><span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> gtk_gadget_parent_class </span><span class="symbol">=</span><span class="normal"> <a href="../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="usertype">gpointer</span><span class="normal"> 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"> </span><span class="usertype">gsize</span><span class="normal"> 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-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"> </span><span class="usertype">GType</span><span class="normal"> 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-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="number">0</span><span class="symbol">);</span> |
| <span class="normal"> </span><span class="cbracket">{</span> |
| <span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">GInterfaceInfo</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="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-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="refsect3"> |
| <a name="G-DEFINE-TYPE-EXTENDED.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TN</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>t_n</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words |
| separated by '_'.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>T_P</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the parent type.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>_f_</p></td> |
| <td class="parameter_description"><p><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></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>_C_</p></td> |
| <td class="parameter_description"><p>Custom code that gets inserted in the *_get_type() function.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-DEFINE-BOXED-TYPE:CAPS"></a><h3>G_DEFINE_BOXED_TYPE()</h3> |
| <pre class="programlisting">#define G_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) G_DEFINE_BOXED_TYPE_WITH_CODE (TypeName, type_name, copy_func, free_func, {}) |
| </pre> |
| <p>A convenience macro for boxed type implementations, which defines a |
| <code class="function">type_name_get_type()</code> function registering the boxed type.</p> |
| <div class="refsect3"> |
| <a name="G-DEFINE-BOXED-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TypeName</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>type_name</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words |
| separated by '_'</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>copy_func</p></td> |
| <td class="parameter_description"><p>the <a class="link" href="gobject-Boxed-Types.html#GBoxedCopyFunc" title="GBoxedCopyFunc ()"><span class="type">GBoxedCopyFunc</span></a> for the new type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>free_func</p></td> |
| <td class="parameter_description"><p>the <a class="link" href="gobject-Boxed-Types.html#GBoxedFreeFunc" title="GBoxedFreeFunc ()"><span class="type">GBoxedFreeFunc</span></a> for the new type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-DEFINE-BOXED-TYPE-WITH-CODE:CAPS"></a><h3>G_DEFINE_BOXED_TYPE_WITH_CODE()</h3> |
| <pre class="programlisting">#define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_func, _C_) _G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() |
| </pre> |
| <p>A convenience macro for boxed type implementations. |
| Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-BOXED-TYPE:CAPS" title="G_DEFINE_BOXED_TYPE()"><code class="function">G_DEFINE_BOXED_TYPE()</code></a>, but allows to insert custom code into the |
| <code class="function">type_name_get_type()</code> function, e.g. to register value transformations with |
| <a class="link" href="gobject-Generic-values.html#g-value-register-transform-func" title="g_value_register_transform_func ()"><code class="function">g_value_register_transform_func()</code></a>, for instance:</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</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="function"><a href="gobject-Type-Information.html#G-DEFINE-BOXED-TYPE-WITH-CODE:CAPS">G_DEFINE_BOXED_TYPE_WITH_CODE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="http://developer.gnome.org/gdk3/gdk3-Points-Rectangles-and-Regions.html#GdkRectangle">GdkRectangle</a></span><span class="symbol">,</span><span class="normal"> gdk_rectangle</span><span class="symbol">,</span> |
| <span class="normal"> gdk_rectangle_copy</span><span class="symbol">,</span> |
| <span class="normal"> gdk_rectangle_free</span><span class="symbol">,</span> |
| <span class="normal"> </span><span class="function">register_rectangle_transform_funcs</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">g_define_type_id</span><span class="symbol">))</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p></p> |
| <p>Similarly to the <a class="link" href="gobject-Type-Information.html#G-DEFINE-TYPE:CAPS" title="G_DEFINE_TYPE()"><code class="literal">G_DEFINE_TYPE</code></a> family of macros, the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> of the newly |
| defined boxed type is exposed in the <code class="literal">g_define_type_id</code> variable.</p> |
| <div class="refsect3"> |
| <a name="G-DEFINE-BOXED-TYPE-WITH-CODE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TypeName</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>type_name</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words |
| separated by '_'</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>copy_func</p></td> |
| <td class="parameter_description"><p>the <a class="link" href="gobject-Boxed-Types.html#GBoxedCopyFunc" title="GBoxedCopyFunc ()"><span class="type">GBoxedCopyFunc</span></a> for the new type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>free_func</p></td> |
| <td class="parameter_description"><p>the <a class="link" href="gobject-Boxed-Types.html#GBoxedFreeFunc" title="GBoxedFreeFunc ()"><span class="type">GBoxedFreeFunc</span></a> for the new type</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>_C_</p></td> |
| <td class="parameter_description"><p>Custom code that gets inserted in the *_get_type() function</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-DEFINE-POINTER-TYPE:CAPS"></a><h3>G_DEFINE_POINTER_TYPE()</h3> |
| <pre class="programlisting">#define G_DEFINE_POINTER_TYPE(TypeName, type_name) G_DEFINE_POINTER_TYPE_WITH_CODE (TypeName, type_name, {}) |
| </pre> |
| <p>A convenience macro for pointer type implementations, which defines a |
| <code class="function">type_name_get_type()</code> function registering the pointer type.</p> |
| <div class="refsect3"> |
| <a name="G-DEFINE-POINTER-TYPE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TypeName</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>type_name</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words |
| separated by '_'</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-DEFINE-POINTER-TYPE-WITH-CODE:CAPS"></a><h3>G_DEFINE_POINTER_TYPE_WITH_CODE()</h3> |
| <pre class="programlisting">#define G_DEFINE_POINTER_TYPE_WITH_CODE(TypeName, type_name, _C_) _G_DEFINE_POINTER_TYPE_BEGIN (TypeName, type_name) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() |
| </pre> |
| <p>A convenience macro for pointer type implementations. |
| Similar to <a class="link" href="gobject-Type-Information.html#G-DEFINE-POINTER-TYPE:CAPS" title="G_DEFINE_POINTER_TYPE()"><code class="function">G_DEFINE_POINTER_TYPE()</code></a>, but allows to insert |
| custom code into the <code class="function">type_name_get_type()</code> function.</p> |
| <div class="refsect3"> |
| <a name="G-DEFINE-POINTER-TYPE-WITH-CODE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>TypeName</p></td> |
| <td class="parameter_description"><p>The name of the new type, in Camel case</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>type_name</p></td> |
| <td class="parameter_description"><p>The name of the new type, in lowercase, with words |
| separated by '_'</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>_C_</p></td> |
| <td class="parameter_description"><p>Custom code that gets inserted in the *_get_type() function</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="gobject-Type-Information.other_details"></a><h2>Types and Values</h2> |
| <div class="refsect2"> |
| <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"> |
| <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"> |
| <a name="GTypeInterface"></a><h3>struct GTypeInterface</h3> |
| <pre class="programlisting">struct GTypeInterface { |
| }; |
| </pre> |
| <p>An opaque structure used as the base of all interface types.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GTypeInstance"></a><h3>struct GTypeInstance</h3> |
| <pre class="programlisting">struct GTypeInstance { |
| }; |
| </pre> |
| <p>An opaque structure used as the base of all type instances.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GTypeClass"></a><h3>struct GTypeClass</h3> |
| <pre class="programlisting">struct GTypeClass { |
| }; |
| </pre> |
| <p>An opaque structure used as the base of all classes.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GTypeInfo"></a><h3>struct GTypeInfo</h3> |
| <pre class="programlisting">struct GTypeInfo { |
| /* 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; |
| }; |
| </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.</p> |
| <p>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="struct 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="refsect3"> |
| <a name="GTypeInfo.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="struct_members_name"> |
| <col class="struct_members_description"> |
| <col width="200px" class="struct_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="struct_member_name"><p><a href="../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>;</p></td> |
| <td class="struct_member_description"><p>Size of the class structure (required for interface, classed and instantiatable types)</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><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>;</p></td> |
| <td class="struct_member_description"><p>Location of the base initialization function (optional)</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><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>;</p></td> |
| <td class="struct_member_description"><p>Location of the base finalization function (optional)</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><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>;</p></td> |
| <td class="struct_member_description"><p>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.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><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>;</p></td> |
| <td class="struct_member_description"><p>Location of the class finalization function for |
| classed and instantiatable types. Location of the default vtable |
| finalization function for interface types. (optional)</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="../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>;</p></td> |
| <td class="struct_member_description"><p>User-supplied data passed to the class init/finalize functions</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="../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>;</p></td> |
| <td class="struct_member_description"><p>Size of the instance (object) structure (required for instantiatable types only)</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="../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>;</p></td> |
| <td class="struct_member_description"><p>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 slice allocator now.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><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>;</p></td> |
| <td class="struct_member_description"><p>Location of the instance initialization function (optional, for instantiatable types only)</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p>const <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> *<em class="structfield"><code><a name="GTypeInfo.value-table"></a>value_table</code></em>;</p></td> |
| <td class="struct_member_description"><p>A <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct GTypeValueTable"><span class="type">GTypeValueTable</span></a> function table for generic handling of GValues |
| of this type (usually only useful for fundamental types)</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GTypeFundamentalInfo"></a><h3>struct GTypeFundamentalInfo</h3> |
| <pre class="programlisting">struct GTypeFundamentalInfo { |
| GTypeFundamentalFlags type_flags; |
| }; |
| </pre> |
| <p>A structure that provides information to the type system which is |
| used specifically for managing fundamental types.</p> |
| <div class="refsect3"> |
| <a name="GTypeFundamentalInfo.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="struct_members_name"> |
| <col class="struct_members_description"> |
| <col width="200px" class="struct_members_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="struct_member_name"><p><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>;</p></td> |
| <td class="struct_member_description"><p><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</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GInterfaceInfo"></a><h3>struct GInterfaceInfo</h3> |
| <pre class="programlisting">struct GInterfaceInfo { |
| GInterfaceInitFunc interface_init; |
| GInterfaceFinalizeFunc interface_finalize; |
| gpointer interface_data; |
| }; |
| </pre> |
| <p>A structure that provides information to the type system which is |
| used specifically for managing interface types.</p> |
| <div class="refsect3"> |
| <a name="GInterfaceInfo.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="struct_members_name"> |
| <col class="struct_members_description"> |
| <col width="200px" class="struct_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="struct_member_name"><p><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>;</p></td> |
| <td class="struct_member_description"><p>location of the interface initialization function</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><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>;</p></td> |
| <td class="struct_member_description"><p>location of the interface finalization function</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="../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>;</p></td> |
| <td class="struct_member_description"><p>user-supplied data passed to the interface init/finalize functions</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GTypeValueTable"></a><h3>struct GTypeValueTable</h3> |
| <pre class="programlisting">struct GTypeValueTable { |
| 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); |
| const gchar *collect_format; |
| gchar* (*collect_value) (GValue *value, |
| guint n_collect_values, |
| GTypeCValue *collect_values, |
| guint collect_flags); |
| const gchar *lcopy_format; |
| gchar* (*lcopy_value) (const GValue *value, |
| guint n_collect_values, |
| GTypeCValue *collect_values, |
| guint collect_flags); |
| }; |
| </pre> |
| <p>The <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="struct 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="refsect3"> |
| <a name="GTypeValueTable.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="struct_members_name"> |
| <col class="struct_members_description"> |
| <col width="200px" class="struct_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GTypeValueTable.value-init"></a>value_init</code></em> ()</p></td> |
| <td class="struct_member_description"> |
| <p>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="literal"><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-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the implementation might |
| look like:</p> |
| <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-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> |
| |
| <p></p> |
| </td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GTypeValueTable.value-free"></a>value_free</code></em> ()</p></td> |
| <td class="struct_member_description"> |
| <p>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:</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</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="function"><a href="../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> |
| |
| <p></p> |
| </td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GTypeValueTable.value-copy"></a>value_copy</code></em> ()</p></td> |
| <td class="struct_member_description"> |
| <p><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:</p> |
| <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-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> |
| |
| <p></p> |
| </td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GTypeValueTable.value-peek-pointer"></a>value_peek_pointer</code></em> ()</p></td> |
| <td class="struct_member_description"> |
| <p>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:</p> |
| <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> |
| |
| <p></p> |
| </td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p>const <a href="../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>;</p></td> |
| <td class="struct_member_description"> |
| <p>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:</p> |
| <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
| <li class="listitem"><p>'i' - Integers. passed as collect_values[].v_int.</p></li> |
| <li class="listitem"><p>'l' - Longs. passed as collect_values[].v_long.</p></li> |
| <li class="listitem"><p>'d' - Doubles. passed as collect_values[].v_double.</p></li> |
| <li class="listitem"><p>'p' - Pointers. passed as collect_values[].v_pointer. |
| 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'.</p></li> |
| </ul></div> |
| </td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GTypeValueTable.collect-value"></a>collect_value</code></em> ()</p></td> |
| <td class="struct_member_description"> |
| <p>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-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="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:</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</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-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="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-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-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p> |
| 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 signal emission 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>:</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</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="usertype">GObject</span><span class="normal"> </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="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="keyword">return</span><span class="normal"> <a href="../glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span> |
| <span class="cbracket">}</span> |
| <span class="keyword">else</span> |
| <span class="keyword">return</span><span class="normal"> </span><span class="function"><a href="../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> |
| |
| <p> |
| 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-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-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-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> return is considered a fatal condition so further |
| program behaviour is undefined.</p> |
| </td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p>const <a href="../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>;</p></td> |
| <td class="struct_member_description"><p>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.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GTypeValueTable.lcopy-value"></a>lcopy_value</code></em> ()</p></td> |
| <td class="struct_member_description"> |
| <p>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:</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</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="usertype">gchar</span><span class="normal"> </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="keyword">return</span><span class="normal"> </span><span class="function"><a href="../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="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="symbol">*</span><span class="normal">string_p </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="../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> |
| |
| <p> |
| And an illustrative version of <code class="function">lcopy_value()</code> for |
| reference-counted types:</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</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="usertype">GObject</span><span class="normal"> </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="keyword">return</span><span class="normal"> </span><span class="function"><a href="../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="symbol">*</span><span class="normal">object_p </span><span class="symbol">=</span><span class="normal"> <a href="../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="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="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-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p></p> |
| </td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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"> |
| <a name="GTypeDebugFlags"></a><h3>enum GTypeDebugFlags</h3> |
| <div class="warning"> |
| <p><code class="literal">GTypeDebugFlags</code> has been deprecated since version 2.36 and should not be used in newly-written code.</p> |
| <p>g_type_init() is now done automatically</p> |
| </div> |
| <p>These flags used to 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> which |
| is now deprecated.</p> |
| <p>If you need to enable debugging features, use the GOBJECT_DEBUG |
| environment variable.</p> |
| <div class="refsect3"> |
| <a name="GTypeDebugFlags.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="enum_members_name"> |
| <col class="enum_members_description"> |
| <col width="200px" class="enum_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-DEBUG-NONE:CAPS"></a>G_TYPE_DEBUG_NONE</p></td> |
| <td class="enum_member_description"> |
| <p>Print no messages</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-DEBUG-OBJECTS:CAPS"></a>G_TYPE_DEBUG_OBJECTS</p></td> |
| <td class="enum_member_description"> |
| <p>Print messages about object bookkeeping</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-DEBUG-SIGNALS:CAPS"></a>G_TYPE_DEBUG_SIGNALS</p></td> |
| <td class="enum_member_description"> |
| <p>Print messages about signal emissions</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-DEBUG-INSTANCE-COUNT:CAPS"></a>G_TYPE_DEBUG_INSTANCE_COUNT</p></td> |
| <td class="enum_member_description"> |
| <p>Keep a count of instances of each type</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-DEBUG-MASK:CAPS"></a>G_TYPE_DEBUG_MASK</p></td> |
| <td class="enum_member_description"> |
| <p>Mask covering all debug flags</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GTypeQuery"></a><h3>struct GTypeQuery</h3> |
| <pre class="programlisting">struct GTypeQuery { |
| GType type; |
| const gchar *type_name; |
| guint class_size; |
| guint instance_size; |
| }; |
| </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="refsect3"> |
| <a name="GTypeQuery.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="struct_members_name"> |
| <col class="struct_members_description"> |
| <col width="200px" class="struct_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="struct_member_name"><p><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>;</p></td> |
| <td class="struct_member_description"><p>the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value of the type</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p>const <a href="../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>;</p></td> |
| <td class="struct_member_description"><p>the name of the type</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="../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>;</p></td> |
| <td class="struct_member_description"><p>the size of the class structure</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="../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>;</p></td> |
| <td class="struct_member_description"><p>the size of the instance structure</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GTypeFlags"></a><h3>enum GTypeFlags</h3> |
| <p>Bit masks used to check or determine characteristics of a type.</p> |
| <div class="refsect3"> |
| <a name="GTypeFlags.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="enum_members_name"> |
| <col class="enum_members_description"> |
| <col width="200px" class="enum_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-FLAG-ABSTRACT:CAPS"></a>G_TYPE_FLAG_ABSTRACT</p></td> |
| <td class="enum_member_description"> |
| <p>Indicates an abstract type. No instances can be |
| created for an abstract type</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-FLAG-VALUE-ABSTRACT:CAPS"></a>G_TYPE_FLAG_VALUE_ABSTRACT</p></td> |
| <td class="enum_member_description"> |
| <p>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></p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GTypeFundamentalFlags"></a><h3>enum GTypeFundamentalFlags</h3> |
| <p>Bit masks used to check or determine specific characteristics of a |
| fundamental type.</p> |
| <div class="refsect3"> |
| <a name="GTypeFundamentalFlags.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="enum_members_name"> |
| <col class="enum_members_description"> |
| <col width="200px" class="enum_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-FLAG-CLASSED:CAPS"></a>G_TYPE_FLAG_CLASSED</p></td> |
| <td class="enum_member_description"> |
| <p>Indicates a classed type</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-FLAG-INSTANTIATABLE:CAPS"></a>G_TYPE_FLAG_INSTANTIATABLE</p></td> |
| <td class="enum_member_description"> |
| <p>Indicates an instantiable type (implies classed)</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-FLAG-DERIVABLE:CAPS"></a>G_TYPE_FLAG_DERIVABLE</p></td> |
| <td class="enum_member_description"> |
| <p>Indicates a flat derivable type</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-TYPE-FLAG-DEEP-DERIVABLE:CAPS"></a>G_TYPE_FLAG_DEEP_DERIVABLE</p></td> |
| <td class="enum_member_description"> |
| <p>Indicates a deep derivable type (implies derivable)</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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"> |
| <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 |
| void return type.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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"> |
| <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-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"> |
| <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-Basic-Types.html#guchar"><span class="type">guchar</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Basic-Types.html#gint"><span class="type">gint</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Basic-Types.html#guint"><span class="type">guint</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Basic-Types.html#glong"><span class="type">glong</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Basic-Types.html#gulong"><span class="type">gulong</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Basic-Types.html#gint64"><span class="type">gint64</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Basic-Types.html#guint64"><span class="type">guint64</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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"> |
| <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"> |
| <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-Basic-Types.html#gfloat"><span class="type">gfloat</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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"> |
| <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-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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"> |
| <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="struct GParamSpec"><span class="type">GParamSpec</span></a> types are derived.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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"> |
| <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"> |
| <a name="G-TYPE-VARIANT:CAPS"></a><h3>G_TYPE_VARIANT</h3> |
| <pre class="programlisting">#define G_TYPE_VARIANT G_TYPE_MAKE_FUNDAMENTAL (21) |
| </pre> |
| <p>The fundamental type corresponding to <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a>.</p> |
| <p>All floating <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> instances passed through the <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> system are |
| consumed.</p> |
| <p>Note that callbacks in closures, and signal handlers |
| for signals of return type <a class="link" href="gobject-Type-Information.html#G-TYPE-VARIANT:CAPS" title="G_TYPE_VARIANT"><code class="literal">G_TYPE_VARIANT</code></a>, must never return floating |
| variants.</p> |
| <p>Note: GLib 2.24 did include a boxed type with this name. It was replaced |
| with this fundamental type in 2.26.</p> |
| <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="G-TYPE-CHECKSUM:CAPS"></a><h3>G_TYPE_CHECKSUM</h3> |
| <pre class="programlisting">#define G_TYPE_CHECKSUM (g_checksum_get_type ()) |
| </pre> |
| <p>The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> for a boxed type holding a <a href="../glib-Data-Checksums.html#GChecksum"><span class="type">GChecksum</span></a>.</p> |
| <p class="since">Since: <a class="link" href="api-index-2-36.html#api-index-2.36">2.36</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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 (22) |
| </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"> |
| <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"> |
| <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"> |
| <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"> |
| <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.25.1</div> |
| </body> |
| </html> |