v0.2.1 c0399be

gtkwidget.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5	"structs"
6	"unsafe"
7
8	"github.com/ebitengine/purego"
9
10	"github.com/bnema/puregotk/pkg/core"
11	"github.com/bnema/puregotk/v4/cairo"
12	"github.com/bnema/puregotk/v4/gdk"
13	"github.com/bnema/puregotk/v4/gio"
14	"github.com/bnema/puregotk/v4/glib"
15	"github.com/bnema/puregotk/v4/gobject"
16	"github.com/bnema/puregotk/v4/gobject/types"
17	"github.com/bnema/puregotk/v4/graphene"
18	"github.com/bnema/puregotk/v4/gsk"
19	"github.com/bnema/puregotk/v4/pango"
20)
21
22// Callback type for adding a function to update animations.
23//
24// See [method@Gtk.Widget.add_tick_callback].
25type TickCallback func(uintptr, uintptr, uintptr) bool
26
27// The type of the callback functions used for activating
28// actions installed with [method@Gtk.WidgetClass.install_action].
29//
30// The @parameter must match the @parameter_type of the action.
31type WidgetActionActivateFunc func(uintptr, string, *glib.Variant)
32
33// Represents the desired size of a widget.
34//
35// See [GtkWidget’s geometry management section](class.Widget.html#height-for-width-geometry-management)
36// for more information.
37type Requisition struct {
38	_ structs.HostLayout
39
40	Width int
41
42	Height int
43}
44
45var xRequisitionGLibType func() types.GType
46
47func RequisitionGLibType() types.GType {
48	return xRequisitionGLibType()
49}
50
51func (x *Requisition) GoPointer() uintptr {
52	return uintptr(unsafe.Pointer(x))
53}
54
55var xNewRequisition func() *Requisition
56
57// Allocates a new `GtkRequisition`.
58//
59// The struct is initialized to zero.
60func NewRequisition() *Requisition {
61
62	cret := xNewRequisition()
63	return cret
64}
65
66var xRequisitionCopy func(uintptr) *Requisition
67
68// Copies a `GtkRequisition`.
69func (x *Requisition) Copy() *Requisition {
70
71	cret := xRequisitionCopy(x.GoPointer())
72	return cret
73}
74
75var xRequisitionFree func(uintptr)
76
77// Frees a `GtkRequisition`.
78func (x *Requisition) Free() {
79
80	xRequisitionFree(x.GoPointer())
81
82}
83
84type WidgetClass struct {
85	_ structs.HostLayout
86
87	ParentClass gobject.InitiallyUnownedClass
88
89	xShow uintptr
90
91	xHide uintptr
92
93	xMap uintptr
94
95	xUnmap uintptr
96
97	xRealize uintptr
98
99	xUnrealize uintptr
100
101	xRoot uintptr
102
103	xUnroot uintptr
104
105	xSizeAllocate uintptr
106
107	xStateFlagsChanged uintptr
108
109	xDirectionChanged uintptr
110
111	xGetRequestMode uintptr
112
113	xMeasure uintptr
114
115	xMnemonicActivate uintptr
116
117	xGrabFocus uintptr
118
119	xFocus uintptr
120
121	xSetFocusChild uintptr
122
123	xMoveFocus uintptr
124
125	xKeynavFailed uintptr
126
127	xQueryTooltip uintptr
128
129	xComputeExpand uintptr
130
131	xCssChanged uintptr
132
133	xSystemSettingChanged uintptr
134
135	xSnapshot uintptr
136
137	xContains uintptr
138
139	Priv *WidgetClassPrivate
140
141	Padding [8]uintptr
142}
143
144func (x *WidgetClass) GoPointer() uintptr {
145	return uintptr(unsafe.Pointer(x))
146}
147
148var xWidgetClassAddBinding func(uintptr, uint, gdk.ModifierType, uintptr, uintptr, ...interface{})
149
150// Creates a new shortcut for @widget_class that calls the given @callback
151// with arguments according to @format_string.
152//
153// The arguments and format string must be provided in the same way as
154// with [ctor@GLib.Variant.new].
155//
156// This function is a convenience wrapper around
157// [method@Gtk.WidgetClass.add_shortcut] and must be called during class
158// initialization. It does not provide for user data, if you need that,
159// you will have to use [method@Gtk.WidgetClass.add_shortcut] with a custom
160// shortcut.
161func (x *WidgetClass) AddBinding(KeyvalVar uint, ModsVar gdk.ModifierType, CallbackVar *ShortcutFunc, FormatStringVar *string, varArgs ...interface{}) {
162
163	var CallbackVarRef uintptr
164	if CallbackVar != nil {
165		CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar))
166		if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok {
167			CallbackVarRef = cbRefPtr
168		} else {
169			fcb := func(arg0 uintptr, arg1 *glib.Variant, arg2 uintptr) bool {
170				cbFn := *CallbackVar
171				return cbFn(arg0, arg1, arg2)
172			}
173			CallbackVarRef = purego.NewCallback(fcb)
174			glib.SaveCallbackWithClosure(CallbackVarPtr, CallbackVarRef, CallbackVar)
175		}
176	}
177
178	FormatStringVarPtr := core.GStrdupNullable(FormatStringVar)
179	defer core.GFreeNullable(FormatStringVarPtr)
180
181	xWidgetClassAddBinding(x.GoPointer(), KeyvalVar, ModsVar, CallbackVarRef, FormatStringVarPtr, varArgs...)
182
183}
184
185var xWidgetClassAddBindingAction func(uintptr, uint, gdk.ModifierType, string, uintptr, ...interface{})
186
187// Creates a new shortcut for @widget_class that activates the given
188// @action_name with arguments read according to @format_string.
189//
190// The arguments and format string must be provided in the same way as
191// with [ctor@GLib.Variant.new].
192//
193// This function is a convenience wrapper around
194// [method@Gtk.WidgetClass.add_shortcut] and must be called during class
195// initialization.
196func (x *WidgetClass) AddBindingAction(KeyvalVar uint, ModsVar gdk.ModifierType, ActionNameVar string, FormatStringVar *string, varArgs ...interface{}) {
197
198	FormatStringVarPtr := core.GStrdupNullable(FormatStringVar)
199	defer core.GFreeNullable(FormatStringVarPtr)
200
201	xWidgetClassAddBindingAction(x.GoPointer(), KeyvalVar, ModsVar, ActionNameVar, FormatStringVarPtr, varArgs...)
202
203}
204
205var xWidgetClassAddBindingSignal func(uintptr, uint, gdk.ModifierType, string, uintptr, ...interface{})
206
207// Creates a new shortcut for @widget_class that emits the given action
208// @signal with arguments read according to @format_string.
209//
210// The arguments and format string must be provided in the same way as
211// with [ctor@GLib.Variant.new].
212//
213// This function is a convenience wrapper around
214// [method@Gtk.WidgetClass.add_shortcut] and must be called during class
215// initialization.
216func (x *WidgetClass) AddBindingSignal(KeyvalVar uint, ModsVar gdk.ModifierType, SignalVar string, FormatStringVar *string, varArgs ...interface{}) {
217
218	FormatStringVarPtr := core.GStrdupNullable(FormatStringVar)
219	defer core.GFreeNullable(FormatStringVarPtr)
220
221	xWidgetClassAddBindingSignal(x.GoPointer(), KeyvalVar, ModsVar, SignalVar, FormatStringVarPtr, varArgs...)
222
223}
224
225var xWidgetClassAddShortcut func(uintptr, uintptr)
226
227// Installs a shortcut in @widget_class.
228//
229// Every instance created for @widget_class or its subclasses will
230// inherit this shortcut and trigger it.
231//
232// Shortcuts added this way will be triggered in the [enum@Gtk.PropagationPhase.bubble]
233// phase, which means they may also trigger if child widgets have focus.
234//
235// This function must only be used in class initialization functions
236// otherwise it is not guaranteed that the shortcut will be installed.
237func (x *WidgetClass) AddShortcut(ShortcutVar *Shortcut) {
238
239	xWidgetClassAddShortcut(x.GoPointer(), ShortcutVar.GoPointer())
240
241}
242
243var xWidgetClassBindTemplateCallbackFull func(uintptr, string, uintptr)
244
245// Associates a name to be used in GtkBuilder XML with a symbol.
246//
247// This function is not supported after [method@Gtk.WidgetClass.set_template_scope]
248// has been used on @widget_class.
249//
250// See [method@Gtk.BuilderCScope.add_callback_symbol].
251//
252// Note that this must be called from a composite widget classes
253// class initializer after calling [method@Gtk.WidgetClass.set_template].
254func (x *WidgetClass) BindTemplateCallbackFull(CallbackNameVar string, CallbackSymbolVar *gobject.Callback) {
255
256	var CallbackSymbolVarRef uintptr
257	if CallbackSymbolVar != nil {
258		CallbackSymbolVarPtr := uintptr(unsafe.Pointer(CallbackSymbolVar))
259		if cbRefPtr, ok := glib.GetCallback(CallbackSymbolVarPtr); ok {
260			CallbackSymbolVarRef = cbRefPtr
261		} else {
262			fcb := func() {
263				cbFn := *CallbackSymbolVar
264				cbFn()
265			}
266			CallbackSymbolVarRef = purego.NewCallback(fcb)
267			glib.SaveCallbackWithClosure(CallbackSymbolVarPtr, CallbackSymbolVarRef, CallbackSymbolVar)
268		}
269	}
270
271	xWidgetClassBindTemplateCallbackFull(x.GoPointer(), CallbackNameVar, CallbackSymbolVarRef)
272
273}
274
275var xWidgetClassBindTemplateChildFull func(uintptr, string, bool, int)
276
277// Assigns an object declared in the class template XML to be set to
278// a location on a freshly built instance’s private data, or
279// alternatively accessible via [method@Gtk.Widget.get_template_child].
280//
281// The struct can point either into the public instance, then you should
282// use `G_STRUCT_OFFSET(WidgetType, member)` for @struct_offset, or in the
283// private struct, then you should use `G_PRIVATE_OFFSET(WidgetType, member)`.
284//
285// An explicit strong reference will be held automatically for the duration
286// of your instance’s life cycle, it will be released automatically when
287// `GObjectClass.dispose()` runs on your instance and if a nonzero @struct_offset
288// is specified, then the automatic location in your instance public or private
289// data will be set to `NULL`. You can however access an automated child pointer
290// the first time your classes `GObjectClass.dispose()` runs, or alternatively
291// in [signal@Gtk.Widget::destroy].
292//
293// If @internal_child is specified, [vfunc@Gtk.Buildable.get_internal_child]
294// will be automatically implemented by the widget class so there is no
295// need to implement it manually.
296//
297// The wrapper macros [func@Gtk.widget_class_bind_template_child],
298// [func@Gtk.widget_class_bind_template_child_internal],
299// [func@Gtk.widget_class_bind_template_child_private] and
300// [func@Gtk.widget_class_bind_template_child_internal_private]
301// might be more convenient to use.
302//
303// Note that this must be called from a composite widget classes class
304// initializer after calling [method@Gtk.WidgetClass.set_template].
305func (x *WidgetClass) BindTemplateChildFull(NameVar string, InternalChildVar bool, StructOffsetVar int) {
306
307	xWidgetClassBindTemplateChildFull(x.GoPointer(), NameVar, InternalChildVar, StructOffsetVar)
308
309}
310
311var xWidgetClassGetAccessibleRole func(uintptr) AccessibleRole
312
313// Retrieves the accessible role used by the given widget class.
314//
315// Different accessible roles have different states, and are rendered
316// differently by assistive technologies.
317//
318// See also: [method@Gtk.Accessible.get_accessible_role].
319func (x *WidgetClass) GetAccessibleRole() AccessibleRole {
320
321	cret := xWidgetClassGetAccessibleRole(x.GoPointer())
322	return cret
323}
324
325var xWidgetClassGetActivateSignal func(uintptr) uint
326
327// Retrieves the signal id for the activation signal.
328//
329// The activation signal is set using
330// [method@Gtk.WidgetClass.set_activate_signal].
331func (x *WidgetClass) GetActivateSignal() uint {
332
333	cret := xWidgetClassGetActivateSignal(x.GoPointer())
334	return cret
335}
336
337var xWidgetClassGetCssName func(uintptr) string
338
339// Gets the name used by this class for matching in CSS code.
340//
341// See [method@Gtk.WidgetClass.set_css_name] for details.
342func (x *WidgetClass) GetCssName() string {
343
344	cret := xWidgetClassGetCssName(x.GoPointer())
345	return cret
346}
347
348var xWidgetClassGetLayoutManagerType func(uintptr) types.GType
349
350// Retrieves the type of the [class@Gtk.LayoutManager]
351// used by widgets of class @widget_class.
352//
353// See also: [method@Gtk.WidgetClass.set_layout_manager_type].
354func (x *WidgetClass) GetLayoutManagerType() types.GType {
355
356	cret := xWidgetClassGetLayoutManagerType(x.GoPointer())
357	return cret
358}
359
360var xWidgetClassInstallAction func(uintptr, string, uintptr, uintptr)
361
362// Adds an action for all instances of a widget class.
363//
364// This function should be called at class initialization time.
365//
366// Actions installed by this function are stateless. The only state
367// they have is whether they are enabled or not (which can be changed
368// with [method@Gtk.Widget.action_set_enabled]).
369func (x *WidgetClass) InstallAction(ActionNameVar string, ParameterTypeVar *string, ActivateVar *WidgetActionActivateFunc) {
370
371	var ActivateVarRef uintptr
372	if ActivateVar != nil {
373		ActivateVarPtr := uintptr(unsafe.Pointer(ActivateVar))
374		if cbRefPtr, ok := glib.GetCallback(ActivateVarPtr); ok {
375			ActivateVarRef = cbRefPtr
376		} else {
377			fcb := func(arg0 uintptr, arg1 uintptr, arg2 *glib.Variant) {
378				cbFn := *ActivateVar
379				cbFn(arg0, core.GoString(arg1), arg2)
380			}
381			ActivateVarRef = purego.NewCallback(fcb)
382			glib.SaveCallbackWithClosure(ActivateVarPtr, ActivateVarRef, ActivateVar)
383		}
384	}
385
386	ParameterTypeVarPtr := core.GStrdupNullable(ParameterTypeVar)
387	defer core.GFreeNullable(ParameterTypeVarPtr)
388
389	xWidgetClassInstallAction(x.GoPointer(), ActionNameVar, ParameterTypeVarPtr, ActivateVarRef)
390
391}
392
393var xWidgetClassInstallPropertyAction func(uintptr, string, string)
394
395// Installs an action called @action_name on @widget_class and
396// binds its state to the value of the @property_name property.
397//
398// This function will perform a few sanity checks on the property selected
399// via @property_name. Namely, the property must exist, must be readable,
400// writable and must not be construct-only. There are also restrictions
401// on the type of the given property, it must be boolean, int, unsigned int,
402// double or string. If any of these conditions are not met, a critical
403// warning will be printed and no action will be added.
404//
405// The state type of the action matches the property type.
406//
407// If the property is boolean, the action will have no parameter and
408// toggle the property value. Otherwise, the action will have a parameter
409// of the same type as the property.
410func (x *WidgetClass) InstallPropertyAction(ActionNameVar string, PropertyNameVar string) {
411
412	xWidgetClassInstallPropertyAction(x.GoPointer(), ActionNameVar, PropertyNameVar)
413
414}
415
416var xWidgetClassQueryAction func(uintptr, uint, *types.GType, *string, **glib.VariantType, *string) bool
417
418// Returns details about an action that has been
419// installed for @widget_class.
420//
421// See [method@Gtk.WidgetClass.install_action] for details on
422// how to install actions.
423//
424// Note that this function will also return actions defined
425// by parent classes. You can identify those by looking
426// at @owner.
427func (x *WidgetClass) QueryAction(IndexVar uint, OwnerVar *types.GType, ActionNameVar *string, ParameterTypeVar **glib.VariantType, PropertyNameVar *string) bool {
428
429	cret := xWidgetClassQueryAction(x.GoPointer(), IndexVar, OwnerVar, ActionNameVar, ParameterTypeVar, PropertyNameVar)
430	return cret
431}
432
433var xWidgetClassSetAccessibleRole func(uintptr, AccessibleRole)
434
435// Sets the accessible role used by the given widget class.
436//
437// Different accessible roles have different states, and are
438// rendered differently by assistive technologies.
439func (x *WidgetClass) SetAccessibleRole(AccessibleRoleVar AccessibleRole) {
440
441	xWidgetClassSetAccessibleRole(x.GoPointer(), AccessibleRoleVar)
442
443}
444
445var xWidgetClassSetActivateSignal func(uintptr, uint)
446
447// Sets the activation signal for a widget class.
448//
449// The signal will be emitted when calling [method@Gtk.Widget.activate].
450//
451// The @signal_id must have been registered with [function.GObject.signal_new]
452// or [func@GObject.signal_newv] before calling this function.
453func (x *WidgetClass) SetActivateSignal(SignalIdVar uint) {
454
455	xWidgetClassSetActivateSignal(x.GoPointer(), SignalIdVar)
456
457}
458
459var xWidgetClassSetActivateSignalFromName func(uintptr, string)
460
461// Sets the activation signal for a widget class.
462//
463// The signal id will by looked up by @signal_name.
464//
465// The signal will be emitted when calling [method@Gtk.Widget.activate].
466//
467// The @signal_name must have been registered with [function.GObject.signal_new]
468// or [func@GObject.signal_newv] before calling this function.
469func (x *WidgetClass) SetActivateSignalFromName(SignalNameVar string) {
470
471	xWidgetClassSetActivateSignalFromName(x.GoPointer(), SignalNameVar)
472
473}
474
475var xWidgetClassSetCssName func(uintptr, string)
476
477// Sets the name to be used for CSS matching of widgets.
478//
479// If this function is not called for a given class, the name
480// set on the parent class is used. By default, `GtkWidget`
481// uses the name "widget".
482func (x *WidgetClass) SetCssName(NameVar string) {
483
484	xWidgetClassSetCssName(x.GoPointer(), NameVar)
485
486}
487
488var xWidgetClassSetLayoutManagerType func(uintptr, types.GType)
489
490// Sets the type to be used for creating layout managers for
491// widgets of @widget_class.
492//
493// The given @type must be a subtype of [class@Gtk.LayoutManager].
494//
495// This function should only be called from class init functions
496// of widgets.
497func (x *WidgetClass) SetLayoutManagerType(TypeVar types.GType) {
498
499	xWidgetClassSetLayoutManagerType(x.GoPointer(), TypeVar)
500
501}
502
503var xWidgetClassSetTemplate func(uintptr, *glib.Bytes)
504
505// This should be called at class initialization time to specify
506// the `GtkBuilder` XML to be used to extend a widget.
507//
508// For convenience, [method@Gtk.WidgetClass.set_template_from_resource]
509// is also provided.
510//
511// Note that any class that installs templates must call
512// [method@Gtk.Widget.init_template] in the widget’s instance initializer.
513func (x *WidgetClass) SetTemplate(TemplateBytesVar *glib.Bytes) {
514
515	xWidgetClassSetTemplate(x.GoPointer(), TemplateBytesVar)
516
517}
518
519var xWidgetClassSetTemplateFromResource func(uintptr, string)
520
521// A convenience function that calls [method@Gtk.WidgetClass.set_template]
522// with the contents of a resource.
523//
524// Note that any class that installs templates must call
525// [method@Gtk.Widget.init_template] in the widget’s instance
526// initializer.
527func (x *WidgetClass) SetTemplateFromResource(ResourceNameVar string) {
528
529	xWidgetClassSetTemplateFromResource(x.GoPointer(), ResourceNameVar)
530
531}
532
533var xWidgetClassSetTemplateScope func(uintptr, uintptr)
534
535// Overrides the default scope to be used when parsing the class template.
536//
537// This function is intended for language bindings.
538//
539// Note that this must be called from a composite widget classes class
540// initializer after calling [method@Gtk.WidgetClass.set_template].
541func (x *WidgetClass) SetTemplateScope(ScopeVar BuilderScope) {
542
543	xWidgetClassSetTemplateScope(x.GoPointer(), ScopeVar.GoPointer())
544
545}
546
547// OverrideShow sets the "show" callback function.
548// Signal emitted when widget is shown
549func (x *WidgetClass) OverrideShow(cb func(*Widget)) {
550	if cb == nil {
551		x.xShow = 0
552	} else {
553		x.xShow = purego.NewCallback(func(WidgetVarp uintptr) {
554			cb(WidgetNewFromInternalPtr(WidgetVarp))
555		})
556	}
557}
558
559// GetShow gets the "show" callback function.
560// Signal emitted when widget is shown
561func (x *WidgetClass) GetShow() func(*Widget) {
562	if x.xShow == 0 {
563		return nil
564	}
565	var rawCallback func(WidgetVarp uintptr)
566	purego.RegisterFunc(&rawCallback, x.xShow)
567	return func(WidgetVar *Widget) {
568		rawCallback(WidgetVar.GoPointer())
569	}
570}
571
572// OverrideHide sets the "hide" callback function.
573// Signal emitted when widget is hidden.
574func (x *WidgetClass) OverrideHide(cb func(*Widget)) {
575	if cb == nil {
576		x.xHide = 0
577	} else {
578		x.xHide = purego.NewCallback(func(WidgetVarp uintptr) {
579			cb(WidgetNewFromInternalPtr(WidgetVarp))
580		})
581	}
582}
583
584// GetHide gets the "hide" callback function.
585// Signal emitted when widget is hidden.
586func (x *WidgetClass) GetHide() func(*Widget) {
587	if x.xHide == 0 {
588		return nil
589	}
590	var rawCallback func(WidgetVarp uintptr)
591	purego.RegisterFunc(&rawCallback, x.xHide)
592	return func(WidgetVar *Widget) {
593		rawCallback(WidgetVar.GoPointer())
594	}
595}
596
597// OverrideMap sets the "map" callback function.
598// Signal emitted when widget is going to be mapped, that is
599//
600//	when the widget is visible (which is controlled with
601//	gtk_widget_set_visible()) and all its parents up to the toplevel
602//	widget are also visible.
603func (x *WidgetClass) OverrideMap(cb func(*Widget)) {
604	if cb == nil {
605		x.xMap = 0
606	} else {
607		x.xMap = purego.NewCallback(func(WidgetVarp uintptr) {
608			cb(WidgetNewFromInternalPtr(WidgetVarp))
609		})
610	}
611}
612
613// GetMap gets the "map" callback function.
614// Signal emitted when widget is going to be mapped, that is
615//
616//	when the widget is visible (which is controlled with
617//	gtk_widget_set_visible()) and all its parents up to the toplevel
618//	widget are also visible.
619func (x *WidgetClass) GetMap() func(*Widget) {
620	if x.xMap == 0 {
621		return nil
622	}
623	var rawCallback func(WidgetVarp uintptr)
624	purego.RegisterFunc(&rawCallback, x.xMap)
625	return func(WidgetVar *Widget) {
626		rawCallback(WidgetVar.GoPointer())
627	}
628}
629
630// OverrideUnmap sets the "unmap" callback function.
631// Signal emitted when widget is going to be unmapped, which
632//
633//	means that either it or any of its parents up to the toplevel
634//	widget have been set as hidden.
635func (x *WidgetClass) OverrideUnmap(cb func(*Widget)) {
636	if cb == nil {
637		x.xUnmap = 0
638	} else {
639		x.xUnmap = purego.NewCallback(func(WidgetVarp uintptr) {
640			cb(WidgetNewFromInternalPtr(WidgetVarp))
641		})
642	}
643}
644
645// GetUnmap gets the "unmap" callback function.
646// Signal emitted when widget is going to be unmapped, which
647//
648//	means that either it or any of its parents up to the toplevel
649//	widget have been set as hidden.
650func (x *WidgetClass) GetUnmap() func(*Widget) {
651	if x.xUnmap == 0 {
652		return nil
653	}
654	var rawCallback func(WidgetVarp uintptr)
655	purego.RegisterFunc(&rawCallback, x.xUnmap)
656	return func(WidgetVar *Widget) {
657		rawCallback(WidgetVar.GoPointer())
658	}
659}
660
661// OverrideRealize sets the "realize" callback function.
662// Signal emitted when widget is associated with a
663//
664//	`GdkSurface`, which means that gtk_widget_realize() has been called or
665//	the widget has been mapped (that is, it is going to be drawn).
666func (x *WidgetClass) OverrideRealize(cb func(*Widget)) {
667	if cb == nil {
668		x.xRealize = 0
669	} else {
670		x.xRealize = purego.NewCallback(func(WidgetVarp uintptr) {
671			cb(WidgetNewFromInternalPtr(WidgetVarp))
672		})
673	}
674}
675
676// GetRealize gets the "realize" callback function.
677// Signal emitted when widget is associated with a
678//
679//	`GdkSurface`, which means that gtk_widget_realize() has been called or
680//	the widget has been mapped (that is, it is going to be drawn).
681func (x *WidgetClass) GetRealize() func(*Widget) {
682	if x.xRealize == 0 {
683		return nil
684	}
685	var rawCallback func(WidgetVarp uintptr)
686	purego.RegisterFunc(&rawCallback, x.xRealize)
687	return func(WidgetVar *Widget) {
688		rawCallback(WidgetVar.GoPointer())
689	}
690}
691
692// OverrideUnrealize sets the "unrealize" callback function.
693// Signal emitted when the GdkSurface associated with
694//
695//	widget is destroyed, which means that gtk_widget_unrealize() has
696//	been called or the widget has been unmapped (that is, it is going
697//	to be hidden).
698func (x *WidgetClass) OverrideUnrealize(cb func(*Widget)) {
699	if cb == nil {
700		x.xUnrealize = 0
701	} else {
702		x.xUnrealize = purego.NewCallback(func(WidgetVarp uintptr) {
703			cb(WidgetNewFromInternalPtr(WidgetVarp))
704		})
705	}
706}
707
708// GetUnrealize gets the "unrealize" callback function.
709// Signal emitted when the GdkSurface associated with
710//
711//	widget is destroyed, which means that gtk_widget_unrealize() has
712//	been called or the widget has been unmapped (that is, it is going
713//	to be hidden).
714func (x *WidgetClass) GetUnrealize() func(*Widget) {
715	if x.xUnrealize == 0 {
716		return nil
717	}
718	var rawCallback func(WidgetVarp uintptr)
719	purego.RegisterFunc(&rawCallback, x.xUnrealize)
720	return func(WidgetVar *Widget) {
721		rawCallback(WidgetVar.GoPointer())
722	}
723}
724
725// OverrideRoot sets the "root" callback function.
726// Called when the widget gets added to a `GtkRoot` widget. Must
727//
728//	chain up
729func (x *WidgetClass) OverrideRoot(cb func(*Widget)) {
730	if cb == nil {
731		x.xRoot = 0
732	} else {
733		x.xRoot = purego.NewCallback(func(WidgetVarp uintptr) {
734			cb(WidgetNewFromInternalPtr(WidgetVarp))
735		})
736	}
737}
738
739// GetRoot gets the "root" callback function.
740// Called when the widget gets added to a `GtkRoot` widget. Must
741//
742//	chain up
743func (x *WidgetClass) GetRoot() func(*Widget) {
744	if x.xRoot == 0 {
745		return nil
746	}
747	var rawCallback func(WidgetVarp uintptr)
748	purego.RegisterFunc(&rawCallback, x.xRoot)
749	return func(WidgetVar *Widget) {
750		rawCallback(WidgetVar.GoPointer())
751	}
752}
753
754// OverrideUnroot sets the "unroot" callback function.
755// Called when the widget is about to be removed from its
756//
757//	`GtkRoot` widget. Must chain up
758func (x *WidgetClass) OverrideUnroot(cb func(*Widget)) {
759	if cb == nil {
760		x.xUnroot = 0
761	} else {
762		x.xUnroot = purego.NewCallback(func(WidgetVarp uintptr) {
763			cb(WidgetNewFromInternalPtr(WidgetVarp))
764		})
765	}
766}
767
768// GetUnroot gets the "unroot" callback function.
769// Called when the widget is about to be removed from its
770//
771//	`GtkRoot` widget. Must chain up
772func (x *WidgetClass) GetUnroot() func(*Widget) {
773	if x.xUnroot == 0 {
774		return nil
775	}
776	var rawCallback func(WidgetVarp uintptr)
777	purego.RegisterFunc(&rawCallback, x.xUnroot)
778	return func(WidgetVar *Widget) {
779		rawCallback(WidgetVar.GoPointer())
780	}
781}
782
783// OverrideSizeAllocate sets the "size_allocate" callback function.
784// Called to set the allocation, if the widget does
785//
786//	not have a layout manager.
787func (x *WidgetClass) OverrideSizeAllocate(cb func(*Widget, int, int, int)) {
788	if cb == nil {
789		x.xSizeAllocate = 0
790	} else {
791		x.xSizeAllocate = purego.NewCallback(func(WidgetVarp uintptr, WidthVarp int, HeightVarp int, BaselineVarp int) {
792			cb(WidgetNewFromInternalPtr(WidgetVarp), WidthVarp, HeightVarp, BaselineVarp)
793		})
794	}
795}
796
797// GetSizeAllocate gets the "size_allocate" callback function.
798// Called to set the allocation, if the widget does
799//
800//	not have a layout manager.
801func (x *WidgetClass) GetSizeAllocate() func(*Widget, int, int, int) {
802	if x.xSizeAllocate == 0 {
803		return nil
804	}
805	var rawCallback func(WidgetVarp uintptr, WidthVarp int, HeightVarp int, BaselineVarp int)
806	purego.RegisterFunc(&rawCallback, x.xSizeAllocate)
807	return func(WidgetVar *Widget, WidthVar int, HeightVar int, BaselineVar int) {
808		rawCallback(WidgetVar.GoPointer(), WidthVar, HeightVar, BaselineVar)
809	}
810}
811
812// OverrideStateFlagsChanged sets the "state_flags_changed" callback function.
813// Signal emitted when the widget state changes,
814//
815//	see gtk_widget_get_state_flags().
816func (x *WidgetClass) OverrideStateFlagsChanged(cb func(*Widget, StateFlags)) {
817	if cb == nil {
818		x.xStateFlagsChanged = 0
819	} else {
820		x.xStateFlagsChanged = purego.NewCallback(func(WidgetVarp uintptr, PreviousStateFlagsVarp StateFlags) {
821			cb(WidgetNewFromInternalPtr(WidgetVarp), PreviousStateFlagsVarp)
822		})
823	}
824}
825
826// GetStateFlagsChanged gets the "state_flags_changed" callback function.
827// Signal emitted when the widget state changes,
828//
829//	see gtk_widget_get_state_flags().
830func (x *WidgetClass) GetStateFlagsChanged() func(*Widget, StateFlags) {
831	if x.xStateFlagsChanged == 0 {
832		return nil
833	}
834	var rawCallback func(WidgetVarp uintptr, PreviousStateFlagsVarp StateFlags)
835	purego.RegisterFunc(&rawCallback, x.xStateFlagsChanged)
836	return func(WidgetVar *Widget, PreviousStateFlagsVar StateFlags) {
837		rawCallback(WidgetVar.GoPointer(), PreviousStateFlagsVar)
838	}
839}
840
841// OverrideDirectionChanged sets the "direction_changed" callback function.
842// Signal emitted when the text direction of a
843//
844//	widget changes.
845func (x *WidgetClass) OverrideDirectionChanged(cb func(*Widget, TextDirection)) {
846	if cb == nil {
847		x.xDirectionChanged = 0
848	} else {
849		x.xDirectionChanged = purego.NewCallback(func(WidgetVarp uintptr, PreviousDirectionVarp TextDirection) {
850			cb(WidgetNewFromInternalPtr(WidgetVarp), PreviousDirectionVarp)
851		})
852	}
853}
854
855// GetDirectionChanged gets the "direction_changed" callback function.
856// Signal emitted when the text direction of a
857//
858//	widget changes.
859func (x *WidgetClass) GetDirectionChanged() func(*Widget, TextDirection) {
860	if x.xDirectionChanged == 0 {
861		return nil
862	}
863	var rawCallback func(WidgetVarp uintptr, PreviousDirectionVarp TextDirection)
864	purego.RegisterFunc(&rawCallback, x.xDirectionChanged)
865	return func(WidgetVar *Widget, PreviousDirectionVar TextDirection) {
866		rawCallback(WidgetVar.GoPointer(), PreviousDirectionVar)
867	}
868}
869
870// OverrideGetRequestMode sets the "get_request_mode" callback function.
871// Called to get the request mode, if the widget
872//
873//	does not have a layout manager.
874//	This allows a widget to tell its parent container whether
875//	it prefers to be allocated in %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or
876//	%GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT mode.
877//	%GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH means the widget prefers to have
878//	`GtkWidgetClass.measure()` called first to get the default width (passing
879//	a for_size of -1), then again to get the height for said default width.
880//	%GTK_SIZE_REQUEST_CONSTANT_SIZE disables any height-for-width or
881//	width-for-height geometry management for said widget and is the
882//	default return.
883//	It’s important to note that any widget
884//	which trades height-for-width or width-for-height must respond properly
885//	to a for_size value >= -1 passed to `GtkWidgetClass.measure`, for both
886//	possible orientations.
887func (x *WidgetClass) OverrideGetRequestMode(cb func(*Widget) SizeRequestMode) {
888	if cb == nil {
889		x.xGetRequestMode = 0
890	} else {
891		x.xGetRequestMode = purego.NewCallback(func(WidgetVarp uintptr) SizeRequestMode {
892			return cb(WidgetNewFromInternalPtr(WidgetVarp))
893		})
894	}
895}
896
897// GetGetRequestMode gets the "get_request_mode" callback function.
898// Called to get the request mode, if the widget
899//
900//	does not have a layout manager.
901//	This allows a widget to tell its parent container whether
902//	it prefers to be allocated in %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or
903//	%GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT mode.
904//	%GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH means the widget prefers to have
905//	`GtkWidgetClass.measure()` called first to get the default width (passing
906//	a for_size of -1), then again to get the height for said default width.
907//	%GTK_SIZE_REQUEST_CONSTANT_SIZE disables any height-for-width or
908//	width-for-height geometry management for said widget and is the
909//	default return.
910//	It’s important to note that any widget
911//	which trades height-for-width or width-for-height must respond properly
912//	to a for_size value >= -1 passed to `GtkWidgetClass.measure`, for both
913//	possible orientations.
914func (x *WidgetClass) GetGetRequestMode() func(*Widget) SizeRequestMode {
915	if x.xGetRequestMode == 0 {
916		return nil
917	}
918	var rawCallback func(WidgetVarp uintptr) SizeRequestMode
919	purego.RegisterFunc(&rawCallback, x.xGetRequestMode)
920	return func(WidgetVar *Widget) SizeRequestMode {
921		return rawCallback(WidgetVar.GoPointer())
922	}
923}
924
925// OverrideMeasure sets the "measure" callback function.
926// Called to obtain the minimum and natural size of the widget,
927//
928//	if the widget does not have a layout manager.
929//	Depending on the orientation parameter, the passed for_size can be
930//	interpreted as width or height. A widget will never be allocated less
931//	than its minimum size.
932func (x *WidgetClass) OverrideMeasure(cb func(*Widget, Orientation, int, *int, *int, *int, *int)) {
933	if cb == nil {
934		x.xMeasure = 0
935	} else {
936		x.xMeasure = purego.NewCallback(func(WidgetVarp uintptr, OrientationVarp Orientation, ForSizeVarp int, MinimumVarp *int, NaturalVarp *int, MinimumBaselineVarp *int, NaturalBaselineVarp *int) {
937			cb(WidgetNewFromInternalPtr(WidgetVarp), OrientationVarp, ForSizeVarp, MinimumVarp, NaturalVarp, MinimumBaselineVarp, NaturalBaselineVarp)
938		})
939	}
940}
941
942// GetMeasure gets the "measure" callback function.
943// Called to obtain the minimum and natural size of the widget,
944//
945//	if the widget does not have a layout manager.
946//	Depending on the orientation parameter, the passed for_size can be
947//	interpreted as width or height. A widget will never be allocated less
948//	than its minimum size.
949func (x *WidgetClass) GetMeasure() func(*Widget, Orientation, int, *int, *int, *int, *int) {
950	if x.xMeasure == 0 {
951		return nil
952	}
953	var rawCallback func(WidgetVarp uintptr, OrientationVarp Orientation, ForSizeVarp int, MinimumVarp *int, NaturalVarp *int, MinimumBaselineVarp *int, NaturalBaselineVarp *int)
954	purego.RegisterFunc(&rawCallback, x.xMeasure)
955	return func(WidgetVar *Widget, OrientationVar Orientation, ForSizeVar int, MinimumVar *int, NaturalVar *int, MinimumBaselineVar *int, NaturalBaselineVar *int) {
956		rawCallback(WidgetVar.GoPointer(), OrientationVar, ForSizeVar, MinimumVar, NaturalVar, MinimumBaselineVar, NaturalBaselineVar)
957	}
958}
959
960// OverrideMnemonicActivate sets the "mnemonic_activate" callback function.
961// Activates the @widget if @group_cycling is
962//
963//	%FALSE, and just grabs the focus if @group_cycling is %TRUE.
964func (x *WidgetClass) OverrideMnemonicActivate(cb func(*Widget, bool) bool) {
965	if cb == nil {
966		x.xMnemonicActivate = 0
967	} else {
968		x.xMnemonicActivate = purego.NewCallback(func(WidgetVarp uintptr, GroupCyclingVarp bool) bool {
969			return cb(WidgetNewFromInternalPtr(WidgetVarp), GroupCyclingVarp)
970		})
971	}
972}
973
974// GetMnemonicActivate gets the "mnemonic_activate" callback function.
975// Activates the @widget if @group_cycling is
976//
977//	%FALSE, and just grabs the focus if @group_cycling is %TRUE.
978func (x *WidgetClass) GetMnemonicActivate() func(*Widget, bool) bool {
979	if x.xMnemonicActivate == 0 {
980		return nil
981	}
982	var rawCallback func(WidgetVarp uintptr, GroupCyclingVarp bool) bool
983	purego.RegisterFunc(&rawCallback, x.xMnemonicActivate)
984	return func(WidgetVar *Widget, GroupCyclingVar bool) bool {
985		return rawCallback(WidgetVar.GoPointer(), GroupCyclingVar)
986	}
987}
988
989// OverrideGrabFocus sets the "grab_focus" callback function.
990// Causes @widget to have the keyboard focus for the
991//
992//	`GtkWindow` it’s inside.
993func (x *WidgetClass) OverrideGrabFocus(cb func(*Widget) bool) {
994	if cb == nil {
995		x.xGrabFocus = 0
996	} else {
997		x.xGrabFocus = purego.NewCallback(func(WidgetVarp uintptr) bool {
998			return cb(WidgetNewFromInternalPtr(WidgetVarp))
999		})
1000	}
1001}
1002
1003// GetGrabFocus gets the "grab_focus" callback function.
1004// Causes @widget to have the keyboard focus for the
1005//
1006//	`GtkWindow` it’s inside.
1007func (x *WidgetClass) GetGrabFocus() func(*Widget) bool {
1008	if x.xGrabFocus == 0 {
1009		return nil
1010	}
1011	var rawCallback func(WidgetVarp uintptr) bool
1012	purego.RegisterFunc(&rawCallback, x.xGrabFocus)
1013	return func(WidgetVar *Widget) bool {
1014		return rawCallback(WidgetVar.GoPointer())
1015	}
1016}
1017
1018// OverrideFocus sets the "focus" callback function.
1019// Vfunc for gtk_widget_child_focus()
1020func (x *WidgetClass) OverrideFocus(cb func(*Widget, DirectionType) bool) {
1021	if cb == nil {
1022		x.xFocus = 0
1023	} else {
1024		x.xFocus = purego.NewCallback(func(WidgetVarp uintptr, DirectionVarp DirectionType) bool {
1025			return cb(WidgetNewFromInternalPtr(WidgetVarp), DirectionVarp)
1026		})
1027	}
1028}
1029
1030// GetFocus gets the "focus" callback function.
1031// Vfunc for gtk_widget_child_focus()
1032func (x *WidgetClass) GetFocus() func(*Widget, DirectionType) bool {
1033	if x.xFocus == 0 {
1034		return nil
1035	}
1036	var rawCallback func(WidgetVarp uintptr, DirectionVarp DirectionType) bool
1037	purego.RegisterFunc(&rawCallback, x.xFocus)
1038	return func(WidgetVar *Widget, DirectionVar DirectionType) bool {
1039		return rawCallback(WidgetVar.GoPointer(), DirectionVar)
1040	}
1041}
1042
1043// OverrideSetFocusChild sets the "set_focus_child" callback function.
1044// Sets the focused child of a widget. Must chain up
1045func (x *WidgetClass) OverrideSetFocusChild(cb func(*Widget, *Widget)) {
1046	if cb == nil {
1047		x.xSetFocusChild = 0
1048	} else {
1049		x.xSetFocusChild = purego.NewCallback(func(WidgetVarp uintptr, ChildVarp uintptr) {
1050			cb(WidgetNewFromInternalPtr(WidgetVarp), WidgetNewFromInternalPtr(ChildVarp))
1051		})
1052	}
1053}
1054
1055// GetSetFocusChild gets the "set_focus_child" callback function.
1056// Sets the focused child of a widget. Must chain up
1057func (x *WidgetClass) GetSetFocusChild() func(*Widget, *Widget) {
1058	if x.xSetFocusChild == 0 {
1059		return nil
1060	}
1061	var rawCallback func(WidgetVarp uintptr, ChildVarp uintptr)
1062	purego.RegisterFunc(&rawCallback, x.xSetFocusChild)
1063	return func(WidgetVar *Widget, ChildVar *Widget) {
1064		rawCallback(WidgetVar.GoPointer(), ChildVar.GoPointer())
1065	}
1066}
1067
1068// OverrideMoveFocus sets the "move_focus" callback function.
1069// Signal emitted when a change of focus is requested
1070func (x *WidgetClass) OverrideMoveFocus(cb func(*Widget, DirectionType)) {
1071	if cb == nil {
1072		x.xMoveFocus = 0
1073	} else {
1074		x.xMoveFocus = purego.NewCallback(func(WidgetVarp uintptr, DirectionVarp DirectionType) {
1075			cb(WidgetNewFromInternalPtr(WidgetVarp), DirectionVarp)
1076		})
1077	}
1078}
1079
1080// GetMoveFocus gets the "move_focus" callback function.
1081// Signal emitted when a change of focus is requested
1082func (x *WidgetClass) GetMoveFocus() func(*Widget, DirectionType) {
1083	if x.xMoveFocus == 0 {
1084		return nil
1085	}
1086	var rawCallback func(WidgetVarp uintptr, DirectionVarp DirectionType)
1087	purego.RegisterFunc(&rawCallback, x.xMoveFocus)
1088	return func(WidgetVar *Widget, DirectionVar DirectionType) {
1089		rawCallback(WidgetVar.GoPointer(), DirectionVar)
1090	}
1091}
1092
1093// OverrideKeynavFailed sets the "keynav_failed" callback function.
1094// Signal emitted if keyboard navigation fails.
1095func (x *WidgetClass) OverrideKeynavFailed(cb func(*Widget, DirectionType) bool) {
1096	if cb == nil {
1097		x.xKeynavFailed = 0
1098	} else {
1099		x.xKeynavFailed = purego.NewCallback(func(WidgetVarp uintptr, DirectionVarp DirectionType) bool {
1100			return cb(WidgetNewFromInternalPtr(WidgetVarp), DirectionVarp)
1101		})
1102	}
1103}
1104
1105// GetKeynavFailed gets the "keynav_failed" callback function.
1106// Signal emitted if keyboard navigation fails.
1107func (x *WidgetClass) GetKeynavFailed() func(*Widget, DirectionType) bool {
1108	if x.xKeynavFailed == 0 {
1109		return nil
1110	}
1111	var rawCallback func(WidgetVarp uintptr, DirectionVarp DirectionType) bool
1112	purego.RegisterFunc(&rawCallback, x.xKeynavFailed)
1113	return func(WidgetVar *Widget, DirectionVar DirectionType) bool {
1114		return rawCallback(WidgetVar.GoPointer(), DirectionVar)
1115	}
1116}
1117
1118// OverrideQueryTooltip sets the "query_tooltip" callback function.
1119// Signal emitted when “has-tooltip” is %TRUE and the
1120//
1121//	hover timeout has expired with the cursor hovering “above”
1122//	widget; or emitted when widget got focus in keyboard mode.
1123func (x *WidgetClass) OverrideQueryTooltip(cb func(*Widget, int, int, bool, *Tooltip) bool) {
1124	if cb == nil {
1125		x.xQueryTooltip = 0
1126	} else {
1127		x.xQueryTooltip = purego.NewCallback(func(WidgetVarp uintptr, XVarp int, YVarp int, KeyboardTooltipVarp bool, TooltipVarp uintptr) bool {
1128			return cb(WidgetNewFromInternalPtr(WidgetVarp), XVarp, YVarp, KeyboardTooltipVarp, TooltipNewFromInternalPtr(TooltipVarp))
1129		})
1130	}
1131}
1132
1133// GetQueryTooltip gets the "query_tooltip" callback function.
1134// Signal emitted when “has-tooltip” is %TRUE and the
1135//
1136//	hover timeout has expired with the cursor hovering “above”
1137//	widget; or emitted when widget got focus in keyboard mode.
1138func (x *WidgetClass) GetQueryTooltip() func(*Widget, int, int, bool, *Tooltip) bool {
1139	if x.xQueryTooltip == 0 {
1140		return nil
1141	}
1142	var rawCallback func(WidgetVarp uintptr, XVarp int, YVarp int, KeyboardTooltipVarp bool, TooltipVarp uintptr) bool
1143	purego.RegisterFunc(&rawCallback, x.xQueryTooltip)
1144	return func(WidgetVar *Widget, XVar int, YVar int, KeyboardTooltipVar bool, TooltipVar *Tooltip) bool {
1145		return rawCallback(WidgetVar.GoPointer(), XVar, YVar, KeyboardTooltipVar, TooltipVar.GoPointer())
1146	}
1147}
1148
1149// OverrideComputeExpand sets the "compute_expand" callback function.
1150// Computes whether a container should give this
1151//
1152//	widget extra space when possible.
1153func (x *WidgetClass) OverrideComputeExpand(cb func(*Widget, bool, bool)) {
1154	if cb == nil {
1155		x.xComputeExpand = 0
1156	} else {
1157		x.xComputeExpand = purego.NewCallback(func(WidgetVarp uintptr, HexpandPVarp bool, VexpandPVarp bool) {
1158			cb(WidgetNewFromInternalPtr(WidgetVarp), HexpandPVarp, VexpandPVarp)
1159		})
1160	}
1161}
1162
1163// GetComputeExpand gets the "compute_expand" callback function.
1164// Computes whether a container should give this
1165//
1166//	widget extra space when possible.
1167func (x *WidgetClass) GetComputeExpand() func(*Widget, bool, bool) {
1168	if x.xComputeExpand == 0 {
1169		return nil
1170	}
1171	var rawCallback func(WidgetVarp uintptr, HexpandPVarp bool, VexpandPVarp bool)
1172	purego.RegisterFunc(&rawCallback, x.xComputeExpand)
1173	return func(WidgetVar *Widget, HexpandPVar bool, VexpandPVar bool) {
1174		rawCallback(WidgetVar.GoPointer(), HexpandPVar, VexpandPVar)
1175	}
1176}
1177
1178// OverrideCssChanged sets the "css_changed" callback function.
1179// Vfunc called when the CSS used by widget was changed. Widgets
1180//
1181//	should then discard their caches that depend on CSS and queue resizes or
1182//	redraws accordingly. The default implementation will take care of this for
1183//	all the default CSS properties, so implementations must chain up.
1184func (x *WidgetClass) OverrideCssChanged(cb func(*Widget, *CssStyleChange)) {
1185	if cb == nil {
1186		x.xCssChanged = 0
1187	} else {
1188		x.xCssChanged = purego.NewCallback(func(WidgetVarp uintptr, ChangeVarp *CssStyleChange) {
1189			cb(WidgetNewFromInternalPtr(WidgetVarp), ChangeVarp)
1190		})
1191	}
1192}
1193
1194// GetCssChanged gets the "css_changed" callback function.
1195// Vfunc called when the CSS used by widget was changed. Widgets
1196//
1197//	should then discard their caches that depend on CSS and queue resizes or
1198//	redraws accordingly. The default implementation will take care of this for
1199//	all the default CSS properties, so implementations must chain up.
1200func (x *WidgetClass) GetCssChanged() func(*Widget, *CssStyleChange) {
1201	if x.xCssChanged == 0 {
1202		return nil
1203	}
1204	var rawCallback func(WidgetVarp uintptr, ChangeVarp *CssStyleChange)
1205	purego.RegisterFunc(&rawCallback, x.xCssChanged)
1206	return func(WidgetVar *Widget, ChangeVar *CssStyleChange) {
1207		rawCallback(WidgetVar.GoPointer(), ChangeVar)
1208	}
1209}
1210
1211// OverrideSystemSettingChanged sets the "system_setting_changed" callback function.
1212// Emitted when a system setting was changed. Must chain up.
1213func (x *WidgetClass) OverrideSystemSettingChanged(cb func(*Widget, SystemSetting)) {
1214	if cb == nil {
1215		x.xSystemSettingChanged = 0
1216	} else {
1217		x.xSystemSettingChanged = purego.NewCallback(func(WidgetVarp uintptr, SettingsVarp SystemSetting) {
1218			cb(WidgetNewFromInternalPtr(WidgetVarp), SettingsVarp)
1219		})
1220	}
1221}
1222
1223// GetSystemSettingChanged gets the "system_setting_changed" callback function.
1224// Emitted when a system setting was changed. Must chain up.
1225func (x *WidgetClass) GetSystemSettingChanged() func(*Widget, SystemSetting) {
1226	if x.xSystemSettingChanged == 0 {
1227		return nil
1228	}
1229	var rawCallback func(WidgetVarp uintptr, SettingsVarp SystemSetting)
1230	purego.RegisterFunc(&rawCallback, x.xSystemSettingChanged)
1231	return func(WidgetVar *Widget, SettingsVar SystemSetting) {
1232		rawCallback(WidgetVar.GoPointer(), SettingsVar)
1233	}
1234}
1235
1236// OverrideSnapshot sets the "snapshot" callback function.
1237// Vfunc called when a new snapshot of the widget has to be taken.
1238func (x *WidgetClass) OverrideSnapshot(cb func(*Widget, *Snapshot)) {
1239	if cb == nil {
1240		x.xSnapshot = 0
1241	} else {
1242		x.xSnapshot = purego.NewCallback(func(WidgetVarp uintptr, SnapshotVarp uintptr) {
1243			cb(WidgetNewFromInternalPtr(WidgetVarp), SnapshotNewFromInternalPtr(SnapshotVarp))
1244		})
1245	}
1246}
1247
1248// GetSnapshot gets the "snapshot" callback function.
1249// Vfunc called when a new snapshot of the widget has to be taken.
1250func (x *WidgetClass) GetSnapshot() func(*Widget, *Snapshot) {
1251	if x.xSnapshot == 0 {
1252		return nil
1253	}
1254	var rawCallback func(WidgetVarp uintptr, SnapshotVarp uintptr)
1255	purego.RegisterFunc(&rawCallback, x.xSnapshot)
1256	return func(WidgetVar *Widget, SnapshotVar *Snapshot) {
1257		rawCallback(WidgetVar.GoPointer(), SnapshotVar.GoPointer())
1258	}
1259}
1260
1261// OverrideContains sets the "contains" callback function.
1262// Vfunc for gtk_widget_contains().
1263func (x *WidgetClass) OverrideContains(cb func(*Widget, float64, float64) bool) {
1264	if cb == nil {
1265		x.xContains = 0
1266	} else {
1267		x.xContains = purego.NewCallback(func(WidgetVarp uintptr, XVarp float64, YVarp float64) bool {
1268			return cb(WidgetNewFromInternalPtr(WidgetVarp), XVarp, YVarp)
1269		})
1270	}
1271}
1272
1273// GetContains gets the "contains" callback function.
1274// Vfunc for gtk_widget_contains().
1275func (x *WidgetClass) GetContains() func(*Widget, float64, float64) bool {
1276	if x.xContains == 0 {
1277		return nil
1278	}
1279	var rawCallback func(WidgetVarp uintptr, XVarp float64, YVarp float64) bool
1280	purego.RegisterFunc(&rawCallback, x.xContains)
1281	return func(WidgetVar *Widget, XVar float64, YVar float64) bool {
1282		return rawCallback(WidgetVar.GoPointer(), XVar, YVar)
1283	}
1284}
1285
1286type WidgetClassPrivate struct {
1287	_ structs.HostLayout
1288}
1289
1290func (x *WidgetClassPrivate) GoPointer() uintptr {
1291	return uintptr(unsafe.Pointer(x))
1292}
1293
1294type WidgetPrivate struct {
1295	_ structs.HostLayout
1296}
1297
1298func (x *WidgetPrivate) GoPointer() uintptr {
1299	return uintptr(unsafe.Pointer(x))
1300}
1301
1302// The rectangle representing the area allocated for a widget by its parent.
1303type Allocation = uintptr
1304
1305// The base class for all widgets.
1306//
1307// It manages the widget lifecycle, layout, states and style.
1308//
1309// ### Height-for-width Geometry Management
1310//
1311// GTK uses a height-for-width (and width-for-height) geometry management
1312// system. Height-for-width means that a widget can change how much
1313// vertical space it needs, depending on the amount of horizontal space
1314// that it is given (and similar for width-for-height). The most common
1315// example is a label that reflows to fill up the available width, wraps
1316// to fewer lines, and therefore needs less height.
1317//
1318// Height-for-width geometry management is implemented in GTK by way
1319// of two virtual methods:
1320//
1321// - [vfunc@Gtk.Widget.get_request_mode]
1322// - [vfunc@Gtk.Widget.measure]
1323//
1324// There are some important things to keep in mind when implementing
1325// height-for-width and when using it in widget implementations.
1326//
1327// If you implement a direct `GtkWidget` subclass that supports
1328// height-for-width or width-for-height geometry management for itself
1329// or its child widgets, the [vfunc@Gtk.Widget.get_request_mode] virtual
1330// function must be implemented as well and return the widget's preferred
1331// request mode. The default implementation of this virtual function
1332// returns %GTK_SIZE_REQUEST_CONSTANT_SIZE, which means that the widget will
1333// only ever get -1 passed as the for_size value to its
1334// [vfunc@Gtk.Widget.measure] implementation.
1335//
1336// The geometry management system will query a widget hierarchy in
1337// only one orientation at a time. When widgets are initially queried
1338// for their minimum sizes it is generally done in two initial passes
1339// in the [enum@Gtk.SizeRequestMode] chosen by the toplevel.
1340//
1341// For example, when queried in the normal %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH mode:
1342//
1343// First, the default minimum and natural width for each widget
1344// in the interface will be computed using [method@Gtk.Widget.measure] with an
1345// orientation of %GTK_ORIENTATION_HORIZONTAL and a for_size of -1.
1346// Because the preferred widths for each widget depend on the preferred
1347// widths of their children, this information propagates up the hierarchy,
1348// and finally a minimum and natural width is determined for the entire
1349// toplevel. Next, the toplevel will use the minimum width to query for the
1350// minimum height contextual to that width using [method@Gtk.Widget.measure] with an
1351// orientation of %GTK_ORIENTATION_VERTICAL and a for_size of the just computed
1352// width. This will also be a highly recursive operation. The minimum height
1353// for the minimum width is normally used to set the minimum size constraint
1354// on the toplevel.
1355//
1356// After the toplevel window has initially requested its size in both
1357// dimensions it can go on to allocate itself a reasonable size (or a size
1358// previously specified with [method@Gtk.Window.set_default_size]). During the
1359// recursive allocation process it’s important to note that request cycles
1360// will be recursively executed while widgets allocate their children.
1361// Each widget, once allocated a size, will go on to first share the
1362// space in one orientation among its children and then request each child's
1363// height for its target allocated width or its width for allocated height,
1364// depending. In this way a widget will typically be requested its size
1365// a number of times before actually being allocated a size. The size a
1366// widget is finally allocated can of course differ from the size it has
1367// requested. For this reason, `GtkWidget` caches a  small number of results
1368// to avoid re-querying for the same sizes in one allocation cycle.
1369//
1370// If a widget does move content around to intelligently use up the
1371// allocated size then it must support the request in both
1372// `GtkSizeRequestMode`s even if the widget in question only
1373// trades sizes in a single orientation.
1374//
1375// For instance, a [class@Gtk.Label] that does height-for-width word wrapping
1376// will not expect to have [vfunc@Gtk.Widget.measure] with an orientation of
1377// %GTK_ORIENTATION_VERTICAL called because that call is specific to a
1378// width-for-height request. In this case the label must return the height
1379// required for its own minimum possible width. By following this rule any
1380// widget that handles height-for-width or width-for-height requests will
1381// always be allocated at least enough space to fit its own content.
1382//
1383// Here are some examples of how a %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH widget
1384// generally deals with width-for-height requests:
1385//
1386// ```c
1387// static void
1388// foo_widget_measure (GtkWidget      *widget,
1389//
1390//	GtkOrientation  orientation,
1391//	int             for_size,
1392//	int            *minimum_size,
1393//	int            *natural_size,
1394//	int            *minimum_baseline,
1395//	int            *natural_baseline)
1396//
1397//	{
1398//	  if (orientation == GTK_ORIENTATION_HORIZONTAL)
1399//	    {
1400//	      // Calculate minimum and natural width
1401//	    }
1402//	  else // VERTICAL
1403//	    {
1404//	      if (i_am_in_height_for_width_mode)
1405//	        {
1406//	          int min_width, dummy;
1407//
1408//	          // First, get the minimum width of our widget
1409//	          GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
1410//	                                                  &min_width, &dummy, &dummy, &dummy);
1411//
1412//	          // Now use the minimum width to retrieve the minimum and natural height to display
1413//	          // that width.
1414//	          GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_VERTICAL, min_width,
1415//	                                                  minimum_size, natural_size, &dummy, &dummy);
1416//	        }
1417//	      else
1418//	        {
1419//	          // ... some widgets do both.
1420//	        }
1421//	    }
1422//	}
1423//
1424// ```
1425//
1426// Often a widget needs to get its own request during size request or
1427// allocation. For example, when computing height it may need to also
1428// compute width. Or when deciding how to use an allocation, the widget
1429// may need to know its natural size. In these cases, the widget should
1430// be careful to call its virtual methods directly, like in the code
1431// example above.
1432//
1433// It will not work to use the wrapper function [method@Gtk.Widget.measure]
1434// inside your own [vfunc@Gtk.Widget.size_allocate] implementation.
1435// These return a request adjusted by [class@Gtk.SizeGroup], the widget's
1436// align and expand flags, as well as its CSS style.
1437//
1438// If a widget used the wrappers inside its virtual method implementations,
1439// then the adjustments (such as widget margins) would be applied
1440// twice. GTK therefore does not allow this and will warn if you try
1441// to do it.
1442//
1443// Of course if you are getting the size request for another widget, such
1444// as a child widget, you must use [method@Gtk.Widget.measure]; otherwise, you
1445// would not properly consider widget margins, [class@Gtk.SizeGroup], and
1446// so forth.
1447//
1448// GTK also supports baseline vertical alignment of widgets. This
1449// means that widgets are positioned such that the typographical baseline of
1450// widgets in the same row are aligned. This happens if a widget supports
1451// baselines, has a vertical alignment using baselines, and is inside
1452// a widget that supports baselines and has a natural “row” that it aligns to
1453// the baseline, or a baseline assigned to it by the grandparent.
1454//
1455// Baseline alignment support for a widget is also done by the
1456// [vfunc@Gtk.Widget.measure] virtual function. It allows you to report
1457// both a minimum and natural size.
1458//
1459// If a widget ends up baseline aligned it will be allocated all the space in
1460// the parent as if it was %GTK_ALIGN_FILL, but the selected baseline can be
1461// found via [method@Gtk.Widget.get_baseline]. If the baseline has a
1462// value other than -1 you need to align the widget such that the baseline
1463// appears at the position.
1464//
1465// ### GtkWidget as GtkBuildable
1466//
1467// The `GtkWidget` implementation of the `GtkBuildable` interface
1468// supports various custom elements to specify additional aspects of widgets
1469// that are not directly expressed as properties.
1470//
1471// If the widget uses a [class@Gtk.LayoutManager], `GtkWidget` supports
1472// a custom `<layout>` element, used to define layout properties:
1473//
1474// ```xml
1475// <object class="GtkGrid" id="my_grid">
1476//
1477//	<child>
1478//	  <object class="GtkLabel" id="label1">
1479//	    <property name="label">Description</property>
1480//	    <layout>
1481//	      <property name="column">0</property>
1482//	      <property name="row">0</property>
1483//	      <property name="row-span">1</property>
1484//	      <property name="column-span">1</property>
1485//	    </layout>
1486//	  </object>
1487//	</child>
1488//	<child>
1489//	  <object class="GtkEntry" id="description_entry">
1490//	    <layout>
1491//	      <property name="column">1</property>
1492//	      <property name="row">0</property>
1493//	      <property name="row-span">1</property>
1494//	      <property name="column-span">1</property>
1495//	    </layout>
1496//	  </object>
1497//	</child>
1498//
1499// </object>
1500// ```
1501//
1502// `GtkWidget` allows style information such as style classes to
1503// be associated with widgets, using the custom `<style>` element:
1504//
1505// ```xml
1506// <object class="GtkButton" id="button1">
1507//
1508//	<style>
1509//	  <class name="my-special-button-class"/>
1510//	  <class name="dark-button"/>
1511//	</style>
1512//
1513// </object>
1514// ```
1515//
1516// `GtkWidget` allows defining accessibility information, such as properties,
1517// relations, and states, using the custom `<accessibility>` element:
1518//
1519// ```xml
1520// <object class="GtkButton" id="button1">
1521//
1522//	<accessibility>
1523//	  <property name="label">Download</property>
1524//	  <relation name="labelled-by">label1</relation>
1525//	</accessibility>
1526//
1527// </object>
1528// ```
1529//
1530// ### Building composite widgets from template XML
1531//
1532// `GtkWidget `exposes some facilities to automate the procedure
1533// of creating composite widgets using "templates".
1534//
1535// To create composite widgets with `GtkBuilder` XML, one must associate
1536// the interface description with the widget class at class initialization
1537// time using [method@Gtk.WidgetClass.set_template].
1538//
1539// The interface description semantics expected in composite template descriptions
1540// is slightly different from regular [class@Gtk.Builder] XML.
1541//
1542// Unlike regular interface descriptions, [method@Gtk.WidgetClass.set_template]
1543// will expect a `<template>` tag as a direct child of the toplevel
1544// `<interface>` tag. The `<template>` tag must specify the “class” attribute
1545// which must be the type name of the widget. Optionally, the “parent”
1546// attribute may be specified to specify the direct parent type of the widget
1547// type; this is ignored by `GtkBuilder` but can be used by UI design tools to
1548// introspect what kind of properties and internal children exist for a given
1549// type when the actual type does not exist.
1550//
1551// The XML which is contained inside the `<template>` tag behaves as if it were
1552// added to the `<object>` tag defining the widget itself. You may set properties
1553// on a widget by inserting `<property>` tags into the `<template>` tag, and also
1554// add `<child>` tags to add children and extend a widget in the normal way you
1555// would with `<object>` tags.
1556//
1557// Additionally, `<object>` tags can also be added before and after the initial
1558// `<template>` tag in the normal way, allowing one to define auxiliary objects
1559// which might be referenced by other widgets declared as children of the
1560// `<template>` tag.
1561//
1562// Since, unlike the `<object>` tag, the `<template>` tag does not contain an
1563// “id” attribute, if you need to refer to the instance of the object itself that
1564// the template will create, simply refer to the template class name in an
1565// applicable element content.
1566//
1567// Here is an example of a template definition, which includes an example of
1568// this in the `<signal>` tag:
1569//
1570// ```xml
1571// <interface>
1572//
1573//	<template class="FooWidget" parent="GtkBox">
1574//	  <property name="orientation">horizontal</property>
1575//	  <property name="spacing">4</property>
1576//	  <child>
1577//	    <object class="GtkButton" id="hello_button">
1578//	      <property name="label">Hello World</property>
1579//	      <signal name="clicked" handler="hello_button_clicked" object="FooWidget" swapped="yes"/>
1580//	    </object>
1581//	  </child>
1582//	  <child>
1583//	    <object class="GtkButton" id="goodbye_button">
1584//	      <property name="label">Goodbye World</property>
1585//	    </object>
1586//	  </child>
1587//	</template>
1588//
1589// </interface>
1590// ```
1591//
1592// Typically, you'll place the template fragment into a file that is
1593// bundled with your project, using `GResource`. In order to load the
1594// template, you need to call [method@Gtk.WidgetClass.set_template_from_resource]
1595// from the class initialization of your `GtkWidget` type:
1596//
1597// ```c
1598// static void
1599// foo_widget_class_init (FooWidgetClass *klass)
1600//
1601//	{
1602//	  // ...
1603//
1604//	  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
1605//	                                               "/com/example/ui/foowidget.ui");
1606//	}
1607//
1608// ```
1609//
1610// You will also need to call [method@Gtk.Widget.init_template] from the
1611// instance initialization function:
1612//
1613// ```c
1614// static void
1615// foo_widget_init (FooWidget *self)
1616//
1617//	{
1618//	  gtk_widget_init_template (GTK_WIDGET (self));
1619//
1620//	  // Initialize the rest of the widget...
1621//	}
1622//
1623// ```
1624//
1625// as well as calling [method@Gtk.Widget.dispose_template] from the dispose
1626// function:
1627//
1628// ```c
1629// static void
1630// foo_widget_dispose (GObject *gobject)
1631//
1632//	{
1633//	  FooWidget *self = FOO_WIDGET (gobject);
1634//
1635//	  // Dispose objects for which you have a reference...
1636//
1637//	  // Clear the template children for this widget type
1638//	  gtk_widget_dispose_template (GTK_WIDGET (self), FOO_TYPE_WIDGET);
1639//
1640//	  G_OBJECT_CLASS (foo_widget_parent_class)->dispose (gobject);
1641//	}
1642//
1643// ```
1644//
1645// You can access widgets defined in the template using the
1646// [method@Gtk.Widget.get_template_child] function, but you will typically declare
1647// a pointer in the instance private data structure of your type using the same
1648// name as the widget in the template definition, and call
1649// [method@Gtk.WidgetClass.bind_template_child_full] (or one of its wrapper macros
1650// [func@Gtk.widget_class_bind_template_child] and [func@Gtk.widget_class_bind_template_child_private])
1651// with that name, e.g.
1652//
1653// ```c
1654//
1655//	typedef struct {
1656//	  GtkWidget *hello_button;
1657//	  GtkWidget *goodbye_button;
1658//	} FooWidgetPrivate;
1659//
1660// G_DEFINE_TYPE_WITH_PRIVATE (FooWidget, foo_widget, GTK_TYPE_BOX)
1661//
1662// static void
1663// foo_widget_dispose (GObject *gobject)
1664//
1665//	{
1666//	  gtk_widget_dispose_template (GTK_WIDGET (gobject), FOO_TYPE_WIDGET);
1667//
1668//	  G_OBJECT_CLASS (foo_widget_parent_class)->dispose (gobject);
1669//	}
1670//
1671// static void
1672// foo_widget_class_init (FooWidgetClass *klass)
1673//
1674//	{
1675//	  // ...
1676//	  G_OBJECT_CLASS (klass)->dispose = foo_widget_dispose;
1677//
1678//	  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
1679//	                                               "/com/example/ui/foowidget.ui");
1680//	  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
1681//	                                                FooWidget, hello_button);
1682//	  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
1683//	                                                FooWidget, goodbye_button);
1684//	}
1685//
1686// static void
1687// foo_widget_init (FooWidget *widget)
1688//
1689//	{
1690//	  gtk_widget_init_template (GTK_WIDGET (widget));
1691//	}
1692//
1693// ```
1694//
1695// You can also use [method@Gtk.WidgetClass.bind_template_callback_full] (or
1696// is wrapper macro [func@Gtk.widget_class_bind_template_callback]) to connect
1697// a signal callback defined in the template with a function visible in the
1698// scope of the class, e.g.
1699//
1700// ```c
1701// // the signal handler has the instance and user data swapped
1702// // because of the swapped="yes" attribute in the template XML
1703// static void
1704// hello_button_clicked (FooWidget *self,
1705//
1706//	GtkButton *button)
1707//
1708//	{
1709//	  g_print ("Hello, world!\n");
1710//	}
1711//
1712// static void
1713// foo_widget_class_init (FooWidgetClass *klass)
1714//
1715//	{
1716//	  // ...
1717//	  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
1718//	                                               "/com/example/ui/foowidget.ui");
1719//	  gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), hello_button_clicked);
1720//	}
1721//
1722// ```
1723type Widget struct {
1724	gobject.InitiallyUnowned
1725}
1726
1727var xWidgetGLibType func() types.GType
1728
1729func WidgetGLibType() types.GType {
1730	return xWidgetGLibType()
1731}
1732
1733func WidgetNewFromInternalPtr(ptr uintptr) *Widget {
1734	cls := &Widget{}
1735	cls.Ptr = ptr
1736	return cls
1737}
1738
1739var xWidgetActionSetEnabled func(uintptr, string, bool)
1740
1741// Enables or disables an action installed with
1742// [method@Gtk.WidgetClass.install_action].
1743func (x *Widget) ActionSetEnabled(ActionNameVar string, EnabledVar bool) {
1744
1745	xWidgetActionSetEnabled(x.GoPointer(), ActionNameVar, EnabledVar)
1746
1747}
1748
1749var xWidgetActivate func(uintptr) bool
1750
1751// Activates the widget.
1752//
1753// The activation will emit the signal set using
1754// [method@Gtk.WidgetClass.set_activate_signal]
1755// during class initialization.
1756//
1757// Activation is what happens when you press <kbd>Enter</kbd>
1758// on a widget.
1759//
1760// If you wish to handle the activation keybinding yourself,
1761// it is recommended to use [method@Gtk.WidgetClass.add_shortcut]
1762// with an action created with [ctor@Gtk.SignalAction.new].
1763//
1764// If @widget is not activatable, the function returns false.
1765func (x *Widget) Activate() bool {
1766
1767	cret := xWidgetActivate(x.GoPointer())
1768	return cret
1769}
1770
1771var xWidgetActivateAction func(uintptr, string, uintptr, ...interface{}) bool
1772
1773// Activates an action for the widget.
1774//
1775// The action is looked up in the action groups associated with
1776// @widget and its ancestors.
1777//
1778// This is a wrapper around [method@Gtk.Widget.activate_action_variant]
1779// that constructs the @args variant according to @format_string.
1780func (x *Widget) ActivateAction(NameVar string, FormatStringVar *string, varArgs ...interface{}) bool {
1781
1782	FormatStringVarPtr := core.GStrdupNullable(FormatStringVar)
1783	defer core.GFreeNullable(FormatStringVarPtr)
1784
1785	cret := xWidgetActivateAction(x.GoPointer(), NameVar, FormatStringVarPtr, varArgs...)
1786	return cret
1787}
1788
1789var xWidgetActivateActionVariant func(uintptr, string, *glib.Variant) bool
1790
1791// Activates an action for the widget.
1792//
1793// The action is looked up in the action groups associated with
1794// @widget and its ancestors.
1795//
1796// If the action is in an action group added with
1797// [method@Gtk.Widget.insert_action_group], the @name is expected
1798// to be prefixed with the prefix that was used when the group was
1799// inserted.
1800//
1801// The arguments must match the actions expected parameter type,
1802// as returned by [method@Gio.Action.get_parameter_type].
1803func (x *Widget) ActivateActionVariant(NameVar string, ArgsVar *glib.Variant) bool {
1804
1805	cret := xWidgetActivateActionVariant(x.GoPointer(), NameVar, ArgsVar)
1806	return cret
1807}
1808
1809var xWidgetActivateDefault func(uintptr)
1810
1811// Activates the `default.activate` action for the widget.
1812//
1813// The action is looked up in the same was as for
1814// [method@Gtk.Widget.activate_action].
1815func (x *Widget) ActivateDefault() {
1816
1817	xWidgetActivateDefault(x.GoPointer())
1818
1819}
1820
1821var xWidgetAddController func(uintptr, uintptr)
1822
1823// Adds an event controller to the widget.
1824//
1825// The event controllers of a widget handle the events that are
1826// propagated to the widget.
1827//
1828// You will usually want to call this function right after
1829// creating any kind of [class@Gtk.EventController].
1830func (x *Widget) AddController(ControllerVar *EventController) {
1831
1832	xWidgetAddController(x.GoPointer(), ControllerVar.GoPointer())
1833
1834}
1835
1836var xWidgetAddCssClass func(uintptr, string)
1837
1838// Adds a style class to the widget.
1839//
1840// After calling this function, the widget’s style will match
1841// for @css_class, according to CSS matching rules.
1842//
1843// Use [method@Gtk.Widget.remove_css_class] to remove the
1844// style again.
1845func (x *Widget) AddCssClass(CssClassVar string) {
1846
1847	xWidgetAddCssClass(x.GoPointer(), CssClassVar)
1848
1849}
1850
1851var xWidgetAddMnemonicLabel func(uintptr, uintptr)
1852
1853// Adds a widget to the list of mnemonic labels for this widget.
1854//
1855// See [method@Gtk.Widget.list_mnemonic_labels].
1856//
1857// Note that the list of mnemonic labels for the widget is cleared
1858// when the widget is destroyed, so the caller must make sure
1859// to update its internal state at this point as well.
1860func (x *Widget) AddMnemonicLabel(LabelVar *Widget) {
1861
1862	xWidgetAddMnemonicLabel(x.GoPointer(), LabelVar.GoPointer())
1863
1864}
1865
1866var xWidgetAddTickCallback func(uintptr, uintptr, uintptr, uintptr) uint
1867
1868// Queues an animation frame update and adds a callback to be called
1869// before each frame.
1870//
1871// Until the tick callback is removed, it will be called frequently
1872// (usually at the frame rate of the output device or as quickly as
1873// the application can be repainted, whichever is slower). For this
1874// reason, is most suitable for handling graphics that change every
1875// frame or every few frames.
1876//
1877// The tick callback does not automatically imply a relayout or repaint.
1878// If you want a repaint or relayout, and aren’t changing widget properties
1879// that would trigger that (for example, changing the text of a label),
1880// then you will have to call [method@Gtk.Widget.queue_resize] or
1881// [method@Gtk.Widget.queue_draw] yourself.
1882//
1883// [method@Gdk.FrameClock.get_frame_time] should generally be used
1884// for timing continuous animations and
1885// [method@Gdk.FrameTimings.get_predicted_presentation_time] should be
1886// used if you are trying to display isolated frames at particular times.
1887//
1888// This is a more convenient alternative to connecting directly to the
1889// [signal@Gdk.FrameClock::update] signal of the frame clock, since you
1890// don't have to worry about when a frame clock is assigned to a widget.
1891//
1892// To remove a tick callback, pass the ID that is returned by this function
1893// to [method@Gtk.Widget.remove_tick_callback].
1894func (x *Widget) AddTickCallback(CallbackVar *TickCallback, UserDataVar uintptr, NotifyVar *glib.DestroyNotify) uint {
1895
1896	var CallbackVarRef uintptr
1897	if CallbackVar != nil {
1898		CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar))
1899		if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok {
1900			CallbackVarRef = cbRefPtr
1901		} else {
1902			fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) bool {
1903				cbFn := *CallbackVar
1904				return cbFn(arg0, arg1, arg2)
1905			}
1906			CallbackVarRef = purego.NewCallback(fcb)
1907			glib.SaveCallbackWithClosure(CallbackVarPtr, CallbackVarRef, CallbackVar)
1908		}
1909	}
1910
1911	var NotifyVarRef uintptr
1912	if NotifyVar != nil {
1913		NotifyVarPtr := uintptr(unsafe.Pointer(NotifyVar))
1914		if cbRefPtr, ok := glib.GetCallback(NotifyVarPtr); ok {
1915			NotifyVarRef = cbRefPtr
1916		} else {
1917			fcb := func(arg0 uintptr) {
1918				cbFn := *NotifyVar
1919				cbFn(arg0)
1920			}
1921			NotifyVarRef = purego.NewCallback(fcb)
1922			glib.SaveCallbackWithClosure(NotifyVarPtr, NotifyVarRef, NotifyVar)
1923		}
1924	}
1925
1926	cret := xWidgetAddTickCallback(x.GoPointer(), CallbackVarRef, UserDataVar, NotifyVarRef)
1927	return cret
1928}
1929
1930var xWidgetAllocate func(uintptr, int, int, int, *gsk.Transform)
1931
1932// Assigns size, position, (optionally) a baseline and transform
1933// to a child widget.
1934//
1935// In this function, the allocation and baseline may be adjusted.
1936// The given allocation will be forced to be bigger than the
1937// widget's minimum size, as well as at least 0×0 in size.
1938//
1939// This function is only used by widget implementations.
1940//
1941// For a version that does not take a transform, see
1942// [method@Gtk.Widget.size_allocate].
1943func (x *Widget) Allocate(WidthVar int, HeightVar int, BaselineVar int, TransformVar *gsk.Transform) {
1944
1945	xWidgetAllocate(x.GoPointer(), WidthVar, HeightVar, BaselineVar, TransformVar)
1946
1947}
1948
1949var xWidgetChildFocus func(uintptr, DirectionType) bool
1950
1951// Called by widgets as the user moves around the window using
1952// keyboard shortcuts.
1953//
1954// The @direction argument indicates what kind of motion is taking
1955// place (up, down, left, right, tab forward, tab backward).
1956//
1957// This function calls the [vfunc@Gtk.Widget.focus] virtual function;
1958// widgets can override the virtual function in order to implement
1959// appropriate focus behavior.
1960//
1961// The default `focus()` virtual function for a widget should return
1962// true if moving in @direction left the focus on a focusable location
1963// inside that widget, and false if moving in @direction moved the focus
1964// outside the widget. When returning true, widgets normally call
1965// [method@Gtk.Widget.grab_focus] to place the focus accordingly;
1966// when returning false, they don’t modify the current focus location.
1967//
1968// This function is used by custom widget implementations; if you're
1969// writing an app, you’d use [method@Gtk.Widget.grab_focus] to move
1970// the focus to a particular widget.
1971func (x *Widget) ChildFocus(DirectionVar DirectionType) bool {
1972
1973	cret := xWidgetChildFocus(x.GoPointer(), DirectionVar)
1974	return cret
1975}
1976
1977var xWidgetComputeBounds func(uintptr, uintptr, *graphene.Rect) bool
1978
1979// Computes the bounds for @widget in the coordinate space of @target.
1980//
1981// The bounds of widget are (the bounding box of) the region that it is
1982// expected to draw in. See the [coordinate system](coordinates.html)
1983// overview to learn more.
1984//
1985// If the operation is successful, true is returned. If @widget has no
1986// bounds or the bounds cannot be expressed in @target's coordinate space
1987// (for example if both widgets are in different windows), false is
1988// returned and @bounds is set to the zero rectangle.
1989//
1990// It is valid for @widget and @target to be the same widget.
1991func (x *Widget) ComputeBounds(TargetVar *Widget, OutBoundsVar *graphene.Rect) bool {
1992
1993	cret := xWidgetComputeBounds(x.GoPointer(), TargetVar.GoPointer(), OutBoundsVar)
1994	return cret
1995}
1996
1997var xWidgetComputeExpand func(uintptr, Orientation) bool
1998
1999// Computes whether a parent widget should give this widget
2000// extra space when possible.
2001//
2002// Widgets with children should check this, rather than looking at
2003// [method@Gtk.Widget.get_hexpand] or [method@Gtk.Widget.get_vexpand].
2004//
2005// This function already checks whether the widget is visible, so
2006// visibility does not need to be checked separately. Non-visible
2007// widgets are not expanded.
2008//
2009// The computed expand value uses either the expand setting explicitly
2010// set on the widget itself, or, if none has been explicitly set,
2011// the widget may expand if some of its children do.
2012func (x *Widget) ComputeExpand(OrientationVar Orientation) bool {
2013
2014	cret := xWidgetComputeExpand(x.GoPointer(), OrientationVar)
2015	return cret
2016}
2017
2018var xWidgetComputePoint func(uintptr, uintptr, *graphene.Point, *graphene.Point) bool
2019
2020// Translates the given @point in @widget's coordinates to coordinates
2021// in @target’s coordinate system.
2022//
2023// In order to perform this operation, both widgets must share a
2024// a common ancestor. If that is not the case, @out_point is set
2025// to (0, 0) and false is returned.
2026func (x *Widget) ComputePoint(TargetVar *Widget, PointVar *graphene.Point, OutPointVar *graphene.Point) bool {
2027
2028	cret := xWidgetComputePoint(x.GoPointer(), TargetVar.GoPointer(), PointVar, OutPointVar)
2029	return cret
2030}
2031
2032var xWidgetComputeTransform func(uintptr, uintptr, *graphene.Matrix) bool
2033
2034// Computes a matrix suitable to describe a transformation from
2035// @widget's coordinate system into @target's coordinate system.
2036//
2037// The transform can not be computed in certain cases, for example
2038// when @widget and @target do not share a common ancestor. In that
2039// case @out_transform gets set to the identity matrix.
2040//
2041// To learn more about widget coordinate systems, see the coordinate
2042// system [overview](coordinates.html).
2043func (x *Widget) ComputeTransform(TargetVar *Widget, OutTransformVar *graphene.Matrix) bool {
2044
2045	cret := xWidgetComputeTransform(x.GoPointer(), TargetVar.GoPointer(), OutTransformVar)
2046	return cret
2047}
2048
2049var xWidgetContains func(uintptr, float64, float64) bool
2050
2051// Tests if a given point is contained in the widget.
2052//
2053// The coordinates for (x, y) must be in widget coordinates, so
2054// (0, 0) is assumed to be the top left of @widget's content area.
2055func (x *Widget) Contains(XVar float64, YVar float64) bool {
2056
2057	cret := xWidgetContains(x.GoPointer(), XVar, YVar)
2058	return cret
2059}
2060
2061var xWidgetCreatePangoContext func(uintptr) uintptr
2062
2063// Creates a new `PangoContext` that is configured for the widget.
2064//
2065// The `PangoContext` will have the appropriate font map,
2066// font options, font description, and base direction set.
2067//
2068// See also [method@Gtk.Widget.get_pango_context].
2069func (x *Widget) CreatePangoContext() *pango.Context {
2070	var cls *pango.Context
2071
2072	cret := xWidgetCreatePangoContext(x.GoPointer())
2073
2074	if cret == 0 {
2075		return nil
2076	}
2077	cls = &pango.Context{}
2078	cls.Ptr = cret
2079	return cls
2080}
2081
2082var xWidgetCreatePangoLayout func(uintptr, uintptr) uintptr
2083
2084// Creates a new `PangoLayout` that is configured for the widget.
2085//
2086// The `PangoLayout` will have the appropriate font map,
2087// font description, and base direction set.
2088//
2089// If you keep a `PangoLayout` created in this way around,
2090// you need to re-create it when the widgets `PangoContext`
2091// is replaced. This can be tracked by listening to changes
2092// of the [property@Gtk.Widget:root] property on the widget.
2093func (x *Widget) CreatePangoLayout(TextVar *string) *pango.Layout {
2094	var cls *pango.Layout
2095
2096	TextVarPtr := core.GStrdupNullable(TextVar)
2097	defer core.GFreeNullable(TextVarPtr)
2098
2099	cret := xWidgetCreatePangoLayout(x.GoPointer(), TextVarPtr)
2100
2101	if cret == 0 {
2102		return nil
2103	}
2104	cls = &pango.Layout{}
2105	cls.Ptr = cret
2106	return cls
2107}
2108
2109var xWidgetDisposeTemplate func(uintptr, types.GType)
2110
2111// Clears the template children for the widget.
2112//
2113// This function is the opposite of [method@Gtk.Widget.init_template],
2114// and it is used to clear all the template children from a widget
2115// instance. If you bound a template child to a field in the instance
2116// structure, or in the instance private data structure, the field will
2117// be set to `NULL` after this function returns.
2118//
2119// You should call this function inside the `GObjectClass.dispose()`
2120// implementation of any widget that called [method@Gtk.Widget.init_template].
2121// Typically, you will want to call this function last, right before
2122// chaining up to the parent type's dispose implementation, e.g.
2123//
2124// ```c
2125// static void
2126// some_widget_dispose (GObject *gobject)
2127//
2128//	{
2129//	  SomeWidget *self = SOME_WIDGET (gobject);
2130//
2131//	  // Clear the template data for SomeWidget
2132//	  gtk_widget_dispose_template (GTK_WIDGET (self), SOME_TYPE_WIDGET);
2133//
2134//	  G_OBJECT_CLASS (some_widget_parent_class)->dispose (gobject);
2135//	}
2136//
2137// ```
2138func (x *Widget) DisposeTemplate(WidgetTypeVar types.GType) {
2139
2140	xWidgetDisposeTemplate(x.GoPointer(), WidgetTypeVar)
2141
2142}
2143
2144var xWidgetDragCheckThreshold func(uintptr, int, int, int, int) bool
2145
2146// Checks to see if a drag movement has passed the GTK drag threshold.
2147func (x *Widget) DragCheckThreshold(StartXVar int, StartYVar int, CurrentXVar int, CurrentYVar int) bool {
2148
2149	cret := xWidgetDragCheckThreshold(x.GoPointer(), StartXVar, StartYVar, CurrentXVar, CurrentYVar)
2150	return cret
2151}
2152
2153var xWidgetErrorBell func(uintptr)
2154
2155// Notifies the user about an input-related error on the widget.
2156//
2157// If the [property@Gtk.Settings:gtk-error-bell] setting is true,
2158// it calls [method@Gdk.Surface.beep], otherwise it does nothing.
2159//
2160// Note that the effect of [method@Gdk.Surface.beep] can be configured
2161// in many ways, depending on the windowing backend and the desktop
2162// environment or window manager that is used.
2163func (x *Widget) ErrorBell() {
2164
2165	xWidgetErrorBell(x.GoPointer())
2166
2167}
2168
2169var xWidgetGetAllocatedBaseline func(uintptr) int
2170
2171// Returns the baseline that has currently been allocated to the widget.
2172//
2173// This function is intended to be used when implementing handlers
2174// for the `GtkWidget`Class.snapshot() function, and when allocating
2175// child widgets in `GtkWidget`Class.size_allocate().
2176func (x *Widget) GetAllocatedBaseline() int {
2177
2178	cret := xWidgetGetAllocatedBaseline(x.GoPointer())
2179	return cret
2180}
2181
2182var xWidgetGetAllocatedHeight func(uintptr) int
2183
2184// Returns the height that has currently been allocated to the widget.
2185//
2186// To learn more about widget sizes, see the coordinate
2187// system [overview](coordinates.html).
2188func (x *Widget) GetAllocatedHeight() int {
2189
2190	cret := xWidgetGetAllocatedHeight(x.GoPointer())
2191	return cret
2192}
2193
2194var xWidgetGetAllocatedWidth func(uintptr) int
2195
2196// Returns the width that has currently been allocated to the widget.
2197//
2198// To learn more about widget sizes, see the coordinate
2199// system [overview](coordinates.html).
2200func (x *Widget) GetAllocatedWidth() int {
2201
2202	cret := xWidgetGetAllocatedWidth(x.GoPointer())
2203	return cret
2204}
2205
2206var xWidgetGetAllocation func(uintptr, *Allocation)
2207
2208// Retrieves the widget’s allocation.
2209//
2210// Note, when implementing a layout widget: a widget’s allocation
2211// will be its “adjusted” allocation, that is, the widget’s parent
2212// typically calls [method@Gtk.Widget.size_allocate] with an allocation,
2213// and that allocation is then adjusted (to handle margin
2214// and alignment for example) before assignment to the widget.
2215// [method@Gtk.Widget.get_allocation] returns the adjusted allocation that
2216// was actually assigned to the widget. The adjusted allocation is
2217// guaranteed to be completely contained within the
2218// [method@Gtk.Widget.size_allocate] allocation, however.
2219//
2220// So a layout widget is guaranteed that its children stay inside
2221// the assigned bounds, but not that they have exactly the bounds the
2222// widget assigned.
2223func (x *Widget) GetAllocation(AllocationVar *Allocation) {
2224
2225	xWidgetGetAllocation(x.GoPointer(), AllocationVar)
2226
2227}
2228
2229var xWidgetGetAncestor func(uintptr, types.GType) uintptr
2230
2231// Gets the first ancestor of the widget with type @widget_type.
2232//
2233// For example, `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)`
2234// gets the first `GtkBox` that’s an ancestor of @widget. No
2235// reference will be added to the returned widget; it should
2236// not be unreferenced.
2237//
2238// Note that unlike [method@Gtk.Widget.is_ancestor], this function
2239// considers @widget to be an ancestor of itself.
2240func (x *Widget) GetAncestor(WidgetTypeVar types.GType) *Widget {
2241	var cls *Widget
2242
2243	cret := xWidgetGetAncestor(x.GoPointer(), WidgetTypeVar)
2244
2245	if cret == 0 {
2246		return nil
2247	}
2248	gobject.IncreaseRef(cret)
2249	cls = &Widget{}
2250	cls.Ptr = cret
2251	return cls
2252}
2253
2254var xWidgetGetBaseline func(uintptr) int
2255
2256// Returns the baseline that has currently been allocated to the widget.
2257//
2258// This function is intended to be used when implementing handlers
2259// for the `GtkWidgetClass.snapshot()` function, and when allocating
2260// child widgets in `GtkWidgetClass.size_allocate()`.
2261func (x *Widget) GetBaseline() int {
2262
2263	cret := xWidgetGetBaseline(x.GoPointer())
2264	return cret
2265}
2266
2267var xWidgetGetCanFocus func(uintptr) bool
2268
2269// Determines whether the input focus can enter the widget or any
2270// of its children.
2271//
2272// See [method@Gtk.Widget.set_can_focus].
2273func (x *Widget) GetCanFocus() bool {
2274
2275	cret := xWidgetGetCanFocus(x.GoPointer())
2276	return cret
2277}
2278
2279var xWidgetGetCanTarget func(uintptr) bool
2280
2281// Queries whether the widget can be the target of pointer events.
2282func (x *Widget) GetCanTarget() bool {
2283
2284	cret := xWidgetGetCanTarget(x.GoPointer())
2285	return cret
2286}
2287
2288var xWidgetGetChildVisible func(uintptr) bool
2289
2290// Gets the value set with [method@Gtk.Widget.set_child_visible].
2291//
2292// If you feel a need to use this function, your code probably
2293// needs reorganization.
2294//
2295// This function is only useful for widget implementations
2296// and should never be called by an application.
2297func (x *Widget) GetChildVisible() bool {
2298
2299	cret := xWidgetGetChildVisible(x.GoPointer())
2300	return cret
2301}
2302
2303var xWidgetGetClipboard func(uintptr) uintptr
2304
2305// Gets the clipboard object for the widget.
2306//
2307// This is a utility function to get the clipboard object for the
2308// display that @widget is using.
2309//
2310// Note that this function always works, even when @widget is not
2311// realized yet.
2312func (x *Widget) GetClipboard() *gdk.Clipboard {
2313	var cls *gdk.Clipboard
2314
2315	cret := xWidgetGetClipboard(x.GoPointer())
2316
2317	if cret == 0 {
2318		return nil
2319	}
2320	gobject.IncreaseRef(cret)
2321	cls = &gdk.Clipboard{}
2322	cls.Ptr = cret
2323	return cls
2324}
2325
2326var xWidgetGetColor func(uintptr, *gdk.RGBA)
2327
2328// Gets the current foreground color for the widget’s style.
2329//
2330// This function should only be used in snapshot
2331// implementations that need to do custom drawing
2332// with the foreground color.
2333func (x *Widget) GetColor(ColorVar *gdk.RGBA) {
2334
2335	xWidgetGetColor(x.GoPointer(), ColorVar)
2336
2337}
2338
2339var xWidgetGetCssClasses func(uintptr) []string
2340
2341// Returns the list of style classes applied to the widget.
2342func (x *Widget) GetCssClasses() []string {
2343
2344	cret := xWidgetGetCssClasses(x.GoPointer())
2345	return cret
2346}
2347
2348var xWidgetGetCssName func(uintptr) string
2349
2350// Returns the CSS name of the widget.
2351func (x *Widget) GetCssName() string {
2352
2353	cret := xWidgetGetCssName(x.GoPointer())
2354	return cret
2355}
2356
2357var xWidgetGetCursor func(uintptr) uintptr
2358
2359// Gets the cursor set on the widget.
2360//
2361// See [method@Gtk.Widget.set_cursor] for details.
2362func (x *Widget) GetCursor() *gdk.Cursor {
2363	var cls *gdk.Cursor
2364
2365	cret := xWidgetGetCursor(x.GoPointer())
2366
2367	if cret == 0 {
2368		return nil
2369	}
2370	gobject.IncreaseRef(cret)
2371	cls = &gdk.Cursor{}
2372	cls.Ptr = cret
2373	return cls
2374}
2375
2376var xWidgetGetDirection func(uintptr) TextDirection
2377
2378// Gets the reading direction for the widget.
2379//
2380// See [method@Gtk.Widget.set_direction].
2381func (x *Widget) GetDirection() TextDirection {
2382
2383	cret := xWidgetGetDirection(x.GoPointer())
2384	return cret
2385}
2386
2387var xWidgetGetDisplay func(uintptr) uintptr
2388
2389// Get the display for the window that the widget belongs to.
2390//
2391// This function can only be called after the widget has been
2392// added to a widget hierarchy with a `GtkRoot` at the top.
2393//
2394// In general, you should only create display-specific
2395// resources when a widget has been realized, and you should
2396// free those resources when the widget is unrealized.
2397func (x *Widget) GetDisplay() *gdk.Display {
2398	var cls *gdk.Display
2399
2400	cret := xWidgetGetDisplay(x.GoPointer())
2401
2402	if cret == 0 {
2403		return nil
2404	}
2405	gobject.IncreaseRef(cret)
2406	cls = &gdk.Display{}
2407	cls.Ptr = cret
2408	return cls
2409}
2410
2411var xWidgetGetFirstChild func(uintptr) uintptr
2412
2413// Returns the widget’s first child.
2414//
2415// This function is primarily meant for widget implementations.
2416func (x *Widget) GetFirstChild() *Widget {
2417	var cls *Widget
2418
2419	cret := xWidgetGetFirstChild(x.GoPointer())
2420
2421	if cret == 0 {
2422		return nil
2423	}
2424	gobject.IncreaseRef(cret)
2425	cls = &Widget{}
2426	cls.Ptr = cret
2427	return cls
2428}
2429
2430var xWidgetGetFocusChild func(uintptr) uintptr
2431
2432// Returns the focus child of the widget.
2433func (x *Widget) GetFocusChild() *Widget {
2434	var cls *Widget
2435
2436	cret := xWidgetGetFocusChild(x.GoPointer())
2437
2438	if cret == 0 {
2439		return nil
2440	}
2441	gobject.IncreaseRef(cret)
2442	cls = &Widget{}
2443	cls.Ptr = cret
2444	return cls
2445}
2446
2447var xWidgetGetFocusOnClick func(uintptr) bool
2448
2449// Returns whether the widget should grab focus when it is clicked
2450// with the mouse.
2451//
2452// See [method@Gtk.Widget.set_focus_on_click].
2453func (x *Widget) GetFocusOnClick() bool {
2454
2455	cret := xWidgetGetFocusOnClick(x.GoPointer())
2456	return cret
2457}
2458
2459var xWidgetGetFocusable func(uintptr) bool
2460
2461// Determines whether the widget can own the input focus.
2462//
2463// See [method@Gtk.Widget.set_focusable].
2464func (x *Widget) GetFocusable() bool {
2465
2466	cret := xWidgetGetFocusable(x.GoPointer())
2467	return cret
2468}
2469
2470var xWidgetGetFontMap func(uintptr) uintptr
2471
2472// Gets the font map of the widget.
2473//
2474// See [method@Gtk.Widget.set_font_map].
2475func (x *Widget) GetFontMap() *pango.FontMap {
2476	var cls *pango.FontMap
2477
2478	cret := xWidgetGetFontMap(x.GoPointer())
2479
2480	if cret == 0 {
2481		return nil
2482	}
2483	gobject.IncreaseRef(cret)
2484	cls = &pango.FontMap{}
2485	cls.Ptr = cret
2486	return cls
2487}
2488
2489var xWidgetGetFontOptions func(uintptr) *cairo.FontOptions
2490
2491// Returns the `cairo_font_options_t` of the widget.
2492//
2493// Seee [method@Gtk.Widget.set_font_options].
2494func (x *Widget) GetFontOptions() *cairo.FontOptions {
2495
2496	cret := xWidgetGetFontOptions(x.GoPointer())
2497	return cret
2498}
2499
2500var xWidgetGetFrameClock func(uintptr) uintptr
2501
2502// Obtains the frame clock for a widget.
2503//
2504// The frame clock is a global “ticker” that can be used to drive
2505// animations and repaints. The most common reason to get the frame
2506// clock is to call [method@Gdk.FrameClock.get_frame_time], in order
2507// to get a time to use for animating. For example you might record
2508// the start of the animation with an initial value from
2509// [method@Gdk.FrameClock.get_frame_time], and then update the animation
2510// by calling [method@Gdk.FrameClock.get_frame_time] again during each repaint.
2511//
2512// [method@Gdk.FrameClock.request_phase] will result in a new frame on the
2513// clock, but won’t necessarily repaint any widgets. To repaint a widget,
2514// you have to use [method@Gtk.Widget.queue_draw] which invalidates the
2515// widget (thus scheduling it to receive a draw on the next frame).
2516// [method@Gtk.Widget.queue_draw] will also end up requesting a frame
2517// on the appropriate frame clock.
2518//
2519// A widget’s frame clock will not change while the widget is mapped.
2520// Reparenting a widget (which implies a temporary unmap) can change
2521// the widget’s frame clock.
2522//
2523// Unrealized widgets do not have a frame clock.
2524func (x *Widget) GetFrameClock() *gdk.FrameClock {
2525	var cls *gdk.FrameClock
2526
2527	cret := xWidgetGetFrameClock(x.GoPointer())
2528
2529	if cret == 0 {
2530		return nil
2531	}
2532	gobject.IncreaseRef(cret)
2533	cls = &gdk.FrameClock{}
2534	cls.Ptr = cret
2535	return cls
2536}
2537
2538var xWidgetGetHalign func(uintptr) Align
2539
2540// Gets the horizontal alignment of the widget.
2541//
2542// For backwards compatibility reasons this method will never return
2543// one of the baseline alignments, but instead it will convert it to
2544// [enum@Gtk.Align.fill] or [enum@Gtk.Align.center].
2545//
2546// Baselines are not supported for horizontal alignment.
2547func (x *Widget) GetHalign() Align {
2548
2549	cret := xWidgetGetHalign(x.GoPointer())
2550	return cret
2551}
2552
2553var xWidgetGetHasTooltip func(uintptr) bool
2554
2555// Returns the current value of the `has-tooltip` property.
2556func (x *Widget) GetHasTooltip() bool {
2557
2558	cret := xWidgetGetHasTooltip(x.GoPointer())
2559	return cret
2560}
2561
2562var xWidgetGetHeight func(uintptr) int
2563
2564// Returns the content height of the widget.
2565//
2566// This function returns the height passed to its
2567// size-allocate implementation, which is the height you
2568// should be using in [vfunc@Gtk.Widget.snapshot].
2569//
2570// For pointer events, see [method@Gtk.Widget.contains].
2571//
2572// To learn more about widget sizes, see the coordinate
2573// system [overview](coordinates.html).
2574func (x *Widget) GetHeight() int {
2575
2576	cret := xWidgetGetHeight(x.GoPointer())
2577	return cret
2578}
2579
2580var xWidgetGetHexpand func(uintptr) bool
2581
2582// Gets whether the widget would like any available extra horizontal
2583// space.
2584//
2585// When a user resizes a window, widgets with expand set to true generally
2586// receive the extra space. For example, a list or scrollable area
2587// or document in your window would often be set to expand.
2588//
2589// Widgets with children should use [method@Gtk.Widget.compute_expand]
2590// rather than this function, to see whether any of its children,
2591// has the expand flag set. If any child of a widget wants to
2592// expand, the parent may ask to expand also.
2593//
2594// This function only looks at the widget’s own hexpand flag, rather
2595// than computing whether the entire widget tree rooted at this widget
2596// wants to expand.
2597func (x *Widget) GetHexpand() bool {
2598
2599	cret := xWidgetGetHexpand(x.GoPointer())
2600	return cret
2601}
2602
2603var xWidgetGetHexpandSet func(uintptr) bool
2604
2605// Gets whether the `hexpand` flag has been explicitly set.
2606//
2607// If [property@Gtk.Widget:hexpand] property is set, then it
2608// overrides any computed expand value based on child widgets.
2609// If `hexpand` is not set, then the expand value depends on
2610// whether any children of the widget would like to expand.
2611//
2612// There are few reasons to use this function, but it’s here
2613// for completeness and consistency.
2614func (x *Widget) GetHexpandSet() bool {
2615
2616	cret := xWidgetGetHexpandSet(x.GoPointer())
2617	return cret
2618}
2619
2620var xWidgetGetLastChild func(uintptr) uintptr
2621
2622// Returns the widget’s last child.
2623//
2624// This function is primarily meant for widget implementations.
2625func (x *Widget) GetLastChild() *Widget {
2626	var cls *Widget
2627
2628	cret := xWidgetGetLastChild(x.GoPointer())
2629
2630	if cret == 0 {
2631		return nil
2632	}
2633	gobject.IncreaseRef(cret)
2634	cls = &Widget{}
2635	cls.Ptr = cret
2636	return cls
2637}
2638
2639var xWidgetGetLayoutManager func(uintptr) uintptr
2640
2641// Retrieves the layout manager of the widget.
2642//
2643// See [method@Gtk.Widget.set_layout_manager].
2644func (x *Widget) GetLayoutManager() *LayoutManager {
2645	var cls *LayoutManager
2646
2647	cret := xWidgetGetLayoutManager(x.GoPointer())
2648
2649	if cret == 0 {
2650		return nil
2651	}
2652	gobject.IncreaseRef(cret)
2653	cls = &LayoutManager{}
2654	cls.Ptr = cret
2655	return cls
2656}
2657
2658var xWidgetGetLimitEvents func(uintptr) bool
2659
2660// Gets the value of the [property@Gtk.Widget:limit-events] property.
2661func (x *Widget) GetLimitEvents() bool {
2662
2663	cret := xWidgetGetLimitEvents(x.GoPointer())
2664	return cret
2665}
2666
2667var xWidgetGetMapped func(uintptr) bool
2668
2669// Returns whether the widget is mapped.
2670func (x *Widget) GetMapped() bool {
2671
2672	cret := xWidgetGetMapped(x.GoPointer())
2673	return cret
2674}
2675
2676var xWidgetGetMarginBottom func(uintptr) int
2677
2678// Gets the bottom margin of the widget.
2679func (x *Widget) GetMarginBottom() int {
2680
2681	cret := xWidgetGetMarginBottom(x.GoPointer())
2682	return cret
2683}
2684
2685var xWidgetGetMarginEnd func(uintptr) int
2686
2687// Gets the end margin of the widget.
2688func (x *Widget) GetMarginEnd() int {
2689
2690	cret := xWidgetGetMarginEnd(x.GoPointer())
2691	return cret
2692}
2693
2694var xWidgetGetMarginStart func(uintptr) int
2695
2696// Gets the start margin of the widget.
2697func (x *Widget) GetMarginStart() int {
2698
2699	cret := xWidgetGetMarginStart(x.GoPointer())
2700	return cret
2701}
2702
2703var xWidgetGetMarginTop func(uintptr) int
2704
2705// Gets the top margin of the widget.
2706func (x *Widget) GetMarginTop() int {
2707
2708	cret := xWidgetGetMarginTop(x.GoPointer())
2709	return cret
2710}
2711
2712var xWidgetGetName func(uintptr) string
2713
2714// Retrieves the name of a widget.
2715//
2716// See [method@Gtk.Widget.set_name] for the significance of widget names.
2717func (x *Widget) GetName() string {
2718
2719	cret := xWidgetGetName(x.GoPointer())
2720	return cret
2721}
2722
2723var xWidgetGetNative func(uintptr) uintptr
2724
2725// Returns the nearest `GtkNative` ancestor of the widget.
2726//
2727// This function will return `NULL` if the widget is not
2728// contained inside a widget tree with a native ancestor.
2729//
2730// `GtkNative` widgets will return themselves here.
2731func (x *Widget) GetNative() *NativeBase {
2732	var cls *NativeBase
2733
2734	cret := xWidgetGetNative(x.GoPointer())
2735
2736	if cret == 0 {
2737		return nil
2738	}
2739	gobject.IncreaseRef(cret)
2740	cls = &NativeBase{}
2741	cls.Ptr = cret
2742	return cls
2743}
2744
2745var xWidgetGetNextSibling func(uintptr) uintptr
2746
2747// Returns the widget’s next sibling.
2748//
2749// This function is primarily meant for widget implementations.
2750func (x *Widget) GetNextSibling() *Widget {
2751	var cls *Widget
2752
2753	cret := xWidgetGetNextSibling(x.GoPointer())
2754
2755	if cret == 0 {
2756		return nil
2757	}
2758	gobject.IncreaseRef(cret)
2759	cls = &Widget{}
2760	cls.Ptr = cret
2761	return cls
2762}
2763
2764var xWidgetGetOpacity func(uintptr) float64
2765
2766// Fetches the requested opacity for the widget.
2767//
2768// See [method@Gtk.Widget.set_opacity].
2769func (x *Widget) GetOpacity() float64 {
2770
2771	cret := xWidgetGetOpacity(x.GoPointer())
2772	return cret
2773}
2774
2775var xWidgetGetOverflow func(uintptr) Overflow
2776
2777// Returns the widget’s overflow value.
2778func (x *Widget) GetOverflow() Overflow {
2779
2780	cret := xWidgetGetOverflow(x.GoPointer())
2781	return cret
2782}
2783
2784var xWidgetGetPangoContext func(uintptr) uintptr
2785
2786// Gets a `PangoContext` that is configured for the widget.
2787//
2788// The `PangoContext` will have the appropriate font map, font description,
2789// and base direction set.
2790//
2791// Unlike the context returned by [method@Gtk.Widget.create_pango_context],
2792// this context is owned by the widget (it can be used until the screen
2793// for the widget changes or the widget is removed from its toplevel),
2794// and will be updated to match any changes to the widget’s attributes.
2795// This can be tracked by listening to changes of the
2796// [property@Gtk.Widget:root] property on the widget.
2797func (x *Widget) GetPangoContext() *pango.Context {
2798	var cls *pango.Context
2799
2800	cret := xWidgetGetPangoContext(x.GoPointer())
2801
2802	if cret == 0 {
2803		return nil
2804	}
2805	gobject.IncreaseRef(cret)
2806	cls = &pango.Context{}
2807	cls.Ptr = cret
2808	return cls
2809}
2810
2811var xWidgetGetParent func(uintptr) uintptr
2812
2813// Returns the parent widget of the widget.
2814func (x *Widget) GetParent() *Widget {
2815	var cls *Widget
2816
2817	cret := xWidgetGetParent(x.GoPointer())
2818
2819	if cret == 0 {
2820		return nil
2821	}
2822	gobject.IncreaseRef(cret)
2823	cls = &Widget{}
2824	cls.Ptr = cret
2825	return cls
2826}
2827
2828var xWidgetGetPreferredSize func(uintptr, *Requisition, *Requisition)
2829
2830// Retrieves the minimum and natural size of a widget, taking
2831// into account the widget’s preference for height-for-width management.
2832//
2833// This is used to retrieve a suitable size by container widgets which do
2834// not impose any restrictions on the child placement. It can be used
2835// to deduce toplevel window and menu sizes as well as child widgets in
2836// free-form containers such as `GtkFixed`.
2837//
2838// Handle with care. Note that the natural height of a height-for-width
2839// widget will generally be a smaller size than the minimum height, since
2840// the required height for the natural width is generally smaller than the
2841// required height for the minimum width.
2842//
2843// Use [method@Gtk.Widget.measure] if you want to support baseline alignment.
2844func (x *Widget) GetPreferredSize(MinimumSizeVar *Requisition, NaturalSizeVar *Requisition) {
2845
2846	xWidgetGetPreferredSize(x.GoPointer(), MinimumSizeVar, NaturalSizeVar)
2847
2848}
2849
2850var xWidgetGetPrevSibling func(uintptr) uintptr
2851
2852// Returns the widget’s previous sibling.
2853//
2854// This function is primarily meant for widget implementations.
2855func (x *Widget) GetPrevSibling() *Widget {
2856	var cls *Widget
2857
2858	cret := xWidgetGetPrevSibling(x.GoPointer())
2859
2860	if cret == 0 {
2861		return nil
2862	}
2863	gobject.IncreaseRef(cret)
2864	cls = &Widget{}
2865	cls.Ptr = cret
2866	return cls
2867}
2868
2869var xWidgetGetPrimaryClipboard func(uintptr) uintptr
2870
2871// Gets the primary clipboard of the widget.
2872//
2873// This is a utility function to get the primary clipboard object
2874// for the display that @widget is using.
2875//
2876// Note that this function always works, even when @widget is not
2877// realized yet.
2878func (x *Widget) GetPrimaryClipboard() *gdk.Clipboard {
2879	var cls *gdk.Clipboard
2880
2881	cret := xWidgetGetPrimaryClipboard(x.GoPointer())
2882
2883	if cret == 0 {
2884		return nil
2885	}
2886	gobject.IncreaseRef(cret)
2887	cls = &gdk.Clipboard{}
2888	cls.Ptr = cret
2889	return cls
2890}
2891
2892var xWidgetGetRealized func(uintptr) bool
2893
2894// Determines whether the widget is realized.
2895func (x *Widget) GetRealized() bool {
2896
2897	cret := xWidgetGetRealized(x.GoPointer())
2898	return cret
2899}
2900
2901var xWidgetGetReceivesDefault func(uintptr) bool
2902
2903// Determines whether the widget is always treated as the default widget
2904// within its toplevel when it has the focus, even if another widget
2905// is the default.
2906//
2907// See [method@Gtk.Widget.set_receives_default].
2908func (x *Widget) GetReceivesDefault() bool {
2909
2910	cret := xWidgetGetReceivesDefault(x.GoPointer())
2911	return cret
2912}
2913
2914var xWidgetGetRequestMode func(uintptr) SizeRequestMode
2915
2916// Gets whether the widget prefers a height-for-width layout
2917// or a width-for-height layout.
2918//
2919// Single-child widgets generally propagate the preference of
2920// their child, more complex widgets need to request something
2921// either in context of their children or in context of their
2922// allocation capabilities.
2923func (x *Widget) GetRequestMode() SizeRequestMode {
2924
2925	cret := xWidgetGetRequestMode(x.GoPointer())
2926	return cret
2927}
2928
2929var xWidgetGetRoot func(uintptr) uintptr
2930
2931// Returns the `GtkRoot` widget of the widget.
2932//
2933// This function will return `NULL` if the widget is not contained
2934// inside a widget tree with a root widget.
2935//
2936// `GtkRoot` widgets will return themselves here.
2937func (x *Widget) GetRoot() *RootBase {
2938	var cls *RootBase
2939
2940	cret := xWidgetGetRoot(x.GoPointer())
2941
2942	if cret == 0 {
2943		return nil
2944	}
2945	gobject.IncreaseRef(cret)
2946	cls = &RootBase{}
2947	cls.Ptr = cret
2948	return cls
2949}
2950
2951var xWidgetGetScaleFactor func(uintptr) int
2952
2953// Retrieves the internal scale factor that maps from window
2954// coordinates to the actual device pixels.
2955//
2956// On traditional systems this is 1, on high density outputs,
2957// it can be a higher value (typically 2).
2958//
2959// See [method@Gdk.Surface.get_scale_factor].
2960//
2961// Note that modern systems may support *fractional* scaling,
2962// where the scale factor is not an integer. On such systems,
2963// this function will return the next higher integer value,
2964// but you probably want to use [method@Gdk.Surface.get_scale]
2965// to get the fractional scale value.
2966func (x *Widget) GetScaleFactor() int {
2967
2968	cret := xWidgetGetScaleFactor(x.GoPointer())
2969	return cret
2970}
2971
2972var xWidgetGetSensitive func(uintptr) bool
2973
2974// Returns the widget’s sensitivity.
2975//
2976// This function returns the value that has been set using
2977// [method@Gtk.Widget.set_sensitive]).
2978//
2979// The effective sensitivity of a widget is however determined
2980// by both its own and its parent widget’s sensitivity.
2981// See [method@Gtk.Widget.is_sensitive].
2982func (x *Widget) GetSensitive() bool {
2983
2984	cret := xWidgetGetSensitive(x.GoPointer())
2985	return cret
2986}
2987
2988var xWidgetGetSettings func(uintptr) uintptr
2989
2990// Gets the settings object holding the settings used for the widget.
2991//
2992// Note that this function can only be called when the `GtkWidget`
2993// is attached to a toplevel, since the settings object is specific
2994// to a particular display. If you want to monitor the widget for
2995// changes in its settings, connect to the `notify::display` signal.
2996func (x *Widget) GetSettings() *Settings {
2997	var cls *Settings
2998
2999	cret := xWidgetGetSettings(x.GoPointer())
3000
3001	if cret == 0 {
3002		return nil
3003	}
3004	gobject.IncreaseRef(cret)
3005	cls = &Settings{}
3006	cls.Ptr = cret
3007	return cls
3008}
3009
3010var xWidgetGetSize func(uintptr, Orientation) int
3011
3012// Returns the content width or height of the widget.
3013//
3014// Which dimension is returned depends on @orientation.
3015//
3016// This is equivalent to calling [method@Gtk.Widget.get_width]
3017// for [enum@Gtk.Orientation.horizontal] or [method@Gtk.Widget.get_height]
3018// for [enum@Gtk.Orientation.vertical], but can be used when
3019// writing orientation-independent code, such as when
3020// implementing [iface@Gtk.Orientable] widgets.
3021//
3022// To learn more about widget sizes, see the coordinate
3023// system [overview](coordinates.html).
3024func (x *Widget) GetSize(OrientationVar Orientation) int {
3025
3026	cret := xWidgetGetSize(x.GoPointer(), OrientationVar)
3027	return cret
3028}
3029
3030var xWidgetGetSizeRequest func(uintptr, *int, *int)
3031
3032// Gets the size request that was explicitly set for the widget.
3033//
3034// A value of -1 stored in @width or @height indicates that that
3035// dimension has not been set explicitly and the natural requisition
3036// of the widget will be used instead.
3037//
3038// See [method@Gtk.Widget.set_size_request].
3039//
3040// To get the size a widget will actually request, call
3041// [method@Gtk.Widget.measure] instead of this function.
3042func (x *Widget) GetSizeRequest(WidthVar *int, HeightVar *int) {
3043
3044	xWidgetGetSizeRequest(x.GoPointer(), WidthVar, HeightVar)
3045
3046}
3047
3048var xWidgetGetStateFlags func(uintptr) StateFlags
3049
3050// Returns the widget state as a flag set.
3051//
3052// It is worth mentioning that the effective [flags@Gtk.StateFlags.insensitive]
3053// state will be returned, that is, also based on parent insensitivity,
3054// even if @widget itself is sensitive.
3055//
3056// Also note that if you are looking for a way to obtain the
3057// [flags@Gtk.StateFlags] to pass to a [class@Gtk.StyleContext]
3058// method, you should look at [method@Gtk.StyleContext.get_state].
3059func (x *Widget) GetStateFlags() StateFlags {
3060
3061	cret := xWidgetGetStateFlags(x.GoPointer())
3062	return cret
3063}
3064
3065var xWidgetGetStyleContext func(uintptr) uintptr
3066
3067// Returns the style context associated to the widget.
3068//
3069// The returned object is guaranteed to be the same
3070// for the lifetime of @widget.
3071func (x *Widget) GetStyleContext() *StyleContext {
3072	var cls *StyleContext
3073
3074	cret := xWidgetGetStyleContext(x.GoPointer())
3075
3076	if cret == 0 {
3077		return nil
3078	}
3079	gobject.IncreaseRef(cret)
3080	cls = &StyleContext{}
3081	cls.Ptr = cret
3082	return cls
3083}
3084
3085var xWidgetGetTemplateChild func(uintptr, types.GType, string) uintptr
3086
3087// Fetches an object build from the template XML for @widget_type in
3088// the widget.
3089//
3090// This will only report children which were previously declared
3091// with [method@Gtk.WidgetClass.bind_template_child_full] or one of its
3092// variants.
3093//
3094// This function is only meant to be called for code which is private
3095// to the @widget_type which declared the child and is meant for language
3096// bindings which cannot easily make use of the GObject structure offsets.
3097func (x *Widget) GetTemplateChild(WidgetTypeVar types.GType, NameVar string) *gobject.Object {
3098	var cls *gobject.Object
3099
3100	cret := xWidgetGetTemplateChild(x.GoPointer(), WidgetTypeVar, NameVar)
3101
3102	if cret == 0 {
3103		return nil
3104	}
3105	gobject.IncreaseRef(cret)
3106	cls = &gobject.Object{}
3107	cls.Ptr = cret
3108	return cls
3109}
3110
3111var xWidgetGetTooltipMarkup func(uintptr) string
3112
3113// Gets the contents of the tooltip for the widget.
3114//
3115// If the tooltip has not been set using
3116// [method@Gtk.Widget.set_tooltip_markup], this
3117// function returns `NULL`.
3118func (x *Widget) GetTooltipMarkup() string {
3119
3120	cret := xWidgetGetTooltipMarkup(x.GoPointer())
3121	return cret
3122}
3123
3124var xWidgetGetTooltipText func(uintptr) string
3125
3126// Gets the contents of the tooltip for the widget.
3127//
3128// If the @widget's tooltip was set using
3129// [method@Gtk.Widget.set_tooltip_markup],
3130// this function will return the escaped text.
3131func (x *Widget) GetTooltipText() string {
3132
3133	cret := xWidgetGetTooltipText(x.GoPointer())
3134	return cret
3135}
3136
3137var xWidgetGetValign func(uintptr) Align
3138
3139// Gets the vertical alignment of the widget.
3140func (x *Widget) GetValign() Align {
3141
3142	cret := xWidgetGetValign(x.GoPointer())
3143	return cret
3144}
3145
3146var xWidgetGetVexpand func(uintptr) bool
3147
3148// Gets whether the widget would like any available extra vertical
3149// space.
3150//
3151// See [method@Gtk.Widget.get_hexpand] for more detail.
3152func (x *Widget) GetVexpand() bool {
3153
3154	cret := xWidgetGetVexpand(x.GoPointer())
3155	return cret
3156}
3157
3158var xWidgetGetVexpandSet func(uintptr) bool
3159
3160// Gets whether the `vexpand` flag has been explicitly set.
3161//
3162// See [method@Gtk.Widget.get_hexpand_set] for more detail.
3163func (x *Widget) GetVexpandSet() bool {
3164
3165	cret := xWidgetGetVexpandSet(x.GoPointer())
3166	return cret
3167}
3168
3169var xWidgetGetVisible func(uintptr) bool
3170
3171// Determines whether the widget is visible.
3172//
3173// If you want to take into account whether the widget’s
3174// parent is also marked as visible, use
3175// [method@Gtk.Widget.is_visible] instead.
3176//
3177// This function does not check if the widget is
3178// obscured in any way.
3179//
3180// See [method@Gtk.Widget.set_visible].
3181func (x *Widget) GetVisible() bool {
3182
3183	cret := xWidgetGetVisible(x.GoPointer())
3184	return cret
3185}
3186
3187var xWidgetGetWidth func(uintptr) int
3188
3189// Returns the content width of the widget.
3190//
3191// This function returns the width passed to its
3192// size-allocate implementation, which is the width you
3193// should be using in [vfunc@Gtk.Widget.snapshot].
3194//
3195// For pointer events, see [method@Gtk.Widget.contains].
3196//
3197// To learn more about widget sizes, see the coordinate
3198// system [overview](coordinates.html).
3199func (x *Widget) GetWidth() int {
3200
3201	cret := xWidgetGetWidth(x.GoPointer())
3202	return cret
3203}
3204
3205var xWidgetGrabFocus func(uintptr) bool
3206
3207// Causes @widget to have the keyboard focus for the window
3208// that it belongs to.
3209//
3210// If @widget is not focusable, or its [vfunc@Gtk.Widget.grab_focus]
3211// implementation cannot transfer the focus to a descendant of @widget
3212// that is focusable, it will not take focus and false will be returned.
3213//
3214// Calling [method@Gtk.Widget.grab_focus] on an already focused widget
3215// is allowed, should not have an effect, and return true.
3216func (x *Widget) GrabFocus() bool {
3217
3218	cret := xWidgetGrabFocus(x.GoPointer())
3219	return cret
3220}
3221
3222var xWidgetHasCssClass func(uintptr, string) bool
3223
3224// Returns whether a style class is currently applied to the widget.
3225func (x *Widget) HasCssClass(CssClassVar string) bool {
3226
3227	cret := xWidgetHasCssClass(x.GoPointer(), CssClassVar)
3228	return cret
3229}
3230
3231var xWidgetHasDefault func(uintptr) bool
3232
3233// Determines whether the widget is the current default widget
3234// within its toplevel.
3235func (x *Widget) HasDefault() bool {
3236
3237	cret := xWidgetHasDefault(x.GoPointer())
3238	return cret
3239}
3240
3241var xWidgetHasFocus func(uintptr) bool
3242
3243// Determines if the widget has the global input focus.
3244//
3245// See [method@Gtk.Widget.is_focus] for the difference between
3246// having the global input focus, and only having the focus
3247// within a toplevel.
3248func (x *Widget) HasFocus() bool {
3249
3250	cret := xWidgetHasFocus(x.GoPointer())
3251	return cret
3252}
3253
3254var xWidgetHasVisibleFocus func(uintptr) bool
3255
3256// Determines if the widget should show a visible indication that
3257// it has the global input focus.
3258//
3259// This is a convenience function that takes into account whether
3260// focus indication should currently be shown in the toplevel window
3261// of @widget. See [method@Gtk.Window.get_focus_visible] for more
3262// information about focus indication.
3263//
3264// To find out if the widget has the global input focus, use
3265// [method@Gtk.Widget.has_focus].
3266func (x *Widget) HasVisibleFocus() bool {
3267
3268	cret := xWidgetHasVisibleFocus(x.GoPointer())
3269	return cret
3270}
3271
3272var xWidgetHide func(uintptr)
3273
3274// Reverses the effects of [method.Gtk.Widget.show].
3275//
3276// This is causing the widget to be hidden (invisible to the user).
3277func (x *Widget) Hide() {
3278
3279	xWidgetHide(x.GoPointer())
3280
3281}
3282
3283var xWidgetInDestruction func(uintptr) bool
3284
3285// Returns whether the widget is currently being destroyed.
3286//
3287// This information can sometimes be used to avoid doing
3288// unnecessary work.
3289func (x *Widget) InDestruction() bool {
3290
3291	cret := xWidgetInDestruction(x.GoPointer())
3292	return cret
3293}
3294
3295var xWidgetInitTemplate func(uintptr)
3296
3297// Creates and initializes child widgets defined in templates.
3298//
3299// This function must be called in the instance initializer
3300// for any class which assigned itself a template using
3301// [method@Gtk.WidgetClass.set_template].
3302//
3303// It is important to call this function in the instance initializer
3304// of a widget subclass and not in `GObject.constructed()` or
3305// `GObject.constructor()` for two reasons:
3306//
3307//   - derived widgets will assume that the composite widgets
3308//     defined by its parent classes have been created in their
3309//     relative instance initializers
3310//   - when calling `g_object_new()` on a widget with composite templates,
3311//     it’s important to build the composite widgets before the construct
3312//     properties are set. Properties passed to `g_object_new()` should
3313//     take precedence over properties set in the private template XML
3314//
3315// A good rule of thumb is to call this function as the first thing in
3316// an instance initialization function.
3317func (x *Widget) InitTemplate() {
3318
3319	xWidgetInitTemplate(x.GoPointer())
3320
3321}
3322
3323var xWidgetInsertActionGroup func(uintptr, string, uintptr)
3324
3325// Inserts an action group into the widget's actions.
3326//
3327// Children of @widget that implement [iface@Gtk.Actionable] can
3328// then be associated with actions in @group by setting their
3329// “action-name” to @prefix.`action-name`.
3330//
3331// Note that inheritance is defined for individual actions. I.e.
3332// even if you insert a group with prefix @prefix, actions with
3333// the same prefix will still be inherited from the parent, unless
3334// the group contains an action with the same name.
3335//
3336// If @group is `NULL`, a previously inserted group for @name is
3337// removed from @widget.
3338func (x *Widget) InsertActionGroup(NameVar string, GroupVar gio.ActionGroup) {
3339
3340	xWidgetInsertActionGroup(x.GoPointer(), NameVar, GroupVar.GoPointer())
3341
3342}
3343
3344var xWidgetInsertAfter func(uintptr, uintptr, uintptr)
3345
3346// Sets the parent widget of the widget.
3347//
3348// In contrast to [method@Gtk.Widget.set_parent], this function
3349// inserts @widget at a specific position into the list of children
3350// of the @parent widget.
3351//
3352// It will be placed after @previous_sibling, or at the beginning if
3353// @previous_sibling is `NULL`.
3354//
3355// After calling this function, `gtk_widget_get_prev_sibling (widget)`
3356// will return @previous_sibling.
3357//
3358// If @parent is already set as the parent widget of @widget, this
3359// function can also be used to reorder @widget in the child widget
3360// list of @parent.
3361//
3362// This function is primarily meant for widget implementations; if you are
3363// just using a widget, you *must* use its own API for adding children.
3364func (x *Widget) InsertAfter(ParentVar *Widget, PreviousSiblingVar *Widget) {
3365
3366	xWidgetInsertAfter(x.GoPointer(), ParentVar.GoPointer(), PreviousSiblingVar.GoPointer())
3367
3368}
3369
3370var xWidgetInsertBefore func(uintptr, uintptr, uintptr)
3371
3372// Sets the parent widget of the widget.
3373//
3374// In contrast to [method@Gtk.Widget.set_parent], this function
3375// inserts @widget at a specific position into the list of children
3376// of the @parent widget.
3377//
3378// It will be placed before @next_sibling, or at the end if
3379// @next_sibling is `NULL`.
3380//
3381// After calling this function, `gtk_widget_get_next_sibling (widget)`
3382// will return @next_sibling.
3383//
3384// If @parent is already set as the parent widget of @widget, this function
3385// can also be used to reorder @widget in the child widget list of @parent.
3386//
3387// This function is primarily meant for widget implementations; if you are
3388// just using a widget, you *must* use its own API for adding children.
3389func (x *Widget) InsertBefore(ParentVar *Widget, NextSiblingVar *Widget) {
3390
3391	xWidgetInsertBefore(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
3392
3393}
3394
3395var xWidgetIsAncestor func(uintptr, uintptr) bool
3396
3397// Determines whether the widget is a descendent of @ancestor.
3398func (x *Widget) IsAncestor(AncestorVar *Widget) bool {
3399
3400	cret := xWidgetIsAncestor(x.GoPointer(), AncestorVar.GoPointer())
3401	return cret
3402}
3403
3404var xWidgetIsDrawable func(uintptr) bool
3405
3406// Determines whether the widget can be drawn to.
3407//
3408// A widget can be drawn if it is mapped and visible.
3409func (x *Widget) IsDrawable() bool {
3410
3411	cret := xWidgetIsDrawable(x.GoPointer())
3412	return cret
3413}
3414
3415var xWidgetIsFocus func(uintptr) bool
3416
3417// Determines if the widget is the focus widget within its
3418// toplevel.
3419//
3420// This does not mean that the [property@Gtk.Widget:has-focus]
3421// property is necessarily set; [property@Gtk.Widget:has-focus]
3422// will only be set if the toplevel widget additionally has the
3423// global input focus.
3424func (x *Widget) IsFocus() bool {
3425
3426	cret := xWidgetIsFocus(x.GoPointer())
3427	return cret
3428}
3429
3430var xWidgetIsSensitive func(uintptr) bool
3431
3432// Returns the widget’s effective sensitivity.
3433//
3434// This means it is sensitive itself and also its
3435// parent widget is sensitive.
3436func (x *Widget) IsSensitive() bool {
3437
3438	cret := xWidgetIsSensitive(x.GoPointer())
3439	return cret
3440}
3441
3442var xWidgetIsVisible func(uintptr) bool
3443
3444// Determines whether the widget and all its parents are marked as
3445// visible.
3446//
3447// This function does not check if the widget is obscured in any way.
3448//
3449// See also [method@Gtk.Widget.get_visible] and
3450// [method@Gtk.Widget.set_visible].
3451func (x *Widget) IsVisible() bool {
3452
3453	cret := xWidgetIsVisible(x.GoPointer())
3454	return cret
3455}
3456
3457var xWidgetKeynavFailed func(uintptr, DirectionType) bool
3458
3459// Emits the [signal@Gtk.Widget::keynav-failed] signal on the widget.
3460//
3461// This function should be called whenever keyboard navigation
3462// within a single widget hits a boundary.
3463//
3464// The return value of this function should be interpreted
3465// in a way similar to the return value of
3466// [method@Gtk.Widget.child_focus]. When true is returned,
3467// stay in the widget, the failed keyboard navigation is ok
3468// and/or there is nowhere we can/should move the focus to.
3469// When false is returned, the caller should continue with
3470// keyboard navigation outside the widget, e.g. by calling
3471// [method@Gtk.Widget.child_focus] on the widget’s toplevel.
3472//
3473// The default [signal@Gtk.Widget::keynav-failed] handler returns
3474// false for [enum@Gtk.DirectionType.tab-forward] and
3475// [enum@Gtk.DirectionType.tab-backward]. For the other values
3476// of [enum@Gtk.DirectionType] it returns true.
3477//
3478// Whenever the default handler returns true, it also calls
3479// [method@Gtk.Widget.error_bell] to notify the user of the
3480// failed keyboard navigation.
3481//
3482// A use case for providing an own implementation of `::keynav-failed`
3483// (either by connecting to it or by overriding it) would be a row of
3484// [class@Gtk.Entry] widgets where the user should be able to navigate
3485// the entire row with the cursor keys, as e.g. known from user
3486// interfaces that require entering license keys.
3487func (x *Widget) KeynavFailed(DirectionVar DirectionType) bool {
3488
3489	cret := xWidgetKeynavFailed(x.GoPointer(), DirectionVar)
3490	return cret
3491}
3492
3493var xWidgetListMnemonicLabels func(uintptr) *glib.List
3494
3495// Returns the widgets for which this widget is the target of a
3496// mnemonic.
3497//
3498// Typically, these widgets will be labels. See, for example,
3499// [method@Gtk.Label.set_mnemonic_widget].
3500//
3501// The widgets in the list are not individually referenced.
3502// If you want to iterate through the list and perform actions
3503// involving callbacks that might destroy the widgets, you
3504// must call `g_list_foreach (result, (GFunc)g_object_ref, NULL)`
3505// first, and then unref all the widgets afterwards.
3506func (x *Widget) ListMnemonicLabels() *glib.List {
3507
3508	cret := xWidgetListMnemonicLabels(x.GoPointer())
3509	return cret
3510}
3511
3512var xWidgetMap func(uintptr)
3513
3514// Causes a widget to be mapped if it isn’t already.
3515//
3516// This function is only for use in widget implementations.
3517func (x *Widget) Map() {
3518
3519	xWidgetMap(x.GoPointer())
3520
3521}
3522
3523var xWidgetMeasure func(uintptr, Orientation, int, *int, *int, *int, *int)
3524
3525// Measures @widget in the orientation @orientation and for the given @for_size.
3526//
3527// As an example, if @orientation is %GTK_ORIENTATION_HORIZONTAL and @for_size
3528// is 300, this functions will compute the minimum and natural width of @widget
3529// if it is allocated at a height of 300 pixels.
3530//
3531// See [GtkWidget’s geometry management section](class.Widget.html#height-for-width-geometry-management) for
3532// a more details on implementing `GtkWidgetClass.measure()`.
3533func (x *Widget) Measure(OrientationVar Orientation, ForSizeVar int, MinimumVar *int, NaturalVar *int, MinimumBaselineVar *int, NaturalBaselineVar *int) {
3534
3535	xWidgetMeasure(x.GoPointer(), OrientationVar, ForSizeVar, MinimumVar, NaturalVar, MinimumBaselineVar, NaturalBaselineVar)
3536
3537}
3538
3539var xWidgetMnemonicActivate func(uintptr, bool) bool
3540
3541// Emits the [signal@Gtk.Widget::mnemonic-activate] signal.
3542func (x *Widget) MnemonicActivate(GroupCyclingVar bool) bool {
3543
3544	cret := xWidgetMnemonicActivate(x.GoPointer(), GroupCyclingVar)
3545	return cret
3546}
3547
3548var xWidgetObserveChildren func(uintptr) uintptr
3549
3550// Returns a list model to track the children of the widget.
3551//
3552// Calling this function will enable extra internal bookkeeping
3553// to track children and emit signals on the returned listmodel.
3554// It may slow down operations a lot.
3555//
3556// Applications should try hard to avoid calling this function
3557// because of the slowdowns.
3558func (x *Widget) ObserveChildren() *gio.ListModelBase {
3559	var cls *gio.ListModelBase
3560
3561	cret := xWidgetObserveChildren(x.GoPointer())
3562
3563	if cret == 0 {
3564		return nil
3565	}
3566	cls = &gio.ListModelBase{}
3567	cls.Ptr = cret
3568	return cls
3569}
3570
3571var xWidgetObserveControllers func(uintptr) uintptr
3572
3573// Returns a list model to track the event controllers of the widget.
3574//
3575// Calling this function will enable extra internal bookkeeping
3576// to track controllers and emit signals on the returned listmodel.
3577// It may slow down operations a lot.
3578//
3579// Applications should try hard to avoid calling this function
3580// because of the slowdowns.
3581func (x *Widget) ObserveControllers() *gio.ListModelBase {
3582	var cls *gio.ListModelBase
3583
3584	cret := xWidgetObserveControllers(x.GoPointer())
3585
3586	if cret == 0 {
3587		return nil
3588	}
3589	cls = &gio.ListModelBase{}
3590	cls.Ptr = cret
3591	return cls
3592}
3593
3594var xWidgetPick func(uintptr, float64, float64, PickFlags) uintptr
3595
3596// Finds the descendant of the widget closest to a point.
3597//
3598// The point (x, y) must be given in widget coordinates, so (0, 0)
3599// is assumed to be the top left of @widget's content area.
3600//
3601// Usually widgets will return `NULL` if the given coordinate is not
3602// contained in @widget checked via [method@Gtk.Widget.contains].
3603// Otherwise they will recursively try to find a child that does
3604// not return `NULL`. Widgets are however free to customize their
3605// picking algorithm.
3606//
3607// This function is used on the toplevel to determine the widget
3608// below the mouse cursor for purposes of hover highlighting and
3609// delivering events.
3610func (x *Widget) Pick(XVar float64, YVar float64, FlagsVar PickFlags) *Widget {
3611	var cls *Widget
3612
3613	cret := xWidgetPick(x.GoPointer(), XVar, YVar, FlagsVar)
3614
3615	if cret == 0 {
3616		return nil
3617	}
3618	gobject.IncreaseRef(cret)
3619	cls = &Widget{}
3620	cls.Ptr = cret
3621	return cls
3622}
3623
3624var xWidgetQueueAllocate func(uintptr)
3625
3626// Flags the widget for a rerun of the [vfunc@Gtk.Widget.size_allocate]
3627// function.
3628//
3629// Use this function instead of [method@Gtk.Widget.queue_resize]
3630// when the @widget's size request didn't change but it wants to
3631// reposition its contents.
3632//
3633// An example user of this function is [method@Gtk.Widget.set_halign].
3634//
3635// This function is only for use in widget implementations.
3636func (x *Widget) QueueAllocate() {
3637
3638	xWidgetQueueAllocate(x.GoPointer())
3639
3640}
3641
3642var xWidgetQueueDraw func(uintptr)
3643
3644// Schedules this widget to be redrawn.
3645//
3646// The redraw will happen in the paint phase
3647// of the current or the next frame.
3648//
3649// This means @widget's [vfunc@Gtk.Widget.snapshot]
3650// implementation will be called.
3651func (x *Widget) QueueDraw() {
3652
3653	xWidgetQueueDraw(x.GoPointer())
3654
3655}
3656
3657var xWidgetQueueResize func(uintptr)
3658
3659// Flags a widget to have its size renegotiated.
3660//
3661// This should be called when a widget for some reason has a new
3662// size request. For example, when you change the text in a
3663// [class@Gtk.Label], the label queues a resize to ensure there’s
3664// enough space for the new text.
3665//
3666// Note that you cannot call gtk_widget_queue_resize() on a widget
3667// from inside its implementation of the [vfunc@Gtk.Widget.size_allocate]
3668// virtual method. Calls to gtk_widget_queue_resize() from inside
3669// [vfunc@Gtk.Widget.size_allocate] will be silently ignored.
3670//
3671// This function is only for use in widget implementations.
3672func (x *Widget) QueueResize() {
3673
3674	xWidgetQueueResize(x.GoPointer())
3675
3676}
3677
3678var xWidgetRealize func(uintptr)
3679
3680// Creates the GDK resources associated with a widget.
3681//
3682// Normally realization happens implicitly; if you show a widget
3683// and all its parent containers, then the widget will be realized
3684// and mapped automatically.
3685//
3686// Realizing a widget requires all the widget’s parent widgets to be
3687// realized; calling this function realizes the widget’s parents
3688// in addition to @widget itself. If a widget is not yet inside a
3689// toplevel window when you realize it, bad things will happen.
3690//
3691// This function is primarily used in widget implementations, and
3692// isn’t very useful otherwise. Many times when you think you might
3693// need it, a better approach is to connect to a signal that will be
3694// called after the widget is realized automatically, such as
3695// [signal@Gtk.Widget::realize].
3696func (x *Widget) Realize() {
3697
3698	xWidgetRealize(x.GoPointer())
3699
3700}
3701
3702var xWidgetRemoveController func(uintptr, uintptr)
3703
3704// Removes an event controller from the widget.
3705//
3706// The removed event controller will not receive any more events,
3707// and should not be used again.
3708//
3709// Widgets will remove all event controllers automatically when they
3710// are destroyed, there is normally no need to call this function.
3711func (x *Widget) RemoveController(ControllerVar *EventController) {
3712
3713	xWidgetRemoveController(x.GoPointer(), ControllerVar.GoPointer())
3714
3715}
3716
3717var xWidgetRemoveCssClass func(uintptr, string)
3718
3719// Removes a style from the widget.
3720//
3721// After this, the style of @widget will stop matching for @css_class.
3722func (x *Widget) RemoveCssClass(CssClassVar string) {
3723
3724	xWidgetRemoveCssClass(x.GoPointer(), CssClassVar)
3725
3726}
3727
3728var xWidgetRemoveMnemonicLabel func(uintptr, uintptr)
3729
3730// Removes a widget from the list of mnemonic labels for this widget.
3731//
3732// See [method@Gtk.Widget.list_mnemonic_labels].
3733//
3734// The widget must have previously been added to the list with
3735// [method@Gtk.Widget.add_mnemonic_label].
3736func (x *Widget) RemoveMnemonicLabel(LabelVar *Widget) {
3737
3738	xWidgetRemoveMnemonicLabel(x.GoPointer(), LabelVar.GoPointer())
3739
3740}
3741
3742var xWidgetRemoveTickCallback func(uintptr, uint)
3743
3744// Removes a tick callback previously registered with
3745// [method@Gtk.Widget.add_tick_callback].
3746func (x *Widget) RemoveTickCallback(IdVar uint) {
3747
3748	xWidgetRemoveTickCallback(x.GoPointer(), IdVar)
3749
3750}
3751
3752var xWidgetSetCanFocus func(uintptr, bool)
3753
3754// Sets whether the input focus can enter the widget or
3755// any of its children.
3756//
3757// Applications should set @can_focus to false to mark a
3758// widget as for pointer/touch use only.
3759//
3760// Note that having @can_focus be true is only one of the
3761// necessary conditions for being focusable. A widget must
3762// also be sensitive and focusable and not have an ancestor
3763// that is marked as not can-focus in order to receive input
3764// focus.
3765//
3766// See [method@Gtk.Widget.grab_focus] for actually setting
3767// the input focus on a widget.
3768func (x *Widget) SetCanFocus(CanFocusVar bool) {
3769
3770	xWidgetSetCanFocus(x.GoPointer(), CanFocusVar)
3771
3772}
3773
3774var xWidgetSetCanTarget func(uintptr, bool)
3775
3776// Sets whether the widget can be the target of pointer events.
3777func (x *Widget) SetCanTarget(CanTargetVar bool) {
3778
3779	xWidgetSetCanTarget(x.GoPointer(), CanTargetVar)
3780
3781}
3782
3783var xWidgetSetChildVisible func(uintptr, bool)
3784
3785// Sets whether the widget should be mapped along with its parent.
3786//
3787// The child visibility can be set for widget before it is added
3788// to a container with [method@Gtk.Widget.set_parent], to avoid
3789// mapping children unnecessary before immediately unmapping them.
3790// However it will be reset to its default state of true when the
3791// widget is removed from a container.
3792//
3793// Note that changing the child visibility of a widget does not
3794// queue a resize on the widget. Most of the time, the size of
3795// a widget is computed from all visible children, whether or
3796// not they are mapped. If this is not the case, the container
3797// can queue a resize itself.
3798//
3799// This function is only useful for widget implementations
3800// and should never be called by an application.
3801func (x *Widget) SetChildVisible(ChildVisibleVar bool) {
3802
3803	xWidgetSetChildVisible(x.GoPointer(), ChildVisibleVar)
3804
3805}
3806
3807var xWidgetSetCssClasses func(uintptr, []string)
3808
3809// Replaces the current style classes of the widget with @classes.
3810func (x *Widget) SetCssClasses(ClassesVar []string) {
3811
3812	xWidgetSetCssClasses(x.GoPointer(), ClassesVar)
3813
3814}
3815
3816var xWidgetSetCursor func(uintptr, uintptr)
3817
3818// Sets the cursor to be shown when the pointer hovers over
3819// the widget.
3820//
3821// If the @cursor is `NULL`, @widget will use the cursor
3822// inherited from its parent.
3823func (x *Widget) SetCursor(CursorVar *gdk.Cursor) {
3824
3825	xWidgetSetCursor(x.GoPointer(), CursorVar.GoPointer())
3826
3827}
3828
3829var xWidgetSetCursorFromName func(uintptr, uintptr)
3830
3831// Sets the cursor to be shown when the pointer hovers over
3832// the widget.
3833//
3834// This is a utility function that creates a cursor via
3835// [ctor@Gdk.Cursor.new_from_name] and then sets it on @widget
3836// with [method@Gtk.Widget.set_cursor]. See those functions for
3837// details.
3838//
3839// On top of that, this function allows @name to be `NULL`, which
3840// will do the same as calling [method@Gtk.Widget.set_cursor]
3841// with a `NULL` cursor.
3842func (x *Widget) SetCursorFromName(NameVar *string) {
3843
3844	NameVarPtr := core.GStrdupNullable(NameVar)
3845	defer core.GFreeNullable(NameVarPtr)
3846
3847	xWidgetSetCursorFromName(x.GoPointer(), NameVarPtr)
3848
3849}
3850
3851var xWidgetSetDirection func(uintptr, TextDirection)
3852
3853// Sets the reading direction on the widget.
3854//
3855// This direction controls the primary direction for widgets
3856// containing text, and also the direction in which the children
3857// of a container are packed. The ability to set the direction is
3858// present in order so that correct localization into languages with
3859// right-to-left reading directions can be done.
3860//
3861// Generally, applications will let the default reading direction
3862// prevail, except for widgets where the children are arranged in
3863// an order that is explicitly visual rather than logical (such as
3864// buttons for text justification).
3865//
3866// If the direction is set to [enum@Gtk.TextDirection.none], then
3867// the value set by [func@Gtk.Widget.set_default_direction] will be used.
3868func (x *Widget) SetDirection(DirVar TextDirection) {
3869
3870	xWidgetSetDirection(x.GoPointer(), DirVar)
3871
3872}
3873
3874var xWidgetSetFocusChild func(uintptr, uintptr)
3875
3876// Set the focus child of the widget.
3877//
3878// This function is only suitable for widget implementations.
3879// If you want a certain widget to get the input focus, call
3880// [method@Gtk.Widget.grab_focus] on it.
3881func (x *Widget) SetFocusChild(ChildVar *Widget) {
3882
3883	xWidgetSetFocusChild(x.GoPointer(), ChildVar.GoPointer())
3884
3885}
3886
3887var xWidgetSetFocusOnClick func(uintptr, bool)
3888
3889// Sets whether the widget should grab focus when it is clicked
3890// with the mouse.
3891//
3892// Making mouse clicks not grab focus is useful in places like
3893// toolbars where you don’t want the keyboard focus removed from
3894// the main area of the application.
3895func (x *Widget) SetFocusOnClick(FocusOnClickVar bool) {
3896
3897	xWidgetSetFocusOnClick(x.GoPointer(), FocusOnClickVar)
3898
3899}
3900
3901var xWidgetSetFocusable func(uintptr, bool)
3902
3903// Sets whether the widget can own the input focus.
3904//
3905// Widget implementations should set @focusable to true in
3906// their init() function if they want to receive keyboard input.
3907//
3908// Note that having @focusable be true is only one of the
3909// necessary conditions for being focusable. A widget must
3910// also be sensitive and can-focus and not have an ancestor
3911// that is marked as not can-focus in order to receive input
3912// focus.
3913//
3914// See [method@Gtk.Widget.grab_focus] for actually setting
3915// the input focus on a widget.
3916func (x *Widget) SetFocusable(FocusableVar bool) {
3917
3918	xWidgetSetFocusable(x.GoPointer(), FocusableVar)
3919
3920}
3921
3922var xWidgetSetFontMap func(uintptr, uintptr)
3923
3924// Sets the font map to use for text rendering in the widget.
3925//
3926// The font map is the object that is used to look up fonts.
3927// Setting a custom font map can be useful in special situations,
3928// e.g. when you need to add application-specific fonts to the set
3929// of available fonts.
3930//
3931// When not set, the widget will inherit the font map from its parent.
3932func (x *Widget) SetFontMap(FontMapVar *pango.FontMap) {
3933
3934	xWidgetSetFontMap(x.GoPointer(), FontMapVar.GoPointer())
3935
3936}
3937
3938var xWidgetSetFontOptions func(uintptr, *cairo.FontOptions)
3939
3940// Sets the `cairo_font_options_t` used for text rendering
3941// in the widget.
3942//
3943// When not set, the default font options for the `GdkDisplay`
3944// will be used.
3945func (x *Widget) SetFontOptions(OptionsVar *cairo.FontOptions) {
3946
3947	xWidgetSetFontOptions(x.GoPointer(), OptionsVar)
3948
3949}
3950
3951var xWidgetSetHalign func(uintptr, Align)
3952
3953// Sets the horizontal alignment of the widget.
3954func (x *Widget) SetHalign(AlignVar Align) {
3955
3956	xWidgetSetHalign(x.GoPointer(), AlignVar)
3957
3958}
3959
3960var xWidgetSetHasTooltip func(uintptr, bool)
3961
3962// Sets the `has-tooltip` property on the widget.
3963func (x *Widget) SetHasTooltip(HasTooltipVar bool) {
3964
3965	xWidgetSetHasTooltip(x.GoPointer(), HasTooltipVar)
3966
3967}
3968
3969var xWidgetSetHexpand func(uintptr, bool)
3970
3971// Sets whether the widget would like any available extra horizontal
3972// space.
3973//
3974// When a user resizes a window, widgets with expand set to true generally
3975// receive the extra space. For example, a list or scrollable area
3976// or document in your window would often be set to expand.
3977//
3978// Call this function to set the expand flag if you would like your
3979// widget to become larger horizontally when the window has extra
3980// room.
3981//
3982// By default, widgets automatically expand if any of their children
3983// want to expand. (To see if a widget will automatically expand given
3984// its current children and state, call [method@Gtk.Widget.compute_expand].
3985// A widget can decide how the expandability of children affects its
3986// own expansion by overriding the `compute_expand` virtual method on
3987// `GtkWidget`.).
3988//
3989// Setting hexpand explicitly with this function will override the
3990// automatic expand behavior.
3991//
3992// This function forces the widget to expand or not to expand,
3993// regardless of children. The override occurs because
3994// [method@Gtk.Widget.set_hexpand] sets the hexpand-set property (see
3995// [method@Gtk.Widget.set_hexpand_set]) which causes the widget’s hexpand
3996// value to be used, rather than looking at children and widget state.
3997func (x *Widget) SetHexpand(ExpandVar bool) {
3998
3999	xWidgetSetHexpand(x.GoPointer(), ExpandVar)
4000
4001}
4002
4003var xWidgetSetHexpandSet func(uintptr, bool)
4004
4005// Sets whether the hexpand flag will be used.
4006//
4007// The [property@Gtk.Widget:hexpand-set] property will be set
4008// automatically when you call [method@Gtk.Widget.set_hexpand]
4009// to set hexpand, so the most likely reason to use this function
4010// would be to unset an explicit expand flag.
4011//
4012// If hexpand is set, then it overrides any computed
4013// expand value based on child widgets. If hexpand is not
4014// set, then the expand value depends on whether any
4015// children of the widget would like to expand.
4016//
4017// There are few reasons to use this function, but it’s here
4018// for completeness and consistency.
4019func (x *Widget) SetHexpandSet(SetVar bool) {
4020
4021	xWidgetSetHexpandSet(x.GoPointer(), SetVar)
4022
4023}
4024
4025var xWidgetSetLayoutManager func(uintptr, uintptr)
4026
4027// Sets the layout manager to use for measuring and allocating children
4028// of the widget.
4029func (x *Widget) SetLayoutManager(LayoutManagerVar *LayoutManager) {
4030
4031	xWidgetSetLayoutManager(x.GoPointer(), LayoutManagerVar.GoPointer())
4032
4033}
4034
4035var xWidgetSetLimitEvents func(uintptr, bool)
4036
4037// Sets whether the widget acts like a modal dialog,
4038// with respect to event delivery.
4039func (x *Widget) SetLimitEvents(LimitEventsVar bool) {
4040
4041	xWidgetSetLimitEvents(x.GoPointer(), LimitEventsVar)
4042
4043}
4044
4045var xWidgetSetMarginBottom func(uintptr, int)
4046
4047// Sets the bottom margin of the widget.
4048func (x *Widget) SetMarginBottom(MarginVar int) {
4049
4050	xWidgetSetMarginBottom(x.GoPointer(), MarginVar)
4051
4052}
4053
4054var xWidgetSetMarginEnd func(uintptr, int)
4055
4056// Sets the end margin of the widget.
4057func (x *Widget) SetMarginEnd(MarginVar int) {
4058
4059	xWidgetSetMarginEnd(x.GoPointer(), MarginVar)
4060
4061}
4062
4063var xWidgetSetMarginStart func(uintptr, int)
4064
4065// Sets the start margin of the widget.
4066func (x *Widget) SetMarginStart(MarginVar int) {
4067
4068	xWidgetSetMarginStart(x.GoPointer(), MarginVar)
4069
4070}
4071
4072var xWidgetSetMarginTop func(uintptr, int)
4073
4074// Sets the top margin of the widget.
4075func (x *Widget) SetMarginTop(MarginVar int) {
4076
4077	xWidgetSetMarginTop(x.GoPointer(), MarginVar)
4078
4079}
4080
4081var xWidgetSetName func(uintptr, string)
4082
4083// Sets a widgets name.
4084//
4085// Setting a name allows you to refer to the widget from a
4086// CSS file. You can apply a style to widgets with a particular name
4087// in the CSS file. See the documentation for the CSS syntax (on the
4088// same page as the docs for [class@Gtk.StyleContext].
4089//
4090// Note that the CSS syntax has certain special characters to delimit
4091// and represent elements in a selector (period, #, >, *...), so using
4092// these will make your widget impossible to match by name. Any combination
4093// of alphanumeric symbols, dashes and underscores will suffice.
4094func (x *Widget) SetName(NameVar string) {
4095
4096	xWidgetSetName(x.GoPointer(), NameVar)
4097
4098}
4099
4100var xWidgetSetOpacity func(uintptr, float64)
4101
4102// Requests the widget to be rendered partially transparent.
4103//
4104// An opacity of 0 is fully transparent and an opacity of 1
4105// is fully opaque.
4106//
4107// Opacity works on both toplevel widgets and child widgets, although
4108// there are some limitations: For toplevel widgets, applying opacity
4109// depends on the capabilities of the windowing system. On X11, this
4110// has any effect only on X displays with a compositing manager, see
4111// [method@Gdk.Display.is_composited]. On Windows and Wayland it will
4112// always work, although setting a window’s opacity after the window
4113// has been shown may cause some flicker.
4114//
4115// Note that the opacity is inherited through inclusion — if you set
4116// a toplevel to be partially translucent, all of its content will
4117// appear translucent, since it is ultimatively rendered on that
4118// toplevel. The opacity value itself is not inherited by child
4119// widgets (since that would make widgets deeper in the hierarchy
4120// progressively more translucent). As a consequence, [class@Gtk.Popover]
4121// instances and other [iface@Gtk.Native] widgets with their own surface
4122// will use their own opacity value, and thus by default appear
4123// non-translucent, even if they are attached to a toplevel that
4124// is translucent.
4125func (x *Widget) SetOpacity(OpacityVar float64) {
4126
4127	xWidgetSetOpacity(x.GoPointer(), OpacityVar)
4128
4129}
4130
4131var xWidgetSetOverflow func(uintptr, Overflow)
4132
4133// Sets how the widget treats content that is drawn outside the
4134// it's content area.
4135//
4136// See the definition of [enum@Gtk.Overflow] for details.
4137//
4138// This setting is provided for widget implementations and
4139// should not be used by application code.
4140//
4141// The default value is [enum@Gtk.Overflow.visible].
4142func (x *Widget) SetOverflow(OverflowVar Overflow) {
4143
4144	xWidgetSetOverflow(x.GoPointer(), OverflowVar)
4145
4146}
4147
4148var xWidgetSetParent func(uintptr, uintptr)
4149
4150// Sets the parent widget of the widget.
4151//
4152// This takes care of details such as updating the state and style
4153// of the child to reflect its new location and resizing the parent.
4154// The opposite function is [method@Gtk.Widget.unparent].
4155//
4156// This function is useful only when implementing subclasses of
4157// `GtkWidget`.
4158func (x *Widget) SetParent(ParentVar *Widget) {
4159
4160	xWidgetSetParent(x.GoPointer(), ParentVar.GoPointer())
4161
4162}
4163
4164var xWidgetSetReceivesDefault func(uintptr, bool)
4165
4166// Sets whether the widget will be treated as the default
4167// widget within its toplevel when it has the focus, even if
4168// another widget is the default.
4169func (x *Widget) SetReceivesDefault(ReceivesDefaultVar bool) {
4170
4171	xWidgetSetReceivesDefault(x.GoPointer(), ReceivesDefaultVar)
4172
4173}
4174
4175var xWidgetSetSensitive func(uintptr, bool)
4176
4177// Sets the sensitivity of the widget.
4178//
4179// A widget is sensitive if the user can interact with it.
4180// Insensitive widgets are “grayed out” and the user can’t
4181// interact with them. Insensitive widgets are known as
4182// “inactive”, “disabled”, or “ghosted” in some other toolkits.
4183func (x *Widget) SetSensitive(SensitiveVar bool) {
4184
4185	xWidgetSetSensitive(x.GoPointer(), SensitiveVar)
4186
4187}
4188
4189var xWidgetSetSizeRequest func(uintptr, int, int)
4190
4191// Sets the minimum size of the widget.
4192//
4193// That is, the widget’s size request will be at least @width
4194// by @height. You can use this function to force a widget to
4195// be larger than it normally would be.
4196//
4197// In most cases, [method@Gtk.Window.set_default_size] is a better
4198// choice for toplevel windows than this function; setting the default
4199// size will still allow users to shrink the window. Setting the size
4200// request will force them to leave the window at least as large as
4201// the size request.
4202//
4203// Note the inherent danger of setting any fixed size - themes,
4204// translations into other languages, different fonts, and user action
4205// can all change the appropriate size for a given widget. So, it is
4206// basically impossible to hardcode a size that will always work.
4207//
4208// The size request of a widget is the smallest size a widget can
4209// accept while still functioning well and drawing itself correctly.
4210// However in some strange cases a widget may be allocated less than
4211// its requested size, and in many cases a widget may be allocated more
4212// space than it requested.
4213//
4214// If the size request in a given direction is -1 (unset), then
4215// the “natural” size request of the widget will be used instead.
4216//
4217// The size request set here does not include any margin from the
4218// properties
4219// [property@Gtk.Widget:margin-start],
4220// [property@Gtk.Widget:margin-end],
4221// [property@Gtk.Widget:margin-top], and
4222// [property@Gtk.Widget:margin-bottom], but it does include pretty
4223// much all other padding or border properties set by any subclass
4224// of `GtkWidget`.
4225func (x *Widget) SetSizeRequest(WidthVar int, HeightVar int) {
4226
4227	xWidgetSetSizeRequest(x.GoPointer(), WidthVar, HeightVar)
4228
4229}
4230
4231var xWidgetSetStateFlags func(uintptr, StateFlags, bool)
4232
4233// Turns on flag values in the current widget state.
4234//
4235// Typical widget states are insensitive, prelighted, etc.
4236//
4237// This function accepts the values [flags@Gtk.StateFlags.dir-ltr] and
4238// [flags@Gtk.StateFlags.dir-rtl] but ignores them. If you want to set
4239// the widget's direction, use [method@Gtk.Widget.set_direction].
4240//
4241// This function is for use in widget implementations.
4242func (x *Widget) SetStateFlags(FlagsVar StateFlags, ClearVar bool) {
4243
4244	xWidgetSetStateFlags(x.GoPointer(), FlagsVar, ClearVar)
4245
4246}
4247
4248var xWidgetSetTooltipMarkup func(uintptr, uintptr)
4249
4250// Sets the contents of the tooltip for widget.
4251//
4252// @markup must contain Pango markup.
4253//
4254// This function will take care of setting the
4255// [property@Gtk.Widget:has-tooltip] as a side effect, and of the
4256// default handler for the [signal@Gtk.Widget::query-tooltip] signal.
4257//
4258// See also [method@Gtk.Tooltip.set_markup].
4259func (x *Widget) SetTooltipMarkup(MarkupVar *string) {
4260
4261	MarkupVarPtr := core.GStrdupNullable(MarkupVar)
4262	defer core.GFreeNullable(MarkupVarPtr)
4263
4264	xWidgetSetTooltipMarkup(x.GoPointer(), MarkupVarPtr)
4265
4266}
4267
4268var xWidgetSetTooltipText func(uintptr, uintptr)
4269
4270// Sets the contents of the tooltip for the widget.
4271//
4272// If @text contains any markup, it will be escaped.
4273//
4274// This function will take care of setting
4275// [property@Gtk.Widget:has-tooltip] as a side effect,
4276// and of the default handler for the
4277// [signal@Gtk.Widget::query-tooltip] signal.
4278//
4279// See also [method@Gtk.Tooltip.set_text].
4280func (x *Widget) SetTooltipText(TextVar *string) {
4281
4282	TextVarPtr := core.GStrdupNullable(TextVar)
4283	defer core.GFreeNullable(TextVarPtr)
4284
4285	xWidgetSetTooltipText(x.GoPointer(), TextVarPtr)
4286
4287}
4288
4289var xWidgetSetValign func(uintptr, Align)
4290
4291// Sets the vertical alignment of the widget.
4292func (x *Widget) SetValign(AlignVar Align) {
4293
4294	xWidgetSetValign(x.GoPointer(), AlignVar)
4295
4296}
4297
4298var xWidgetSetVexpand func(uintptr, bool)
4299
4300// Sets whether the widget would like any available extra vertical
4301// space.
4302//
4303// See [method@Gtk.Widget.set_hexpand] for more detail.
4304func (x *Widget) SetVexpand(ExpandVar bool) {
4305
4306	xWidgetSetVexpand(x.GoPointer(), ExpandVar)
4307
4308}
4309
4310var xWidgetSetVexpandSet func(uintptr, bool)
4311
4312// Sets whether the vexpand flag will be used.
4313//
4314// See [method@Gtk.Widget.set_hexpand_set] for more detail.
4315func (x *Widget) SetVexpandSet(SetVar bool) {
4316
4317	xWidgetSetVexpandSet(x.GoPointer(), SetVar)
4318
4319}
4320
4321var xWidgetSetVisible func(uintptr, bool)
4322
4323// Sets the visibility state of @widget.
4324//
4325// Note that setting this to true doesn’t mean the widget is
4326// actually viewable, see [method@Gtk.Widget.get_visible].
4327func (x *Widget) SetVisible(VisibleVar bool) {
4328
4329	xWidgetSetVisible(x.GoPointer(), VisibleVar)
4330
4331}
4332
4333var xWidgetShouldLayout func(uintptr) bool
4334
4335// Returns whether the widget should contribute to
4336// the measuring and allocation of its parent.
4337//
4338// This is false for invisible children, but also
4339// for children that have their own surface, such
4340// as [class@Gtk.Popover] instances.
4341func (x *Widget) ShouldLayout() bool {
4342
4343	cret := xWidgetShouldLayout(x.GoPointer())
4344	return cret
4345}
4346
4347var xWidgetShow func(uintptr)
4348
4349// Flags a widget to be displayed.
4350//
4351// Any widget that isn’t shown will not appear on the screen.
4352//
4353// Remember that you have to show the containers containing a widget,
4354// in addition to the widget itself, before it will appear onscreen.
4355//
4356// When a toplevel widget is shown, it is immediately realized and
4357// mapped; other shown widgets are realized and mapped when their
4358// toplevel widget is realized and mapped.
4359func (x *Widget) Show() {
4360
4361	xWidgetShow(x.GoPointer())
4362
4363}
4364
4365var xWidgetSizeAllocate func(uintptr, *Allocation, int)
4366
4367// Allocates widget with a transformation that translates
4368// the origin to the position in @allocation.
4369//
4370// This is a simple form of [method@Gtk.Widget.allocate].
4371func (x *Widget) SizeAllocate(AllocationVar *Allocation, BaselineVar int) {
4372
4373	xWidgetSizeAllocate(x.GoPointer(), AllocationVar, BaselineVar)
4374
4375}
4376
4377var xWidgetSnapshotChild func(uintptr, uintptr, uintptr)
4378
4379// Snapshots a child of the widget.
4380//
4381// When a widget receives a call to the snapshot function,
4382// it must send synthetic [vfunc@Gtk.Widget.snapshot] calls
4383// to all children. This function provides a convenient way
4384// of doing this. A widget, when it receives a call to its
4385// [vfunc@Gtk.Widget.snapshot] function, calls
4386// gtk_widget_snapshot_child() once for each child, passing in
4387// the @snapshot the widget received.
4388//
4389// This function takes care of translating the origin of @snapshot,
4390// and deciding whether the child needs to be snapshot.
4391//
4392// It does nothing for children that implement `GtkNative`.
4393func (x *Widget) SnapshotChild(ChildVar *Widget, SnapshotVar *Snapshot) {
4394
4395	xWidgetSnapshotChild(x.GoPointer(), ChildVar.GoPointer(), SnapshotVar.GoPointer())
4396
4397}
4398
4399var xWidgetTranslateCoordinates func(uintptr, uintptr, float64, float64, *float64, *float64) bool
4400
4401// Translates coordinates relative to @src_widget’s allocation
4402// to coordinates relative to @dest_widget’s allocations.
4403//
4404// In order to perform this operation, both widget must share
4405// a common ancestor. If that is not the case, @dest_x and @dest_y
4406// are set to 0 and false is returned.
4407func (x *Widget) TranslateCoordinates(DestWidgetVar *Widget, SrcXVar float64, SrcYVar float64, DestXVar *float64, DestYVar *float64) bool {
4408
4409	cret := xWidgetTranslateCoordinates(x.GoPointer(), DestWidgetVar.GoPointer(), SrcXVar, SrcYVar, DestXVar, DestYVar)
4410	return cret
4411}
4412
4413var xWidgetTriggerTooltipQuery func(uintptr)
4414
4415// Triggers a tooltip query on the display of the widget.
4416func (x *Widget) TriggerTooltipQuery() {
4417
4418	xWidgetTriggerTooltipQuery(x.GoPointer())
4419
4420}
4421
4422var xWidgetUnmap func(uintptr)
4423
4424// Causes a widget to be unmapped if it’s currently mapped.
4425//
4426// This function is only for use in widget implementations.
4427func (x *Widget) Unmap() {
4428
4429	xWidgetUnmap(x.GoPointer())
4430
4431}
4432
4433var xWidgetUnparent func(uintptr)
4434
4435// Removes @widget from its parent.
4436//
4437// This function is only for use in widget implementations,
4438// typically in dispose.
4439func (x *Widget) Unparent() {
4440
4441	xWidgetUnparent(x.GoPointer())
4442
4443}
4444
4445var xWidgetUnrealize func(uintptr)
4446
4447// Causes a widget to be unrealized.
4448//
4449// This frees all GDK resources associated with the widget.
4450//
4451// This function is only useful in widget implementations.
4452func (x *Widget) Unrealize() {
4453
4454	xWidgetUnrealize(x.GoPointer())
4455
4456}
4457
4458var xWidgetUnsetStateFlags func(uintptr, StateFlags)
4459
4460// Turns off flag values for the current widget state.
4461//
4462// See [method@Gtk.Widget.set_state_flags].
4463//
4464// This function is for use in widget implementations.
4465func (x *Widget) UnsetStateFlags(FlagsVar StateFlags) {
4466
4467	xWidgetUnsetStateFlags(x.GoPointer(), FlagsVar)
4468
4469}
4470
4471func (c *Widget) GoPointer() uintptr {
4472	if c == nil {
4473		return 0
4474	}
4475	return c.Ptr
4476}
4477
4478func (c *Widget) SetGoPointer(ptr uintptr) {
4479	c.Ptr = ptr
4480}
4481
4482// SetPropertyCanFocus sets the "can-focus" property.
4483// Whether the widget or any of its descendents can accept
4484// the input focus.
4485//
4486// This property is meant to be set by widget implementations,
4487// typically in their instance init function.
4488func (x *Widget) SetPropertyCanFocus(value bool) {
4489	var v gobject.Value
4490	v.Init(gobject.TypeBooleanVal)
4491	v.SetBoolean(value)
4492	x.SetProperty("can-focus", &v)
4493}
4494
4495// GetPropertyCanFocus gets the "can-focus" property.
4496// Whether the widget or any of its descendents can accept
4497// the input focus.
4498//
4499// This property is meant to be set by widget implementations,
4500// typically in their instance init function.
4501func (x *Widget) GetPropertyCanFocus() bool {
4502	var v gobject.Value
4503	x.GetProperty("can-focus", &v)
4504	return v.GetBoolean()
4505}
4506
4507// SetPropertyCanTarget sets the "can-target" property.
4508// Whether the widget can receive pointer events.
4509func (x *Widget) SetPropertyCanTarget(value bool) {
4510	var v gobject.Value
4511	v.Init(gobject.TypeBooleanVal)
4512	v.SetBoolean(value)
4513	x.SetProperty("can-target", &v)
4514}
4515
4516// GetPropertyCanTarget gets the "can-target" property.
4517// Whether the widget can receive pointer events.
4518func (x *Widget) GetPropertyCanTarget() bool {
4519	var v gobject.Value
4520	x.GetProperty("can-target", &v)
4521	return v.GetBoolean()
4522}
4523
4524// SetPropertyCssClasses sets the "css-classes" property.
4525// A list of css classes applied to this widget.
4526func (x *Widget) SetPropertyCssClasses(value []string) {
4527	var v gobject.Value
4528	v.Init(glib.StrvGetType())
4529	v.SetBoxed(uintptr(unsafe.Pointer(core.ByteSlice(value))))
4530	x.SetProperty("css-classes", &v)
4531}
4532
4533// GetPropertyCssClasses gets the "css-classes" property.
4534// A list of css classes applied to this widget.
4535func (x *Widget) GetPropertyCssClasses() []string {
4536	var v gobject.Value
4537	x.GetProperty("css-classes", &v)
4538	return core.GoStringSlice(v.GetBoxed())
4539}
4540
4541// SetPropertyCssName sets the "css-name" property.
4542// The name of this widget in the CSS tree.
4543//
4544// This property is meant to be set by widget implementations,
4545// typically in their instance init function.
4546func (x *Widget) SetPropertyCssName(value string) {
4547	var v gobject.Value
4548	v.Init(gobject.TypeStringVal)
4549	v.SetString(&value)
4550	x.SetProperty("css-name", &v)
4551}
4552
4553// GetPropertyCssName gets the "css-name" property.
4554// The name of this widget in the CSS tree.
4555//
4556// This property is meant to be set by widget implementations,
4557// typically in their instance init function.
4558func (x *Widget) GetPropertyCssName() string {
4559	var v gobject.Value
4560	x.GetProperty("css-name", &v)
4561	return v.GetString()
4562}
4563
4564// SetPropertyFocusOnClick sets the "focus-on-click" property.
4565// Whether the widget should grab focus when it is clicked with the mouse.
4566//
4567// This property is only relevant for widgets that can take focus.
4568func (x *Widget) SetPropertyFocusOnClick(value bool) {
4569	var v gobject.Value
4570	v.Init(gobject.TypeBooleanVal)
4571	v.SetBoolean(value)
4572	x.SetProperty("focus-on-click", &v)
4573}
4574
4575// GetPropertyFocusOnClick gets the "focus-on-click" property.
4576// Whether the widget should grab focus when it is clicked with the mouse.
4577//
4578// This property is only relevant for widgets that can take focus.
4579func (x *Widget) GetPropertyFocusOnClick() bool {
4580	var v gobject.Value
4581	x.GetProperty("focus-on-click", &v)
4582	return v.GetBoolean()
4583}
4584
4585// SetPropertyFocusable sets the "focusable" property.
4586// Whether this widget itself will accept the input focus.
4587func (x *Widget) SetPropertyFocusable(value bool) {
4588	var v gobject.Value
4589	v.Init(gobject.TypeBooleanVal)
4590	v.SetBoolean(value)
4591	x.SetProperty("focusable", &v)
4592}
4593
4594// GetPropertyFocusable gets the "focusable" property.
4595// Whether this widget itself will accept the input focus.
4596func (x *Widget) GetPropertyFocusable() bool {
4597	var v gobject.Value
4598	x.GetProperty("focusable", &v)
4599	return v.GetBoolean()
4600}
4601
4602// GetPropertyHasDefault gets the "has-default" property.
4603// Whether the widget is the default widget.
4604func (x *Widget) GetPropertyHasDefault() bool {
4605	var v gobject.Value
4606	x.GetProperty("has-default", &v)
4607	return v.GetBoolean()
4608}
4609
4610// GetPropertyHasFocus gets the "has-focus" property.
4611// Whether the widget has the input focus.
4612func (x *Widget) GetPropertyHasFocus() bool {
4613	var v gobject.Value
4614	x.GetProperty("has-focus", &v)
4615	return v.GetBoolean()
4616}
4617
4618// SetPropertyHasTooltip sets the "has-tooltip" property.
4619// Enables or disables the emission of the [signal@Gtk.Widget::query-tooltip]
4620// signal on @widget.
4621//
4622// A true value indicates that @widget can have a tooltip, in this case
4623// the widget will be queried using [signal@Gtk.Widget::query-tooltip] to
4624// determine whether it will provide a tooltip or not.
4625func (x *Widget) SetPropertyHasTooltip(value bool) {
4626	var v gobject.Value
4627	v.Init(gobject.TypeBooleanVal)
4628	v.SetBoolean(value)
4629	x.SetProperty("has-tooltip", &v)
4630}
4631
4632// GetPropertyHasTooltip gets the "has-tooltip" property.
4633// Enables or disables the emission of the [signal@Gtk.Widget::query-tooltip]
4634// signal on @widget.
4635//
4636// A true value indicates that @widget can have a tooltip, in this case
4637// the widget will be queried using [signal@Gtk.Widget::query-tooltip] to
4638// determine whether it will provide a tooltip or not.
4639func (x *Widget) GetPropertyHasTooltip() bool {
4640	var v gobject.Value
4641	x.GetProperty("has-tooltip", &v)
4642	return v.GetBoolean()
4643}
4644
4645// SetPropertyHeightRequest sets the "height-request" property.
4646// Overrides for height request of the widget.
4647//
4648// If this is -1, the natural request will be used.
4649func (x *Widget) SetPropertyHeightRequest(value int) {
4650	var v gobject.Value
4651	v.Init(gobject.TypeIntVal)
4652	v.SetInt(value)
4653	x.SetProperty("height-request", &v)
4654}
4655
4656// GetPropertyHeightRequest gets the "height-request" property.
4657// Overrides for height request of the widget.
4658//
4659// If this is -1, the natural request will be used.
4660func (x *Widget) GetPropertyHeightRequest() int {
4661	var v gobject.Value
4662	x.GetProperty("height-request", &v)
4663	return v.GetInt()
4664}
4665
4666// SetPropertyHexpand sets the "hexpand" property.
4667// Whether to expand horizontally.
4668func (x *Widget) SetPropertyHexpand(value bool) {
4669	var v gobject.Value
4670	v.Init(gobject.TypeBooleanVal)
4671	v.SetBoolean(value)
4672	x.SetProperty("hexpand", &v)
4673}
4674
4675// GetPropertyHexpand gets the "hexpand" property.
4676// Whether to expand horizontally.
4677func (x *Widget) GetPropertyHexpand() bool {
4678	var v gobject.Value
4679	x.GetProperty("hexpand", &v)
4680	return v.GetBoolean()
4681}
4682
4683// SetPropertyHexpandSet sets the "hexpand-set" property.
4684// Whether to use the `hexpand` property.
4685func (x *Widget) SetPropertyHexpandSet(value bool) {
4686	var v gobject.Value
4687	v.Init(gobject.TypeBooleanVal)
4688	v.SetBoolean(value)
4689	x.SetProperty("hexpand-set", &v)
4690}
4691
4692// GetPropertyHexpandSet gets the "hexpand-set" property.
4693// Whether to use the `hexpand` property.
4694func (x *Widget) GetPropertyHexpandSet() bool {
4695	var v gobject.Value
4696	x.GetProperty("hexpand-set", &v)
4697	return v.GetBoolean()
4698}
4699
4700// SetPropertyLimitEvents sets the "limit-events" property.
4701// Makes this widget act like a modal dialog, with respect to
4702// event delivery.
4703//
4704// Global event controllers will not handle events with targets
4705// inside the widget, unless they are set up to ignore propagation
4706// limits. See [method@Gtk.EventController.set_propagation_limit].
4707func (x *Widget) SetPropertyLimitEvents(value bool) {
4708	var v gobject.Value
4709	v.Init(gobject.TypeBooleanVal)
4710	v.SetBoolean(value)
4711	x.SetProperty("limit-events", &v)
4712}
4713
4714// GetPropertyLimitEvents gets the "limit-events" property.
4715// Makes this widget act like a modal dialog, with respect to
4716// event delivery.
4717//
4718// Global event controllers will not handle events with targets
4719// inside the widget, unless they are set up to ignore propagation
4720// limits. See [method@Gtk.EventController.set_propagation_limit].
4721func (x *Widget) GetPropertyLimitEvents() bool {
4722	var v gobject.Value
4723	x.GetProperty("limit-events", &v)
4724	return v.GetBoolean()
4725}
4726
4727// SetPropertyMarginBottom sets the "margin-bottom" property.
4728// Margin on bottom side of widget.
4729//
4730// This property adds margin outside of the widget's normal size
4731// request, the margin will be added in addition to the size from
4732// [method@Gtk.Widget.set_size_request] for example.
4733func (x *Widget) SetPropertyMarginBottom(value int) {
4734	var v gobject.Value
4735	v.Init(gobject.TypeIntVal)
4736	v.SetInt(value)
4737	x.SetProperty("margin-bottom", &v)
4738}
4739
4740// GetPropertyMarginBottom gets the "margin-bottom" property.
4741// Margin on bottom side of widget.
4742//
4743// This property adds margin outside of the widget's normal size
4744// request, the margin will be added in addition to the size from
4745// [method@Gtk.Widget.set_size_request] for example.
4746func (x *Widget) GetPropertyMarginBottom() int {
4747	var v gobject.Value
4748	x.GetProperty("margin-bottom", &v)
4749	return v.GetInt()
4750}
4751
4752// SetPropertyMarginEnd sets the "margin-end" property.
4753// Margin on end of widget, horizontally.
4754//
4755// This property supports left-to-right and right-to-left text
4756// directions.
4757//
4758// This property adds margin outside of the widget's normal size
4759// request, the margin will be added in addition to the size from
4760// [method@Gtk.Widget.set_size_request] for example.
4761func (x *Widget) SetPropertyMarginEnd(value int) {
4762	var v gobject.Value
4763	v.Init(gobject.TypeIntVal)
4764	v.SetInt(value)
4765	x.SetProperty("margin-end", &v)
4766}
4767
4768// GetPropertyMarginEnd gets the "margin-end" property.
4769// Margin on end of widget, horizontally.
4770//
4771// This property supports left-to-right and right-to-left text
4772// directions.
4773//
4774// This property adds margin outside of the widget's normal size
4775// request, the margin will be added in addition to the size from
4776// [method@Gtk.Widget.set_size_request] for example.
4777func (x *Widget) GetPropertyMarginEnd() int {
4778	var v gobject.Value
4779	x.GetProperty("margin-end", &v)
4780	return v.GetInt()
4781}
4782
4783// SetPropertyMarginStart sets the "margin-start" property.
4784// Margin on start of widget, horizontally.
4785//
4786// This property supports left-to-right and right-to-left text
4787// directions.
4788//
4789// This property adds margin outside of the widget's normal size
4790// request, the margin will be added in addition to the size from
4791// [method@Gtk.Widget.set_size_request] for example.
4792func (x *Widget) SetPropertyMarginStart(value int) {
4793	var v gobject.Value
4794	v.Init(gobject.TypeIntVal)
4795	v.SetInt(value)
4796	x.SetProperty("margin-start", &v)
4797}
4798
4799// GetPropertyMarginStart gets the "margin-start" property.
4800// Margin on start of widget, horizontally.
4801//
4802// This property supports left-to-right and right-to-left text
4803// directions.
4804//
4805// This property adds margin outside of the widget's normal size
4806// request, the margin will be added in addition to the size from
4807// [method@Gtk.Widget.set_size_request] for example.
4808func (x *Widget) GetPropertyMarginStart() int {
4809	var v gobject.Value
4810	x.GetProperty("margin-start", &v)
4811	return v.GetInt()
4812}
4813
4814// SetPropertyMarginTop sets the "margin-top" property.
4815// Margin on top side of widget.
4816//
4817// This property adds margin outside of the widget's normal size
4818// request, the margin will be added in addition to the size from
4819// [method@Gtk.Widget.set_size_request] for example.
4820func (x *Widget) SetPropertyMarginTop(value int) {
4821	var v gobject.Value
4822	v.Init(gobject.TypeIntVal)
4823	v.SetInt(value)
4824	x.SetProperty("margin-top", &v)
4825}
4826
4827// GetPropertyMarginTop gets the "margin-top" property.
4828// Margin on top side of widget.
4829//
4830// This property adds margin outside of the widget's normal size
4831// request, the margin will be added in addition to the size from
4832// [method@Gtk.Widget.set_size_request] for example.
4833func (x *Widget) GetPropertyMarginTop() int {
4834	var v gobject.Value
4835	x.GetProperty("margin-top", &v)
4836	return v.GetInt()
4837}
4838
4839// SetPropertyName sets the "name" property.
4840// The name of the widget.
4841func (x *Widget) SetPropertyName(value string) {
4842	var v gobject.Value
4843	v.Init(gobject.TypeStringVal)
4844	v.SetString(&value)
4845	x.SetProperty("name", &v)
4846}
4847
4848// GetPropertyName gets the "name" property.
4849// The name of the widget.
4850func (x *Widget) GetPropertyName() string {
4851	var v gobject.Value
4852	x.GetProperty("name", &v)
4853	return v.GetString()
4854}
4855
4856// SetPropertyOpacity sets the "opacity" property.
4857// The requested opacity of the widget.
4858func (x *Widget) SetPropertyOpacity(value float64) {
4859	var v gobject.Value
4860	v.Init(gobject.TypeDoubleVal)
4861	v.SetDouble(value)
4862	x.SetProperty("opacity", &v)
4863}
4864
4865// GetPropertyOpacity gets the "opacity" property.
4866// The requested opacity of the widget.
4867func (x *Widget) GetPropertyOpacity() float64 {
4868	var v gobject.Value
4869	x.GetProperty("opacity", &v)
4870	return v.GetDouble()
4871}
4872
4873// SetPropertyReceivesDefault sets the "receives-default" property.
4874// Whether the widget will receive the default action when it is focused.
4875func (x *Widget) SetPropertyReceivesDefault(value bool) {
4876	var v gobject.Value
4877	v.Init(gobject.TypeBooleanVal)
4878	v.SetBoolean(value)
4879	x.SetProperty("receives-default", &v)
4880}
4881
4882// GetPropertyReceivesDefault gets the "receives-default" property.
4883// Whether the widget will receive the default action when it is focused.
4884func (x *Widget) GetPropertyReceivesDefault() bool {
4885	var v gobject.Value
4886	x.GetProperty("receives-default", &v)
4887	return v.GetBoolean()
4888}
4889
4890// GetPropertyScaleFactor gets the "scale-factor" property.
4891// The scale factor of the widget.
4892func (x *Widget) GetPropertyScaleFactor() int {
4893	var v gobject.Value
4894	x.GetProperty("scale-factor", &v)
4895	return v.GetInt()
4896}
4897
4898// SetPropertySensitive sets the "sensitive" property.
4899// Whether the widget responds to input.
4900func (x *Widget) SetPropertySensitive(value bool) {
4901	var v gobject.Value
4902	v.Init(gobject.TypeBooleanVal)
4903	v.SetBoolean(value)
4904	x.SetProperty("sensitive", &v)
4905}
4906
4907// GetPropertySensitive gets the "sensitive" property.
4908// Whether the widget responds to input.
4909func (x *Widget) GetPropertySensitive() bool {
4910	var v gobject.Value
4911	x.GetProperty("sensitive", &v)
4912	return v.GetBoolean()
4913}
4914
4915// SetPropertyTooltipMarkup sets the "tooltip-markup" property.
4916// Sets the text of tooltip to be the given string, which is marked up
4917// with Pango markup.
4918//
4919// Also see [method@Gtk.Tooltip.set_markup].
4920//
4921// This is a convenience property which will take care of getting the
4922// tooltip shown if the given string is not `NULL`:
4923// [property@Gtk.Widget:has-tooltip] will automatically be set to true
4924// and there will be taken care of [signal@Gtk.Widget::query-tooltip] in
4925// the default signal handler.
4926//
4927// Note that if both [property@Gtk.Widget:tooltip-text] and
4928// [property@Gtk.Widget:tooltip-markup] are set, the last one wins.
4929func (x *Widget) SetPropertyTooltipMarkup(value string) {
4930	var v gobject.Value
4931	v.Init(gobject.TypeStringVal)
4932	v.SetString(&value)
4933	x.SetProperty("tooltip-markup", &v)
4934}
4935
4936// GetPropertyTooltipMarkup gets the "tooltip-markup" property.
4937// Sets the text of tooltip to be the given string, which is marked up
4938// with Pango markup.
4939//
4940// Also see [method@Gtk.Tooltip.set_markup].
4941//
4942// This is a convenience property which will take care of getting the
4943// tooltip shown if the given string is not `NULL`:
4944// [property@Gtk.Widget:has-tooltip] will automatically be set to true
4945// and there will be taken care of [signal@Gtk.Widget::query-tooltip] in
4946// the default signal handler.
4947//
4948// Note that if both [property@Gtk.Widget:tooltip-text] and
4949// [property@Gtk.Widget:tooltip-markup] are set, the last one wins.
4950func (x *Widget) GetPropertyTooltipMarkup() string {
4951	var v gobject.Value
4952	x.GetProperty("tooltip-markup", &v)
4953	return v.GetString()
4954}
4955
4956// SetPropertyTooltipText sets the "tooltip-text" property.
4957// Sets the text of tooltip to be the given string.
4958//
4959// Also see [method@Gtk.Tooltip.set_text].
4960//
4961// This is a convenience property which will take care of getting the
4962// tooltip shown if the given string is not `NULL`:
4963// [property@Gtk.Widget:has-tooltip] will automatically be set to true
4964// and there will be taken care of [signal@Gtk.Widget::query-tooltip] in
4965// the default signal handler.
4966//
4967// Note that if both [property@Gtk.Widget:tooltip-text] and
4968// [property@Gtk.Widget:tooltip-markup] are set, the last one wins.
4969func (x *Widget) SetPropertyTooltipText(value string) {
4970	var v gobject.Value
4971	v.Init(gobject.TypeStringVal)
4972	v.SetString(&value)
4973	x.SetProperty("tooltip-text", &v)
4974}
4975
4976// GetPropertyTooltipText gets the "tooltip-text" property.
4977// Sets the text of tooltip to be the given string.
4978//
4979// Also see [method@Gtk.Tooltip.set_text].
4980//
4981// This is a convenience property which will take care of getting the
4982// tooltip shown if the given string is not `NULL`:
4983// [property@Gtk.Widget:has-tooltip] will automatically be set to true
4984// and there will be taken care of [signal@Gtk.Widget::query-tooltip] in
4985// the default signal handler.
4986//
4987// Note that if both [property@Gtk.Widget:tooltip-text] and
4988// [property@Gtk.Widget:tooltip-markup] are set, the last one wins.
4989func (x *Widget) GetPropertyTooltipText() string {
4990	var v gobject.Value
4991	x.GetProperty("tooltip-text", &v)
4992	return v.GetString()
4993}
4994
4995// SetPropertyVexpand sets the "vexpand" property.
4996// Whether to expand vertically.
4997func (x *Widget) SetPropertyVexpand(value bool) {
4998	var v gobject.Value
4999	v.Init(gobject.TypeBooleanVal)
5000	v.SetBoolean(value)
5001	x.SetProperty("vexpand", &v)
5002}
5003
5004// GetPropertyVexpand gets the "vexpand" property.
5005// Whether to expand vertically.
5006func (x *Widget) GetPropertyVexpand() bool {
5007	var v gobject.Value
5008	x.GetProperty("vexpand", &v)
5009	return v.GetBoolean()
5010}
5011
5012// SetPropertyVexpandSet sets the "vexpand-set" property.
5013// Whether to use the `vexpand` property.
5014func (x *Widget) SetPropertyVexpandSet(value bool) {
5015	var v gobject.Value
5016	v.Init(gobject.TypeBooleanVal)
5017	v.SetBoolean(value)
5018	x.SetProperty("vexpand-set", &v)
5019}
5020
5021// GetPropertyVexpandSet gets the "vexpand-set" property.
5022// Whether to use the `vexpand` property.
5023func (x *Widget) GetPropertyVexpandSet() bool {
5024	var v gobject.Value
5025	x.GetProperty("vexpand-set", &v)
5026	return v.GetBoolean()
5027}
5028
5029// SetPropertyVisible sets the "visible" property.
5030// Whether the widget is visible.
5031func (x *Widget) SetPropertyVisible(value bool) {
5032	var v gobject.Value
5033	v.Init(gobject.TypeBooleanVal)
5034	v.SetBoolean(value)
5035	x.SetProperty("visible", &v)
5036}
5037
5038// GetPropertyVisible gets the "visible" property.
5039// Whether the widget is visible.
5040func (x *Widget) GetPropertyVisible() bool {
5041	var v gobject.Value
5042	x.GetProperty("visible", &v)
5043	return v.GetBoolean()
5044}
5045
5046// SetPropertyWidthRequest sets the "width-request" property.
5047// Overrides for width request of the widget.
5048//
5049// If this is -1, the natural request will be used.
5050func (x *Widget) SetPropertyWidthRequest(value int) {
5051	var v gobject.Value
5052	v.Init(gobject.TypeIntVal)
5053	v.SetInt(value)
5054	x.SetProperty("width-request", &v)
5055}
5056
5057// GetPropertyWidthRequest gets the "width-request" property.
5058// Overrides for width request of the widget.
5059//
5060// If this is -1, the natural request will be used.
5061func (x *Widget) GetPropertyWidthRequest() int {
5062	var v gobject.Value
5063	x.GetProperty("width-request", &v)
5064	return v.GetInt()
5065}
5066
5067// Signals that all holders of a reference to the widget should release
5068// the reference that they hold.
5069//
5070// May result in finalization of the widget if all references are released.
5071//
5072// This signal is not suitable for saving widget state.
5073func (x *Widget) ConnectDestroy(cb *func(Widget)) uint {
5074	cbPtr := uintptr(unsafe.Pointer(cb))
5075	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5076		handlerID := gobject.SignalConnect(x.GoPointer(), "destroy", cbRefPtr)
5077		glib.SaveHandlerMapping(handlerID, cbPtr)
5078		return handlerID
5079	}
5080
5081	fcb := func(clsPtr uintptr) {
5082		fa := Widget{}
5083		fa.Ptr = clsPtr
5084		cbFn := *cb
5085
5086		cbFn(fa)
5087
5088	}
5089	cbRefPtr := purego.NewCallback(fcb)
5090	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5091	handlerID := gobject.SignalConnect(x.GoPointer(), "destroy", cbRefPtr)
5092	glib.SaveHandlerMapping(handlerID, cbPtr)
5093	return handlerID
5094}
5095
5096// Emitted when the text direction of a widget changes.
5097func (x *Widget) ConnectDirectionChanged(cb *func(Widget, TextDirection)) uint {
5098	cbPtr := uintptr(unsafe.Pointer(cb))
5099	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5100		handlerID := gobject.SignalConnect(x.GoPointer(), "direction-changed", cbRefPtr)
5101		glib.SaveHandlerMapping(handlerID, cbPtr)
5102		return handlerID
5103	}
5104
5105	fcb := func(clsPtr uintptr, PreviousDirectionVarp TextDirection) {
5106		fa := Widget{}
5107		fa.Ptr = clsPtr
5108		cbFn := *cb
5109
5110		cbFn(fa, PreviousDirectionVarp)
5111
5112	}
5113	cbRefPtr := purego.NewCallback(fcb)
5114	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5115	handlerID := gobject.SignalConnect(x.GoPointer(), "direction-changed", cbRefPtr)
5116	glib.SaveHandlerMapping(handlerID, cbPtr)
5117	return handlerID
5118}
5119
5120// Emitted when @widget is hidden.
5121func (x *Widget) ConnectHide(cb *func(Widget)) uint {
5122	cbPtr := uintptr(unsafe.Pointer(cb))
5123	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5124		handlerID := gobject.SignalConnect(x.GoPointer(), "hide", cbRefPtr)
5125		glib.SaveHandlerMapping(handlerID, cbPtr)
5126		return handlerID
5127	}
5128
5129	fcb := func(clsPtr uintptr) {
5130		fa := Widget{}
5131		fa.Ptr = clsPtr
5132		cbFn := *cb
5133
5134		cbFn(fa)
5135
5136	}
5137	cbRefPtr := purego.NewCallback(fcb)
5138	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5139	handlerID := gobject.SignalConnect(x.GoPointer(), "hide", cbRefPtr)
5140	glib.SaveHandlerMapping(handlerID, cbPtr)
5141	return handlerID
5142}
5143
5144// Emitted if keyboard navigation fails.
5145//
5146// See [method@Gtk.Widget.keynav_failed] for details.
5147func (x *Widget) ConnectKeynavFailed(cb *func(Widget, DirectionType) bool) uint {
5148	cbPtr := uintptr(unsafe.Pointer(cb))
5149	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5150		handlerID := gobject.SignalConnect(x.GoPointer(), "keynav-failed", cbRefPtr)
5151		glib.SaveHandlerMapping(handlerID, cbPtr)
5152		return handlerID
5153	}
5154
5155	fcb := func(clsPtr uintptr, DirectionVarp DirectionType) bool {
5156		fa := Widget{}
5157		fa.Ptr = clsPtr
5158		cbFn := *cb
5159
5160		return cbFn(fa, DirectionVarp)
5161
5162	}
5163	cbRefPtr := purego.NewCallback(fcb)
5164	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5165	handlerID := gobject.SignalConnect(x.GoPointer(), "keynav-failed", cbRefPtr)
5166	glib.SaveHandlerMapping(handlerID, cbPtr)
5167	return handlerID
5168}
5169
5170// Emitted when @widget is going to be mapped.
5171//
5172// A widget is mapped when the widget is visible (which is controlled with
5173// [property@Gtk.Widget:visible]) and all its parents up to the toplevel widget
5174// are also visible.
5175//
5176// The `::map` signal can be used to determine whether a widget will be drawn,
5177// for instance it can resume an animation that was stopped during the
5178// emission of [signal@Gtk.Widget::unmap].
5179func (x *Widget) ConnectMap(cb *func(Widget)) uint {
5180	cbPtr := uintptr(unsafe.Pointer(cb))
5181	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5182		handlerID := gobject.SignalConnect(x.GoPointer(), "map", cbRefPtr)
5183		glib.SaveHandlerMapping(handlerID, cbPtr)
5184		return handlerID
5185	}
5186
5187	fcb := func(clsPtr uintptr) {
5188		fa := Widget{}
5189		fa.Ptr = clsPtr
5190		cbFn := *cb
5191
5192		cbFn(fa)
5193
5194	}
5195	cbRefPtr := purego.NewCallback(fcb)
5196	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5197	handlerID := gobject.SignalConnect(x.GoPointer(), "map", cbRefPtr)
5198	glib.SaveHandlerMapping(handlerID, cbPtr)
5199	return handlerID
5200}
5201
5202// Emitted when a widget is activated via a mnemonic.
5203//
5204// The default handler for this signal activates @widget if @group_cycling
5205// is false, or just makes @widget grab focus if @group_cycling is true.
5206func (x *Widget) ConnectMnemonicActivate(cb *func(Widget, bool) bool) uint {
5207	cbPtr := uintptr(unsafe.Pointer(cb))
5208	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5209		handlerID := gobject.SignalConnect(x.GoPointer(), "mnemonic-activate", cbRefPtr)
5210		glib.SaveHandlerMapping(handlerID, cbPtr)
5211		return handlerID
5212	}
5213
5214	fcb := func(clsPtr uintptr, GroupCyclingVarp bool) bool {
5215		fa := Widget{}
5216		fa.Ptr = clsPtr
5217		cbFn := *cb
5218
5219		return cbFn(fa, GroupCyclingVarp)
5220
5221	}
5222	cbRefPtr := purego.NewCallback(fcb)
5223	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5224	handlerID := gobject.SignalConnect(x.GoPointer(), "mnemonic-activate", cbRefPtr)
5225	glib.SaveHandlerMapping(handlerID, cbPtr)
5226	return handlerID
5227}
5228
5229// Emitted when the focus is moved.
5230//
5231// The `::move-focus` signal is a [keybinding signal](class.SignalAction.html).
5232//
5233// The default bindings for this signal are <kbd>Tab</kbd> to move forward,
5234// and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.
5235func (x *Widget) ConnectMoveFocus(cb *func(Widget, DirectionType)) uint {
5236	cbPtr := uintptr(unsafe.Pointer(cb))
5237	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5238		handlerID := gobject.SignalConnect(x.GoPointer(), "move-focus", cbRefPtr)
5239		glib.SaveHandlerMapping(handlerID, cbPtr)
5240		return handlerID
5241	}
5242
5243	fcb := func(clsPtr uintptr, DirectionVarp DirectionType) {
5244		fa := Widget{}
5245		fa.Ptr = clsPtr
5246		cbFn := *cb
5247
5248		cbFn(fa, DirectionVarp)
5249
5250	}
5251	cbRefPtr := purego.NewCallback(fcb)
5252	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5253	handlerID := gobject.SignalConnect(x.GoPointer(), "move-focus", cbRefPtr)
5254	glib.SaveHandlerMapping(handlerID, cbPtr)
5255	return handlerID
5256}
5257
5258// Emitted when the widget’s tooltip is about to be shown.
5259//
5260// This happens when the [property@Gtk.Widget:has-tooltip] property
5261// is true and the hover timeout has expired with the cursor hovering
5262// above @widget; or emitted when @widget got focus in keyboard mode.
5263//
5264// Using the given coordinates, the signal handler should determine
5265// whether a tooltip should be shown for @widget. If this is the case
5266// true should be returned, false otherwise. Note that if @keyboard_mode
5267// is true, the values of @x and @y are undefined and should not be used.
5268//
5269// The signal handler is free to manipulate @tooltip with the therefore
5270// destined function calls.
5271func (x *Widget) ConnectQueryTooltip(cb *func(Widget, int, int, bool, uintptr) bool) uint {
5272	cbPtr := uintptr(unsafe.Pointer(cb))
5273	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5274		handlerID := gobject.SignalConnect(x.GoPointer(), "query-tooltip", cbRefPtr)
5275		glib.SaveHandlerMapping(handlerID, cbPtr)
5276		return handlerID
5277	}
5278
5279	fcb := func(clsPtr uintptr, XVarp int, YVarp int, KeyboardModeVarp bool, TooltipVarp uintptr) bool {
5280		fa := Widget{}
5281		fa.Ptr = clsPtr
5282		cbFn := *cb
5283
5284		return cbFn(fa, XVarp, YVarp, KeyboardModeVarp, TooltipVarp)
5285
5286	}
5287	cbRefPtr := purego.NewCallback(fcb)
5288	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5289	handlerID := gobject.SignalConnect(x.GoPointer(), "query-tooltip", cbRefPtr)
5290	glib.SaveHandlerMapping(handlerID, cbPtr)
5291	return handlerID
5292}
5293
5294// Emitted when @widget is associated with a `GdkSurface`.
5295//
5296// This means that [method@Gtk.Widget.realize] has been called
5297// or the widget has been mapped (that is, it is going to be drawn).
5298func (x *Widget) ConnectRealize(cb *func(Widget)) uint {
5299	cbPtr := uintptr(unsafe.Pointer(cb))
5300	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5301		handlerID := gobject.SignalConnect(x.GoPointer(), "realize", cbRefPtr)
5302		glib.SaveHandlerMapping(handlerID, cbPtr)
5303		return handlerID
5304	}
5305
5306	fcb := func(clsPtr uintptr) {
5307		fa := Widget{}
5308		fa.Ptr = clsPtr
5309		cbFn := *cb
5310
5311		cbFn(fa)
5312
5313	}
5314	cbRefPtr := purego.NewCallback(fcb)
5315	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5316	handlerID := gobject.SignalConnect(x.GoPointer(), "realize", cbRefPtr)
5317	glib.SaveHandlerMapping(handlerID, cbPtr)
5318	return handlerID
5319}
5320
5321// Emitted when @widget is shown.
5322func (x *Widget) ConnectShow(cb *func(Widget)) uint {
5323	cbPtr := uintptr(unsafe.Pointer(cb))
5324	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5325		handlerID := gobject.SignalConnect(x.GoPointer(), "show", cbRefPtr)
5326		glib.SaveHandlerMapping(handlerID, cbPtr)
5327		return handlerID
5328	}
5329
5330	fcb := func(clsPtr uintptr) {
5331		fa := Widget{}
5332		fa.Ptr = clsPtr
5333		cbFn := *cb
5334
5335		cbFn(fa)
5336
5337	}
5338	cbRefPtr := purego.NewCallback(fcb)
5339	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5340	handlerID := gobject.SignalConnect(x.GoPointer(), "show", cbRefPtr)
5341	glib.SaveHandlerMapping(handlerID, cbPtr)
5342	return handlerID
5343}
5344
5345// Emitted when the widget state changes.
5346//
5347// See [method@Gtk.Widget.get_state_flags].
5348func (x *Widget) ConnectStateFlagsChanged(cb *func(Widget, StateFlags)) uint {
5349	cbPtr := uintptr(unsafe.Pointer(cb))
5350	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5351		handlerID := gobject.SignalConnect(x.GoPointer(), "state-flags-changed", cbRefPtr)
5352		glib.SaveHandlerMapping(handlerID, cbPtr)
5353		return handlerID
5354	}
5355
5356	fcb := func(clsPtr uintptr, FlagsVarp StateFlags) {
5357		fa := Widget{}
5358		fa.Ptr = clsPtr
5359		cbFn := *cb
5360
5361		cbFn(fa, FlagsVarp)
5362
5363	}
5364	cbRefPtr := purego.NewCallback(fcb)
5365	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5366	handlerID := gobject.SignalConnect(x.GoPointer(), "state-flags-changed", cbRefPtr)
5367	glib.SaveHandlerMapping(handlerID, cbPtr)
5368	return handlerID
5369}
5370
5371// Emitted when @widget is going to be unmapped.
5372//
5373// A widget is unmapped when either it or any of its parents up to the
5374// toplevel widget have been set as hidden.
5375//
5376// As `::unmap` indicates that a widget will not be shown any longer,
5377// it can be used to, for example, stop an animation on the widget.
5378func (x *Widget) ConnectUnmap(cb *func(Widget)) uint {
5379	cbPtr := uintptr(unsafe.Pointer(cb))
5380	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5381		handlerID := gobject.SignalConnect(x.GoPointer(), "unmap", cbRefPtr)
5382		glib.SaveHandlerMapping(handlerID, cbPtr)
5383		return handlerID
5384	}
5385
5386	fcb := func(clsPtr uintptr) {
5387		fa := Widget{}
5388		fa.Ptr = clsPtr
5389		cbFn := *cb
5390
5391		cbFn(fa)
5392
5393	}
5394	cbRefPtr := purego.NewCallback(fcb)
5395	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5396	handlerID := gobject.SignalConnect(x.GoPointer(), "unmap", cbRefPtr)
5397	glib.SaveHandlerMapping(handlerID, cbPtr)
5398	return handlerID
5399}
5400
5401// Emitted when the `GdkSurface` associated with @widget is destroyed.
5402//
5403// This means that [method@Gtk.Widget.unrealize] has been called
5404// or the widget has been unmapped (that is, it is going to be hidden).
5405func (x *Widget) ConnectUnrealize(cb *func(Widget)) uint {
5406	cbPtr := uintptr(unsafe.Pointer(cb))
5407	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5408		handlerID := gobject.SignalConnect(x.GoPointer(), "unrealize", cbRefPtr)
5409		glib.SaveHandlerMapping(handlerID, cbPtr)
5410		return handlerID
5411	}
5412
5413	fcb := func(clsPtr uintptr) {
5414		fa := Widget{}
5415		fa.Ptr = clsPtr
5416		cbFn := *cb
5417
5418		cbFn(fa)
5419
5420	}
5421	cbRefPtr := purego.NewCallback(fcb)
5422	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5423	handlerID := gobject.SignalConnect(x.GoPointer(), "unrealize", cbRefPtr)
5424	glib.SaveHandlerMapping(handlerID, cbPtr)
5425	return handlerID
5426}
5427
5428// Requests the user's screen reader to announce the given message.
5429//
5430// This kind of notification is useful for messages that
5431// either have only a visual representation or that are not
5432// exposed visually at all, e.g. a notification about a
5433// successful operation.
5434//
5435// Also, by using this API, you can ensure that the message
5436// does not interrupts the user's current screen reader output.
5437func (x *Widget) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
5438
5439	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
5440
5441}
5442
5443// Retrieves the accessible parent for an accessible object.
5444//
5445// This function returns `NULL` for top level widgets.
5446func (x *Widget) GetAccessibleParent() *AccessibleBase {
5447	var cls *AccessibleBase
5448
5449	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
5450
5451	if cret == 0 {
5452		return nil
5453	}
5454	cls = &AccessibleBase{}
5455	cls.Ptr = cret
5456	return cls
5457}
5458
5459// Retrieves the accessible role of an accessible object.
5460func (x *Widget) GetAccessibleRole() AccessibleRole {
5461
5462	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
5463	return cret
5464}
5465
5466// Retrieves the implementation for the given accessible object.
5467func (x *Widget) GetAtContext() *ATContext {
5468	var cls *ATContext
5469
5470	cret := XGtkAccessibleGetAtContext(x.GoPointer())
5471
5472	if cret == 0 {
5473		return nil
5474	}
5475	cls = &ATContext{}
5476	cls.Ptr = cret
5477	return cls
5478}
5479
5480// Queries the coordinates and dimensions of this accessible
5481//
5482// This functionality can be overridden by `GtkAccessible`
5483// implementations, e.g. to get the bounds from an ignored
5484// child widget.
5485func (x *Widget) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
5486
5487	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
5488	return cret
5489}
5490
5491// Retrieves the first accessible child of an accessible object.
5492func (x *Widget) GetFirstAccessibleChild() *AccessibleBase {
5493	var cls *AccessibleBase
5494
5495	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
5496
5497	if cret == 0 {
5498		return nil
5499	}
5500	cls = &AccessibleBase{}
5501	cls.Ptr = cret
5502	return cls
5503}
5504
5505// Retrieves the next accessible sibling of an accessible object
5506func (x *Widget) GetNextAccessibleSibling() *AccessibleBase {
5507	var cls *AccessibleBase
5508
5509	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
5510
5511	if cret == 0 {
5512		return nil
5513	}
5514	cls = &AccessibleBase{}
5515	cls.Ptr = cret
5516	return cls
5517}
5518
5519// Queries a platform state, such as focus.
5520//
5521// This functionality can be overridden by `GtkAccessible`
5522// implementations, e.g. to get platform state from an ignored
5523// child widget, as is the case for `GtkText` wrappers.
5524func (x *Widget) GetPlatformState(StateVar AccessiblePlatformState) bool {
5525
5526	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
5527	return cret
5528}
5529
5530// Resets the accessible property to its default value.
5531func (x *Widget) ResetProperty(PropertyVar AccessibleProperty) {
5532
5533	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
5534
5535}
5536
5537// Resets the accessible relation to its default value.
5538func (x *Widget) ResetRelation(RelationVar AccessibleRelation) {
5539
5540	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
5541
5542}
5543
5544// Resets the accessible state to its default value.
5545func (x *Widget) ResetState(StateVar AccessibleState) {
5546
5547	XGtkAccessibleResetState(x.GoPointer(), StateVar)
5548
5549}
5550
5551// Sets the parent and sibling of an accessible object.
5552//
5553// This function is meant to be used by accessible implementations that are
5554// not part of the widget hierarchy, and but act as a logical bridge between
5555// widgets. For instance, if a widget creates an object that holds metadata
5556// for each child, and you want that object to implement the `GtkAccessible`
5557// interface, you will use this function to ensure that the parent of each
5558// child widget is the metadata object, and the parent of each metadata
5559// object is the container widget.
5560func (x *Widget) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
5561
5562	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
5563
5564}
5565
5566// Updates the next accessible sibling.
5567//
5568// That might be useful when a new child of a custom accessible
5569// is created, and it needs to be linked to a previous child.
5570func (x *Widget) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
5571
5572	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
5573
5574}
5575
5576// Informs ATs that the platform state has changed.
5577//
5578// This function should be used by `GtkAccessible` implementations that
5579// have a platform state but are not widgets. Widgets handle platform
5580// states automatically.
5581func (x *Widget) UpdatePlatformState(StateVar AccessiblePlatformState) {
5582
5583	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
5584
5585}
5586
5587// Updates a list of accessible properties.
5588//
5589// See the [enum@Gtk.AccessibleProperty] documentation for the
5590// value types of accessible properties.
5591//
5592// This function should be called by `GtkWidget` types whenever
5593// an accessible property change must be communicated to assistive
5594// technologies.
5595//
5596// Example:
5597// ```c
5598// value = gtk_adjustment_get_value (adjustment);
5599// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
5600//
5601//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
5602//	-1);
5603//
5604// ```
5605func (x *Widget) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
5606
5607	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
5608
5609}
5610
5611// Updates an array of accessible properties.
5612//
5613// This function should be called by `GtkWidget` types whenever an accessible
5614// property change must be communicated to assistive technologies.
5615//
5616// This function is meant to be used by language bindings.
5617func (x *Widget) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
5618
5619	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
5620
5621}
5622
5623// Updates a list of accessible relations.
5624//
5625// This function should be called by `GtkWidget` types whenever an accessible
5626// relation change must be communicated to assistive technologies.
5627//
5628// If the [enum@Gtk.AccessibleRelation] requires a list of references,
5629// you should pass each reference individually, followed by `NULL`, e.g.
5630//
5631// ```c
5632// gtk_accessible_update_relation (accessible,
5633//
5634//	GTK_ACCESSIBLE_RELATION_CONTROLS,
5635//	  ref1, NULL,
5636//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
5637//	  ref1, ref2, ref3, NULL,
5638//	-1);
5639//
5640// ```
5641func (x *Widget) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
5642
5643	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
5644
5645}
5646
5647// Updates an array of accessible relations.
5648//
5649// This function should be called by `GtkWidget` types whenever an accessible
5650// relation change must be communicated to assistive technologies.
5651//
5652// This function is meant to be used by language bindings.
5653func (x *Widget) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
5654
5655	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
5656
5657}
5658
5659// Updates a list of accessible states.
5660//
5661// See the [enum@Gtk.AccessibleState] documentation for the
5662// value types of accessible states.
5663//
5664// This function should be called by `GtkWidget` types whenever
5665// an accessible state change must be communicated to assistive
5666// technologies.
5667//
5668// Example:
5669//
5670// ```c
5671// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
5672// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
5673//
5674//	GTK_ACCESSIBLE_STATE_CHECKED, value,
5675//	-1);
5676//
5677// ```
5678func (x *Widget) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
5679
5680	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
5681
5682}
5683
5684// Updates an array of accessible states.
5685//
5686// This function should be called by `GtkWidget` types whenever an accessible
5687// state change must be communicated to assistive technologies.
5688//
5689// This function is meant to be used by language bindings.
5690func (x *Widget) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
5691
5692	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
5693
5694}
5695
5696// Gets the ID of the @buildable object.
5697//
5698// `GtkBuilder` sets the name based on the ID attribute
5699// of the `<object>` tag used to construct the @buildable.
5700func (x *Widget) GetBuildableId() string {
5701
5702	cret := XGtkBuildableGetBuildableId(x.GoPointer())
5703	return cret
5704}
5705
5706var xWidgetGetDefaultDirection func() TextDirection
5707
5708// Obtains the default reading direction.
5709//
5710// See [func@Gtk.Widget.set_default_direction].
5711func WidgetGetDefaultDirection() TextDirection {
5712
5713	cret := xWidgetGetDefaultDirection()
5714	return cret
5715}
5716
5717var xWidgetSetDefaultDirection func(TextDirection)
5718
5719// Sets the default reading direction for widgets.
5720//
5721// See [method@Gtk.Widget.set_direction].
5722func WidgetSetDefaultDirection(DirVar TextDirection) {
5723
5724	xWidgetSetDefaultDirection(DirVar)
5725
5726}
5727
5728func init() {
5729	core.SetPackageName("GTK", "gtk4")
5730	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
5731	var libs []uintptr
5732	for _, libPath := range core.GetPaths("GTK") {
5733		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
5734		if err != nil {
5735			panic(err)
5736		}
5737		libs = append(libs, lib)
5738	}
5739
5740	core.PuregoSafeRegister(&xRequisitionGLibType, libs, "gtk_requisition_get_type")
5741
5742	core.PuregoSafeRegister(&xNewRequisition, libs, "gtk_requisition_new")
5743
5744	core.PuregoSafeRegister(&xRequisitionCopy, libs, "gtk_requisition_copy")
5745	core.PuregoSafeRegister(&xRequisitionFree, libs, "gtk_requisition_free")
5746
5747	core.PuregoSafeRegister(&xWidgetClassAddBinding, libs, "gtk_widget_class_add_binding")
5748	core.PuregoSafeRegister(&xWidgetClassAddBindingAction, libs, "gtk_widget_class_add_binding_action")
5749	core.PuregoSafeRegister(&xWidgetClassAddBindingSignal, libs, "gtk_widget_class_add_binding_signal")
5750	core.PuregoSafeRegister(&xWidgetClassAddShortcut, libs, "gtk_widget_class_add_shortcut")
5751	core.PuregoSafeRegister(&xWidgetClassBindTemplateCallbackFull, libs, "gtk_widget_class_bind_template_callback_full")
5752	core.PuregoSafeRegister(&xWidgetClassBindTemplateChildFull, libs, "gtk_widget_class_bind_template_child_full")
5753	core.PuregoSafeRegister(&xWidgetClassGetAccessibleRole, libs, "gtk_widget_class_get_accessible_role")
5754	core.PuregoSafeRegister(&xWidgetClassGetActivateSignal, libs, "gtk_widget_class_get_activate_signal")
5755	core.PuregoSafeRegister(&xWidgetClassGetCssName, libs, "gtk_widget_class_get_css_name")
5756	core.PuregoSafeRegister(&xWidgetClassGetLayoutManagerType, libs, "gtk_widget_class_get_layout_manager_type")
5757	core.PuregoSafeRegister(&xWidgetClassInstallAction, libs, "gtk_widget_class_install_action")
5758	core.PuregoSafeRegister(&xWidgetClassInstallPropertyAction, libs, "gtk_widget_class_install_property_action")
5759	core.PuregoSafeRegister(&xWidgetClassQueryAction, libs, "gtk_widget_class_query_action")
5760	core.PuregoSafeRegister(&xWidgetClassSetAccessibleRole, libs, "gtk_widget_class_set_accessible_role")
5761	core.PuregoSafeRegister(&xWidgetClassSetActivateSignal, libs, "gtk_widget_class_set_activate_signal")
5762	core.PuregoSafeRegister(&xWidgetClassSetActivateSignalFromName, libs, "gtk_widget_class_set_activate_signal_from_name")
5763	core.PuregoSafeRegister(&xWidgetClassSetCssName, libs, "gtk_widget_class_set_css_name")
5764	core.PuregoSafeRegister(&xWidgetClassSetLayoutManagerType, libs, "gtk_widget_class_set_layout_manager_type")
5765	core.PuregoSafeRegister(&xWidgetClassSetTemplate, libs, "gtk_widget_class_set_template")
5766	core.PuregoSafeRegister(&xWidgetClassSetTemplateFromResource, libs, "gtk_widget_class_set_template_from_resource")
5767	core.PuregoSafeRegister(&xWidgetClassSetTemplateScope, libs, "gtk_widget_class_set_template_scope")
5768
5769	core.PuregoSafeRegister(&xWidgetGLibType, libs, "gtk_widget_get_type")
5770
5771	core.PuregoSafeRegister(&xWidgetActionSetEnabled, libs, "gtk_widget_action_set_enabled")
5772	core.PuregoSafeRegister(&xWidgetActivate, libs, "gtk_widget_activate")
5773	core.PuregoSafeRegister(&xWidgetActivateAction, libs, "gtk_widget_activate_action")
5774	core.PuregoSafeRegister(&xWidgetActivateActionVariant, libs, "gtk_widget_activate_action_variant")
5775	core.PuregoSafeRegister(&xWidgetActivateDefault, libs, "gtk_widget_activate_default")
5776	core.PuregoSafeRegister(&xWidgetAddController, libs, "gtk_widget_add_controller")
5777	core.PuregoSafeRegister(&xWidgetAddCssClass, libs, "gtk_widget_add_css_class")
5778	core.PuregoSafeRegister(&xWidgetAddMnemonicLabel, libs, "gtk_widget_add_mnemonic_label")
5779	core.PuregoSafeRegister(&xWidgetAddTickCallback, libs, "gtk_widget_add_tick_callback")
5780	core.PuregoSafeRegister(&xWidgetAllocate, libs, "gtk_widget_allocate")
5781	core.PuregoSafeRegister(&xWidgetChildFocus, libs, "gtk_widget_child_focus")
5782	core.PuregoSafeRegister(&xWidgetComputeBounds, libs, "gtk_widget_compute_bounds")
5783	core.PuregoSafeRegister(&xWidgetComputeExpand, libs, "gtk_widget_compute_expand")
5784	core.PuregoSafeRegister(&xWidgetComputePoint, libs, "gtk_widget_compute_point")
5785	core.PuregoSafeRegister(&xWidgetComputeTransform, libs, "gtk_widget_compute_transform")
5786	core.PuregoSafeRegister(&xWidgetContains, libs, "gtk_widget_contains")
5787	core.PuregoSafeRegister(&xWidgetCreatePangoContext, libs, "gtk_widget_create_pango_context")
5788	core.PuregoSafeRegister(&xWidgetCreatePangoLayout, libs, "gtk_widget_create_pango_layout")
5789	core.PuregoSafeRegister(&xWidgetDisposeTemplate, libs, "gtk_widget_dispose_template")
5790	core.PuregoSafeRegister(&xWidgetDragCheckThreshold, libs, "gtk_drag_check_threshold")
5791	core.PuregoSafeRegister(&xWidgetErrorBell, libs, "gtk_widget_error_bell")
5792	core.PuregoSafeRegister(&xWidgetGetAllocatedBaseline, libs, "gtk_widget_get_allocated_baseline")
5793	core.PuregoSafeRegister(&xWidgetGetAllocatedHeight, libs, "gtk_widget_get_allocated_height")
5794	core.PuregoSafeRegister(&xWidgetGetAllocatedWidth, libs, "gtk_widget_get_allocated_width")
5795	core.PuregoSafeRegister(&xWidgetGetAllocation, libs, "gtk_widget_get_allocation")
5796	core.PuregoSafeRegister(&xWidgetGetAncestor, libs, "gtk_widget_get_ancestor")
5797	core.PuregoSafeRegister(&xWidgetGetBaseline, libs, "gtk_widget_get_baseline")
5798	core.PuregoSafeRegister(&xWidgetGetCanFocus, libs, "gtk_widget_get_can_focus")
5799	core.PuregoSafeRegister(&xWidgetGetCanTarget, libs, "gtk_widget_get_can_target")
5800	core.PuregoSafeRegister(&xWidgetGetChildVisible, libs, "gtk_widget_get_child_visible")
5801	core.PuregoSafeRegister(&xWidgetGetClipboard, libs, "gtk_widget_get_clipboard")
5802	core.PuregoSafeRegister(&xWidgetGetColor, libs, "gtk_widget_get_color")
5803	core.PuregoSafeRegister(&xWidgetGetCssClasses, libs, "gtk_widget_get_css_classes")
5804	core.PuregoSafeRegister(&xWidgetGetCssName, libs, "gtk_widget_get_css_name")
5805	core.PuregoSafeRegister(&xWidgetGetCursor, libs, "gtk_widget_get_cursor")
5806	core.PuregoSafeRegister(&xWidgetGetDirection, libs, "gtk_widget_get_direction")
5807	core.PuregoSafeRegister(&xWidgetGetDisplay, libs, "gtk_widget_get_display")
5808	core.PuregoSafeRegister(&xWidgetGetFirstChild, libs, "gtk_widget_get_first_child")
5809	core.PuregoSafeRegister(&xWidgetGetFocusChild, libs, "gtk_widget_get_focus_child")
5810	core.PuregoSafeRegister(&xWidgetGetFocusOnClick, libs, "gtk_widget_get_focus_on_click")
5811	core.PuregoSafeRegister(&xWidgetGetFocusable, libs, "gtk_widget_get_focusable")
5812	core.PuregoSafeRegister(&xWidgetGetFontMap, libs, "gtk_widget_get_font_map")
5813	core.PuregoSafeRegister(&xWidgetGetFontOptions, libs, "gtk_widget_get_font_options")
5814	core.PuregoSafeRegister(&xWidgetGetFrameClock, libs, "gtk_widget_get_frame_clock")
5815	core.PuregoSafeRegister(&xWidgetGetHalign, libs, "gtk_widget_get_halign")
5816	core.PuregoSafeRegister(&xWidgetGetHasTooltip, libs, "gtk_widget_get_has_tooltip")
5817	core.PuregoSafeRegister(&xWidgetGetHeight, libs, "gtk_widget_get_height")
5818	core.PuregoSafeRegister(&xWidgetGetHexpand, libs, "gtk_widget_get_hexpand")
5819	core.PuregoSafeRegister(&xWidgetGetHexpandSet, libs, "gtk_widget_get_hexpand_set")
5820	core.PuregoSafeRegister(&xWidgetGetLastChild, libs, "gtk_widget_get_last_child")
5821	core.PuregoSafeRegister(&xWidgetGetLayoutManager, libs, "gtk_widget_get_layout_manager")
5822	core.PuregoSafeRegister(&xWidgetGetLimitEvents, libs, "gtk_widget_get_limit_events")
5823	core.PuregoSafeRegister(&xWidgetGetMapped, libs, "gtk_widget_get_mapped")
5824	core.PuregoSafeRegister(&xWidgetGetMarginBottom, libs, "gtk_widget_get_margin_bottom")
5825	core.PuregoSafeRegister(&xWidgetGetMarginEnd, libs, "gtk_widget_get_margin_end")
5826	core.PuregoSafeRegister(&xWidgetGetMarginStart, libs, "gtk_widget_get_margin_start")
5827	core.PuregoSafeRegister(&xWidgetGetMarginTop, libs, "gtk_widget_get_margin_top")
5828	core.PuregoSafeRegister(&xWidgetGetName, libs, "gtk_widget_get_name")
5829	core.PuregoSafeRegister(&xWidgetGetNative, libs, "gtk_widget_get_native")
5830	core.PuregoSafeRegister(&xWidgetGetNextSibling, libs, "gtk_widget_get_next_sibling")
5831	core.PuregoSafeRegister(&xWidgetGetOpacity, libs, "gtk_widget_get_opacity")
5832	core.PuregoSafeRegister(&xWidgetGetOverflow, libs, "gtk_widget_get_overflow")
5833	core.PuregoSafeRegister(&xWidgetGetPangoContext, libs, "gtk_widget_get_pango_context")
5834	core.PuregoSafeRegister(&xWidgetGetParent, libs, "gtk_widget_get_parent")
5835	core.PuregoSafeRegister(&xWidgetGetPreferredSize, libs, "gtk_widget_get_preferred_size")
5836	core.PuregoSafeRegister(&xWidgetGetPrevSibling, libs, "gtk_widget_get_prev_sibling")
5837	core.PuregoSafeRegister(&xWidgetGetPrimaryClipboard, libs, "gtk_widget_get_primary_clipboard")
5838	core.PuregoSafeRegister(&xWidgetGetRealized, libs, "gtk_widget_get_realized")
5839	core.PuregoSafeRegister(&xWidgetGetReceivesDefault, libs, "gtk_widget_get_receives_default")
5840	core.PuregoSafeRegister(&xWidgetGetRequestMode, libs, "gtk_widget_get_request_mode")
5841	core.PuregoSafeRegister(&xWidgetGetRoot, libs, "gtk_widget_get_root")
5842	core.PuregoSafeRegister(&xWidgetGetScaleFactor, libs, "gtk_widget_get_scale_factor")
5843	core.PuregoSafeRegister(&xWidgetGetSensitive, libs, "gtk_widget_get_sensitive")
5844	core.PuregoSafeRegister(&xWidgetGetSettings, libs, "gtk_widget_get_settings")
5845	core.PuregoSafeRegister(&xWidgetGetSize, libs, "gtk_widget_get_size")
5846	core.PuregoSafeRegister(&xWidgetGetSizeRequest, libs, "gtk_widget_get_size_request")
5847	core.PuregoSafeRegister(&xWidgetGetStateFlags, libs, "gtk_widget_get_state_flags")
5848	core.PuregoSafeRegister(&xWidgetGetStyleContext, libs, "gtk_widget_get_style_context")
5849	core.PuregoSafeRegister(&xWidgetGetTemplateChild, libs, "gtk_widget_get_template_child")
5850	core.PuregoSafeRegister(&xWidgetGetTooltipMarkup, libs, "gtk_widget_get_tooltip_markup")
5851	core.PuregoSafeRegister(&xWidgetGetTooltipText, libs, "gtk_widget_get_tooltip_text")
5852	core.PuregoSafeRegister(&xWidgetGetValign, libs, "gtk_widget_get_valign")
5853	core.PuregoSafeRegister(&xWidgetGetVexpand, libs, "gtk_widget_get_vexpand")
5854	core.PuregoSafeRegister(&xWidgetGetVexpandSet, libs, "gtk_widget_get_vexpand_set")
5855	core.PuregoSafeRegister(&xWidgetGetVisible, libs, "gtk_widget_get_visible")
5856	core.PuregoSafeRegister(&xWidgetGetWidth, libs, "gtk_widget_get_width")
5857	core.PuregoSafeRegister(&xWidgetGrabFocus, libs, "gtk_widget_grab_focus")
5858	core.PuregoSafeRegister(&xWidgetHasCssClass, libs, "gtk_widget_has_css_class")
5859	core.PuregoSafeRegister(&xWidgetHasDefault, libs, "gtk_widget_has_default")
5860	core.PuregoSafeRegister(&xWidgetHasFocus, libs, "gtk_widget_has_focus")
5861	core.PuregoSafeRegister(&xWidgetHasVisibleFocus, libs, "gtk_widget_has_visible_focus")
5862	core.PuregoSafeRegister(&xWidgetHide, libs, "gtk_widget_hide")
5863	core.PuregoSafeRegister(&xWidgetInDestruction, libs, "gtk_widget_in_destruction")
5864	core.PuregoSafeRegister(&xWidgetInitTemplate, libs, "gtk_widget_init_template")
5865	core.PuregoSafeRegister(&xWidgetInsertActionGroup, libs, "gtk_widget_insert_action_group")
5866	core.PuregoSafeRegister(&xWidgetInsertAfter, libs, "gtk_widget_insert_after")
5867	core.PuregoSafeRegister(&xWidgetInsertBefore, libs, "gtk_widget_insert_before")
5868	core.PuregoSafeRegister(&xWidgetIsAncestor, libs, "gtk_widget_is_ancestor")
5869	core.PuregoSafeRegister(&xWidgetIsDrawable, libs, "gtk_widget_is_drawable")
5870	core.PuregoSafeRegister(&xWidgetIsFocus, libs, "gtk_widget_is_focus")
5871	core.PuregoSafeRegister(&xWidgetIsSensitive, libs, "gtk_widget_is_sensitive")
5872	core.PuregoSafeRegister(&xWidgetIsVisible, libs, "gtk_widget_is_visible")
5873	core.PuregoSafeRegister(&xWidgetKeynavFailed, libs, "gtk_widget_keynav_failed")
5874	core.PuregoSafeRegister(&xWidgetListMnemonicLabels, libs, "gtk_widget_list_mnemonic_labels")
5875	core.PuregoSafeRegister(&xWidgetMap, libs, "gtk_widget_map")
5876	core.PuregoSafeRegister(&xWidgetMeasure, libs, "gtk_widget_measure")
5877	core.PuregoSafeRegister(&xWidgetMnemonicActivate, libs, "gtk_widget_mnemonic_activate")
5878	core.PuregoSafeRegister(&xWidgetObserveChildren, libs, "gtk_widget_observe_children")
5879	core.PuregoSafeRegister(&xWidgetObserveControllers, libs, "gtk_widget_observe_controllers")
5880	core.PuregoSafeRegister(&xWidgetPick, libs, "gtk_widget_pick")
5881	core.PuregoSafeRegister(&xWidgetQueueAllocate, libs, "gtk_widget_queue_allocate")
5882	core.PuregoSafeRegister(&xWidgetQueueDraw, libs, "gtk_widget_queue_draw")
5883	core.PuregoSafeRegister(&xWidgetQueueResize, libs, "gtk_widget_queue_resize")
5884	core.PuregoSafeRegister(&xWidgetRealize, libs, "gtk_widget_realize")
5885	core.PuregoSafeRegister(&xWidgetRemoveController, libs, "gtk_widget_remove_controller")
5886	core.PuregoSafeRegister(&xWidgetRemoveCssClass, libs, "gtk_widget_remove_css_class")
5887	core.PuregoSafeRegister(&xWidgetRemoveMnemonicLabel, libs, "gtk_widget_remove_mnemonic_label")
5888	core.PuregoSafeRegister(&xWidgetRemoveTickCallback, libs, "gtk_widget_remove_tick_callback")
5889	core.PuregoSafeRegister(&xWidgetSetCanFocus, libs, "gtk_widget_set_can_focus")
5890	core.PuregoSafeRegister(&xWidgetSetCanTarget, libs, "gtk_widget_set_can_target")
5891	core.PuregoSafeRegister(&xWidgetSetChildVisible, libs, "gtk_widget_set_child_visible")
5892	core.PuregoSafeRegister(&xWidgetSetCssClasses, libs, "gtk_widget_set_css_classes")
5893	core.PuregoSafeRegister(&xWidgetSetCursor, libs, "gtk_widget_set_cursor")
5894	core.PuregoSafeRegister(&xWidgetSetCursorFromName, libs, "gtk_widget_set_cursor_from_name")
5895	core.PuregoSafeRegister(&xWidgetSetDirection, libs, "gtk_widget_set_direction")
5896	core.PuregoSafeRegister(&xWidgetSetFocusChild, libs, "gtk_widget_set_focus_child")
5897	core.PuregoSafeRegister(&xWidgetSetFocusOnClick, libs, "gtk_widget_set_focus_on_click")
5898	core.PuregoSafeRegister(&xWidgetSetFocusable, libs, "gtk_widget_set_focusable")
5899	core.PuregoSafeRegister(&xWidgetSetFontMap, libs, "gtk_widget_set_font_map")
5900	core.PuregoSafeRegister(&xWidgetSetFontOptions, libs, "gtk_widget_set_font_options")
5901	core.PuregoSafeRegister(&xWidgetSetHalign, libs, "gtk_widget_set_halign")
5902	core.PuregoSafeRegister(&xWidgetSetHasTooltip, libs, "gtk_widget_set_has_tooltip")
5903	core.PuregoSafeRegister(&xWidgetSetHexpand, libs, "gtk_widget_set_hexpand")
5904	core.PuregoSafeRegister(&xWidgetSetHexpandSet, libs, "gtk_widget_set_hexpand_set")
5905	core.PuregoSafeRegister(&xWidgetSetLayoutManager, libs, "gtk_widget_set_layout_manager")
5906	core.PuregoSafeRegister(&xWidgetSetLimitEvents, libs, "gtk_widget_set_limit_events")
5907	core.PuregoSafeRegister(&xWidgetSetMarginBottom, libs, "gtk_widget_set_margin_bottom")
5908	core.PuregoSafeRegister(&xWidgetSetMarginEnd, libs, "gtk_widget_set_margin_end")
5909	core.PuregoSafeRegister(&xWidgetSetMarginStart, libs, "gtk_widget_set_margin_start")
5910	core.PuregoSafeRegister(&xWidgetSetMarginTop, libs, "gtk_widget_set_margin_top")
5911	core.PuregoSafeRegister(&xWidgetSetName, libs, "gtk_widget_set_name")
5912	core.PuregoSafeRegister(&xWidgetSetOpacity, libs, "gtk_widget_set_opacity")
5913	core.PuregoSafeRegister(&xWidgetSetOverflow, libs, "gtk_widget_set_overflow")
5914	core.PuregoSafeRegister(&xWidgetSetParent, libs, "gtk_widget_set_parent")
5915	core.PuregoSafeRegister(&xWidgetSetReceivesDefault, libs, "gtk_widget_set_receives_default")
5916	core.PuregoSafeRegister(&xWidgetSetSensitive, libs, "gtk_widget_set_sensitive")
5917	core.PuregoSafeRegister(&xWidgetSetSizeRequest, libs, "gtk_widget_set_size_request")
5918	core.PuregoSafeRegister(&xWidgetSetStateFlags, libs, "gtk_widget_set_state_flags")
5919	core.PuregoSafeRegister(&xWidgetSetTooltipMarkup, libs, "gtk_widget_set_tooltip_markup")
5920	core.PuregoSafeRegister(&xWidgetSetTooltipText, libs, "gtk_widget_set_tooltip_text")
5921	core.PuregoSafeRegister(&xWidgetSetValign, libs, "gtk_widget_set_valign")
5922	core.PuregoSafeRegister(&xWidgetSetVexpand, libs, "gtk_widget_set_vexpand")
5923	core.PuregoSafeRegister(&xWidgetSetVexpandSet, libs, "gtk_widget_set_vexpand_set")
5924	core.PuregoSafeRegister(&xWidgetSetVisible, libs, "gtk_widget_set_visible")
5925	core.PuregoSafeRegister(&xWidgetShouldLayout, libs, "gtk_widget_should_layout")
5926	core.PuregoSafeRegister(&xWidgetShow, libs, "gtk_widget_show")
5927	core.PuregoSafeRegister(&xWidgetSizeAllocate, libs, "gtk_widget_size_allocate")
5928	core.PuregoSafeRegister(&xWidgetSnapshotChild, libs, "gtk_widget_snapshot_child")
5929	core.PuregoSafeRegister(&xWidgetTranslateCoordinates, libs, "gtk_widget_translate_coordinates")
5930	core.PuregoSafeRegister(&xWidgetTriggerTooltipQuery, libs, "gtk_widget_trigger_tooltip_query")
5931	core.PuregoSafeRegister(&xWidgetUnmap, libs, "gtk_widget_unmap")
5932	core.PuregoSafeRegister(&xWidgetUnparent, libs, "gtk_widget_unparent")
5933	core.PuregoSafeRegister(&xWidgetUnrealize, libs, "gtk_widget_unrealize")
5934	core.PuregoSafeRegister(&xWidgetUnsetStateFlags, libs, "gtk_widget_unset_state_flags")
5935
5936	core.PuregoSafeRegister(&xWidgetGetDefaultDirection, libs, "gtk_widget_get_default_direction")
5937	core.PuregoSafeRegister(&xWidgetSetDefaultDirection, libs, "gtk_widget_set_default_direction")
5938
5939}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close