re34.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>&lt;GMainLoop&gt;: </title>
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
  7. <link rel="home" href="index.html" title="">
  8. <link rel="up" href="ch01.html" title="GLib">
  9. <link rel="prev" href="re33.html" title="&lt;GMainContext&gt;">
  10. <link rel="next" href="re35.html" title="&lt;GMappedFile&gt;">
  11. <meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
  12. <link rel="stylesheet" href="style.css" type="text/css">
  13. </head>
  14. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  15. <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
  16. <td width="100%" align="left" class="shortcuts"></td>
  17. <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
  18. <td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
  19. <td><a accesskey="p" href="re33.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
  20. <td><a accesskey="n" href="re35.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
  21. </tr></table>
  22. <div class="refentry">
  23. <a name="id-1.1.35"></a><div class="titlepage"></div>
  24. <div class="refnamediv">
  25. <h2>&lt;GMainLoop&gt;</h2>
  26. <p>&lt;GMainLoop&gt;</p>
  27. </div>
  28. <div class="refsect1">
  29. <a name="id-1.1.35.2"></a><h2>Description</h2>
  30. <p>The <code class="code">GMainLoop</code> struct is an opaque data type
  31. representing the main event loop of a GLib or GTK+ application.</p>
  32. </div>
  33. <div class="refsect1">
  34. <a name="id-1.1.35.3"></a><h2>Functions</h2>
  35. <div class="refsect2">
  36. <a name="id-1.1.35.3.2"></a><h3>get-context</h3>
  37. <div class="informalexample"><pre class="programlisting">(define-values (%return) (main-loop:get-context self))
  38. </pre></div>
  39. <p>Returns the <span class="type">GMainContext</span> of <em class="parameter"><code>loop</code></em>.</p>
  40. <div class="refsect3">
  41. <a name="id-1.1.35.3.2.4"></a><h4>Parameters</h4>
  42. <div class="informaltable"><table><tr>
  43. <td class="parameter_name"><p>loop</p></td>
  44. <td class="parameter_description">
  45. <p>a <span class="type">GMainLoop</span>.</p>
  46. <p>Passed as <code class="code">self</code></p>
  47. </td>
  48. </tr></table></div>
  49. </div>
  50. </div>
  51. <div class="refsect2">
  52. <a name="id-1.1.35.3.3"></a><h3>is-running?</h3>
  53. <div class="informalexample"><pre class="programlisting">(define-values (%return) (main-loop:is-running? self))
  54. </pre></div>
  55. <p>Checks to see if the main loop is currently being run via <code class="function">g_main_loop_run()</code>.</p>
  56. <div class="refsect3">
  57. <a name="id-1.1.35.3.3.4"></a><h4>Parameters</h4>
  58. <div class="informaltable"><table><tr>
  59. <td class="parameter_name"><p>loop</p></td>
  60. <td class="parameter_description">
  61. <p>a <span class="type">GMainLoop</span>.</p>
  62. <p>Passed as <code class="code">self</code></p>
  63. </td>
  64. </tr></table></div>
  65. </div>
  66. </div>
  67. <div class="refsect2">
  68. <a name="id-1.1.35.3.4"></a><h3>quit</h3>
  69. <div class="informalexample"><pre class="programlisting">(define-values () (main-loop:quit self))
  70. </pre></div>
  71. <p>Stops a <span class="type">GMainLoop</span> from running. Any calls to <code class="function">g_main_loop_run()</code>
  72. for the loop will return.
  73. </p>
  74. <p>Note that sources that have already been dispatched when
  75. <code class="function">g_main_loop_quit()</code> is called will still be executed.</p>
  76. <div class="refsect3">
  77. <a name="id-1.1.35.3.4.5"></a><h4>Parameters</h4>
  78. <div class="informaltable"><table><tr>
  79. <td class="parameter_name"><p>loop</p></td>
  80. <td class="parameter_description">
  81. <p>a <span class="type">GMainLoop</span></p>
  82. <p>Passed as <code class="code">self</code></p>
  83. </td>
  84. </tr></table></div>
  85. </div>
  86. </div>
  87. <div class="refsect2">
  88. <a name="id-1.1.35.3.5"></a><h3>ref</h3>
  89. <div class="informalexample"><pre class="programlisting">(define-values (%return) (main-loop:ref self))
  90. </pre></div>
  91. <p>Increases the reference count on a <span class="type">GMainLoop</span> object by one.</p>
  92. <div class="refsect3">
  93. <a name="id-1.1.35.3.5.4"></a><h4>Parameters</h4>
  94. <div class="informaltable"><table><tr>
  95. <td class="parameter_name"><p>loop</p></td>
  96. <td class="parameter_description">
  97. <p>a <span class="type">GMainLoop</span></p>
  98. <p>Passed as <code class="code">self</code></p>
  99. </td>
  100. </tr></table></div>
  101. </div>
  102. </div>
  103. <div class="refsect2">
  104. <a name="id-1.1.35.3.6"></a><h3>run</h3>
  105. <div class="informalexample"><pre class="programlisting">(define-values () (main-loop:run self))
  106. </pre></div>
  107. <p>Runs a main loop until <code class="function">g_main_loop_quit()</code> is called on the loop.
  108. If this is called for the thread of the loop's <span class="type">GMainContext</span>,
  109. it will process events from the loop, otherwise it will
  110. simply wait.</p>
  111. <div class="refsect3">
  112. <a name="id-1.1.35.3.6.4"></a><h4>Parameters</h4>
  113. <div class="informaltable"><table><tr>
  114. <td class="parameter_name"><p>loop</p></td>
  115. <td class="parameter_description">
  116. <p>a <span class="type">GMainLoop</span></p>
  117. <p>Passed as <code class="code">self</code></p>
  118. </td>
  119. </tr></table></div>
  120. </div>
  121. </div>
  122. <div class="refsect2">
  123. <a name="id-1.1.35.3.7"></a><h3>unref</h3>
  124. <div class="informalexample"><pre class="programlisting">(define-values () (main-loop:unref self))
  125. </pre></div>
  126. <p>Decreases the reference count on a <span class="type">GMainLoop</span> object by one. If
  127. the result is zero, free the loop and free all associated memory.</p>
  128. <div class="refsect3">
  129. <a name="id-1.1.35.3.7.4"></a><h4>Parameters</h4>
  130. <div class="informaltable"><table><tr>
  131. <td class="parameter_name"><p>loop</p></td>
  132. <td class="parameter_description">
  133. <p>a <span class="type">GMainLoop</span></p>
  134. <p>Passed as <code class="code">self</code></p>
  135. </td>
  136. </tr></table></div>
  137. </div>
  138. </div>
  139. <div class="refsect2">
  140. <a name="id-1.1.35.3.8"></a><h3>main-loop:new</h3>
  141. <div class="informalexample"><pre class="programlisting">(define-values (%return) (main-loop:new context is-running))
  142. </pre></div>
  143. <p>Undocumented</p>
  144. <div class="refsect3">
  145. <a name="id-1.1.35.3.8.4"></a><h4>Parameters</h4>
  146. <div class="informaltable"><table>
  147. <tr>
  148. <td class="parameter_name"><p>context</p></td>
  149. <td class="parameter_description">
  150. <p></p>
  151. <p>Passed as <code class="code">context</code></p>
  152. </td>
  153. </tr>
  154. <tr>
  155. <td class="parameter_name"><p>is_running</p></td>
  156. <td class="parameter_description">
  157. <p></p>
  158. <p>Passed as <code class="code">is-running</code></p>
  159. </td>
  160. </tr>
  161. </table></div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <div class="footer">
  167. <hr>Generated by GTK-Doc V1.33.1</div>
  168. </body>
  169. </html>