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

📄 main.sgml

📁 GLib是GTK+和GNOME工程的基础底层核心程序库
💻 SGML
📖 第 1 页 / 共 5 页
字号:
<literal>g_main_is_running</literal> is deprecated and should not be used in newly-written code.</para></warning><para>Checks if the main loop is running. A compatibility macro, see<link linkend="g-main-loop-is-running">g_main_loop_is_running</link>().    </para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>loop</parameter>&nbsp;:</entry><entry>a <link linkend="GMainLoop">GMainLoop</link>.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry><literal>TRUE</literal> if the main loop is running.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="G-PRIORITY-HIGH-CAPS">G_PRIORITY_HIGH</title><programlisting>#define G_PRIORITY_HIGH            -100</programlisting><para>Use this for high priority event sources.It is not used within GLib or GTK+.</para></refsect2><refsect2><title><anchor id="G-PRIORITY-DEFAULT-CAPS">G_PRIORITY_DEFAULT</title><programlisting>#define G_PRIORITY_DEFAULT          0</programlisting><para>Use this for default priority event sources.In GLib this priority is used when adding timeout functions with<link linkend="g-timeout-add">g_timeout_add</link>().In GDK this priority is used for events from the X server.</para></refsect2><refsect2><title><anchor id="G-PRIORITY-HIGH-IDLE-CAPS">G_PRIORITY_HIGH_IDLE</title><programlisting>#define G_PRIORITY_HIGH_IDLE        100</programlisting><para>Use this for high priority idle functions.GTK+ uses <link linkend="G-PRIORITY-HIGH-IDLE-CAPS">G_PRIORITY_HIGH_IDLE</link> + 10 for resizing operations, and<link linkend="G-PRIORITY-HIGH-IDLE-CAPS">G_PRIORITY_HIGH_IDLE</link> + 20 for redrawing operations. (This is done toensure that any pending resizes are processed before any pending redraws,so that widgets are not redrawn twice unnecessarily.)</para></refsect2><refsect2><title><anchor id="G-PRIORITY-DEFAULT-IDLE-CAPS">G_PRIORITY_DEFAULT_IDLE</title><programlisting>#define G_PRIORITY_DEFAULT_IDLE     200</programlisting><para>Use this for default priority idle functions.In GLib this priority is used when adding idle functions with <link linkend="g-idle-add">g_idle_add</link>().</para></refsect2><refsect2><title><anchor id="G-PRIORITY-LOW-CAPS">G_PRIORITY_LOW</title><programlisting>#define G_PRIORITY_LOW	            300</programlisting><para>Use this for very low priority background tasks.It is not used within GLib or GTK+.</para></refsect2><refsect2><title><anchor id="GMainContext">struct GMainContext</title><programlisting>struct GMainContext;</programlisting><para>The <structname>GMainContext</structname> struct is an opaque data type representing a set of sources to be handled in a main loop. </para></refsect2><refsect2><title><anchor id="g-main-context-new">g_main_context_new ()</title><programlisting><link linkend="GMainContext">GMainContext</link>* g_main_context_new            (void);</programlisting><para>Creates a new <link linkend="GMainContext">GMainContext</link> strcuture</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the new <link linkend="GMainContext">GMainContext</link></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-main-context-ref">g_main_context_ref ()</title><programlisting>void        g_main_context_ref              (<link linkend="GMainContext">GMainContext</link> *context);</programlisting><para>Increases the reference count on a <link linkend="GMainContext">GMainContext</link> object by one.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>context</parameter>&nbsp;:</entry><entry> a <link linkend="GMainContext">GMainContext</link></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-main-context-unref">g_main_context_unref ()</title><programlisting>void        g_main_context_unref            (<link linkend="GMainContext">GMainContext</link> *context);</programlisting><para>Decreases the reference count on a <link linkend="GMainContext">GMainContext</link> object by one. Ifthe result is zero, free the context and free all associated memory.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>context</parameter>&nbsp;:</entry><entry> a <link linkend="GMainContext">GMainContext</link></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-main-context-default">g_main_context_default ()</title><programlisting><link linkend="GMainContext">GMainContext</link>* g_main_context_default        (void);</programlisting><para>Returns the default main context. This is the main context usedfor main loop functions when a main loop is not explicitlyspecified.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the default main context.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-main-context-iteration">g_main_context_iteration ()</title><programlisting><link linkend="gboolean">gboolean</link>    g_main_context_iteration        (<link linkend="GMainContext">GMainContext</link> *context,                                             <link linkend="gboolean">gboolean</link> may_block);</programlisting><para>Runs a single iteration for the given main loop. This involveschecking to see if any event sources are ready to be processed,then if no events sources are ready and <parameter>may_block</parameter> is <literal>TRUE</literal>, waitingfor a source to become ready, then dispatching the highest priorityevents sources that are ready. Note that even when <parameter>may_block</parameter> is <literal>TRUE</literal>,it is still possible for <link linkend="g-main-context-iteration">g_main_context_iteration</link>() to return<literal>FALSE</literal>, since the the wait may be interrupted for otherreasons than an event source becoming ready.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>context</parameter>&nbsp;:</entry><entry> a <link linkend="GMainContext">GMainContext</link> (if <literal>NULL</literal>, the default context will be used) </entry></row><row><entry align="right"><parameter>may_block</parameter>&nbsp;:</entry><entry> whether the call may block.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <literal>TRUE</literal> if events were dispatched.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-main-iteration">g_main_iteration()</title><programlisting>#define     g_main_iteration(may_block)</programlisting><warning><para><literal>g_main_iteration</literal> is deprecated and should not be used in newly-written code.</para></warning><para>Runs a single iteration for the default <link linkend="GMainContext">GMainContext</link>.A compatibility macro, see <link linkend="g-main-context-iteration">g_main_context_iteration</link>().</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>may_block</parameter>&nbsp;:</entry><entry>set to <literal>TRUE</literal> if it should block (i.e. wait) until an event sourcebecomes ready. It will return after an event source has been processed.If set to <literal>FALSE</literal> it will return immediately if no event source is ready to beprocessed.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry><literal>TRUE</literal> if more events are pending.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-main-context-pending">g_main_context_pending ()</title><programlisting><link linkend="gboolean">gboolean</link>    g_main_context_pending          (<link linkend="GMainContext">GMainContext</link> *context);</programlisting><para>Checks if any sources have pending events for the given context.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>context</parameter>&nbsp;:</entry><entry> a <link linkend="GMainContext">GMainContext</link> (if <literal>NULL</literal>, the default context will be used)</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <literal>TRUE</literal> if events are pending.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-main-pending">g_main_pending()</title><programlisting>#define     g_main_pending()</programlisting><warning><para><literal>g_main_pending</literal> is deprecated and should not be used in newly-written code.</para></warning><para>Checks if any events are pending for the default <link linkend="GMainContext">GMainContext</link>(i.e. ready to be processed).  A compatibility macro, see<link linkend="g-main-context-pending">g_main_context_pending</link>().</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry><literal>TRUE</literal> if any events are pending.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-main-context-find-source-by-id">g_main_context_find_source_by_id ()</title><programlisting><link linkend="GSource">GSource</link>*    g_main_context_find_source_by_id                                            (<link linkend="GMainContext">GMainContext</link> *context,                                             <link linkend="guint">guint</link> source_id);</programlisting><para>Finds a <link linkend="GSource">GSource</link> given a pair of context and ID</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2">

⌨️ 快捷键说明

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