Debian Codegraph @

gtk/gtkmenusectionbox.c

raw symbols SCIP
1 /*
2 * Copyright © 2014 Canonical Limited
3 * Copyright © 2013 Carlos Garnacho
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the licence, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * Author: Ryan Lortie <[email protected]>
19 */
20
21 #include "config.h"cxx . . $ `<file>/build/config.h`/
22
23 #include "gtkmenusectionboxprivate.h"cxx . . $ `<file>/gtk/gtkmenusectionboxprivate.h`/
24
25 #include "gtkwidgetprivate.h"cxx . . $ `<file>/gtk/gtkwidgetprivate.h`/
26 #include "gtklabel.h"cxx . . $ `<file>/gtk/gtklabel.h`/
27 #include "gtkmenutrackerprivate.h"cxx . . $ `<file>/gtk/gtkmenutrackerprivate.h`/
28 #include "gtkmodelbuttonprivate.h"cxx . . $ `<file>/gtk/gtkmodelbuttonprivate.h`/
29 #include "gtkseparator.h"cxx . . $ `<file>/gtk/gtkseparator.h`/
30 #include "gtksizegroup.h"cxx . . $ `<file>/gtk/gtksizegroup.h`/
31 #include "gtkstack.h"cxx . . $ `<file>/gtk/gtkstack.h`/
32 #include "gtkpopovermenuprivate.h"cxx . . $ `<file>/gtk/gtkpopovermenuprivate.h`/
33 #include "gtkorientable.h"cxx . . $ `<file>/gtk/gtkorientable.h`/
34 #include "gtkbuiltiniconprivate.h"cxx . . $ `<file>/gtk/gtkbuiltiniconprivate.h`/
35 #include "gtkgizmoprivate.h"cxx . . $ `<file>/gtk/gtkgizmoprivate.h`/
36 #include "gtkbinlayout.h"cxx . . $ `<file>/gtk/gtkbinlayout.h`/
37 #include "gtkprivate.h"cxx . . $ `<file>/gtk/gtkprivate.h`/
38
39 typedef GtkBoxClasscxx . . $ GtkBoxClass# GtkMenuSectionBoxClasscxx . . $ GtkMenuSectionBoxClass#;
40
41 struct _GtkMenuSectionBoxcxx . . $ _GtkMenuSectionBox#
42 {
43 GtkBoxcxx . . $ GtkBox# parent_instancecxx . . $ _GtkMenuSectionBox#parent_instance.;
44
45 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *toplevelcxx . . $ _GtkMenuSectionBox#toplevel.;
46 GtkMenuTrackercxx . . $ GtkMenuTracker# *trackercxx . . $ _GtkMenuSectionBox#tracker.;
47 GtkBoxcxx . . $ GtkBox# *item_boxcxx . . $ _GtkMenuSectionBox#item_box.;
48 GtkWidgetcxx . . $ GtkWidget# *separatorcxx . . $ _GtkMenuSectionBox#separator.;
49 guintcxx . . $ guint# separator_sync_idlecxx . . $ _GtkMenuSectionBox#separator_sync_idle.;
50 gbooleancxx . . $ gboolean# iconiccxx . . $ _GtkMenuSectionBox#iconic.;
51 gbooleancxx . . $ gboolean# inline_buttonscxx . . $ _GtkMenuSectionBox#inline_buttons.;
52 gbooleancxx . . $ gboolean# circularcxx . . $ _GtkMenuSectionBox#circular.;
53 int depthcxx . . $ _GtkMenuSectionBox#depth.;
54 GtkPopoverMenuFlagscxx . . $ GtkPopoverMenuFlags# flagscxx . . $ _GtkMenuSectionBox#flags.;
55 GtkSizeGroupcxx . . $ GtkSizeGroup# *indicatorscxx . . $ _GtkMenuSectionBox#indicators.;
56 GHashTablecxx . . $ GHashTable# *custom_slotscxx . . $ _GtkMenuSectionBox#custom_slots.;
57 };
58
59 typedef structcxx . . $ $anonymous_type_d4c6f160ea8da181_0#
60 {
61 int n_itemscxx . . $ $anonymous_type_d4c6f160ea8da181_0#n_items.;
62 gbooleancxx . . $ gboolean# previous_is_iconiccxx . . $ $anonymous_type_d4c6f160ea8da181_0#previous_is_iconic.;
63 } MenuDatacxx . . $ MenuData#;
64
65 G_DEFINE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1834:9`! (GtkMenuSectionBox, gtk_menu_section_box, GTK_TYPE_BOXcxx . . $ `gtk/gtkbox.h:38:9`!)
66
67 static void gtk_menu_section_box_sync_separatorscxx . . $ gtk_menu_section_box_sync_separators(eae5c1a441475b0a). (GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box,
68 MenuDatacxx . . $ MenuData# *data);
69 static void gtk_menu_section_box_new_submenucxx . . $ gtk_menu_section_box_new_submenu(98eb698d9520e0fd). (GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item,
70 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *toplevel,
71 GtkWidgetcxx . . $ GtkWidget# *focus,
72 const char *name);
73 static GtkWidgetcxx . . $ GtkWidget# * gtk_menu_section_box_new_sectioncxx . . $ gtk_menu_section_box_new_section(70715fb1f4a9316c). (GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item,
74 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *parent);
75
76 /* We are trying to implement the following rules here:
77 *
78 * rule 1: never ever show separators for empty sections
79 * rule 2: always show a separator if there is a label
80 * rule 3: don't show a separator for the first section
81 * rule 4: don't show a separator for the following sections if there are
82 * no items before it
83 * rule 5: never show separators directly above or below an iconic box
84 * (rule 6: these rules don't apply exactly the same way for subsections)
85 */
86 static void
87 gtk_menu_section_box_sync_separatorscxx . . $ gtk_menu_section_box_sync_separators(eae5c1a441475b0a). (GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box,
88 MenuDatacxx . . $ MenuData# *data)
89 {
90 gbooleancxx . . $ gboolean# previous_section_is_iconic;
91 gbooleancxx . . $ gboolean# should_have_separator;
92 gbooleancxx . . $ gboolean# should_have_top_margin = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
93 gbooleancxx . . $ gboolean# is_not_empty_item;
94 gbooleancxx . . $ gboolean# has_separator;
95 gbooleancxx . . $ gboolean# has_label;
96 gbooleancxx . . $ gboolean# separator_condition;
97 int n_items_before;
98 GtkWidgetcxx . . $ GtkWidget# *child;
99
100 n_items_before = data->n_itemscxx . . $ $anonymous_type_d4c6f160ea8da181_0#n_items.;
101 previous_section_is_iconic = data->previous_is_iconiccxx . . $ $anonymous_type_d4c6f160ea8da181_0#previous_is_iconic.;
102
103 for (child = gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->item_box));
104 child != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
105 child = gtk_widget_get_next_siblingcxx . . $ gtk_widget_get_next_sibling(ef973e1b01680070). (child))
106 {
107 if (GTK_IS_MENU_SECTION_BOXcxx . . $ `gtk/gtkmenusectionboxprivate.h:33:9`! (child))
108 gtk_menu_section_box_sync_separatorscxx . . $ gtk_menu_section_box_sync_separators(eae5c1a441475b0a). (GTK_MENU_SECTION_BOXcxx . . $ `gtk/gtkmenusectionboxprivate.h:29:9`! (child), data);
109 else
110 data->n_itemscxx . . $ $anonymous_type_d4c6f160ea8da181_0#n_items.++;
111 }
112
113 is_not_empty_item = (data->n_itemscxx . . $ $anonymous_type_d4c6f160ea8da181_0#n_items. > n_items_before);
114
115 if (is_not_empty_item)
116 data->previous_is_iconiccxx . . $ $anonymous_type_d4c6f160ea8da181_0#previous_is_iconic. = box->iconiccxx . . $ _GtkMenuSectionBox#iconic.;
117
118 if (box->separatorcxx . . $ _GtkMenuSectionBox#separator. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
119 return;
120
121 has_separator = gtk_widget_get_parentcxx . . $ gtk_widget_get_parent(ef973e1b01680070). (box->separatorcxx . . $ _GtkMenuSectionBox#separator.) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
122 has_label = !GTK_IS_SEPARATORcxx . . $ `gtk/gtkseparator.h:39:9`! (box->separator);
123
124 separator_condition = has_label ? TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`! : n_items_before > 0 &&
125 box->depthcxx . . $ _GtkMenuSectionBox#depth. <= 1 &&
126 !previous_section_is_iconic &&
127 !box->iconiccxx . . $ _GtkMenuSectionBox#iconic.;
128
129 should_have_separator = separator_condition && is_not_empty_item;
130
131 should_have_top_margin = !should_have_separator &&
132 (box->depthcxx . . $ _GtkMenuSectionBox#depth. <= 1 || box->iconiccxx . . $ _GtkMenuSectionBox#iconic. || box->circularcxx . . $ _GtkMenuSectionBox#circular.) &&
133 n_items_before > 0 &&
134 is_not_empty_item;
135
136 gtk_widget_set_margin_topcxx . . $ gtk_widget_set_margin_top(81f145f668a0074f). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->item_box), should_have_top_margin ? 10 : 0);
137
138 if (has_label)
139 {
140 GtkWidgetcxx . . $ GtkWidget# *separator = gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (box->separatorcxx . . $ _GtkMenuSectionBox#separator.);
141
142 gtk_widget_set_visiblecxx . . $ gtk_widget_set_visible(81f145f668a0074f). (separator, n_items_before > 0);
143 }
144
145 if (should_have_separator == has_separator)
146 return;
147
148 if (should_have_separator)
149 gtk_box_insert_child_aftercxx . . $ gtk_box_insert_child_after(d0ded8d662e2b046). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box), box->separatorcxx . . $ _GtkMenuSectionBox#separator., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
150 else
151 gtk_box_removecxx . . $ gtk_box_remove(72f3a0256788ecaf). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box), box->separatorcxx . . $ _GtkMenuSectionBox#separator.);
152 }
153
154 static gbooleancxx . . $ gboolean#
155 gtk_menu_section_box_handle_sync_separatorscxx . . $ gtk_menu_section_box_handle_sync_separators(dedf1e9b1c614a07). (gpointercxx . . $ gpointer# user_data)
156 {
157 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box = user_data;
158 MenuDatacxx . . $ MenuData# data;
159
160 data.n_itemscxx . . $ $anonymous_type_d4c6f160ea8da181_0#n_items. = 0;
161 data.previous_is_iconiccxx . . $ $anonymous_type_d4c6f160ea8da181_0#previous_is_iconic. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
162 gtk_menu_section_box_sync_separatorscxx . . $ gtk_menu_section_box_sync_separators(eae5c1a441475b0a). (box, &data);
163
164 box->separator_sync_idlecxx . . $ _GtkMenuSectionBox#separator_sync_idle. = 0;
165
166 return G_SOURCE_REMOVEcxx . . $ `<external>/1856471541377536744/gmain.h:475:9`!;
167 }
168
169 static void
170 gtk_menu_section_box_schedule_separator_synccxx . . $ gtk_menu_section_box_schedule_separator_sync(8036681e749c5d60). (GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box)
171 {
172 box = box->toplevelcxx . . $ _GtkMenuSectionBox#toplevel.;
173
174 if (!box->separator_sync_idlecxx . . $ _GtkMenuSectionBox#separator_sync_idle.)
175 {
176 box->separator_sync_idlecxx . . $ _GtkMenuSectionBox#separator_sync_idle. = g_idle_add_fullcxx . . $ g_idle_add_full(45e19b0935db1869). (G_PRIORITY_DEFAULTcxx . . $ `<external>/1856471541377536744/gmain.h:434:9`!, /* before menu is drawn... */
177 gtk_menu_section_box_handle_sync_separatorscxx . . $ gtk_menu_section_box_handle_sync_separators(dedf1e9b1c614a07).,
178 box, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
179 gdk_source_set_static_name_by_idcxx . . $ gdk_source_set_static_name_by_id(d7adf5cfafc0e15a). (box->separator_sync_idlecxx . . $ _GtkMenuSectionBox#separator_sync_idle., "[gtk] menu section box handle sync separators");
180 }
181 }
182
183 static void
184 gtk_popover_item_activatecxx . . $ gtk_popover_item_activate(c2a8b32df5332c4b). (GtkWidgetcxx . . $ GtkWidget# *button,
185 gpointercxx . . $ gpointer# user_data)
186 {
187 GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item = user_data;
188 GtkWidgetcxx . . $ GtkWidget# *popover = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
189
190 if (gtk_menu_tracker_item_get_rolecxx . . $ gtk_menu_tracker_item_get_role(ef7a2d5036f588dc). (item) == GTK_MENU_TRACKER_ITEM_ROLE_NORMALcxx . . $ GTK_MENU_TRACKER_ITEM_ROLE_NORMAL.)
191 {
192 /* Activating the item could cause the popover
193 * to be free'd, for example if it is a Quit item
194 */
195 popover = gtk_widget_get_ancestorcxx . . $ gtk_widget_get_ancestor(b7ba6c2729848898). (button, GTK_TYPE_POPOVERcxx . . $ `gtk/gtkpopover.h:31:9`!);
196 if (popover)
197 g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (popover);
198 }
199
200 gtk_menu_tracker_item_activatedcxx . . $ gtk_menu_tracker_item_activated(59ef1654e5a8902d). (item);
201
202 if (popover != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
203 {
204 gtk_widget_set_visiblecxx . . $ gtk_widget_set_visible(81f145f668a0074f). (popover, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
205 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (popover);
206 }
207 }
208
209 static void
210 gtk_menu_section_box_remove_funccxx . . $ gtk_menu_section_box_remove_func(6ca3d68f5c5f0975). (int position,
211 gpointercxx . . $ gpointer# user_data)
212 {
213 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box = user_data;
214 GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item;
215 GtkWidgetcxx . . $ GtkWidget# *widget;
216 int pos;
217
218 for (widget = gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->item_box)), pos = 0;
219 widget != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
220 widget = gtk_widget_get_next_siblingcxx . . $ gtk_widget_get_next_sibling(ef973e1b01680070). (widget), pos++)
221 {
222 if (pos == position)
223 break;
224 }
225
226 item = g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (widget), "GtkMenuTrackerItem");
227 if (gtk_menu_tracker_item_get_has_linkcxx . . $ gtk_menu_tracker_item_get_has_link(169db4d3e22482f8). (item, G_MENU_LINK_SUBMENUcxx . . $ `<external>/17783962342109199441/gmenumodel.h:100:9`!))
228 {
229 GtkWidgetcxx . . $ GtkWidget# *stack, *subbox;
230
231 stack = gtk_widget_get_ancestorcxx . . $ gtk_widget_get_ancestor(b7ba6c2729848898). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->toplevel), GTK_TYPE_STACKcxx . . $ `gtk/gtkstack.h:34:9`!);
232 subbox = gtk_stack_get_child_by_namecxx . . $ gtk_stack_get_child_by_name(2a7cd6a18d4d1a59). (GTK_STACKcxx . . $ `gtk/gtkstack.h:35:9`! (stack), gtk_menu_tracker_item_get_labelcxx . . $ gtk_menu_tracker_item_get_label(dccc92de3a185c7c). (item));
233 if (subbox != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
234 gtk_stack_removecxx . . $ gtk_stack_remove(49e424d5d1cc8631). (GTK_STACKcxx . . $ `gtk/gtkstack.h:35:9`! (stack), subbox);
235 }
236
237 gtk_box_removecxx . . $ gtk_box_remove(72f3a0256788ecaf). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box->item_box), widget);
238
239 gtk_menu_section_box_schedule_separator_synccxx . . $ gtk_menu_section_box_schedule_separator_sync(8036681e749c5d60). (box);
240 }
241
242 static gbooleancxx . . $ gboolean#
243 get_ancestorscxx . . $ get_ancestors(35bd2c2a4da6aefe). (GtkWidgetcxx . . $ GtkWidget# *widget,
244 GTypecxx . . $ GType# widget_type,
245 GtkWidgetcxx . . $ GtkWidget# **ancestor,
246 GtkWidgetcxx . . $ GtkWidget# **below)
247 {
248 GtkWidgetcxx . . $ GtkWidget# *a, *b;
249
250 a = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
251 b = widget;
252 while (b != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
253 {
254 a = gtk_widget_get_parentcxx . . $ gtk_widget_get_parent(ef973e1b01680070). (b);
255 if (!a)
256 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
257 if (g_type_is_acxx . . $ `<external>/9567554376676449156/gtype.h:760:9`! (G_OBJECT_TYPEcxx . . $ `<external>/1341695927569185362/gobject.h:98:9`! (a), widget_type))
258 break;
259 b = a;
260 }
261
262 *below = b;
263 *ancestor = a;
264
265 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
266 }
267
268 static void
269 close_submenucxx . . $ close_submenu(c2a8b32df5332c4b). (GtkWidgetcxx . . $ GtkWidget# *button,
270 gpointercxx . . $ gpointer# data)
271 {
272 GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item = data;
273 GtkWidgetcxx . . $ GtkWidget# *focus;
274
275 if (gtk_menu_tracker_item_get_should_request_showcxx . . $ gtk_menu_tracker_item_get_should_request_show(2d2c72eb589aeff). (item))
276 gtk_menu_tracker_item_request_submenu_showncxx . . $ gtk_menu_tracker_item_request_submenu_shown(173a0feca292fad6). (item, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
277
278 focus = GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (button), "focus"));
279 gtk_widget_grab_focuscxx . . $ gtk_widget_grab_focus(9247ef2dc26c5426). (focus);
280 }
281
282 static void
283 open_submenucxx . . $ open_submenu(c2a8b32df5332c4b). (GtkWidgetcxx . . $ GtkWidget# *button,
284 gpointercxx . . $ gpointer# data)
285 {
286 GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item = data;
287 GtkWidgetcxx . . $ GtkWidget# *focus;
288
289 if (gtk_menu_tracker_item_get_should_request_showcxx . . $ gtk_menu_tracker_item_get_should_request_show(2d2c72eb589aeff). (item))
290 gtk_menu_tracker_item_request_submenu_showncxx . . $ gtk_menu_tracker_item_request_submenu_shown(173a0feca292fad6). (item, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
291
292 focus = GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (button), "focus"));
293 gtk_widget_grab_focuscxx . . $ gtk_widget_grab_focus(9247ef2dc26c5426). (focus);
294 }
295
296 static void
297 submenu_showncxx . . $ submenu_shown(a5e3a2d3edf5d8a8). (GtkPopoverMenucxx . . $ GtkPopoverMenu# *popover,
298 GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item)
299 {
300 if (gtk_menu_tracker_item_get_should_request_showcxx . . $ gtk_menu_tracker_item_get_should_request_show(2d2c72eb589aeff). (item))
301 gtk_menu_tracker_item_request_submenu_showncxx . . $ gtk_menu_tracker_item_request_submenu_shown(173a0feca292fad6). (item, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
302 }
303
304 static void
305 submenu_hiddencxx . . $ submenu_hidden(a5e3a2d3edf5d8a8). (GtkPopoverMenucxx . . $ GtkPopoverMenu# *popover,
306 GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item)
307 {
308 if (gtk_menu_tracker_item_get_should_request_showcxx . . $ gtk_menu_tracker_item_get_should_request_show(2d2c72eb589aeff). (item))
309 gtk_menu_tracker_item_request_submenu_showncxx . . $ gtk_menu_tracker_item_request_submenu_shown(173a0feca292fad6). (item, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
310 }
311
312 /* We're using the gizmo as an easy single child container, not as
313 * a custom widget to draw some visual indicators (like markers).
314 * As such its default focus functions blocks focus through the children,
315 * so we need to handle it correctly here so that custom widgets inside
316 * menus can be focused.
317 */
318 static gbooleancxx . . $ gboolean#
319 custom_widget_focuscxx . . $ custom_widget_focus(17fb145bb2aa71fe). (GtkGizmocxx . . $ GtkGizmo# *gizmo,
320 GtkDirectionTypecxx . . $ GtkDirectionType# direction)
321 {
322 return gtk_widget_focus_childcxx . . $ gtk_widget_focus_child(8bb1c65c821a69cd). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (gizmo), direction);
323 }
324
325 static gbooleancxx . . $ gboolean#
326 custom_widget_grab_focuscxx . . $ custom_widget_grab_focus(12ce29db4786d50a). (GtkGizmocxx . . $ GtkGizmo# *gizmo)
327 {
328 return gtk_widget_grab_focus_childcxx . . $ gtk_widget_grab_focus_child(9247ef2dc26c5426). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (gizmo));
329 }
330
331 static void
332 gtk_menu_section_box_insert_funccxx . . $ gtk_menu_section_box_insert_func(2eb6bed35727c4d2). (GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item,
333 int position,
334 gpointercxx . . $ gpointer# user_data)
335 {
336 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box = user_data;
337 GtkWidgetcxx . . $ GtkWidget# *widget;
338
339 if (gtk_menu_tracker_item_get_is_separatorcxx . . $ gtk_menu_tracker_item_get_is_separator(2d2c72eb589aeff). (item))
340 {
341 widget = gtk_menu_section_box_new_sectioncxx . . $ gtk_menu_section_box_new_section(70715fb1f4a9316c). (item, box);
342 }
343 else if (gtk_menu_tracker_item_get_has_linkcxx . . $ gtk_menu_tracker_item_get_has_link(169db4d3e22482f8). (item, G_MENU_LINK_SUBMENUcxx . . $ `<external>/17783962342109199441/gmenumodel.h:100:9`!))
344 {
345 if (box->flagscxx . . $ _GtkMenuSectionBox#flags. & GTK_POPOVER_MENU_NESTEDcxx . . $ GTK_POPOVER_MENU_NESTED.)
346 {
347 GMenuModelcxx . . $ GMenuModel# *model;
348 GtkWidgetcxx . . $ GtkWidget# *submenu;
349
350 model = _gtk_menu_tracker_item_get_linkcxx . . $ _gtk_menu_tracker_item_get_link(9ad15bd9ee87aa90). (item, G_MENU_LINK_SUBMENUcxx . . $ `<external>/17783962342109199441/gmenumodel.h:100:9`!);
351
352 submenu = gtk_popover_menu_new_from_model_fullcxx . . $ gtk_popover_menu_new_from_model_full(8c172dc2b7386d4d). (model, box->flagscxx . . $ _GtkMenuSectionBox#flags.);
353 gtk_popover_set_has_arrowcxx . . $ gtk_popover_set_has_arrow(20283c8f4c8e9815). (GTK_POPOVERcxx . . $ `gtk/gtkpopover.h:32:9`! (submenu), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
354 gtk_widget_set_valigncxx . . $ gtk_widget_set_valign(71362b4a1e4eb244). (submenu, GTK_ALIGN_STARTcxx . . $ GTK_ALIGN_START.);
355
356 widget = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_MODEL_BUTTONcxx . . $ `gtk/gtkmodelbuttonprivate.h:26:9`!,
357 "popover", submenu,
358 "indicator-size-group", box->indicatorscxx . . $ _GtkMenuSectionBox#indicators.,
359 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
360 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "label", widget, "text", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
361 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "icon", widget, "icon", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
362 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "use-markup", widget, "use-markup", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
363 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "sensitive", widget, "sensitive", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
364
365 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (submenu, "show", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (submenu_shown), item);
366 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (submenu, "hide", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (submenu_hidden), item);
367 }
368 else
369 {
370 GtkWidgetcxx . . $ GtkWidget# *stack = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
371 GtkWidgetcxx . . $ GtkWidget# *parent = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
372 char *name;
373
374 widget = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_MODEL_BUTTONcxx . . $ `gtk/gtkmodelbuttonprivate.h:26:9`!,
375 "menu-name", gtk_menu_tracker_item_get_labelcxx . . $ gtk_menu_tracker_item_get_label(dccc92de3a185c7c). (item),
376 "indicator-size-group", box->indicatorscxx . . $ _GtkMenuSectionBox#indicators.,
377 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
378 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "label", widget, "text", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
379 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "icon", widget, "icon", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
380 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "use-markup", widget, "use-markup", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
381 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "sensitive", widget, "sensitive", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
382
383 get_ancestorscxx . . $ get_ancestors(35bd2c2a4da6aefe). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->toplevel), GTK_TYPE_STACKcxx . . $ `gtk/gtkstack.h:34:9`!, &stack, &parent);
384 g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d). (gtk_stack_get_pagecxx . . $ gtk_stack_get_page(bc36c75693d73164). (GTK_STACKcxx . . $ `gtk/gtkstack.h:35:9`! (stack), parent), "name", &name, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
385 gtk_menu_section_box_new_submenucxx . . $ gtk_menu_section_box_new_submenu(98eb698d9520e0fd). (item, box->toplevelcxx . . $ _GtkMenuSectionBox#toplevel., widget, name);
386 g_freecxx . . $ g_free(5d22bdacc48458e8). (name);
387 }
388 }
389 else if (gtk_menu_tracker_item_get_customcxx . . $ gtk_menu_tracker_item_get_custom(dccc92de3a185c7c). (item))
390 {
391 const char *id = gtk_menu_tracker_item_get_customcxx . . $ gtk_menu_tracker_item_get_custom(dccc92de3a185c7c). (item);
392
393 widget = gtk_gizmo_newcxx . . $ gtk_gizmo_new(bef4db173a6affd). ("widget", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, custom_widget_focuscxx . . $ custom_widget_focus(17fb145bb2aa71fe)., custom_widget_grab_focuscxx . . $ custom_widget_grab_focus(12ce29db4786d50a).);
394 gtk_widget_set_layout_managercxx . . $ gtk_widget_set_layout_manager(4079769398e3bd92). (widget, gtk_bin_layout_newcxx . . $ gtk_bin_layout_new(487a1448eb6d33ac). ());
395
396 if (g_hash_table_lookupcxx . . $ g_hash_table_lookup(8183d62c39a6a245). (box->custom_slotscxx . . $ _GtkMenuSectionBox#custom_slots., id))
397 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:340:9`! ("Duplicate custom ID: %s", id);
398 else
399 {
400 char *slot_id = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (id);
401 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (widget), "slot-id", slot_id, g_freecxx . . $ g_free(5d22bdacc48458e8).);
402 g_hash_table_insertcxx . . $ g_hash_table_insert(6a7c46015dd5ef26). (box->custom_slotscxx . . $ _GtkMenuSectionBox#custom_slots., slot_id, widget);
403 }
404 }
405 else
406 {
407 widget = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_MODEL_BUTTONcxx . . $ `gtk/gtkmodelbuttonprivate.h:26:9`!,
408 "indicator-size-group", box->indicatorscxx . . $ _GtkMenuSectionBox#indicators.,
409 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
410 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "label", widget, "text", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
411
412 if (box->iconiccxx . . $ _GtkMenuSectionBox#iconic.)
413 {
414 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "verb-icon", widget, "icon", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
415 g_object_setcxx . . $ g_object_set(1ac911bdc4e9a14d). (widget, "iconic", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
416 }
417 else if (box->inline_buttonscxx . . $ _GtkMenuSectionBox#inline_buttons.)
418 {
419 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "verb-icon", widget, "icon", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
420 g_object_setcxx . . $ g_object_set(1ac911bdc4e9a14d). (widget, "iconic", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
421 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (widget, "flat");
422 }
423 else if (box->circularcxx . . $ _GtkMenuSectionBox#circular.)
424 {
425 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "verb-icon", widget, "icon", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
426 g_object_setcxx . . $ g_object_set(1ac911bdc4e9a14d). (widget, "iconic", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
427 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (widget, "circular");
428 }
429 else
430 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "icon", widget, "icon", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
431
432 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "use-markup", widget, "use-markup", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
433 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "sensitive", widget, "sensitive", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
434 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "role", widget, "role", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
435 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "toggled", widget, "active", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
436 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "accel", widget, "accel", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
437 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (widget, "clicked", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (gtk_popover_item_activate), item);
438 }
439
440 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (widget), "GtkMenuTrackerItem", g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (item), g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).);
441
442 if (box->circularcxx . . $ _GtkMenuSectionBox#circular.)
443 {
444 gtk_widget_set_hexpandcxx . . $ gtk_widget_set_hexpand(81f145f668a0074f). (widget, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
445 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (widget, GTK_ALIGN_CENTERcxx . . $ GTK_ALIGN_CENTER.);
446 }
447 else
448 {
449 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (widget, GTK_ALIGN_FILLcxx . . $ GTK_ALIGN_FILL.);
450 }
451 gtk_box_appendcxx . . $ gtk_box_append(72f3a0256788ecaf). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box->item_box), widget);
452
453 if (position == 0)
454 gtk_box_reorder_child_aftercxx . . $ gtk_box_reorder_child_after(d0ded8d662e2b046). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box->item_box), widget, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
455 else
456 {
457 GtkWidgetcxx . . $ GtkWidget# *sibling = gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->item_box));
458 int i;
459 for (i = 1; i < position; i++)
460 sibling = gtk_widget_get_next_siblingcxx . . $ gtk_widget_get_next_sibling(ef973e1b01680070). (sibling);
461 gtk_box_reorder_child_aftercxx . . $ gtk_box_reorder_child_after(d0ded8d662e2b046). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box->item_box), widget, sibling);
462 }
463
464 if (box->circularcxx . . $ _GtkMenuSectionBox#circular.)
465 {
466 GtkWidgetcxx . . $ GtkWidget# *c1, *c2, *c3;
467
468 /* special-case the n > 2 case */
469 c1 = gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->item_box));
470 if ((c2 = gtk_widget_get_next_siblingcxx . . $ gtk_widget_get_next_sibling(ef973e1b01680070). (c1)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! &&
471 (c3 = gtk_widget_get_next_siblingcxx . . $ gtk_widget_get_next_sibling(ef973e1b01680070). (c2)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
472 {
473 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (c1, GTK_ALIGN_STARTcxx . . $ GTK_ALIGN_START.);
474 while (c3 != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
475 {
476 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (c2, GTK_ALIGN_CENTERcxx . . $ GTK_ALIGN_CENTER.);
477 c2 = c3;
478 c3 = gtk_widget_get_next_siblingcxx . . $ gtk_widget_get_next_sibling(ef973e1b01680070). (c3);
479 }
480 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (c2, GTK_ALIGN_ENDcxx . . $ GTK_ALIGN_END.);
481 }
482 }
483
484 gtk_menu_section_box_schedule_separator_synccxx . . $ gtk_menu_section_box_schedule_separator_sync(8036681e749c5d60). (box);
485 }
486
487 static void
488 gtk_menu_section_box_initcxx . . $ gtk_menu_section_box_init(8036681e749c5d60). (GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box)
489 {
490 GtkWidgetcxx . . $ GtkWidget# *item_box;
491
492 gtk_orientable_set_orientationcxx . . $ gtk_orientable_set_orientation(8171de8e2702f829). (GTK_ORIENTABLEcxx . . $ `gtk/gtkorientable.h:33:9`! (box), GTK_ORIENTATION_VERTICALcxx . . $ GTK_ORIENTATION_VERTICAL.);
493
494 box->toplevelcxx . . $ _GtkMenuSectionBox#toplevel. = box;
495
496 item_box = gtk_box_newcxx . . $ gtk_box_new(b19e0ce02196028e). (GTK_ORIENTATION_VERTICALcxx . . $ GTK_ORIENTATION_VERTICAL., 0);
497 box->item_boxcxx . . $ _GtkMenuSectionBox#item_box. = GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (item_box);
498 gtk_box_appendcxx . . $ gtk_box_append(72f3a0256788ecaf). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box), item_box);
499 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (item_box), GTK_ALIGN_FILLcxx . . $ GTK_ALIGN_FILL.);
500 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box), GTK_ALIGN_FILLcxx . . $ GTK_ALIGN_FILL.);
501 }
502
503 static void
504 gtk_menu_section_box_disposecxx . . $ gtk_menu_section_box_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
505 {
506 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box = GTK_MENU_SECTION_BOXcxx . . $ `gtk/gtkmenusectionboxprivate.h:29:9`! (object);
507
508 if (box->separator_sync_idlecxx . . $ _GtkMenuSectionBox#separator_sync_idle.)
509 {
510 g_source_removecxx . . $ g_source_remove(4c679297bf94b9eb). (box->separator_sync_idlecxx . . $ _GtkMenuSectionBox#separator_sync_idle.);
511 box->separator_sync_idlecxx . . $ _GtkMenuSectionBox#separator_sync_idle. = 0;
512 }
513
514 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&box->separator);
515
516 if (box->trackercxx . . $ _GtkMenuSectionBox#tracker.)
517 {
518 gtk_menu_tracker_freecxx . . $ gtk_menu_tracker_free(150a0784250ac808). (box->trackercxx . . $ _GtkMenuSectionBox#tracker.);
519 box->trackercxx . . $ _GtkMenuSectionBox#tracker. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
520 }
521
522 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&box->indicators);
523 g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&box->custom_slots, g_hash_table_unref);
524
525 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gtk_menu_section_box_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object);
526 }
527
528 static void
529 gtk_menu_section_box_class_initcxx . . $ gtk_menu_section_box_class_init(2d4adbfffcb6412). (GtkMenuSectionBoxClasscxx . . $ GtkMenuSectionBoxClass# *class)
530 {
531 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (class)->disposecxx . . $ _GObjectClass#dispose. = gtk_menu_section_box_disposecxx . . $ gtk_menu_section_box_dispose(6087475fa43034d3).;
532 }
533
534 static void
535 update_popover_position_cbcxx . . $ update_popover_position_cb(84a341b7c72eb27). (GObjectcxx . . $ GObject# *source,
536 GParamSpeccxx . . $ GParamSpec# *spec,
537 gpointercxx . . $ gpointer# *user_data)
538 {
539 GtkPopovercxx . . $ GtkPopover# *popover = GTK_POPOVERcxx . . $ `gtk/gtkpopover.h:32:9`! (source);
540 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box = GTK_MENU_SECTION_BOXcxx . . $ `gtk/gtkmenusectionboxprivate.h:29:9`! (user_data);
541 GtkWidgetcxx . . $ GtkWidget# *w;
542
543 GtkPositionTypecxx . . $ GtkPositionType# new_pos = gtk_popover_get_positioncxx . . $ gtk_popover_get_position(fdc9b57637d0f1cd). (popover);
544
545 for (w = gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (gtk_widget_get_parentcxx . . $ gtk_widget_get_parent(ef973e1b01680070). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box)));
546 w != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
547 w = gtk_widget_get_next_siblingcxx . . $ gtk_widget_get_next_sibling(ef973e1b01680070). (w))
548 {
549 if (new_pos == GTK_POS_BOTTOMcxx . . $ GTK_POS_BOTTOM.)
550 gtk_widget_set_valigncxx . . $ gtk_widget_set_valign(71362b4a1e4eb244). (w, GTK_ALIGN_STARTcxx . . $ GTK_ALIGN_START.);
551 else if (new_pos == GTK_POS_TOPcxx . . $ GTK_POS_TOP.)
552 gtk_widget_set_valigncxx . . $ gtk_widget_set_valign(71362b4a1e4eb244). (w, GTK_ALIGN_ENDcxx . . $ GTK_ALIGN_END.);
553 else
554 gtk_widget_set_valigncxx . . $ gtk_widget_set_valign(71362b4a1e4eb244). (w, GTK_ALIGN_CENTERcxx . . $ GTK_ALIGN_CENTER.);
555 }
556 }
557
558 void
559 gtk_menu_section_box_new_toplevelcxx . . $ gtk_menu_section_box_new_toplevel(ac2226ca7b307f82). (GtkPopoverMenucxx . . $ GtkPopoverMenu# *popover,
560 GMenuModelcxx . . $ GMenuModel# *model,
561 GtkPopoverMenuFlagscxx . . $ GtkPopoverMenuFlags# flags)
562 {
563 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box;
564
565 box = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_MENU_SECTION_BOXcxx . . $ `gtk/gtkmenusectionboxprivate.h:28:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
566 box->indicatorscxx . . $ _GtkMenuSectionBox#indicators. = gtk_size_group_newcxx . . $ gtk_size_group_new(178ffe5e7fb365b9). (GTK_SIZE_GROUP_HORIZONTALcxx . . $ GTK_SIZE_GROUP_HORIZONTAL.);
567 box->custom_slotscxx . . $ _GtkMenuSectionBox#custom_slots. = g_hash_table_newcxx . . $ g_hash_table_new(444186de27d60923). (g_str_hashcxx . . $ g_str_hash(b11f534102b1ad6)., g_str_equalcxx . . $ g_str_equal(9148c8c3ff42c9d8).);
568 box->flagscxx . . $ _GtkMenuSectionBox#flags. = flags;
569
570 gtk_popover_menu_add_submenucxx . . $ gtk_popover_menu_add_submenu(ead94046266943b8). (popover, GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box), "main");
571
572 box->trackercxx . . $ _GtkMenuSectionBox#tracker. = gtk_menu_tracker_newcxx . . $ gtk_menu_tracker_new(c776749331e6c703). (GTK_ACTION_OBSERVABLEcxx . . $ `gtk/gtkactionobservableprivate.h:27:9`! (_gtk_widget_get_action_muxer (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box), TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!)),
573 model, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
574 gtk_menu_section_box_insert_funccxx . . $ gtk_menu_section_box_insert_func(2eb6bed35727c4d2).,
575 gtk_menu_section_box_remove_funccxx . . $ gtk_menu_section_box_remove_func(6ca3d68f5c5f0975)., box);
576
577 g_signal_connect_objectcxx . . $ g_signal_connect_object(567cfbe0c886a38e). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (popover), "notify::position", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (update_popover_position_cb), box, G_CONNECT_DEFAULTcxx . . $ G_CONNECT_DEFAULT.);
578 }
579
580 static void
581 gtk_menu_section_box_new_submenucxx . . $ gtk_menu_section_box_new_submenu(98eb698d9520e0fd). (GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item,
582 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *toplevel,
583 GtkWidgetcxx . . $ GtkWidget# *focus,
584 const char *name)
585 {
586 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box;
587 GtkWidgetcxx . . $ GtkWidget# *button;
588
589 box = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_MENU_SECTION_BOXcxx . . $ `gtk/gtkmenusectionboxprivate.h:28:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
590 box->indicatorscxx . . $ _GtkMenuSectionBox#indicators. = gtk_size_group_newcxx . . $ gtk_size_group_new(178ffe5e7fb365b9). (GTK_SIZE_GROUP_HORIZONTALcxx . . $ GTK_SIZE_GROUP_HORIZONTAL.);
591 box->custom_slotscxx . . $ _GtkMenuSectionBox#custom_slots. = g_hash_table_refcxx . . $ g_hash_table_ref(32c77d737e0ec0f5). (toplevel->custom_slotscxx . . $ _GtkMenuSectionBox#custom_slots.);
592 box->flagscxx . . $ _GtkMenuSectionBox#flags. = toplevel->flagscxx . . $ _GtkMenuSectionBox#flags.;
593
594 button = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_MODEL_BUTTONcxx . . $ `gtk/gtkmodelbuttonprivate.h:26:9`!,
595 "menu-name", name,
596 "role", GTK_BUTTON_ROLE_TITLEcxx . . $ GTK_BUTTON_ROLE_TITLE.,
597 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
598
599 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "label", button, "text", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
600 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "icon", button, "icon", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
601
602 g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (button), "focus", focus);
603 g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (focus), "focus", button);
604
605 gtk_box_insert_child_aftercxx . . $ gtk_box_insert_child_after(d0ded8d662e2b046). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box), button, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
606
607 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (focus, "clicked", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (open_submenu), item);
608 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (button, "clicked", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (close_submenu), item);
609
610 gtk_stack_add_namedcxx . . $ gtk_stack_add_named(bfc95f2c70619af8). (GTK_STACKcxx . . $ `gtk/gtkstack.h:35:9`! (gtk_widget_get_ancestor (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (toplevel), GTK_TYPE_STACKcxx . . $ `gtk/gtkstack.h:34:9`!)),
611 GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box), gtk_menu_tracker_item_get_labelcxx . . $ gtk_menu_tracker_item_get_label(dccc92de3a185c7c). (item));
612
613 box->trackercxx . . $ _GtkMenuSectionBox#tracker. = gtk_menu_tracker_new_for_item_linkcxx . . $ gtk_menu_tracker_new_for_item_link(1fd6cac66d61909e). (item, G_MENU_LINK_SUBMENUcxx . . $ `<external>/17783962342109199441/gmenumodel.h:100:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!,
614 gtk_menu_section_box_insert_funccxx . . $ gtk_menu_section_box_insert_func(2eb6bed35727c4d2).,
615 gtk_menu_section_box_remove_funccxx . . $ gtk_menu_section_box_remove_func(6ca3d68f5c5f0975).,
616 box);
617 }
618
619 static GtkWidgetcxx . . $ GtkWidget# *
620 gtk_menu_section_box_new_sectioncxx . . $ gtk_menu_section_box_new_section(70715fb1f4a9316c). (GtkMenuTrackerItemcxx . . $ GtkMenuTrackerItem# *item,
621 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *parent)
622 {
623 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box;
624 const char *label;
625 const char *hint;
626 const char *text_direction;
627
628 box = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_MENU_SECTION_BOXcxx . . $ `gtk/gtkmenusectionboxprivate.h:28:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
629 box->indicatorscxx . . $ _GtkMenuSectionBox#indicators. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (parent->indicators);
630 box->custom_slotscxx . . $ _GtkMenuSectionBox#custom_slots. = g_hash_table_refcxx . . $ g_hash_table_ref(32c77d737e0ec0f5). (parent->toplevelcxx . . $ _GtkMenuSectionBox#toplevel.->custom_slotscxx . . $ _GtkMenuSectionBox#custom_slots.);
631 box->toplevelcxx . . $ _GtkMenuSectionBox#toplevel. = parent->toplevelcxx . . $ _GtkMenuSectionBox#toplevel.;
632 box->depthcxx . . $ _GtkMenuSectionBox#depth. = parent->depthcxx . . $ _GtkMenuSectionBox#depth. + 1;
633 box->flagscxx . . $ _GtkMenuSectionBox#flags. = parent->flagscxx . . $ _GtkMenuSectionBox#flags.;
634
635 label = gtk_menu_tracker_item_get_labelcxx . . $ gtk_menu_tracker_item_get_label(dccc92de3a185c7c). (item);
636 hint = gtk_menu_tracker_item_get_display_hintcxx . . $ gtk_menu_tracker_item_get_display_hint(dccc92de3a185c7c). (item);
637 text_direction = gtk_menu_tracker_item_get_text_directioncxx . . $ gtk_menu_tracker_item_get_text_direction(dccc92de3a185c7c). (item);
638
639 if (hint && g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (hint, "horizontal-buttons"))
640 {
641 gtk_box_set_homogeneouscxx . . $ gtk_box_set_homogeneous(aaaf6a087046aaad). (box->item_boxcxx . . $ _GtkMenuSectionBox#item_box., TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
642 gtk_orientable_set_orientationcxx . . $ gtk_orientable_set_orientation(8171de8e2702f829). (GTK_ORIENTABLEcxx . . $ `gtk/gtkorientable.h:33:9`! (box->item_box), GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL.);
643 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->item_box), "linked");
644 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->item_box), "horizontal-buttons");
645 box->iconiccxx . . $ _GtkMenuSectionBox#iconic. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
646
647 if (text_direction)
648 {
649 GtkTextDirectioncxx . . $ GtkTextDirection# dir = GTK_TEXT_DIR_NONEcxx . . $ GTK_TEXT_DIR_NONE.;
650
651 if (g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (text_direction, "rtl"))
652 dir = GTK_TEXT_DIR_RTLcxx . . $ GTK_TEXT_DIR_RTL.;
653 else if (g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (text_direction, "ltr"))
654 dir = GTK_TEXT_DIR_LTRcxx . . $ GTK_TEXT_DIR_LTR.;
655
656 gtk_widget_set_directioncxx . . $ gtk_widget_set_direction(ca8bba12f0ec948f). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->item_box), dir);
657 }
658 }
659 else if (hint && g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (hint, "inline-buttons"))
660 {
661 GtkWidgetcxx . . $ GtkWidget# *item_box;
662 GtkWidgetcxx . . $ GtkWidget# *spacer;
663
664 box->inline_buttonscxx . . $ _GtkMenuSectionBox#inline_buttons. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
665
666 gtk_orientable_set_orientationcxx . . $ gtk_orientable_set_orientation(8171de8e2702f829). (GTK_ORIENTABLEcxx . . $ `gtk/gtkorientable.h:33:9`! (box->item_box), GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL.);
667 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->item_box), "inline-buttons");
668
669 spacer = gtk_gizmo_newcxx . . $ gtk_gizmo_new(bef4db173a6affd). ("none", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
670 gtk_box_appendcxx . . $ gtk_box_append(72f3a0256788ecaf). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box->item_box), spacer);
671 gtk_size_group_add_widgetcxx . . $ gtk_size_group_add_widget(1c29cbce5c69a315). (box->indicatorscxx . . $ _GtkMenuSectionBox#indicators., spacer);
672
673 if (label != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
674 {
675 GtkWidgetcxx . . $ GtkWidget# *title;
676
677 title = gtk_label_newcxx . . $ gtk_label_new(6d90f3ec8782e10d). (label);
678 gtk_widget_set_hexpandcxx . . $ gtk_widget_set_hexpand(81f145f668a0074f). (title, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
679 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (title, GTK_ALIGN_STARTcxx . . $ GTK_ALIGN_START.);
680 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "label", title, "label", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
681 gtk_box_appendcxx . . $ gtk_box_append(72f3a0256788ecaf). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box->item_box), title);
682 gtk_accessible_update_relationcxx . . $ gtk_accessible_update_relation(ee5ad1c3df8c751). (GTK_ACCESSIBLEcxx . . $ GTK_ACCESSIBLE(4ecffd44f086533a). (box),
683 GTK_ACCESSIBLE_RELATION_LABELLED_BYcxx . . $ GTK_ACCESSIBLE_RELATION_LABELLED_BY.,
684 title,
685 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, -1);
686 }
687
688 item_box = gtk_box_newcxx . . $ gtk_box_new(b19e0ce02196028e). (GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL., 0);
689 gtk_box_appendcxx . . $ gtk_box_append(72f3a0256788ecaf). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box->item_box), item_box);
690 box->item_boxcxx . . $ _GtkMenuSectionBox#item_box. = GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (item_box);
691 }
692 else if (hint && g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (hint, "circular-buttons"))
693 {
694 gtk_box_set_homogeneouscxx . . $ gtk_box_set_homogeneous(aaaf6a087046aaad). (box->item_boxcxx . . $ _GtkMenuSectionBox#item_box., TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
695 gtk_orientable_set_orientationcxx . . $ gtk_orientable_set_orientation(8171de8e2702f829). (GTK_ORIENTABLEcxx . . $ `gtk/gtkorientable.h:33:9`! (box->item_box), GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL.);
696 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box->item_box), "circular-buttons");
697 box->circularcxx . . $ _GtkMenuSectionBox#circular. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
698 }
699
700 if (label != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && !box->inline_buttonscxx . . $ _GtkMenuSectionBox#inline_buttons.)
701 {
702 GtkWidgetcxx . . $ GtkWidget# *separator;
703 GtkWidgetcxx . . $ GtkWidget# *title;
704
705 box->separatorcxx . . $ _GtkMenuSectionBox#separator. = gtk_box_newcxx . . $ gtk_box_new(b19e0ce02196028e). (GTK_ORIENTATION_VERTICALcxx . . $ GTK_ORIENTATION_VERTICAL., 0);
706 g_object_ref_sinkcxx . . $ `<external>/1341695927569185362/gobject.h:534:9`! (box->separator);
707
708 separator = gtk_separator_newcxx . . $ gtk_separator_new(a67c098c83382a30). (GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL.);
709 gtk_widget_set_valigncxx . . $ gtk_widget_set_valign(71362b4a1e4eb244). (separator, GTK_ALIGN_CENTERcxx . . $ GTK_ALIGN_CENTER.);
710 gtk_widget_set_hexpandcxx . . $ gtk_widget_set_hexpand(81f145f668a0074f). (separator, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
711 gtk_box_appendcxx . . $ gtk_box_append(72f3a0256788ecaf). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box->separator), separator);
712
713 title = gtk_label_newcxx . . $ gtk_label_new(6d90f3ec8782e10d). (label);
714 g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (item, "label", title, "label", G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.);
715 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (title, "separator");
716 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (title, GTK_ALIGN_STARTcxx . . $ GTK_ALIGN_START.);
717 gtk_label_set_xaligncxx . . $ gtk_label_set_xalign(5155ad053c7b621). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (title), 0.0);
718 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (title, "title");
719 gtk_box_appendcxx . . $ gtk_box_append(72f3a0256788ecaf). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box->separator), title);
720 gtk_accessible_update_relationcxx . . $ gtk_accessible_update_relation(ee5ad1c3df8c751). (GTK_ACCESSIBLEcxx . . $ GTK_ACCESSIBLE(4ecffd44f086533a). (box),
721 GTK_ACCESSIBLE_RELATION_LABELLED_BYcxx . . $ GTK_ACCESSIBLE_RELATION_LABELLED_BY.,
722 title,
723 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, -1);
724 }
725 else
726 {
727 box->separatorcxx . . $ _GtkMenuSectionBox#separator. = gtk_separator_newcxx . . $ gtk_separator_new(a67c098c83382a30). (GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL.);
728 g_object_ref_sinkcxx . . $ `<external>/1341695927569185362/gobject.h:534:9`! (box->separator);
729 }
730
731 box->trackercxx . . $ _GtkMenuSectionBox#tracker. = gtk_menu_tracker_new_for_item_linkcxx . . $ gtk_menu_tracker_new_for_item_link(1fd6cac66d61909e). (item, G_MENU_LINK_SECTIONcxx . . $ `<external>/17783962342109199441/gmenumodel.h:113:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!,
732 gtk_menu_section_box_insert_funccxx . . $ gtk_menu_section_box_insert_func(2eb6bed35727c4d2).,
733 gtk_menu_section_box_remove_funccxx . . $ gtk_menu_section_box_remove_func(6ca3d68f5c5f0975).,
734 box);
735
736 return GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (box);
737 }
738
739 gbooleancxx . . $ gboolean#
740 gtk_menu_section_box_add_customcxx . . $ gtk_menu_section_box_add_custom(5fd616c27faf4d8c). (GtkPopoverMenucxx . . $ GtkPopoverMenu# *popover,
741 GtkWidgetcxx . . $ GtkWidget# *child,
742 const char *id)
743 {
744 GtkWidgetcxx . . $ GtkWidget# *stack;
745 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box;
746 GtkWidgetcxx . . $ GtkWidget# *slot;
747
748 stack = gtk_popover_menu_get_stackcxx . . $ gtk_popover_menu_get_stack(63f594d8228c9907). (popover);
749 box = GTK_MENU_SECTION_BOXcxx . . $ `gtk/gtkmenusectionboxprivate.h:29:9`! (gtk_stack_get_child_by_name (GTK_STACKcxx . . $ `gtk/gtkstack.h:35:9`! (stack), "main"));
750 if (box == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
751 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
752
753 slot = (GtkWidgetcxx . . $ GtkWidget# *)g_hash_table_lookupcxx . . $ g_hash_table_lookup(8183d62c39a6a245). (box->custom_slotscxx . . $ _GtkMenuSectionBox#custom_slots., id);
754
755 if (slot == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
756 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
757
758 if (gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (slot))
759 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
760
761 gtk_widget_insert_beforecxx . . $ gtk_widget_insert_before(72c16b162d9e96e5). (child, slot, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
762 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
763 }
764
765 gbooleancxx . . $ gboolean#
766 gtk_menu_section_box_remove_customcxx . . $ gtk_menu_section_box_remove_custom(ef6da3bfcc2cfde0). (GtkPopoverMenucxx . . $ GtkPopoverMenu# *popover,
767 GtkWidgetcxx . . $ GtkWidget# *child)
768 {
769 GtkWidgetcxx . . $ GtkWidget# *stack;
770 GtkMenuSectionBoxcxx . . $ GtkMenuSectionBox# *box;
771 GtkWidgetcxx . . $ GtkWidget# *parent;
772 const char *id;
773 GtkWidgetcxx . . $ GtkWidget# *slot;
774
775 stack = gtk_popover_menu_get_stackcxx . . $ gtk_popover_menu_get_stack(63f594d8228c9907). (popover);
776 box = GTK_MENU_SECTION_BOXcxx . . $ `gtk/gtkmenusectionboxprivate.h:29:9`! (gtk_stack_get_child_by_name (GTK_STACKcxx . . $ `gtk/gtkstack.h:35:9`! (stack), "main"));
777 if (box == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
778 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
779
780 parent = gtk_widget_get_parentcxx . . $ gtk_widget_get_parent(ef973e1b01680070). (child);
781
782 id = (const char *) g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (parent), "slot-id");
783 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
784
785 slot = (GtkWidgetcxx . . $ GtkWidget# *)g_hash_table_lookupcxx . . $ g_hash_table_lookup(8183d62c39a6a245). (box->custom_slotscxx . . $ _GtkMenuSectionBox#custom_slots., id);
786
787 if (slot != parent)
788 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
789
790 gtk_widget_unparentcxx . . $ gtk_widget_unparent(d7cf858254b37903). (child);
791
792 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
793 }