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/gdk"
12 "github.com/bnema/puregotk/v4/gio"
13 "github.com/bnema/puregotk/v4/glib"
14 "github.com/bnema/puregotk/v4/gobject"
15 "github.com/bnema/puregotk/v4/gobject/types"
16 "github.com/bnema/puregotk/v4/gsk"
17)
18
19type ApplicationWindowClass struct {
20 _ structs.HostLayout
21
22 ParentClass WindowClass
23
24 Padding [8]uintptr
25}
26
27func (x *ApplicationWindowClass) GoPointer() uintptr {
28 return uintptr(unsafe.Pointer(x))
29}
30
31// A `GtkWindow` subclass that integrates with `GtkApplication`.
32//
33// Notably, `GtkApplicationWindow` can handle an application menubar.
34//
35// This class implements the [iface@Gio.ActionGroup] and [iface@Gio.ActionMap]
36// interfaces, to let you add window-specific actions that will be exported
37// by the associated [class@Gtk.Application], together with its application-wide
38// actions. Window-specific actions are prefixed with the “win.”
39// prefix and application-wide actions are prefixed with the “app.”
40// prefix. Actions must be addressed with the prefixed name when
41// referring to them from a menu model.
42//
43// Note that widgets that are placed inside a `GtkApplicationWindow`
44// can also activate these actions, if they implement the
45// [iface@Gtk.Actionable] interface.
46//
47// The settings [property@Gtk.Settings:gtk-shell-shows-app-menu] and
48// [property@Gtk.Settings:gtk-shell-shows-menubar] tell GTK whether the
49// desktop environment is showing the application menu and menubar
50// models outside the application as part of the desktop shell.
51// For instance, on OS X, both menus will be displayed remotely;
52// on Windows neither will be.
53//
54// If the desktop environment does not display the menubar, it can be shown in
55// the `GtkApplicationWindow` by setting the
56// [property@Gtk.ApplicationWindow:show-menubar] property to true. If the
57// desktop environment does not display the application menu, then it will
58// automatically be included in the menubar or in the window’s client-side
59// decorations.
60//
61// See [class@Gtk.PopoverMenu] for information about the XML language
62// used by `GtkBuilder` for menu models.
63//
64// See also: [method@Gtk.Application.set_menubar].
65//
66// ## A GtkApplicationWindow with a menubar
67//
68// The code sample below shows how to set up a `GtkApplicationWindow`
69// with a menu bar defined on the [class@Gtk.Application]:
70//
71// ```c
72// GtkApplication *app = gtk_application_new ("org.gtk.test", 0);
73//
74// GtkBuilder *builder = gtk_builder_new_from_string (
75//
76// "<interface>"
77// " <menu id='menubar'>"
78// " <submenu>"
79// " <attribute name='label' translatable='yes'>_Edit</attribute>"
80// " <item>"
81// " <attribute name='label' translatable='yes'>_Copy</attribute>"
82// " <attribute name='action'>win.copy</attribute>"
83// " </item>"
84// " <item>"
85// " <attribute name='label' translatable='yes'>_Paste</attribute>"
86// " <attribute name='action'>win.paste</attribute>"
87// " </item>"
88// " </submenu>"
89// " </menu>"
90// "</interface>",
91// -1);
92//
93// GMenuModel *menubar = G_MENU_MODEL (gtk_builder_get_object (builder, "menubar"));
94// gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
95// g_object_unref (builder);
96//
97// // ...
98//
99// GtkWidget *window = gtk_application_window_new (app);
100// ```
101type ApplicationWindow struct {
102 Window
103}
104
105var xApplicationWindowGLibType func() types.GType
106
107func ApplicationWindowGLibType() types.GType {
108 return xApplicationWindowGLibType()
109}
110
111func ApplicationWindowNewFromInternalPtr(ptr uintptr) *ApplicationWindow {
112 cls := &ApplicationWindow{}
113 cls.Ptr = ptr
114 return cls
115}
116
117var xNewApplicationWindow func(uintptr) uintptr
118
119// Creates a new `GtkApplicationWindow`.
120func NewApplicationWindow(ApplicationVar *Application) *ApplicationWindow {
121 var cls *ApplicationWindow
122
123 cret := xNewApplicationWindow(ApplicationVar.GoPointer())
124
125 if cret == 0 {
126 return nil
127 }
128 gobject.IncreaseRef(cret)
129 cls = &ApplicationWindow{}
130 cls.Ptr = cret
131 return cls
132}
133
134var xApplicationWindowGetHelpOverlay func(uintptr) uintptr
135
136// Gets the `GtkShortcutsWindow` that is associated with @window.
137//
138// See [method@Gtk.ApplicationWindow.set_help_overlay].
139func (x *ApplicationWindow) GetHelpOverlay() *ShortcutsWindow {
140 var cls *ShortcutsWindow
141
142 cret := xApplicationWindowGetHelpOverlay(x.GoPointer())
143
144 if cret == 0 {
145 return nil
146 }
147 gobject.IncreaseRef(cret)
148 cls = &ShortcutsWindow{}
149 cls.Ptr = cret
150 return cls
151}
152
153var xApplicationWindowGetId func(uintptr) uint
154
155// Returns the unique ID of the window.
156//
157// If the window has not yet been added to a `GtkApplication`, returns `0`.
158func (x *ApplicationWindow) GetId() uint {
159
160 cret := xApplicationWindowGetId(x.GoPointer())
161 return cret
162}
163
164var xApplicationWindowGetShowMenubar func(uintptr) bool
165
166// Returns whether the window will display a menubar for the app menu
167// and menubar as needed.
168func (x *ApplicationWindow) GetShowMenubar() bool {
169
170 cret := xApplicationWindowGetShowMenubar(x.GoPointer())
171 return cret
172}
173
174var xApplicationWindowSetHelpOverlay func(uintptr, uintptr)
175
176// Associates a shortcuts window with the application window.
177//
178// Additionally, sets up an action with the name
179// `win.show-help-overlay` to present it.
180//
181// The window takes responsibility for destroying the help overlay.
182func (x *ApplicationWindow) SetHelpOverlay(HelpOverlayVar *ShortcutsWindow) {
183
184 xApplicationWindowSetHelpOverlay(x.GoPointer(), HelpOverlayVar.GoPointer())
185
186}
187
188var xApplicationWindowSetShowMenubar func(uintptr, bool)
189
190// Sets whether the window will display a menubar for the app menu
191// and menubar as needed.
192func (x *ApplicationWindow) SetShowMenubar(ShowMenubarVar bool) {
193
194 xApplicationWindowSetShowMenubar(x.GoPointer(), ShowMenubarVar)
195
196}
197
198func (c *ApplicationWindow) GoPointer() uintptr {
199 if c == nil {
200 return 0
201 }
202 return c.Ptr
203}
204
205func (c *ApplicationWindow) SetGoPointer(ptr uintptr) {
206 c.Ptr = ptr
207}
208
209// SetPropertyShowMenubar sets the "show-menubar" property.
210// If this property is true, the window will display a menubar
211// unless it is shown by the desktop shell.
212//
213// See [method@Gtk.Application.set_menubar].
214//
215// If false, the window will not display a menubar, regardless
216// of whether the desktop shell is showing it or not.
217func (x *ApplicationWindow) SetPropertyShowMenubar(value bool) {
218 var v gobject.Value
219 v.Init(gobject.TypeBooleanVal)
220 v.SetBoolean(value)
221 x.SetProperty("show-menubar", &v)
222}
223
224// GetPropertyShowMenubar gets the "show-menubar" property.
225// If this property is true, the window will display a menubar
226// unless it is shown by the desktop shell.
227//
228// See [method@Gtk.Application.set_menubar].
229//
230// If false, the window will not display a menubar, regardless
231// of whether the desktop shell is showing it or not.
232func (x *ApplicationWindow) GetPropertyShowMenubar() bool {
233 var v gobject.Value
234 x.GetProperty("show-menubar", &v)
235 return v.GetBoolean()
236}
237
238// Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group.
239//
240// This function should only be called by [type@Gio.ActionGroup] implementations.
241func (x *ApplicationWindow) ActionAdded(ActionNameVar string) {
242
243 gio.XGActionGroupActionAdded(x.GoPointer(), ActionNameVar)
244
245}
246
247// Emits the [signal@Gio.ActionGroup::action-enabled-changed] signal on @action_group.
248//
249// This function should only be called by [type@Gio.ActionGroup] implementations.
250func (x *ApplicationWindow) ActionEnabledChanged(ActionNameVar string, EnabledVar bool) {
251
252 gio.XGActionGroupActionEnabledChanged(x.GoPointer(), ActionNameVar, EnabledVar)
253
254}
255
256// Emits the [signal@Gio.ActionGroup::action-removed] signal on @action_group.
257//
258// This function should only be called by [type@Gio.ActionGroup] implementations.
259func (x *ApplicationWindow) ActionRemoved(ActionNameVar string) {
260
261 gio.XGActionGroupActionRemoved(x.GoPointer(), ActionNameVar)
262
263}
264
265// Emits the [signal@Gio.ActionGroup::action-state-changed] signal on @action_group.
266//
267// This function should only be called by [type@Gio.ActionGroup] implementations.
268func (x *ApplicationWindow) ActionStateChanged(ActionNameVar string, StateVar *glib.Variant) {
269
270 gio.XGActionGroupActionStateChanged(x.GoPointer(), ActionNameVar, StateVar)
271
272}
273
274// Activate the named action within @action_group.
275//
276// If the action is expecting a parameter, then the correct type of
277// parameter must be given as @parameter. If the action is expecting no
278// parameters then @parameter must be `NULL`. See
279// [method@Gio.ActionGroup.get_action_parameter_type].
280//
281// If the [type@Gio.ActionGroup] implementation supports asynchronous remote
282// activation over D-Bus, this call may return before the relevant
283// D-Bus traffic has been sent, or any replies have been received. In
284// order to block on such asynchronous activation calls,
285// [method@Gio.DBusConnection.flush] should be called prior to the code, which
286// depends on the result of the action activation. Without flushing
287// the D-Bus connection, there is no guarantee that the action would
288// have been activated.
289//
290// The following code which runs in a remote app instance, shows an
291// example of a ‘quit’ action being activated on the primary app
292// instance over D-Bus. Here [method@Gio.DBusConnection.flush] is called
293// before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action
294// may fail to be activated on the primary instance.
295//
296// ```c
297// // call ‘quit’ action on primary instance
298// g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL);
299//
300// // make sure the action is activated now
301// g_dbus_connection_flush (…);
302//
303// g_debug ("Application has been terminated. Exiting.");
304//
305// exit (0);
306// ```
307func (x *ApplicationWindow) ActivateAction(ActionNameVar string, ParameterVar *glib.Variant) {
308
309 gio.XGActionGroupActivateAction(x.GoPointer(), ActionNameVar, ParameterVar)
310
311}
312
313// Request for the state of the named action within @action_group to be
314// changed to @value.
315//
316// The action must be stateful and @value must be of the correct type.
317// See [method@Gio.ActionGroup.get_action_state_type].
318//
319// This call merely requests a change. The action may refuse to change
320// its state or may change its state to something other than @value.
321// See [method@Gio.ActionGroup.get_action_state_hint].
322//
323// If the @value GVariant is floating, it is consumed.
324func (x *ApplicationWindow) ChangeActionState(ActionNameVar string, ValueVar *glib.Variant) {
325
326 gio.XGActionGroupChangeActionState(x.GoPointer(), ActionNameVar, ValueVar)
327
328}
329
330// Checks if the named action within @action_group is currently enabled.
331//
332// An action must be enabled in order to be activated or in order to
333// have its state changed from outside callers.
334func (x *ApplicationWindow) GetActionEnabled(ActionNameVar string) bool {
335
336 cret := gio.XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar)
337 return cret
338}
339
340// Queries the type of the parameter that must be given when activating
341// the named action within @action_group.
342//
343// When activating the action using [method@Gio.ActionGroup.activate_action],
344// the [type@GLib.Variant] given to that function must be of the type returned
345// by this function.
346//
347// In the case that this function returns `NULL`, you must not give any
348// [type@GLib.Variant], but `NULL` instead.
349//
350// The parameter type of a particular action will never change but it is
351// possible for an action to be removed and for a new action to be added
352// with the same name but a different parameter type.
353func (x *ApplicationWindow) GetActionParameterType(ActionNameVar string) *glib.VariantType {
354
355 cret := gio.XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar)
356 return cret
357}
358
359// Queries the current state of the named action within @action_group.
360//
361// If the action is not stateful then `NULL` will be returned. If the
362// action is stateful then the type of the return value is the type
363// given by [method@Gio.ActionGroup.get_action_state_type].
364//
365// The return value (if non-`NULL`) should be freed with
366// [method@GLib.Variant.unref] when it is no longer required.
367func (x *ApplicationWindow) GetActionState(ActionNameVar string) *glib.Variant {
368
369 cret := gio.XGActionGroupGetActionState(x.GoPointer(), ActionNameVar)
370 return cret
371}
372
373// Requests a hint about the valid range of values for the state of the
374// named action within @action_group.
375//
376// If `NULL` is returned it either means that the action is not stateful
377// or that there is no hint about the valid range of values for the
378// state of the action.
379//
380// If a [type@GLib.Variant] array is returned then each item in the array is a
381// possible value for the state. If a [type@GLib.Variant] pair (ie: two-tuple) is
382// returned then the tuple specifies the inclusive lower and upper bound
383// of valid values for the state.
384//
385// In any case, the information is merely a hint. It may be possible to
386// have a state value outside of the hinted range and setting a value
387// within the range may fail.
388//
389// The return value (if non-`NULL`) should be freed with
390// [method@GLib.Variant.unref] when it is no longer required.
391func (x *ApplicationWindow) GetActionStateHint(ActionNameVar string) *glib.Variant {
392
393 cret := gio.XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar)
394 return cret
395}
396
397// Queries the type of the state of the named action within
398// @action_group.
399//
400// If the action is stateful then this function returns the
401// [type@GLib.VariantType] of the state. All calls to
402// [method@Gio.ActionGroup.change_action_state] must give a [type@GLib.Variant] of this
403// type and [method@Gio.ActionGroup.get_action_state] will return a [type@GLib.Variant]
404// of the same type.
405//
406// If the action is not stateful then this function will return `NULL`.
407// In that case, [method@Gio.ActionGroup.get_action_state] will return `NULL`
408// and you must not call [method@Gio.ActionGroup.change_action_state].
409//
410// The state type of a particular action will never change but it is
411// possible for an action to be removed and for a new action to be added
412// with the same name but a different state type.
413func (x *ApplicationWindow) GetActionStateType(ActionNameVar string) *glib.VariantType {
414
415 cret := gio.XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar)
416 return cret
417}
418
419// Checks if the named action exists within @action_group.
420func (x *ApplicationWindow) HasAction(ActionNameVar string) bool {
421
422 cret := gio.XGActionGroupHasAction(x.GoPointer(), ActionNameVar)
423 return cret
424}
425
426// Lists the actions contained within @action_group.
427//
428// The caller is responsible for freeing the list with [func@GLib.strfreev] when
429// it is no longer required.
430func (x *ApplicationWindow) ListActions() []string {
431
432 cret := gio.XGActionGroupListActions(x.GoPointer())
433 return cret
434}
435
436// Queries all aspects of the named action within an @action_group.
437//
438// This function acquires the information available from
439// [method@Gio.ActionGroup.has_action], [method@Gio.ActionGroup.get_action_enabled],
440// [method@Gio.ActionGroup.get_action_parameter_type],
441// [method@Gio.ActionGroup.get_action_state_type],
442// [method@Gio.ActionGroup.get_action_state_hint] and
443// [method@Gio.ActionGroup.get_action_state] with a single function call.
444//
445// This provides two main benefits.
446//
447// The first is the improvement in efficiency that comes with not having
448// to perform repeated lookups of the action in order to discover
449// different things about it. The second is that implementing
450// [type@Gio.ActionGroup] can now be done by only overriding this one virtual
451// function.
452//
453// The interface provides a default implementation of this function that
454// calls the individual functions, as required, to fetch the
455// information. The interface also provides default implementations of
456// those functions that call this function. All implementations,
457// therefore, must override either this function or all of the others.
458//
459// If the action exists, `TRUE` is returned and any of the requested
460// fields (as indicated by having a non-`NULL` reference passed in) are
461// filled. If the action doesn’t exist, `FALSE` is returned and the
462// fields may or may not have been modified.
463func (x *ApplicationWindow) QueryAction(ActionNameVar string, EnabledVar *bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool {
464
465 cret := gio.XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar)
466 return cret
467}
468
469// Adds an action to the @action_map.
470//
471// If the action map already contains an action with the same name
472// as @action then the old action is dropped from the action map.
473//
474// The action map takes its own reference on @action.
475func (x *ApplicationWindow) AddAction(ActionVar gio.Action) {
476
477 gio.XGActionMapAddAction(x.GoPointer(), ActionVar.GoPointer())
478
479}
480
481// A convenience function for creating multiple [class@Gio.SimpleAction]
482// instances and adding them to a [iface@Gio.ActionMap].
483//
484// Each action is constructed as per one [struct@Gio.ActionEntry].
485//
486// ```c
487// static void
488// activate_quit (GSimpleAction *simple,
489//
490// GVariant *parameter,
491// gpointer user_data)
492//
493// {
494// exit (0);
495// }
496//
497// static void
498// activate_print_string (GSimpleAction *simple,
499//
500// GVariant *parameter,
501// gpointer user_data)
502//
503// {
504// g_print ("%s\n", g_variant_get_string (parameter, NULL));
505// }
506//
507// static GActionGroup *
508// create_action_group (void)
509//
510// {
511// const GActionEntry entries[] = {
512// { "quit", activate_quit },
513// { "print-string", activate_print_string, "s" }
514// };
515// GSimpleActionGroup *group;
516//
517// group = g_simple_action_group_new ();
518// g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
519//
520// return G_ACTION_GROUP (group);
521// }
522//
523// ```
524func (x *ApplicationWindow) AddActionEntries(EntriesVar []gio.ActionEntry, NEntriesVar int, UserDataVar uintptr) {
525
526 gio.XGActionMapAddActionEntries(x.GoPointer(), EntriesVar, NEntriesVar, UserDataVar)
527
528}
529
530// Looks up the action with the name @action_name in @action_map.
531//
532// If no such action exists, returns `NULL`.
533func (x *ApplicationWindow) LookupAction(ActionNameVar string) *gio.ActionBase {
534 var cls *gio.ActionBase
535
536 cret := gio.XGActionMapLookupAction(x.GoPointer(), ActionNameVar)
537
538 if cret == 0 {
539 return nil
540 }
541 gobject.IncreaseRef(cret)
542 cls = &gio.ActionBase{}
543 cls.Ptr = cret
544 return cls
545}
546
547// Removes the named action from the action map.
548//
549// If no action of this name is in the map then nothing happens.
550func (x *ApplicationWindow) RemoveAction(ActionNameVar string) {
551
552 gio.XGActionMapRemoveAction(x.GoPointer(), ActionNameVar)
553
554}
555
556// Remove actions from a [iface@Gio.ActionMap]. This is meant as the reverse of
557// [method@Gio.ActionMap.add_action_entries].
558//
559// ```c
560//
561// static const GActionEntry entries[] = {
562// { "quit", activate_quit },
563// { "print-string", activate_print_string, "s" }
564// };
565//
566// void
567// add_actions (GActionMap *map)
568//
569// {
570// g_action_map_add_action_entries (map, entries, G_N_ELEMENTS (entries), NULL);
571// }
572//
573// void
574// remove_actions (GActionMap *map)
575//
576// {
577// g_action_map_remove_action_entries (map, entries, G_N_ELEMENTS (entries));
578// }
579//
580// ```
581func (x *ApplicationWindow) RemoveActionEntries(EntriesVar []gio.ActionEntry, NEntriesVar int) {
582
583 gio.XGActionMapRemoveActionEntries(x.GoPointer(), EntriesVar, NEntriesVar)
584
585}
586
587// Requests the user's screen reader to announce the given message.
588//
589// This kind of notification is useful for messages that
590// either have only a visual representation or that are not
591// exposed visually at all, e.g. a notification about a
592// successful operation.
593//
594// Also, by using this API, you can ensure that the message
595// does not interrupts the user's current screen reader output.
596func (x *ApplicationWindow) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
597
598 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
599
600}
601
602// Retrieves the accessible parent for an accessible object.
603//
604// This function returns `NULL` for top level widgets.
605func (x *ApplicationWindow) GetAccessibleParent() *AccessibleBase {
606 var cls *AccessibleBase
607
608 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
609
610 if cret == 0 {
611 return nil
612 }
613 cls = &AccessibleBase{}
614 cls.Ptr = cret
615 return cls
616}
617
618// Retrieves the accessible role of an accessible object.
619func (x *ApplicationWindow) GetAccessibleRole() AccessibleRole {
620
621 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
622 return cret
623}
624
625// Retrieves the implementation for the given accessible object.
626func (x *ApplicationWindow) GetAtContext() *ATContext {
627 var cls *ATContext
628
629 cret := XGtkAccessibleGetAtContext(x.GoPointer())
630
631 if cret == 0 {
632 return nil
633 }
634 cls = &ATContext{}
635 cls.Ptr = cret
636 return cls
637}
638
639// Queries the coordinates and dimensions of this accessible
640//
641// This functionality can be overridden by `GtkAccessible`
642// implementations, e.g. to get the bounds from an ignored
643// child widget.
644func (x *ApplicationWindow) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
645
646 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
647 return cret
648}
649
650// Retrieves the first accessible child of an accessible object.
651func (x *ApplicationWindow) GetFirstAccessibleChild() *AccessibleBase {
652 var cls *AccessibleBase
653
654 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
655
656 if cret == 0 {
657 return nil
658 }
659 cls = &AccessibleBase{}
660 cls.Ptr = cret
661 return cls
662}
663
664// Retrieves the next accessible sibling of an accessible object
665func (x *ApplicationWindow) GetNextAccessibleSibling() *AccessibleBase {
666 var cls *AccessibleBase
667
668 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
669
670 if cret == 0 {
671 return nil
672 }
673 cls = &AccessibleBase{}
674 cls.Ptr = cret
675 return cls
676}
677
678// Queries a platform state, such as focus.
679//
680// This functionality can be overridden by `GtkAccessible`
681// implementations, e.g. to get platform state from an ignored
682// child widget, as is the case for `GtkText` wrappers.
683func (x *ApplicationWindow) GetPlatformState(StateVar AccessiblePlatformState) bool {
684
685 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
686 return cret
687}
688
689// Resets the accessible property to its default value.
690func (x *ApplicationWindow) ResetProperty(PropertyVar AccessibleProperty) {
691
692 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
693
694}
695
696// Resets the accessible relation to its default value.
697func (x *ApplicationWindow) ResetRelation(RelationVar AccessibleRelation) {
698
699 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
700
701}
702
703// Resets the accessible state to its default value.
704func (x *ApplicationWindow) ResetState(StateVar AccessibleState) {
705
706 XGtkAccessibleResetState(x.GoPointer(), StateVar)
707
708}
709
710// Sets the parent and sibling of an accessible object.
711//
712// This function is meant to be used by accessible implementations that are
713// not part of the widget hierarchy, and but act as a logical bridge between
714// widgets. For instance, if a widget creates an object that holds metadata
715// for each child, and you want that object to implement the `GtkAccessible`
716// interface, you will use this function to ensure that the parent of each
717// child widget is the metadata object, and the parent of each metadata
718// object is the container widget.
719func (x *ApplicationWindow) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
720
721 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
722
723}
724
725// Updates the next accessible sibling.
726//
727// That might be useful when a new child of a custom accessible
728// is created, and it needs to be linked to a previous child.
729func (x *ApplicationWindow) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
730
731 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
732
733}
734
735// Informs ATs that the platform state has changed.
736//
737// This function should be used by `GtkAccessible` implementations that
738// have a platform state but are not widgets. Widgets handle platform
739// states automatically.
740func (x *ApplicationWindow) UpdatePlatformState(StateVar AccessiblePlatformState) {
741
742 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
743
744}
745
746// Updates a list of accessible properties.
747//
748// See the [enum@Gtk.AccessibleProperty] documentation for the
749// value types of accessible properties.
750//
751// This function should be called by `GtkWidget` types whenever
752// an accessible property change must be communicated to assistive
753// technologies.
754//
755// Example:
756// ```c
757// value = gtk_adjustment_get_value (adjustment);
758// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
759//
760// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
761// -1);
762//
763// ```
764func (x *ApplicationWindow) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
765
766 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
767
768}
769
770// Updates an array of accessible properties.
771//
772// This function should be called by `GtkWidget` types whenever an accessible
773// property change must be communicated to assistive technologies.
774//
775// This function is meant to be used by language bindings.
776func (x *ApplicationWindow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
777
778 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
779
780}
781
782// Updates a list of accessible relations.
783//
784// This function should be called by `GtkWidget` types whenever an accessible
785// relation change must be communicated to assistive technologies.
786//
787// If the [enum@Gtk.AccessibleRelation] requires a list of references,
788// you should pass each reference individually, followed by `NULL`, e.g.
789//
790// ```c
791// gtk_accessible_update_relation (accessible,
792//
793// GTK_ACCESSIBLE_RELATION_CONTROLS,
794// ref1, NULL,
795// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
796// ref1, ref2, ref3, NULL,
797// -1);
798//
799// ```
800func (x *ApplicationWindow) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
801
802 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
803
804}
805
806// Updates an array of accessible relations.
807//
808// This function should be called by `GtkWidget` types whenever an accessible
809// relation change must be communicated to assistive technologies.
810//
811// This function is meant to be used by language bindings.
812func (x *ApplicationWindow) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
813
814 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
815
816}
817
818// Updates a list of accessible states.
819//
820// See the [enum@Gtk.AccessibleState] documentation for the
821// value types of accessible states.
822//
823// This function should be called by `GtkWidget` types whenever
824// an accessible state change must be communicated to assistive
825// technologies.
826//
827// Example:
828//
829// ```c
830// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
831// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
832//
833// GTK_ACCESSIBLE_STATE_CHECKED, value,
834// -1);
835//
836// ```
837func (x *ApplicationWindow) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
838
839 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
840
841}
842
843// Updates an array of accessible states.
844//
845// This function should be called by `GtkWidget` types whenever an accessible
846// state change must be communicated to assistive technologies.
847//
848// This function is meant to be used by language bindings.
849func (x *ApplicationWindow) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
850
851 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
852
853}
854
855// Gets the ID of the @buildable object.
856//
857// `GtkBuilder` sets the name based on the ID attribute
858// of the `<object>` tag used to construct the @buildable.
859func (x *ApplicationWindow) GetBuildableId() string {
860
861 cret := XGtkBuildableGetBuildableId(x.GoPointer())
862 return cret
863}
864
865// Returns the renderer that is used for this `GtkNative`.
866func (x *ApplicationWindow) GetRenderer() *gsk.Renderer {
867 var cls *gsk.Renderer
868
869 cret := XGtkNativeGetRenderer(x.GoPointer())
870
871 if cret == 0 {
872 return nil
873 }
874 gobject.IncreaseRef(cret)
875 cls = &gsk.Renderer{}
876 cls.Ptr = cret
877 return cls
878}
879
880// Returns the surface of this `GtkNative`.
881func (x *ApplicationWindow) GetSurface() *gdk.Surface {
882 var cls *gdk.Surface
883
884 cret := XGtkNativeGetSurface(x.GoPointer())
885
886 if cret == 0 {
887 return nil
888 }
889 gobject.IncreaseRef(cret)
890 cls = &gdk.Surface{}
891 cls.Ptr = cret
892 return cls
893}
894
895// Retrieves the surface transform of @self.
896//
897// This is the translation from @self's surface coordinates into
898// @self's widget coordinates.
899func (x *ApplicationWindow) GetSurfaceTransform(XVar *float64, YVar *float64) {
900
901 XGtkNativeGetSurfaceTransform(x.GoPointer(), XVar, YVar)
902
903}
904
905// Realizes a `GtkNative`.
906//
907// This should only be used by subclasses.
908func (x *ApplicationWindow) Realize() {
909
910 XGtkNativeRealize(x.GoPointer())
911
912}
913
914// Unrealizes a `GtkNative`.
915//
916// This should only be used by subclasses.
917func (x *ApplicationWindow) Unrealize() {
918
919 XGtkNativeUnrealize(x.GoPointer())
920
921}
922
923// Returns the display that this `GtkRoot` is on.
924func (x *ApplicationWindow) GetDisplay() *gdk.Display {
925 var cls *gdk.Display
926
927 cret := XGtkRootGetDisplay(x.GoPointer())
928
929 if cret == 0 {
930 return nil
931 }
932 gobject.IncreaseRef(cret)
933 cls = &gdk.Display{}
934 cls.Ptr = cret
935 return cls
936}
937
938// Retrieves the current focused widget within the root.
939//
940// Note that this is the widget that would have the focus
941// if the root is active; if the root is not focused then
942// `gtk_widget_has_focus (widget)` will be %FALSE for the
943// widget.
944func (x *ApplicationWindow) GetFocus() *Widget {
945 var cls *Widget
946
947 cret := XGtkRootGetFocus(x.GoPointer())
948
949 if cret == 0 {
950 return nil
951 }
952 gobject.IncreaseRef(cret)
953 cls = &Widget{}
954 cls.Ptr = cret
955 return cls
956}
957
958// If @focus is not the current focus widget, and is focusable, sets
959// it as the focus widget for the root.
960//
961// If @focus is %NULL, unsets the focus widget for the root.
962//
963// To set the focus to a particular widget in the root, it is usually
964// more convenient to use [method@Gtk.Widget.grab_focus] instead of
965// this function.
966func (x *ApplicationWindow) SetFocus(FocusVar *Widget) {
967
968 XGtkRootSetFocus(x.GoPointer(), FocusVar.GoPointer())
969
970}
971
972func init() {
973 core.SetPackageName("GTK", "gtk4")
974 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
975 var libs []uintptr
976 for _, libPath := range core.GetPaths("GTK") {
977 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
978 if err != nil {
979 panic(err)
980 }
981 libs = append(libs, lib)
982 }
983
984 core.PuregoSafeRegister(&xApplicationWindowGLibType, libs, "gtk_application_window_get_type")
985
986 core.PuregoSafeRegister(&xNewApplicationWindow, libs, "gtk_application_window_new")
987
988 core.PuregoSafeRegister(&xApplicationWindowGetHelpOverlay, libs, "gtk_application_window_get_help_overlay")
989 core.PuregoSafeRegister(&xApplicationWindowGetId, libs, "gtk_application_window_get_id")
990 core.PuregoSafeRegister(&xApplicationWindowGetShowMenubar, libs, "gtk_application_window_get_show_menubar")
991 core.PuregoSafeRegister(&xApplicationWindowSetHelpOverlay, libs, "gtk_application_window_set_help_overlay")
992 core.PuregoSafeRegister(&xApplicationWindowSetShowMenubar, libs, "gtk_application_window_set_show_menubar")
993
994}