Imported Upstream version 2.50.2
[platform/upstream/glib.git] / docs / reference / gio / html / GMenuModel.html
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>GMenuModel: GIO Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="application.html" title="Application support">
9 <link rel="prev" href="GDBusActionGroup.html" title="GDBusActionGroup">
10 <link rel="next" href="GMenu.html" title="GMenu">
11 <meta name="generator" content="GTK-Doc V1.25.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">
17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
18                   <a href="#GMenuModel.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
19                   <a href="#GMenuModel.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_signals">  <span class="dim">|</span> 
20                   <a href="#GMenuModel.signals" class="shortcut">Signals</a></span>
21 </td>
22 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
23 <td><a accesskey="u" href="application.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
24 <td><a accesskey="p" href="GDBusActionGroup.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
25 <td><a accesskey="n" href="GMenu.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
26 </tr></table>
27 <div class="refentry">
28 <a name="GMenuModel"></a><div class="titlepage"></div>
29 <div class="refnamediv"><table width="100%"><tr>
30 <td valign="top">
31 <h2><span class="refentrytitle"><a name="GMenuModel.top_of_page"></a>GMenuModel</span></h2>
32 <p>GMenuModel — An abstract class representing the contents of a menu</p>
33 </td>
34 <td class="gallery_image" valign="top" align="right"></td>
35 </tr></table></div>
36 <div class="refsect1">
37 <a name="GMenuModel.functions"></a><h2>Functions</h2>
38 <div class="informaltable"><table class="informaltable" width="100%" border="0">
39 <colgroup>
40 <col width="150px" class="functions_return">
41 <col class="functions_name">
42 </colgroup>
43 <tbody>
44 <tr>
45 <td class="function_type">
46 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
47 </td>
48 <td class="function_name">
49 <a class="link" href="GMenuModel.html#g-menu-model-is-mutable" title="g_menu_model_is_mutable ()">g_menu_model_is_mutable</a> <span class="c_punctuation">()</span>
50 </td>
51 </tr>
52 <tr>
53 <td class="function_type">
54 <a href="../glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
55 </td>
56 <td class="function_name">
57 <a class="link" href="GMenuModel.html#g-menu-model-get-n-items" title="g_menu_model_get_n_items ()">g_menu_model_get_n_items</a> <span class="c_punctuation">()</span>
58 </td>
59 </tr>
60 <tr>
61 <td class="function_type">
62 <a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
63 </td>
64 <td class="function_name">
65 <a class="link" href="GMenuModel.html#g-menu-model-get-item-attribute-value" title="g_menu_model_get_item_attribute_value ()">g_menu_model_get_item_attribute_value</a> <span class="c_punctuation">()</span>
66 </td>
67 </tr>
68 <tr>
69 <td class="function_type">
70 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
71 </td>
72 <td class="function_name">
73 <a class="link" href="GMenuModel.html#g-menu-model-get-item-attribute" title="g_menu_model_get_item_attribute ()">g_menu_model_get_item_attribute</a> <span class="c_punctuation">()</span>
74 </td>
75 </tr>
76 <tr>
77 <td class="function_type">
78 <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="returnvalue">GMenuModel</span></a> *
79 </td>
80 <td class="function_name">
81 <a class="link" href="GMenuModel.html#g-menu-model-get-item-link" title="g_menu_model_get_item_link ()">g_menu_model_get_item_link</a> <span class="c_punctuation">()</span>
82 </td>
83 </tr>
84 <tr>
85 <td class="function_type">
86 <a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="returnvalue">GMenuAttributeIter</span></a> *
87 </td>
88 <td class="function_name">
89 <a class="link" href="GMenuModel.html#g-menu-model-iterate-item-attributes" title="g_menu_model_iterate_item_attributes ()">g_menu_model_iterate_item_attributes</a> <span class="c_punctuation">()</span>
90 </td>
91 </tr>
92 <tr>
93 <td class="function_type">
94 <a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="returnvalue">GMenuLinkIter</span></a> *
95 </td>
96 <td class="function_name">
97 <a class="link" href="GMenuModel.html#g-menu-model-iterate-item-links" title="g_menu_model_iterate_item_links ()">g_menu_model_iterate_item_links</a> <span class="c_punctuation">()</span>
98 </td>
99 </tr>
100 <tr>
101 <td class="function_type">
102 <span class="returnvalue">void</span>
103 </td>
104 <td class="function_name">
105 <a class="link" href="GMenuModel.html#g-menu-model-items-changed" title="g_menu_model_items_changed ()">g_menu_model_items_changed</a> <span class="c_punctuation">()</span>
106 </td>
107 </tr>
108 <tr>
109 <td class="function_type">
110 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
111 </td>
112 <td class="function_name">
113 <a class="link" href="GMenuModel.html#g-menu-attribute-iter-get-next" title="g_menu_attribute_iter_get_next ()">g_menu_attribute_iter_get_next</a> <span class="c_punctuation">()</span>
114 </td>
115 </tr>
116 <tr>
117 <td class="function_type">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
118 </td>
119 <td class="function_name">
120 <a class="link" href="GMenuModel.html#g-menu-attribute-iter-get-name" title="g_menu_attribute_iter_get_name ()">g_menu_attribute_iter_get_name</a> <span class="c_punctuation">()</span>
121 </td>
122 </tr>
123 <tr>
124 <td class="function_type">
125 <a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
126 </td>
127 <td class="function_name">
128 <a class="link" href="GMenuModel.html#g-menu-attribute-iter-get-value" title="g_menu_attribute_iter_get_value ()">g_menu_attribute_iter_get_value</a> <span class="c_punctuation">()</span>
129 </td>
130 </tr>
131 <tr>
132 <td class="function_type">
133 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
134 </td>
135 <td class="function_name">
136 <a class="link" href="GMenuModel.html#g-menu-attribute-iter-next" title="g_menu_attribute_iter_next ()">g_menu_attribute_iter_next</a> <span class="c_punctuation">()</span>
137 </td>
138 </tr>
139 <tr>
140 <td class="function_type">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
141 </td>
142 <td class="function_name">
143 <a class="link" href="GMenuModel.html#g-menu-link-iter-get-name" title="g_menu_link_iter_get_name ()">g_menu_link_iter_get_name</a> <span class="c_punctuation">()</span>
144 </td>
145 </tr>
146 <tr>
147 <td class="function_type">
148 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
149 </td>
150 <td class="function_name">
151 <a class="link" href="GMenuModel.html#g-menu-link-iter-get-next" title="g_menu_link_iter_get_next ()">g_menu_link_iter_get_next</a> <span class="c_punctuation">()</span>
152 </td>
153 </tr>
154 <tr>
155 <td class="function_type">
156 <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="returnvalue">GMenuModel</span></a> *
157 </td>
158 <td class="function_name">
159 <a class="link" href="GMenuModel.html#g-menu-link-iter-get-value" title="g_menu_link_iter_get_value ()">g_menu_link_iter_get_value</a> <span class="c_punctuation">()</span>
160 </td>
161 </tr>
162 <tr>
163 <td class="function_type">
164 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
165 </td>
166 <td class="function_name">
167 <a class="link" href="GMenuModel.html#g-menu-link-iter-next" title="g_menu_link_iter_next ()">g_menu_link_iter_next</a> <span class="c_punctuation">()</span>
168 </td>
169 </tr>
170 </tbody>
171 </table></div>
172 </div>
173 <div class="refsect1">
174 <a name="GMenuModel.signals"></a><h2>Signals</h2>
175 <div class="informaltable"><table class="informaltable" border="0">
176 <colgroup>
177 <col width="150px" class="signals_return">
178 <col width="300px" class="signals_name">
179 <col width="200px" class="signals_flags">
180 </colgroup>
181 <tbody><tr>
182 <td class="signal_type"><span class="returnvalue">void</span></td>
183 <td class="signal_name"><a class="link" href="GMenuModel.html#GMenuModel-items-changed" title="The “items-changed” signal">items-changed</a></td>
184 <td class="signal_flags"><a href="../gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></td>
185 </tr></tbody>
186 </table></div>
187 </div>
188 <a name="GMenuAttributeIter"></a><a name="GMenuLinkIter"></a><div class="refsect1">
189 <a name="GMenuModel.other"></a><h2>Types and Values</h2>
190 <div class="informaltable"><table class="informaltable" width="100%" border="0">
191 <colgroup>
192 <col width="150px" class="name">
193 <col class="description">
194 </colgroup>
195 <tbody>
196 <tr>
197 <td class="datatype_keyword"> </td>
198 <td class="function_name"><a class="link" href="GMenuModel.html#GMenuModel-struct" title="GMenuModel">GMenuModel</a></td>
199 </tr>
200 <tr>
201 <td class="define_keyword">#define</td>
202 <td class="function_name"><a class="link" href="GMenuModel.html#G-MENU-ATTRIBUTE-ACTION:CAPS" title="G_MENU_ATTRIBUTE_ACTION">G_MENU_ATTRIBUTE_ACTION</a></td>
203 </tr>
204 <tr>
205 <td class="define_keyword">#define</td>
206 <td class="function_name"><a class="link" href="GMenuModel.html#G-MENU-ATTRIBUTE-ACTION-NAMESPACE:CAPS" title="G_MENU_ATTRIBUTE_ACTION_NAMESPACE">G_MENU_ATTRIBUTE_ACTION_NAMESPACE</a></td>
207 </tr>
208 <tr>
209 <td class="define_keyword">#define</td>
210 <td class="function_name"><a class="link" href="GMenuModel.html#G-MENU-ATTRIBUTE-TARGET:CAPS" title="G_MENU_ATTRIBUTE_TARGET">G_MENU_ATTRIBUTE_TARGET</a></td>
211 </tr>
212 <tr>
213 <td class="define_keyword">#define</td>
214 <td class="function_name"><a class="link" href="GMenuModel.html#G-MENU-ATTRIBUTE-LABEL:CAPS" title="G_MENU_ATTRIBUTE_LABEL">G_MENU_ATTRIBUTE_LABEL</a></td>
215 </tr>
216 <tr>
217 <td class="define_keyword">#define</td>
218 <td class="function_name"><a class="link" href="GMenuModel.html#G-MENU-ATTRIBUTE-ICON:CAPS" title="G_MENU_ATTRIBUTE_ICON">G_MENU_ATTRIBUTE_ICON</a></td>
219 </tr>
220 <tr>
221 <td class="define_keyword">#define</td>
222 <td class="function_name"><a class="link" href="GMenuModel.html#G-MENU-LINK-SECTION:CAPS" title="G_MENU_LINK_SECTION">G_MENU_LINK_SECTION</a></td>
223 </tr>
224 <tr>
225 <td class="define_keyword">#define</td>
226 <td class="function_name"><a class="link" href="GMenuModel.html#G-MENU-LINK-SUBMENU:CAPS" title="G_MENU_LINK_SUBMENU">G_MENU_LINK_SUBMENU</a></td>
227 </tr>
228 <tr>
229 <td class="datatype_keyword">struct</td>
230 <td class="function_name"><a class="link" href="GMenuModel.html#GMenuAttributeIter-struct" title="struct GMenuAttributeIter">GMenuAttributeIter</a></td>
231 </tr>
232 <tr>
233 <td class="datatype_keyword">struct</td>
234 <td class="function_name"><a class="link" href="GMenuModel.html#GMenuLinkIter-struct" title="struct GMenuLinkIter">GMenuLinkIter</a></td>
235 </tr>
236 </tbody>
237 </table></div>
238 </div>
239 <div class="refsect1">
240 <a name="GMenuModel.object-hierarchy"></a><h2>Object Hierarchy</h2>
241 <pre class="screen">    <a href="../gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
242     <span class="lineart">├──</span> GMenuAttributeIter
243     <span class="lineart">├──</span> GMenuLinkIter
244     <span class="lineart">╰──</span> GMenuModel
245         <span class="lineart">├──</span> <a class="link" href="GDBusMenuModel.html" title="GDBusMenuModel">GDBusMenuModel</a>
246         <span class="lineart">╰──</span> <a class="link" href="GMenu.html" title="GMenu">GMenu</a>
247 </pre>
248 </div>
249 <div class="refsect1">
250 <a name="GMenuModel.includes"></a><h2>Includes</h2>
251 <pre class="synopsis">#include &lt;gio/gio.h&gt;
252 </pre>
253 </div>
254 <div class="refsect1">
255 <a name="GMenuModel.description"></a><h2>Description</h2>
256 <p><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> represents the contents of a menu -- an ordered list of
257 menu items. The items are associated with actions, which can be
258 activated through them. Items can be grouped in sections, and may
259 have submenus associated with them. Both items and sections usually
260 have some representation data, such as labels or icons. The type of
261 the associated action (ie whether it is stateful, and what kind of
262 state it has) can influence the representation of the item.</p>
263 <p>The conceptual model of menus in <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> is hierarchical:
264 sections and submenus are again represented by <a href="GMenuModel.html#GMenuModel-struct"><span class="type">GMenuModels</span></a>.
265 Menus themselves do not define their own roles. Rather, the role
266 of a particular <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> is defined by the item that references
267 it (or, in the case of the 'root' menu, is defined by the context
268 in which it is used).</p>
269 <p>As an example, consider the visible portions of this menu:</p>
270 <div class="refsect3">
271 <a name="menu-example"></a><h4>An example menu</h4>
272 <p><span class="inlinemediaobject"><img src="menu-example.png"></span></p>
273 <p>There are 8 "menus" visible in the screenshot: one menubar, two
274 submenus and 5 sections:</p>
275 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
276 <li class="listitem"><p>the toplevel menubar (containing 4 items)</p></li>
277 <li class="listitem"><p>the View submenu (containing 3 sections)</p></li>
278 <li class="listitem"><p>the first section of the View submenu (containing 2 items)</p></li>
279 <li class="listitem"><p>the second section of the View submenu (containing 1 item)</p></li>
280 <li class="listitem"><p>the final section of the View submenu (containing 1 item)</p></li>
281 <li class="listitem"><p>the Highlight Mode submenu (containing 2 sections)</p></li>
282 <li class="listitem"><p>the Sources section (containing 2 items)</p></li>
283 <li class="listitem"><p>the Markup section (containing 2 items)</p></li>
284 </ul></div>
285 <p>The <a class="link" href="GMenuModel.html#menu-model" title="A menu example">example</a> illustrates the conceptual connection between
286 these 8 menus. Each large block in the figure represents a menu and the
287 smaller blocks within the large block represent items in that menu. Some
288 items contain references to other menus.</p>
289 </div>
290 <div class="refsect3">
291 <a name="menu-model"></a><h4>A menu example</h4>
292 <p><span class="inlinemediaobject"><img src="menu-model.png"></span></p>
293 <p>Notice that the separators visible in the <a class="link" href="GMenuModel.html#menu-example" title="An example menu">example</a>
294 appear nowhere in the <a class="link" href="GMenuModel.html#menu-model" title="A menu example">menu model</a>. This is because
295 separators are not explicitly represented in the menu model. Instead,
296 a separator is inserted between any two non-empty sections of a menu.
297 Section items can have labels just like any other item. In that case,
298 a display system may show a section header instead of a separator.</p>
299 <p>The motivation for this abstract model of application controls is
300 that modern user interfaces tend to make these controls available
301 outside the application. Examples include global menus, jumplists,
302 dash boards, etc. To support such uses, it is necessary to 'export'
303 information about actions and their representation in menus, which
304 is exactly what the <a class="link" href="gio-GActionGroup-exporter.html" title="GActionGroup exporter">GActionGroup exporter</a>
305 and the <a class="link" href="gio-GMenuModel-exporter.html" title="GMenuModel exporter">GMenuModel exporter</a> do for
306 <a class="link" href="GActionGroup.html" title="GActionGroup"><span class="type">GActionGroup</span></a> and <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a>. The client-side counterparts to
307 make use of the exported information are <a class="link" href="GDBusActionGroup.html" title="GDBusActionGroup"><span class="type">GDBusActionGroup</span></a> and
308 <a class="link" href="GDBusMenuModel.html" title="GDBusMenuModel"><span class="type">GDBusMenuModel</span></a>.</p>
309 <p>The API of <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> is very generic, with iterators for the
310 attributes and links of an item, see <a class="link" href="GMenuModel.html#g-menu-model-iterate-item-attributes" title="g_menu_model_iterate_item_attributes ()"><code class="function">g_menu_model_iterate_item_attributes()</code></a>
311 and <a class="link" href="GMenuModel.html#g-menu-model-iterate-item-links" title="g_menu_model_iterate_item_links ()"><code class="function">g_menu_model_iterate_item_links()</code></a>. The 'standard' attributes and
312 link types have predefined names: <a class="link" href="GMenuModel.html#G-MENU-ATTRIBUTE-LABEL:CAPS" title="G_MENU_ATTRIBUTE_LABEL"><code class="literal">G_MENU_ATTRIBUTE_LABEL</code></a>,
313 <a class="link" href="GMenuModel.html#G-MENU-ATTRIBUTE-ACTION:CAPS" title="G_MENU_ATTRIBUTE_ACTION"><code class="literal">G_MENU_ATTRIBUTE_ACTION</code></a>, <a class="link" href="GMenuModel.html#G-MENU-ATTRIBUTE-TARGET:CAPS" title="G_MENU_ATTRIBUTE_TARGET"><code class="literal">G_MENU_ATTRIBUTE_TARGET</code></a>, <a class="link" href="GMenuModel.html#G-MENU-LINK-SECTION:CAPS" title="G_MENU_LINK_SECTION"><code class="literal">G_MENU_LINK_SECTION</code></a>
314 and <a class="link" href="GMenuModel.html#G-MENU-LINK-SUBMENU:CAPS" title="G_MENU_LINK_SUBMENU"><code class="literal">G_MENU_LINK_SUBMENU</code></a>.</p>
315 <p>Items in a <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> represent active controls if they refer to
316 an action that can get activated when the user interacts with the
317 menu item. The reference to the action is encoded by the string id
318 in the <a class="link" href="GMenuModel.html#G-MENU-ATTRIBUTE-ACTION:CAPS" title="G_MENU_ATTRIBUTE_ACTION"><code class="literal">G_MENU_ATTRIBUTE_ACTION</code></a> attribute. An action id uniquely
319 identifies an action in an action group. Which action group(s) provide
320 actions depends on the context in which the menu model is used.
321 E.g. when the model is exported as the application menu of a
322 <a href="http://developer.gnome.org/gtk4/GtkApplication.html#GtkApplication-struct"><span class="type">GtkApplication</span></a>, actions can be application-wide or window-specific
323 (and thus come from two different action groups). By convention, the
324 application-wide actions have names that start with "app.", while the
325 names of window-specific actions start with "win.".</p>
326 <p>While a wide variety of stateful actions is possible, the following
327 is the minimum that is expected to be supported by all users of exported
328 menu information:</p>
329 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
330 <li class="listitem"><p>an action with no parameter type and no state</p></li>
331 <li class="listitem"><p>an action with no parameter type and boolean state</p></li>
332 <li class="listitem"><p>an action with string parameter type and string state</p></li>
333 </ul></div>
334 </div>
335 <div class="refsect3">
336 <a name="id-1.4.24.13.10.7"></a><h4>Stateless</h4>
337 <p>A stateless action typically corresponds to an ordinary menu item.</p>
338 <p>Selecting such a menu item will activate the action (with no parameter).</p>
339 </div>
340 <div class="refsect3">
341 <a name="id-1.4.24.13.10.8"></a><h4>Boolean State</h4>
342 <p>An action with a boolean state will most typically be used with a "toggle"
343 or "switch" menu item. The state can be set directly, but activating the
344 action (with no parameter) results in the state being toggled.</p>
345 <p>Selecting a toggle menu item will activate the action. The menu item should
346 be rendered as "checked" when the state is true.</p>
347 </div>
348 <div class="refsect3">
349 <a name="id-1.4.24.13.10.9"></a><h4>String Parameter and State</h4>
350 <p>Actions with string parameters and state will most typically be used to
351 represent an enumerated choice over the items available for a group of
352 radio menu items. Activating the action with a string parameter is
353 equivalent to setting that parameter as the state.</p>
354 <p>Radio menu items, in addition to being associated with the action, will
355 have a target value. Selecting that menu item will result in activation
356 of the action with the target value as the parameter. The menu item should
357 be rendered as "selected" when the state of the action is equal to the
358 target value of the menu item.</p>
359 </div>
360 </div>
361 <div class="refsect1">
362 <a name="GMenuModel.functions_details"></a><h2>Functions</h2>
363 <div class="refsect2">
364 <a name="g-menu-model-is-mutable"></a><h3>g_menu_model_is_mutable ()</h3>
365 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
366 g_menu_model_is_mutable (<em class="parameter"><code><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> *model</code></em>);</pre>
367 <p>Queries if <em class="parameter"><code>model</code></em>
368  is mutable.</p>
369 <p>An immutable <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> will never emit the <a class="link" href="GMenuModel.html#GMenuModel-items-changed" title="The “items-changed” signal"><span class="type">“items-changed”</span></a>
370 signal. Consumers of the model may make optimisations accordingly.</p>
371 <div class="refsect3">
372 <a name="g-menu-model-is-mutable.parameters"></a><h4>Parameters</h4>
373 <div class="informaltable"><table class="informaltable" width="100%" border="0">
374 <colgroup>
375 <col width="150px" class="parameters_name">
376 <col class="parameters_description">
377 <col width="200px" class="parameters_annotations">
378 </colgroup>
379 <tbody><tr>
380 <td class="parameter_name"><p>model</p></td>
381 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a></p></td>
382 <td class="parameter_annotations"> </td>
383 </tr></tbody>
384 </table></div>
385 </div>
386 <div class="refsect3">
387 <a name="g-menu-model-is-mutable.returns"></a><h4>Returns</h4>
388 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the model is mutable (ie: "items-changed" may be
389 emitted).</p>
390 </div>
391 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
392 </div>
393 <hr>
394 <div class="refsect2">
395 <a name="g-menu-model-get-n-items"></a><h3>g_menu_model_get_n_items ()</h3>
396 <pre class="programlisting"><a href="../glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
397 g_menu_model_get_n_items (<em class="parameter"><code><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> *model</code></em>);</pre>
398 <p>Query the number of items in <em class="parameter"><code>model</code></em>
399 .</p>
400 <div class="refsect3">
401 <a name="g-menu-model-get-n-items.parameters"></a><h4>Parameters</h4>
402 <div class="informaltable"><table class="informaltable" width="100%" border="0">
403 <colgroup>
404 <col width="150px" class="parameters_name">
405 <col class="parameters_description">
406 <col width="200px" class="parameters_annotations">
407 </colgroup>
408 <tbody><tr>
409 <td class="parameter_name"><p>model</p></td>
410 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a></p></td>
411 <td class="parameter_annotations"> </td>
412 </tr></tbody>
413 </table></div>
414 </div>
415 <div class="refsect3">
416 <a name="g-menu-model-get-n-items.returns"></a><h4>Returns</h4>
417 <p> the number of items</p>
418 </div>
419 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
420 </div>
421 <hr>
422 <div class="refsect2">
423 <a name="g-menu-model-get-item-attribute-value"></a><h3>g_menu_model_get_item_attribute_value ()</h3>
424 <pre class="programlisting"><a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
425 g_menu_model_get_item_attribute_value (<em class="parameter"><code><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> *model</code></em>,
426                                        <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> item_index</code></em>,
427                                        <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *attribute</code></em>,
428                                        <em class="parameter"><code>const <a href="../glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> *expected_type</code></em>);</pre>
429 <p>Queries the item at position <em class="parameter"><code>item_index</code></em>
430  in <em class="parameter"><code>model</code></em>
431  for the attribute
432 specified by <em class="parameter"><code>attribute</code></em>
433 .</p>
434 <p>If <em class="parameter"><code>expected_type</code></em>
435  is non-<a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then it specifies the expected type of
436 the attribute.  If it is <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then any type will be accepted.</p>
437 <p>If the attribute exists and matches <em class="parameter"><code>expected_type</code></em>
438  (or if the
439 expected type is unspecified) then the value is returned.</p>
440 <p>If the attribute does not exist, or does not match the expected type
441 then <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned.</p>
442 <div class="refsect3">
443 <a name="g-menu-model-get-item-attribute-value.parameters"></a><h4>Parameters</h4>
444 <div class="informaltable"><table class="informaltable" width="100%" border="0">
445 <colgroup>
446 <col width="150px" class="parameters_name">
447 <col class="parameters_description">
448 <col width="200px" class="parameters_annotations">
449 </colgroup>
450 <tbody>
451 <tr>
452 <td class="parameter_name"><p>model</p></td>
453 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a></p></td>
454 <td class="parameter_annotations"> </td>
455 </tr>
456 <tr>
457 <td class="parameter_name"><p>item_index</p></td>
458 <td class="parameter_description"><p>the index of the item</p></td>
459 <td class="parameter_annotations"> </td>
460 </tr>
461 <tr>
462 <td class="parameter_name"><p>attribute</p></td>
463 <td class="parameter_description"><p>the attribute to query</p></td>
464 <td class="parameter_annotations"> </td>
465 </tr>
466 <tr>
467 <td class="parameter_name"><p>expected_type</p></td>
468 <td class="parameter_description"><p> the expected type of the attribute, or
469 <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
470 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
471 </tr>
472 </tbody>
473 </table></div>
474 </div>
475 <div class="refsect3">
476 <a name="g-menu-model-get-item-attribute-value.returns"></a><h4>Returns</h4>
477 <p> the value of the attribute. </p>
478 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
479 </div>
480 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
481 </div>
482 <hr>
483 <div class="refsect2">
484 <a name="g-menu-model-get-item-attribute"></a><h3>g_menu_model_get_item_attribute ()</h3>
485 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
486 g_menu_model_get_item_attribute (<em class="parameter"><code><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> *model</code></em>,
487                                  <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> item_index</code></em>,
488                                  <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *attribute</code></em>,
489                                  <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format_string</code></em>,
490                                  <em class="parameter"><code>...</code></em>);</pre>
491 <p>Queries item at position <em class="parameter"><code>item_index</code></em>
492  in <em class="parameter"><code>model</code></em>
493  for the attribute
494 specified by <em class="parameter"><code>attribute</code></em>
495 .</p>
496 <p>If the attribute exists and matches the <a href="../glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> corresponding
497 to <em class="parameter"><code>format_string</code></em>
498  then <em class="parameter"><code>format_string</code></em>
499  is used to deconstruct the
500 value into the positional parameters and <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned.</p>
501 <p>If the attribute does not exist, or it does exist but has the wrong
502 type, then the positional parameters are ignored and <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is
503 returned.</p>
504 <p>This function is a mix of <a class="link" href="GMenuModel.html#g-menu-model-get-item-attribute-value" title="g_menu_model_get_item_attribute_value ()"><code class="function">g_menu_model_get_item_attribute_value()</code></a> and
505 <a href="../glib-GVariant.html#g-variant-get"><code class="function">g_variant_get()</code></a>, followed by a <a href="../glib-GVariant.html#g-variant-unref"><code class="function">g_variant_unref()</code></a>.  As such,
506 <em class="parameter"><code>format_string</code></em>
507  must make a complete copy of the data (since the
508 <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> may go away after the call to <a href="../glib-GVariant.html#g-variant-unref"><code class="function">g_variant_unref()</code></a>).  In
509 particular, no '&amp;' characters are allowed in <em class="parameter"><code>format_string</code></em>
510 .</p>
511 <div class="refsect3">
512 <a name="g-menu-model-get-item-attribute.parameters"></a><h4>Parameters</h4>
513 <div class="informaltable"><table class="informaltable" width="100%" border="0">
514 <colgroup>
515 <col width="150px" class="parameters_name">
516 <col class="parameters_description">
517 <col width="200px" class="parameters_annotations">
518 </colgroup>
519 <tbody>
520 <tr>
521 <td class="parameter_name"><p>model</p></td>
522 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a></p></td>
523 <td class="parameter_annotations"> </td>
524 </tr>
525 <tr>
526 <td class="parameter_name"><p>item_index</p></td>
527 <td class="parameter_description"><p>the index of the item</p></td>
528 <td class="parameter_annotations"> </td>
529 </tr>
530 <tr>
531 <td class="parameter_name"><p>attribute</p></td>
532 <td class="parameter_description"><p>the attribute to query</p></td>
533 <td class="parameter_annotations"> </td>
534 </tr>
535 <tr>
536 <td class="parameter_name"><p>format_string</p></td>
537 <td class="parameter_description"><p>a <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> format string</p></td>
538 <td class="parameter_annotations"> </td>
539 </tr>
540 <tr>
541 <td class="parameter_name"><p>...</p></td>
542 <td class="parameter_description"><p>positional parameters, as per <em class="parameter"><code>format_string</code></em>
543 </p></td>
544 <td class="parameter_annotations"> </td>
545 </tr>
546 </tbody>
547 </table></div>
548 </div>
549 <div class="refsect3">
550 <a name="g-menu-model-get-item-attribute.returns"></a><h4>Returns</h4>
551 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the named attribute was found with the expected
552 type</p>
553 </div>
554 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
555 </div>
556 <hr>
557 <div class="refsect2">
558 <a name="g-menu-model-get-item-link"></a><h3>g_menu_model_get_item_link ()</h3>
559 <pre class="programlisting"><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="returnvalue">GMenuModel</span></a> *
560 g_menu_model_get_item_link (<em class="parameter"><code><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> *model</code></em>,
561                             <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> item_index</code></em>,
562                             <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *link</code></em>);</pre>
563 <p>Queries the item at position <em class="parameter"><code>item_index</code></em>
564  in <em class="parameter"><code>model</code></em>
565  for the link
566 specified by <em class="parameter"><code>link</code></em>
567 .</p>
568 <p>If the link exists, the linked <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> is returned.  If the link
569 does not exist, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned.</p>
570 <div class="refsect3">
571 <a name="g-menu-model-get-item-link.parameters"></a><h4>Parameters</h4>
572 <div class="informaltable"><table class="informaltable" width="100%" border="0">
573 <colgroup>
574 <col width="150px" class="parameters_name">
575 <col class="parameters_description">
576 <col width="200px" class="parameters_annotations">
577 </colgroup>
578 <tbody>
579 <tr>
580 <td class="parameter_name"><p>model</p></td>
581 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a></p></td>
582 <td class="parameter_annotations"> </td>
583 </tr>
584 <tr>
585 <td class="parameter_name"><p>item_index</p></td>
586 <td class="parameter_description"><p>the index of the item</p></td>
587 <td class="parameter_annotations"> </td>
588 </tr>
589 <tr>
590 <td class="parameter_name"><p>link</p></td>
591 <td class="parameter_description"><p>the link to query</p></td>
592 <td class="parameter_annotations"> </td>
593 </tr>
594 </tbody>
595 </table></div>
596 </div>
597 <div class="refsect3">
598 <a name="g-menu-model-get-item-link.returns"></a><h4>Returns</h4>
599 <p> the linked <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p>
600 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
601 </div>
602 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
603 </div>
604 <hr>
605 <div class="refsect2">
606 <a name="g-menu-model-iterate-item-attributes"></a><h3>g_menu_model_iterate_item_attributes ()</h3>
607 <pre class="programlisting"><a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="returnvalue">GMenuAttributeIter</span></a> *
608 g_menu_model_iterate_item_attributes (<em class="parameter"><code><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> *model</code></em>,
609                                       <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> item_index</code></em>);</pre>
610 <p>Creates a <a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a> to iterate over the attributes of
611 the item at position <em class="parameter"><code>item_index</code></em>
612  in <em class="parameter"><code>model</code></em>
613 .</p>
614 <p>You must free the iterator with <a href="../gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> when you are done.</p>
615 <div class="refsect3">
616 <a name="g-menu-model-iterate-item-attributes.parameters"></a><h4>Parameters</h4>
617 <div class="informaltable"><table class="informaltable" width="100%" border="0">
618 <colgroup>
619 <col width="150px" class="parameters_name">
620 <col class="parameters_description">
621 <col width="200px" class="parameters_annotations">
622 </colgroup>
623 <tbody>
624 <tr>
625 <td class="parameter_name"><p>model</p></td>
626 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a></p></td>
627 <td class="parameter_annotations"> </td>
628 </tr>
629 <tr>
630 <td class="parameter_name"><p>item_index</p></td>
631 <td class="parameter_description"><p>the index of the item</p></td>
632 <td class="parameter_annotations"> </td>
633 </tr>
634 </tbody>
635 </table></div>
636 </div>
637 <div class="refsect3">
638 <a name="g-menu-model-iterate-item-attributes.returns"></a><h4>Returns</h4>
639 <p> a new <a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a>. </p>
640 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
641 </div>
642 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
643 </div>
644 <hr>
645 <div class="refsect2">
646 <a name="g-menu-model-iterate-item-links"></a><h3>g_menu_model_iterate_item_links ()</h3>
647 <pre class="programlisting"><a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="returnvalue">GMenuLinkIter</span></a> *
648 g_menu_model_iterate_item_links (<em class="parameter"><code><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> *model</code></em>,
649                                  <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> item_index</code></em>);</pre>
650 <p>Creates a <a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a> to iterate over the links of the item at
651 position <em class="parameter"><code>item_index</code></em>
652  in <em class="parameter"><code>model</code></em>
653 .</p>
654 <p>You must free the iterator with <a href="../gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> when you are done.</p>
655 <div class="refsect3">
656 <a name="g-menu-model-iterate-item-links.parameters"></a><h4>Parameters</h4>
657 <div class="informaltable"><table class="informaltable" width="100%" border="0">
658 <colgroup>
659 <col width="150px" class="parameters_name">
660 <col class="parameters_description">
661 <col width="200px" class="parameters_annotations">
662 </colgroup>
663 <tbody>
664 <tr>
665 <td class="parameter_name"><p>model</p></td>
666 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a></p></td>
667 <td class="parameter_annotations"> </td>
668 </tr>
669 <tr>
670 <td class="parameter_name"><p>item_index</p></td>
671 <td class="parameter_description"><p>the index of the item</p></td>
672 <td class="parameter_annotations"> </td>
673 </tr>
674 </tbody>
675 </table></div>
676 </div>
677 <div class="refsect3">
678 <a name="g-menu-model-iterate-item-links.returns"></a><h4>Returns</h4>
679 <p> a new <a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a>. </p>
680 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
681 </div>
682 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
683 </div>
684 <hr>
685 <div class="refsect2">
686 <a name="g-menu-model-items-changed"></a><h3>g_menu_model_items_changed ()</h3>
687 <pre class="programlisting"><span class="returnvalue">void</span>
688 g_menu_model_items_changed (<em class="parameter"><code><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> *model</code></em>,
689                             <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>,
690                             <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> removed</code></em>,
691                             <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> added</code></em>);</pre>
692 <p>Requests emission of the <a class="link" href="GMenuModel.html#GMenuModel-items-changed" title="The “items-changed” signal"><span class="type">“items-changed”</span></a> signal on <em class="parameter"><code>model</code></em>
693 .</p>
694 <p>This function should never be called except by <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a>
695 subclasses.  Any other calls to this function will very likely lead
696 to a violation of the interface of the model.</p>
697 <p>The implementation should update its internal representation of the
698 menu before emitting the signal.  The implementation should further
699 expect to receive queries about the new state of the menu (and
700 particularly added menu items) while signal handlers are running.</p>
701 <p>The implementation must dispatch this call directly from a mainloop
702 entry and not in response to calls -- particularly those from the
703 <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> API.  Said another way: the menu must not change while
704 user code is running without returning to the mainloop.</p>
705 <div class="refsect3">
706 <a name="g-menu-model-items-changed.parameters"></a><h4>Parameters</h4>
707 <div class="informaltable"><table class="informaltable" width="100%" border="0">
708 <colgroup>
709 <col width="150px" class="parameters_name">
710 <col class="parameters_description">
711 <col width="200px" class="parameters_annotations">
712 </colgroup>
713 <tbody>
714 <tr>
715 <td class="parameter_name"><p>model</p></td>
716 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a></p></td>
717 <td class="parameter_annotations"> </td>
718 </tr>
719 <tr>
720 <td class="parameter_name"><p>position</p></td>
721 <td class="parameter_description"><p>the position of the change</p></td>
722 <td class="parameter_annotations"> </td>
723 </tr>
724 <tr>
725 <td class="parameter_name"><p>removed</p></td>
726 <td class="parameter_description"><p>the number of items removed</p></td>
727 <td class="parameter_annotations"> </td>
728 </tr>
729 <tr>
730 <td class="parameter_name"><p>added</p></td>
731 <td class="parameter_description"><p>the number of items added</p></td>
732 <td class="parameter_annotations"> </td>
733 </tr>
734 </tbody>
735 </table></div>
736 </div>
737 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
738 </div>
739 <hr>
740 <div class="refsect2">
741 <a name="g-menu-attribute-iter-get-next"></a><h3>g_menu_attribute_iter_get_next ()</h3>
742 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
743 g_menu_attribute_iter_get_next (<em class="parameter"><code><a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a> *iter</code></em>,
744                                 <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_name</code></em>,
745                                 <em class="parameter"><code><a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> **value</code></em>);</pre>
746 <p>This function combines <a class="link" href="GMenuModel.html#g-menu-attribute-iter-next" title="g_menu_attribute_iter_next ()"><code class="function">g_menu_attribute_iter_next()</code></a> with
747 <a class="link" href="GMenuModel.html#g-menu-attribute-iter-get-name" title="g_menu_attribute_iter_get_name ()"><code class="function">g_menu_attribute_iter_get_name()</code></a> and <a class="link" href="GMenuModel.html#g-menu-attribute-iter-get-value" title="g_menu_attribute_iter_get_value ()"><code class="function">g_menu_attribute_iter_get_value()</code></a>.</p>
748 <p>First the iterator is advanced to the next (possibly first) attribute.
749 If that fails, then <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and there are no other
750 effects.</p>
751 <p>If successful, <em class="parameter"><code>name</code></em>
752  and <em class="parameter"><code>value</code></em>
753  are set to the name and value of the
754 attribute that has just been advanced to.  At this point,
755 <a class="link" href="GMenuModel.html#g-menu-attribute-iter-get-name" title="g_menu_attribute_iter_get_name ()"><code class="function">g_menu_attribute_iter_get_name()</code></a> and <a class="link" href="GMenuModel.html#g-menu-attribute-iter-get-value" title="g_menu_attribute_iter_get_value ()"><code class="function">g_menu_attribute_iter_get_value()</code></a> will
756 return the same values again.</p>
757 <p>The value returned in <em class="parameter"><code>name</code></em>
758  remains valid for as long as the iterator
759 remains at the current position.  The value returned in <em class="parameter"><code>value</code></em>
760  must
761 be unreffed using <a href="../glib-GVariant.html#g-variant-unref"><code class="function">g_variant_unref()</code></a> when it is no longer in use.</p>
762 <div class="refsect3">
763 <a name="g-menu-attribute-iter-get-next.parameters"></a><h4>Parameters</h4>
764 <div class="informaltable"><table class="informaltable" width="100%" border="0">
765 <colgroup>
766 <col width="150px" class="parameters_name">
767 <col class="parameters_description">
768 <col width="200px" class="parameters_annotations">
769 </colgroup>
770 <tbody>
771 <tr>
772 <td class="parameter_name"><p>iter</p></td>
773 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a></p></td>
774 <td class="parameter_annotations"> </td>
775 </tr>
776 <tr>
777 <td class="parameter_name"><p>out_name</p></td>
778 <td class="parameter_description"><p> the type of the attribute. </p></td>
779 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
780 </tr>
781 <tr>
782 <td class="parameter_name"><p>value</p></td>
783 <td class="parameter_description"><p> the attribute value. </p></td>
784 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
785 </tr>
786 </tbody>
787 </table></div>
788 </div>
789 <div class="refsect3">
790 <a name="g-menu-attribute-iter-get-next.returns"></a><h4>Returns</h4>
791 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, or <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there is no additional
792 attribute</p>
793 </div>
794 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
795 </div>
796 <hr>
797 <div class="refsect2">
798 <a name="g-menu-attribute-iter-get-name"></a><h3>g_menu_attribute_iter_get_name ()</h3>
799 <pre class="programlisting">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
800 g_menu_attribute_iter_get_name (<em class="parameter"><code><a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a> *iter</code></em>);</pre>
801 <p>Gets the name of the attribute at the current iterator position, as
802 a string.</p>
803 <p>The iterator is not advanced.</p>
804 <div class="refsect3">
805 <a name="g-menu-attribute-iter-get-name.parameters"></a><h4>Parameters</h4>
806 <div class="informaltable"><table class="informaltable" width="100%" border="0">
807 <colgroup>
808 <col width="150px" class="parameters_name">
809 <col class="parameters_description">
810 <col width="200px" class="parameters_annotations">
811 </colgroup>
812 <tbody><tr>
813 <td class="parameter_name"><p>iter</p></td>
814 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a></p></td>
815 <td class="parameter_annotations"> </td>
816 </tr></tbody>
817 </table></div>
818 </div>
819 <div class="refsect3">
820 <a name="g-menu-attribute-iter-get-name.returns"></a><h4>Returns</h4>
821 <p> the name of the attribute</p>
822 </div>
823 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
824 </div>
825 <hr>
826 <div class="refsect2">
827 <a name="g-menu-attribute-iter-get-value"></a><h3>g_menu_attribute_iter_get_value ()</h3>
828 <pre class="programlisting"><a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
829 g_menu_attribute_iter_get_value (<em class="parameter"><code><a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a> *iter</code></em>);</pre>
830 <p>Gets the value of the attribute at the current iterator position.</p>
831 <p>The iterator is not advanced.</p>
832 <div class="refsect3">
833 <a name="g-menu-attribute-iter-get-value.parameters"></a><h4>Parameters</h4>
834 <div class="informaltable"><table class="informaltable" width="100%" border="0">
835 <colgroup>
836 <col width="150px" class="parameters_name">
837 <col class="parameters_description">
838 <col width="200px" class="parameters_annotations">
839 </colgroup>
840 <tbody><tr>
841 <td class="parameter_name"><p>iter</p></td>
842 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a></p></td>
843 <td class="parameter_annotations"> </td>
844 </tr></tbody>
845 </table></div>
846 </div>
847 <div class="refsect3">
848 <a name="g-menu-attribute-iter-get-value.returns"></a><h4>Returns</h4>
849 <p> the value of the current attribute. </p>
850 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
851 </div>
852 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
853 </div>
854 <hr>
855 <div class="refsect2">
856 <a name="g-menu-attribute-iter-next"></a><h3>g_menu_attribute_iter_next ()</h3>
857 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
858 g_menu_attribute_iter_next (<em class="parameter"><code><a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a> *iter</code></em>);</pre>
859 <p>Attempts to advance the iterator to the next (possibly first)
860 attribute.</p>
861 <p><a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned on success, or <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there are no more
862 attributes.</p>
863 <p>You must call this function when you first acquire the iterator
864 to advance it to the first attribute (and determine if the first
865 attribute exists at all).</p>
866 <div class="refsect3">
867 <a name="g-menu-attribute-iter-next.parameters"></a><h4>Parameters</h4>
868 <div class="informaltable"><table class="informaltable" width="100%" border="0">
869 <colgroup>
870 <col width="150px" class="parameters_name">
871 <col class="parameters_description">
872 <col width="200px" class="parameters_annotations">
873 </colgroup>
874 <tbody><tr>
875 <td class="parameter_name"><p>iter</p></td>
876 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a></p></td>
877 <td class="parameter_annotations"> </td>
878 </tr></tbody>
879 </table></div>
880 </div>
881 <div class="refsect3">
882 <a name="g-menu-attribute-iter-next.returns"></a><h4>Returns</h4>
883 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, or <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> when there are no more attributes</p>
884 </div>
885 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
886 </div>
887 <hr>
888 <div class="refsect2">
889 <a name="g-menu-link-iter-get-name"></a><h3>g_menu_link_iter_get_name ()</h3>
890 <pre class="programlisting">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
891 g_menu_link_iter_get_name (<em class="parameter"><code><a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a> *iter</code></em>);</pre>
892 <p>Gets the name of the link at the current iterator position.</p>
893 <p>The iterator is not advanced.</p>
894 <div class="refsect3">
895 <a name="g-menu-link-iter-get-name.parameters"></a><h4>Parameters</h4>
896 <div class="informaltable"><table class="informaltable" width="100%" border="0">
897 <colgroup>
898 <col width="150px" class="parameters_name">
899 <col class="parameters_description">
900 <col width="200px" class="parameters_annotations">
901 </colgroup>
902 <tbody><tr>
903 <td class="parameter_name"><p>iter</p></td>
904 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a></p></td>
905 <td class="parameter_annotations"> </td>
906 </tr></tbody>
907 </table></div>
908 </div>
909 <div class="refsect3">
910 <a name="g-menu-link-iter-get-name.returns"></a><h4>Returns</h4>
911 <p> the type of the link</p>
912 </div>
913 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
914 </div>
915 <hr>
916 <div class="refsect2">
917 <a name="g-menu-link-iter-get-next"></a><h3>g_menu_link_iter_get_next ()</h3>
918 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
919 g_menu_link_iter_get_next (<em class="parameter"><code><a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a> *iter</code></em>,
920                            <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_link</code></em>,
921                            <em class="parameter"><code><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> **value</code></em>);</pre>
922 <p>This function combines <a class="link" href="GMenuModel.html#g-menu-link-iter-next" title="g_menu_link_iter_next ()"><code class="function">g_menu_link_iter_next()</code></a> with
923 <a class="link" href="GMenuModel.html#g-menu-link-iter-get-name" title="g_menu_link_iter_get_name ()"><code class="function">g_menu_link_iter_get_name()</code></a> and <a class="link" href="GMenuModel.html#g-menu-link-iter-get-value" title="g_menu_link_iter_get_value ()"><code class="function">g_menu_link_iter_get_value()</code></a>.</p>
924 <p>First the iterator is advanced to the next (possibly first) link.
925 If that fails, then <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and there are no other effects.</p>
926 <p>If successful, <em class="parameter"><code>out_link</code></em>
927  and <em class="parameter"><code>value</code></em>
928  are set to the name and <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a>
929 of the link that has just been advanced to.  At this point,
930 <a class="link" href="GMenuModel.html#g-menu-link-iter-get-name" title="g_menu_link_iter_get_name ()"><code class="function">g_menu_link_iter_get_name()</code></a> and <a class="link" href="GMenuModel.html#g-menu-link-iter-get-value" title="g_menu_link_iter_get_value ()"><code class="function">g_menu_link_iter_get_value()</code></a> will return the
931 same values again.</p>
932 <p>The value returned in <em class="parameter"><code>out_link</code></em>
933  remains valid for as long as the iterator
934 remains at the current position.  The value returned in <em class="parameter"><code>value</code></em>
935  must
936 be unreffed using <a href="../gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> when it is no longer in use.</p>
937 <div class="refsect3">
938 <a name="g-menu-link-iter-get-next.parameters"></a><h4>Parameters</h4>
939 <div class="informaltable"><table class="informaltable" width="100%" border="0">
940 <colgroup>
941 <col width="150px" class="parameters_name">
942 <col class="parameters_description">
943 <col width="200px" class="parameters_annotations">
944 </colgroup>
945 <tbody>
946 <tr>
947 <td class="parameter_name"><p>iter</p></td>
948 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a></p></td>
949 <td class="parameter_annotations"> </td>
950 </tr>
951 <tr>
952 <td class="parameter_name"><p>out_link</p></td>
953 <td class="parameter_description"><p> the name of the link. </p></td>
954 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
955 </tr>
956 <tr>
957 <td class="parameter_name"><p>value</p></td>
958 <td class="parameter_description"><p> the linked <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a>. </p></td>
959 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
960 </tr>
961 </tbody>
962 </table></div>
963 </div>
964 <div class="refsect3">
965 <a name="g-menu-link-iter-get-next.returns"></a><h4>Returns</h4>
966 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, or <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there is no additional link</p>
967 </div>
968 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
969 </div>
970 <hr>
971 <div class="refsect2">
972 <a name="g-menu-link-iter-get-value"></a><h3>g_menu_link_iter_get_value ()</h3>
973 <pre class="programlisting"><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="returnvalue">GMenuModel</span></a> *
974 g_menu_link_iter_get_value (<em class="parameter"><code><a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a> *iter</code></em>);</pre>
975 <p>Gets the linked <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> at the current iterator position.</p>
976 <p>The iterator is not advanced.</p>
977 <div class="refsect3">
978 <a name="g-menu-link-iter-get-value.parameters"></a><h4>Parameters</h4>
979 <div class="informaltable"><table class="informaltable" width="100%" border="0">
980 <colgroup>
981 <col width="150px" class="parameters_name">
982 <col class="parameters_description">
983 <col width="200px" class="parameters_annotations">
984 </colgroup>
985 <tbody><tr>
986 <td class="parameter_name"><p>iter</p></td>
987 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a></p></td>
988 <td class="parameter_annotations"> </td>
989 </tr></tbody>
990 </table></div>
991 </div>
992 <div class="refsect3">
993 <a name="g-menu-link-iter-get-value.returns"></a><h4>Returns</h4>
994 <p> the <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> that is linked to. </p>
995 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
996 </div>
997 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
998 </div>
999 <hr>
1000 <div class="refsect2">
1001 <a name="g-menu-link-iter-next"></a><h3>g_menu_link_iter_next ()</h3>
1002 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1003 g_menu_link_iter_next (<em class="parameter"><code><a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a> *iter</code></em>);</pre>
1004 <p>Attempts to advance the iterator to the next (possibly first)
1005 link.</p>
1006 <p><a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned on success, or <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there are no more links.</p>
1007 <p>You must call this function when you first acquire the iterator to
1008 advance it to the first link (and determine if the first link exists
1009 at all).</p>
1010 <div class="refsect3">
1011 <a name="g-menu-link-iter-next.parameters"></a><h4>Parameters</h4>
1012 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1013 <colgroup>
1014 <col width="150px" class="parameters_name">
1015 <col class="parameters_description">
1016 <col width="200px" class="parameters_annotations">
1017 </colgroup>
1018 <tbody><tr>
1019 <td class="parameter_name"><p>iter</p></td>
1020 <td class="parameter_description"><p>a <a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a></p></td>
1021 <td class="parameter_annotations"> </td>
1022 </tr></tbody>
1023 </table></div>
1024 </div>
1025 <div class="refsect3">
1026 <a name="g-menu-link-iter-next.returns"></a><h4>Returns</h4>
1027 <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, or <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> when there are no more links</p>
1028 </div>
1029 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
1030 </div>
1031 </div>
1032 <div class="refsect1">
1033 <a name="GMenuModel.other_details"></a><h2>Types and Values</h2>
1034 <div class="refsect2">
1035 <a name="GMenuModel-struct"></a><h3>GMenuModel</h3>
1036 <pre class="programlisting">typedef struct _GMenuModel GMenuModel;</pre>
1037 <p><a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> is an opaque structure type.  You must access it using the
1038 functions below.</p>
1039 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
1040 </div>
1041 <hr>
1042 <div class="refsect2">
1043 <a name="G-MENU-ATTRIBUTE-ACTION:CAPS"></a><h3>G_MENU_ATTRIBUTE_ACTION</h3>
1044 <pre class="programlisting">#define G_MENU_ATTRIBUTE_ACTION "action"
1045 </pre>
1046 <p>The menu item attribute which holds the action name of the item.  Action
1047 names are namespaced with an identifier for the action group in which the
1048 action resides. For example, "win." for window-specific actions and "app."
1049 for application-wide actions.</p>
1050 <p>See also <a class="link" href="GMenuModel.html#g-menu-model-get-item-attribute" title="g_menu_model_get_item_attribute ()"><code class="function">g_menu_model_get_item_attribute()</code></a> and <a class="link" href="GMenu.html#g-menu-item-set-attribute" title="g_menu_item_set_attribute ()"><code class="function">g_menu_item_set_attribute()</code></a>.</p>
1051 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
1052 </div>
1053 <hr>
1054 <div class="refsect2">
1055 <a name="G-MENU-ATTRIBUTE-ACTION-NAMESPACE:CAPS"></a><h3>G_MENU_ATTRIBUTE_ACTION_NAMESPACE</h3>
1056 <pre class="programlisting">#define G_MENU_ATTRIBUTE_ACTION_NAMESPACE "action-namespace"
1057 </pre>
1058 <p>The menu item attribute that holds the namespace for all action names in
1059 menus that are linked from this item.</p>
1060 <p class="since">Since: <a class="link" href="api-index-2-36.html#api-index-2.36">2.36</a></p>
1061 </div>
1062 <hr>
1063 <div class="refsect2">
1064 <a name="G-MENU-ATTRIBUTE-TARGET:CAPS"></a><h3>G_MENU_ATTRIBUTE_TARGET</h3>
1065 <pre class="programlisting">#define G_MENU_ATTRIBUTE_TARGET "target"
1066 </pre>
1067 <p>The menu item attribute which holds the target with which the item's action
1068 will be activated.</p>
1069 <p>See also <a class="link" href="GMenu.html#g-menu-item-set-action-and-target" title="g_menu_item_set_action_and_target ()"><code class="function">g_menu_item_set_action_and_target()</code></a></p>
1070 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
1071 </div>
1072 <hr>
1073 <div class="refsect2">
1074 <a name="G-MENU-ATTRIBUTE-LABEL:CAPS"></a><h3>G_MENU_ATTRIBUTE_LABEL</h3>
1075 <pre class="programlisting">#define G_MENU_ATTRIBUTE_LABEL "label"
1076 </pre>
1077 <p>The menu item attribute which holds the label of the item.</p>
1078 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
1079 </div>
1080 <hr>
1081 <div class="refsect2">
1082 <a name="G-MENU-ATTRIBUTE-ICON:CAPS"></a><h3>G_MENU_ATTRIBUTE_ICON</h3>
1083 <pre class="programlisting">#define G_MENU_ATTRIBUTE_ICON "icon"
1084 </pre>
1085 <p>The menu item attribute which holds the icon of the item.</p>
1086 <p>The icon is stored in the format returned by <a class="link" href="GIcon.html#g-icon-serialize" title="g_icon_serialize ()"><code class="function">g_icon_serialize()</code></a>.</p>
1087 <p>This attribute is intended only to represent 'noun' icons such as
1088 favicons for a webpage, or application icons.  It should not be used
1089 for 'verbs' (ie: stock icons).</p>
1090 <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p>
1091 </div>
1092 <hr>
1093 <div class="refsect2">
1094 <a name="G-MENU-LINK-SECTION:CAPS"></a><h3>G_MENU_LINK_SECTION</h3>
1095 <pre class="programlisting">#define G_MENU_LINK_SECTION "section"
1096 </pre>
1097 <p>The name of the link that associates a menu item with a section.  The linked
1098 menu will usually be shown in place of the menu item, using the item's label
1099 as a header.</p>
1100 <p>See also <a class="link" href="GMenu.html#g-menu-item-set-link" title="g_menu_item_set_link ()"><code class="function">g_menu_item_set_link()</code></a>.</p>
1101 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
1102 </div>
1103 <hr>
1104 <div class="refsect2">
1105 <a name="G-MENU-LINK-SUBMENU:CAPS"></a><h3>G_MENU_LINK_SUBMENU</h3>
1106 <pre class="programlisting">#define G_MENU_LINK_SUBMENU "submenu"
1107 </pre>
1108 <p>The name of the link that associates a menu item with a submenu.</p>
1109 <p>See also <a class="link" href="GMenu.html#g-menu-item-set-link" title="g_menu_item_set_link ()"><code class="function">g_menu_item_set_link()</code></a>.</p>
1110 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
1111 </div>
1112 <hr>
1113 <div class="refsect2">
1114 <a name="GMenuAttributeIter-struct"></a><h3>struct GMenuAttributeIter</h3>
1115 <pre class="programlisting">struct GMenuAttributeIter;</pre>
1116 <p><a class="link" href="GMenuModel.html#GMenuAttributeIter"><span class="type">GMenuAttributeIter</span></a> is an opaque structure type.  You must access it
1117 using the functions below.</p>
1118 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
1119 </div>
1120 <hr>
1121 <div class="refsect2">
1122 <a name="GMenuLinkIter-struct"></a><h3>struct GMenuLinkIter</h3>
1123 <pre class="programlisting">struct GMenuLinkIter;</pre>
1124 <p><a class="link" href="GMenuModel.html#GMenuLinkIter"><span class="type">GMenuLinkIter</span></a> is an opaque structure type.  You must access it using
1125 the functions below.</p>
1126 <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
1127 </div>
1128 </div>
1129 <div class="refsect1">
1130 <a name="GMenuModel.signal-details"></a><h2>Signal Details</h2>
1131 <div class="refsect2">
1132 <a name="GMenuModel-items-changed"></a><h3>The <code class="literal">“items-changed”</code> signal</h3>
1133 <pre class="programlisting"><span class="returnvalue">void</span>
1134 user_function (<a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> *model,
1135                <a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a>        position,
1136                <a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a>        removed,
1137                <a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a>        added,
1138                <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>    user_data)</pre>
1139 <p>Emitted when a change has occured to the menu.</p>
1140 <p>The only changes that can occur to a menu is that items are removed
1141 or added.  Items may not change (except by being removed and added
1142 back in the same location).  This signal is capable of describing
1143 both of those changes (at the same time).</p>
1144 <p>The signal means that starting at the index <em class="parameter"><code>position</code></em>
1145 , <em class="parameter"><code>removed</code></em>
1146
1147 items were removed and <em class="parameter"><code>added</code></em>
1148  items were added in their place.  If
1149 <em class="parameter"><code>removed</code></em>
1150  is zero then only items were added.  If <em class="parameter"><code>added</code></em>
1151  is zero
1152 then only items were removed.</p>
1153 <p>As an example, if the menu contains items a, b, c, d (in that
1154 order) and the signal (2, 1, 3) occurs then the new composition of
1155 the menu will be a, b, _, _, _, d (with each _ representing some
1156 new item).</p>
1157 <p>Signal handlers may query the model (particularly the added items)
1158 and expect to see the results of the modification that is being
1159 reported.  The signal is emitted after the modification.</p>
1160 <div class="refsect3">
1161 <a name="GMenuModel-items-changed.parameters"></a><h4>Parameters</h4>
1162 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1163 <colgroup>
1164 <col width="150px" class="parameters_name">
1165 <col class="parameters_description">
1166 <col width="200px" class="parameters_annotations">
1167 </colgroup>
1168 <tbody>
1169 <tr>
1170 <td class="parameter_name"><p>model</p></td>
1171 <td class="parameter_description"><p>the <a class="link" href="GMenuModel.html" title="GMenuModel"><span class="type">GMenuModel</span></a> that is changing</p></td>
1172 <td class="parameter_annotations"> </td>
1173 </tr>
1174 <tr>
1175 <td class="parameter_name"><p>position</p></td>
1176 <td class="parameter_description"><p>the position of the change</p></td>
1177 <td class="parameter_annotations"> </td>
1178 </tr>
1179 <tr>
1180 <td class="parameter_name"><p>removed</p></td>
1181 <td class="parameter_description"><p>the number of items removed</p></td>
1182 <td class="parameter_annotations"> </td>
1183 </tr>
1184 <tr>
1185 <td class="parameter_name"><p>added</p></td>
1186 <td class="parameter_description"><p>the number of items added</p></td>
1187 <td class="parameter_annotations"> </td>
1188 </tr>
1189 <tr>
1190 <td class="parameter_name"><p>user_data</p></td>
1191 <td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
1192 <td class="parameter_annotations"> </td>
1193 </tr>
1194 </tbody>
1195 </table></div>
1196 </div>
1197 <p>Flags: <a href="../gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></p>
1198 </div>
1199 </div>
1200 <div class="refsect1">
1201 <a name="GMenuModel.see-also"></a><h2>See Also</h2>
1202 <p><a class="link" href="GActionGroup.html" title="GActionGroup"><span class="type">GActionGroup</span></a></p>
1203 </div>
1204 </div>
1205 <div class="footer">
1206 <hr>Generated by GTK-Doc V1.25.1</div>
1207 </body>
1208 </html>