re47.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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;GOptionGroup&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="re46.html" title="&lt;%GLibOptionFlags&gt;">
  10. <link rel="next" href="re48.html" title="&lt;GPatternSpec&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="re46.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
  20. <td><a accesskey="n" href="re48.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.48"></a><div class="titlepage"></div>
  24. <div class="refnamediv">
  25. <h2>&lt;GOptionGroup&gt;</h2>
  26. <p>&lt;GOptionGroup&gt;</p>
  27. </div>
  28. <div class="refsect1">
  29. <a name="id-1.1.48.2"></a><h2>Description</h2>
  30. <p>A <code class="code">GOptionGroup</code> struct defines the options in a single
  31. group. The struct has only private fields and should not be directly accessed.
  32. </p>
  33. <p>All options in a group share the same translation function. Libraries which
  34. need to parse commandline options are expected to provide a function for
  35. getting a <code class="code">GOptionGroup</code> holding their options, which
  36. the application can then add to its <span class="type">GOptionContext</span>.</p>
  37. </div>
  38. <div class="refsect1">
  39. <a name="id-1.1.48.3"></a><h2>Functions</h2>
  40. <div class="refsect2">
  41. <a name="id-1.1.48.3.2"></a><h3>free</h3>
  42. <div class="informalexample"><pre class="programlisting">(define-values () (option-group:free self))
  43. </pre></div>
  44. <p>Frees a <span class="type">GOptionGroup</span>. Note that you must not free groups
  45. which have been added to a <span class="type">GOptionContext</span>.</p>
  46. <div class="refsect3">
  47. <a name="id-1.1.48.3.2.4"></a><h4>Parameters</h4>
  48. <div class="informaltable"><table><tr>
  49. <td class="parameter_name"><p>group</p></td>
  50. <td class="parameter_description">
  51. <p>a <span class="type">GOptionGroup</span></p>
  52. <p>Passed as <code class="code">self</code></p>
  53. </td>
  54. </tr></table></div>
  55. </div>
  56. </div>
  57. <div class="refsect2">
  58. <a name="id-1.1.48.3.3"></a><h3>ref</h3>
  59. <div class="informalexample"><pre class="programlisting">(define-values (%return) (option-group:ref self))
  60. </pre></div>
  61. <p>Increments the reference count of <em class="parameter"><code>group</code></em> by one.</p>
  62. <div class="refsect3">
  63. <a name="id-1.1.48.3.3.4"></a><h4>Parameters</h4>
  64. <div class="informaltable"><table><tr>
  65. <td class="parameter_name"><p>group</p></td>
  66. <td class="parameter_description">
  67. <p>a <span class="type">GOptionGroup</span></p>
  68. <p>Passed as <code class="code">self</code></p>
  69. </td>
  70. </tr></table></div>
  71. </div>
  72. </div>
  73. <div class="refsect2">
  74. <a name="id-1.1.48.3.4"></a><h3>set-translate-func</h3>
  75. <div class="informalexample"><pre class="programlisting">(define-values
  76. ()
  77. (option-group:set-translate-func self func data destroy-notify))
  78. </pre></div>
  79. <p>Sets the function which is used to translate user-visible strings,
  80. for <code class="code">--help</code> output. Different groups can use different
  81. <span class="type">GTranslateFuncs</span>. If <em class="parameter"><code>func</code></em> is <code class="constant">NULL</code>, strings are not translated.
  82. </p>
  83. <p>If you are using <code class="function">gettext()</code>, you only need to set the translation
  84. domain, see <code class="function">g_option_group_set_translation_domain()</code>.</p>
  85. <div class="refsect3">
  86. <a name="id-1.1.48.3.4.5"></a><h4>Parameters</h4>
  87. <div class="informaltable"><table>
  88. <tr>
  89. <td class="parameter_name"><p>group</p></td>
  90. <td class="parameter_description">
  91. <p>a <span class="type">GOptionGroup</span></p>
  92. <p>Passed as <code class="code">self</code></p>
  93. </td>
  94. </tr>
  95. <tr>
  96. <td class="parameter_name"><p>func</p></td>
  97. <td class="parameter_description">
  98. <p>the <span class="type">GTranslateFunc</span>, or <code class="constant">NULL</code></p>
  99. <p>Passed as <code class="code">func</code></p>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td class="parameter_name"><p>data</p></td>
  104. <td class="parameter_description">
  105. <p>user data to pass to <em class="parameter"><code>func</code></em>, or <code class="constant">NULL</code></p>
  106. <p>Passed as <code class="code">data</code></p>
  107. </td>
  108. </tr>
  109. <tr>
  110. <td class="parameter_name"><p>destroy_notify</p></td>
  111. <td class="parameter_description">
  112. <p>a function which gets called to free <em class="parameter"><code>data</code></em>, or <code class="constant">NULL</code></p>
  113. <p>Passed as <code class="code">destroy-notify</code></p>
  114. </td>
  115. </tr>
  116. </table></div>
  117. </div>
  118. </div>
  119. <div class="refsect2">
  120. <a name="id-1.1.48.3.5"></a><h3>set-translation-domain</h3>
  121. <div class="informalexample"><pre class="programlisting">(define-values () (option-group:set-translation-domain self domain))
  122. </pre></div>
  123. <p>A convenience function to use <code class="function">gettext()</code> for translating
  124. user-visible strings.</p>
  125. <div class="refsect3">
  126. <a name="id-1.1.48.3.5.4"></a><h4>Parameters</h4>
  127. <div class="informaltable"><table>
  128. <tr>
  129. <td class="parameter_name"><p>group</p></td>
  130. <td class="parameter_description">
  131. <p>a <span class="type">GOptionGroup</span></p>
  132. <p>Passed as <code class="code">self</code></p>
  133. </td>
  134. </tr>
  135. <tr>
  136. <td class="parameter_name"><p>domain</p></td>
  137. <td class="parameter_description">
  138. <p>the domain to use</p>
  139. <p>Passed as <code class="code">domain</code></p>
  140. </td>
  141. </tr>
  142. </table></div>
  143. </div>
  144. </div>
  145. <div class="refsect2">
  146. <a name="id-1.1.48.3.6"></a><h3>unref</h3>
  147. <div class="informalexample"><pre class="programlisting">(define-values () (option-group:unref self))
  148. </pre></div>
  149. <p>Decrements the reference count of <em class="parameter"><code>group</code></em> by one.
  150. If the reference count drops to 0, the <em class="parameter"><code>group</code></em> will be freed.
  151. and all memory allocated by the <em class="parameter"><code>group</code></em> is released.</p>
  152. <div class="refsect3">
  153. <a name="id-1.1.48.3.6.4"></a><h4>Parameters</h4>
  154. <div class="informaltable"><table><tr>
  155. <td class="parameter_name"><p>group</p></td>
  156. <td class="parameter_description">
  157. <p>a <span class="type">GOptionGroup</span></p>
  158. <p>Passed as <code class="code">self</code></p>
  159. </td>
  160. </tr></table></div>
  161. </div>
  162. </div>
  163. <div class="refsect2">
  164. <a name="id-1.1.48.3.7"></a><h3>option-group:new</h3>
  165. <div class="informalexample"><pre class="programlisting">(define-values
  166. (%return)
  167. (option-group:new name description help-description user-data destroy))
  168. </pre></div>
  169. <p>Undocumented</p>
  170. <div class="refsect3">
  171. <a name="id-1.1.48.3.7.4"></a><h4>Parameters</h4>
  172. <div class="informaltable"><table>
  173. <tr>
  174. <td class="parameter_name"><p>name</p></td>
  175. <td class="parameter_description">
  176. <p></p>
  177. <p>Passed as <code class="code">name</code></p>
  178. </td>
  179. </tr>
  180. <tr>
  181. <td class="parameter_name"><p>description</p></td>
  182. <td class="parameter_description">
  183. <p></p>
  184. <p>Passed as <code class="code">description</code></p>
  185. </td>
  186. </tr>
  187. <tr>
  188. <td class="parameter_name"><p>help_description</p></td>
  189. <td class="parameter_description">
  190. <p></p>
  191. <p>Passed as <code class="code">help-description</code></p>
  192. </td>
  193. </tr>
  194. <tr>
  195. <td class="parameter_name"><p>user_data</p></td>
  196. <td class="parameter_description">
  197. <p></p>
  198. <p>Passed as <code class="code">user-data</code></p>
  199. </td>
  200. </tr>
  201. <tr>
  202. <td class="parameter_name"><p>destroy</p></td>
  203. <td class="parameter_description">
  204. <p></p>
  205. <p>Passed as <code class="code">destroy</code></p>
  206. </td>
  207. </tr>
  208. </table></div>
  209. </div>
  210. </div>
  211. </div>
  212. </div>
  213. <div class="footer">
  214. <hr>Generated by GTK-Doc V1.33.1</div>
  215. </body>
  216. </html>