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/gdk"
12 "github.com/bnema/puregotk/v4/glib"
13 "github.com/bnema/puregotk/v4/gobject"
14 "github.com/bnema/puregotk/v4/gobject/types"
15 "github.com/bnema/puregotk/v4/gtk"
16)
17
18type BottomSheetClass struct {
19 _ structs.HostLayout
20
21 ParentClass gtk.WidgetClass
22}
23
24func (x *BottomSheetClass) GoPointer() uintptr {
25 return uintptr(unsafe.Pointer(x))
26}
27
28// A bottom sheet with an optional bottom bar.
29//
30// <picture>
31//
32// <source srcset="bottom-sheet-dark.png" media="(prefers-color-scheme: dark)">
33// <img src="bottom-sheet.png" alt="bottom-sheet">
34//
35// </picture>
36//
37// `AdwBottomSheet` has three child widgets. [property@BottomSheet:content] is
38// shown persistently. [property@BottomSheet:sheet] is displayed above it when
39// it's open, and [property@BottomSheet:bottom-bar] is displayed when it's not.
40//
41// Bottom sheet and bottom bar are attached to the bottom edge of the widget.
42// They take the full width by default, but can only take a portion of it if
43// [property@BottomSheet:full-width] is set to `FALSE`. In this case,
44// [property@BottomSheet:align] determines where along the bottom edge they are
45// placed.
46//
47// Bottom bar can be hidden using the [property@BottomSheet:reveal-bottom-bar]
48// property.
49//
50// `AdwBottomSheet` can be useful for applications such as music players, that
51// want to have a persistent bottom bar that expands into a bottom sheet when
52// clicked. It's meant for cases where a bottom sheet is tightly integrated into
53// the UI. For more transient bottom sheets, see [class@Dialog].
54//
55// To open or close the bottom sheet, use the [property@BottomSheet:open]
56// property.
57//
58// By default, the bottom sheet has an overlaid drag handle. It can be disabled
59// by setting [property@BottomSheet:show-drag-handle] to `FALSE`. Note that the
60// handle also controls whether the sheet can be dragged using a pointer.
61//
62// Bottom sheets are modal by default, meaning that the content is dimmed and
63// cannot be accessed while the sheet is open. Set [property@BottomSheet:modal]
64// to `FALSE` if this behavior is unwanted.
65//
66// To disable user interactions for opening or closing the bottom sheet (such as
67// swipes or clicking the bottom bar or close button), set
68// [property@BottomSheet:can-open] or [property@BottomSheet:can-close] to
69// `FALSE`.
70//
71// In some cases, particularly when using a full-width bottom bar, it may be
72// necessary to shift [property@BottomSheet:content] upwards. Use the
73// [property@BottomSheet:bottom-bar-height] and
74// [property@BottomSheet:sheet-height] for that.
75//
76// `AdwBottomSheet` is not adaptive, and for larger window sizes applications
77// may want to replace it with another UI, such as a sidebar. This can be done
78// using [class@MultiLayoutView].
79//
80// ## Sizing
81//
82// Unlike [class@Dialog] presented as a bottom sheet, `AdwBottomSheet` just
83// follows the content's natural size, and it's up to the applications to make
84// sure their content provides one. For example, when using
85// [class@Gtk.ScrolledWindow], make sure to set
86// [property@Gtk.ScrolledWindow:propagate-natural-height] to `TRUE`.
87//
88// ## Header Bar Integration
89//
90// When placed inside an `AdwBottomSheet`, [class@HeaderBar] will not show the
91// title when [property@BottomSheet:show-drag-handle] is `TRUE`, regardless of
92// [property@HeaderBar:show-title]. This only applies to the default title,
93// titles set with [property@HeaderBar:title-widget] will still be shown.
94//
95// ## `AdwBottomSheet` as `GtkBuildable`:
96//
97// The `AdwBottomSheet` implementation of the [iface@Gtk.Buildable] interface
98// supports setting the sheet widget by specifying “sheet” as the “type”
99// attribute of a `<child>` element, and the bottom bar by specifying
100// “bottom-bar”. Specifying “content” or omitting the child type results in
101// setting the content child.
102type BottomSheet struct {
103 gtk.Widget
104}
105
106var xBottomSheetGLibType func() types.GType
107
108func BottomSheetGLibType() types.GType {
109 return xBottomSheetGLibType()
110}
111
112func BottomSheetNewFromInternalPtr(ptr uintptr) *BottomSheet {
113 cls := &BottomSheet{}
114 cls.Ptr = ptr
115 return cls
116}
117
118var xNewBottomSheet func() uintptr
119
120// Creates a new `AdwBottomSheet`.
121func NewBottomSheet() *BottomSheet {
122 var cls *BottomSheet
123
124 cret := xNewBottomSheet()
125
126 if cret == 0 {
127 return nil
128 }
129 gobject.IncreaseRef(cret)
130 cls = &BottomSheet{}
131 cls.Ptr = cret
132 return cls
133}
134
135var xBottomSheetGetAlign func(uintptr) float32
136
137// Gets horizontal alignment of the bottom sheet.
138func (x *BottomSheet) GetAlign() float32 {
139
140 cret := xBottomSheetGetAlign(x.GoPointer())
141 return cret
142}
143
144var xBottomSheetGetBottomBar func(uintptr) uintptr
145
146// Gets the bottom bar widget for @self.
147func (x *BottomSheet) GetBottomBar() *gtk.Widget {
148 var cls *gtk.Widget
149
150 cret := xBottomSheetGetBottomBar(x.GoPointer())
151
152 if cret == 0 {
153 return nil
154 }
155 gobject.IncreaseRef(cret)
156 cls = >k.Widget{}
157 cls.Ptr = cret
158 return cls
159}
160
161var xBottomSheetGetBottomBarHeight func(uintptr) int
162
163// Gets the current bottom bar height.
164//
165// It can be used to shift the content upwards permanently to accommodate for
166// the bottom bar.
167func (x *BottomSheet) GetBottomBarHeight() int {
168
169 cret := xBottomSheetGetBottomBarHeight(x.GoPointer())
170 return cret
171}
172
173var xBottomSheetGetCanClose func(uintptr) bool
174
175// Gets whether the bottom sheet can be closed by user.
176func (x *BottomSheet) GetCanClose() bool {
177
178 cret := xBottomSheetGetCanClose(x.GoPointer())
179 return cret
180}
181
182var xBottomSheetGetCanOpen func(uintptr) bool
183
184// Gets whether the bottom sheet can be opened by user.
185func (x *BottomSheet) GetCanOpen() bool {
186
187 cret := xBottomSheetGetCanOpen(x.GoPointer())
188 return cret
189}
190
191var xBottomSheetGetContent func(uintptr) uintptr
192
193// Gets the content widget for @self.
194func (x *BottomSheet) GetContent() *gtk.Widget {
195 var cls *gtk.Widget
196
197 cret := xBottomSheetGetContent(x.GoPointer())
198
199 if cret == 0 {
200 return nil
201 }
202 gobject.IncreaseRef(cret)
203 cls = >k.Widget{}
204 cls.Ptr = cret
205 return cls
206}
207
208var xBottomSheetGetFullWidth func(uintptr) bool
209
210// Gets whether the bottom sheet takes the full width.
211func (x *BottomSheet) GetFullWidth() bool {
212
213 cret := xBottomSheetGetFullWidth(x.GoPointer())
214 return cret
215}
216
217var xBottomSheetGetModal func(uintptr) bool
218
219// Gets whether the bottom sheet is modal.
220func (x *BottomSheet) GetModal() bool {
221
222 cret := xBottomSheetGetModal(x.GoPointer())
223 return cret
224}
225
226var xBottomSheetGetOpen func(uintptr) bool
227
228// Gets whether the bottom sheet is open.
229func (x *BottomSheet) GetOpen() bool {
230
231 cret := xBottomSheetGetOpen(x.GoPointer())
232 return cret
233}
234
235var xBottomSheetGetRevealBottomBar func(uintptr) bool
236
237// Gets whether the bottom bar is revealed.
238func (x *BottomSheet) GetRevealBottomBar() bool {
239
240 cret := xBottomSheetGetRevealBottomBar(x.GoPointer())
241 return cret
242}
243
244var xBottomSheetGetSheet func(uintptr) uintptr
245
246// Gets the bottom sheet widget for @self.
247func (x *BottomSheet) GetSheet() *gtk.Widget {
248 var cls *gtk.Widget
249
250 cret := xBottomSheetGetSheet(x.GoPointer())
251
252 if cret == 0 {
253 return nil
254 }
255 gobject.IncreaseRef(cret)
256 cls = >k.Widget{}
257 cls.Ptr = cret
258 return cls
259}
260
261var xBottomSheetGetSheetHeight func(uintptr) int
262
263// Gets the current bottom sheet height.
264//
265// It can be used to shift the content upwards when the bottom sheet is open.
266func (x *BottomSheet) GetSheetHeight() int {
267
268 cret := xBottomSheetGetSheetHeight(x.GoPointer())
269 return cret
270}
271
272var xBottomSheetGetShowDragHandle func(uintptr) bool
273
274// Gets whether to show a drag handle in the bottom sheet.
275func (x *BottomSheet) GetShowDragHandle() bool {
276
277 cret := xBottomSheetGetShowDragHandle(x.GoPointer())
278 return cret
279}
280
281var xBottomSheetSetAlign func(uintptr, float32)
282
283// Sets horizontal alignment of the bottom sheet.
284//
285// 0 means the bottom sheet is flush with the start edge, 1 means it's flush
286// with the end edge. 0.5 means it's centered.
287//
288// Only used when [property@BottomSheet:full-width] is set to `FALSE`.
289func (x *BottomSheet) SetAlign(AlignVar float32) {
290
291 xBottomSheetSetAlign(x.GoPointer(), AlignVar)
292
293}
294
295var xBottomSheetSetBottomBar func(uintptr, uintptr)
296
297// Sets the bottom bar widget for @self.
298//
299// Shown when [property@BottomSheet:open] is `FALSE`. When open, morphs into
300// the [property@BottomSheet:sheet].
301//
302// Bottom bar can be temporarily hidden using the
303// [property@BottomSheet:reveal-bottom-bar] property.
304func (x *BottomSheet) SetBottomBar(BottomBarVar *gtk.Widget) {
305
306 xBottomSheetSetBottomBar(x.GoPointer(), BottomBarVar.GoPointer())
307
308}
309
310var xBottomSheetSetCanClose func(uintptr, bool)
311
312// Sets whether the bottom sheet can be closed by user.
313//
314// It can be closed via the close button, swiping down, pressing
315// <kbd>Escape</kbd> or clicking the content dimming (when modal).
316//
317// Bottom sheet can still be closed using [property@BottomSheet:open].
318func (x *BottomSheet) SetCanClose(CanCloseVar bool) {
319
320 xBottomSheetSetCanClose(x.GoPointer(), CanCloseVar)
321
322}
323
324var xBottomSheetSetCanOpen func(uintptr, bool)
325
326// Sets whether the bottom sheet can be opened by user.
327//
328// It can be opened via clicking or swiping up from the bottom bar.
329//
330// Does nothing if [property@BottomSheet:bottom-bar] is not set.
331//
332// Bottom sheet can still be opened using [property@BottomSheet:open].
333func (x *BottomSheet) SetCanOpen(CanOpenVar bool) {
334
335 xBottomSheetSetCanOpen(x.GoPointer(), CanOpenVar)
336
337}
338
339var xBottomSheetSetContent func(uintptr, uintptr)
340
341// Sets the content widget for @self.
342//
343// It's always shown, and the bottom sheet is overlaid over it.
344func (x *BottomSheet) SetContent(ContentVar *gtk.Widget) {
345
346 xBottomSheetSetContent(x.GoPointer(), ContentVar.GoPointer())
347
348}
349
350var xBottomSheetSetFullWidth func(uintptr, bool)
351
352// Sets whether the bottom sheet takes the full width.
353//
354// When full width, [property@BottomSheet:align] is ignored.
355func (x *BottomSheet) SetFullWidth(FullWidthVar bool) {
356
357 xBottomSheetSetFullWidth(x.GoPointer(), FullWidthVar)
358
359}
360
361var xBottomSheetSetModal func(uintptr, bool)
362
363// Sets whether the bottom sheet is modal.
364//
365// When modal, [property@BottomSheet:content] will be dimmed when the bottom
366// sheet is open, and clicking it will close the bottom sheet. It also cannot be
367// focused with keyboard.
368//
369// Otherwise, the content is accessible even when the bottom sheet is open.
370func (x *BottomSheet) SetModal(ModalVar bool) {
371
372 xBottomSheetSetModal(x.GoPointer(), ModalVar)
373
374}
375
376var xBottomSheetSetOpen func(uintptr, bool)
377
378// Sets whether the bottom sheet is open.
379func (x *BottomSheet) SetOpen(OpenVar bool) {
380
381 xBottomSheetSetOpen(x.GoPointer(), OpenVar)
382
383}
384
385var xBottomSheetSetRevealBottomBar func(uintptr, bool)
386
387// Sets whether to reveal the bottom bar.
388//
389// The transition will be animated.
390//
391// See [property@BottomSheet:bottom-bar] and
392// [property@BottomSheet:bottom-bar-height].
393func (x *BottomSheet) SetRevealBottomBar(RevealVar bool) {
394
395 xBottomSheetSetRevealBottomBar(x.GoPointer(), RevealVar)
396
397}
398
399var xBottomSheetSetSheet func(uintptr, uintptr)
400
401// Sets the bottom sheet widget for @self.
402//
403// Only shown when [property@BottomSheet:open] is `TRUE`.
404func (x *BottomSheet) SetSheet(SheetVar *gtk.Widget) {
405
406 xBottomSheetSetSheet(x.GoPointer(), SheetVar.GoPointer())
407
408}
409
410var xBottomSheetSetShowDragHandle func(uintptr, bool)
411
412// Sets whether to show a drag handle in the bottom sheet.
413//
414// The handle will be overlaid over [property@BottomSheet:sheet].
415//
416// When the handle is shown, [class@HeaderBar] will hide its default title, and
417// [class@ToolbarView] will reserve space if there are no top bars.
418//
419// Showing drag handle also allows to swipe the bottom sheet down (and to swipe
420// the bottom bar up) with a pointer, instead of just touchscreen.
421func (x *BottomSheet) SetShowDragHandle(ShowDragHandleVar bool) {
422
423 xBottomSheetSetShowDragHandle(x.GoPointer(), ShowDragHandleVar)
424
425}
426
427func (c *BottomSheet) GoPointer() uintptr {
428 if c == nil {
429 return 0
430 }
431 return c.Ptr
432}
433
434func (c *BottomSheet) SetGoPointer(ptr uintptr) {
435 c.Ptr = ptr
436}
437
438// SetPropertyAlign sets the "align" property.
439// Horizontal alignment of the bottom sheet.
440//
441// 0 means the bottom sheet is flush with the start edge, 1 means it's flush
442// with the end edge. 0.5 means it's centered.
443//
444// Only used when [property@BottomSheet:full-width] is set to `FALSE`.
445func (x *BottomSheet) SetPropertyAlign(value float32) {
446 var v gobject.Value
447 v.Init(gobject.TypeFloatVal)
448 v.SetFloat(value)
449 x.SetProperty("align", &v)
450}
451
452// GetPropertyAlign gets the "align" property.
453// Horizontal alignment of the bottom sheet.
454//
455// 0 means the bottom sheet is flush with the start edge, 1 means it's flush
456// with the end edge. 0.5 means it's centered.
457//
458// Only used when [property@BottomSheet:full-width] is set to `FALSE`.
459func (x *BottomSheet) GetPropertyAlign() float32 {
460 var v gobject.Value
461 x.GetProperty("align", &v)
462 return v.GetFloat()
463}
464
465// GetPropertyBottomBarHeight gets the "bottom-bar-height" property.
466// The current bottom bar height.
467//
468// It can be used to shift the content upwards permanently to accommodate for
469// the bottom bar.
470func (x *BottomSheet) GetPropertyBottomBarHeight() int {
471 var v gobject.Value
472 x.GetProperty("bottom-bar-height", &v)
473 return v.GetInt()
474}
475
476// SetPropertyCanClose sets the "can-close" property.
477// Whether the bottom sheet can be closed by user.
478//
479// It can be closed via the close button, swiping down, pressing
480// <kbd>Escape</kbd> or clicking the content dimming (when modal).
481//
482// Bottom sheet can still be closed using [property@BottomSheet:open].
483func (x *BottomSheet) SetPropertyCanClose(value bool) {
484 var v gobject.Value
485 v.Init(gobject.TypeBooleanVal)
486 v.SetBoolean(value)
487 x.SetProperty("can-close", &v)
488}
489
490// GetPropertyCanClose gets the "can-close" property.
491// Whether the bottom sheet can be closed by user.
492//
493// It can be closed via the close button, swiping down, pressing
494// <kbd>Escape</kbd> or clicking the content dimming (when modal).
495//
496// Bottom sheet can still be closed using [property@BottomSheet:open].
497func (x *BottomSheet) GetPropertyCanClose() bool {
498 var v gobject.Value
499 x.GetProperty("can-close", &v)
500 return v.GetBoolean()
501}
502
503// SetPropertyCanOpen sets the "can-open" property.
504// Whether the bottom sheet can be opened by user.
505//
506// It can be opened via clicking or swiping up from the bottom bar.
507//
508// Does nothing if [property@BottomSheet:bottom-bar] is not set.
509//
510// Bottom sheet can still be opened using [property@BottomSheet:open].
511func (x *BottomSheet) SetPropertyCanOpen(value bool) {
512 var v gobject.Value
513 v.Init(gobject.TypeBooleanVal)
514 v.SetBoolean(value)
515 x.SetProperty("can-open", &v)
516}
517
518// GetPropertyCanOpen gets the "can-open" property.
519// Whether the bottom sheet can be opened by user.
520//
521// It can be opened via clicking or swiping up from the bottom bar.
522//
523// Does nothing if [property@BottomSheet:bottom-bar] is not set.
524//
525// Bottom sheet can still be opened using [property@BottomSheet:open].
526func (x *BottomSheet) GetPropertyCanOpen() bool {
527 var v gobject.Value
528 x.GetProperty("can-open", &v)
529 return v.GetBoolean()
530}
531
532// SetPropertyFullWidth sets the "full-width" property.
533// Whether the bottom sheet takes the full width.
534//
535// When full width, [property@BottomSheet:align] is ignored.
536func (x *BottomSheet) SetPropertyFullWidth(value bool) {
537 var v gobject.Value
538 v.Init(gobject.TypeBooleanVal)
539 v.SetBoolean(value)
540 x.SetProperty("full-width", &v)
541}
542
543// GetPropertyFullWidth gets the "full-width" property.
544// Whether the bottom sheet takes the full width.
545//
546// When full width, [property@BottomSheet:align] is ignored.
547func (x *BottomSheet) GetPropertyFullWidth() bool {
548 var v gobject.Value
549 x.GetProperty("full-width", &v)
550 return v.GetBoolean()
551}
552
553// SetPropertyModal sets the "modal" property.
554// Whether the bottom sheet is modal.
555//
556// When modal, [property@BottomSheet:content] will be dimmed when the bottom
557// sheet is open, and clicking it will close the bottom sheet. It also cannot
558// be focused with keyboard.
559//
560// Otherwise, the content is accessible even when the bottom sheet is open.
561func (x *BottomSheet) SetPropertyModal(value bool) {
562 var v gobject.Value
563 v.Init(gobject.TypeBooleanVal)
564 v.SetBoolean(value)
565 x.SetProperty("modal", &v)
566}
567
568// GetPropertyModal gets the "modal" property.
569// Whether the bottom sheet is modal.
570//
571// When modal, [property@BottomSheet:content] will be dimmed when the bottom
572// sheet is open, and clicking it will close the bottom sheet. It also cannot
573// be focused with keyboard.
574//
575// Otherwise, the content is accessible even when the bottom sheet is open.
576func (x *BottomSheet) GetPropertyModal() bool {
577 var v gobject.Value
578 x.GetProperty("modal", &v)
579 return v.GetBoolean()
580}
581
582// SetPropertyOpen sets the "open" property.
583// Whether the bottom sheet is open.
584func (x *BottomSheet) SetPropertyOpen(value bool) {
585 var v gobject.Value
586 v.Init(gobject.TypeBooleanVal)
587 v.SetBoolean(value)
588 x.SetProperty("open", &v)
589}
590
591// GetPropertyOpen gets the "open" property.
592// Whether the bottom sheet is open.
593func (x *BottomSheet) GetPropertyOpen() bool {
594 var v gobject.Value
595 x.GetProperty("open", &v)
596 return v.GetBoolean()
597}
598
599// SetPropertyRevealBottomBar sets the "reveal-bottom-bar" property.
600// Whether to reveal the bottom bar.
601//
602// The transition will be animated.
603//
604// See [property@BottomSheet:bottom-bar] and
605// [property@BottomSheet:bottom-bar-height].
606func (x *BottomSheet) SetPropertyRevealBottomBar(value bool) {
607 var v gobject.Value
608 v.Init(gobject.TypeBooleanVal)
609 v.SetBoolean(value)
610 x.SetProperty("reveal-bottom-bar", &v)
611}
612
613// GetPropertyRevealBottomBar gets the "reveal-bottom-bar" property.
614// Whether to reveal the bottom bar.
615//
616// The transition will be animated.
617//
618// See [property@BottomSheet:bottom-bar] and
619// [property@BottomSheet:bottom-bar-height].
620func (x *BottomSheet) GetPropertyRevealBottomBar() bool {
621 var v gobject.Value
622 x.GetProperty("reveal-bottom-bar", &v)
623 return v.GetBoolean()
624}
625
626// GetPropertySheetHeight gets the "sheet-height" property.
627// The current bottom sheet height.
628//
629// It can be used to shift the content upwards when the bottom sheet is open.
630func (x *BottomSheet) GetPropertySheetHeight() int {
631 var v gobject.Value
632 x.GetProperty("sheet-height", &v)
633 return v.GetInt()
634}
635
636// SetPropertyShowDragHandle sets the "show-drag-handle" property.
637// Whether to overlay a drag handle in the bottom sheet.
638//
639// The handle will be overlaid over [property@BottomSheet:sheet].
640//
641// When the handle is shown, [class@HeaderBar] will hide its default title,
642// and [class@ToolbarView] will reserve space if there are no top bars.
643//
644// Showing drag handle also allows to swipe the bottom sheet down (and to
645// swipe the bottom bar up) with a pointer, instead of just touchscreen.
646func (x *BottomSheet) SetPropertyShowDragHandle(value bool) {
647 var v gobject.Value
648 v.Init(gobject.TypeBooleanVal)
649 v.SetBoolean(value)
650 x.SetProperty("show-drag-handle", &v)
651}
652
653// GetPropertyShowDragHandle gets the "show-drag-handle" property.
654// Whether to overlay a drag handle in the bottom sheet.
655//
656// The handle will be overlaid over [property@BottomSheet:sheet].
657//
658// When the handle is shown, [class@HeaderBar] will hide its default title,
659// and [class@ToolbarView] will reserve space if there are no top bars.
660//
661// Showing drag handle also allows to swipe the bottom sheet down (and to
662// swipe the bottom bar up) with a pointer, instead of just touchscreen.
663func (x *BottomSheet) GetPropertyShowDragHandle() bool {
664 var v gobject.Value
665 x.GetProperty("show-drag-handle", &v)
666 return v.GetBoolean()
667}
668
669// Emitted when the close button or shortcut is used while
670// [property@Dialog:can-close] is set to `FALSE`.
671func (x *BottomSheet) ConnectCloseAttempt(cb *func(BottomSheet)) uint {
672 cbPtr := uintptr(unsafe.Pointer(cb))
673 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
674 handlerID := gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)
675 glib.SaveHandlerMapping(handlerID, cbPtr)
676 return handlerID
677 }
678
679 fcb := func(clsPtr uintptr) {
680 fa := BottomSheet{}
681 fa.Ptr = clsPtr
682 cbFn := *cb
683
684 cbFn(fa)
685
686 }
687 cbRefPtr := purego.NewCallback(fcb)
688 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
689 handlerID := gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)
690 glib.SaveHandlerMapping(handlerID, cbPtr)
691 return handlerID
692}
693
694// Gets the progress @self will snap back to after the gesture is canceled.
695func (x *BottomSheet) GetCancelProgress() float64 {
696
697 cret := XAdwSwipeableGetCancelProgress(x.GoPointer())
698 return cret
699}
700
701// Gets the swipe distance of @self.
702//
703// This corresponds to how many pixels 1 unit represents.
704func (x *BottomSheet) GetDistance() float64 {
705
706 cret := XAdwSwipeableGetDistance(x.GoPointer())
707 return cret
708}
709
710// Gets the current progress of @self.
711func (x *BottomSheet) GetProgress() float64 {
712
713 cret := XAdwSwipeableGetProgress(x.GoPointer())
714 return cret
715}
716
717// Gets the snap points of @self.
718//
719// Each snap point represents a progress value that is considered acceptable to
720// end the swipe on.
721func (x *BottomSheet) GetSnapPoints(NSnapPointsVar *int) uintptr {
722
723 cret := XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar)
724 return cret
725}
726
727// Gets the area @self can start a swipe from for the given direction and
728// gesture type.
729//
730// This can be used to restrict swipes to only be possible from a certain area,
731// for example, to only allow edge swipes, or to have a draggable element and
732// ignore swipes elsewhere.
733//
734// If not implemented, the default implementation returns the allocation of
735// @self, allowing swipes from anywhere.
736func (x *BottomSheet) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDragVar bool, RectVar *gdk.Rectangle) {
737
738 XAdwSwipeableGetSwipeArea(x.GoPointer(), NavigationDirectionVar, IsDragVar, RectVar)
739
740}
741
742// Requests the user's screen reader to announce the given message.
743//
744// This kind of notification is useful for messages that
745// either have only a visual representation or that are not
746// exposed visually at all, e.g. a notification about a
747// successful operation.
748//
749// Also, by using this API, you can ensure that the message
750// does not interrupts the user's current screen reader output.
751func (x *BottomSheet) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
752
753 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
754
755}
756
757// Retrieves the accessible parent for an accessible object.
758//
759// This function returns `NULL` for top level widgets.
760func (x *BottomSheet) GetAccessibleParent() *gtk.AccessibleBase {
761 var cls *gtk.AccessibleBase
762
763 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
764
765 if cret == 0 {
766 return nil
767 }
768 cls = >k.AccessibleBase{}
769 cls.Ptr = cret
770 return cls
771}
772
773// Retrieves the accessible role of an accessible object.
774func (x *BottomSheet) GetAccessibleRole() gtk.AccessibleRole {
775
776 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
777 return cret
778}
779
780// Retrieves the implementation for the given accessible object.
781func (x *BottomSheet) GetAtContext() *gtk.ATContext {
782 var cls *gtk.ATContext
783
784 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
785
786 if cret == 0 {
787 return nil
788 }
789 cls = >k.ATContext{}
790 cls.Ptr = cret
791 return cls
792}
793
794// Queries the coordinates and dimensions of this accessible
795//
796// This functionality can be overridden by `GtkAccessible`
797// implementations, e.g. to get the bounds from an ignored
798// child widget.
799func (x *BottomSheet) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
800
801 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
802 return cret
803}
804
805// Retrieves the first accessible child of an accessible object.
806func (x *BottomSheet) GetFirstAccessibleChild() *gtk.AccessibleBase {
807 var cls *gtk.AccessibleBase
808
809 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
810
811 if cret == 0 {
812 return nil
813 }
814 cls = >k.AccessibleBase{}
815 cls.Ptr = cret
816 return cls
817}
818
819// Retrieves the next accessible sibling of an accessible object
820func (x *BottomSheet) GetNextAccessibleSibling() *gtk.AccessibleBase {
821 var cls *gtk.AccessibleBase
822
823 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
824
825 if cret == 0 {
826 return nil
827 }
828 cls = >k.AccessibleBase{}
829 cls.Ptr = cret
830 return cls
831}
832
833// Queries a platform state, such as focus.
834//
835// This functionality can be overridden by `GtkAccessible`
836// implementations, e.g. to get platform state from an ignored
837// child widget, as is the case for `GtkText` wrappers.
838func (x *BottomSheet) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
839
840 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
841 return cret
842}
843
844// Resets the accessible property to its default value.
845func (x *BottomSheet) ResetProperty(PropertyVar gtk.AccessibleProperty) {
846
847 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
848
849}
850
851// Resets the accessible relation to its default value.
852func (x *BottomSheet) ResetRelation(RelationVar gtk.AccessibleRelation) {
853
854 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
855
856}
857
858// Resets the accessible state to its default value.
859func (x *BottomSheet) ResetState(StateVar gtk.AccessibleState) {
860
861 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
862
863}
864
865// Sets the parent and sibling of an accessible object.
866//
867// This function is meant to be used by accessible implementations that are
868// not part of the widget hierarchy, and but act as a logical bridge between
869// widgets. For instance, if a widget creates an object that holds metadata
870// for each child, and you want that object to implement the `GtkAccessible`
871// interface, you will use this function to ensure that the parent of each
872// child widget is the metadata object, and the parent of each metadata
873// object is the container widget.
874func (x *BottomSheet) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
875
876 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
877
878}
879
880// Updates the next accessible sibling.
881//
882// That might be useful when a new child of a custom accessible
883// is created, and it needs to be linked to a previous child.
884func (x *BottomSheet) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
885
886 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
887
888}
889
890// Informs ATs that the platform state has changed.
891//
892// This function should be used by `GtkAccessible` implementations that
893// have a platform state but are not widgets. Widgets handle platform
894// states automatically.
895func (x *BottomSheet) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
896
897 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
898
899}
900
901// Updates a list of accessible properties.
902//
903// See the [enum@Gtk.AccessibleProperty] documentation for the
904// value types of accessible properties.
905//
906// This function should be called by `GtkWidget` types whenever
907// an accessible property change must be communicated to assistive
908// technologies.
909//
910// Example:
911// ```c
912// value = gtk_adjustment_get_value (adjustment);
913// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
914//
915// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
916// -1);
917//
918// ```
919func (x *BottomSheet) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
920
921 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
922
923}
924
925// Updates an array of accessible properties.
926//
927// This function should be called by `GtkWidget` types whenever an accessible
928// property change must be communicated to assistive technologies.
929//
930// This function is meant to be used by language bindings.
931func (x *BottomSheet) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
932
933 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
934
935}
936
937// Updates a list of accessible relations.
938//
939// This function should be called by `GtkWidget` types whenever an accessible
940// relation change must be communicated to assistive technologies.
941//
942// If the [enum@Gtk.AccessibleRelation] requires a list of references,
943// you should pass each reference individually, followed by `NULL`, e.g.
944//
945// ```c
946// gtk_accessible_update_relation (accessible,
947//
948// GTK_ACCESSIBLE_RELATION_CONTROLS,
949// ref1, NULL,
950// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
951// ref1, ref2, ref3, NULL,
952// -1);
953//
954// ```
955func (x *BottomSheet) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
956
957 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
958
959}
960
961// Updates an array of accessible relations.
962//
963// This function should be called by `GtkWidget` types whenever an accessible
964// relation change must be communicated to assistive technologies.
965//
966// This function is meant to be used by language bindings.
967func (x *BottomSheet) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
968
969 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
970
971}
972
973// Updates a list of accessible states.
974//
975// See the [enum@Gtk.AccessibleState] documentation for the
976// value types of accessible states.
977//
978// This function should be called by `GtkWidget` types whenever
979// an accessible state change must be communicated to assistive
980// technologies.
981//
982// Example:
983//
984// ```c
985// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
986// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
987//
988// GTK_ACCESSIBLE_STATE_CHECKED, value,
989// -1);
990//
991// ```
992func (x *BottomSheet) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
993
994 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
995
996}
997
998// Updates an array of accessible states.
999//
1000// This function should be called by `GtkWidget` types whenever an accessible
1001// state change must be communicated to assistive technologies.
1002//
1003// This function is meant to be used by language bindings.
1004func (x *BottomSheet) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
1005
1006 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
1007
1008}
1009
1010// Gets the ID of the @buildable object.
1011//
1012// `GtkBuilder` sets the name based on the ID attribute
1013// of the `<object>` tag used to construct the @buildable.
1014func (x *BottomSheet) GetBuildableId() string {
1015
1016 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
1017 return cret
1018}
1019
1020func init() {
1021 core.SetPackageName("ADW", "libadwaita-1")
1022 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
1023 var libs []uintptr
1024 for _, libPath := range core.GetPaths("ADW") {
1025 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1026 if err != nil {
1027 panic(err)
1028 }
1029 libs = append(libs, lib)
1030 }
1031
1032 core.PuregoSafeRegister(&xBottomSheetGLibType, libs, "adw_bottom_sheet_get_type")
1033
1034 core.PuregoSafeRegister(&xNewBottomSheet, libs, "adw_bottom_sheet_new")
1035
1036 core.PuregoSafeRegister(&xBottomSheetGetAlign, libs, "adw_bottom_sheet_get_align")
1037 core.PuregoSafeRegister(&xBottomSheetGetBottomBar, libs, "adw_bottom_sheet_get_bottom_bar")
1038 core.PuregoSafeRegister(&xBottomSheetGetBottomBarHeight, libs, "adw_bottom_sheet_get_bottom_bar_height")
1039 core.PuregoSafeRegister(&xBottomSheetGetCanClose, libs, "adw_bottom_sheet_get_can_close")
1040 core.PuregoSafeRegister(&xBottomSheetGetCanOpen, libs, "adw_bottom_sheet_get_can_open")
1041 core.PuregoSafeRegister(&xBottomSheetGetContent, libs, "adw_bottom_sheet_get_content")
1042 core.PuregoSafeRegister(&xBottomSheetGetFullWidth, libs, "adw_bottom_sheet_get_full_width")
1043 core.PuregoSafeRegister(&xBottomSheetGetModal, libs, "adw_bottom_sheet_get_modal")
1044 core.PuregoSafeRegister(&xBottomSheetGetOpen, libs, "adw_bottom_sheet_get_open")
1045 core.PuregoSafeRegister(&xBottomSheetGetRevealBottomBar, libs, "adw_bottom_sheet_get_reveal_bottom_bar")
1046 core.PuregoSafeRegister(&xBottomSheetGetSheet, libs, "adw_bottom_sheet_get_sheet")
1047 core.PuregoSafeRegister(&xBottomSheetGetSheetHeight, libs, "adw_bottom_sheet_get_sheet_height")
1048 core.PuregoSafeRegister(&xBottomSheetGetShowDragHandle, libs, "adw_bottom_sheet_get_show_drag_handle")
1049 core.PuregoSafeRegister(&xBottomSheetSetAlign, libs, "adw_bottom_sheet_set_align")
1050 core.PuregoSafeRegister(&xBottomSheetSetBottomBar, libs, "adw_bottom_sheet_set_bottom_bar")
1051 core.PuregoSafeRegister(&xBottomSheetSetCanClose, libs, "adw_bottom_sheet_set_can_close")
1052 core.PuregoSafeRegister(&xBottomSheetSetCanOpen, libs, "adw_bottom_sheet_set_can_open")
1053 core.PuregoSafeRegister(&xBottomSheetSetContent, libs, "adw_bottom_sheet_set_content")
1054 core.PuregoSafeRegister(&xBottomSheetSetFullWidth, libs, "adw_bottom_sheet_set_full_width")
1055 core.PuregoSafeRegister(&xBottomSheetSetModal, libs, "adw_bottom_sheet_set_modal")
1056 core.PuregoSafeRegister(&xBottomSheetSetOpen, libs, "adw_bottom_sheet_set_open")
1057 core.PuregoSafeRegister(&xBottomSheetSetRevealBottomBar, libs, "adw_bottom_sheet_set_reveal_bottom_bar")
1058 core.PuregoSafeRegister(&xBottomSheetSetSheet, libs, "adw_bottom_sheet_set_sheet")
1059 core.PuregoSafeRegister(&xBottomSheetSetShowDragHandle, libs, "adw_bottom_sheet_set_show_drag_handle")
1060
1061}