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 SpinnerClass struct {
17 _ structs.HostLayout
18
19 ParentClass gtk.WidgetClass
20}
21
22func (x *SpinnerClass) GoPointer() uintptr {
23 return uintptr(unsafe.Pointer(x))
24}
25
26// A widget showing a loading spinner.
27//
28// <picture>
29//
30// <source srcset="spinner-dark.png" media="(prefers-color-scheme: dark)">
31// <img src="spinner.png" alt="spinner">
32//
33// </picture>
34//
35// The size of the spinner depends on the available size, never smaller than
36// 16×16 pixels and never larger than 64×64 pixels.
37//
38// Use the [property@Gtk.Widget:halign] and [property@Gtk.Widget:valign]
39// properties in combination with [property@Gtk.Widget:width-request] and
40// [property@Gtk.Widget:height-request] for fine sizing control.
41//
42// For example, the following snippet shows the spinner at 48×48 pixels:
43//
44// ```xml
45// <object class="AdwSpinner">
46//
47// <property name="halign">center</property>
48// <property name="valign">center</property>
49// <property name="width-request">48</property>
50// <property name="height-request">48</property>
51//
52// </object>
53// ```
54//
55// See [class@SpinnerPaintable] for cases where using a widget is impractical or
56// impossible, such as [property@StatusPage:paintable].
57//
58// ## CSS nodes
59//
60// `AdwSpinner` has a single node with the name `image` and the style class
61// `.spinner`.
62//
63// ## Accessibility
64//
65// `AdwSpinner` uses the [enum@Gtk.AccessibleRole.progress-bar] role.
66type Spinner struct {
67 gtk.Widget
68}
69
70var xSpinnerGLibType func() types.GType
71
72func SpinnerGLibType() types.GType {
73 return xSpinnerGLibType()
74}
75
76func SpinnerNewFromInternalPtr(ptr uintptr) *Spinner {
77 cls := &Spinner{}
78 cls.Ptr = ptr
79 return cls
80}
81
82var xNewSpinner func() uintptr
83
84// Creates a new `AdwSpinner`.
85func NewSpinner() *Spinner {
86 var cls *Spinner
87
88 cret := xNewSpinner()
89
90 if cret == 0 {
91 return nil
92 }
93 gobject.IncreaseRef(cret)
94 cls = &Spinner{}
95 cls.Ptr = cret
96 return cls
97}
98
99func (c *Spinner) GoPointer() uintptr {
100 if c == nil {
101 return 0
102 }
103 return c.Ptr
104}
105
106func (c *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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 *Spinner) 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(&xSpinnerGLibType, libs, "adw_spinner_get_type")
401
402 core.PuregoSafeRegister(&xNewSpinner, libs, "adw_spinner_new")
403
404}