⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gtype.sgml

📁 GLib是GTK+和GNOME工程的基础底层核心程序库
💻 SGML
📖 第 1 页 / 共 5 页
字号:
<refsect2><title><anchor id="G-TYPE-IS-DERIVED-CAPS">G_TYPE_IS_DERIVED()</title><programlisting>#define G_TYPE_IS_DERIVED(type)                 ((type) &gt; G_TYPE_FUNDAMENTAL_MAX)</programlisting><para>Returns <link linkend="TRUE-CAPS">TRUE</link> if <parameter>type</parameter> is derived (or in object-oriented terminology:inherited) from another type (this holds true for all non-fundamentaltypes).</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>type</parameter>&nbsp;:</entry><entry>A <link linkend="GType">GType</link> value.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="G-TYPE-IS-FUNDAMENTAL-CAPS">G_TYPE_IS_FUNDAMENTAL()</title><programlisting>#define G_TYPE_IS_FUNDAMENTAL(type)             ((type) &lt;= G_TYPE_FUNDAMENTAL_MAX)</programlisting><para>Returns <link linkend="TRUE-CAPS">TRUE</link> if <parameter>type</parameter> is a fundamental type.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>type</parameter>&nbsp;:</entry><entry>A <link linkend="GType">GType</link> value.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="G-TYPE-IS-VALUE-TYPE-CAPS">G_TYPE_IS_VALUE_TYPE()</title><programlisting>#define G_TYPE_IS_VALUE_TYPE(type)              (g_type_check_is_value_type (type))</programlisting><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>type</parameter>&nbsp;:</entry><entry>A <link linkend="GType">GType</link> value.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="G-TYPE-HAS-VALUE-TABLE-CAPS">G_TYPE_HAS_VALUE_TABLE()</title><programlisting>#define G_TYPE_HAS_VALUE_TABLE(type)            (g_type_value_table_peek (type) != NULL)</programlisting><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>type</parameter>&nbsp;:</entry><entry></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="G-TYPE-IS-CLASSED-CAPS">G_TYPE_IS_CLASSED()</title><programlisting>#define G_TYPE_IS_CLASSED(type)                 (g_type_test_flags ((type), G_TYPE_FLAG_CLASSED))</programlisting><para>Returns <link linkend="TRUE-CAPS">TRUE</link> if <parameter>type</parameter> is a classed type.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>type</parameter>&nbsp;:</entry><entry>A <link linkend="GType">GType</link> value.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="G-TYPE-IS-INSTANTIATABLE-CAPS">G_TYPE_IS_INSTANTIATABLE()</title><programlisting>#define G_TYPE_IS_INSTANTIATABLE(type)          (g_type_test_flags ((type), G_TYPE_FLAG_INSTANTIATABLE))</programlisting><para>Returns <link linkend="TRUE-CAPS">TRUE</link> if <parameter>type</parameter> can be instantiated.  Instantiation is theprocess of creating an instance (object) of this type.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>type</parameter>&nbsp;:</entry><entry>A <link linkend="GType">GType</link> value.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="G-TYPE-IS-DERIVABLE-CAPS">G_TYPE_IS_DERIVABLE()</title><programlisting>#define G_TYPE_IS_DERIVABLE(type)               (g_type_test_flags ((type), G_TYPE_FLAG_DERIVABLE))</programlisting><para>Returns <link linkend="TRUE-CAPS">TRUE</link> if <parameter>type</parameter> is a derivable type.  A derivable type canbe used as the base class of a flat (single-level) class hierarchy.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>type</parameter>&nbsp;:</entry><entry>A <link linkend="GType">GType</link> value.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="G-TYPE-IS-DEEP-DERIVABLE-CAPS">G_TYPE_IS_DEEP_DERIVABLE()</title><programlisting>#define G_TYPE_IS_DEEP_DERIVABLE(type)          (g_type_test_flags ((type), G_TYPE_FLAG_DEEP_DERIVABLE))</programlisting><para>Returns <link linkend="TRUE-CAPS">TRUE</link> if <parameter>type</parameter> is a deep derivable type.  A deep derivable typecan be used as the base class of a deep (multi-level) class hierarchy.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>type</parameter>&nbsp;:</entry><entry>A <link linkend="GType">GType</link> value.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="G-TYPE-IS-INTERFACE-CAPS">G_TYPE_IS_INTERFACE()</title><programlisting>#define G_TYPE_IS_INTERFACE(type)               (G_TYPE_FUNDAMENTAL (type) == G_TYPE_INTERFACE)</programlisting><para>Returns <link linkend="TRUE-CAPS">TRUE</link> if <parameter>type</parameter> is an interface type.Interface types are types that provide pure APIs, the implementationof which is provided by another type (which is then said to conformto the interface).  GLib interfaces are somewhat analogous to Javainterfaces and C++ classes containing only pure virtual functions.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>type</parameter>&nbsp;:</entry><entry>A <link linkend="GType">GType</link> value.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GTypeInterface">struct GTypeInterface</title><programlisting>struct GTypeInterface{  /*&lt; private &gt;*/  GType g_type;         /* iface type */  GType g_instance_type;};</programlisting><para>An opaque structure used as the base of all interface types.</para></refsect2><refsect2><title><anchor id="GTypeInstance">struct GTypeInstance</title><programlisting>struct GTypeInstance{  /*&lt; private &gt;*/  GTypeClass *g_class;};</programlisting><para>An opaque structure used as the base of all type instances.</para></refsect2><refsect2><title><anchor id="GTypeInfo">struct GTypeInfo</title><programlisting>struct GTypeInfo{  /* interface types, classed types, instantiated types */  guint16                class_size;    GBaseInitFunc          base_init;  GBaseFinalizeFunc      base_finalize;    /* 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;};</programlisting><para>This structure is used to provide the type system with the informationrequired to initialize and destruct (finalize) a type's class andinstances thereof.The initialized structure is passed to the <link linkend="g-type-register-static">g_type_register_static</link>() function(or is copied into the provided <link linkend="GTypeInfo">GTypeInfo</link> structure in the<link linkend="g-type-plugin-complete-type-info">g_type_plugin_complete_type_info</link>()). The type system will perform a deepcopy of this structure, so it's memory does not need to be persistentacross invocation of <link linkend="g-type-register-static">g_type_register_static</link>().</para><informaltable pgwide="1" frame="none" role="struct"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry><link linkend="guint16">guint16</link> <structfield>class_size</structfield></entry><entry>	 Size of the class structure (required for interface, classed and instantiatable types).</entry></row><row><entry><link linkend="GBaseInitFunc">GBaseInitFunc</link> <structfield>base_init</structfield></entry><entry>	 Location of the base initialization function (optional).</entry></row><row><entry><link linkend="GBaseFinalizeFunc">GBaseFinalizeFunc</link> <structfield>base_finalize</structfield></entry><entry> Location of the base finalization function (optional).</entry></row><row><entry><link linkend="GClassInitFunc">GClassInitFunc</link> <structfield>class_init</structfield></entry><entry>	 Location of the class initialization function (optional, for classed and instantiatable types only).</entry></row><row><entry><link linkend="GClassFinalizeFunc">GClassFinalizeFunc</link> <structfield>class_finalize</structfield></entry><entry>Location of the class finalization function (optional).</entry></row><row><entry><link linkend="gconstpointer">gconstpointer</link> <structfield>class_data</structfield></entry><entry>	 User-supplied data passed to the class init/finalize functions.</entry></row><row><entry><link linkend="guint16">guint16</link> <structfield>instance_size</structfield></entry><entry> Size of the instance (object) structure (required for instantiatable types only).</entry></row><row><entry><link linkend="guint16">guint16</link> <structfield>n_preallocs</structfield></entry><entry>	 Number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching).</entry></row><row><entry><link linkend="GInstanceInitFunc">GInstanceInitFunc</link> <structfield>instance_init</structfield></entry><entry> Location of the instance initialization function (optional, for instantiatable types only).</entry></row><row><entry>const <link linkend="GTypeValueTable">GTypeValueTable</link> *<structfield>value_table</structfield></entry><entry>	 A <link linkend="GTypeValueTable">GTypeValueTable</link> function table for generic handling of GValues of this type (usualy only		 useful for fundamental types).</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GTypeFundamentalInfo">struct GTypeFundamentalInfo</title><programlisting>struct GTypeFundamentalInfo

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -