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/gobject"
12 "github.com/bnema/puregotk/v4/gobject/types"
13 "github.com/bnema/puregotk/v4/gtk"
14)
15
16type BinClass struct {
17 _ structs.HostLayout
18
19 ParentClass gtk.WidgetClass
20}
21
22func (x *BinClass) GoPointer() uintptr {
23 return uintptr(unsafe.Pointer(x))
24}
25
26// A widget with one child.
27//
28// <picture>
29//
30// <source srcset="bin-dark.png" media="(prefers-color-scheme: dark)">
31// <img src="bin.png" alt="bin">
32//
33// </picture>
34//
35// The `AdwBin` widget has only one child, set with the [property@Bin:child]
36// property.
37//
38// It is useful for deriving subclasses, since it provides common code needed
39// for handling a single child widget.
40type Bin struct {
41 gtk.Widget
42}
43
44var xBinGLibType func() types.GType
45
46func BinGLibType() types.GType {
47 return xBinGLibType()
48}
49
50func BinNewFromInternalPtr(ptr uintptr) *Bin {
51 cls := &Bin{}
52 cls.Ptr = ptr
53 return cls
54}
55
56var xNewBin func() uintptr
57
58// Creates a new `AdwBin`.
59func NewBin() *Bin {
60 var cls *Bin
61
62 cret := xNewBin()
63
64 if cret == 0 {
65 return nil
66 }
67 gobject.IncreaseRef(cret)
68 cls = &Bin{}
69 cls.Ptr = cret
70 return cls
71}
72
73var xBinGetChild func(uintptr) uintptr
74
75// Gets the child widget of @self.
76func (x *Bin) GetChild() *gtk.Widget {
77 var cls *gtk.Widget
78
79 cret := xBinGetChild(x.GoPointer())
80
81 if cret == 0 {
82 return nil
83 }
84 gobject.IncreaseRef(cret)
85 cls = >k.Widget{}
86 cls.Ptr = cret
87 return cls
88}
89
90var xBinSetChild func(uintptr, uintptr)
91
92// Sets the child widget of @self.
93func (x *Bin) SetChild(ChildVar *gtk.Widget) {
94
95 xBinSetChild(x.GoPointer(), ChildVar.GoPointer())
96
97}
98
99func (c *Bin) GoPointer() uintptr {
100 if c == nil {
101 return 0
102 }
103 return c.Ptr
104}
105
106func (c *Bin) SetGoPointer(ptr uintptr) {
107 c.Ptr = ptr
108}
109
110// Requests the user's screen reader to announce the given message.
111//
112// This kind of notification is useful for messages that
113// either have only a visual representation or that are not
114// exposed visually at all, e.g. a notification about a
115// successful operation.
116//
117// Also, by using this API, you can ensure that the message
118// does not interrupts the user's current screen reader output.
119func (x *Bin) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
120
121 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
122
123}
124
125// Retrieves the accessible parent for an accessible object.
126//
127// This function returns `NULL` for top level widgets.
128func (x *Bin) GetAccessibleParent() *gtk.AccessibleBase {
129 var cls *gtk.AccessibleBase
130
131 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
132
133 if cret == 0 {
134 return nil
135 }
136 cls = >k.AccessibleBase{}
137 cls.Ptr = cret
138 return cls
139}
140
141// Retrieves the accessible role of an accessible object.
142func (x *Bin) GetAccessibleRole() gtk.AccessibleRole {
143
144 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
145 return cret
146}
147
148// Retrieves the implementation for the given accessible object.
149func (x *Bin) GetAtContext() *gtk.ATContext {
150 var cls *gtk.ATContext
151
152 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
153
154 if cret == 0 {
155 return nil
156 }
157 cls = >k.ATContext{}
158 cls.Ptr = cret
159 return cls
160}
161
162// Queries the coordinates and dimensions of this accessible
163//
164// This functionality can be overridden by `GtkAccessible`
165// implementations, e.g. to get the bounds from an ignored
166// child widget.
167func (x *Bin) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
168
169 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
170 return cret
171}
172
173// Retrieves the first accessible child of an accessible object.
174func (x *Bin) GetFirstAccessibleChild() *gtk.AccessibleBase {
175 var cls *gtk.AccessibleBase
176
177 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
178
179 if cret == 0 {
180 return nil
181 }
182 cls = >k.AccessibleBase{}
183 cls.Ptr = cret
184 return cls
185}
186
187// Retrieves the next accessible sibling of an accessible object
188func (x *Bin) GetNextAccessibleSibling() *gtk.AccessibleBase {
189 var cls *gtk.AccessibleBase
190
191 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
192
193 if cret == 0 {
194 return nil
195 }
196 cls = >k.AccessibleBase{}
197 cls.Ptr = cret
198 return cls
199}
200
201// Queries a platform state, such as focus.
202//
203// This functionality can be overridden by `GtkAccessible`
204// implementations, e.g. to get platform state from an ignored
205// child widget, as is the case for `GtkText` wrappers.
206func (x *Bin) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
207
208 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
209 return cret
210}
211
212// Resets the accessible property to its default value.
213func (x *Bin) ResetProperty(PropertyVar gtk.AccessibleProperty) {
214
215 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
216
217}
218
219// Resets the accessible relation to its default value.
220func (x *Bin) ResetRelation(RelationVar gtk.AccessibleRelation) {
221
222 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
223
224}
225
226// Resets the accessible state to its default value.
227func (x *Bin) ResetState(StateVar gtk.AccessibleState) {
228
229 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
230
231}
232
233// Sets the parent and sibling of an accessible object.
234//
235// This function is meant to be used by accessible implementations that are
236// not part of the widget hierarchy, and but act as a logical bridge between
237// widgets. For instance, if a widget creates an object that holds metadata
238// for each child, and you want that object to implement the `GtkAccessible`
239// interface, you will use this function to ensure that the parent of each
240// child widget is the metadata object, and the parent of each metadata
241// object is the container widget.
242func (x *Bin) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
243
244 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
245
246}
247
248// Updates the next accessible sibling.
249//
250// That might be useful when a new child of a custom accessible
251// is created, and it needs to be linked to a previous child.
252func (x *Bin) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
253
254 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
255
256}
257
258// Informs ATs that the platform state has changed.
259//
260// This function should be used by `GtkAccessible` implementations that
261// have a platform state but are not widgets. Widgets handle platform
262// states automatically.
263func (x *Bin) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
264
265 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
266
267}
268
269// Updates a list of accessible properties.
270//
271// See the [enum@Gtk.AccessibleProperty] documentation for the
272// value types of accessible properties.
273//
274// This function should be called by `GtkWidget` types whenever
275// an accessible property change must be communicated to assistive
276// technologies.
277//
278// Example:
279// ```c
280// value = gtk_adjustment_get_value (adjustment);
281// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
282//
283// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
284// -1);
285//
286// ```
287func (x *Bin) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
288
289 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
290
291}
292
293// Updates an array of accessible properties.
294//
295// This function should be called by `GtkWidget` types whenever an accessible
296// property change must be communicated to assistive technologies.
297//
298// This function is meant to be used by language bindings.
299func (x *Bin) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
300
301 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
302
303}
304
305// Updates a list of accessible relations.
306//
307// This function should be called by `GtkWidget` types whenever an accessible
308// relation change must be communicated to assistive technologies.
309//
310// If the [enum@Gtk.AccessibleRelation] requires a list of references,
311// you should pass each reference individually, followed by `NULL`, e.g.
312//
313// ```c
314// gtk_accessible_update_relation (accessible,
315//
316// GTK_ACCESSIBLE_RELATION_CONTROLS,
317// ref1, NULL,
318// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
319// ref1, ref2, ref3, NULL,
320// -1);
321//
322// ```
323func (x *Bin) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
324
325 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
326
327}
328
329// Updates an array of accessible relations.
330//
331// This function should be called by `GtkWidget` types whenever an accessible
332// relation change must be communicated to assistive technologies.
333//
334// This function is meant to be used by language bindings.
335func (x *Bin) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
336
337 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
338
339}
340
341// Updates a list of accessible states.
342//
343// See the [enum@Gtk.AccessibleState] documentation for the
344// value types of accessible states.
345//
346// This function should be called by `GtkWidget` types whenever
347// an accessible state change must be communicated to assistive
348// technologies.
349//
350// Example:
351//
352// ```c
353// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
354// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
355//
356// GTK_ACCESSIBLE_STATE_CHECKED, value,
357// -1);
358//
359// ```
360func (x *Bin) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
361
362 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
363
364}
365
366// Updates an array of accessible states.
367//
368// This function should be called by `GtkWidget` types whenever an accessible
369// state change must be communicated to assistive technologies.
370//
371// This function is meant to be used by language bindings.
372func (x *Bin) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
373
374 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
375
376}
377
378// Gets the ID of the @buildable object.
379//
380// `GtkBuilder` sets the name based on the ID attribute
381// of the `<object>` tag used to construct the @buildable.
382func (x *Bin) GetBuildableId() string {
383
384 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
385 return cret
386}
387
388func init() {
389 core.SetPackageName("ADW", "libadwaita-1")
390 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
391 var libs []uintptr
392 for _, libPath := range core.GetPaths("ADW") {
393 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
394 if err != nil {
395 panic(err)
396 }
397 libs = append(libs, lib)
398 }
399
400 core.PuregoSafeRegister(&xBinGLibType, libs, "adw_bin_get_type")
401
402 core.PuregoSafeRegister(&xNewBin, libs, "adw_bin_new")
403
404 core.PuregoSafeRegister(&xBinGetChild, libs, "adw_bin_get_child")
405 core.PuregoSafeRegister(&xBinSetChild, libs, "adw_bin_set_child")
406
407}