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/gobject"
13 "github.com/bnema/puregotk/v4/gobject/types"
14 "github.com/bnema/puregotk/v4/gtk"
15)
16
17type StatusPageClass struct {
18 _ structs.HostLayout
19
20 ParentClass gtk.WidgetClass
21}
22
23func (x *StatusPageClass) GoPointer() uintptr {
24 return uintptr(unsafe.Pointer(x))
25}
26
27// A page used for empty/error states and similar use-cases.
28//
29// <picture>
30//
31// <source srcset="status-page-dark.png" media="(prefers-color-scheme: dark)">
32// <img src="status-page.png" alt="status-page">
33//
34// </picture>
35//
36// The `AdwStatusPage` widget can have an icon, a title, a description and a
37// custom widget which is displayed below them.
38//
39// ## CSS nodes
40//
41// `AdwStatusPage` has a main CSS node with name `statuspage`.
42//
43// When setting an [class@SpinnerPaintable] as [property@StatusPage:paintable],
44// the main nodes gains the `.spinner` style class for a more compact
45// appearance.
46//
47// ## Style classes
48//
49// `AdwStatusPage` can use the
50// [`.compact`](style-classes.html#compact-status-page) style class for when it
51// needs to fit into a small space such a sidebar or a popover, similar to when
52// using a spinner as the paintable.
53//
54// <picture>
55//
56// <source srcset="status-page-compact-dark.png" media="(prefers-color-scheme: dark)">
57// <img src="status-page-compact.png" alt="status-page-compact">
58//
59// </picture>
60type StatusPage struct {
61 gtk.Widget
62}
63
64var xStatusPageGLibType func() types.GType
65
66func StatusPageGLibType() types.GType {
67 return xStatusPageGLibType()
68}
69
70func StatusPageNewFromInternalPtr(ptr uintptr) *StatusPage {
71 cls := &StatusPage{}
72 cls.Ptr = ptr
73 return cls
74}
75
76var xNewStatusPage func() uintptr
77
78// Creates a new `AdwStatusPage`.
79func NewStatusPage() *StatusPage {
80 var cls *StatusPage
81
82 cret := xNewStatusPage()
83
84 if cret == 0 {
85 return nil
86 }
87 gobject.IncreaseRef(cret)
88 cls = &StatusPage{}
89 cls.Ptr = cret
90 return cls
91}
92
93var xStatusPageGetChild func(uintptr) uintptr
94
95// Gets the child widget of @self.
96func (x *StatusPage) GetChild() *gtk.Widget {
97 var cls *gtk.Widget
98
99 cret := xStatusPageGetChild(x.GoPointer())
100
101 if cret == 0 {
102 return nil
103 }
104 gobject.IncreaseRef(cret)
105 cls = >k.Widget{}
106 cls.Ptr = cret
107 return cls
108}
109
110var xStatusPageGetDescription func(uintptr) string
111
112// Gets the description markup for @self.
113func (x *StatusPage) GetDescription() string {
114
115 cret := xStatusPageGetDescription(x.GoPointer())
116 return cret
117}
118
119var xStatusPageGetIconName func(uintptr) string
120
121// Gets the icon name for @self.
122func (x *StatusPage) GetIconName() string {
123
124 cret := xStatusPageGetIconName(x.GoPointer())
125 return cret
126}
127
128var xStatusPageGetPaintable func(uintptr) uintptr
129
130// Gets the paintable for @self.
131func (x *StatusPage) GetPaintable() *gdk.PaintableBase {
132 var cls *gdk.PaintableBase
133
134 cret := xStatusPageGetPaintable(x.GoPointer())
135
136 if cret == 0 {
137 return nil
138 }
139 gobject.IncreaseRef(cret)
140 cls = &gdk.PaintableBase{}
141 cls.Ptr = cret
142 return cls
143}
144
145var xStatusPageGetTitle func(uintptr) string
146
147// Gets the title for @self.
148func (x *StatusPage) GetTitle() string {
149
150 cret := xStatusPageGetTitle(x.GoPointer())
151 return cret
152}
153
154var xStatusPageSetChild func(uintptr, uintptr)
155
156// Sets the child widget of @self.
157func (x *StatusPage) SetChild(ChildVar *gtk.Widget) {
158
159 xStatusPageSetChild(x.GoPointer(), ChildVar.GoPointer())
160
161}
162
163var xStatusPageSetDescription func(uintptr, uintptr)
164
165// Sets the description markup for @self.
166//
167// The description is displayed below the title. It is parsed as Pango markup.
168func (x *StatusPage) SetDescription(DescriptionVar *string) {
169
170 DescriptionVarPtr := core.GStrdupNullable(DescriptionVar)
171 defer core.GFreeNullable(DescriptionVarPtr)
172
173 xStatusPageSetDescription(x.GoPointer(), DescriptionVarPtr)
174
175}
176
177var xStatusPageSetIconName func(uintptr, uintptr)
178
179// Sets the icon name for @self.
180//
181// Changing this will set [property@StatusPage:paintable] to `NULL`.
182func (x *StatusPage) SetIconName(IconNameVar *string) {
183
184 IconNameVarPtr := core.GStrdupNullable(IconNameVar)
185 defer core.GFreeNullable(IconNameVarPtr)
186
187 xStatusPageSetIconName(x.GoPointer(), IconNameVarPtr)
188
189}
190
191var xStatusPageSetPaintable func(uintptr, uintptr)
192
193// Sets the paintable for @self.
194//
195// Changing this will set [property@StatusPage:icon-name] to `NULL`.
196func (x *StatusPage) SetPaintable(PaintableVar gdk.Paintable) {
197
198 xStatusPageSetPaintable(x.GoPointer(), PaintableVar.GoPointer())
199
200}
201
202var xStatusPageSetTitle func(uintptr, string)
203
204// Sets the title for @self.
205//
206// The title is displayed below the icon. It is not parsed as Pango markup.
207func (x *StatusPage) SetTitle(TitleVar string) {
208
209 xStatusPageSetTitle(x.GoPointer(), TitleVar)
210
211}
212
213func (c *StatusPage) GoPointer() uintptr {
214 if c == nil {
215 return 0
216 }
217 return c.Ptr
218}
219
220func (c *StatusPage) SetGoPointer(ptr uintptr) {
221 c.Ptr = ptr
222}
223
224// SetPropertyDescription sets the "description" property.
225// The description markup to be displayed below the title.
226func (x *StatusPage) SetPropertyDescription(value string) {
227 var v gobject.Value
228 v.Init(gobject.TypeStringVal)
229 v.SetString(&value)
230 x.SetProperty("description", &v)
231}
232
233// GetPropertyDescription gets the "description" property.
234// The description markup to be displayed below the title.
235func (x *StatusPage) GetPropertyDescription() string {
236 var v gobject.Value
237 x.GetProperty("description", &v)
238 return v.GetString()
239}
240
241// SetPropertyIconName sets the "icon-name" property.
242// The name of the icon to be used.
243//
244// Changing this will set [property@StatusPage:paintable] to `NULL`.
245func (x *StatusPage) SetPropertyIconName(value string) {
246 var v gobject.Value
247 v.Init(gobject.TypeStringVal)
248 v.SetString(&value)
249 x.SetProperty("icon-name", &v)
250}
251
252// GetPropertyIconName gets the "icon-name" property.
253// The name of the icon to be used.
254//
255// Changing this will set [property@StatusPage:paintable] to `NULL`.
256func (x *StatusPage) GetPropertyIconName() string {
257 var v gobject.Value
258 x.GetProperty("icon-name", &v)
259 return v.GetString()
260}
261
262// SetPropertyTitle sets the "title" property.
263// The title to be displayed below the icon.
264//
265// It is not parsed as Pango markup.
266func (x *StatusPage) SetPropertyTitle(value string) {
267 var v gobject.Value
268 v.Init(gobject.TypeStringVal)
269 v.SetString(&value)
270 x.SetProperty("title", &v)
271}
272
273// GetPropertyTitle gets the "title" property.
274// The title to be displayed below the icon.
275//
276// It is not parsed as Pango markup.
277func (x *StatusPage) GetPropertyTitle() string {
278 var v gobject.Value
279 x.GetProperty("title", &v)
280 return v.GetString()
281}
282
283// Requests the user's screen reader to announce the given message.
284//
285// This kind of notification is useful for messages that
286// either have only a visual representation or that are not
287// exposed visually at all, e.g. a notification about a
288// successful operation.
289//
290// Also, by using this API, you can ensure that the message
291// does not interrupts the user's current screen reader output.
292func (x *StatusPage) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
293
294 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
295
296}
297
298// Retrieves the accessible parent for an accessible object.
299//
300// This function returns `NULL` for top level widgets.
301func (x *StatusPage) GetAccessibleParent() *gtk.AccessibleBase {
302 var cls *gtk.AccessibleBase
303
304 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
305
306 if cret == 0 {
307 return nil
308 }
309 cls = >k.AccessibleBase{}
310 cls.Ptr = cret
311 return cls
312}
313
314// Retrieves the accessible role of an accessible object.
315func (x *StatusPage) GetAccessibleRole() gtk.AccessibleRole {
316
317 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
318 return cret
319}
320
321// Retrieves the implementation for the given accessible object.
322func (x *StatusPage) GetAtContext() *gtk.ATContext {
323 var cls *gtk.ATContext
324
325 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
326
327 if cret == 0 {
328 return nil
329 }
330 cls = >k.ATContext{}
331 cls.Ptr = cret
332 return cls
333}
334
335// Queries the coordinates and dimensions of this accessible
336//
337// This functionality can be overridden by `GtkAccessible`
338// implementations, e.g. to get the bounds from an ignored
339// child widget.
340func (x *StatusPage) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
341
342 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
343 return cret
344}
345
346// Retrieves the first accessible child of an accessible object.
347func (x *StatusPage) GetFirstAccessibleChild() *gtk.AccessibleBase {
348 var cls *gtk.AccessibleBase
349
350 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
351
352 if cret == 0 {
353 return nil
354 }
355 cls = >k.AccessibleBase{}
356 cls.Ptr = cret
357 return cls
358}
359
360// Retrieves the next accessible sibling of an accessible object
361func (x *StatusPage) GetNextAccessibleSibling() *gtk.AccessibleBase {
362 var cls *gtk.AccessibleBase
363
364 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
365
366 if cret == 0 {
367 return nil
368 }
369 cls = >k.AccessibleBase{}
370 cls.Ptr = cret
371 return cls
372}
373
374// Queries a platform state, such as focus.
375//
376// This functionality can be overridden by `GtkAccessible`
377// implementations, e.g. to get platform state from an ignored
378// child widget, as is the case for `GtkText` wrappers.
379func (x *StatusPage) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
380
381 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
382 return cret
383}
384
385// Resets the accessible property to its default value.
386func (x *StatusPage) ResetProperty(PropertyVar gtk.AccessibleProperty) {
387
388 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
389
390}
391
392// Resets the accessible relation to its default value.
393func (x *StatusPage) ResetRelation(RelationVar gtk.AccessibleRelation) {
394
395 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
396
397}
398
399// Resets the accessible state to its default value.
400func (x *StatusPage) ResetState(StateVar gtk.AccessibleState) {
401
402 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
403
404}
405
406// Sets the parent and sibling of an accessible object.
407//
408// This function is meant to be used by accessible implementations that are
409// not part of the widget hierarchy, and but act as a logical bridge between
410// widgets. For instance, if a widget creates an object that holds metadata
411// for each child, and you want that object to implement the `GtkAccessible`
412// interface, you will use this function to ensure that the parent of each
413// child widget is the metadata object, and the parent of each metadata
414// object is the container widget.
415func (x *StatusPage) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
416
417 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
418
419}
420
421// Updates the next accessible sibling.
422//
423// That might be useful when a new child of a custom accessible
424// is created, and it needs to be linked to a previous child.
425func (x *StatusPage) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
426
427 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
428
429}
430
431// Informs ATs that the platform state has changed.
432//
433// This function should be used by `GtkAccessible` implementations that
434// have a platform state but are not widgets. Widgets handle platform
435// states automatically.
436func (x *StatusPage) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
437
438 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
439
440}
441
442// Updates a list of accessible properties.
443//
444// See the [enum@Gtk.AccessibleProperty] documentation for the
445// value types of accessible properties.
446//
447// This function should be called by `GtkWidget` types whenever
448// an accessible property change must be communicated to assistive
449// technologies.
450//
451// Example:
452// ```c
453// value = gtk_adjustment_get_value (adjustment);
454// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
455//
456// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
457// -1);
458//
459// ```
460func (x *StatusPage) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
461
462 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
463
464}
465
466// Updates an array of accessible properties.
467//
468// This function should be called by `GtkWidget` types whenever an accessible
469// property change must be communicated to assistive technologies.
470//
471// This function is meant to be used by language bindings.
472func (x *StatusPage) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
473
474 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
475
476}
477
478// Updates a list of accessible relations.
479//
480// This function should be called by `GtkWidget` types whenever an accessible
481// relation change must be communicated to assistive technologies.
482//
483// If the [enum@Gtk.AccessibleRelation] requires a list of references,
484// you should pass each reference individually, followed by `NULL`, e.g.
485//
486// ```c
487// gtk_accessible_update_relation (accessible,
488//
489// GTK_ACCESSIBLE_RELATION_CONTROLS,
490// ref1, NULL,
491// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
492// ref1, ref2, ref3, NULL,
493// -1);
494//
495// ```
496func (x *StatusPage) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
497
498 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
499
500}
501
502// Updates an array of accessible relations.
503//
504// This function should be called by `GtkWidget` types whenever an accessible
505// relation change must be communicated to assistive technologies.
506//
507// This function is meant to be used by language bindings.
508func (x *StatusPage) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
509
510 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
511
512}
513
514// Updates a list of accessible states.
515//
516// See the [enum@Gtk.AccessibleState] documentation for the
517// value types of accessible states.
518//
519// This function should be called by `GtkWidget` types whenever
520// an accessible state change must be communicated to assistive
521// technologies.
522//
523// Example:
524//
525// ```c
526// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
527// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
528//
529// GTK_ACCESSIBLE_STATE_CHECKED, value,
530// -1);
531//
532// ```
533func (x *StatusPage) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
534
535 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
536
537}
538
539// Updates an array of accessible states.
540//
541// This function should be called by `GtkWidget` types whenever an accessible
542// state change must be communicated to assistive technologies.
543//
544// This function is meant to be used by language bindings.
545func (x *StatusPage) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
546
547 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
548
549}
550
551// Gets the ID of the @buildable object.
552//
553// `GtkBuilder` sets the name based on the ID attribute
554// of the `<object>` tag used to construct the @buildable.
555func (x *StatusPage) GetBuildableId() string {
556
557 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
558 return cret
559}
560
561func init() {
562 core.SetPackageName("ADW", "libadwaita-1")
563 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
564 var libs []uintptr
565 for _, libPath := range core.GetPaths("ADW") {
566 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
567 if err != nil {
568 panic(err)
569 }
570 libs = append(libs, lib)
571 }
572
573 core.PuregoSafeRegister(&xStatusPageGLibType, libs, "adw_status_page_get_type")
574
575 core.PuregoSafeRegister(&xNewStatusPage, libs, "adw_status_page_new")
576
577 core.PuregoSafeRegister(&xStatusPageGetChild, libs, "adw_status_page_get_child")
578 core.PuregoSafeRegister(&xStatusPageGetDescription, libs, "adw_status_page_get_description")
579 core.PuregoSafeRegister(&xStatusPageGetIconName, libs, "adw_status_page_get_icon_name")
580 core.PuregoSafeRegister(&xStatusPageGetPaintable, libs, "adw_status_page_get_paintable")
581 core.PuregoSafeRegister(&xStatusPageGetTitle, libs, "adw_status_page_get_title")
582 core.PuregoSafeRegister(&xStatusPageSetChild, libs, "adw_status_page_set_child")
583 core.PuregoSafeRegister(&xStatusPageSetDescription, libs, "adw_status_page_set_description")
584 core.PuregoSafeRegister(&xStatusPageSetIconName, libs, "adw_status_page_set_icon_name")
585 core.PuregoSafeRegister(&xStatusPageSetPaintable, libs, "adw_status_page_set_paintable")
586 core.PuregoSafeRegister(&xStatusPageSetTitle, libs, "adw_status_page_set_title")
587
588}