v0.2.1 c0399be

gtkpopover.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5	"structs"
6	"unsafe"
7
8	"github.com/ebitengine/purego"
9
10	"github.com/bnema/puregotk/pkg/core"
11	"github.com/bnema/puregotk/v4/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/gsk"
16)
17
18type PopoverClass struct {
19	_ structs.HostLayout
20
21	ParentClass WidgetClass
22
23	xClosed uintptr
24
25	xActivateDefault uintptr
26
27	Reserved [8]uintptr
28}
29
30func (x *PopoverClass) GoPointer() uintptr {
31	return uintptr(unsafe.Pointer(x))
32}
33
34// OverrideClosed sets the "closed" callback function.
35func (x *PopoverClass) OverrideClosed(cb func(*Popover)) {
36	if cb == nil {
37		x.xClosed = 0
38	} else {
39		x.xClosed = purego.NewCallback(func(PopoverVarp uintptr) {
40			cb(PopoverNewFromInternalPtr(PopoverVarp))
41		})
42	}
43}
44
45// GetClosed gets the "closed" callback function.
46func (x *PopoverClass) GetClosed() func(*Popover) {
47	if x.xClosed == 0 {
48		return nil
49	}
50	var rawCallback func(PopoverVarp uintptr)
51	purego.RegisterFunc(&rawCallback, x.xClosed)
52	return func(PopoverVar *Popover) {
53		rawCallback(PopoverVar.GoPointer())
54	}
55}
56
57// OverrideActivateDefault sets the "activate_default" callback function.
58func (x *PopoverClass) OverrideActivateDefault(cb func(*Popover)) {
59	if cb == nil {
60		x.xActivateDefault = 0
61	} else {
62		x.xActivateDefault = purego.NewCallback(func(PopoverVarp uintptr) {
63			cb(PopoverNewFromInternalPtr(PopoverVarp))
64		})
65	}
66}
67
68// GetActivateDefault gets the "activate_default" callback function.
69func (x *PopoverClass) GetActivateDefault() func(*Popover) {
70	if x.xActivateDefault == 0 {
71		return nil
72	}
73	var rawCallback func(PopoverVarp uintptr)
74	purego.RegisterFunc(&rawCallback, x.xActivateDefault)
75	return func(PopoverVar *Popover) {
76		rawCallback(PopoverVar.GoPointer())
77	}
78}
79
80// Presents a bubble-like popup.
81//
82// <picture>
83//
84//	<source srcset="popover-dark.png" media="(prefers-color-scheme: dark)">
85//	<img alt="An example GtkPopover" src="popover.png">
86//
87// </picture>
88//
89// It is primarily meant to provide context-dependent information
90// or options. Popovers are attached to a parent widget. The parent widget
91// must support popover children, as [class@Gtk.MenuButton] and
92// [class@Gtk.PopoverMenuBar] do. If you want to make a custom widget that
93// has an attached popover, you need to call [method@Gtk.Popover.present]
94// in your [vfunc@Gtk.Widget.size_allocate] vfunc, in order to update the
95// positioning of the popover.
96//
97// The position of a popover relative to the widget it is attached to
98// can also be changed with [method@Gtk.Popover.set_position]. By default,
99// it points to the whole widget area, but it can be made to point to
100// a specific area using [method@Gtk.Popover.set_pointing_to].
101//
102// By default, `GtkPopover` performs a grab, in order to ensure input
103// events get redirected to it while it is shown, and also so the popover
104// is dismissed in the expected situations (clicks outside the popover,
105// or the Escape key being pressed). If no such modal behavior is desired
106// on a popover, [method@Gtk.Popover.set_autohide] may be called on it to
107// tweak its behavior.
108//
109// ## GtkPopover as menu replacement
110//
111// `GtkPopover` is often used to replace menus. The best way to do this
112// is to use the [class@Gtk.PopoverMenu] subclass which supports being
113// populated from a `GMenuModel` with [ctor@Gtk.PopoverMenu.new_from_model].
114//
115// ```xml
116// <section>
117//
118//	<attribute name="display-hint">horizontal-buttons</attribute>
119//	<item>
120//	  <attribute name="label">Cut</attribute>
121//	  <attribute name="action">app.cut</attribute>
122//	  <attribute name="verb-icon">edit-cut-symbolic</attribute>
123//	</item>
124//	<item>
125//	  <attribute name="label">Copy</attribute>
126//	  <attribute name="action">app.copy</attribute>
127//	  <attribute name="verb-icon">edit-copy-symbolic</attribute>
128//	</item>
129//	<item>
130//	  <attribute name="label">Paste</attribute>
131//	  <attribute name="action">app.paste</attribute>
132//	  <attribute name="verb-icon">edit-paste-symbolic</attribute>
133//	</item>
134//
135// </section>
136// ```
137//
138// # Shortcuts and Gestures
139//
140// `GtkPopover` supports the following keyboard shortcuts:
141//
142// - <kbd>Escape</kbd> closes the popover.
143// - <kbd>Alt</kbd> makes the mnemonics visible.
144//
145// The following signals have default keybindings:
146//
147// - [signal@Gtk.Popover::activate-default]
148//
149// # CSS nodes
150//
151// ```
152// popover.background[.menu]
153// ├── arrow
154// ╰── contents
155//
156//	╰── <child>
157//
158// ```
159//
160// `GtkPopover` has a main node with name `popover`, an arrow with name `arrow`,
161// and another node for the content named `contents`. The `popover` node always
162// gets the `.background` style class. It also gets the `.menu` style class
163// if the popover is menu-like, e.g. is a [class@Gtk.PopoverMenu].
164//
165// Particular uses of `GtkPopover`, such as touch selection popups or
166// magnifiers in `GtkEntry` or `GtkTextView` get style classes like
167// `.touch-selection` or `.magnifier` to differentiate from plain popovers.
168//
169// When styling a popover directly, the `popover` node should usually
170// not have any background. The visible part of the popover can have
171// a shadow. To specify it in CSS, set the box-shadow of the `contents` node.
172//
173// Note that, in order to accomplish appropriate arrow visuals, `GtkPopover`
174// uses custom drawing for the `arrow` node. This makes it possible for the
175// arrow to change its shape dynamically, but it also limits the possibilities
176// of styling it using CSS. In particular, the `arrow` gets drawn over the
177// `content` node's border and shadow, so they look like one shape, which
178// means that the border width of the `content` node and the `arrow` node should
179// be the same. The arrow also does not support any border shape other than
180// solid, no border-radius, only one border width (border-bottom-width is
181// used) and no box-shadow.
182type Popover struct {
183	Widget
184}
185
186var xPopoverGLibType func() types.GType
187
188func PopoverGLibType() types.GType {
189	return xPopoverGLibType()
190}
191
192func PopoverNewFromInternalPtr(ptr uintptr) *Popover {
193	cls := &Popover{}
194	cls.Ptr = ptr
195	return cls
196}
197
198var xNewPopover func() uintptr
199
200// Creates a new `GtkPopover`.
201func NewPopover() *Popover {
202	var cls *Popover
203
204	cret := xNewPopover()
205
206	if cret == 0 {
207		return nil
208	}
209	gobject.IncreaseRef(cret)
210	cls = &Popover{}
211	cls.Ptr = cret
212	return cls
213}
214
215var xPopoverGetAutohide func(uintptr) bool
216
217// Returns whether the popover is modal.
218//
219// See [method@Gtk.Popover.set_autohide] for the
220// implications of this.
221func (x *Popover) GetAutohide() bool {
222
223	cret := xPopoverGetAutohide(x.GoPointer())
224	return cret
225}
226
227var xPopoverGetCascadePopdown func(uintptr) bool
228
229// Returns whether the popover will close after a modal child is closed.
230func (x *Popover) GetCascadePopdown() bool {
231
232	cret := xPopoverGetCascadePopdown(x.GoPointer())
233	return cret
234}
235
236var xPopoverGetChild func(uintptr) uintptr
237
238// Gets the child widget of @popover.
239func (x *Popover) GetChild() *Widget {
240	var cls *Widget
241
242	cret := xPopoverGetChild(x.GoPointer())
243
244	if cret == 0 {
245		return nil
246	}
247	gobject.IncreaseRef(cret)
248	cls = &Widget{}
249	cls.Ptr = cret
250	return cls
251}
252
253var xPopoverGetHasArrow func(uintptr) bool
254
255// Gets whether this popover is showing an arrow
256// pointing at the widget that it is relative to.
257func (x *Popover) GetHasArrow() bool {
258
259	cret := xPopoverGetHasArrow(x.GoPointer())
260	return cret
261}
262
263var xPopoverGetMnemonicsVisible func(uintptr) bool
264
265// Gets whether mnemonics are visible.
266func (x *Popover) GetMnemonicsVisible() bool {
267
268	cret := xPopoverGetMnemonicsVisible(x.GoPointer())
269	return cret
270}
271
272var xPopoverGetOffset func(uintptr, *int, *int)
273
274// Gets the offset previous set with [method@Gtk.Popover.set_offset].
275func (x *Popover) GetOffset(XOffsetVar *int, YOffsetVar *int) {
276
277	xPopoverGetOffset(x.GoPointer(), XOffsetVar, YOffsetVar)
278
279}
280
281var xPopoverGetPointingTo func(uintptr, *gdk.Rectangle) bool
282
283// Gets the rectangle that the popover points to.
284//
285// If a rectangle to point to has been set, this function will
286// return %TRUE and fill in @rect with such rectangle, otherwise
287// it will return %FALSE and fill in @rect with the parent
288// widget coordinates.
289func (x *Popover) GetPointingTo(RectVar *gdk.Rectangle) bool {
290
291	cret := xPopoverGetPointingTo(x.GoPointer(), RectVar)
292	return cret
293}
294
295var xPopoverGetPosition func(uintptr) PositionType
296
297// Returns the preferred position of @popover.
298func (x *Popover) GetPosition() PositionType {
299
300	cret := xPopoverGetPosition(x.GoPointer())
301	return cret
302}
303
304var xPopoverPopdown func(uintptr)
305
306// Pops @popover down.
307//
308// This may have the side-effect of closing a parent popover
309// as well. See [property@Gtk.Popover:cascade-popdown].
310func (x *Popover) Popdown() {
311
312	xPopoverPopdown(x.GoPointer())
313
314}
315
316var xPopoverPopup func(uintptr)
317
318// Pops @popover up.
319func (x *Popover) Popup() {
320
321	xPopoverPopup(x.GoPointer())
322
323}
324
325var xPopoverPresent func(uintptr)
326
327// Allocate a size for the `GtkPopover`.
328//
329// This function needs to be called in size-allocate by widgets
330// who have a `GtkPopover` as child. When using a layout manager,
331// this is happening automatically.
332//
333// To make a popover appear on screen, use [method@Gtk.Popover.popup].
334func (x *Popover) Present() {
335
336	xPopoverPresent(x.GoPointer())
337
338}
339
340var xPopoverSetAutohide func(uintptr, bool)
341
342// Sets whether @popover is modal.
343//
344// A modal popover will grab the keyboard focus on it when being
345// displayed. Focus will wrap around within the popover. Clicking
346// outside the popover area or pressing Esc will dismiss the popover.
347//
348// Called this function on an already showing popup with a new
349// autohide value different from the current one, will cause the
350// popup to be hidden.
351func (x *Popover) SetAutohide(AutohideVar bool) {
352
353	xPopoverSetAutohide(x.GoPointer(), AutohideVar)
354
355}
356
357var xPopoverSetCascadePopdown func(uintptr, bool)
358
359// If @cascade_popdown is %TRUE, the popover will be
360// closed when a child modal popover is closed.
361//
362// If %FALSE, @popover will stay visible.
363func (x *Popover) SetCascadePopdown(CascadePopdownVar bool) {
364
365	xPopoverSetCascadePopdown(x.GoPointer(), CascadePopdownVar)
366
367}
368
369var xPopoverSetChild func(uintptr, uintptr)
370
371// Sets the child widget of @popover.
372func (x *Popover) SetChild(ChildVar *Widget) {
373
374	xPopoverSetChild(x.GoPointer(), ChildVar.GoPointer())
375
376}
377
378var xPopoverSetDefaultWidget func(uintptr, uintptr)
379
380// Sets the default widget of a `GtkPopover`.
381//
382// The default widget is the widget that’s activated when the user
383// presses Enter in a dialog (for example). This function sets or
384// unsets the default widget for a `GtkPopover`.
385func (x *Popover) SetDefaultWidget(WidgetVar *Widget) {
386
387	xPopoverSetDefaultWidget(x.GoPointer(), WidgetVar.GoPointer())
388
389}
390
391var xPopoverSetHasArrow func(uintptr, bool)
392
393// Sets whether this popover should draw an arrow
394// pointing at the widget it is relative to.
395func (x *Popover) SetHasArrow(HasArrowVar bool) {
396
397	xPopoverSetHasArrow(x.GoPointer(), HasArrowVar)
398
399}
400
401var xPopoverSetMnemonicsVisible func(uintptr, bool)
402
403// Sets whether mnemonics should be visible.
404func (x *Popover) SetMnemonicsVisible(MnemonicsVisibleVar bool) {
405
406	xPopoverSetMnemonicsVisible(x.GoPointer(), MnemonicsVisibleVar)
407
408}
409
410var xPopoverSetOffset func(uintptr, int, int)
411
412// Sets the offset to use when calculating the position
413// of the popover.
414//
415// These values are used when preparing the [struct@Gdk.PopupLayout]
416// for positioning the popover.
417func (x *Popover) SetOffset(XOffsetVar int, YOffsetVar int) {
418
419	xPopoverSetOffset(x.GoPointer(), XOffsetVar, YOffsetVar)
420
421}
422
423var xPopoverSetPointingTo func(uintptr, *gdk.Rectangle)
424
425// Sets the rectangle that @popover points to.
426//
427// This is in the coordinate space of the @popover parent.
428func (x *Popover) SetPointingTo(RectVar *gdk.Rectangle) {
429
430	xPopoverSetPointingTo(x.GoPointer(), RectVar)
431
432}
433
434var xPopoverSetPosition func(uintptr, PositionType)
435
436// Sets the preferred position for @popover to appear.
437//
438// If the @popover is currently visible, it will be immediately
439// updated.
440//
441// This preference will be respected where possible, although
442// on lack of space (eg. if close to the window edges), the
443// `GtkPopover` may choose to appear on the opposite side.
444func (x *Popover) SetPosition(PositionVar PositionType) {
445
446	xPopoverSetPosition(x.GoPointer(), PositionVar)
447
448}
449
450func (c *Popover) GoPointer() uintptr {
451	if c == nil {
452		return 0
453	}
454	return c.Ptr
455}
456
457func (c *Popover) SetGoPointer(ptr uintptr) {
458	c.Ptr = ptr
459}
460
461// SetPropertyAutohide sets the "autohide" property.
462// Whether to dismiss the popover on outside clicks.
463func (x *Popover) SetPropertyAutohide(value bool) {
464	var v gobject.Value
465	v.Init(gobject.TypeBooleanVal)
466	v.SetBoolean(value)
467	x.SetProperty("autohide", &v)
468}
469
470// GetPropertyAutohide gets the "autohide" property.
471// Whether to dismiss the popover on outside clicks.
472func (x *Popover) GetPropertyAutohide() bool {
473	var v gobject.Value
474	x.GetProperty("autohide", &v)
475	return v.GetBoolean()
476}
477
478// SetPropertyCascadePopdown sets the "cascade-popdown" property.
479// Whether the popover pops down after a child popover.
480//
481// This is used to implement the expected behavior of submenus.
482func (x *Popover) SetPropertyCascadePopdown(value bool) {
483	var v gobject.Value
484	v.Init(gobject.TypeBooleanVal)
485	v.SetBoolean(value)
486	x.SetProperty("cascade-popdown", &v)
487}
488
489// GetPropertyCascadePopdown gets the "cascade-popdown" property.
490// Whether the popover pops down after a child popover.
491//
492// This is used to implement the expected behavior of submenus.
493func (x *Popover) GetPropertyCascadePopdown() bool {
494	var v gobject.Value
495	x.GetProperty("cascade-popdown", &v)
496	return v.GetBoolean()
497}
498
499// SetPropertyHasArrow sets the "has-arrow" property.
500// Whether to draw an arrow.
501func (x *Popover) SetPropertyHasArrow(value bool) {
502	var v gobject.Value
503	v.Init(gobject.TypeBooleanVal)
504	v.SetBoolean(value)
505	x.SetProperty("has-arrow", &v)
506}
507
508// GetPropertyHasArrow gets the "has-arrow" property.
509// Whether to draw an arrow.
510func (x *Popover) GetPropertyHasArrow() bool {
511	var v gobject.Value
512	x.GetProperty("has-arrow", &v)
513	return v.GetBoolean()
514}
515
516// SetPropertyMnemonicsVisible sets the "mnemonics-visible" property.
517// Whether mnemonics are currently visible in this popover.
518func (x *Popover) SetPropertyMnemonicsVisible(value bool) {
519	var v gobject.Value
520	v.Init(gobject.TypeBooleanVal)
521	v.SetBoolean(value)
522	x.SetProperty("mnemonics-visible", &v)
523}
524
525// GetPropertyMnemonicsVisible gets the "mnemonics-visible" property.
526// Whether mnemonics are currently visible in this popover.
527func (x *Popover) GetPropertyMnemonicsVisible() bool {
528	var v gobject.Value
529	x.GetProperty("mnemonics-visible", &v)
530	return v.GetBoolean()
531}
532
533// SetPropertyPointingTo sets the "pointing-to" property.
534// Rectangle in the parent widget that the popover points to.
535func (x *Popover) SetPropertyPointingTo(value uintptr) {
536	var v gobject.Value
537	v.Init(gobject.TypePointerVal)
538	v.SetPointer(value)
539	x.SetProperty("pointing-to", &v)
540}
541
542// GetPropertyPointingTo gets the "pointing-to" property.
543// Rectangle in the parent widget that the popover points to.
544func (x *Popover) GetPropertyPointingTo() uintptr {
545	var v gobject.Value
546	x.GetProperty("pointing-to", &v)
547	return v.GetPointer()
548}
549
550// Emitted whend the user activates the default widget.
551//
552// This is a [keybinding signal](class.SignalAction.html).
553//
554// The default binding for this signal is <kbd>Enter</kbd>.
555func (x *Popover) ConnectActivateDefault(cb *func(Popover)) uint {
556	cbPtr := uintptr(unsafe.Pointer(cb))
557	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
558		handlerID := gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)
559		glib.SaveHandlerMapping(handlerID, cbPtr)
560		return handlerID
561	}
562
563	fcb := func(clsPtr uintptr) {
564		fa := Popover{}
565		fa.Ptr = clsPtr
566		cbFn := *cb
567
568		cbFn(fa)
569
570	}
571	cbRefPtr := purego.NewCallback(fcb)
572	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
573	handlerID := gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)
574	glib.SaveHandlerMapping(handlerID, cbPtr)
575	return handlerID
576}
577
578// Emitted when the popover is closed.
579func (x *Popover) ConnectClosed(cb *func(Popover)) uint {
580	cbPtr := uintptr(unsafe.Pointer(cb))
581	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
582		handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
583		glib.SaveHandlerMapping(handlerID, cbPtr)
584		return handlerID
585	}
586
587	fcb := func(clsPtr uintptr) {
588		fa := Popover{}
589		fa.Ptr = clsPtr
590		cbFn := *cb
591
592		cbFn(fa)
593
594	}
595	cbRefPtr := purego.NewCallback(fcb)
596	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
597	handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
598	glib.SaveHandlerMapping(handlerID, cbPtr)
599	return handlerID
600}
601
602// Requests the user's screen reader to announce the given message.
603//
604// This kind of notification is useful for messages that
605// either have only a visual representation or that are not
606// exposed visually at all, e.g. a notification about a
607// successful operation.
608//
609// Also, by using this API, you can ensure that the message
610// does not interrupts the user's current screen reader output.
611func (x *Popover) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
612
613	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
614
615}
616
617// Retrieves the accessible parent for an accessible object.
618//
619// This function returns `NULL` for top level widgets.
620func (x *Popover) GetAccessibleParent() *AccessibleBase {
621	var cls *AccessibleBase
622
623	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
624
625	if cret == 0 {
626		return nil
627	}
628	cls = &AccessibleBase{}
629	cls.Ptr = cret
630	return cls
631}
632
633// Retrieves the accessible role of an accessible object.
634func (x *Popover) GetAccessibleRole() AccessibleRole {
635
636	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
637	return cret
638}
639
640// Retrieves the implementation for the given accessible object.
641func (x *Popover) GetAtContext() *ATContext {
642	var cls *ATContext
643
644	cret := XGtkAccessibleGetAtContext(x.GoPointer())
645
646	if cret == 0 {
647		return nil
648	}
649	cls = &ATContext{}
650	cls.Ptr = cret
651	return cls
652}
653
654// Queries the coordinates and dimensions of this accessible
655//
656// This functionality can be overridden by `GtkAccessible`
657// implementations, e.g. to get the bounds from an ignored
658// child widget.
659func (x *Popover) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
660
661	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
662	return cret
663}
664
665// Retrieves the first accessible child of an accessible object.
666func (x *Popover) GetFirstAccessibleChild() *AccessibleBase {
667	var cls *AccessibleBase
668
669	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
670
671	if cret == 0 {
672		return nil
673	}
674	cls = &AccessibleBase{}
675	cls.Ptr = cret
676	return cls
677}
678
679// Retrieves the next accessible sibling of an accessible object
680func (x *Popover) GetNextAccessibleSibling() *AccessibleBase {
681	var cls *AccessibleBase
682
683	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
684
685	if cret == 0 {
686		return nil
687	}
688	cls = &AccessibleBase{}
689	cls.Ptr = cret
690	return cls
691}
692
693// Queries a platform state, such as focus.
694//
695// This functionality can be overridden by `GtkAccessible`
696// implementations, e.g. to get platform state from an ignored
697// child widget, as is the case for `GtkText` wrappers.
698func (x *Popover) GetPlatformState(StateVar AccessiblePlatformState) bool {
699
700	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
701	return cret
702}
703
704// Resets the accessible property to its default value.
705func (x *Popover) ResetProperty(PropertyVar AccessibleProperty) {
706
707	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
708
709}
710
711// Resets the accessible relation to its default value.
712func (x *Popover) ResetRelation(RelationVar AccessibleRelation) {
713
714	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
715
716}
717
718// Resets the accessible state to its default value.
719func (x *Popover) ResetState(StateVar AccessibleState) {
720
721	XGtkAccessibleResetState(x.GoPointer(), StateVar)
722
723}
724
725// Sets the parent and sibling of an accessible object.
726//
727// This function is meant to be used by accessible implementations that are
728// not part of the widget hierarchy, and but act as a logical bridge between
729// widgets. For instance, if a widget creates an object that holds metadata
730// for each child, and you want that object to implement the `GtkAccessible`
731// interface, you will use this function to ensure that the parent of each
732// child widget is the metadata object, and the parent of each metadata
733// object is the container widget.
734func (x *Popover) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
735
736	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
737
738}
739
740// Updates the next accessible sibling.
741//
742// That might be useful when a new child of a custom accessible
743// is created, and it needs to be linked to a previous child.
744func (x *Popover) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
745
746	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
747
748}
749
750// Informs ATs that the platform state has changed.
751//
752// This function should be used by `GtkAccessible` implementations that
753// have a platform state but are not widgets. Widgets handle platform
754// states automatically.
755func (x *Popover) UpdatePlatformState(StateVar AccessiblePlatformState) {
756
757	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
758
759}
760
761// Updates a list of accessible properties.
762//
763// See the [enum@Gtk.AccessibleProperty] documentation for the
764// value types of accessible properties.
765//
766// This function should be called by `GtkWidget` types whenever
767// an accessible property change must be communicated to assistive
768// technologies.
769//
770// Example:
771// ```c
772// value = gtk_adjustment_get_value (adjustment);
773// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
774//
775//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
776//	-1);
777//
778// ```
779func (x *Popover) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
780
781	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
782
783}
784
785// Updates an array of accessible properties.
786//
787// This function should be called by `GtkWidget` types whenever an accessible
788// property change must be communicated to assistive technologies.
789//
790// This function is meant to be used by language bindings.
791func (x *Popover) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
792
793	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
794
795}
796
797// Updates a list of accessible relations.
798//
799// This function should be called by `GtkWidget` types whenever an accessible
800// relation change must be communicated to assistive technologies.
801//
802// If the [enum@Gtk.AccessibleRelation] requires a list of references,
803// you should pass each reference individually, followed by `NULL`, e.g.
804//
805// ```c
806// gtk_accessible_update_relation (accessible,
807//
808//	GTK_ACCESSIBLE_RELATION_CONTROLS,
809//	  ref1, NULL,
810//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
811//	  ref1, ref2, ref3, NULL,
812//	-1);
813//
814// ```
815func (x *Popover) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
816
817	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
818
819}
820
821// Updates an array of accessible relations.
822//
823// This function should be called by `GtkWidget` types whenever an accessible
824// relation change must be communicated to assistive technologies.
825//
826// This function is meant to be used by language bindings.
827func (x *Popover) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
828
829	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
830
831}
832
833// Updates a list of accessible states.
834//
835// See the [enum@Gtk.AccessibleState] documentation for the
836// value types of accessible states.
837//
838// This function should be called by `GtkWidget` types whenever
839// an accessible state change must be communicated to assistive
840// technologies.
841//
842// Example:
843//
844// ```c
845// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
846// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
847//
848//	GTK_ACCESSIBLE_STATE_CHECKED, value,
849//	-1);
850//
851// ```
852func (x *Popover) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
853
854	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
855
856}
857
858// Updates an array of accessible states.
859//
860// This function should be called by `GtkWidget` types whenever an accessible
861// state change must be communicated to assistive technologies.
862//
863// This function is meant to be used by language bindings.
864func (x *Popover) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
865
866	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
867
868}
869
870// Gets the ID of the @buildable object.
871//
872// `GtkBuilder` sets the name based on the ID attribute
873// of the `<object>` tag used to construct the @buildable.
874func (x *Popover) GetBuildableId() string {
875
876	cret := XGtkBuildableGetBuildableId(x.GoPointer())
877	return cret
878}
879
880// Returns the renderer that is used for this `GtkNative`.
881func (x *Popover) GetRenderer() *gsk.Renderer {
882	var cls *gsk.Renderer
883
884	cret := XGtkNativeGetRenderer(x.GoPointer())
885
886	if cret == 0 {
887		return nil
888	}
889	gobject.IncreaseRef(cret)
890	cls = &gsk.Renderer{}
891	cls.Ptr = cret
892	return cls
893}
894
895// Returns the surface of this `GtkNative`.
896func (x *Popover) GetSurface() *gdk.Surface {
897	var cls *gdk.Surface
898
899	cret := XGtkNativeGetSurface(x.GoPointer())
900
901	if cret == 0 {
902		return nil
903	}
904	gobject.IncreaseRef(cret)
905	cls = &gdk.Surface{}
906	cls.Ptr = cret
907	return cls
908}
909
910// Retrieves the surface transform of @self.
911//
912// This is the translation from @self's surface coordinates into
913// @self's widget coordinates.
914func (x *Popover) GetSurfaceTransform(XVar *float64, YVar *float64) {
915
916	XGtkNativeGetSurfaceTransform(x.GoPointer(), XVar, YVar)
917
918}
919
920// Realizes a `GtkNative`.
921//
922// This should only be used by subclasses.
923func (x *Popover) Realize() {
924
925	XGtkNativeRealize(x.GoPointer())
926
927}
928
929// Unrealizes a `GtkNative`.
930//
931// This should only be used by subclasses.
932func (x *Popover) Unrealize() {
933
934	XGtkNativeUnrealize(x.GoPointer())
935
936}
937
938func init() {
939	core.SetPackageName("GTK", "gtk4")
940	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
941	var libs []uintptr
942	for _, libPath := range core.GetPaths("GTK") {
943		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
944		if err != nil {
945			panic(err)
946		}
947		libs = append(libs, lib)
948	}
949
950	core.PuregoSafeRegister(&xPopoverGLibType, libs, "gtk_popover_get_type")
951
952	core.PuregoSafeRegister(&xNewPopover, libs, "gtk_popover_new")
953
954	core.PuregoSafeRegister(&xPopoverGetAutohide, libs, "gtk_popover_get_autohide")
955	core.PuregoSafeRegister(&xPopoverGetCascadePopdown, libs, "gtk_popover_get_cascade_popdown")
956	core.PuregoSafeRegister(&xPopoverGetChild, libs, "gtk_popover_get_child")
957	core.PuregoSafeRegister(&xPopoverGetHasArrow, libs, "gtk_popover_get_has_arrow")
958	core.PuregoSafeRegister(&xPopoverGetMnemonicsVisible, libs, "gtk_popover_get_mnemonics_visible")
959	core.PuregoSafeRegister(&xPopoverGetOffset, libs, "gtk_popover_get_offset")
960	core.PuregoSafeRegister(&xPopoverGetPointingTo, libs, "gtk_popover_get_pointing_to")
961	core.PuregoSafeRegister(&xPopoverGetPosition, libs, "gtk_popover_get_position")
962	core.PuregoSafeRegister(&xPopoverPopdown, libs, "gtk_popover_popdown")
963	core.PuregoSafeRegister(&xPopoverPopup, libs, "gtk_popover_popup")
964	core.PuregoSafeRegister(&xPopoverPresent, libs, "gtk_popover_present")
965	core.PuregoSafeRegister(&xPopoverSetAutohide, libs, "gtk_popover_set_autohide")
966	core.PuregoSafeRegister(&xPopoverSetCascadePopdown, libs, "gtk_popover_set_cascade_popdown")
967	core.PuregoSafeRegister(&xPopoverSetChild, libs, "gtk_popover_set_child")
968	core.PuregoSafeRegister(&xPopoverSetDefaultWidget, libs, "gtk_popover_set_default_widget")
969	core.PuregoSafeRegister(&xPopoverSetHasArrow, libs, "gtk_popover_set_has_arrow")
970	core.PuregoSafeRegister(&xPopoverSetMnemonicsVisible, libs, "gtk_popover_set_mnemonics_visible")
971	core.PuregoSafeRegister(&xPopoverSetOffset, libs, "gtk_popover_set_offset")
972	core.PuregoSafeRegister(&xPopoverSetPointingTo, libs, "gtk_popover_set_pointing_to")
973	core.PuregoSafeRegister(&xPopoverSetPosition, libs, "gtk_popover_set_position")
974
975}

Keyboard shortcuts

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

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

Branches 1

Tags 102

↑↓ moveenter openesc close