1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5 "github.com/ebitengine/purego"
6
7 "github.com/bnema/puregotk/pkg/core"
8 "github.com/bnema/puregotk/v4/gobject"
9 "github.com/bnema/puregotk/v4/gobject/types"
10)
11
12// These enumeration values describe the possible transitions
13// when the child of a `GtkRevealer` widget is shown or hidden.
14type RevealerTransitionType int
15
16var xRevealerTransitionTypeGLibType func() types.GType
17
18func RevealerTransitionTypeGLibType() types.GType {
19 return xRevealerTransitionTypeGLibType()
20}
21
22const (
23
24 // No transition
25 RevealerTransitionTypeNoneValue RevealerTransitionType = 0
26 // Fade in
27 RevealerTransitionTypeCrossfadeValue RevealerTransitionType = 1
28 // Slide in from the left
29 RevealerTransitionTypeSlideRightValue RevealerTransitionType = 2
30 // Slide in from the right
31 RevealerTransitionTypeSlideLeftValue RevealerTransitionType = 3
32 // Slide in from the bottom
33 RevealerTransitionTypeSlideUpValue RevealerTransitionType = 4
34 // Slide in from the top
35 RevealerTransitionTypeSlideDownValue RevealerTransitionType = 5
36 // Floop in from the left
37 RevealerTransitionTypeSwingRightValue RevealerTransitionType = 6
38 // Floop in from the right
39 RevealerTransitionTypeSwingLeftValue RevealerTransitionType = 7
40 // Floop in from the bottom
41 RevealerTransitionTypeSwingUpValue RevealerTransitionType = 8
42 // Floop in from the top
43 RevealerTransitionTypeSwingDownValue RevealerTransitionType = 9
44)
45
46// Animates the transition of its child from invisible to visible.
47//
48// The style of transition can be controlled with
49// [method@Gtk.Revealer.set_transition_type].
50//
51// These animations respect the [property@Gtk.Settings:gtk-enable-animations]
52// setting.
53//
54// # CSS nodes
55//
56// `GtkRevealer` has a single CSS node with name revealer.
57// When styling `GtkRevealer` using CSS, remember that it only hides its contents,
58// not itself. That means applied margin, padding and borders will be visible even
59// when the [property@Gtk.Revealer:reveal-child] property is set to %FALSE.
60//
61// # Accessibility
62//
63// `GtkRevealer` uses the [enum@Gtk.AccessibleRole.group] role.
64//
65// The child of `GtkRevealer`, if set, is always available in the accessibility
66// tree, regardless of the state of the revealer widget.
67type Revealer struct {
68 Widget
69}
70
71var xRevealerGLibType func() types.GType
72
73func RevealerGLibType() types.GType {
74 return xRevealerGLibType()
75}
76
77func RevealerNewFromInternalPtr(ptr uintptr) *Revealer {
78 cls := &Revealer{}
79 cls.Ptr = ptr
80 return cls
81}
82
83var xNewRevealer func() uintptr
84
85// Creates a new `GtkRevealer`.
86func NewRevealer() *Revealer {
87 var cls *Revealer
88
89 cret := xNewRevealer()
90
91 if cret == 0 {
92 return nil
93 }
94 gobject.IncreaseRef(cret)
95 cls = &Revealer{}
96 cls.Ptr = cret
97 return cls
98}
99
100var xRevealerGetChild func(uintptr) uintptr
101
102// Gets the child widget of @revealer.
103func (x *Revealer) GetChild() *Widget {
104 var cls *Widget
105
106 cret := xRevealerGetChild(x.GoPointer())
107
108 if cret == 0 {
109 return nil
110 }
111 gobject.IncreaseRef(cret)
112 cls = &Widget{}
113 cls.Ptr = cret
114 return cls
115}
116
117var xRevealerGetChildRevealed func(uintptr) bool
118
119// Returns whether the child is fully revealed.
120//
121// In other words, this returns whether the transition
122// to the revealed state is completed.
123func (x *Revealer) GetChildRevealed() bool {
124
125 cret := xRevealerGetChildRevealed(x.GoPointer())
126 return cret
127}
128
129var xRevealerGetRevealChild func(uintptr) bool
130
131// Returns whether the child is currently revealed.
132//
133// This function returns %TRUE as soon as the transition
134// is to the revealed state is started. To learn whether
135// the child is fully revealed (ie the transition is completed),
136// use [method@Gtk.Revealer.get_child_revealed].
137func (x *Revealer) GetRevealChild() bool {
138
139 cret := xRevealerGetRevealChild(x.GoPointer())
140 return cret
141}
142
143var xRevealerGetTransitionDuration func(uintptr) uint
144
145// Returns the amount of time (in milliseconds) that
146// transitions will take.
147func (x *Revealer) GetTransitionDuration() uint {
148
149 cret := xRevealerGetTransitionDuration(x.GoPointer())
150 return cret
151}
152
153var xRevealerGetTransitionType func(uintptr) RevealerTransitionType
154
155// Gets the type of animation that will be used
156// for transitions in @revealer.
157func (x *Revealer) GetTransitionType() RevealerTransitionType {
158
159 cret := xRevealerGetTransitionType(x.GoPointer())
160 return cret
161}
162
163var xRevealerSetChild func(uintptr, uintptr)
164
165// Sets the child widget of @revealer.
166func (x *Revealer) SetChild(ChildVar *Widget) {
167
168 xRevealerSetChild(x.GoPointer(), ChildVar.GoPointer())
169
170}
171
172var xRevealerSetRevealChild func(uintptr, bool)
173
174// Tells the `GtkRevealer` to reveal or conceal its child.
175//
176// The transition will be animated with the current
177// transition type of @revealer.
178func (x *Revealer) SetRevealChild(RevealChildVar bool) {
179
180 xRevealerSetRevealChild(x.GoPointer(), RevealChildVar)
181
182}
183
184var xRevealerSetTransitionDuration func(uintptr, uint)
185
186// Sets the duration that transitions will take.
187func (x *Revealer) SetTransitionDuration(DurationVar uint) {
188
189 xRevealerSetTransitionDuration(x.GoPointer(), DurationVar)
190
191}
192
193var xRevealerSetTransitionType func(uintptr, RevealerTransitionType)
194
195// Sets the type of animation that will be used for
196// transitions in @revealer.
197//
198// Available types include various kinds of fades and slides.
199func (x *Revealer) SetTransitionType(TransitionVar RevealerTransitionType) {
200
201 xRevealerSetTransitionType(x.GoPointer(), TransitionVar)
202
203}
204
205func (c *Revealer) GoPointer() uintptr {
206 if c == nil {
207 return 0
208 }
209 return c.Ptr
210}
211
212func (c *Revealer) SetGoPointer(ptr uintptr) {
213 c.Ptr = ptr
214}
215
216// GetPropertyChildRevealed gets the "child-revealed" property.
217// Whether the child is revealed and the animation target reached.
218func (x *Revealer) GetPropertyChildRevealed() bool {
219 var v gobject.Value
220 x.GetProperty("child-revealed", &v)
221 return v.GetBoolean()
222}
223
224// SetPropertyRevealChild sets the "reveal-child" property.
225// Whether the revealer should reveal the child.
226func (x *Revealer) SetPropertyRevealChild(value bool) {
227 var v gobject.Value
228 v.Init(gobject.TypeBooleanVal)
229 v.SetBoolean(value)
230 x.SetProperty("reveal-child", &v)
231}
232
233// GetPropertyRevealChild gets the "reveal-child" property.
234// Whether the revealer should reveal the child.
235func (x *Revealer) GetPropertyRevealChild() bool {
236 var v gobject.Value
237 x.GetProperty("reveal-child", &v)
238 return v.GetBoolean()
239}
240
241// SetPropertyTransitionDuration sets the "transition-duration" property.
242// The animation duration, in milliseconds.
243func (x *Revealer) SetPropertyTransitionDuration(value uint) {
244 var v gobject.Value
245 v.Init(gobject.TypeUintVal)
246 v.SetUint(value)
247 x.SetProperty("transition-duration", &v)
248}
249
250// GetPropertyTransitionDuration gets the "transition-duration" property.
251// The animation duration, in milliseconds.
252func (x *Revealer) GetPropertyTransitionDuration() uint {
253 var v gobject.Value
254 x.GetProperty("transition-duration", &v)
255 return v.GetUint()
256}
257
258// Requests the user's screen reader to announce the given message.
259//
260// This kind of notification is useful for messages that
261// either have only a visual representation or that are not
262// exposed visually at all, e.g. a notification about a
263// successful operation.
264//
265// Also, by using this API, you can ensure that the message
266// does not interrupts the user's current screen reader output.
267func (x *Revealer) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
268
269 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
270
271}
272
273// Retrieves the accessible parent for an accessible object.
274//
275// This function returns `NULL` for top level widgets.
276func (x *Revealer) GetAccessibleParent() *AccessibleBase {
277 var cls *AccessibleBase
278
279 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
280
281 if cret == 0 {
282 return nil
283 }
284 cls = &AccessibleBase{}
285 cls.Ptr = cret
286 return cls
287}
288
289// Retrieves the accessible role of an accessible object.
290func (x *Revealer) GetAccessibleRole() AccessibleRole {
291
292 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
293 return cret
294}
295
296// Retrieves the implementation for the given accessible object.
297func (x *Revealer) GetAtContext() *ATContext {
298 var cls *ATContext
299
300 cret := XGtkAccessibleGetAtContext(x.GoPointer())
301
302 if cret == 0 {
303 return nil
304 }
305 cls = &ATContext{}
306 cls.Ptr = cret
307 return cls
308}
309
310// Queries the coordinates and dimensions of this accessible
311//
312// This functionality can be overridden by `GtkAccessible`
313// implementations, e.g. to get the bounds from an ignored
314// child widget.
315func (x *Revealer) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
316
317 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
318 return cret
319}
320
321// Retrieves the first accessible child of an accessible object.
322func (x *Revealer) GetFirstAccessibleChild() *AccessibleBase {
323 var cls *AccessibleBase
324
325 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
326
327 if cret == 0 {
328 return nil
329 }
330 cls = &AccessibleBase{}
331 cls.Ptr = cret
332 return cls
333}
334
335// Retrieves the next accessible sibling of an accessible object
336func (x *Revealer) GetNextAccessibleSibling() *AccessibleBase {
337 var cls *AccessibleBase
338
339 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
340
341 if cret == 0 {
342 return nil
343 }
344 cls = &AccessibleBase{}
345 cls.Ptr = cret
346 return cls
347}
348
349// Queries a platform state, such as focus.
350//
351// This functionality can be overridden by `GtkAccessible`
352// implementations, e.g. to get platform state from an ignored
353// child widget, as is the case for `GtkText` wrappers.
354func (x *Revealer) GetPlatformState(StateVar AccessiblePlatformState) bool {
355
356 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
357 return cret
358}
359
360// Resets the accessible property to its default value.
361func (x *Revealer) ResetProperty(PropertyVar AccessibleProperty) {
362
363 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
364
365}
366
367// Resets the accessible relation to its default value.
368func (x *Revealer) ResetRelation(RelationVar AccessibleRelation) {
369
370 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
371
372}
373
374// Resets the accessible state to its default value.
375func (x *Revealer) ResetState(StateVar AccessibleState) {
376
377 XGtkAccessibleResetState(x.GoPointer(), StateVar)
378
379}
380
381// Sets the parent and sibling of an accessible object.
382//
383// This function is meant to be used by accessible implementations that are
384// not part of the widget hierarchy, and but act as a logical bridge between
385// widgets. For instance, if a widget creates an object that holds metadata
386// for each child, and you want that object to implement the `GtkAccessible`
387// interface, you will use this function to ensure that the parent of each
388// child widget is the metadata object, and the parent of each metadata
389// object is the container widget.
390func (x *Revealer) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
391
392 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
393
394}
395
396// Updates the next accessible sibling.
397//
398// That might be useful when a new child of a custom accessible
399// is created, and it needs to be linked to a previous child.
400func (x *Revealer) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
401
402 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
403
404}
405
406// Informs ATs that the platform state has changed.
407//
408// This function should be used by `GtkAccessible` implementations that
409// have a platform state but are not widgets. Widgets handle platform
410// states automatically.
411func (x *Revealer) UpdatePlatformState(StateVar AccessiblePlatformState) {
412
413 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
414
415}
416
417// Updates a list of accessible properties.
418//
419// See the [enum@Gtk.AccessibleProperty] documentation for the
420// value types of accessible properties.
421//
422// This function should be called by `GtkWidget` types whenever
423// an accessible property change must be communicated to assistive
424// technologies.
425//
426// Example:
427// ```c
428// value = gtk_adjustment_get_value (adjustment);
429// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
430//
431// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
432// -1);
433//
434// ```
435func (x *Revealer) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
436
437 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
438
439}
440
441// Updates an array of accessible properties.
442//
443// This function should be called by `GtkWidget` types whenever an accessible
444// property change must be communicated to assistive technologies.
445//
446// This function is meant to be used by language bindings.
447func (x *Revealer) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
448
449 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
450
451}
452
453// Updates a list of accessible relations.
454//
455// This function should be called by `GtkWidget` types whenever an accessible
456// relation change must be communicated to assistive technologies.
457//
458// If the [enum@Gtk.AccessibleRelation] requires a list of references,
459// you should pass each reference individually, followed by `NULL`, e.g.
460//
461// ```c
462// gtk_accessible_update_relation (accessible,
463//
464// GTK_ACCESSIBLE_RELATION_CONTROLS,
465// ref1, NULL,
466// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
467// ref1, ref2, ref3, NULL,
468// -1);
469//
470// ```
471func (x *Revealer) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
472
473 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
474
475}
476
477// Updates an array of accessible relations.
478//
479// This function should be called by `GtkWidget` types whenever an accessible
480// relation change must be communicated to assistive technologies.
481//
482// This function is meant to be used by language bindings.
483func (x *Revealer) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
484
485 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
486
487}
488
489// Updates a list of accessible states.
490//
491// See the [enum@Gtk.AccessibleState] documentation for the
492// value types of accessible states.
493//
494// This function should be called by `GtkWidget` types whenever
495// an accessible state change must be communicated to assistive
496// technologies.
497//
498// Example:
499//
500// ```c
501// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
502// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
503//
504// GTK_ACCESSIBLE_STATE_CHECKED, value,
505// -1);
506//
507// ```
508func (x *Revealer) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
509
510 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
511
512}
513
514// Updates an array of accessible states.
515//
516// This function should be called by `GtkWidget` types whenever an accessible
517// state change must be communicated to assistive technologies.
518//
519// This function is meant to be used by language bindings.
520func (x *Revealer) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
521
522 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
523
524}
525
526// Gets the ID of the @buildable object.
527//
528// `GtkBuilder` sets the name based on the ID attribute
529// of the `<object>` tag used to construct the @buildable.
530func (x *Revealer) GetBuildableId() string {
531
532 cret := XGtkBuildableGetBuildableId(x.GoPointer())
533 return cret
534}
535
536func init() {
537 core.SetPackageName("GTK", "gtk4")
538 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
539 var libs []uintptr
540 for _, libPath := range core.GetPaths("GTK") {
541 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
542 if err != nil {
543 panic(err)
544 }
545 libs = append(libs, lib)
546 }
547
548 core.PuregoSafeRegister(&xRevealerTransitionTypeGLibType, libs, "gtk_revealer_transition_type_get_type")
549
550 core.PuregoSafeRegister(&xRevealerGLibType, libs, "gtk_revealer_get_type")
551
552 core.PuregoSafeRegister(&xNewRevealer, libs, "gtk_revealer_new")
553
554 core.PuregoSafeRegister(&xRevealerGetChild, libs, "gtk_revealer_get_child")
555 core.PuregoSafeRegister(&xRevealerGetChildRevealed, libs, "gtk_revealer_get_child_revealed")
556 core.PuregoSafeRegister(&xRevealerGetRevealChild, libs, "gtk_revealer_get_reveal_child")
557 core.PuregoSafeRegister(&xRevealerGetTransitionDuration, libs, "gtk_revealer_get_transition_duration")
558 core.PuregoSafeRegister(&xRevealerGetTransitionType, libs, "gtk_revealer_get_transition_type")
559 core.PuregoSafeRegister(&xRevealerSetChild, libs, "gtk_revealer_set_child")
560 core.PuregoSafeRegister(&xRevealerSetRevealChild, libs, "gtk_revealer_set_reveal_child")
561 core.PuregoSafeRegister(&xRevealerSetTransitionDuration, libs, "gtk_revealer_set_transition_duration")
562 core.PuregoSafeRegister(&xRevealerSetTransitionType, libs, "gtk_revealer_set_transition_type")
563
564}