-
Notifications
You must be signed in to change notification settings - Fork 6
/
adw-enum-list-model.go
288 lines (225 loc) · 6.8 KB
/
adw-enum-list-model.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
// 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/gio/v2"
)
// #include <stdlib.h>
// #include <adwaita.h>
// #include <glib-object.h>
import "C"
// GType values.
var (
GTypeEnumListItem = coreglib.Type(C.adw_enum_list_item_get_type())
GTypeEnumListModel = coreglib.Type(C.adw_enum_list_model_get_type())
)
func init() {
coreglib.RegisterGValueMarshalers([]coreglib.TypeMarshaler{
coreglib.TypeMarshaler{T: GTypeEnumListItem, F: marshalEnumListItem},
coreglib.TypeMarshaler{T: GTypeEnumListModel, F: marshalEnumListModel},
})
}
// EnumListItemOverrides contains methods that are overridable.
type EnumListItemOverrides struct {
}
func defaultEnumListItemOverrides(v *EnumListItem) EnumListItemOverrides {
return EnumListItemOverrides{}
}
// EnumListItem: AdwEnumListItem is the type of items in a enumlistmodel.
type EnumListItem struct {
_ [0]func() // equal guard
*coreglib.Object
}
var (
_ coreglib.Objector = (*EnumListItem)(nil)
)
func init() {
coreglib.RegisterClassInfo[*EnumListItem, *EnumListItemClass, EnumListItemOverrides](
GTypeEnumListItem,
initEnumListItemClass,
wrapEnumListItem,
defaultEnumListItemOverrides,
)
}
func initEnumListItemClass(gclass unsafe.Pointer, overrides EnumListItemOverrides, classInitFunc func(*EnumListItemClass)) {
if classInitFunc != nil {
class := (*EnumListItemClass)(gextras.NewStructNative(gclass))
classInitFunc(class)
}
}
func wrapEnumListItem(obj *coreglib.Object) *EnumListItem {
return &EnumListItem{
Object: obj,
}
}
func marshalEnumListItem(p uintptr) (interface{}, error) {
return wrapEnumListItem(coreglib.ValueFromNative(unsafe.Pointer(p)).Object()), nil
}
// Name gets the enum value name.
//
// The function returns the following values:
//
// - utf8: enum value name.
//
func (self *EnumListItem) Name() string {
var _arg0 *C.AdwEnumListItem // out
var _cret *C.char // in
_arg0 = (*C.AdwEnumListItem)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_cret = C.adw_enum_list_item_get_name(_arg0)
runtime.KeepAlive(self)
var _utf8 string // out
_utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
return _utf8
}
// Nick gets the enum value nick.
//
// The function returns the following values:
//
// - utf8: enum value nick.
//
func (self *EnumListItem) Nick() string {
var _arg0 *C.AdwEnumListItem // out
var _cret *C.char // in
_arg0 = (*C.AdwEnumListItem)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_cret = C.adw_enum_list_item_get_nick(_arg0)
runtime.KeepAlive(self)
var _utf8 string // out
_utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
return _utf8
}
// Value gets the enum value.
//
// The function returns the following values:
//
// - gint: enum value.
//
func (self *EnumListItem) Value() int {
var _arg0 *C.AdwEnumListItem // out
var _cret C.int // in
_arg0 = (*C.AdwEnumListItem)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_cret = C.adw_enum_list_item_get_value(_arg0)
runtime.KeepAlive(self)
var _gint int // out
_gint = int(_cret)
return _gint
}
// EnumListModelOverrides contains methods that are overridable.
type EnumListModelOverrides struct {
}
func defaultEnumListModelOverrides(v *EnumListModel) EnumListModelOverrides {
return EnumListModelOverrides{}
}
// EnumListModel: gio.ListModel representing values of a given enum.
//
// AdwEnumListModel contains objects of type enumlistitem.
type EnumListModel struct {
_ [0]func() // equal guard
*coreglib.Object
gio.ListModel
}
var (
_ coreglib.Objector = (*EnumListModel)(nil)
)
func init() {
coreglib.RegisterClassInfo[*EnumListModel, *EnumListModelClass, EnumListModelOverrides](
GTypeEnumListModel,
initEnumListModelClass,
wrapEnumListModel,
defaultEnumListModelOverrides,
)
}
func initEnumListModelClass(gclass unsafe.Pointer, overrides EnumListModelOverrides, classInitFunc func(*EnumListModelClass)) {
if classInitFunc != nil {
class := (*EnumListModelClass)(gextras.NewStructNative(gclass))
classInitFunc(class)
}
}
func wrapEnumListModel(obj *coreglib.Object) *EnumListModel {
return &EnumListModel{
Object: obj,
ListModel: gio.ListModel{
Object: obj,
},
}
}
func marshalEnumListModel(p uintptr) (interface{}, error) {
return wrapEnumListModel(coreglib.ValueFromNative(unsafe.Pointer(p)).Object()), nil
}
// NewEnumListModel creates a new AdwEnumListModel for enum_type.
//
// The function takes the following parameters:
//
// - enumType: type of the enum to construct the model from.
//
// The function returns the following values:
//
// - enumListModel: newly created AdwEnumListModel.
//
func NewEnumListModel(enumType coreglib.Type) *EnumListModel {
var _arg1 C.GType // out
var _cret *C.AdwEnumListModel // in
_arg1 = C.GType(enumType)
_cret = C.adw_enum_list_model_new(_arg1)
runtime.KeepAlive(enumType)
var _enumListModel *EnumListModel // out
_enumListModel = wrapEnumListModel(coreglib.AssumeOwnership(unsafe.Pointer(_cret)))
return _enumListModel
}
// FindPosition finds the position of a given enum value in self.
//
// If the value is not found, GTK_INVALID_LIST_POSITION is returned.
//
// The function takes the following parameters:
//
// - value: enum value.
//
// The function returns the following values:
//
func (self *EnumListModel) FindPosition(value int) uint {
var _arg0 *C.AdwEnumListModel // out
var _arg1 C.int // out
var _cret C.guint // in
_arg0 = (*C.AdwEnumListModel)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_arg1 = C.int(value)
_cret = C.adw_enum_list_model_find_position(_arg0, _arg1)
runtime.KeepAlive(self)
runtime.KeepAlive(value)
var _guint uint // out
_guint = uint(_cret)
return _guint
}
// EnumType gets the type of the enum represented by self.
//
// The function returns the following values:
//
// - gType: enum type.
//
func (self *EnumListModel) EnumType() coreglib.Type {
var _arg0 *C.AdwEnumListModel // out
var _cret C.GType // in
_arg0 = (*C.AdwEnumListModel)(unsafe.Pointer(coreglib.InternObject(self).Native()))
_cret = C.adw_enum_list_model_get_enum_type(_arg0)
runtime.KeepAlive(self)
var _gType coreglib.Type // out
_gType = coreglib.Type(_cret)
return _gType
}
// EnumListItemClass: instance of this type is always passed by reference.
type EnumListItemClass struct {
*enumListItemClass
}
// enumListItemClass is the struct that's finalized.
type enumListItemClass struct {
native *C.AdwEnumListItemClass
}
// EnumListModelClass: instance of this type is always passed by reference.
type EnumListModelClass struct {
*enumListModelClass
}
// enumListModelClass is the struct that's finalized.
type enumListModelClass struct {
native *C.AdwEnumListModelClass
}