Debian Codegraph @

gtk/gtkoverlay.c

raw symbols SCIP
1 /*
2 * gtkoverlay.c
3 * This file is part of gtk
4 *
5 * Copyright (C) 2011 - Ignacio Casal Quinteiro, Mike Krüger
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "config.h"cxx . . $ `<file>/build/config.h`/
22
23 #include "gtkoverlay.h"cxx . . $ `<file>/gtk/gtkoverlay.h`/
24
25 #include "gtkoverlaylayout.h"cxx . . $ `<file>/gtk/gtkoverlaylayout.h`/
26 #include "gtkbuildable.h"cxx . . $ `<file>/gtk/gtkbuildable.h`/
27 #include "gtkbuilderprivate.h"cxx . . $ `<file>/gtk/gtkbuilderprivate.h`/
28 #include "gtkmarshalers.h"cxx . . $ `<file>/build/gtk/gtkmarshalers.h`/
29 #include "gtkprivate.h"cxx . . $ `<file>/gtk/gtkprivate.h`/
30 #include "gtkscrolledwindow.h"cxx . . $ `<file>/gtk/gtkscrolledwindow.h`/
31 #include "gtksnapshot.h"cxx . . $ `<file>/gtk/gtksnapshot.h`/
32 #include "gtkwidgetprivate.h"cxx . . $ `<file>/gtk/gtkwidgetprivate.h`/
33
34 /**
35 * GtkOverlay
36 *
37 * Places “overlay” widgets on top of a single main child.
38 *
39 * <picture>
40 * <source srcset="overlay-dark.png" media="(prefers-color-scheme: dark)">
41 * <img alt="An example GtkOverlay" src="overlay.png">
42 * </picture>
43 *
44 * The position of each overlay widget is determined by its
45 * [[email protected]:halign] and [[email protected]:valign]
46 * properties. E.g. a widget with both alignments set to %GTK_ALIGN_START
47 * will be placed at the top left corner of the `GtkOverlay` container,
48 * whereas an overlay with halign set to %GTK_ALIGN_CENTER and valign set
49 * to %GTK_ALIGN_END will be placed a the bottom edge of the `GtkOverlay`,
50 * horizontally centered. The position can be adjusted by setting the margin
51 * properties of the child to non-zero values.
52 *
53 * More complicated placement of overlays is possible by connecting
54 * to the [[email protected]::get-child-position] signal.
55 *
56 * An overlay’s minimum and natural sizes are those of its main child.
57 * The sizes of overlay children are not considered when measuring these
58 * preferred sizes.
59 *
60 * # GtkOverlay as GtkBuildable
61 *
62 * The `GtkOverlay` implementation of the `GtkBuildable` interface
63 * supports placing a child as an overlay by specifying “overlay” as
64 * the “type” attribute of a `<child>` element.
65 *
66 * # CSS nodes
67 *
68 * `GtkOverlay` has a single CSS node with the name “overlay”. Overlay children
69 * whose alignments cause them to be positioned at an edge get the style classes
70 * “.left”, “.right”, “.top”, and/or “.bottom” according to their position.
71 */
72
73 enumcxx . . $ $anonymous_type_bfca4b5e23f3ae7d_0# {
74 GET_CHILD_POSITIONcxx . . $ GET_CHILD_POSITION.,
75 LAST_SIGNALcxx . . $ LAST_SIGNAL.
76 };
77
78 static guintcxx . . $ guint# signalscxx . . $ signals.[LAST_SIGNALcxx . . $ LAST_SIGNAL.] = { 0 };
79
80 enumcxx . . $ $anonymous_type_bfca4b5e23f3ae7d_1# {
81 PROP_CHILDcxx . . $ PROP_CHILD. = 1
82 };
83
84 static void gtk_overlay_buildable_initcxx . . $ gtk_overlay_buildable_init(c5db55232772c4cd). (GtkBuildableIfacecxx . . $ GtkBuildableIface# *iface);
85
86 typedef struct _GtkOverlayClasscxx . . $ _GtkOverlayClass# GtkOverlayClasscxx . . $ GtkOverlayClass#;
87
88 struct _GtkOverlaycxx . . $ _GtkOverlay#
89 {
90 GtkWidgetcxx . . $ GtkWidget# parent_instancecxx . . $ _GtkOverlay#parent_instance.;
91
92 GtkWidgetcxx . . $ GtkWidget# *childcxx . . $ _GtkOverlay#child.;
93 };
94
95 struct _GtkOverlayClasscxx . . $ _GtkOverlayClass#
96 {
97 GtkWidgetClasscxx . . $ GtkWidgetClass# parent_classcxx . . $ _GtkOverlayClass#parent_class.;
98
99 gbooleancxx . . $ gboolean# (*get_child_positioncxx . . $ _GtkOverlayClass#get_child_position.) (GtkOverlaycxx . . $ GtkOverlay# *overlay,
100 GtkWidgetcxx . . $ GtkWidget# *widget,
101 GtkAllocationcxx . . $ GtkAllocation# *allocation);
102 };
103
104 G_DEFINE_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1850:9`! (GtkOverlay, gtk_overlay, GTK_TYPE_WIDGETcxx . . $ `gtk/gtkwidget.h:43:9`!,
105 G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (GTK_TYPE_BUILDABLEcxx . . $ `gtk/gtkbuildable.h:29:9`!,
106 gtk_overlay_buildable_init))
107
108 static GtkAligncxx . . $ GtkAlign#
109 effective_aligncxx . . $ effective_align(408c22e46a737f03). (GtkAligncxx . . $ GtkAlign# align,
110 GtkTextDirectioncxx . . $ GtkTextDirection# direction)
111 {
112 switch (align)
113 {
114 case GTK_ALIGN_STARTcxx . . $ GTK_ALIGN_START.:
115 return direction == GTK_TEXT_DIR_RTLcxx . . $ GTK_TEXT_DIR_RTL. ? GTK_ALIGN_ENDcxx . . $ GTK_ALIGN_END. : GTK_ALIGN_STARTcxx . . $ GTK_ALIGN_START.;
116 case GTK_ALIGN_ENDcxx . . $ GTK_ALIGN_END.:
117 return direction == GTK_TEXT_DIR_RTLcxx . . $ GTK_TEXT_DIR_RTL. ? GTK_ALIGN_STARTcxx . . $ GTK_ALIGN_START. : GTK_ALIGN_ENDcxx . . $ GTK_ALIGN_END.;
118 case GTK_ALIGN_FILLcxx . . $ GTK_ALIGN_FILL.:
119 case GTK_ALIGN_CENTERcxx . . $ GTK_ALIGN_CENTER.:
120 case GTK_ALIGN_BASELINE_FILLcxx . . $ GTK_ALIGN_BASELINE_FILL.:
121 case GTK_ALIGN_BASELINE_CENTERcxx . . $ GTK_ALIGN_BASELINE_CENTER.:
122 default:
123 return align;
124 }
125 }
126
127 static gbooleancxx . . $ gboolean#
128 gtk_overlay_get_child_positioncxx . . $ gtk_overlay_get_child_position(4390c798782b6d50). (GtkOverlaycxx . . $ GtkOverlay# *overlay,
129 GtkWidgetcxx . . $ GtkWidget# *widget,
130 GtkAllocationcxx . . $ GtkAllocation# *alloc)
131 {
132 GtkRequisitioncxx . . $ GtkRequisition# min, req;
133 GtkAligncxx . . $ GtkAlign# halign;
134 GtkTextDirectioncxx . . $ GtkTextDirection# direction;
135 int width, height;
136
137 gtk_widget_get_preferred_sizecxx . . $ gtk_widget_get_preferred_size(a04c30c006717235). (widget, &min, &req);
138 width = gtk_widget_get_widthcxx . . $ gtk_widget_get_width(9247ef2dc26c5426). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (overlay));
139 height = gtk_widget_get_heightcxx . . $ gtk_widget_get_height(9247ef2dc26c5426). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (overlay));
140
141 alloc->xcxx . . $ _cairo_rectangle_int#x. = 0;
142 alloc->widthcxx . . $ _cairo_rectangle_int#width. = MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (min.width, MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (width, req.width));
143
144 direction = _gtk_widget_get_directioncxx . . $ _gtk_widget_get_direction(a6537c3bfdacec30). (widget);
145
146 halign = gtk_widget_get_haligncxx . . $ gtk_widget_get_halign(66a538eaafe45e9). (widget);
147 switch (effective_aligncxx . . $ effective_align(408c22e46a737f03). (halign, direction))
148 {
149 case GTK_ALIGN_STARTcxx . . $ GTK_ALIGN_START.:
150 /* nothing to do */
151 break;
152 case GTK_ALIGN_FILLcxx . . $ GTK_ALIGN_FILL.:
153 alloc->widthcxx . . $ _cairo_rectangle_int#width. = MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (alloc->width, width);
154 break;
155 case GTK_ALIGN_CENTERcxx . . $ GTK_ALIGN_CENTER.:
156 alloc->xcxx . . $ _cairo_rectangle_int#x. += width / 2 - alloc->widthcxx . . $ _cairo_rectangle_int#width. / 2;
157 break;
158 case GTK_ALIGN_ENDcxx . . $ GTK_ALIGN_END.:
159 alloc->xcxx . . $ _cairo_rectangle_int#x. += width - alloc->widthcxx . . $ _cairo_rectangle_int#width.;
160 break;
161 case GTK_ALIGN_BASELINE_FILLcxx . . $ GTK_ALIGN_BASELINE_FILL.:
162 case GTK_ALIGN_BASELINE_CENTERcxx . . $ GTK_ALIGN_BASELINE_CENTER.:
163 default:
164 g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! ();
165 break;
166 }
167
168 alloc->ycxx . . $ _cairo_rectangle_int#y. = 0;
169 alloc->heightcxx . . $ _cairo_rectangle_int#height. = MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (min.height, MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (height, req.height));
170
171 switch (gtk_widget_get_valigncxx . . $ gtk_widget_get_valign(66a538eaafe45e9). (widget))
172 {
173 case GTK_ALIGN_STARTcxx . . $ GTK_ALIGN_START.:
174 /* nothing to do */
175 break;
176 case GTK_ALIGN_FILLcxx . . $ GTK_ALIGN_FILL.:
177 alloc->heightcxx . . $ _cairo_rectangle_int#height. = MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (alloc->height, height);
178 break;
179 case GTK_ALIGN_CENTERcxx . . $ GTK_ALIGN_CENTER.:
180 alloc->ycxx . . $ _cairo_rectangle_int#y. += height / 2 - alloc->heightcxx . . $ _cairo_rectangle_int#height. / 2;
181 break;
182 case GTK_ALIGN_ENDcxx . . $ GTK_ALIGN_END.:
183 alloc->ycxx . . $ _cairo_rectangle_int#y. += height - alloc->heightcxx . . $ _cairo_rectangle_int#height.;
184 break;
185 case GTK_ALIGN_BASELINE_FILLcxx . . $ GTK_ALIGN_BASELINE_FILL.:
186 case GTK_ALIGN_BASELINE_CENTERcxx . . $ GTK_ALIGN_BASELINE_CENTER.:
187 default:
188 g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! ();
189 break;
190 }
191
192 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
193 }
194
195 static void
196 gtk_overlay_snapshot_childcxx . . $ gtk_overlay_snapshot_child(70f87a8b59fe0054). (GtkWidgetcxx . . $ GtkWidget# *overlay,
197 GtkWidgetcxx . . $ GtkWidget# *child,
198 GtkSnapshotcxx . . $ GtkSnapshot# *snapshot)
199 {
200 graphene_rect_tcxx . . $ graphene_rect_t# bounds;
201 gbooleancxx . . $ gboolean# clip_set;
202
203 clip_set = gtk_overlay_get_clip_overlaycxx . . $ gtk_overlay_get_clip_overlay(df18ce0a731c2319). (GTK_OVERLAYcxx . . $ `gtk/gtkoverlay.h:32:9`! (overlay), child);
204
205 if (!clip_set)
206 {
207 gtk_widget_snapshot_childcxx . . $ gtk_widget_snapshot_child(70f87a8b59fe0054). (overlay, child, snapshot);
208 return;
209 }
210
211 graphene_rect_initcxx . . $ graphene_rect_init(41a513f04ded43b4). (&bounds, 0, 0,
212 gtk_widget_get_widthcxx . . $ gtk_widget_get_width(9247ef2dc26c5426). (overlay),
213 gtk_widget_get_heightcxx . . $ gtk_widget_get_height(9247ef2dc26c5426). (overlay));
214
215 gtk_snapshot_push_clipcxx . . $ gtk_snapshot_push_clip(f2e77ce91ee65beb). (snapshot, &bounds);
216 gtk_widget_snapshot_childcxx . . $ gtk_widget_snapshot_child(70f87a8b59fe0054). (overlay, child, snapshot);
217 gtk_snapshot_popcxx . . $ gtk_snapshot_pop(afbd0a0317d5665f). (snapshot);
218 }
219
220 static void
221 gtk_overlay_snapshotcxx . . $ gtk_overlay_snapshot(80012d1141bb3efa). (GtkWidgetcxx . . $ GtkWidget# *widget,
222 GtkSnapshotcxx . . $ GtkSnapshot# *snapshot)
223 {
224 GtkWidgetcxx . . $ GtkWidget# *child;
225
226 for (child = _gtk_widget_get_first_childcxx . . $ _gtk_widget_get_first_child(ef973e1b01680070). (widget);
227 child != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
228 child = _gtk_widget_get_next_siblingcxx . . $ _gtk_widget_get_next_sibling(ef973e1b01680070). (child))
229 {
230 gtk_overlay_snapshot_childcxx . . $ gtk_overlay_snapshot_child(70f87a8b59fe0054). (widget, child, snapshot);
231 }
232 }
233
234 static void
235 gtk_overlay_get_propertycxx . . $ gtk_overlay_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *object,
236 guintcxx . . $ guint# prop_id,
237 GValuecxx . . $ GValue# *value,
238 GParamSpeccxx . . $ GParamSpec# *pspec)
239 {
240 GtkOverlaycxx . . $ GtkOverlay# *overlay = GTK_OVERLAYcxx . . $ `gtk/gtkoverlay.h:32:9`! (object);
241
242 switch (prop_id)
243 {
244 case PROP_CHILDcxx . . $ PROP_CHILD.:
245 g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, gtk_overlay_get_childcxx . . $ gtk_overlay_get_child(8b07e496b0b290b7). (overlay));
246 break;
247
248 default:
249 G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec);
250 break;
251 }
252 }
253
254 static void
255 gtk_overlay_set_propertycxx . . $ gtk_overlay_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *object,
256 guintcxx . . $ guint# prop_id,
257 const GValuecxx . . $ GValue# *value,
258 GParamSpeccxx . . $ GParamSpec# *pspec)
259 {
260 GtkOverlaycxx . . $ GtkOverlay# *overlay = GTK_OVERLAYcxx . . $ `gtk/gtkoverlay.h:32:9`! (object);
261
262 switch (prop_id)
263 {
264 case PROP_CHILDcxx . . $ PROP_CHILD.:
265 gtk_overlay_set_childcxx . . $ gtk_overlay_set_child(e4d6ee1b9127570d). (overlay, g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value));
266 break;
267
268 default:
269 G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec);
270 break;
271 }
272 }
273
274 static void
275 gtk_overlay_disposecxx . . $ gtk_overlay_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
276 {
277 GtkOverlaycxx . . $ GtkOverlay# *overlay = GTK_OVERLAYcxx . . $ `gtk/gtkoverlay.h:32:9`! (object);
278 GtkWidgetcxx . . $ GtkWidget# *child;
279
280 g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&overlay->child, gtk_widget_unparent);
281
282 while ((child = gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (overlay))))
283 gtk_widget_unparentcxx . . $ gtk_widget_unparent(d7cf858254b37903). (child);
284
285 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gtk_overlay_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object);
286 }
287
288 static void
289 gtk_overlay_compute_expandcxx . . $ gtk_overlay_compute_expand(327d22ad06f230a). (GtkWidgetcxx . . $ GtkWidget# *widget,
290 gbooleancxx . . $ gboolean# *hexpand,
291 gbooleancxx . . $ gboolean# *vexpand)
292 {
293 GtkOverlaycxx . . $ GtkOverlay# *overlay = GTK_OVERLAYcxx . . $ `gtk/gtkoverlay.h:32:9`! (widget);
294
295 if (overlay->childcxx . . $ _GtkOverlay#child.)
296 {
297 *hexpand = gtk_widget_compute_expandcxx . . $ gtk_widget_compute_expand(4898acbd212220bc). (overlay->childcxx . . $ _GtkOverlay#child., GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL.);
298 *vexpand = gtk_widget_compute_expandcxx . . $ gtk_widget_compute_expand(4898acbd212220bc). (overlay->childcxx . . $ _GtkOverlay#child., GTK_ORIENTATION_VERTICALcxx . . $ GTK_ORIENTATION_VERTICAL.);
299 }
300 else
301 {
302 *hexpand = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
303 *vexpand = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
304 }
305 }
306
307 static void
308 gtk_overlay_class_initcxx . . $ gtk_overlay_class_init(e3ab55c699fc22e8). (GtkOverlayClasscxx . . $ GtkOverlayClass# *klass)
309 {
310 GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass);
311 GtkWidgetClasscxx . . $ GtkWidgetClass# *widget_class = GTK_WIDGET_CLASScxx . . $ `gtk/gtkwidget.h:45:9`! (klass);
312
313 object_class->disposecxx . . $ _GObjectClass#dispose. = gtk_overlay_disposecxx . . $ gtk_overlay_dispose(6087475fa43034d3).;
314
315 object_class->get_propertycxx . . $ _GObjectClass#get_property. = gtk_overlay_get_propertycxx . . $ gtk_overlay_get_property(cee2c52f22407c66).;
316 object_class->set_propertycxx . . $ _GObjectClass#set_property. = gtk_overlay_set_propertycxx . . $ gtk_overlay_set_property(d7c4bb29f36c0dc4).;
317
318 widget_class->snapshotcxx . . $ _GtkWidgetClass#snapshot. = gtk_overlay_snapshotcxx . . $ gtk_overlay_snapshot(80012d1141bb3efa).;
319 widget_class->compute_expandcxx . . $ _GtkWidgetClass#compute_expand. = gtk_overlay_compute_expandcxx . . $ gtk_overlay_compute_expand(327d22ad06f230a).;
320
321 klass->get_child_positioncxx . . $ _GtkOverlayClass#get_child_position. = gtk_overlay_get_child_positioncxx . . $ gtk_overlay_get_child_position(4390c798782b6d50).;
322
323 /**
324 * GtkOverlay:child:
325 *
326 * The main child widget.
327 */
328 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (object_class,
329 PROP_CHILDcxx . . $ PROP_CHILD.,
330 g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("child", 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`!,
331 GTK_TYPE_WIDGETcxx . . $ `gtk/gtkwidget.h:43:9`!,
332 GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`!|G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.));
333
334 /**
335 * GtkOverlay::get-child-position:
336 * @overlay: the `GtkOverlay`
337 * @widget: the child widget to position
338 * @allocation: (type Gdk.Rectangle) (out caller-allocates): return
339 * location for the allocation
340 *
341 * Emitted to determine the position and size of any overlay
342 * child widgets.
343 *
344 * A handler for this signal should fill @allocation with
345 * the desired position and size for @widget, relative to
346 * the 'main' child of @overlay.
347 *
348 * The default handler for this signal uses the @widget's
349 * halign and valign properties to determine the position
350 * and gives the widget its natural size (except that an
351 * alignment of %GTK_ALIGN_FILL will cause the overlay to
352 * be full-width/height). If the main child is a
353 * `GtkScrolledWindow`, the overlays are placed relative
354 * to its contents.
355 *
356 * Returns: %TRUE if the @allocation has been filled
357 */
358 signalscxx . . $ signals.[GET_CHILD_POSITIONcxx . . $ GET_CHILD_POSITION.] =
359 g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (I_cxx . . $ `gdk/gdkprivate.h:35:9`!("get-child-position"),
360 G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (object_class),
361 G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST.,
362 G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GtkOverlayClass, get_child_position),
363 _gtk_boolean_handled_accumulatorcxx . . $ _gtk_boolean_handled_accumulator(76292f232a01f816)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
364 _gtk_marshal_BOOLEAN__OBJECT_BOXEDcxx . . $ _gtk_marshal_BOOLEAN__OBJECT_BOXED(cba270afb0f82555).,
365 G_TYPE_BOOLEANcxx . . $ `<external>/9567554376676449156/gtype.h:99:9`!, 2,
366 GTK_TYPE_WIDGETcxx . . $ `gtk/gtkwidget.h:43:9`!,
367 GDK_TYPE_RECTANGLEcxx . . $ `gdk/gdkrectangle.h:58:9`! | G_SIGNAL_TYPE_STATIC_SCOPEcxx . . $ `<external>/15952772511652638895/gsignal.h:249:9`!);
368 g_signal_set_va_marshallercxx . . $ g_signal_set_va_marshaller(4fd870c04a9d6fe7). (signalscxx . . $ signals.[GET_CHILD_POSITIONcxx . . $ GET_CHILD_POSITION.],
369 G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (object_class),
370 _gtk_marshal_BOOLEAN__OBJECT_BOXEDvcxx . . $ _gtk_marshal_BOOLEAN__OBJECT_BOXEDv(d309f4be92d1737c).);
371
372 gtk_widget_class_set_css_namecxx . . $ gtk_widget_class_set_css_name(6333614c746ab65a). (widget_class, I_cxx . . $ `gdk/gdkprivate.h:35:9`!("overlay"));
373
374 gtk_widget_class_set_layout_manager_typecxx . . $ gtk_widget_class_set_layout_manager_type(2a839cbf4b1b4191). (widget_class, GTK_TYPE_OVERLAY_LAYOUTcxx . . $ `gtk/gtkoverlaylayout.h:27:9`!);
375 }
376
377 static void
378 gtk_overlay_initcxx . . $ gtk_overlay_init(5d60d203f0fef460). (GtkOverlaycxx . . $ GtkOverlay# *overlay)
379 {
380 }
381
382 static GtkBuildableIfacecxx . . $ GtkBuildableIface# *parent_buildable_ifacecxx . . $ parent_buildable_iface.;
383
384 static void
385 gtk_overlay_buildable_add_childcxx . . $ gtk_overlay_buildable_add_child(784606fbae7a2cc). (GtkBuildablecxx . . $ GtkBuildable# *buildable,
386 GtkBuildercxx . . $ GtkBuilder# *builder,
387 GObjectcxx . . $ GObject# *child,
388 const char *type)
389 {
390 if (GTK_IS_WIDGETcxx . . $ `gtk/gtkwidget.h:46:9`! (child))
391 {
392 if (type && strcmpcxx . . $ strcmp(5ae29d726ae57f88). (type, "overlay") == 0)
393 {
394 gtk_overlay_add_overlaycxx . . $ gtk_overlay_add_overlay(e4d6ee1b9127570d). (GTK_OVERLAYcxx . . $ `gtk/gtkoverlay.h:32:9`! (buildable), GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (child));
395 }
396 else if (!type)
397 {
398 gtk_buildable_child_deprecation_warningcxx . . $ gtk_buildable_child_deprecation_warning(f47ca88812b837c7). (buildable, builder, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, "child");
399 gtk_overlay_set_childcxx . . $ gtk_overlay_set_child(e4d6ee1b9127570d). (GTK_OVERLAYcxx . . $ `gtk/gtkoverlay.h:32:9`! (buildable), GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (child));
400 }
401 else
402 {
403 GTK_BUILDER_WARN_INVALID_CHILD_TYPEcxx . . $ `gtk/gtkbuilder.h:194:9`! (buildable, type);
404 }
405 }
406 else
407 {
408 parent_buildable_ifacecxx . . $ parent_buildable_iface.->add_childcxx . . $ _GtkBuildableIface#add_child. (buildable, builder, child, type);
409 }
410 }
411
412 static void
413 gtk_overlay_buildable_initcxx . . $ gtk_overlay_buildable_init(c5db55232772c4cd). (GtkBuildableIfacecxx . . $ GtkBuildableIface# *iface)
414 {
415 parent_buildable_ifacecxx . . $ parent_buildable_iface. = g_type_interface_peek_parentcxx . . $ g_type_interface_peek_parent(9f162e79bfc6c74). (iface);
416
417 iface->add_childcxx . . $ _GtkBuildableIface#add_child. = gtk_overlay_buildable_add_childcxx . . $ gtk_overlay_buildable_add_child(784606fbae7a2cc).;
418 }
419
420 /**
421 * gtk_overlay_new:
422 *
423 * Creates a new `GtkOverlay`.
424 *
425 * Returns: a new `GtkOverlay` object.
426 */
427 GtkWidgetcxx . . $ GtkWidget# *
428 gtk_overlay_newcxx . . $ gtk_overlay_new(2369ce5e9f2c7dfd). (void)
429 {
430 return g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_OVERLAYcxx . . $ `gtk/gtkoverlay.h:31:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
431 }
432
433 /**
434 * gtk_overlay_add_overlay:
435 * @overlay: a `GtkOverlay`
436 * @widget: a `GtkWidget` to be added to the container
437 *
438 * Adds @widget to @overlay.
439 *
440 * The widget will be stacked on top of the main widget
441 * added with [[email protected]_child].
442 *
443 * The position at which @widget is placed is determined
444 * from its [[email protected]:halign] and
445 * [[email protected]:valign] properties.
446 */
447 void
448 gtk_overlay_add_overlaycxx . . $ gtk_overlay_add_overlay(e4d6ee1b9127570d). (GtkOverlaycxx . . $ GtkOverlay# *overlay,
449 GtkWidgetcxx . . $ GtkWidget# *widget)
450 {
451 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_OVERLAYcxx . . $ `gtk/gtkoverlay.h:33:9`! (overlay));
452 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_WIDGETcxx . . $ `gtk/gtkwidget.h:46:9`! (widget));
453 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (widget != overlay->child);
454
455 gtk_widget_insert_beforecxx . . $ gtk_widget_insert_before(72c16b162d9e96e5). (widget, GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (overlay), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
456 }
457
458 /**
459 * gtk_overlay_remove_overlay:
460 * @overlay: a `GtkOverlay`
461 * @widget: a `GtkWidget` to be removed
462 *
463 * Removes an overlay that was added with gtk_overlay_add_overlay().
464 */
465 void
466 gtk_overlay_remove_overlaycxx . . $ gtk_overlay_remove_overlay(e4d6ee1b9127570d). (GtkOverlaycxx . . $ GtkOverlay# *overlay,
467 GtkWidgetcxx . . $ GtkWidget# *widget)
468 {
469 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_OVERLAYcxx . . $ `gtk/gtkoverlay.h:33:9`! (overlay));
470 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_WIDGETcxx . . $ `gtk/gtkwidget.h:46:9`! (widget));
471 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (gtk_widget_get_parent (widget) == GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (overlay));
472 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (widget != overlay->child);
473
474 gtk_widget_unparentcxx . . $ gtk_widget_unparent(d7cf858254b37903). (widget);
475 }
476
477 /**
478 * gtk_overlay_set_measure_overlay:
479 * @overlay: a `GtkOverlay`
480 * @widget: an overlay child of `GtkOverlay`
481 * @measure: whether the child should be measured
482 *
483 * Sets whether @widget is included in the measured size of @overlay.
484 *
485 * The overlay will request the size of the largest child that has
486 * this property set to %TRUE. Children who are not included may
487 * be drawn outside of @overlay's allocation if they are too large.
488 */
489 void
490 gtk_overlay_set_measure_overlaycxx . . $ gtk_overlay_set_measure_overlay(509e0a23eec7391e). (GtkOverlaycxx . . $ GtkOverlay# *overlay,
491 GtkWidgetcxx . . $ GtkWidget# *widget,
492 gbooleancxx . . $ gboolean# measure)
493 {
494 GtkLayoutManagercxx . . $ GtkLayoutManager# *layout;
495 GtkOverlayLayoutChildcxx . . $ GtkOverlayLayoutChild# *child;
496
497 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_OVERLAYcxx . . $ `gtk/gtkoverlay.h:33:9`! (overlay));
498 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_WIDGETcxx . . $ `gtk/gtkwidget.h:46:9`! (widget));
499
500 layout = gtk_widget_get_layout_managercxx . . $ gtk_widget_get_layout_manager(f39d5da42f817d25). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (overlay));
501 child = GTK_OVERLAY_LAYOUT_CHILDcxx . . $ GTK_OVERLAY_LAYOUT_CHILD(5e88c528df38c9f4). (gtk_layout_manager_get_layout_childcxx . . $ gtk_layout_manager_get_layout_child(171c47ee439b0a3). (layout, widget));
502 gtk_overlay_layout_child_set_measurecxx . . $ gtk_overlay_layout_child_set_measure(9e3bbdc17a66bdf9). (child, measure);
503 }
504
505 /**
506 * gtk_overlay_get_measure_overlay:
507 * @overlay: a `GtkOverlay`
508 * @widget: an overlay child of `GtkOverlay`
509 *
510 * Gets whether @widget's size is included in the measurement of
511 * @overlay.
512 *
513 * Returns: whether the widget is measured
514 */
515 gbooleancxx . . $ gboolean#
516 gtk_overlay_get_measure_overlaycxx . . $ gtk_overlay_get_measure_overlay(df18ce0a731c2319). (GtkOverlaycxx . . $ GtkOverlay# *overlay,
517 GtkWidgetcxx . . $ GtkWidget# *widget)
518 {
519 GtkLayoutManagercxx . . $ GtkLayoutManager# *layout;
520 GtkOverlayLayoutChildcxx . . $ GtkOverlayLayoutChild# *child;
521
522 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_OVERLAYcxx . . $ `gtk/gtkoverlay.h:33:9`! (overlay), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
523 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_WIDGETcxx . . $ `gtk/gtkwidget.h:46:9`! (widget), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
524
525 layout = gtk_widget_get_layout_managercxx . . $ gtk_widget_get_layout_manager(f39d5da42f817d25). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (overlay));
526 child = GTK_OVERLAY_LAYOUT_CHILDcxx . . $ GTK_OVERLAY_LAYOUT_CHILD(5e88c528df38c9f4). (gtk_layout_manager_get_layout_childcxx . . $ gtk_layout_manager_get_layout_child(171c47ee439b0a3). (layout, widget));
527 return gtk_overlay_layout_child_get_measurecxx . . $ gtk_overlay_layout_child_get_measure(8aef59a4c33d7b89). (child);
528 }
529
530 /**
531 * gtk_overlay_set_clip_overlay:
532 * @overlay: a `GtkOverlay`
533 * @widget: an overlay child of `GtkOverlay`
534 * @clip_overlay: whether the child should be clipped
535 *
536 * Sets whether @widget should be clipped within the parent.
537 */
538 void
539 gtk_overlay_set_clip_overlaycxx . . $ gtk_overlay_set_clip_overlay(509e0a23eec7391e). (GtkOverlaycxx . . $ GtkOverlay# *overlay,
540 GtkWidgetcxx . . $ GtkWidget# *widget,
541 gbooleancxx . . $ gboolean# clip_overlay)
542 {
543 GtkLayoutManagercxx . . $ GtkLayoutManager# *layout;
544 GtkOverlayLayoutChildcxx . . $ GtkOverlayLayoutChild# *child;
545
546 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_OVERLAYcxx . . $ `gtk/gtkoverlay.h:33:9`! (overlay));
547 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_WIDGETcxx . . $ `gtk/gtkwidget.h:46:9`! (widget));
548
549 layout = gtk_widget_get_layout_managercxx . . $ gtk_widget_get_layout_manager(f39d5da42f817d25). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (overlay));
550 child = GTK_OVERLAY_LAYOUT_CHILDcxx . . $ GTK_OVERLAY_LAYOUT_CHILD(5e88c528df38c9f4). (gtk_layout_manager_get_layout_childcxx . . $ gtk_layout_manager_get_layout_child(171c47ee439b0a3). (layout, widget));
551 gtk_overlay_layout_child_set_clip_overlaycxx . . $ gtk_overlay_layout_child_set_clip_overlay(9e3bbdc17a66bdf9). (child, clip_overlay);
552 }
553
554 /**
555 * gtk_overlay_get_clip_overlay:
556 * @overlay: a `GtkOverlay`
557 * @widget: an overlay child of `GtkOverlay`
558 *
559 * Gets whether @widget should be clipped within the parent.
560 *
561 * Returns: whether the widget is clipped within the parent.
562 */
563 gbooleancxx . . $ gboolean#
564 gtk_overlay_get_clip_overlaycxx . . $ gtk_overlay_get_clip_overlay(df18ce0a731c2319). (GtkOverlaycxx . . $ GtkOverlay# *overlay,
565 GtkWidgetcxx . . $ GtkWidget# *widget)
566 {
567 GtkLayoutManagercxx . . $ GtkLayoutManager# *layout;
568 GtkOverlayLayoutChildcxx . . $ GtkOverlayLayoutChild# *child;
569
570 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_OVERLAYcxx . . $ `gtk/gtkoverlay.h:33:9`! (overlay), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
571 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_WIDGETcxx . . $ `gtk/gtkwidget.h:46:9`! (widget), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
572
573 layout = gtk_widget_get_layout_managercxx . . $ gtk_widget_get_layout_manager(f39d5da42f817d25). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (overlay));
574 child = GTK_OVERLAY_LAYOUT_CHILDcxx . . $ GTK_OVERLAY_LAYOUT_CHILD(5e88c528df38c9f4). (gtk_layout_manager_get_layout_childcxx . . $ gtk_layout_manager_get_layout_child(171c47ee439b0a3). (layout, widget));
575
576 return gtk_overlay_layout_child_get_clip_overlaycxx . . $ gtk_overlay_layout_child_get_clip_overlay(8aef59a4c33d7b89). (child);
577 }
578
579 /**
580 * gtk_overlay_set_child:
581 * @overlay: a `GtkOverlay`
582 * @child: (nullable): the child widget
583 *
584 * Sets the child widget of @overlay.
585 */
586 void
587 gtk_overlay_set_childcxx . . $ gtk_overlay_set_child(e4d6ee1b9127570d). (GtkOverlaycxx . . $ GtkOverlay# *overlay,
588 GtkWidgetcxx . . $ GtkWidget# *child)
589 {
590 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_OVERLAYcxx . . $ `gtk/gtkoverlay.h:33:9`! (overlay));
591 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (child == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || overlay->child == child || gtk_widget_get_parent (child) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
592
593 if (overlay->childcxx . . $ _GtkOverlay#child. == child)
594 return;
595
596 g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&overlay->child, gtk_widget_unparent);
597
598 overlay->childcxx . . $ _GtkOverlay#child. = child;
599
600 if (child)
601 {
602 /* Make sure the main-child node is the first one */
603 gtk_widget_insert_aftercxx . . $ gtk_widget_insert_after(72c16b162d9e96e5). (child, GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (overlay), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
604 }
605
606 g_object_notifycxx . . $ g_object_notify(174c9e6df5777c4e). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (overlay), "child");
607 }
608
609 /**
610 * gtk_overlay_get_child:
611 * @overlay: a `GtkOverlay`
612 *
613 * Gets the child widget of @overlay.
614 *
615 * Returns: (nullable) (transfer none): the child widget of @overlay
616 */
617 GtkWidgetcxx . . $ GtkWidget# *
618 gtk_overlay_get_childcxx . . $ gtk_overlay_get_child(8b07e496b0b290b7). (GtkOverlaycxx . . $ GtkOverlay# *overlay)
619 {
620 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_OVERLAYcxx . . $ `gtk/gtkoverlay.h:33:9`! (overlay), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
621
622 return overlay->childcxx . . $ _GtkOverlay#child.;
623 }