-
Notifications
You must be signed in to change notification settings - Fork 6
/
adw-status-page.go
381 lines (313 loc) · 9.16 KB
/
adw-status-page.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
// Code generated by girgen. DO NOT EDIT.
package adw
import (
"runtime"
"unsafe"
"github.com/diamondburned/gotk4/pkg/core/gextras"
coreglib "github.com/diamondburned/gotk4/pkg/core/glib"
"github.com/diamondburned/gotk4/pkg/gdk/v4"
"github.com/diamondburned/gotk4/pkg/gtk/v4"
)
// #include <stdlib.h>
// #include <adwaita.h>
// #include <glib-object.h>
import "C"
// GType values.
var (
GTypeStatusPage = coreglib.Type(C.adw_status_page_get_type())
)
func init() {
coreglib.RegisterGValueMarshalers([]coreglib.TypeMarshaler{
coreglib.TypeMarshaler{T: GTypeStatusPage, F: marshalStatusPage},
})
}
// StatusPageOverrides contains methods that are overridable.
type StatusPageOverrides struct {
}
func defaultStatusPageOverrides(v *StatusPage) StatusPageOverrides {
return StatusPageOverrides{}
}
// StatusPage: page used for empty/error states and similar use-cases.
//
// <picture> <source srcset="status-page-dark.png" media="(prefers-color-scheme:
// dark)"> <img src="status-page.png" alt="status-page"> </picture>
//
// The AdwStatusPage widget can have an icon, a title, a description and a
// custom widget which is displayed below them.
//
// # CSS nodes
//
// AdwStatusPage has a main CSS node with name statuspage.
//
// AdwStatusPage can use the .compact (style-classes.html#compact-status-page)
// style class for when it needs to fit into a small space such a sidebar or a
// popover.
type StatusPage struct {
_ [0]func() // equal guard
gtk.Widget
}
var (
_ gtk.Widgetter = (*StatusPage)(nil)
)
func init() {
coreglib.RegisterClassInfo[*StatusPage, *StatusPageClass, StatusPageOverrides](
GTypeStatusPage,
initStatusPageClass,
wrapStatusPage,
defaultStatusPageOverrides,
)
}
func initStatusPageClass(gclass unsafe.Pointer, overrides StatusPageOverrides, classInitFunc func(*StatusPageClass)) {
if classInitFunc != nil {
class := (*StatusPageClass)(gextras.NewStructNative(gclass))
classInitFunc(class)
}
}
func wrapStatusPage(obj *coreglib.Object) *StatusPage {
return &StatusPage{
Widget: gtk.Widget{
InitiallyUnowned: coreglib.InitiallyUnowned{
Object: obj,
},
Object: obj,
Accessible: gtk.Accessible{
Object: obj,
},
Buildable: gtk.Buildable{
Object: obj,
},
ConstraintTarget: gtk.ConstraintTarget{
Object: obj,
},
},
}
}
func marshalStatusPage(p uintptr) (interface{}, error) {
return wrapStatusPage(coreglib.ValueFromNative(unsafe.Pointer(p)).Object()), nil
}
// NewStatusPage creates a new AdwStatusPage.
//
// The function returns the following values:
//
// - statusPage: newly created AdwStatusPage.
//
func NewStatusPage() *StatusPage {
var _cret *C.GtkWidget // in
_cret = C.adw_status_page_new()
var _statusPage *StatusPage // out
_statusPage = wrapStatusPage(coreglib.Take(unsafe.Pointer(_cret)))
return _statusPage
}
// Child gets the child widget of self.
//
// The function returns the following values:
//
// - widget (optional): child widget of self.
//
func (self *StatusPage) Child() gtk.Widgetter {
var _arg0 *C.AdwStatusPage // out
var _cret *C.GtkWidget // in
_arg0 = (*C.AdwStatusPage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_cret = C.adw_status_page_get_child(_arg0)
runtime.KeepAlive(self)
var _widget gtk.Widgetter // out
if _cret != nil {
{
objptr := unsafe.Pointer(_cret)
object := coreglib.Take(objptr)
casted := object.WalkCast(func(obj coreglib.Objector) bool {
_, ok := obj.(gtk.Widgetter)
return ok
})
rv, ok := casted.(gtk.Widgetter)
if !ok {
panic("no marshaler for " + object.TypeFromInstance().String() + " matching gtk.Widgetter")
}
_widget = rv
}
}
return _widget
}
// Description gets the description markup for self.
//
// The function returns the following values:
//
// - utf8 (optional): description.
//
func (self *StatusPage) Description() string {
var _arg0 *C.AdwStatusPage // out
var _cret *C.char // in
_arg0 = (*C.AdwStatusPage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_cret = C.adw_status_page_get_description(_arg0)
runtime.KeepAlive(self)
var _utf8 string // out
if _cret != nil {
_utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
}
return _utf8
}
// IconName gets the icon name for self.
//
// The function returns the following values:
//
// - utf8 (optional): icon name.
//
func (self *StatusPage) IconName() string {
var _arg0 *C.AdwStatusPage // out
var _cret *C.char // in
_arg0 = (*C.AdwStatusPage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_cret = C.adw_status_page_get_icon_name(_arg0)
runtime.KeepAlive(self)
var _utf8 string // out
if _cret != nil {
_utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
}
return _utf8
}
// Paintable gets the paintable for self.
//
// The function returns the following values:
//
// - paintable (optional): paintable.
//
func (self *StatusPage) Paintable() *gdk.Paintable {
var _arg0 *C.AdwStatusPage // out
var _cret *C.GdkPaintable // in
_arg0 = (*C.AdwStatusPage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_cret = C.adw_status_page_get_paintable(_arg0)
runtime.KeepAlive(self)
var _paintable *gdk.Paintable // out
if _cret != nil {
{
obj := coreglib.Take(unsafe.Pointer(_cret))
_paintable = &gdk.Paintable{
Object: obj,
}
}
}
return _paintable
}
// Title gets the title for self.
//
// The function returns the following values:
//
// - utf8: title.
//
func (self *StatusPage) Title() string {
var _arg0 *C.AdwStatusPage // out
var _cret *C.char // in
_arg0 = (*C.AdwStatusPage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_cret = C.adw_status_page_get_title(_arg0)
runtime.KeepAlive(self)
var _utf8 string // out
_utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
return _utf8
}
// SetChild sets the child widget of self.
//
// The function takes the following parameters:
//
// - child (optional) widget.
//
func (self *StatusPage) SetChild(child gtk.Widgetter) {
var _arg0 *C.AdwStatusPage // out
var _arg1 *C.GtkWidget // out
_arg0 = (*C.AdwStatusPage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
if child != nil {
_arg1 = (*C.GtkWidget)(unsafe.Pointer(coreglib.InternObject(child).Native()))
}
C.adw_status_page_set_child(_arg0, _arg1)
runtime.KeepAlive(self)
runtime.KeepAlive(child)
}
// SetDescription sets the description markup for self.
//
// The description is displayed below the title. It is parsed as Pango markup.
//
// The function takes the following parameters:
//
// - description (optional): description.
//
func (self *StatusPage) SetDescription(description string) {
var _arg0 *C.AdwStatusPage // out
var _arg1 *C.char // out
_arg0 = (*C.AdwStatusPage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
if description != "" {
_arg1 = (*C.char)(unsafe.Pointer(C.CString(description)))
defer C.free(unsafe.Pointer(_arg1))
}
C.adw_status_page_set_description(_arg0, _arg1)
runtime.KeepAlive(self)
runtime.KeepAlive(description)
}
// SetIconName sets the icon name for self.
//
// Changing this will set statuspage:paintable to NULL.
//
// The function takes the following parameters:
//
// - iconName (optional): icon name.
//
func (self *StatusPage) SetIconName(iconName string) {
var _arg0 *C.AdwStatusPage // out
var _arg1 *C.char // out
_arg0 = (*C.AdwStatusPage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
if iconName != "" {
_arg1 = (*C.char)(unsafe.Pointer(C.CString(iconName)))
defer C.free(unsafe.Pointer(_arg1))
}
C.adw_status_page_set_icon_name(_arg0, _arg1)
runtime.KeepAlive(self)
runtime.KeepAlive(iconName)
}
// SetPaintable sets the paintable for self.
//
// Changing this will set statuspage:icon-name to NULL.
//
// The function takes the following parameters:
//
// - paintable (optional): paintable.
//
func (self *StatusPage) SetPaintable(paintable gdk.Paintabler) {
var _arg0 *C.AdwStatusPage // out
var _arg1 *C.GdkPaintable // out
_arg0 = (*C.AdwStatusPage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
if paintable != nil {
_arg1 = (*C.GdkPaintable)(unsafe.Pointer(coreglib.InternObject(paintable).Native()))
}
C.adw_status_page_set_paintable(_arg0, _arg1)
runtime.KeepAlive(self)
runtime.KeepAlive(paintable)
}
// SetTitle sets the title for self.
//
// The title is displayed below the icon. It is not parsed as Pango markup.
//
// The function takes the following parameters:
//
// - title: title.
//
func (self *StatusPage) SetTitle(title string) {
var _arg0 *C.AdwStatusPage // out
var _arg1 *C.char // out
_arg0 = (*C.AdwStatusPage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_arg1 = (*C.char)(unsafe.Pointer(C.CString(title)))
defer C.free(unsafe.Pointer(_arg1))
C.adw_status_page_set_title(_arg0, _arg1)
runtime.KeepAlive(self)
runtime.KeepAlive(title)
}
// StatusPageClass: instance of this type is always passed by reference.
type StatusPageClass struct {
*statusPageClass
}
// statusPageClass is the struct that's finalized.
type statusPageClass struct {
native *C.AdwStatusPageClass
}
func (s *StatusPageClass) ParentClass() *gtk.WidgetClass {
valptr := &s.native.parent_class
var _v *gtk.WidgetClass // out
_v = (*gtk.WidgetClass)(gextras.NewStructNative(unsafe.Pointer(valptr)))
return _v
}