1// Package adw was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package adw
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/glib"
12 "github.com/bnema/puregotk/v4/gobject"
13 "github.com/bnema/puregotk/v4/gobject/types"
14 "github.com/bnema/puregotk/v4/gtk"
15)
16
17type DialogClass struct {
18 _ structs.HostLayout
19
20 ParentClass gtk.WidgetClass
21
22 xCloseAttempt uintptr
23
24 xClosed uintptr
25
26 Padding [4]uintptr
27}
28
29func (x *DialogClass) GoPointer() uintptr {
30 return uintptr(unsafe.Pointer(x))
31}
32
33// OverrideCloseAttempt sets the "close_attempt" callback function.
34func (x *DialogClass) OverrideCloseAttempt(cb func(*Dialog)) {
35 if cb == nil {
36 x.xCloseAttempt = 0
37 } else {
38 x.xCloseAttempt = purego.NewCallback(func(DialogVarp uintptr) {
39 cb(DialogNewFromInternalPtr(DialogVarp))
40 })
41 }
42}
43
44// GetCloseAttempt gets the "close_attempt" callback function.
45func (x *DialogClass) GetCloseAttempt() func(*Dialog) {
46 if x.xCloseAttempt == 0 {
47 return nil
48 }
49 var rawCallback func(DialogVarp uintptr)
50 purego.RegisterFunc(&rawCallback, x.xCloseAttempt)
51 return func(DialogVar *Dialog) {
52 rawCallback(DialogVar.GoPointer())
53 }
54}
55
56// OverrideClosed sets the "closed" callback function.
57func (x *DialogClass) OverrideClosed(cb func(*Dialog)) {
58 if cb == nil {
59 x.xClosed = 0
60 } else {
61 x.xClosed = purego.NewCallback(func(DialogVarp uintptr) {
62 cb(DialogNewFromInternalPtr(DialogVarp))
63 })
64 }
65}
66
67// GetClosed gets the "closed" callback function.
68func (x *DialogClass) GetClosed() func(*Dialog) {
69 if x.xClosed == 0 {
70 return nil
71 }
72 var rawCallback func(DialogVarp uintptr)
73 purego.RegisterFunc(&rawCallback, x.xClosed)
74 return func(DialogVar *Dialog) {
75 rawCallback(DialogVar.GoPointer())
76 }
77}
78
79// Describes the available presentation modes for [class@Dialog].
80//
81// New values may be added to this enumeration over time.
82//
83// See [property@Dialog:presentation-mode].
84type DialogPresentationMode int
85
86var xDialogPresentationModeGLibType func() types.GType
87
88func DialogPresentationModeGLibType() types.GType {
89 return xDialogPresentationModeGLibType()
90}
91
92const (
93
94 // Switch between `ADW_DIALOG_FLOATING` and
95 // `ADW_DIALOG_BOTTOM_SHEET` depending on available size.
96 DialogAutoValue DialogPresentationMode = 0
97 // Present dialog as a centered floating window.
98 DialogFloatingValue DialogPresentationMode = 1
99 // Present dialog as a bottom sheet.
100 DialogBottomSheetValue DialogPresentationMode = 2
101)
102
103// An adaptive dialog container.
104//
105// <picture>
106//
107// <source srcset="dialog-floating-dark.png" media="(prefers-color-scheme: dark)">
108// <img src="dialog-floating.png" alt="dialog-floating">
109//
110// </picture>
111// <picture>
112//
113// <source srcset="dialog-bottom-dark.png" media="(prefers-color-scheme: dark)">
114// <img src="dialog-bottom.png" alt="dialog-bottom">
115//
116// </picture>
117//
118// `AdwDialog` is similar to a window, but is shown within another window. It
119// can be used with [class@Window] and [class@ApplicationWindow], use
120// [method@Dialog.present] to show it.
121//
122// `AdwDialog` is not resizable. Use the [property@Dialog:content-width] and
123// [property@Dialog:content-height] properties to set its size, or set
124// [property@Dialog:follows-content-size] to `TRUE` to make the dialog track the
125// content's size as it changes. `AdwDialog` can never be larger than its parent
126// window.
127//
128// `AdwDialog` can be presented as a centered floating window or a bottom sheet.
129// By default it's automatic depending on the available size.
130// [property@Dialog:presentation-mode] can be used to change that.
131//
132// `AdwDialog` can be closed via [method@Dialog.close].
133//
134// When presented as a bottom sheet, `AdwDialog` can also be closed via swiping
135// it down.
136//
137// The [property@Dialog:can-close] can be used to prevent closing. In that case,
138// [signal@Dialog::close-attempt] gets emitted instead.
139//
140// Use [method@Dialog.force_close] to close the dialog even when `can-close` is set to
141// `FALSE`.
142//
143// `AdwDialog` is transient and doesn't integrate with the window below it, for
144// example it's not possible to collapse it into a bottom bar. See
145// [class@BottomSheet] for persistent and more tightly integrated bottom sheets.
146//
147// ## Header Bar Integration
148//
149// When placed inside an `AdwDialog`, [class@HeaderBar] will display the dialog
150// title instead of window title. It will also adjust the decoration layout to
151// ensure it always has a close button and nothing else. Set
152// [property@HeaderBar:show-start-title-buttons] and
153// [property@HeaderBar:show-end-title-buttons] to `FALSE` to remove it if it's
154// unwanted.
155//
156// ## Breakpoints
157//
158// `AdwDialog` can be used with [class@Breakpoint] the same way as
159// [class@BreakpointBin]. Refer to that widget's documentation for details.
160//
161// Like `AdwBreakpointBin`, if breakpoints are used, `AdwDialog` doesn't have a
162// minimum size, and [property@Gtk.Widget:width-request] and
163// [property@Gtk.Widget:height-request] properties must be set manually.
164type Dialog struct {
165 gtk.Widget
166}
167
168var xDialogGLibType func() types.GType
169
170func DialogGLibType() types.GType {
171 return xDialogGLibType()
172}
173
174func DialogNewFromInternalPtr(ptr uintptr) *Dialog {
175 cls := &Dialog{}
176 cls.Ptr = ptr
177 return cls
178}
179
180var xNewDialog func() uintptr
181
182// Creates a new `AdwDialog`.
183func NewDialog() *Dialog {
184 var cls *Dialog
185
186 cret := xNewDialog()
187
188 if cret == 0 {
189 return nil
190 }
191 gobject.IncreaseRef(cret)
192 cls = &Dialog{}
193 cls.Ptr = cret
194 return cls
195}
196
197var xDialogAddBreakpoint func(uintptr, uintptr)
198
199// Adds @breakpoint to @self.
200func (x *Dialog) AddBreakpoint(BreakpointVar *Breakpoint) {
201
202 xDialogAddBreakpoint(x.GoPointer(), BreakpointVar.GoPointer())
203
204}
205
206var xDialogClose func(uintptr) bool
207
208// Attempts to close @self.
209//
210// If the [property@Dialog:can-close] property is set to `FALSE`, the
211// [signal@Dialog::close-attempt] signal is emitted.
212//
213// See also: [method@Dialog.force_close].
214func (x *Dialog) Close() bool {
215
216 cret := xDialogClose(x.GoPointer())
217 return cret
218}
219
220var xDialogForceClose func(uintptr)
221
222// Closes @self.
223//
224// Unlike [method@Dialog.close], it succeeds even if [property@Dialog:can-close]
225// is set to `FALSE`.
226func (x *Dialog) ForceClose() {
227
228 xDialogForceClose(x.GoPointer())
229
230}
231
232var xDialogGetCanClose func(uintptr) bool
233
234// Gets whether @self can be closed.
235func (x *Dialog) GetCanClose() bool {
236
237 cret := xDialogGetCanClose(x.GoPointer())
238 return cret
239}
240
241var xDialogGetChild func(uintptr) uintptr
242
243// Gets the child widget of @self.
244func (x *Dialog) GetChild() *gtk.Widget {
245 var cls *gtk.Widget
246
247 cret := xDialogGetChild(x.GoPointer())
248
249 if cret == 0 {
250 return nil
251 }
252 gobject.IncreaseRef(cret)
253 cls = >k.Widget{}
254 cls.Ptr = cret
255 return cls
256}
257
258var xDialogGetContentHeight func(uintptr) int
259
260// Gets the height of the dialog's contents.
261func (x *Dialog) GetContentHeight() int {
262
263 cret := xDialogGetContentHeight(x.GoPointer())
264 return cret
265}
266
267var xDialogGetContentWidth func(uintptr) int
268
269// Gets the width of the dialog's contents.
270func (x *Dialog) GetContentWidth() int {
271
272 cret := xDialogGetContentWidth(x.GoPointer())
273 return cret
274}
275
276var xDialogGetCurrentBreakpoint func(uintptr) uintptr
277
278// Gets the current breakpoint.
279func (x *Dialog) GetCurrentBreakpoint() *Breakpoint {
280 var cls *Breakpoint
281
282 cret := xDialogGetCurrentBreakpoint(x.GoPointer())
283
284 if cret == 0 {
285 return nil
286 }
287 gobject.IncreaseRef(cret)
288 cls = &Breakpoint{}
289 cls.Ptr = cret
290 return cls
291}
292
293var xDialogGetDefaultWidget func(uintptr) uintptr
294
295// Gets the default widget for @self.
296func (x *Dialog) GetDefaultWidget() *gtk.Widget {
297 var cls *gtk.Widget
298
299 cret := xDialogGetDefaultWidget(x.GoPointer())
300
301 if cret == 0 {
302 return nil
303 }
304 gobject.IncreaseRef(cret)
305 cls = >k.Widget{}
306 cls.Ptr = cret
307 return cls
308}
309
310var xDialogGetFocus func(uintptr) uintptr
311
312// Gets the focus widget for @self.
313func (x *Dialog) GetFocus() *gtk.Widget {
314 var cls *gtk.Widget
315
316 cret := xDialogGetFocus(x.GoPointer())
317
318 if cret == 0 {
319 return nil
320 }
321 gobject.IncreaseRef(cret)
322 cls = >k.Widget{}
323 cls.Ptr = cret
324 return cls
325}
326
327var xDialogGetFollowsContentSize func(uintptr) bool
328
329// Gets whether to size content of @self automatically.
330func (x *Dialog) GetFollowsContentSize() bool {
331
332 cret := xDialogGetFollowsContentSize(x.GoPointer())
333 return cret
334}
335
336var xDialogGetPresentationMode func(uintptr) DialogPresentationMode
337
338// Gets presentation mode for @self.
339func (x *Dialog) GetPresentationMode() DialogPresentationMode {
340
341 cret := xDialogGetPresentationMode(x.GoPointer())
342 return cret
343}
344
345var xDialogGetTitle func(uintptr) string
346
347// Gets the title of @self.
348func (x *Dialog) GetTitle() string {
349
350 cret := xDialogGetTitle(x.GoPointer())
351 return cret
352}
353
354var xDialogPresent func(uintptr, uintptr)
355
356// Presents @self within @parent's window.
357//
358// If @self is already shown, raises it to the top instead.
359//
360// If the window is an [class@Window] or [class@ApplicationWindow], the dialog
361// will be shown within it. Otherwise, it will be a separate window.
362func (x *Dialog) Present(ParentVar *gtk.Widget) {
363
364 xDialogPresent(x.GoPointer(), ParentVar.GoPointer())
365
366}
367
368var xDialogSetCanClose func(uintptr, bool)
369
370// Sets whether @self can be closed.
371//
372// If set to `FALSE`, the close button, shortcuts and
373// [method@Dialog.close] will result in [signal@Dialog::close-attempt] being
374// emitted instead, and bottom sheet close swipe will be disabled.
375// [method@Dialog.force_close] still works.
376func (x *Dialog) SetCanClose(CanCloseVar bool) {
377
378 xDialogSetCanClose(x.GoPointer(), CanCloseVar)
379
380}
381
382var xDialogSetChild func(uintptr, uintptr)
383
384// Sets the child widget of @self.
385func (x *Dialog) SetChild(ChildVar *gtk.Widget) {
386
387 xDialogSetChild(x.GoPointer(), ChildVar.GoPointer())
388
389}
390
391var xDialogSetContentHeight func(uintptr, int)
392
393// Sets the height of the dialog's contents.
394//
395// Set it to -1 to reset it to the content's natural height.
396//
397// See also: [property@Gtk.Window:default-height]
398func (x *Dialog) SetContentHeight(ContentHeightVar int) {
399
400 xDialogSetContentHeight(x.GoPointer(), ContentHeightVar)
401
402}
403
404var xDialogSetContentWidth func(uintptr, int)
405
406// Sets the width of the dialog's contents.
407//
408// Set it to -1 to reset it to the content's natural width.
409//
410// See also: [property@Gtk.Window:default-width]
411func (x *Dialog) SetContentWidth(ContentWidthVar int) {
412
413 xDialogSetContentWidth(x.GoPointer(), ContentWidthVar)
414
415}
416
417var xDialogSetDefaultWidget func(uintptr, uintptr)
418
419// Sets the default widget for @self.
420//
421// It's activated when the user presses Enter.
422func (x *Dialog) SetDefaultWidget(DefaultWidgetVar *gtk.Widget) {
423
424 xDialogSetDefaultWidget(x.GoPointer(), DefaultWidgetVar.GoPointer())
425
426}
427
428var xDialogSetFocus func(uintptr, uintptr)
429
430// Sets the focus widget for @self.
431//
432// If @focus is not the current focus widget, and is focusable, sets it as the
433// focus widget for the dialog.
434//
435// If focus is `NULL`, unsets the focus widget for this dialog. To set the focus
436// to a particular widget in the dialog, it is usually more convenient to use
437// [method@Gtk.Widget.grab_focus] instead of this function.
438func (x *Dialog) SetFocus(FocusVar *gtk.Widget) {
439
440 xDialogSetFocus(x.GoPointer(), FocusVar.GoPointer())
441
442}
443
444var xDialogSetFollowsContentSize func(uintptr, bool)
445
446// Sets whether to size content of @self automatically.
447//
448// If set to `TRUE`, always use the content's natural size instead of
449// [property@Dialog:content-width] and [property@Dialog:content-height]. If
450// the content resizes, the dialog will immediately resize as well.
451//
452// See also: [property@Gtk.Window:resizable]
453func (x *Dialog) SetFollowsContentSize(FollowsContentSizeVar bool) {
454
455 xDialogSetFollowsContentSize(x.GoPointer(), FollowsContentSizeVar)
456
457}
458
459var xDialogSetPresentationMode func(uintptr, DialogPresentationMode)
460
461// Sets presentation mode for @self.
462//
463// When set to `ADW_DIALOG_AUTO`, the dialog appears as a bottom sheet when the
464// following condition is met: `max-width: 450px or max-height: 360px`, and as a
465// floating window otherwise.
466//
467// Set it to `ADW_DIALOG_FLOATING` or `ADW_DIALOG_BOTTOM_SHEET` to always
468// present it a floating window or a bottom sheet respectively, regardless of
469// available size.
470//
471// Presentation mode does nothing for dialogs presented as a window.
472func (x *Dialog) SetPresentationMode(PresentationModeVar DialogPresentationMode) {
473
474 xDialogSetPresentationMode(x.GoPointer(), PresentationModeVar)
475
476}
477
478var xDialogSetTitle func(uintptr, string)
479
480// Sets the title of @self.
481func (x *Dialog) SetTitle(TitleVar string) {
482
483 xDialogSetTitle(x.GoPointer(), TitleVar)
484
485}
486
487func (c *Dialog) GoPointer() uintptr {
488 if c == nil {
489 return 0
490 }
491 return c.Ptr
492}
493
494func (c *Dialog) SetGoPointer(ptr uintptr) {
495 c.Ptr = ptr
496}
497
498// SetPropertyCanClose sets the "can-close" property.
499// Whether the dialog can be closed.
500//
501// If set to `FALSE`, the close button, shortcuts and
502// [method@Dialog.close] will result in [signal@Dialog::close-attempt] being
503// emitted instead, and bottom sheet close swipe will be disabled.
504// [method@Dialog.force_close] still works.
505func (x *Dialog) SetPropertyCanClose(value bool) {
506 var v gobject.Value
507 v.Init(gobject.TypeBooleanVal)
508 v.SetBoolean(value)
509 x.SetProperty("can-close", &v)
510}
511
512// GetPropertyCanClose gets the "can-close" property.
513// Whether the dialog can be closed.
514//
515// If set to `FALSE`, the close button, shortcuts and
516// [method@Dialog.close] will result in [signal@Dialog::close-attempt] being
517// emitted instead, and bottom sheet close swipe will be disabled.
518// [method@Dialog.force_close] still works.
519func (x *Dialog) GetPropertyCanClose() bool {
520 var v gobject.Value
521 x.GetProperty("can-close", &v)
522 return v.GetBoolean()
523}
524
525// SetPropertyContentHeight sets the "content-height" property.
526// The height of the dialog's contents.
527//
528// Set it to -1 to reset it to the content's natural height.
529//
530// See also: [property@Gtk.Window:default-height]
531func (x *Dialog) SetPropertyContentHeight(value int) {
532 var v gobject.Value
533 v.Init(gobject.TypeIntVal)
534 v.SetInt(value)
535 x.SetProperty("content-height", &v)
536}
537
538// GetPropertyContentHeight gets the "content-height" property.
539// The height of the dialog's contents.
540//
541// Set it to -1 to reset it to the content's natural height.
542//
543// See also: [property@Gtk.Window:default-height]
544func (x *Dialog) GetPropertyContentHeight() int {
545 var v gobject.Value
546 x.GetProperty("content-height", &v)
547 return v.GetInt()
548}
549
550// SetPropertyContentWidth sets the "content-width" property.
551// The width of the dialog's contents.
552//
553// Set it to -1 to reset it to the content's natural width.
554//
555// See also: [property@Gtk.Window:default-width]
556func (x *Dialog) SetPropertyContentWidth(value int) {
557 var v gobject.Value
558 v.Init(gobject.TypeIntVal)
559 v.SetInt(value)
560 x.SetProperty("content-width", &v)
561}
562
563// GetPropertyContentWidth gets the "content-width" property.
564// The width of the dialog's contents.
565//
566// Set it to -1 to reset it to the content's natural width.
567//
568// See also: [property@Gtk.Window:default-width]
569func (x *Dialog) GetPropertyContentWidth() int {
570 var v gobject.Value
571 x.GetProperty("content-width", &v)
572 return v.GetInt()
573}
574
575// SetPropertyFollowsContentSize sets the "follows-content-size" property.
576// Whether to size content automatically.
577//
578// If set to `TRUE`, always use the content's natural size instead of
579// [property@Dialog:content-width] and [property@Dialog:content-height]. If
580// the content resizes, the dialog will immediately resize as well.
581//
582// See also: [property@Gtk.Window:resizable]
583func (x *Dialog) SetPropertyFollowsContentSize(value bool) {
584 var v gobject.Value
585 v.Init(gobject.TypeBooleanVal)
586 v.SetBoolean(value)
587 x.SetProperty("follows-content-size", &v)
588}
589
590// GetPropertyFollowsContentSize gets the "follows-content-size" property.
591// Whether to size content automatically.
592//
593// If set to `TRUE`, always use the content's natural size instead of
594// [property@Dialog:content-width] and [property@Dialog:content-height]. If
595// the content resizes, the dialog will immediately resize as well.
596//
597// See also: [property@Gtk.Window:resizable]
598func (x *Dialog) GetPropertyFollowsContentSize() bool {
599 var v gobject.Value
600 x.GetProperty("follows-content-size", &v)
601 return v.GetBoolean()
602}
603
604// SetPropertyTitle sets the "title" property.
605// The title of the dialog.
606func (x *Dialog) SetPropertyTitle(value string) {
607 var v gobject.Value
608 v.Init(gobject.TypeStringVal)
609 v.SetString(&value)
610 x.SetProperty("title", &v)
611}
612
613// GetPropertyTitle gets the "title" property.
614// The title of the dialog.
615func (x *Dialog) GetPropertyTitle() string {
616 var v gobject.Value
617 x.GetProperty("title", &v)
618 return v.GetString()
619}
620
621// Emitted when the close button or shortcut is used, or
622// [method@Dialog.close] is called while [property@Dialog:can-close] is set to
623// `FALSE`.
624func (x *Dialog) ConnectCloseAttempt(cb *func(Dialog)) uint {
625 cbPtr := uintptr(unsafe.Pointer(cb))
626 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
627 handlerID := gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)
628 glib.SaveHandlerMapping(handlerID, cbPtr)
629 return handlerID
630 }
631
632 fcb := func(clsPtr uintptr) {
633 fa := Dialog{}
634 fa.Ptr = clsPtr
635 cbFn := *cb
636
637 cbFn(fa)
638
639 }
640 cbRefPtr := purego.NewCallback(fcb)
641 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
642 handlerID := gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)
643 glib.SaveHandlerMapping(handlerID, cbPtr)
644 return handlerID
645}
646
647// Emitted when the dialog is successfully closed.
648func (x *Dialog) ConnectClosed(cb *func(Dialog)) uint {
649 cbPtr := uintptr(unsafe.Pointer(cb))
650 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
651 handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
652 glib.SaveHandlerMapping(handlerID, cbPtr)
653 return handlerID
654 }
655
656 fcb := func(clsPtr uintptr) {
657 fa := Dialog{}
658 fa.Ptr = clsPtr
659 cbFn := *cb
660
661 cbFn(fa)
662
663 }
664 cbRefPtr := purego.NewCallback(fcb)
665 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
666 handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
667 glib.SaveHandlerMapping(handlerID, cbPtr)
668 return handlerID
669}
670
671// Requests the user's screen reader to announce the given message.
672//
673// This kind of notification is useful for messages that
674// either have only a visual representation or that are not
675// exposed visually at all, e.g. a notification about a
676// successful operation.
677//
678// Also, by using this API, you can ensure that the message
679// does not interrupts the user's current screen reader output.
680func (x *Dialog) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
681
682 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
683
684}
685
686// Retrieves the accessible parent for an accessible object.
687//
688// This function returns `NULL` for top level widgets.
689func (x *Dialog) GetAccessibleParent() *gtk.AccessibleBase {
690 var cls *gtk.AccessibleBase
691
692 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
693
694 if cret == 0 {
695 return nil
696 }
697 cls = >k.AccessibleBase{}
698 cls.Ptr = cret
699 return cls
700}
701
702// Retrieves the accessible role of an accessible object.
703func (x *Dialog) GetAccessibleRole() gtk.AccessibleRole {
704
705 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
706 return cret
707}
708
709// Retrieves the implementation for the given accessible object.
710func (x *Dialog) GetAtContext() *gtk.ATContext {
711 var cls *gtk.ATContext
712
713 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
714
715 if cret == 0 {
716 return nil
717 }
718 cls = >k.ATContext{}
719 cls.Ptr = cret
720 return cls
721}
722
723// Queries the coordinates and dimensions of this accessible
724//
725// This functionality can be overridden by `GtkAccessible`
726// implementations, e.g. to get the bounds from an ignored
727// child widget.
728func (x *Dialog) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
729
730 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
731 return cret
732}
733
734// Retrieves the first accessible child of an accessible object.
735func (x *Dialog) GetFirstAccessibleChild() *gtk.AccessibleBase {
736 var cls *gtk.AccessibleBase
737
738 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
739
740 if cret == 0 {
741 return nil
742 }
743 cls = >k.AccessibleBase{}
744 cls.Ptr = cret
745 return cls
746}
747
748// Retrieves the next accessible sibling of an accessible object
749func (x *Dialog) GetNextAccessibleSibling() *gtk.AccessibleBase {
750 var cls *gtk.AccessibleBase
751
752 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
753
754 if cret == 0 {
755 return nil
756 }
757 cls = >k.AccessibleBase{}
758 cls.Ptr = cret
759 return cls
760}
761
762// Queries a platform state, such as focus.
763//
764// This functionality can be overridden by `GtkAccessible`
765// implementations, e.g. to get platform state from an ignored
766// child widget, as is the case for `GtkText` wrappers.
767func (x *Dialog) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
768
769 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
770 return cret
771}
772
773// Resets the accessible property to its default value.
774func (x *Dialog) ResetProperty(PropertyVar gtk.AccessibleProperty) {
775
776 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
777
778}
779
780// Resets the accessible relation to its default value.
781func (x *Dialog) ResetRelation(RelationVar gtk.AccessibleRelation) {
782
783 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
784
785}
786
787// Resets the accessible state to its default value.
788func (x *Dialog) ResetState(StateVar gtk.AccessibleState) {
789
790 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
791
792}
793
794// Sets the parent and sibling of an accessible object.
795//
796// This function is meant to be used by accessible implementations that are
797// not part of the widget hierarchy, and but act as a logical bridge between
798// widgets. For instance, if a widget creates an object that holds metadata
799// for each child, and you want that object to implement the `GtkAccessible`
800// interface, you will use this function to ensure that the parent of each
801// child widget is the metadata object, and the parent of each metadata
802// object is the container widget.
803func (x *Dialog) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
804
805 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
806
807}
808
809// Updates the next accessible sibling.
810//
811// That might be useful when a new child of a custom accessible
812// is created, and it needs to be linked to a previous child.
813func (x *Dialog) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
814
815 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
816
817}
818
819// Informs ATs that the platform state has changed.
820//
821// This function should be used by `GtkAccessible` implementations that
822// have a platform state but are not widgets. Widgets handle platform
823// states automatically.
824func (x *Dialog) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
825
826 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
827
828}
829
830// Updates a list of accessible properties.
831//
832// See the [enum@Gtk.AccessibleProperty] documentation for the
833// value types of accessible properties.
834//
835// This function should be called by `GtkWidget` types whenever
836// an accessible property change must be communicated to assistive
837// technologies.
838//
839// Example:
840// ```c
841// value = gtk_adjustment_get_value (adjustment);
842// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
843//
844// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
845// -1);
846//
847// ```
848func (x *Dialog) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
849
850 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
851
852}
853
854// Updates an array of accessible properties.
855//
856// This function should be called by `GtkWidget` types whenever an accessible
857// property change must be communicated to assistive technologies.
858//
859// This function is meant to be used by language bindings.
860func (x *Dialog) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
861
862 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
863
864}
865
866// Updates a list of accessible relations.
867//
868// This function should be called by `GtkWidget` types whenever an accessible
869// relation change must be communicated to assistive technologies.
870//
871// If the [enum@Gtk.AccessibleRelation] requires a list of references,
872// you should pass each reference individually, followed by `NULL`, e.g.
873//
874// ```c
875// gtk_accessible_update_relation (accessible,
876//
877// GTK_ACCESSIBLE_RELATION_CONTROLS,
878// ref1, NULL,
879// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
880// ref1, ref2, ref3, NULL,
881// -1);
882//
883// ```
884func (x *Dialog) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
885
886 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
887
888}
889
890// Updates an array of accessible relations.
891//
892// This function should be called by `GtkWidget` types whenever an accessible
893// relation change must be communicated to assistive technologies.
894//
895// This function is meant to be used by language bindings.
896func (x *Dialog) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
897
898 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
899
900}
901
902// Updates a list of accessible states.
903//
904// See the [enum@Gtk.AccessibleState] documentation for the
905// value types of accessible states.
906//
907// This function should be called by `GtkWidget` types whenever
908// an accessible state change must be communicated to assistive
909// technologies.
910//
911// Example:
912//
913// ```c
914// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
915// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
916//
917// GTK_ACCESSIBLE_STATE_CHECKED, value,
918// -1);
919//
920// ```
921func (x *Dialog) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
922
923 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
924
925}
926
927// Updates an array of accessible states.
928//
929// This function should be called by `GtkWidget` types whenever an accessible
930// state change must be communicated to assistive technologies.
931//
932// This function is meant to be used by language bindings.
933func (x *Dialog) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
934
935 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
936
937}
938
939// Gets the ID of the @buildable object.
940//
941// `GtkBuilder` sets the name based on the ID attribute
942// of the `<object>` tag used to construct the @buildable.
943func (x *Dialog) GetBuildableId() string {
944
945 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
946 return cret
947}
948
949func init() {
950 core.SetPackageName("ADW", "libadwaita-1")
951 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
952 var libs []uintptr
953 for _, libPath := range core.GetPaths("ADW") {
954 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
955 if err != nil {
956 panic(err)
957 }
958 libs = append(libs, lib)
959 }
960
961 core.PuregoSafeRegister(&xDialogPresentationModeGLibType, libs, "adw_dialog_presentation_mode_get_type")
962
963 core.PuregoSafeRegister(&xDialogGLibType, libs, "adw_dialog_get_type")
964
965 core.PuregoSafeRegister(&xNewDialog, libs, "adw_dialog_new")
966
967 core.PuregoSafeRegister(&xDialogAddBreakpoint, libs, "adw_dialog_add_breakpoint")
968 core.PuregoSafeRegister(&xDialogClose, libs, "adw_dialog_close")
969 core.PuregoSafeRegister(&xDialogForceClose, libs, "adw_dialog_force_close")
970 core.PuregoSafeRegister(&xDialogGetCanClose, libs, "adw_dialog_get_can_close")
971 core.PuregoSafeRegister(&xDialogGetChild, libs, "adw_dialog_get_child")
972 core.PuregoSafeRegister(&xDialogGetContentHeight, libs, "adw_dialog_get_content_height")
973 core.PuregoSafeRegister(&xDialogGetContentWidth, libs, "adw_dialog_get_content_width")
974 core.PuregoSafeRegister(&xDialogGetCurrentBreakpoint, libs, "adw_dialog_get_current_breakpoint")
975 core.PuregoSafeRegister(&xDialogGetDefaultWidget, libs, "adw_dialog_get_default_widget")
976 core.PuregoSafeRegister(&xDialogGetFocus, libs, "adw_dialog_get_focus")
977 core.PuregoSafeRegister(&xDialogGetFollowsContentSize, libs, "adw_dialog_get_follows_content_size")
978 core.PuregoSafeRegister(&xDialogGetPresentationMode, libs, "adw_dialog_get_presentation_mode")
979 core.PuregoSafeRegister(&xDialogGetTitle, libs, "adw_dialog_get_title")
980 core.PuregoSafeRegister(&xDialogPresent, libs, "adw_dialog_present")
981 core.PuregoSafeRegister(&xDialogSetCanClose, libs, "adw_dialog_set_can_close")
982 core.PuregoSafeRegister(&xDialogSetChild, libs, "adw_dialog_set_child")
983 core.PuregoSafeRegister(&xDialogSetContentHeight, libs, "adw_dialog_set_content_height")
984 core.PuregoSafeRegister(&xDialogSetContentWidth, libs, "adw_dialog_set_content_width")
985 core.PuregoSafeRegister(&xDialogSetDefaultWidget, libs, "adw_dialog_set_default_widget")
986 core.PuregoSafeRegister(&xDialogSetFocus, libs, "adw_dialog_set_focus")
987 core.PuregoSafeRegister(&xDialogSetFollowsContentSize, libs, "adw_dialog_set_follows_content_size")
988 core.PuregoSafeRegister(&xDialogSetPresentationMode, libs, "adw_dialog_set_presentation_mode")
989 core.PuregoSafeRegister(&xDialogSetTitle, libs, "adw_dialog_set_title")
990
991}