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

📄 gtype.sgml

📁 GLib是GTK+和GNOME工程的基础底层核心程序库
💻 SGML
📖 第 1 页 / 共 5 页
字号:
<para></para></refsect2><refsect2><title><anchor id="g-type-init-with-debug-flags">g_type_init_with_debug_flags ()</title><programlisting>void        g_type_init_with_debug_flags    (<link linkend="GTypeDebugFlags">GTypeDebugFlags</link> debug_flags);</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>debug_flags</parameter>&nbsp;:</entry><entry></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-name">g_type_name ()</title><programlisting>G_CONST_RETURN <link linkend="gchar">gchar</link>* g_type_name           (<link linkend="GType">GType</link> type);</programlisting><para>Return the unique name that is assigned to a type ID (this is the preferred methodto find out whether a specific type has been registered for the passed in ID yet).</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>		Type to return name for.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>	Static type name or NULL.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-qname">g_type_qname ()</title><programlisting><link linkend="GQuark">GQuark</link>      g_type_qname                    (<link linkend="GType">GType</link> type);</programlisting><para>Return the corresponding quark of the type IDs name.</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>   Type to return quark of type name for.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>The type names quark or 0.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-from-name">g_type_from_name ()</title><programlisting><link linkend="GType">GType</link>       g_type_from_name                (const <link linkend="gchar">gchar</link> *name);</programlisting><para>Lookup the type ID from a given type name, returns 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).</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>name</parameter>&nbsp;:</entry><entry>   Type name to lookup.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>Corresponding type ID or 0.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-parent">g_type_parent ()</title><programlisting><link linkend="GType">GType</link>       g_type_parent                   (<link linkend="GType">GType</link> type);</programlisting><para>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.</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>   The derived type.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>The parent type.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-depth">g_type_depth ()</title><programlisting><link linkend="guint">guint</link>       g_type_depth                    (<link linkend="GType">GType</link> 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></entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-next-base">g_type_next_base ()</title><programlisting><link linkend="GType">GType</link>       g_type_next_base                (<link linkend="GType">GType</link> leaf_type,                                             <link linkend="GType">GType</link> root_type);</programlisting><para>Given a <parameter>leaf_type</parameter> and a <parameter>root_type</parameter> which is contained in its anchestry, returnthe type that <parameter>root_type</parameter> is the immediate parent of.In other words, this function determines the type that is derived directly from<parameter>root_type</parameter> which is also a base class of <parameter>leaf_type</parameter>.  Given a root type and aleaf type, this function can be used to determine the types and order in whichthe leaf type is descended from the root type.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>leaf_type</parameter>&nbsp;:</entry><entry>	Descendant of <parameter>root_type</parameter> and the type to be returned.</entry></row><row><entry align="right"><parameter>root_type</parameter>&nbsp;:</entry><entry>	Immediate parent of the returned type.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>	Immediate child of <parameter>root_type</parameter> and anchestor of <parameter>leaf_type</parameter>.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-is-a">g_type_is_a ()</title><programlisting><link linkend="gboolean">gboolean</link>    g_type_is_a                     (<link linkend="GType">GType</link> type,                                             <link linkend="GType">GType</link> is_a_type);</programlisting><para>Check whether <parameter>type</parameter> is a descendant of <parameter>is_a_type</parameter>.</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>     Type to check anchestry for.</entry></row><row><entry align="right"><parameter>is_a_type</parameter>&nbsp;:</entry><entry>Possible anchestor of <parameter>type</parameter>.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>  <literal>TRUE</literal> if <parameter>type</parameter> is_a <parameter>is_a_type</parameter> holds true.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-class-ref">g_type_class_ref ()</title><programlisting><link linkend="gpointer">gpointer</link>    g_type_class_ref                (<link linkend="GType">GType</link> type);</programlisting><para>Increments the reference count of the class structure belonging to<parameter>type</parameter>. This function will demand-create the class if it doesn'texist already.</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>	  Type ID of a classed type.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>The <link linkend="GTypeClass">GTypeClass</link> structure for the given type ID.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-class-peek">g_type_class_peek ()</title><programlisting><link linkend="gpointer">gpointer</link>    g_type_class_peek               (<link linkend="GType">GType</link> type);</programlisting><para>This function is essentially the same as <link linkend="g-type-class-ref">g_type_class_ref</link>(), except thatthe classes reference count isn't incremented. Therefore, this functionmay return NULL if the class of the type passed in does not currentlyexist (hasn't been referenced before).</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>		Type ID of a classed type.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>	The <link linkend="GTypeClass">GTypeClass</link> structure for the given type ID or NULL		if the class does not currently exist.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-class-unref">g_type_class_unref ()</title><programlisting>void        g_type_class_unref              (<link linkend="gpointer">gpointer</link> g_class);</programlisting><para>Decrements the reference count of the class structure being passed in.Once the last reference count of a class has been released, classesmay be finalized by the type system, so further dereferencing of aclass pointer after <link linkend="g-type-class-unref">g_type_class_unref</link>() are invalid.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry><entry>	The <link linkend="GTypeClass">GTypeClass</link> structure to unreference.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-class-peek-parent">g_type_class_peek_parent ()</title><programlisting><link linkend="gpointer">gpointer</link>    g_type_class_peek_parent        (<link linkend="gpointer">gpointer</link> g_class);</programlisting><para>This is a convenience function, often needed in class intializers.It essentially takes the immediate parent type of the class passed in,and returns the class structure thereof. Since derived classes holda reference count on their parent classes as long as they are instantiated,the returned class will always exist. This function is essentiallyequivalent to:<msgtext><programlisting>g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)));</programlisting></msgtext></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>g_class</parameter>&nbsp;:</entry><entry>The <link linkend="GTypeClass">GTypeClass</link> structure to retrieve the parent class for.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>The parent class of <parameter>g_class</parameter>.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-interface-peek">g_type_interface_peek ()</title><programlisting><link linkend="gpointer">gpointer</link>    g_type_interface_peek           (<link linkend="gpointer">gpointer</link> instance_class,                                             <link linkend="GType">GType</link> iface_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>instance_class</parameter>&nbsp;:</entry><entry></entry></row><row><entry align="right"><parameter>iface_type</parameter>&nbsp;:</entry><entry></entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-type-interface-peek-parent">g_type_interface_peek_parent ()</title><programlisting><link linkend="gpointer">gpointer</link>    g_type_interface_peek_parent    (<link linkend="gpoi

⌨️ 快捷键说明

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