/
hdy-clamp.go
183 lines (145 loc) · 4.18 KB
/
hdy-clamp.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
// Code generated by girgen. DO NOT EDIT.
package handy
import (
"runtime"
"unsafe"
"github.com/diamondburned/gotk4/pkg/atk"
externglib "github.com/diamondburned/gotk4/pkg/core/glib"
"github.com/diamondburned/gotk4/pkg/gtk/v3"
)
// #include <stdlib.h>
// #include <glib-object.h>
// #include <handy.h>
import "C"
// glib.Type values for hdy-clamp.go.
var GTypeClamp = externglib.Type(C.hdy_clamp_get_type())
func init() {
externglib.RegisterGValueMarshalers([]externglib.TypeMarshaler{
{T: GTypeClamp, F: marshalClamp},
})
}
// ClampOverrider contains methods that are overridable.
type ClampOverrider interface {
}
type Clamp struct {
_ [0]func() // equal guard
gtk.Bin
*externglib.Object
gtk.Orientable
}
var (
_ gtk.Binner = (*Clamp)(nil)
_ externglib.Objector = (*Clamp)(nil)
)
func classInitClamper(gclassPtr, data C.gpointer) {
C.g_type_class_add_private(gclassPtr, C.gsize(unsafe.Sizeof(uintptr(0))))
goffset := C.g_type_class_get_instance_private_offset(gclassPtr)
*(*C.gpointer)(unsafe.Add(unsafe.Pointer(gclassPtr), goffset)) = data
}
func wrapClamp(obj *externglib.Object) *Clamp {
return &Clamp{
Bin: gtk.Bin{
Container: gtk.Container{
Widget: gtk.Widget{
InitiallyUnowned: externglib.InitiallyUnowned{
Object: obj,
},
Object: obj,
ImplementorIface: atk.ImplementorIface{
Object: obj,
},
Buildable: gtk.Buildable{
Object: obj,
},
},
},
},
Object: obj,
Orientable: gtk.Orientable{
Object: obj,
},
}
}
func marshalClamp(p uintptr) (interface{}, error) {
return wrapClamp(externglib.ValueFromNative(unsafe.Pointer(p)).Object()), nil
}
// NewClamp creates a new Clamp.
//
// The function returns the following values:
//
// - clamp: new Clamp.
//
func NewClamp() *Clamp {
var _cret *C.GtkWidget // in
_cret = C.hdy_clamp_new()
var _clamp *Clamp // out
_clamp = wrapClamp(externglib.Take(unsafe.Pointer(_cret)))
return _clamp
}
// MaximumSize gets the maximum size to allocate to the contained child. It is
// the width if self is horizontal, or the height if it is vertical.
//
// The function returns the following values:
//
// - gint: maximum size to allocate to the contained child.
//
func (self *Clamp) MaximumSize() int {
var _arg0 *C.HdyClamp // out
var _cret C.gint // in
_arg0 = (*C.HdyClamp)(unsafe.Pointer(externglib.InternObject(self).Native()))
_cret = C.hdy_clamp_get_maximum_size(_arg0)
runtime.KeepAlive(self)
var _gint int // out
_gint = int(_cret)
return _gint
}
// TighteningThreshold gets the size starting from which the clamp will tighten
// its grip on the child.
//
// The function returns the following values:
//
// - gint: size starting from which the clamp will tighten its grip on the
// child.
//
func (self *Clamp) TighteningThreshold() int {
var _arg0 *C.HdyClamp // out
var _cret C.gint // in
_arg0 = (*C.HdyClamp)(unsafe.Pointer(externglib.InternObject(self).Native()))
_cret = C.hdy_clamp_get_tightening_threshold(_arg0)
runtime.KeepAlive(self)
var _gint int // out
_gint = int(_cret)
return _gint
}
// SetMaximumSize sets the maximum size to allocate to the contained child. It
// is the width if self is horizontal, or the height if it is vertical.
//
// The function takes the following parameters:
//
// - maximumSize: maximum size.
//
func (self *Clamp) SetMaximumSize(maximumSize int) {
var _arg0 *C.HdyClamp // out
var _arg1 C.gint // out
_arg0 = (*C.HdyClamp)(unsafe.Pointer(externglib.InternObject(self).Native()))
_arg1 = C.gint(maximumSize)
C.hdy_clamp_set_maximum_size(_arg0, _arg1)
runtime.KeepAlive(self)
runtime.KeepAlive(maximumSize)
}
// SetTighteningThreshold sets the size starting from which the clamp will
// tighten its grip on the child.
//
// The function takes the following parameters:
//
// - tighteningThreshold: tightening threshold.
//
func (self *Clamp) SetTighteningThreshold(tighteningThreshold int) {
var _arg0 *C.HdyClamp // out
var _arg1 C.gint // out
_arg0 = (*C.HdyClamp)(unsafe.Pointer(externglib.InternObject(self).Native()))
_arg1 = C.gint(tighteningThreshold)
C.hdy_clamp_set_tightening_threshold(_arg0, _arg1)
runtime.KeepAlive(self)
runtime.KeepAlive(tighteningThreshold)
}