-
Notifications
You must be signed in to change notification settings - Fork 3
/
v-.go
5838 lines (4322 loc) · 159 KB
/
v-.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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated - DO NOT EDIT.
// +build !gobject_2.2,!gobject_2.4,!gobject_2.6,!gobject_2.8,!gobject_2.10,!gobject_2.12,!gobject_2.18,!gobject_2.24,!gobject_2.26,!gobject_2.28,!gobject_2.30,!gobject_2.32,!gobject_2.34,!gobject_2.36,!gobject_2.38,!gobject_2.42,!gobject_2.44,!gobject_2.46,!gobject_2.54
package gobject
import (
glib "github.com/pekim/gobbi/lib/glib"
"runtime"
"sync"
"unsafe"
)
// #cgo CFLAGS: -Wno-deprecated-declarations
// #cgo CFLAGS: -Wno-format-security
// #cgo CFLAGS: -Wno-incompatible-pointer-types
// #include <glib-object.h>
// #include <stdlib.h>
/*
void object_notifyHandler(GObject *, GParamSpec *, gpointer);
static gulong Object_signal_connect_notify(gpointer instance, gpointer data) {
return g_signal_connect(instance, "notify", G_CALLBACK(object_notifyHandler), data);
}
*/
import "C"
// Unsupported : alias has no type generator for ClosureMarshal, GClosureMarshal
// Unsupported : alias has no type generator for VaClosureMarshal, GVaClosureMarshal
// Type is a representation of the C alias GType.
type Type uint64
type ConnectFlags C.GConnectFlags
const (
CONNECT_AFTER ConnectFlags = 1
CONNECT_SWAPPED ConnectFlags = 2
)
type ParamFlags C.GParamFlags
const (
PARAM_READABLE ParamFlags = 1
PARAM_WRITABLE ParamFlags = 2
PARAM_READWRITE ParamFlags = 3
PARAM_CONSTRUCT ParamFlags = 4
PARAM_CONSTRUCT_ONLY ParamFlags = 8
PARAM_LAX_VALIDATION ParamFlags = 16
PARAM_STATIC_NAME ParamFlags = 32
PARAM_PRIVATE ParamFlags = 32
PARAM_STATIC_NICK ParamFlags = 64
PARAM_STATIC_BLURB ParamFlags = 128
PARAM_EXPLICIT_NOTIFY ParamFlags = 1073741824
// Blacklisted member : G_PARAM_DEPRECATED
)
type SignalFlags C.GSignalFlags
const (
SIGNAL_RUN_FIRST SignalFlags = 1
SIGNAL_RUN_LAST SignalFlags = 2
SIGNAL_RUN_CLEANUP SignalFlags = 4
SIGNAL_NO_RECURSE SignalFlags = 8
SIGNAL_DETAILED SignalFlags = 16
SIGNAL_ACTION SignalFlags = 32
SIGNAL_NO_HOOKS SignalFlags = 64
SIGNAL_MUST_COLLECT SignalFlags = 128
SIGNAL_DEPRECATED SignalFlags = 256
)
type SignalMatchType C.GSignalMatchType
const (
SIGNAL_MATCH_ID SignalMatchType = 1
SIGNAL_MATCH_DETAIL SignalMatchType = 2
SIGNAL_MATCH_CLOSURE SignalMatchType = 4
SIGNAL_MATCH_FUNC SignalMatchType = 8
SIGNAL_MATCH_DATA SignalMatchType = 16
SIGNAL_MATCH_UNBLOCKED SignalMatchType = 32
)
type TypeDebugFlags C.GTypeDebugFlags
const (
TYPE_DEBUG_NONE TypeDebugFlags = 0
TYPE_DEBUG_OBJECTS TypeDebugFlags = 1
TYPE_DEBUG_SIGNALS TypeDebugFlags = 2
TYPE_DEBUG_INSTANCE_COUNT TypeDebugFlags = 4
TYPE_DEBUG_MASK TypeDebugFlags = 7
)
type TypeFlags C.GTypeFlags
const (
TYPE_FLAG_ABSTRACT TypeFlags = 16
TYPE_FLAG_VALUE_ABSTRACT TypeFlags = 32
)
type TypeFundamentalFlags C.GTypeFundamentalFlags
const (
TYPE_FLAG_CLASSED TypeFundamentalFlags = 1
TYPE_FLAG_INSTANTIATABLE TypeFundamentalFlags = 2
TYPE_FLAG_DERIVABLE TypeFundamentalFlags = 4
TYPE_FLAG_DEEP_DERIVABLE TypeFundamentalFlags = 8
)
// InitiallyUnowned is a wrapper around the C record GInitiallyUnowned.
type InitiallyUnowned struct {
native *C.GInitiallyUnowned
// All fields are private
}
func InitiallyUnownedNewFromC(u unsafe.Pointer) *InitiallyUnowned {
c := (*C.GInitiallyUnowned)(u)
if c == nil {
return nil
}
g := &InitiallyUnowned{native: c}
ug := (C.gpointer)(u)
if C.g_object_is_floating(ug) == C.TRUE {
C.g_object_ref_sink(ug)
} else {
C.g_object_ref(ug)
}
runtime.SetFinalizer(g, func(o *InitiallyUnowned) {
C.g_object_unref((C.gpointer)(o.native))
})
return g
}
func (recv *InitiallyUnowned) ToC() unsafe.Pointer {
return (unsafe.Pointer)(recv.native)
}
// Equals compares this InitiallyUnowned with another InitiallyUnowned, and returns true if they represent the same GObject.
func (recv *InitiallyUnowned) Equals(other *InitiallyUnowned) bool {
return other.ToC() == recv.ToC()
}
// Object upcasts to *Object
func (recv *InitiallyUnowned) Object() *Object {
return ObjectNewFromC(unsafe.Pointer(recv.native))
}
// CastToWidget down casts any arbitrary Object to InitiallyUnowned.
// Exercise care, as this is a potentially dangerous function if the Object is not a InitiallyUnowned.
func CastToInitiallyUnowned(object *Object) *InitiallyUnowned {
return InitiallyUnownedNewFromC(object.ToC())
}
// Object is a wrapper around the C record GObject.
type Object struct {
native *C.GObject
// All fields are private
}
func ObjectNewFromC(u unsafe.Pointer) *Object {
c := (*C.GObject)(u)
if c == nil {
return nil
}
g := &Object{native: c}
return g
}
func (recv *Object) ToC() unsafe.Pointer {
return (unsafe.Pointer)(recv.native)
}
// Equals compares this Object with another Object, and returns true if they represent the same GObject.
func (recv *Object) Equals(other *Object) bool {
return other.ToC() == recv.ToC()
}
// CastToWidget down casts any arbitrary Object to Object.
// Exercise care, as this is a potentially dangerous function if the Object is not a Object.
func CastToObject(object *Object) *Object {
return ObjectNewFromC(object.ToC())
}
type signalObjectNotifyDetail struct {
callback ObjectSignalNotifyCallback
handlerID C.gulong
}
var signalObjectNotifyId int
var signalObjectNotifyMap = make(map[int]signalObjectNotifyDetail)
var signalObjectNotifyLock sync.RWMutex
// ObjectSignalNotifyCallback is a callback function for a 'notify' signal emitted from a Object.
type ObjectSignalNotifyCallback func(targetObject *Object, pspec *ParamSpec)
/*
ConnectNotify connects the callback to the 'notify' signal for the Object.
The returned value represents the connection, and may be passed to DisconnectNotify to remove it.
*/
func (recv *Object) ConnectNotify(callback ObjectSignalNotifyCallback) int {
signalObjectNotifyLock.Lock()
defer signalObjectNotifyLock.Unlock()
signalObjectNotifyId++
instance := C.gpointer(recv.native)
handlerID := C.Object_signal_connect_notify(instance, C.gpointer(uintptr(signalObjectNotifyId)))
detail := signalObjectNotifyDetail{callback, handlerID}
signalObjectNotifyMap[signalObjectNotifyId] = detail
return signalObjectNotifyId
}
/*
DisconnectNotify disconnects a callback from the 'notify' signal for the Object.
The connectionID should be a value returned from a call to ConnectNotify.
*/
func (recv *Object) DisconnectNotify(connectionID int) {
signalObjectNotifyLock.Lock()
defer signalObjectNotifyLock.Unlock()
detail, exists := signalObjectNotifyMap[connectionID]
if !exists {
return
}
instance := C.gpointer(recv.native)
C.g_signal_handler_disconnect(instance, detail.handlerID)
delete(signalObjectNotifyMap, connectionID)
}
//export object_notifyHandler
func object_notifyHandler(c_targetObject *C.GObject, c_pspec *C.GParamSpec, data C.gpointer) {
signalObjectNotifyLock.RLock()
defer signalObjectNotifyLock.RUnlock()
pspec := ParamSpecNewFromC(unsafe.Pointer(c_pspec))
targetObject := ObjectNewFromC((unsafe.Pointer)(c_targetObject))
index := int(uintptr(data))
callback := signalObjectNotifyMap[index].callback
callback(targetObject, pspec)
}
// Unsupported : g_object_new : unsupported parameter ... : varargs
// Unsupported : g_object_new_valist : unsupported parameter var_args : no type generator for va_list (va_list) for param var_args
// Unsupported : g_object_newv : unsupported parameter parameters :
// ObjectCompatControl is a wrapper around the C function g_object_compat_control.
func ObjectCompatControl(what uint64, data uintptr) uint64 {
c_what := (C.gsize)(what)
c_data := (C.gpointer)(data)
retC := C.g_object_compat_control(c_what, c_data)
retGo := (uint64)(retC)
return retGo
}
// AddWeakPointer is a wrapper around the C function g_object_add_weak_pointer.
func (recv *Object) AddWeakPointer(weakPointerLocation uintptr) {
c_weak_pointer_location := (C.gpointer)(weakPointerLocation)
C.g_object_add_weak_pointer((*C.GObject)(recv.native), &c_weak_pointer_location)
return
}
// Unsupported : g_object_connect : unsupported parameter ... : varargs
// Unsupported : g_object_disconnect : unsupported parameter ... : varargs
// FreezeNotify is a wrapper around the C function g_object_freeze_notify.
func (recv *Object) FreezeNotify() {
C.g_object_freeze_notify((*C.GObject)(recv.native))
return
}
// Unsupported : g_object_get : unsupported parameter ... : varargs
// GetData is a wrapper around the C function g_object_get_data.
func (recv *Object) GetData(key string) uintptr {
c_key := C.CString(key)
defer C.free(unsafe.Pointer(c_key))
retC := C.g_object_get_data((*C.GObject)(recv.native), c_key)
retGo := (uintptr)(unsafe.Pointer(retC))
return retGo
}
// GetProperty is a wrapper around the C function g_object_get_property.
func (recv *Object) GetProperty(propertyName string, value *Value) {
c_property_name := C.CString(propertyName)
defer C.free(unsafe.Pointer(c_property_name))
c_value := (*C.GValue)(C.NULL)
if value != nil {
c_value = (*C.GValue)(value.ToC())
}
C.g_object_get_property((*C.GObject)(recv.native), c_property_name, c_value)
return
}
// GetQdata is a wrapper around the C function g_object_get_qdata.
func (recv *Object) GetQdata(quark glib.Quark) uintptr {
c_quark := (C.GQuark)(quark)
retC := C.g_object_get_qdata((*C.GObject)(recv.native), c_quark)
retGo := (uintptr)(unsafe.Pointer(retC))
return retGo
}
// Unsupported : g_object_get_valist : unsupported parameter var_args : no type generator for va_list (va_list) for param var_args
// Notify is a wrapper around the C function g_object_notify.
func (recv *Object) Notify(propertyName string) {
c_property_name := C.CString(propertyName)
defer C.free(unsafe.Pointer(c_property_name))
C.g_object_notify((*C.GObject)(recv.native), c_property_name)
return
}
// Ref is a wrapper around the C function g_object_ref.
func (recv *Object) Ref() Object {
retC := C.g_object_ref((C.gpointer)(recv.native))
retGo := *ObjectNewFromC(unsafe.Pointer(retC))
return retGo
}
// RemoveWeakPointer is a wrapper around the C function g_object_remove_weak_pointer.
func (recv *Object) RemoveWeakPointer(weakPointerLocation uintptr) {
c_weak_pointer_location := (C.gpointer)(weakPointerLocation)
C.g_object_remove_weak_pointer((*C.GObject)(recv.native), &c_weak_pointer_location)
return
}
// RunDispose is a wrapper around the C function g_object_run_dispose.
func (recv *Object) RunDispose() {
C.g_object_run_dispose((*C.GObject)(recv.native))
return
}
// Unsupported : g_object_set : unsupported parameter ... : varargs
// SetData is a wrapper around the C function g_object_set_data.
func (recv *Object) SetData(key string, data uintptr) {
c_key := C.CString(key)
defer C.free(unsafe.Pointer(c_key))
c_data := (C.gpointer)(data)
C.g_object_set_data((*C.GObject)(recv.native), c_key, c_data)
return
}
// Unsupported : g_object_set_data_full : unsupported parameter destroy : no type generator for GLib.DestroyNotify (GDestroyNotify) for param destroy
// SetProperty is a wrapper around the C function g_object_set_property.
func (recv *Object) SetProperty(propertyName string, value *Value) {
c_property_name := C.CString(propertyName)
defer C.free(unsafe.Pointer(c_property_name))
c_value := (*C.GValue)(C.NULL)
if value != nil {
c_value = (*C.GValue)(value.ToC())
}
C.g_object_set_property((*C.GObject)(recv.native), c_property_name, c_value)
return
}
// SetQdata is a wrapper around the C function g_object_set_qdata.
func (recv *Object) SetQdata(quark glib.Quark, data uintptr) {
c_quark := (C.GQuark)(quark)
c_data := (C.gpointer)(data)
C.g_object_set_qdata((*C.GObject)(recv.native), c_quark, c_data)
return
}
// Unsupported : g_object_set_qdata_full : unsupported parameter destroy : no type generator for GLib.DestroyNotify (GDestroyNotify) for param destroy
// Unsupported : g_object_set_valist : unsupported parameter var_args : no type generator for va_list (va_list) for param var_args
// StealData is a wrapper around the C function g_object_steal_data.
func (recv *Object) StealData(key string) uintptr {
c_key := C.CString(key)
defer C.free(unsafe.Pointer(c_key))
retC := C.g_object_steal_data((*C.GObject)(recv.native), c_key)
retGo := (uintptr)(unsafe.Pointer(retC))
return retGo
}
// StealQdata is a wrapper around the C function g_object_steal_qdata.
func (recv *Object) StealQdata(quark glib.Quark) uintptr {
c_quark := (C.GQuark)(quark)
retC := C.g_object_steal_qdata((*C.GObject)(recv.native), c_quark)
retGo := (uintptr)(unsafe.Pointer(retC))
return retGo
}
// ThawNotify is a wrapper around the C function g_object_thaw_notify.
func (recv *Object) ThawNotify() {
C.g_object_thaw_notify((*C.GObject)(recv.native))
return
}
// Unref is a wrapper around the C function g_object_unref.
func (recv *Object) Unref() {
C.g_object_unref((C.gpointer)(recv.native))
return
}
// WatchClosure is a wrapper around the C function g_object_watch_closure.
func (recv *Object) WatchClosure(closure *Closure) {
c_closure := (*C.GClosure)(C.NULL)
if closure != nil {
c_closure = (*C.GClosure)(closure.ToC())
}
C.g_object_watch_closure((*C.GObject)(recv.native), c_closure)
return
}
// Unsupported : g_object_weak_ref : unsupported parameter notify : no type generator for WeakNotify (GWeakNotify) for param notify
// Unsupported : g_object_weak_unref : unsupported parameter notify : no type generator for WeakNotify (GWeakNotify) for param notify
// ParamSpec is a wrapper around the C record GParamSpec.
type ParamSpec struct {
native *C.GParamSpec
// g_type_instance : record
Name string
Flags ParamFlags
ValueType Type
OwnerType Type
// Private : _nick
// Private : _blurb
// Private : qdata
// Private : ref_count
// Private : param_id
}
func ParamSpecNewFromC(u unsafe.Pointer) *ParamSpec {
c := (*C.GParamSpec)(u)
if c == nil {
return nil
}
g := &ParamSpec{
Flags: (ParamFlags)(c.flags),
Name: C.GoString(c.name),
OwnerType: (Type)(c.owner_type),
ValueType: (Type)(c.value_type),
native: c,
}
return g
}
func (recv *ParamSpec) ToC() unsafe.Pointer {
recv.native.name =
C.CString(recv.Name)
recv.native.flags =
(C.GParamFlags)(recv.Flags)
recv.native.value_type =
(C.GType)(recv.ValueType)
recv.native.owner_type =
(C.GType)(recv.OwnerType)
return (unsafe.Pointer)(recv.native)
}
// Equals compares this ParamSpec with another ParamSpec, and returns true if they represent the same GObject.
func (recv *ParamSpec) Equals(other *ParamSpec) bool {
return other.ToC() == recv.ToC()
}
// ParamSpecInternal is a wrapper around the C function g_param_spec_internal.
func ParamSpecInternal(paramType Type, name string, nick string, blurb string, flags ParamFlags) ParamSpec {
c_param_type := (C.GType)(paramType)
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_name))
c_nick := C.CString(nick)
defer C.free(unsafe.Pointer(c_nick))
c_blurb := C.CString(blurb)
defer C.free(unsafe.Pointer(c_blurb))
c_flags := (C.GParamFlags)(flags)
retC := C.g_param_spec_internal(c_param_type, c_name, c_nick, c_blurb, c_flags)
retGo := *ParamSpecNewFromC(unsafe.Pointer(retC))
return retGo
}
// GetBlurb is a wrapper around the C function g_param_spec_get_blurb.
func (recv *ParamSpec) GetBlurb() string {
retC := C.g_param_spec_get_blurb((*C.GParamSpec)(recv.native))
retGo := C.GoString(retC)
return retGo
}
// GetName is a wrapper around the C function g_param_spec_get_name.
func (recv *ParamSpec) GetName() string {
retC := C.g_param_spec_get_name((*C.GParamSpec)(recv.native))
retGo := C.GoString(retC)
return retGo
}
// GetNick is a wrapper around the C function g_param_spec_get_nick.
func (recv *ParamSpec) GetNick() string {
retC := C.g_param_spec_get_nick((*C.GParamSpec)(recv.native))
retGo := C.GoString(retC)
return retGo
}
// GetQdata is a wrapper around the C function g_param_spec_get_qdata.
func (recv *ParamSpec) GetQdata(quark glib.Quark) uintptr {
c_quark := (C.GQuark)(quark)
retC := C.g_param_spec_get_qdata((*C.GParamSpec)(recv.native), c_quark)
retGo := (uintptr)(unsafe.Pointer(retC))
return retGo
}
// Ref is a wrapper around the C function g_param_spec_ref.
func (recv *ParamSpec) Ref() *ParamSpec {
retC := C.g_param_spec_ref((*C.GParamSpec)(recv.native))
retGo := ParamSpecNewFromC(unsafe.Pointer(retC))
return retGo
}
// SetQdata is a wrapper around the C function g_param_spec_set_qdata.
func (recv *ParamSpec) SetQdata(quark glib.Quark, data uintptr) {
c_quark := (C.GQuark)(quark)
c_data := (C.gpointer)(data)
C.g_param_spec_set_qdata((*C.GParamSpec)(recv.native), c_quark, c_data)
return
}
// Unsupported : g_param_spec_set_qdata_full : unsupported parameter destroy : no type generator for GLib.DestroyNotify (GDestroyNotify) for param destroy
// Sink is a wrapper around the C function g_param_spec_sink.
func (recv *ParamSpec) Sink() {
C.g_param_spec_sink((*C.GParamSpec)(recv.native))
return
}
// StealQdata is a wrapper around the C function g_param_spec_steal_qdata.
func (recv *ParamSpec) StealQdata(quark glib.Quark) uintptr {
c_quark := (C.GQuark)(quark)
retC := C.g_param_spec_steal_qdata((*C.GParamSpec)(recv.native), c_quark)
retGo := (uintptr)(unsafe.Pointer(retC))
return retGo
}
// Unref is a wrapper around the C function g_param_spec_unref.
func (recv *ParamSpec) Unref() {
C.g_param_spec_unref((*C.GParamSpec)(recv.native))
return
}
// ParamSpecBoolean is a wrapper around the C record GParamSpecBoolean.
type ParamSpecBoolean struct {
native *C.GParamSpecBoolean
// parent_instance : record
DefaultValue bool
}
func ParamSpecBooleanNewFromC(u unsafe.Pointer) *ParamSpecBoolean {
c := (*C.GParamSpecBoolean)(u)
if c == nil {
return nil
}
g := &ParamSpecBoolean{
DefaultValue: c.default_value == C.TRUE,
native: c,
}
return g
}
func (recv *ParamSpecBoolean) ToC() unsafe.Pointer {
recv.native.default_value =
boolToGboolean(recv.DefaultValue)
return (unsafe.Pointer)(recv.native)
}
// Equals compares this ParamSpecBoolean with another ParamSpecBoolean, and returns true if they represent the same GObject.
func (recv *ParamSpecBoolean) Equals(other *ParamSpecBoolean) bool {
return other.ToC() == recv.ToC()
}
// ParamSpec upcasts to *ParamSpec
func (recv *ParamSpecBoolean) ParamSpec() *ParamSpec {
return ParamSpecNewFromC(unsafe.Pointer(recv.native))
}
// ParamSpecBoxed is a wrapper around the C record GParamSpecBoxed.
type ParamSpecBoxed struct {
native *C.GParamSpecBoxed
// parent_instance : record
}
func ParamSpecBoxedNewFromC(u unsafe.Pointer) *ParamSpecBoxed {
c := (*C.GParamSpecBoxed)(u)
if c == nil {
return nil
}
g := &ParamSpecBoxed{native: c}
return g
}
func (recv *ParamSpecBoxed) ToC() unsafe.Pointer {
return (unsafe.Pointer)(recv.native)
}
// Equals compares this ParamSpecBoxed with another ParamSpecBoxed, and returns true if they represent the same GObject.
func (recv *ParamSpecBoxed) Equals(other *ParamSpecBoxed) bool {
return other.ToC() == recv.ToC()
}
// ParamSpec upcasts to *ParamSpec
func (recv *ParamSpecBoxed) ParamSpec() *ParamSpec {
return ParamSpecNewFromC(unsafe.Pointer(recv.native))
}
// ParamSpecChar is a wrapper around the C record GParamSpecChar.
type ParamSpecChar struct {
native *C.GParamSpecChar
// parent_instance : record
Minimum int8
Maximum int8
DefaultValue int8
}
func ParamSpecCharNewFromC(u unsafe.Pointer) *ParamSpecChar {
c := (*C.GParamSpecChar)(u)
if c == nil {
return nil
}
g := &ParamSpecChar{
DefaultValue: (int8)(c.default_value),
Maximum: (int8)(c.maximum),
Minimum: (int8)(c.minimum),
native: c,
}
return g
}
func (recv *ParamSpecChar) ToC() unsafe.Pointer {
recv.native.minimum =
(C.gint8)(recv.Minimum)
recv.native.maximum =
(C.gint8)(recv.Maximum)
recv.native.default_value =
(C.gint8)(recv.DefaultValue)
return (unsafe.Pointer)(recv.native)
}
// Equals compares this ParamSpecChar with another ParamSpecChar, and returns true if they represent the same GObject.
func (recv *ParamSpecChar) Equals(other *ParamSpecChar) bool {
return other.ToC() == recv.ToC()
}
// ParamSpec upcasts to *ParamSpec
func (recv *ParamSpecChar) ParamSpec() *ParamSpec {
return ParamSpecNewFromC(unsafe.Pointer(recv.native))
}
// ParamSpecDouble is a wrapper around the C record GParamSpecDouble.
type ParamSpecDouble struct {
native *C.GParamSpecDouble
// parent_instance : record
Minimum float64
Maximum float64
DefaultValue float64
Epsilon float64
}
func ParamSpecDoubleNewFromC(u unsafe.Pointer) *ParamSpecDouble {
c := (*C.GParamSpecDouble)(u)
if c == nil {
return nil
}
g := &ParamSpecDouble{
DefaultValue: (float64)(c.default_value),
Epsilon: (float64)(c.epsilon),
Maximum: (float64)(c.maximum),
Minimum: (float64)(c.minimum),
native: c,
}
return g
}
func (recv *ParamSpecDouble) ToC() unsafe.Pointer {
recv.native.minimum =
(C.gdouble)(recv.Minimum)
recv.native.maximum =
(C.gdouble)(recv.Maximum)
recv.native.default_value =
(C.gdouble)(recv.DefaultValue)
recv.native.epsilon =
(C.gdouble)(recv.Epsilon)
return (unsafe.Pointer)(recv.native)
}
// Equals compares this ParamSpecDouble with another ParamSpecDouble, and returns true if they represent the same GObject.
func (recv *ParamSpecDouble) Equals(other *ParamSpecDouble) bool {
return other.ToC() == recv.ToC()
}
// ParamSpec upcasts to *ParamSpec
func (recv *ParamSpecDouble) ParamSpec() *ParamSpec {
return ParamSpecNewFromC(unsafe.Pointer(recv.native))
}
// ParamSpecEnum is a wrapper around the C record GParamSpecEnum.
type ParamSpecEnum struct {
native *C.GParamSpecEnum
// parent_instance : record
// enum_class : record
DefaultValue int32
}
func ParamSpecEnumNewFromC(u unsafe.Pointer) *ParamSpecEnum {
c := (*C.GParamSpecEnum)(u)
if c == nil {
return nil
}
g := &ParamSpecEnum{
DefaultValue: (int32)(c.default_value),
native: c,
}
return g
}
func (recv *ParamSpecEnum) ToC() unsafe.Pointer {
recv.native.default_value =
(C.gint)(recv.DefaultValue)
return (unsafe.Pointer)(recv.native)
}
// Equals compares this ParamSpecEnum with another ParamSpecEnum, and returns true if they represent the same GObject.
func (recv *ParamSpecEnum) Equals(other *ParamSpecEnum) bool {
return other.ToC() == recv.ToC()
}
// ParamSpec upcasts to *ParamSpec
func (recv *ParamSpecEnum) ParamSpec() *ParamSpec {
return ParamSpecNewFromC(unsafe.Pointer(recv.native))
}
// ParamSpecFlags is a wrapper around the C record GParamSpecFlags.
type ParamSpecFlags struct {
native *C.GParamSpecFlags
// parent_instance : record
// flags_class : record
DefaultValue uint32
}
func ParamSpecFlagsNewFromC(u unsafe.Pointer) *ParamSpecFlags {
c := (*C.GParamSpecFlags)(u)
if c == nil {
return nil
}
g := &ParamSpecFlags{
DefaultValue: (uint32)(c.default_value),
native: c,
}
return g
}
func (recv *ParamSpecFlags) ToC() unsafe.Pointer {
recv.native.default_value =
(C.guint)(recv.DefaultValue)
return (unsafe.Pointer)(recv.native)
}
// Equals compares this ParamSpecFlags with another ParamSpecFlags, and returns true if they represent the same GObject.
func (recv *ParamSpecFlags) Equals(other *ParamSpecFlags) bool {
return other.ToC() == recv.ToC()
}
// ParamSpec upcasts to *ParamSpec
func (recv *ParamSpecFlags) ParamSpec() *ParamSpec {
return ParamSpecNewFromC(unsafe.Pointer(recv.native))
}
// ParamSpecFloat is a wrapper around the C record GParamSpecFloat.
type ParamSpecFloat struct {
native *C.GParamSpecFloat
// parent_instance : record
Minimum float32
Maximum float32
DefaultValue float32
Epsilon float32
}
func ParamSpecFloatNewFromC(u unsafe.Pointer) *ParamSpecFloat {
c := (*C.GParamSpecFloat)(u)
if c == nil {
return nil
}
g := &ParamSpecFloat{
DefaultValue: (float32)(c.default_value),
Epsilon: (float32)(c.epsilon),
Maximum: (float32)(c.maximum),
Minimum: (float32)(c.minimum),
native: c,
}
return g
}
func (recv *ParamSpecFloat) ToC() unsafe.Pointer {
recv.native.minimum =
(C.gfloat)(recv.Minimum)
recv.native.maximum =
(C.gfloat)(recv.Maximum)
recv.native.default_value =
(C.gfloat)(recv.DefaultValue)
recv.native.epsilon =
(C.gfloat)(recv.Epsilon)
return (unsafe.Pointer)(recv.native)
}
// Equals compares this ParamSpecFloat with another ParamSpecFloat, and returns true if they represent the same GObject.
func (recv *ParamSpecFloat) Equals(other *ParamSpecFloat) bool {
return other.ToC() == recv.ToC()
}
// ParamSpec upcasts to *ParamSpec
func (recv *ParamSpecFloat) ParamSpec() *ParamSpec {
return ParamSpecNewFromC(unsafe.Pointer(recv.native))
}
// ParamSpecInt is a wrapper around the C record GParamSpecInt.
type ParamSpecInt struct {
native *C.GParamSpecInt
// parent_instance : record
Minimum int32
Maximum int32
DefaultValue int32
}
func ParamSpecIntNewFromC(u unsafe.Pointer) *ParamSpecInt {
c := (*C.GParamSpecInt)(u)
if c == nil {
return nil
}
g := &ParamSpecInt{
DefaultValue: (int32)(c.default_value),
Maximum: (int32)(c.maximum),
Minimum: (int32)(c.minimum),
native: c,
}
return g
}
func (recv *ParamSpecInt) ToC() unsafe.Pointer {
recv.native.minimum =
(C.gint)(recv.Minimum)
recv.native.maximum =
(C.gint)(recv.Maximum)
recv.native.default_value =
(C.gint)(recv.DefaultValue)
return (unsafe.Pointer)(recv.native)
}
// Equals compares this ParamSpecInt with another ParamSpecInt, and returns true if they represent the same GObject.
func (recv *ParamSpecInt) Equals(other *ParamSpecInt) bool {
return other.ToC() == recv.ToC()
}
// ParamSpec upcasts to *ParamSpec
func (recv *ParamSpecInt) ParamSpec() *ParamSpec {
return ParamSpecNewFromC(unsafe.Pointer(recv.native))
}
// ParamSpecInt64 is a wrapper around the C record GParamSpecInt64.
type ParamSpecInt64 struct {
native *C.GParamSpecInt64
// parent_instance : record
Minimum int64
Maximum int64
DefaultValue int64
}
func ParamSpecInt64NewFromC(u unsafe.Pointer) *ParamSpecInt64 {
c := (*C.GParamSpecInt64)(u)
if c == nil {
return nil
}
g := &ParamSpecInt64{
DefaultValue: (int64)(c.default_value),
Maximum: (int64)(c.maximum),
Minimum: (int64)(c.minimum),
native: c,
}
return g
}
func (recv *ParamSpecInt64) ToC() unsafe.Pointer {
recv.native.minimum =
(C.gint64)(recv.Minimum)
recv.native.maximum =
(C.gint64)(recv.Maximum)
recv.native.default_value =
(C.gint64)(recv.DefaultValue)
return (unsafe.Pointer)(recv.native)
}
// Equals compares this ParamSpecInt64 with another ParamSpecInt64, and returns true if they represent the same GObject.
func (recv *ParamSpecInt64) Equals(other *ParamSpecInt64) bool {
return other.ToC() == recv.ToC()
}
// ParamSpec upcasts to *ParamSpec
func (recv *ParamSpecInt64) ParamSpec() *ParamSpec {
return ParamSpecNewFromC(unsafe.Pointer(recv.native))
}