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 WindowClass struct {
20 _ structs.HostLayout
21
22 ParentClass WidgetClass
23
24 xActivateFocus uintptr
25
26 xActivateDefault uintptr
27
28 xKeysChanged uintptr
29
30 xEnableDebugging uintptr
31
32 xCloseRequest uintptr
33
34 Padding [8]uintptr
35}
36
37func (x *WindowClass) GoPointer() uintptr {
38 return uintptr(unsafe.Pointer(x))
39}
40
41// OverrideActivateFocus sets the "activate_focus" callback function.
42// Activates the current focused widget within the window.
43func (x *WindowClass) OverrideActivateFocus(cb func(*Window)) {
44 if cb == nil {
45 x.xActivateFocus = 0
46 } else {
47 x.xActivateFocus = purego.NewCallback(func(WindowVarp uintptr) {
48 cb(WindowNewFromInternalPtr(WindowVarp))
49 })
50 }
51}
52
53// GetActivateFocus gets the "activate_focus" callback function.
54// Activates the current focused widget within the window.
55func (x *WindowClass) GetActivateFocus() func(*Window) {
56 if x.xActivateFocus == 0 {
57 return nil
58 }
59 var rawCallback func(WindowVarp uintptr)
60 purego.RegisterFunc(&rawCallback, x.xActivateFocus)
61 return func(WindowVar *Window) {
62 rawCallback(WindowVar.GoPointer())
63 }
64}
65
66// OverrideActivateDefault sets the "activate_default" callback function.
67// Activates the default widget for the window.
68func (x *WindowClass) OverrideActivateDefault(cb func(*Window)) {
69 if cb == nil {
70 x.xActivateDefault = 0
71 } else {
72 x.xActivateDefault = purego.NewCallback(func(WindowVarp uintptr) {
73 cb(WindowNewFromInternalPtr(WindowVarp))
74 })
75 }
76}
77
78// GetActivateDefault gets the "activate_default" callback function.
79// Activates the default widget for the window.
80func (x *WindowClass) GetActivateDefault() func(*Window) {
81 if x.xActivateDefault == 0 {
82 return nil
83 }
84 var rawCallback func(WindowVarp uintptr)
85 purego.RegisterFunc(&rawCallback, x.xActivateDefault)
86 return func(WindowVar *Window) {
87 rawCallback(WindowVar.GoPointer())
88 }
89}
90
91// OverrideKeysChanged sets the "keys_changed" callback function.
92// Signal gets emitted when the set of accelerators or
93//
94// mnemonics that are associated with window changes.
95func (x *WindowClass) OverrideKeysChanged(cb func(*Window)) {
96 if cb == nil {
97 x.xKeysChanged = 0
98 } else {
99 x.xKeysChanged = purego.NewCallback(func(WindowVarp uintptr) {
100 cb(WindowNewFromInternalPtr(WindowVarp))
101 })
102 }
103}
104
105// GetKeysChanged gets the "keys_changed" callback function.
106// Signal gets emitted when the set of accelerators or
107//
108// mnemonics that are associated with window changes.
109func (x *WindowClass) GetKeysChanged() func(*Window) {
110 if x.xKeysChanged == 0 {
111 return nil
112 }
113 var rawCallback func(WindowVarp uintptr)
114 purego.RegisterFunc(&rawCallback, x.xKeysChanged)
115 return func(WindowVar *Window) {
116 rawCallback(WindowVar.GoPointer())
117 }
118}
119
120// OverrideEnableDebugging sets the "enable_debugging" callback function.
121// Class handler for the `GtkWindow::enable-debugging`
122//
123// keybinding signal.
124func (x *WindowClass) OverrideEnableDebugging(cb func(*Window, bool) bool) {
125 if cb == nil {
126 x.xEnableDebugging = 0
127 } else {
128 x.xEnableDebugging = purego.NewCallback(func(WindowVarp uintptr, ToggleVarp bool) bool {
129 return cb(WindowNewFromInternalPtr(WindowVarp), ToggleVarp)
130 })
131 }
132}
133
134// GetEnableDebugging gets the "enable_debugging" callback function.
135// Class handler for the `GtkWindow::enable-debugging`
136//
137// keybinding signal.
138func (x *WindowClass) GetEnableDebugging() func(*Window, bool) bool {
139 if x.xEnableDebugging == 0 {
140 return nil
141 }
142 var rawCallback func(WindowVarp uintptr, ToggleVarp bool) bool
143 purego.RegisterFunc(&rawCallback, x.xEnableDebugging)
144 return func(WindowVar *Window, ToggleVar bool) bool {
145 return rawCallback(WindowVar.GoPointer(), ToggleVar)
146 }
147}
148
149// OverrideCloseRequest sets the "close_request" callback function.
150func (x *WindowClass) OverrideCloseRequest(cb func(*Window) bool) {
151 if cb == nil {
152 x.xCloseRequest = 0
153 } else {
154 x.xCloseRequest = purego.NewCallback(func(WindowVarp uintptr) bool {
155 return cb(WindowNewFromInternalPtr(WindowVarp))
156 })
157 }
158}
159
160// GetCloseRequest gets the "close_request" callback function.
161func (x *WindowClass) GetCloseRequest() func(*Window) bool {
162 if x.xCloseRequest == 0 {
163 return nil
164 }
165 var rawCallback func(WindowVarp uintptr) bool
166 purego.RegisterFunc(&rawCallback, x.xCloseRequest)
167 return func(WindowVar *Window) bool {
168 return rawCallback(WindowVar.GoPointer())
169 }
170}
171
172type WindowGroupPrivate struct {
173 _ structs.HostLayout
174}
175
176func (x *WindowGroupPrivate) GoPointer() uintptr {
177 return uintptr(unsafe.Pointer(x))
178}
179
180// Determines which point or edge of a window is meant to remain fixed
181// when a window changes size.
182type WindowGravity int
183
184var xWindowGravityGLibType func() types.GType
185
186func WindowGravityGLibType() types.GType {
187 return xWindowGravityGLibType()
188}
189
190const (
191
192 // The top left corner
193 WindowGravityTopLeftValue WindowGravity = 0
194 // The top edge
195 WindowGravityTopValue WindowGravity = 1
196 // The top right corner
197 WindowGravityTopRightValue WindowGravity = 2
198 // The left edge
199 WindowGravityLeftValue WindowGravity = 3
200 // The center pointer
201 WindowGravityCenterValue WindowGravity = 4
202 // The right edge
203 WindowGravityRightValue WindowGravity = 5
204 // The bottom left corner
205 WindowGravityBottomLeftValue WindowGravity = 6
206 // the bottom edge
207 WindowGravityBottomValue WindowGravity = 7
208 // The bottom right corner
209 WindowGravityBottomRightValue WindowGravity = 8
210 // The top left or top right corner,
211 // depending on the text direction
212 WindowGravityTopStartValue WindowGravity = 9
213 // The top right or top left corner,
214 // depending on the text direction
215 WindowGravityTopEndValue WindowGravity = 10
216 // The left or right edge,
217 // depending on the text direction
218 WindowGravityStartValue WindowGravity = 11
219 // The right or left edge,
220 // depending on the text direction
221 WindowGravityEndValue WindowGravity = 12
222 // The bottom left or top right corner,
223 // depending on the text direction
224 WindowGravityBottomStartValue WindowGravity = 13
225 // The bottom right or top left corner,
226 // depending on the text direction
227 WindowGravityBottomEndValue WindowGravity = 14
228)
229
230// A toplevel window which can contain other widgets.
231//
232// <picture>
233//
234// <source srcset="window-dark.png" media="(prefers-color-scheme: dark)">
235// <img alt="An example GtkWindow" src="window.png">
236//
237// </picture>
238//
239// Windows normally have decorations that are under the control
240// of the windowing system and allow the user to manipulate the window
241// (resize it, move it, close it,...).
242//
243// # GtkWindow as GtkBuildable
244//
245// The `GtkWindow` implementation of the [iface@Gtk.Buildable] interface supports
246// setting a child as the titlebar by specifying “titlebar” as the “type”
247// attribute of a `<child>` element.
248//
249// # Shortcuts and Gestures
250//
251// `GtkWindow` supports the following keyboard shortcuts:
252//
253// - <kbd>F10</kbd> activates the menubar, if present.
254// - <kbd>Alt</kbd> makes the mnemonics visible while pressed.
255//
256// The following signals have default keybindings:
257//
258// - [signal@Gtk.Window::activate-default]
259// - [signal@Gtk.Window::activate-focus]
260// - [signal@Gtk.Window::enable-debugging]
261//
262// # Actions
263//
264// `GtkWindow` defines a set of built-in actions:
265//
266// - `default.activate` activates the default widget.
267// - `window.minimize` minimizes the window.
268// - `window.toggle-maximized` maximizes or restores the window.
269// - `window.close` closes the window.
270//
271// # CSS nodes
272//
273// ```
274// window.background [.csd / .solid-csd / .ssd] [.maximized / .fullscreen / .tiled]
275// ├── <child>
276// ╰── <titlebar child>.titlebar [.default-decoration]
277// ```
278//
279// `GtkWindow` has a main CSS node with name window and style class .background.
280//
281// Style classes that are typically used with the main CSS node are .csd (when
282// client-side decorations are in use), .solid-csd (for client-side decorations
283// without invisible borders), .ssd (used by mutter when rendering server-side
284// decorations). GtkWindow also represents window states with the following
285// style classes on the main node: .maximized, .fullscreen, .tiled (when supported,
286// also .tiled-top, .tiled-left, .tiled-right, .tiled-bottom).
287//
288// `GtkWindow` subclasses often add their own discriminating style classes,
289// such as .dialog, .popup or .tooltip.
290//
291// Generally, some CSS properties don't make sense on the toplevel window node,
292// such as margins or padding. When client-side decorations without invisible
293// borders are in use (i.e. the .solid-csd style class is added to the
294// main window node), the CSS border of the toplevel window is used for
295// resize drags. In the .csd case, the shadow area outside of the window
296// can be used to resize it.
297//
298// `GtkWindow` adds the .titlebar and .default-decoration style classes to the
299// widget that is added as a titlebar child.
300//
301// # Accessibility
302//
303// `GtkWindow` uses the [enum@Gtk.AccessibleRole.window] role.
304//
305// From GTK 4.12 to 4.18, it used the [enum@Gtk.AccessibleRole.application] role.
306type Window struct {
307 Widget
308}
309
310var xWindowGLibType func() types.GType
311
312func WindowGLibType() types.GType {
313 return xWindowGLibType()
314}
315
316func WindowNewFromInternalPtr(ptr uintptr) *Window {
317 cls := &Window{}
318 cls.Ptr = ptr
319 return cls
320}
321
322var xNewWindow func() uintptr
323
324// Creates a new `GtkWindow`.
325//
326// To get an undecorated window (without window borders),
327// use [method@Gtk.Window.set_decorated].
328//
329// All top-level windows created by this function are stored
330// in an internal top-level window list. This list can be obtained
331// from [func@Gtk.Window.list_toplevels]. Due to GTK keeping a
332// reference to the window internally, this function does not
333// return a reference to the caller.
334//
335// To delete a `GtkWindow`, call [method@Gtk.Window.destroy].
336func NewWindow() *Window {
337 var cls *Window
338
339 cret := xNewWindow()
340
341 if cret == 0 {
342 return nil
343 }
344 gobject.IncreaseRef(cret)
345 cls = &Window{}
346 cls.Ptr = cret
347 return cls
348}
349
350var xWindowClose func(uintptr)
351
352// Requests that the window is closed.
353//
354// This is similar to what happens when a window manager
355// close button is clicked.
356//
357// This function can be used with close buttons in custom
358// titlebars.
359func (x *Window) Close() {
360
361 xWindowClose(x.GoPointer())
362
363}
364
365var xWindowDestroy func(uintptr)
366
367// Drops the internal reference GTK holds on toplevel windows.
368func (x *Window) Destroy() {
369
370 xWindowDestroy(x.GoPointer())
371
372}
373
374var xWindowFullscreen func(uintptr)
375
376// Asks to place the window in the fullscreen state.
377//
378// Note that you shouldn’t assume the window is definitely fullscreen
379// afterward, because other entities (e.g. the user or window manager)
380// unfullscreen it again, and not all window managers honor requests
381// to fullscreen windows.
382//
383// If a window is not explicitly fullscreened or unfullscreened before
384// it is shown, the initial state is at the window managers discretion.
385//
386// You can track the result of this operation via the
387// [property@Gdk.Toplevel:state] property, or by listening to
388// notifications of the [property@Gtk.Window:fullscreened] property.
389func (x *Window) Fullscreen() {
390
391 xWindowFullscreen(x.GoPointer())
392
393}
394
395var xWindowFullscreenOnMonitor func(uintptr, uintptr)
396
397// Asks to place the window in the fullscreen state on the given monitor.
398//
399// Note that you shouldn't assume the window is definitely fullscreen
400// afterward, or that the windowing system allows fullscreen windows on
401// any given monitor.
402//
403// You can track the result of this operation via the
404// [property@Gdk.Toplevel:state] property, or by listening to
405// notifications of the [property@Gtk.Window:fullscreened] property.
406func (x *Window) FullscreenOnMonitor(MonitorVar *gdk.Monitor) {
407
408 xWindowFullscreenOnMonitor(x.GoPointer(), MonitorVar.GoPointer())
409
410}
411
412var xWindowGetApplication func(uintptr) uintptr
413
414// Gets the application object associated with the window.
415func (x *Window) GetApplication() *Application {
416 var cls *Application
417
418 cret := xWindowGetApplication(x.GoPointer())
419
420 if cret == 0 {
421 return nil
422 }
423 gobject.IncreaseRef(cret)
424 cls = &Application{}
425 cls.Ptr = cret
426 return cls
427}
428
429var xWindowGetChild func(uintptr) uintptr
430
431// Gets the child widget of the window.
432func (x *Window) GetChild() *Widget {
433 var cls *Widget
434
435 cret := xWindowGetChild(x.GoPointer())
436
437 if cret == 0 {
438 return nil
439 }
440 gobject.IncreaseRef(cret)
441 cls = &Widget{}
442 cls.Ptr = cret
443 return cls
444}
445
446var xWindowGetDecorated func(uintptr) bool
447
448// Returns whether the window has been set to have decorations.
449func (x *Window) GetDecorated() bool {
450
451 cret := xWindowGetDecorated(x.GoPointer())
452 return cret
453}
454
455var xWindowGetDefaultSize func(uintptr, *int, *int)
456
457// Gets the default size of the window.
458//
459// A value of 0 for the width or height indicates that a default
460// size has not been explicitly set for that dimension, so the
461// “natural” size of the window will be used.
462//
463// This function is the recommended way for [saving window state
464// across restarts of applications](https://developer.gnome.org/documentation/tutorials/save-state.html).
465func (x *Window) GetDefaultSize(WidthVar *int, HeightVar *int) {
466
467 xWindowGetDefaultSize(x.GoPointer(), WidthVar, HeightVar)
468
469}
470
471var xWindowGetDefaultWidget func(uintptr) uintptr
472
473// Returns the default widget for @window.
474func (x *Window) GetDefaultWidget() *Widget {
475 var cls *Widget
476
477 cret := xWindowGetDefaultWidget(x.GoPointer())
478
479 if cret == 0 {
480 return nil
481 }
482 gobject.IncreaseRef(cret)
483 cls = &Widget{}
484 cls.Ptr = cret
485 return cls
486}
487
488var xWindowGetDeletable func(uintptr) bool
489
490// Returns whether the window has been set to have a close button.
491func (x *Window) GetDeletable() bool {
492
493 cret := xWindowGetDeletable(x.GoPointer())
494 return cret
495}
496
497var xWindowGetDestroyWithParent func(uintptr) bool
498
499// Returns whether the window will be destroyed with its transient parent.
500func (x *Window) GetDestroyWithParent() bool {
501
502 cret := xWindowGetDestroyWithParent(x.GoPointer())
503 return cret
504}
505
506var xWindowGetFocus func(uintptr) uintptr
507
508// Retrieves the current focused widget within the window.
509//
510// Note that this is the widget that would have the focus
511// if the toplevel window focused; if the toplevel window
512// is not focused then `gtk_widget_has_focus (widget)` will
513// not be false for the widget.
514func (x *Window) GetFocus() *Widget {
515 var cls *Widget
516
517 cret := xWindowGetFocus(x.GoPointer())
518
519 if cret == 0 {
520 return nil
521 }
522 gobject.IncreaseRef(cret)
523 cls = &Widget{}
524 cls.Ptr = cret
525 return cls
526}
527
528var xWindowGetFocusVisible func(uintptr) bool
529
530// Gets whether “focus rectangles” are supposed to be visible.
531func (x *Window) GetFocusVisible() bool {
532
533 cret := xWindowGetFocusVisible(x.GoPointer())
534 return cret
535}
536
537var xWindowGetGravity func(uintptr) WindowGravity
538
539// Returns the gravity that is used when changing the window size programmatically.
540func (x *Window) GetGravity() WindowGravity {
541
542 cret := xWindowGetGravity(x.GoPointer())
543 return cret
544}
545
546var xWindowGetGroup func(uintptr) uintptr
547
548// Returns the group for the window.
549//
550// If the window has no group, then the default group is returned.
551func (x *Window) GetGroup() *WindowGroup {
552 var cls *WindowGroup
553
554 cret := xWindowGetGroup(x.GoPointer())
555
556 if cret == 0 {
557 return nil
558 }
559 gobject.IncreaseRef(cret)
560 cls = &WindowGroup{}
561 cls.Ptr = cret
562 return cls
563}
564
565var xWindowGetHandleMenubarAccel func(uintptr) bool
566
567// Returns whether this window reacts to <kbd>F10</kbd>
568// presses by activating a menubar it contains.
569func (x *Window) GetHandleMenubarAccel() bool {
570
571 cret := xWindowGetHandleMenubarAccel(x.GoPointer())
572 return cret
573}
574
575var xWindowGetHideOnClose func(uintptr) bool
576
577// Returns whether the window will be hidden instead of destroyed when the close
578// button is clicked.
579func (x *Window) GetHideOnClose() bool {
580
581 cret := xWindowGetHideOnClose(x.GoPointer())
582 return cret
583}
584
585var xWindowGetIconName func(uintptr) string
586
587// Returns the name of the themed icon for the window.
588func (x *Window) GetIconName() string {
589
590 cret := xWindowGetIconName(x.GoPointer())
591 return cret
592}
593
594var xWindowGetMnemonicsVisible func(uintptr) bool
595
596// Gets whether mnemonics are supposed to be visible.
597func (x *Window) GetMnemonicsVisible() bool {
598
599 cret := xWindowGetMnemonicsVisible(x.GoPointer())
600 return cret
601}
602
603var xWindowGetModal func(uintptr) bool
604
605// Returns whether the window is modal.
606func (x *Window) GetModal() bool {
607
608 cret := xWindowGetModal(x.GoPointer())
609 return cret
610}
611
612var xWindowGetResizable func(uintptr) bool
613
614// Gets whether the user can resize the window.
615func (x *Window) GetResizable() bool {
616
617 cret := xWindowGetResizable(x.GoPointer())
618 return cret
619}
620
621var xWindowGetTitle func(uintptr) string
622
623// Retrieves the title of the window.
624func (x *Window) GetTitle() string {
625
626 cret := xWindowGetTitle(x.GoPointer())
627 return cret
628}
629
630var xWindowGetTitlebar func(uintptr) uintptr
631
632// Returns the titlebar that has been set with
633// [method@Gtk.Window.set_titlebar].
634func (x *Window) GetTitlebar() *Widget {
635 var cls *Widget
636
637 cret := xWindowGetTitlebar(x.GoPointer())
638
639 if cret == 0 {
640 return nil
641 }
642 gobject.IncreaseRef(cret)
643 cls = &Widget{}
644 cls.Ptr = cret
645 return cls
646}
647
648var xWindowGetTransientFor func(uintptr) uintptr
649
650// Fetches the transient parent for this window.
651func (x *Window) GetTransientFor() *Window {
652 var cls *Window
653
654 cret := xWindowGetTransientFor(x.GoPointer())
655
656 if cret == 0 {
657 return nil
658 }
659 gobject.IncreaseRef(cret)
660 cls = &Window{}
661 cls.Ptr = cret
662 return cls
663}
664
665var xWindowHasGroup func(uintptr) bool
666
667// Returns whether the window has an explicit window group.
668func (x *Window) HasGroup() bool {
669
670 cret := xWindowHasGroup(x.GoPointer())
671 return cret
672}
673
674var xWindowIsActive func(uintptr) bool
675
676// Returns whether the window is part of the current active toplevel.
677//
678// The active toplevel is the window receiving keystrokes.
679//
680// The return value is %TRUE if the window is active toplevel itself.
681// You might use this function if you wanted to draw a widget
682// differently in an active window from a widget in an inactive window.
683func (x *Window) IsActive() bool {
684
685 cret := xWindowIsActive(x.GoPointer())
686 return cret
687}
688
689var xWindowIsFullscreen func(uintptr) bool
690
691// Retrieves the current fullscreen state of the window.
692//
693// Note that since fullscreening is ultimately handled by the window
694// manager and happens asynchronously to an application request, you
695// shouldn’t assume the return value of this function changing
696// immediately (or at all), as an effect of calling
697// [method@Gtk.Window.fullscreen] or [method@Gtk.Window.unfullscreen].
698//
699// If the window isn't yet mapped, the value returned will whether the
700// initial requested state is fullscreen.
701func (x *Window) IsFullscreen() bool {
702
703 cret := xWindowIsFullscreen(x.GoPointer())
704 return cret
705}
706
707var xWindowIsMaximized func(uintptr) bool
708
709// Retrieves the current maximized state of the window.
710//
711// Note that since maximization is ultimately handled by the window
712// manager and happens asynchronously to an application request, you
713// shouldn’t assume the return value of this function changing
714// immediately (or at all), as an effect of calling
715// [method@Gtk.Window.maximize] or [method@Gtk.Window.unmaximize].
716//
717// If the window isn't yet mapped, the value returned will whether the
718// initial requested state is maximized.
719func (x *Window) IsMaximized() bool {
720
721 cret := xWindowIsMaximized(x.GoPointer())
722 return cret
723}
724
725var xWindowIsSuspended func(uintptr) bool
726
727// Retrieves the current suspended state of the window.
728//
729// A window being suspended means it's currently not visible
730// to the user, for example by being on a inactive workspace,
731// minimized, obstructed.
732func (x *Window) IsSuspended() bool {
733
734 cret := xWindowIsSuspended(x.GoPointer())
735 return cret
736}
737
738var xWindowMaximize func(uintptr)
739
740// Asks to maximize the window, so that it fills the screen.
741//
742// Note that you shouldn’t assume the window is definitely maximized
743// afterward, because other entities (e.g. the user or window manager)
744// could unmaximize it again, and not all window managers support
745// maximization.
746//
747// It’s permitted to call this function before showing a window,
748// in which case the window will be maximized when it appears onscreen
749// initially.
750//
751// If a window is not explicitly maximized or unmaximized before it is
752// shown, the initial state is at the window managers discretion. For
753// example, it might decide to maximize a window that almost fills the
754// screen.
755//
756// You can track the result of this operation via the
757// [property@Gdk.Toplevel:state] property, or by listening to
758// notifications on the [property@Gtk.Window:maximized]
759// property.
760func (x *Window) Maximize() {
761
762 xWindowMaximize(x.GoPointer())
763
764}
765
766var xWindowMinimize func(uintptr)
767
768// Asks to minimize the window.
769//
770// Note that you shouldn’t assume the window is definitely minimized
771// afterward, because the windowing system might not support this
772// functionality; other entities (e.g. the user or the window manager)
773// could unminimize it again, or there may not be a window manager in
774// which case minimization isn’t possible, etc.
775//
776// It’s permitted to call this function before showing a window,
777// in which case the window will be minimized before it ever appears
778// onscreen.
779//
780// You can track result of this operation via the
781// [property@Gdk.Toplevel:state] property.
782func (x *Window) Minimize() {
783
784 xWindowMinimize(x.GoPointer())
785
786}
787
788var xWindowPresent func(uintptr)
789
790// Presents a window to the user.
791//
792// This may mean raising the window in the stacking order,
793// unminimizing it, moving it to the current desktop and/or
794// giving it the keyboard focus (possibly dependent on the user’s
795// platform, window manager and preferences).
796//
797// If @window is hidden, this function also makes it visible.
798func (x *Window) Present() {
799
800 xWindowPresent(x.GoPointer())
801
802}
803
804var xWindowPresentWithTime func(uintptr, uint32)
805
806// Presents a window to the user in response to an user interaction.
807//
808// See [method@Gtk.Window.present] for more details.
809//
810// The timestamp should be gathered when the window was requested
811// to be shown (when clicking a link for example), rather than once
812// the window is ready to be shown.
813func (x *Window) PresentWithTime(TimestampVar uint32) {
814
815 xWindowPresentWithTime(x.GoPointer(), TimestampVar)
816
817}
818
819var xWindowSetApplication func(uintptr, uintptr)
820
821// Sets or unsets the application object associated with the window.
822//
823// The application will be kept alive for at least as long as it has
824// any windows associated with it (see [method@Gio.Application.hold]
825// for a way to keep it alive without windows).
826//
827// Normally, the connection between the application and the window will
828// remain until the window is destroyed, but you can explicitly remove
829// it by setting the @application to %NULL.
830//
831// This is equivalent to calling [method@Gtk.Application.remove_window]
832// and/or [method@Gtk.Application.add_window] on the old/new applications
833// as relevant.
834func (x *Window) SetApplication(ApplicationVar *Application) {
835
836 xWindowSetApplication(x.GoPointer(), ApplicationVar.GoPointer())
837
838}
839
840var xWindowSetChild func(uintptr, uintptr)
841
842// Sets the child widget of the window.
843func (x *Window) SetChild(ChildVar *Widget) {
844
845 xWindowSetChild(x.GoPointer(), ChildVar.GoPointer())
846
847}
848
849var xWindowSetDecorated func(uintptr, bool)
850
851// Sets whether the window should be decorated.
852//
853// By default, windows are decorated with a title bar, resize
854// controls, etc. Some window managers allow GTK to disable these
855// decorations, creating a borderless window. If you set the decorated
856// property to false using this function, GTK will do its best to
857// convince the window manager not to decorate the window. Depending on
858// the system, this function may not have any effect when called on a
859// window that is already visible, so you should call it before calling
860// [method@Gtk.Widget.show].
861//
862// On Windows, this function always works, since there’s no window manager
863// policy involved.
864func (x *Window) SetDecorated(SettingVar bool) {
865
866 xWindowSetDecorated(x.GoPointer(), SettingVar)
867
868}
869
870var xWindowSetDefaultSize func(uintptr, int, int)
871
872// Sets the default size of a window.
873//
874// The default size of a window is the size that will be used
875// if no other constraints apply.
876//
877// The default size will be updated whenever the window is resized
878// to reflect the new size, unless the window is forced to a size,
879// like when it is maximized or fullscreened.
880//
881// If the window’s minimum size request is larger than
882// the default, the default will be ignored.
883//
884// Setting the default size to a value <= 0 will cause it to be
885// ignored and the natural size request will be used instead. It
886// is possible to do this while the window is showing to "reset"
887// it to its initial size.
888//
889// Unlike [method@Gtk.Widget.set_size_request], which sets a size
890// request for a widget and thus would keep users from shrinking
891// the window, this function only sets the initial size, just as
892// if the user had resized the window themselves. Users can still
893// shrink the window again as they normally would. Setting a default
894// size of -1 means to use the “natural” default size (the size request
895// of the window).
896//
897// If you use this function to reestablish a previously saved window size,
898// note that the appropriate size to save is the one returned by
899// [method@Gtk.Window.get_default_size]. Using the window allocation
900// directly will not work in all circumstances and can lead to growing
901// or shrinking windows.
902func (x *Window) SetDefaultSize(WidthVar int, HeightVar int) {
903
904 xWindowSetDefaultSize(x.GoPointer(), WidthVar, HeightVar)
905
906}
907
908var xWindowSetDefaultWidget func(uintptr, uintptr)
909
910// Sets the default widget.
911//
912// The default widget is the widget that is activated
913// when the user presses <kbd>Enter</kbd> in a dialog
914// (for example).
915func (x *Window) SetDefaultWidget(DefaultWidgetVar *Widget) {
916
917 xWindowSetDefaultWidget(x.GoPointer(), DefaultWidgetVar.GoPointer())
918
919}
920
921var xWindowSetDeletable func(uintptr, bool)
922
923// Sets whether the window should be deletable.
924//
925// By default, windows have a close button in the window frame.
926// Some window managers allow GTK to disable this button. If you
927// set the deletable property to false using this function, GTK
928// will do its best to convince the window manager not to show a
929// close button. Depending on the system, this function may not
930// have any effect when called on a window that is already visible,
931// so you should call it before calling [method@Gtk.Widget.show].
932//
933// On Windows, this function always works, since there’s no window
934// manager policy involved.
935func (x *Window) SetDeletable(SettingVar bool) {
936
937 xWindowSetDeletable(x.GoPointer(), SettingVar)
938
939}
940
941var xWindowSetDestroyWithParent func(uintptr, bool)
942
943// Sets whether to destroy the window when the transient parent is destroyed.
944//
945// This is useful for dialogs that shouldn’t persist beyond the lifetime
946// of the main window they are associated with, for example.
947func (x *Window) SetDestroyWithParent(SettingVar bool) {
948
949 xWindowSetDestroyWithParent(x.GoPointer(), SettingVar)
950
951}
952
953var xWindowSetDisplay func(uintptr, uintptr)
954
955// Sets the display where the window is displayed.
956//
957// If the window is already mapped, it will be unmapped,
958// and then remapped on the new display.
959func (x *Window) SetDisplay(DisplayVar *gdk.Display) {
960
961 xWindowSetDisplay(x.GoPointer(), DisplayVar.GoPointer())
962
963}
964
965var xWindowSetFocus func(uintptr, uintptr)
966
967// Sets the focus widget.
968//
969// If @focus is not the current focus widget, and is focusable,
970// sets it as the focus widget for the window. If @focus is %NULL,
971// unsets the focus widget for this window. To set the focus to a
972// particular widget in the toplevel, it is usually more convenient
973// to use [method@Gtk.Widget.grab_focus] instead of this function.
974func (x *Window) SetFocus(FocusVar *Widget) {
975
976 xWindowSetFocus(x.GoPointer(), FocusVar.GoPointer())
977
978}
979
980var xWindowSetFocusVisible func(uintptr, bool)
981
982// Sets whether “focus rectangles” are supposed to be visible.
983//
984// This property is maintained by GTK based on user input,
985// and should not be set by applications.
986func (x *Window) SetFocusVisible(SettingVar bool) {
987
988 xWindowSetFocusVisible(x.GoPointer(), SettingVar)
989
990}
991
992var xWindowSetGravity func(uintptr, WindowGravity)
993
994// Sets the gravity that is used when changing the window size programmatically.
995func (x *Window) SetGravity(GravityVar WindowGravity) {
996
997 xWindowSetGravity(x.GoPointer(), GravityVar)
998
999}
1000
1001var xWindowSetHandleMenubarAccel func(uintptr, bool)
1002
1003// Sets whether this window should react to <kbd>F10</kbd>
1004// presses by activating a menubar it contains.
1005func (x *Window) SetHandleMenubarAccel(HandleMenubarAccelVar bool) {
1006
1007 xWindowSetHandleMenubarAccel(x.GoPointer(), HandleMenubarAccelVar)
1008
1009}
1010
1011var xWindowSetHideOnClose func(uintptr, bool)
1012
1013// Sets whether clicking the close button will hide the window instead
1014// of destroying it.
1015func (x *Window) SetHideOnClose(SettingVar bool) {
1016
1017 xWindowSetHideOnClose(x.GoPointer(), SettingVar)
1018
1019}
1020
1021var xWindowSetIconName func(uintptr, uintptr)
1022
1023// Sets the icon for the window from a named themed icon.
1024//
1025// See the docs for [class@Gtk.IconTheme] for more details.
1026// On some platforms, the window icon is not used at all.
1027//
1028// Note that this has nothing to do with the WM_ICON_NAME
1029// property which is mentioned in the ICCCM.
1030func (x *Window) SetIconName(NameVar *string) {
1031
1032 NameVarPtr := core.GStrdupNullable(NameVar)
1033 defer core.GFreeNullable(NameVarPtr)
1034
1035 xWindowSetIconName(x.GoPointer(), NameVarPtr)
1036
1037}
1038
1039var xWindowSetMnemonicsVisible func(uintptr, bool)
1040
1041// Sets whether mnemonics are supposed to be visible.
1042//
1043// This property is maintained by GTK based on user input,
1044// and should not be set by applications.
1045func (x *Window) SetMnemonicsVisible(SettingVar bool) {
1046
1047 xWindowSetMnemonicsVisible(x.GoPointer(), SettingVar)
1048
1049}
1050
1051var xWindowSetModal func(uintptr, bool)
1052
1053// Sets a window modal or non-modal.
1054//
1055// Modal windows prevent interaction with other windows in the same
1056// application. To keep modal dialogs on top of main application windows,
1057// use [method@Gtk.Window.set_transient_for] to make the dialog transient
1058// for the parent; most window managers will then disallow lowering the
1059// dialog below the parent.
1060func (x *Window) SetModal(ModalVar bool) {
1061
1062 xWindowSetModal(x.GoPointer(), ModalVar)
1063
1064}
1065
1066var xWindowSetResizable func(uintptr, bool)
1067
1068// Sets whether the user can resize a window.
1069//
1070// Windows are user resizable by default.
1071func (x *Window) SetResizable(ResizableVar bool) {
1072
1073 xWindowSetResizable(x.GoPointer(), ResizableVar)
1074
1075}
1076
1077var xWindowSetStartupId func(uintptr, string)
1078
1079// Sets the startup notification ID.
1080//
1081// Startup notification identifiers are used by desktop environment
1082// to track application startup, to provide user feedback and other
1083// features. This function changes the corresponding property on the
1084// underlying `GdkSurface`.
1085//
1086// Normally, startup identifier is managed automatically and you should
1087// only use this function in special cases like transferring focus from
1088// other processes. You should use this function before calling
1089// [method@Gtk.Window.present] or any equivalent function generating
1090// a window map event.
1091//
1092// This function is only useful on Wayland or X11, not with other GDK
1093// backends.
1094func (x *Window) SetStartupId(StartupIdVar string) {
1095
1096 xWindowSetStartupId(x.GoPointer(), StartupIdVar)
1097
1098}
1099
1100var xWindowSetTitle func(uintptr, uintptr)
1101
1102// Sets the title of the window.
1103//
1104// The title of a window will be displayed in its title bar; on the
1105// X Window System, the title bar is rendered by the window manager
1106// so exactly how the title appears to users may vary according to a
1107// user’s exact configuration. The title should help a user distinguish
1108// this window from other windows they may have open. A good title might
1109// include the application name and current document filename, for example.
1110//
1111// Passing `NULL` does the same as setting the title to an empty string.
1112func (x *Window) SetTitle(TitleVar *string) {
1113
1114 TitleVarPtr := core.GStrdupNullable(TitleVar)
1115 defer core.GFreeNullable(TitleVarPtr)
1116
1117 xWindowSetTitle(x.GoPointer(), TitleVarPtr)
1118
1119}
1120
1121var xWindowSetTitlebar func(uintptr, uintptr)
1122
1123// Sets a custom titlebar for the window.
1124//
1125// A typical widget used here is [class@Gtk.HeaderBar], as it
1126// provides various features expected of a titlebar while allowing
1127// the addition of child widgets to it.
1128//
1129// If you set a custom titlebar, GTK will do its best to convince
1130// the window manager not to put its own titlebar on the window.
1131// Depending on the system, this function may not work for a window
1132// that is already visible, so you set the titlebar before calling
1133// [method@Gtk.Widget.show].
1134func (x *Window) SetTitlebar(TitlebarVar *Widget) {
1135
1136 xWindowSetTitlebar(x.GoPointer(), TitlebarVar.GoPointer())
1137
1138}
1139
1140var xWindowSetTransientFor func(uintptr, uintptr)
1141
1142// Sets a transient parent for the window.
1143//
1144// Dialog windows should be set transient for the main application
1145// window they were spawned from. This allows window managers to e.g.
1146// keep the dialog on top of the main window, or center the dialog
1147// over the main window. [ctor@Gtk.Dialog.new_with_buttons] and other
1148// convenience functions in GTK will sometimes call this function on
1149// your behalf.
1150//
1151// Passing `NULL` for @parent unsets the current transient window.
1152//
1153// On Windows, this function puts the child window on top of the parent,
1154// much as the window manager would have done on X.
1155func (x *Window) SetTransientFor(ParentVar *Window) {
1156
1157 xWindowSetTransientFor(x.GoPointer(), ParentVar.GoPointer())
1158
1159}
1160
1161var xWindowUnfullscreen func(uintptr)
1162
1163// Asks to remove the fullscreen state for the window, and return to
1164// its previous state.
1165//
1166// Note that you shouldn’t assume the window is definitely not
1167// fullscreen afterward, because other entities (e.g. the user or
1168// window manager) could fullscreen it again, and not all window
1169// managers honor requests to unfullscreen windows; normally the
1170// window will end up restored to its normal state. Just don’t
1171// write code that crashes if not.
1172//
1173// If a window is not explicitly fullscreened or unfullscreened before
1174// it is shown, the initial state is at the window managers discretion.
1175//
1176// You can track the result of this operation via the
1177// [property@Gdk.Toplevel:state] property, or by listening to
1178// notifications of the [property@Gtk.Window:fullscreened] property.
1179func (x *Window) Unfullscreen() {
1180
1181 xWindowUnfullscreen(x.GoPointer())
1182
1183}
1184
1185var xWindowUnmaximize func(uintptr)
1186
1187// Asks to unmaximize the window.
1188//
1189// Note that you shouldn’t assume the window is definitely unmaximized
1190// afterward, because other entities (e.g. the user or window manager)
1191// maximize it again, and not all window managers honor requests to
1192// unmaximize.
1193//
1194// If a window is not explicitly maximized or unmaximized before it is
1195// shown, the initial state is at the window managers discretion. For
1196// example, it might decide to maximize a window that almost fills the
1197// screen.
1198//
1199// You can track the result of this operation via the
1200// [property@Gdk.Toplevel:state] property, or by listening to
1201// notifications on the [property@Gtk.Window:maximized] property.
1202func (x *Window) Unmaximize() {
1203
1204 xWindowUnmaximize(x.GoPointer())
1205
1206}
1207
1208var xWindowUnminimize func(uintptr)
1209
1210// Asks to unminimize the window.
1211//
1212// Note that you shouldn’t assume the window is definitely unminimized
1213// afterward, because the windowing system might not support this
1214// functionality; other entities (e.g. the user or the window manager)
1215// could minimize it again, or there may not be a window manager in
1216// which case minimization isn’t possible, etc.
1217//
1218// You can track result of this operation via the
1219// [property@Gdk.Toplevel:state] property.
1220func (x *Window) Unminimize() {
1221
1222 xWindowUnminimize(x.GoPointer())
1223
1224}
1225
1226func (c *Window) GoPointer() uintptr {
1227 if c == nil {
1228 return 0
1229 }
1230 return c.Ptr
1231}
1232
1233func (c *Window) SetGoPointer(ptr uintptr) {
1234 c.Ptr = ptr
1235}
1236
1237// SetPropertyDecorated sets the "decorated" property.
1238// Whether the window should have a frame (also known as *decorations*).
1239func (x *Window) SetPropertyDecorated(value bool) {
1240 var v gobject.Value
1241 v.Init(gobject.TypeBooleanVal)
1242 v.SetBoolean(value)
1243 x.SetProperty("decorated", &v)
1244}
1245
1246// GetPropertyDecorated gets the "decorated" property.
1247// Whether the window should have a frame (also known as *decorations*).
1248func (x *Window) GetPropertyDecorated() bool {
1249 var v gobject.Value
1250 x.GetProperty("decorated", &v)
1251 return v.GetBoolean()
1252}
1253
1254// SetPropertyDefaultHeight sets the "default-height" property.
1255// The default height of the window.
1256func (x *Window) SetPropertyDefaultHeight(value int) {
1257 var v gobject.Value
1258 v.Init(gobject.TypeIntVal)
1259 v.SetInt(value)
1260 x.SetProperty("default-height", &v)
1261}
1262
1263// GetPropertyDefaultHeight gets the "default-height" property.
1264// The default height of the window.
1265func (x *Window) GetPropertyDefaultHeight() int {
1266 var v gobject.Value
1267 x.GetProperty("default-height", &v)
1268 return v.GetInt()
1269}
1270
1271// SetPropertyDefaultWidth sets the "default-width" property.
1272// The default width of the window.
1273func (x *Window) SetPropertyDefaultWidth(value int) {
1274 var v gobject.Value
1275 v.Init(gobject.TypeIntVal)
1276 v.SetInt(value)
1277 x.SetProperty("default-width", &v)
1278}
1279
1280// GetPropertyDefaultWidth gets the "default-width" property.
1281// The default width of the window.
1282func (x *Window) GetPropertyDefaultWidth() int {
1283 var v gobject.Value
1284 x.GetProperty("default-width", &v)
1285 return v.GetInt()
1286}
1287
1288// SetPropertyDeletable sets the "deletable" property.
1289// Whether the window frame should have a close button.
1290func (x *Window) SetPropertyDeletable(value bool) {
1291 var v gobject.Value
1292 v.Init(gobject.TypeBooleanVal)
1293 v.SetBoolean(value)
1294 x.SetProperty("deletable", &v)
1295}
1296
1297// GetPropertyDeletable gets the "deletable" property.
1298// Whether the window frame should have a close button.
1299func (x *Window) GetPropertyDeletable() bool {
1300 var v gobject.Value
1301 x.GetProperty("deletable", &v)
1302 return v.GetBoolean()
1303}
1304
1305// SetPropertyDestroyWithParent sets the "destroy-with-parent" property.
1306// If this window should be destroyed when the parent is destroyed.
1307func (x *Window) SetPropertyDestroyWithParent(value bool) {
1308 var v gobject.Value
1309 v.Init(gobject.TypeBooleanVal)
1310 v.SetBoolean(value)
1311 x.SetProperty("destroy-with-parent", &v)
1312}
1313
1314// GetPropertyDestroyWithParent gets the "destroy-with-parent" property.
1315// If this window should be destroyed when the parent is destroyed.
1316func (x *Window) GetPropertyDestroyWithParent() bool {
1317 var v gobject.Value
1318 x.GetProperty("destroy-with-parent", &v)
1319 return v.GetBoolean()
1320}
1321
1322// SetPropertyFocusVisible sets the "focus-visible" property.
1323// Whether 'focus rectangles' are currently visible in this window.
1324//
1325// This property is maintained by GTK based on user input
1326// and should not be set by applications.
1327func (x *Window) SetPropertyFocusVisible(value bool) {
1328 var v gobject.Value
1329 v.Init(gobject.TypeBooleanVal)
1330 v.SetBoolean(value)
1331 x.SetProperty("focus-visible", &v)
1332}
1333
1334// GetPropertyFocusVisible gets the "focus-visible" property.
1335// Whether 'focus rectangles' are currently visible in this window.
1336//
1337// This property is maintained by GTK based on user input
1338// and should not be set by applications.
1339func (x *Window) GetPropertyFocusVisible() bool {
1340 var v gobject.Value
1341 x.GetProperty("focus-visible", &v)
1342 return v.GetBoolean()
1343}
1344
1345// SetPropertyFullscreened sets the "fullscreened" property.
1346// Whether the window is fullscreen.
1347//
1348// Setting this property is the equivalent of calling
1349// [method@Gtk.Window.fullscreen] or [method@Gtk.Window.unfullscreen];
1350// either operation is asynchronous, which means you will need to
1351// connect to the ::notify signal in order to know whether the
1352// operation was successful.
1353func (x *Window) SetPropertyFullscreened(value bool) {
1354 var v gobject.Value
1355 v.Init(gobject.TypeBooleanVal)
1356 v.SetBoolean(value)
1357 x.SetProperty("fullscreened", &v)
1358}
1359
1360// GetPropertyFullscreened gets the "fullscreened" property.
1361// Whether the window is fullscreen.
1362//
1363// Setting this property is the equivalent of calling
1364// [method@Gtk.Window.fullscreen] or [method@Gtk.Window.unfullscreen];
1365// either operation is asynchronous, which means you will need to
1366// connect to the ::notify signal in order to know whether the
1367// operation was successful.
1368func (x *Window) GetPropertyFullscreened() bool {
1369 var v gobject.Value
1370 x.GetProperty("fullscreened", &v)
1371 return v.GetBoolean()
1372}
1373
1374// SetPropertyHandleMenubarAccel sets the "handle-menubar-accel" property.
1375// Whether the window frame should handle <kbd>F10</kbd> for activating
1376// menubars.
1377func (x *Window) SetPropertyHandleMenubarAccel(value bool) {
1378 var v gobject.Value
1379 v.Init(gobject.TypeBooleanVal)
1380 v.SetBoolean(value)
1381 x.SetProperty("handle-menubar-accel", &v)
1382}
1383
1384// GetPropertyHandleMenubarAccel gets the "handle-menubar-accel" property.
1385// Whether the window frame should handle <kbd>F10</kbd> for activating
1386// menubars.
1387func (x *Window) GetPropertyHandleMenubarAccel() bool {
1388 var v gobject.Value
1389 x.GetProperty("handle-menubar-accel", &v)
1390 return v.GetBoolean()
1391}
1392
1393// SetPropertyHideOnClose sets the "hide-on-close" property.
1394// If this window should be hidden instead of destroyed when the user clicks
1395// the close button.
1396func (x *Window) SetPropertyHideOnClose(value bool) {
1397 var v gobject.Value
1398 v.Init(gobject.TypeBooleanVal)
1399 v.SetBoolean(value)
1400 x.SetProperty("hide-on-close", &v)
1401}
1402
1403// GetPropertyHideOnClose gets the "hide-on-close" property.
1404// If this window should be hidden instead of destroyed when the user clicks
1405// the close button.
1406func (x *Window) GetPropertyHideOnClose() bool {
1407 var v gobject.Value
1408 x.GetProperty("hide-on-close", &v)
1409 return v.GetBoolean()
1410}
1411
1412// SetPropertyIconName sets the "icon-name" property.
1413// Specifies the name of the themed icon to use as the window icon.
1414//
1415// See [class@Gtk.IconTheme] for more details.
1416func (x *Window) SetPropertyIconName(value string) {
1417 var v gobject.Value
1418 v.Init(gobject.TypeStringVal)
1419 v.SetString(&value)
1420 x.SetProperty("icon-name", &v)
1421}
1422
1423// GetPropertyIconName gets the "icon-name" property.
1424// Specifies the name of the themed icon to use as the window icon.
1425//
1426// See [class@Gtk.IconTheme] for more details.
1427func (x *Window) GetPropertyIconName() string {
1428 var v gobject.Value
1429 x.GetProperty("icon-name", &v)
1430 return v.GetString()
1431}
1432
1433// GetPropertyIsActive gets the "is-active" property.
1434// Whether the toplevel is the currently active window.
1435func (x *Window) GetPropertyIsActive() bool {
1436 var v gobject.Value
1437 x.GetProperty("is-active", &v)
1438 return v.GetBoolean()
1439}
1440
1441// SetPropertyMaximized sets the "maximized" property.
1442// Whether the window is maximized.
1443//
1444// Setting this property is the equivalent of calling
1445// [method@Gtk.Window.maximize] or [method@Gtk.Window.unmaximize];
1446// either operation is asynchronous, which means you will need to
1447// connect to the ::notify signal in order to know whether the
1448// operation was successful.
1449func (x *Window) SetPropertyMaximized(value bool) {
1450 var v gobject.Value
1451 v.Init(gobject.TypeBooleanVal)
1452 v.SetBoolean(value)
1453 x.SetProperty("maximized", &v)
1454}
1455
1456// GetPropertyMaximized gets the "maximized" property.
1457// Whether the window is maximized.
1458//
1459// Setting this property is the equivalent of calling
1460// [method@Gtk.Window.maximize] or [method@Gtk.Window.unmaximize];
1461// either operation is asynchronous, which means you will need to
1462// connect to the ::notify signal in order to know whether the
1463// operation was successful.
1464func (x *Window) GetPropertyMaximized() bool {
1465 var v gobject.Value
1466 x.GetProperty("maximized", &v)
1467 return v.GetBoolean()
1468}
1469
1470// SetPropertyMnemonicsVisible sets the "mnemonics-visible" property.
1471// Whether mnemonics are currently visible in this window.
1472//
1473// This property is maintained by GTK based on user input,
1474// and should not be set by applications.
1475func (x *Window) SetPropertyMnemonicsVisible(value bool) {
1476 var v gobject.Value
1477 v.Init(gobject.TypeBooleanVal)
1478 v.SetBoolean(value)
1479 x.SetProperty("mnemonics-visible", &v)
1480}
1481
1482// GetPropertyMnemonicsVisible gets the "mnemonics-visible" property.
1483// Whether mnemonics are currently visible in this window.
1484//
1485// This property is maintained by GTK based on user input,
1486// and should not be set by applications.
1487func (x *Window) GetPropertyMnemonicsVisible() bool {
1488 var v gobject.Value
1489 x.GetProperty("mnemonics-visible", &v)
1490 return v.GetBoolean()
1491}
1492
1493// SetPropertyModal sets the "modal" property.
1494// If true, the window is modal.
1495func (x *Window) SetPropertyModal(value bool) {
1496 var v gobject.Value
1497 v.Init(gobject.TypeBooleanVal)
1498 v.SetBoolean(value)
1499 x.SetProperty("modal", &v)
1500}
1501
1502// GetPropertyModal gets the "modal" property.
1503// If true, the window is modal.
1504func (x *Window) GetPropertyModal() bool {
1505 var v gobject.Value
1506 x.GetProperty("modal", &v)
1507 return v.GetBoolean()
1508}
1509
1510// SetPropertyResizable sets the "resizable" property.
1511// If true, users can resize the window.
1512func (x *Window) SetPropertyResizable(value bool) {
1513 var v gobject.Value
1514 v.Init(gobject.TypeBooleanVal)
1515 v.SetBoolean(value)
1516 x.SetProperty("resizable", &v)
1517}
1518
1519// GetPropertyResizable gets the "resizable" property.
1520// If true, users can resize the window.
1521func (x *Window) GetPropertyResizable() bool {
1522 var v gobject.Value
1523 x.GetProperty("resizable", &v)
1524 return v.GetBoolean()
1525}
1526
1527// SetPropertyStartupId sets the "startup-id" property.
1528// A write-only property for setting window's startup notification identifier.
1529func (x *Window) SetPropertyStartupId(value string) {
1530 var v gobject.Value
1531 v.Init(gobject.TypeStringVal)
1532 v.SetString(&value)
1533 x.SetProperty("startup-id", &v)
1534}
1535
1536// GetPropertySuspended gets the "suspended" property.
1537// Whether the window is suspended.
1538//
1539// See [method@Gtk.Window.is_suspended] for details about what suspended means.
1540func (x *Window) GetPropertySuspended() bool {
1541 var v gobject.Value
1542 x.GetProperty("suspended", &v)
1543 return v.GetBoolean()
1544}
1545
1546// SetPropertyTitle sets the "title" property.
1547// The title of the window.
1548func (x *Window) SetPropertyTitle(value string) {
1549 var v gobject.Value
1550 v.Init(gobject.TypeStringVal)
1551 v.SetString(&value)
1552 x.SetProperty("title", &v)
1553}
1554
1555// GetPropertyTitle gets the "title" property.
1556// The title of the window.
1557func (x *Window) GetPropertyTitle() string {
1558 var v gobject.Value
1559 x.GetProperty("title", &v)
1560 return v.GetString()
1561}
1562
1563// Emitted when the user activates the default widget.
1564//
1565// This is a [keybinding signal](class.SignalAction.html).
1566//
1567// The keybindings for this signal are all forms of the <kbd>Enter</kbd> key.
1568func (x *Window) ConnectActivateDefault(cb *func(Window)) uint {
1569 cbPtr := uintptr(unsafe.Pointer(cb))
1570 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1571 handlerID := gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)
1572 glib.SaveHandlerMapping(handlerID, cbPtr)
1573 return handlerID
1574 }
1575
1576 fcb := func(clsPtr uintptr) {
1577 fa := Window{}
1578 fa.Ptr = clsPtr
1579 cbFn := *cb
1580
1581 cbFn(fa)
1582
1583 }
1584 cbRefPtr := purego.NewCallback(fcb)
1585 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1586 handlerID := gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)
1587 glib.SaveHandlerMapping(handlerID, cbPtr)
1588 return handlerID
1589}
1590
1591// Emitted when the user activates the currently focused
1592// widget of @window.
1593//
1594// This is a [keybinding signal](class.SignalAction.html).
1595//
1596// The default binding for this signal is <kbd>␣</kbd>.
1597func (x *Window) ConnectActivateFocus(cb *func(Window)) uint {
1598 cbPtr := uintptr(unsafe.Pointer(cb))
1599 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1600 handlerID := gobject.SignalConnect(x.GoPointer(), "activate-focus", cbRefPtr)
1601 glib.SaveHandlerMapping(handlerID, cbPtr)
1602 return handlerID
1603 }
1604
1605 fcb := func(clsPtr uintptr) {
1606 fa := Window{}
1607 fa.Ptr = clsPtr
1608 cbFn := *cb
1609
1610 cbFn(fa)
1611
1612 }
1613 cbRefPtr := purego.NewCallback(fcb)
1614 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1615 handlerID := gobject.SignalConnect(x.GoPointer(), "activate-focus", cbRefPtr)
1616 glib.SaveHandlerMapping(handlerID, cbPtr)
1617 return handlerID
1618}
1619
1620// Emitted when the user clicks on the close button of the window.
1621func (x *Window) ConnectCloseRequest(cb *func(Window) bool) uint {
1622 cbPtr := uintptr(unsafe.Pointer(cb))
1623 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1624 handlerID := gobject.SignalConnect(x.GoPointer(), "close-request", cbRefPtr)
1625 glib.SaveHandlerMapping(handlerID, cbPtr)
1626 return handlerID
1627 }
1628
1629 fcb := func(clsPtr uintptr) bool {
1630 fa := Window{}
1631 fa.Ptr = clsPtr
1632 cbFn := *cb
1633
1634 return cbFn(fa)
1635
1636 }
1637 cbRefPtr := purego.NewCallback(fcb)
1638 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1639 handlerID := gobject.SignalConnect(x.GoPointer(), "close-request", cbRefPtr)
1640 glib.SaveHandlerMapping(handlerID, cbPtr)
1641 return handlerID
1642}
1643
1644// Emitted when the user enables or disables interactive debugging.
1645//
1646// When @toggle is true, interactive debugging is toggled on or off,
1647// when it is false, the debugger will be pointed at the widget
1648// under the pointer.
1649//
1650// This is a [keybinding signal](class.SignalAction.html).
1651//
1652// The default bindings for this signal are
1653// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd> and
1654// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd>.
1655func (x *Window) ConnectEnableDebugging(cb *func(Window, bool) bool) uint {
1656 cbPtr := uintptr(unsafe.Pointer(cb))
1657 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1658 handlerID := gobject.SignalConnect(x.GoPointer(), "enable-debugging", cbRefPtr)
1659 glib.SaveHandlerMapping(handlerID, cbPtr)
1660 return handlerID
1661 }
1662
1663 fcb := func(clsPtr uintptr, ToggleVarp bool) bool {
1664 fa := Window{}
1665 fa.Ptr = clsPtr
1666 cbFn := *cb
1667
1668 return cbFn(fa, ToggleVarp)
1669
1670 }
1671 cbRefPtr := purego.NewCallback(fcb)
1672 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1673 handlerID := gobject.SignalConnect(x.GoPointer(), "enable-debugging", cbRefPtr)
1674 glib.SaveHandlerMapping(handlerID, cbPtr)
1675 return handlerID
1676}
1677
1678// Emitted when the set of accelerators or mnemonics that
1679// are associated with the window changes.
1680func (x *Window) ConnectKeysChanged(cb *func(Window)) uint {
1681 cbPtr := uintptr(unsafe.Pointer(cb))
1682 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1683 handlerID := gobject.SignalConnect(x.GoPointer(), "keys-changed", cbRefPtr)
1684 glib.SaveHandlerMapping(handlerID, cbPtr)
1685 return handlerID
1686 }
1687
1688 fcb := func(clsPtr uintptr) {
1689 fa := Window{}
1690 fa.Ptr = clsPtr
1691 cbFn := *cb
1692
1693 cbFn(fa)
1694
1695 }
1696 cbRefPtr := purego.NewCallback(fcb)
1697 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1698 handlerID := gobject.SignalConnect(x.GoPointer(), "keys-changed", cbRefPtr)
1699 glib.SaveHandlerMapping(handlerID, cbPtr)
1700 return handlerID
1701}
1702
1703// Requests the user's screen reader to announce the given message.
1704//
1705// This kind of notification is useful for messages that
1706// either have only a visual representation or that are not
1707// exposed visually at all, e.g. a notification about a
1708// successful operation.
1709//
1710// Also, by using this API, you can ensure that the message
1711// does not interrupts the user's current screen reader output.
1712func (x *Window) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
1713
1714 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
1715
1716}
1717
1718// Retrieves the accessible parent for an accessible object.
1719//
1720// This function returns `NULL` for top level widgets.
1721func (x *Window) GetAccessibleParent() *AccessibleBase {
1722 var cls *AccessibleBase
1723
1724 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
1725
1726 if cret == 0 {
1727 return nil
1728 }
1729 cls = &AccessibleBase{}
1730 cls.Ptr = cret
1731 return cls
1732}
1733
1734// Retrieves the accessible role of an accessible object.
1735func (x *Window) GetAccessibleRole() AccessibleRole {
1736
1737 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
1738 return cret
1739}
1740
1741// Retrieves the implementation for the given accessible object.
1742func (x *Window) GetAtContext() *ATContext {
1743 var cls *ATContext
1744
1745 cret := XGtkAccessibleGetAtContext(x.GoPointer())
1746
1747 if cret == 0 {
1748 return nil
1749 }
1750 cls = &ATContext{}
1751 cls.Ptr = cret
1752 return cls
1753}
1754
1755// Queries the coordinates and dimensions of this accessible
1756//
1757// This functionality can be overridden by `GtkAccessible`
1758// implementations, e.g. to get the bounds from an ignored
1759// child widget.
1760func (x *Window) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
1761
1762 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
1763 return cret
1764}
1765
1766// Retrieves the first accessible child of an accessible object.
1767func (x *Window) GetFirstAccessibleChild() *AccessibleBase {
1768 var cls *AccessibleBase
1769
1770 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
1771
1772 if cret == 0 {
1773 return nil
1774 }
1775 cls = &AccessibleBase{}
1776 cls.Ptr = cret
1777 return cls
1778}
1779
1780// Retrieves the next accessible sibling of an accessible object
1781func (x *Window) GetNextAccessibleSibling() *AccessibleBase {
1782 var cls *AccessibleBase
1783
1784 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
1785
1786 if cret == 0 {
1787 return nil
1788 }
1789 cls = &AccessibleBase{}
1790 cls.Ptr = cret
1791 return cls
1792}
1793
1794// Queries a platform state, such as focus.
1795//
1796// This functionality can be overridden by `GtkAccessible`
1797// implementations, e.g. to get platform state from an ignored
1798// child widget, as is the case for `GtkText` wrappers.
1799func (x *Window) GetPlatformState(StateVar AccessiblePlatformState) bool {
1800
1801 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
1802 return cret
1803}
1804
1805// Resets the accessible property to its default value.
1806func (x *Window) ResetProperty(PropertyVar AccessibleProperty) {
1807
1808 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
1809
1810}
1811
1812// Resets the accessible relation to its default value.
1813func (x *Window) ResetRelation(RelationVar AccessibleRelation) {
1814
1815 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
1816
1817}
1818
1819// Resets the accessible state to its default value.
1820func (x *Window) ResetState(StateVar AccessibleState) {
1821
1822 XGtkAccessibleResetState(x.GoPointer(), StateVar)
1823
1824}
1825
1826// Sets the parent and sibling of an accessible object.
1827//
1828// This function is meant to be used by accessible implementations that are
1829// not part of the widget hierarchy, and but act as a logical bridge between
1830// widgets. For instance, if a widget creates an object that holds metadata
1831// for each child, and you want that object to implement the `GtkAccessible`
1832// interface, you will use this function to ensure that the parent of each
1833// child widget is the metadata object, and the parent of each metadata
1834// object is the container widget.
1835func (x *Window) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
1836
1837 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
1838
1839}
1840
1841// Updates the next accessible sibling.
1842//
1843// That might be useful when a new child of a custom accessible
1844// is created, and it needs to be linked to a previous child.
1845func (x *Window) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
1846
1847 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
1848
1849}
1850
1851// Informs ATs that the platform state has changed.
1852//
1853// This function should be used by `GtkAccessible` implementations that
1854// have a platform state but are not widgets. Widgets handle platform
1855// states automatically.
1856func (x *Window) UpdatePlatformState(StateVar AccessiblePlatformState) {
1857
1858 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
1859
1860}
1861
1862// Updates a list of accessible properties.
1863//
1864// See the [enum@Gtk.AccessibleProperty] documentation for the
1865// value types of accessible properties.
1866//
1867// This function should be called by `GtkWidget` types whenever
1868// an accessible property change must be communicated to assistive
1869// technologies.
1870//
1871// Example:
1872// ```c
1873// value = gtk_adjustment_get_value (adjustment);
1874// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
1875//
1876// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
1877// -1);
1878//
1879// ```
1880func (x *Window) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
1881
1882 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
1883
1884}
1885
1886// Updates an array of accessible properties.
1887//
1888// This function should be called by `GtkWidget` types whenever an accessible
1889// property change must be communicated to assistive technologies.
1890//
1891// This function is meant to be used by language bindings.
1892func (x *Window) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
1893
1894 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
1895
1896}
1897
1898// Updates a list of accessible relations.
1899//
1900// This function should be called by `GtkWidget` types whenever an accessible
1901// relation change must be communicated to assistive technologies.
1902//
1903// If the [enum@Gtk.AccessibleRelation] requires a list of references,
1904// you should pass each reference individually, followed by `NULL`, e.g.
1905//
1906// ```c
1907// gtk_accessible_update_relation (accessible,
1908//
1909// GTK_ACCESSIBLE_RELATION_CONTROLS,
1910// ref1, NULL,
1911// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
1912// ref1, ref2, ref3, NULL,
1913// -1);
1914//
1915// ```
1916func (x *Window) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
1917
1918 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
1919
1920}
1921
1922// Updates an array of accessible relations.
1923//
1924// This function should be called by `GtkWidget` types whenever an accessible
1925// relation change must be communicated to assistive technologies.
1926//
1927// This function is meant to be used by language bindings.
1928func (x *Window) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
1929
1930 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
1931
1932}
1933
1934// Updates a list of accessible states.
1935//
1936// See the [enum@Gtk.AccessibleState] documentation for the
1937// value types of accessible states.
1938//
1939// This function should be called by `GtkWidget` types whenever
1940// an accessible state change must be communicated to assistive
1941// technologies.
1942//
1943// Example:
1944//
1945// ```c
1946// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
1947// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
1948//
1949// GTK_ACCESSIBLE_STATE_CHECKED, value,
1950// -1);
1951//
1952// ```
1953func (x *Window) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
1954
1955 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
1956
1957}
1958
1959// Updates an array of accessible states.
1960//
1961// This function should be called by `GtkWidget` types whenever an accessible
1962// state change must be communicated to assistive technologies.
1963//
1964// This function is meant to be used by language bindings.
1965func (x *Window) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
1966
1967 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
1968
1969}
1970
1971// Gets the ID of the @buildable object.
1972//
1973// `GtkBuilder` sets the name based on the ID attribute
1974// of the `<object>` tag used to construct the @buildable.
1975func (x *Window) GetBuildableId() string {
1976
1977 cret := XGtkBuildableGetBuildableId(x.GoPointer())
1978 return cret
1979}
1980
1981// Returns the renderer that is used for this `GtkNative`.
1982func (x *Window) GetRenderer() *gsk.Renderer {
1983 var cls *gsk.Renderer
1984
1985 cret := XGtkNativeGetRenderer(x.GoPointer())
1986
1987 if cret == 0 {
1988 return nil
1989 }
1990 gobject.IncreaseRef(cret)
1991 cls = &gsk.Renderer{}
1992 cls.Ptr = cret
1993 return cls
1994}
1995
1996// Returns the surface of this `GtkNative`.
1997func (x *Window) GetSurface() *gdk.Surface {
1998 var cls *gdk.Surface
1999
2000 cret := XGtkNativeGetSurface(x.GoPointer())
2001
2002 if cret == 0 {
2003 return nil
2004 }
2005 gobject.IncreaseRef(cret)
2006 cls = &gdk.Surface{}
2007 cls.Ptr = cret
2008 return cls
2009}
2010
2011// Retrieves the surface transform of @self.
2012//
2013// This is the translation from @self's surface coordinates into
2014// @self's widget coordinates.
2015func (x *Window) GetSurfaceTransform(XVar *float64, YVar *float64) {
2016
2017 XGtkNativeGetSurfaceTransform(x.GoPointer(), XVar, YVar)
2018
2019}
2020
2021// Realizes a `GtkNative`.
2022//
2023// This should only be used by subclasses.
2024func (x *Window) Realize() {
2025
2026 XGtkNativeRealize(x.GoPointer())
2027
2028}
2029
2030// Unrealizes a `GtkNative`.
2031//
2032// This should only be used by subclasses.
2033func (x *Window) Unrealize() {
2034
2035 XGtkNativeUnrealize(x.GoPointer())
2036
2037}
2038
2039// Returns the display that this `GtkRoot` is on.
2040func (x *Window) GetDisplay() *gdk.Display {
2041 var cls *gdk.Display
2042
2043 cret := XGtkRootGetDisplay(x.GoPointer())
2044
2045 if cret == 0 {
2046 return nil
2047 }
2048 gobject.IncreaseRef(cret)
2049 cls = &gdk.Display{}
2050 cls.Ptr = cret
2051 return cls
2052}
2053
2054var xWindowGetDefaultIconName func() string
2055
2056// Returns the fallback icon name for windows.
2057//
2058// The returned string is owned by GTK and should not
2059// be modified. It is only valid until the next call to
2060// [func@Gtk.Window.set_default_icon_name].
2061func WindowGetDefaultIconName() string {
2062
2063 cret := xWindowGetDefaultIconName()
2064 return cret
2065}
2066
2067var xWindowGetToplevels func() uintptr
2068
2069// Returns the list of all existing toplevel windows.
2070//
2071// If you want to iterate through the list and perform actions involving
2072// callbacks that might destroy the widgets or add new ones, be aware that
2073// the list of toplevels will change and emit the "items-changed" signal.
2074func WindowGetToplevels() *gio.ListModelBase {
2075 var cls *gio.ListModelBase
2076
2077 cret := xWindowGetToplevels()
2078
2079 if cret == 0 {
2080 return nil
2081 }
2082 gobject.IncreaseRef(cret)
2083 cls = &gio.ListModelBase{}
2084 cls.Ptr = cret
2085 return cls
2086}
2087
2088var xWindowListToplevels func() *glib.List
2089
2090// Returns the list of all existing toplevel windows.
2091//
2092// The widgets in the list are not individually referenced.
2093// If you want to iterate through the list and perform actions
2094// involving callbacks that might destroy the widgets, you must
2095// call `g_list_foreach (result, (GFunc)g_object_ref, NULL)` first,
2096// and then unref all the widgets afterwards.
2097func WindowListToplevels() *glib.List {
2098
2099 cret := xWindowListToplevels()
2100 return cret
2101}
2102
2103var xWindowSetAutoStartupNotification func(bool)
2104
2105// Sets whether the window should request startup notification.
2106//
2107// By default, after showing the first window, GTK calls
2108// [method@Gdk.Toplevel.set_startup_id]. Call this function
2109// to disable the automatic startup notification. You might do this
2110// if your first window is a splash screen, and you want to delay
2111// notification until after your real main window has been shown,
2112// for example.
2113//
2114// In that example, you would disable startup notification
2115// temporarily, show your splash screen, then re-enable it so that
2116// showing the main window would automatically result in notification.
2117func WindowSetAutoStartupNotification(SettingVar bool) {
2118
2119 xWindowSetAutoStartupNotification(SettingVar)
2120
2121}
2122
2123var xWindowSetDefaultIconName func(string)
2124
2125// Sets an icon to be used as fallback.
2126//
2127// The fallback icon is used for windows that
2128// haven't had [method@Gtk.Window.set_icon_name]
2129// called on them.
2130func WindowSetDefaultIconName(NameVar string) {
2131
2132 xWindowSetDefaultIconName(NameVar)
2133
2134}
2135
2136var xWindowSetInteractiveDebugging func(bool)
2137
2138// Opens or closes the [interactive debugger](running.html#interactive-debugging).
2139//
2140// The debugger offers access to the widget hierarchy of the application
2141// and to useful debugging tools.
2142//
2143// This function allows applications that already use
2144// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd>
2145// (or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd>)
2146// for their own key shortcuts to add a different shortcut to open the Inspector.
2147//
2148// If you are not overriding the default key shortcuts for the Inspector,
2149// you should not use this function.
2150func WindowSetInteractiveDebugging(EnableVar bool) {
2151
2152 xWindowSetInteractiveDebugging(EnableVar)
2153
2154}
2155
2156func init() {
2157 core.SetPackageName("GTK", "gtk4")
2158 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
2159 var libs []uintptr
2160 for _, libPath := range core.GetPaths("GTK") {
2161 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
2162 if err != nil {
2163 panic(err)
2164 }
2165 libs = append(libs, lib)
2166 }
2167
2168 core.PuregoSafeRegister(&xWindowGravityGLibType, libs, "gtk_window_gravity_get_type")
2169
2170 core.PuregoSafeRegister(&xWindowGLibType, libs, "gtk_window_get_type")
2171
2172 core.PuregoSafeRegister(&xNewWindow, libs, "gtk_window_new")
2173
2174 core.PuregoSafeRegister(&xWindowClose, libs, "gtk_window_close")
2175 core.PuregoSafeRegister(&xWindowDestroy, libs, "gtk_window_destroy")
2176 core.PuregoSafeRegister(&xWindowFullscreen, libs, "gtk_window_fullscreen")
2177 core.PuregoSafeRegister(&xWindowFullscreenOnMonitor, libs, "gtk_window_fullscreen_on_monitor")
2178 core.PuregoSafeRegister(&xWindowGetApplication, libs, "gtk_window_get_application")
2179 core.PuregoSafeRegister(&xWindowGetChild, libs, "gtk_window_get_child")
2180 core.PuregoSafeRegister(&xWindowGetDecorated, libs, "gtk_window_get_decorated")
2181 core.PuregoSafeRegister(&xWindowGetDefaultSize, libs, "gtk_window_get_default_size")
2182 core.PuregoSafeRegister(&xWindowGetDefaultWidget, libs, "gtk_window_get_default_widget")
2183 core.PuregoSafeRegister(&xWindowGetDeletable, libs, "gtk_window_get_deletable")
2184 core.PuregoSafeRegister(&xWindowGetDestroyWithParent, libs, "gtk_window_get_destroy_with_parent")
2185 core.PuregoSafeRegister(&xWindowGetFocus, libs, "gtk_window_get_focus")
2186 core.PuregoSafeRegister(&xWindowGetFocusVisible, libs, "gtk_window_get_focus_visible")
2187 core.PuregoSafeRegister(&xWindowGetGravity, libs, "gtk_window_get_gravity")
2188 core.PuregoSafeRegister(&xWindowGetGroup, libs, "gtk_window_get_group")
2189 core.PuregoSafeRegister(&xWindowGetHandleMenubarAccel, libs, "gtk_window_get_handle_menubar_accel")
2190 core.PuregoSafeRegister(&xWindowGetHideOnClose, libs, "gtk_window_get_hide_on_close")
2191 core.PuregoSafeRegister(&xWindowGetIconName, libs, "gtk_window_get_icon_name")
2192 core.PuregoSafeRegister(&xWindowGetMnemonicsVisible, libs, "gtk_window_get_mnemonics_visible")
2193 core.PuregoSafeRegister(&xWindowGetModal, libs, "gtk_window_get_modal")
2194 core.PuregoSafeRegister(&xWindowGetResizable, libs, "gtk_window_get_resizable")
2195 core.PuregoSafeRegister(&xWindowGetTitle, libs, "gtk_window_get_title")
2196 core.PuregoSafeRegister(&xWindowGetTitlebar, libs, "gtk_window_get_titlebar")
2197 core.PuregoSafeRegister(&xWindowGetTransientFor, libs, "gtk_window_get_transient_for")
2198 core.PuregoSafeRegister(&xWindowHasGroup, libs, "gtk_window_has_group")
2199 core.PuregoSafeRegister(&xWindowIsActive, libs, "gtk_window_is_active")
2200 core.PuregoSafeRegister(&xWindowIsFullscreen, libs, "gtk_window_is_fullscreen")
2201 core.PuregoSafeRegister(&xWindowIsMaximized, libs, "gtk_window_is_maximized")
2202 core.PuregoSafeRegister(&xWindowIsSuspended, libs, "gtk_window_is_suspended")
2203 core.PuregoSafeRegister(&xWindowMaximize, libs, "gtk_window_maximize")
2204 core.PuregoSafeRegister(&xWindowMinimize, libs, "gtk_window_minimize")
2205 core.PuregoSafeRegister(&xWindowPresent, libs, "gtk_window_present")
2206 core.PuregoSafeRegister(&xWindowPresentWithTime, libs, "gtk_window_present_with_time")
2207 core.PuregoSafeRegister(&xWindowSetApplication, libs, "gtk_window_set_application")
2208 core.PuregoSafeRegister(&xWindowSetChild, libs, "gtk_window_set_child")
2209 core.PuregoSafeRegister(&xWindowSetDecorated, libs, "gtk_window_set_decorated")
2210 core.PuregoSafeRegister(&xWindowSetDefaultSize, libs, "gtk_window_set_default_size")
2211 core.PuregoSafeRegister(&xWindowSetDefaultWidget, libs, "gtk_window_set_default_widget")
2212 core.PuregoSafeRegister(&xWindowSetDeletable, libs, "gtk_window_set_deletable")
2213 core.PuregoSafeRegister(&xWindowSetDestroyWithParent, libs, "gtk_window_set_destroy_with_parent")
2214 core.PuregoSafeRegister(&xWindowSetDisplay, libs, "gtk_window_set_display")
2215 core.PuregoSafeRegister(&xWindowSetFocus, libs, "gtk_window_set_focus")
2216 core.PuregoSafeRegister(&xWindowSetFocusVisible, libs, "gtk_window_set_focus_visible")
2217 core.PuregoSafeRegister(&xWindowSetGravity, libs, "gtk_window_set_gravity")
2218 core.PuregoSafeRegister(&xWindowSetHandleMenubarAccel, libs, "gtk_window_set_handle_menubar_accel")
2219 core.PuregoSafeRegister(&xWindowSetHideOnClose, libs, "gtk_window_set_hide_on_close")
2220 core.PuregoSafeRegister(&xWindowSetIconName, libs, "gtk_window_set_icon_name")
2221 core.PuregoSafeRegister(&xWindowSetMnemonicsVisible, libs, "gtk_window_set_mnemonics_visible")
2222 core.PuregoSafeRegister(&xWindowSetModal, libs, "gtk_window_set_modal")
2223 core.PuregoSafeRegister(&xWindowSetResizable, libs, "gtk_window_set_resizable")
2224 core.PuregoSafeRegister(&xWindowSetStartupId, libs, "gtk_window_set_startup_id")
2225 core.PuregoSafeRegister(&xWindowSetTitle, libs, "gtk_window_set_title")
2226 core.PuregoSafeRegister(&xWindowSetTitlebar, libs, "gtk_window_set_titlebar")
2227 core.PuregoSafeRegister(&xWindowSetTransientFor, libs, "gtk_window_set_transient_for")
2228 core.PuregoSafeRegister(&xWindowUnfullscreen, libs, "gtk_window_unfullscreen")
2229 core.PuregoSafeRegister(&xWindowUnmaximize, libs, "gtk_window_unmaximize")
2230 core.PuregoSafeRegister(&xWindowUnminimize, libs, "gtk_window_unminimize")
2231
2232 core.PuregoSafeRegister(&xWindowGetDefaultIconName, libs, "gtk_window_get_default_icon_name")
2233 core.PuregoSafeRegister(&xWindowGetToplevels, libs, "gtk_window_get_toplevels")
2234 core.PuregoSafeRegister(&xWindowListToplevels, libs, "gtk_window_list_toplevels")
2235 core.PuregoSafeRegister(&xWindowSetAutoStartupNotification, libs, "gtk_window_set_auto_startup_notification")
2236 core.PuregoSafeRegister(&xWindowSetDefaultIconName, libs, "gtk_window_set_default_icon_name")
2237 core.PuregoSafeRegister(&xWindowSetInteractiveDebugging, libs, "gtk_window_set_interactive_debugging")
2238
2239}