1// Package graphene was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package graphene
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/gobject/types"
12)
13
14// A structure capable of holding a vector with two dimensions, x and y.
15//
16// The contents of the #graphene_vec2_t structure are private and should
17// never be accessed directly.
18type Vec2 struct {
19 _ structs.HostLayout
20
21 Value uintptr
22}
23
24var xVec2GLibType func() types.GType
25
26func Vec2GLibType() types.GType {
27 return xVec2GLibType()
28}
29
30func (x *Vec2) GoPointer() uintptr {
31 return uintptr(unsafe.Pointer(x))
32}
33
34var xVec2Alloc func() *Vec2
35
36// Allocates a new #graphene_vec2_t structure.
37//
38// The contents of the returned structure are undefined.
39//
40// Use graphene_vec2_init() to initialize the vector.
41func Vec2Alloc() *Vec2 {
42
43 cret := xVec2Alloc()
44 return cret
45}
46
47var xVec2Add func(uintptr, *Vec2, *Vec2)
48
49// Adds each component of the two passed vectors and places
50// each result into the components of @res.
51func (x *Vec2) Add(BVar *Vec2, ResVar *Vec2) {
52
53 xVec2Add(x.GoPointer(), BVar, ResVar)
54
55}
56
57var xVec2Divide func(uintptr, *Vec2, *Vec2)
58
59// Divides each component of the first operand @a by the corresponding
60// component of the second operand @b, and places the results into the
61// vector @res.
62func (x *Vec2) Divide(BVar *Vec2, ResVar *Vec2) {
63
64 xVec2Divide(x.GoPointer(), BVar, ResVar)
65
66}
67
68var xVec2Dot func(uintptr, *Vec2) float32
69
70// Computes the dot product of the two given vectors.
71func (x *Vec2) Dot(BVar *Vec2) float32 {
72
73 cret := xVec2Dot(x.GoPointer(), BVar)
74 return cret
75}
76
77var xVec2Equal func(uintptr, *Vec2) bool
78
79// Checks whether the two given #graphene_vec2_t are equal.
80func (x *Vec2) Equal(V2Var *Vec2) bool {
81
82 cret := xVec2Equal(x.GoPointer(), V2Var)
83 return cret
84}
85
86var xVec2Free func(uintptr)
87
88// Frees the resources allocated by @v
89func (x *Vec2) Free() {
90
91 xVec2Free(x.GoPointer())
92
93}
94
95var xVec2GetX func(uintptr) float32
96
97// Retrieves the X component of the #graphene_vec2_t.
98func (x *Vec2) GetX() float32 {
99
100 cret := xVec2GetX(x.GoPointer())
101 return cret
102}
103
104var xVec2GetY func(uintptr) float32
105
106// Retrieves the Y component of the #graphene_vec2_t.
107func (x *Vec2) GetY() float32 {
108
109 cret := xVec2GetY(x.GoPointer())
110 return cret
111}
112
113var xVec2Init func(uintptr, float32, float32) *Vec2
114
115// Initializes a #graphene_vec2_t using the given values.
116//
117// This function can be called multiple times.
118func (x *Vec2) Init(XVar float32, YVar float32) *Vec2 {
119
120 cret := xVec2Init(x.GoPointer(), XVar, YVar)
121 return cret
122}
123
124var xVec2InitFromFloat func(uintptr, *[2]float32) *Vec2
125
126// Initializes @v with the contents of the given array.
127func (x *Vec2) InitFromFloat(SrcVar [2]float32) *Vec2 {
128
129 cret := xVec2InitFromFloat(x.GoPointer(), &SrcVar)
130 return cret
131}
132
133var xVec2InitFromVec2 func(uintptr, *Vec2) *Vec2
134
135// Copies the contents of @src into @v.
136func (x *Vec2) InitFromVec2(SrcVar *Vec2) *Vec2 {
137
138 cret := xVec2InitFromVec2(x.GoPointer(), SrcVar)
139 return cret
140}
141
142var xVec2Interpolate func(uintptr, *Vec2, float64, *Vec2)
143
144// Linearly interpolates @v1 and @v2 using the given @factor.
145func (x *Vec2) Interpolate(V2Var *Vec2, FactorVar float64, ResVar *Vec2) {
146
147 xVec2Interpolate(x.GoPointer(), V2Var, FactorVar, ResVar)
148
149}
150
151var xVec2Length func(uintptr) float32
152
153// Computes the length of the given vector.
154func (x *Vec2) Length() float32 {
155
156 cret := xVec2Length(x.GoPointer())
157 return cret
158}
159
160var xVec2Max func(uintptr, *Vec2, *Vec2)
161
162// Compares the two given vectors and places the maximum
163// values of each component into @res.
164func (x *Vec2) Max(BVar *Vec2, ResVar *Vec2) {
165
166 xVec2Max(x.GoPointer(), BVar, ResVar)
167
168}
169
170var xVec2Min func(uintptr, *Vec2, *Vec2)
171
172// Compares the two given vectors and places the minimum
173// values of each component into @res.
174func (x *Vec2) Min(BVar *Vec2, ResVar *Vec2) {
175
176 xVec2Min(x.GoPointer(), BVar, ResVar)
177
178}
179
180var xVec2Multiply func(uintptr, *Vec2, *Vec2)
181
182// Multiplies each component of the two passed vectors and places
183// each result into the components of @res.
184func (x *Vec2) Multiply(BVar *Vec2, ResVar *Vec2) {
185
186 xVec2Multiply(x.GoPointer(), BVar, ResVar)
187
188}
189
190var xVec2Near func(uintptr, *Vec2, float32) bool
191
192// Compares the two given #graphene_vec2_t vectors and checks
193// whether their values are within the given @epsilon.
194func (x *Vec2) Near(V2Var *Vec2, EpsilonVar float32) bool {
195
196 cret := xVec2Near(x.GoPointer(), V2Var, EpsilonVar)
197 return cret
198}
199
200var xVec2Negate func(uintptr, *Vec2)
201
202// Negates the given #graphene_vec2_t.
203func (x *Vec2) Negate(ResVar *Vec2) {
204
205 xVec2Negate(x.GoPointer(), ResVar)
206
207}
208
209var xVec2Normalize func(uintptr, *Vec2)
210
211// Computes the normalized vector for the given vector @v.
212func (x *Vec2) Normalize(ResVar *Vec2) {
213
214 xVec2Normalize(x.GoPointer(), ResVar)
215
216}
217
218var xVec2Scale func(uintptr, float32, *Vec2)
219
220// Multiplies all components of the given vector with the given scalar @factor.
221func (x *Vec2) Scale(FactorVar float32, ResVar *Vec2) {
222
223 xVec2Scale(x.GoPointer(), FactorVar, ResVar)
224
225}
226
227var xVec2Subtract func(uintptr, *Vec2, *Vec2)
228
229// Subtracts from each component of the first operand @a the
230// corresponding component of the second operand @b and places
231// each result into the components of @res.
232func (x *Vec2) Subtract(BVar *Vec2, ResVar *Vec2) {
233
234 xVec2Subtract(x.GoPointer(), BVar, ResVar)
235
236}
237
238var xVec2ToFloat func(uintptr, *[2]float32)
239
240// Stores the components of @v into an array.
241func (x *Vec2) ToFloat(DestVar *[2]float32) {
242
243 xVec2ToFloat(x.GoPointer(), DestVar)
244
245}
246
247var xVec2One func() *Vec2
248
249// Retrieves a constant vector with (1, 1) components.
250func Vec2One() *Vec2 {
251
252 cret := xVec2One()
253 return cret
254}
255
256var xVec2XAxis func() *Vec2
257
258// Retrieves a constant vector with (1, 0) components.
259func Vec2XAxis() *Vec2 {
260
261 cret := xVec2XAxis()
262 return cret
263}
264
265var xVec2YAxis func() *Vec2
266
267// Retrieves a constant vector with (0, 1) components.
268func Vec2YAxis() *Vec2 {
269
270 cret := xVec2YAxis()
271 return cret
272}
273
274var xVec2Zero func() *Vec2
275
276// Retrieves a constant vector with (0, 0) components.
277func Vec2Zero() *Vec2 {
278
279 cret := xVec2Zero()
280 return cret
281}
282
283func init() {
284 core.SetPackageName("GRAPHENE", "graphene-gobject-1.0")
285 core.SetSharedLibraries("GRAPHENE", []string{"libgraphene-1.0.so.0"})
286 var libs []uintptr
287 for _, libPath := range core.GetPaths("GRAPHENE") {
288 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
289 if err != nil {
290 panic(err)
291 }
292 libs = append(libs, lib)
293 }
294
295 core.PuregoSafeRegister(&xVec2One, libs, "graphene_vec2_one")
296 core.PuregoSafeRegister(&xVec2XAxis, libs, "graphene_vec2_x_axis")
297 core.PuregoSafeRegister(&xVec2YAxis, libs, "graphene_vec2_y_axis")
298 core.PuregoSafeRegister(&xVec2Zero, libs, "graphene_vec2_zero")
299
300 core.PuregoSafeRegister(&xVec2GLibType, libs, "graphene_vec2_get_type")
301
302 core.PuregoSafeRegister(&xVec2Alloc, libs, "graphene_vec2_alloc")
303
304 core.PuregoSafeRegister(&xVec2Add, libs, "graphene_vec2_add")
305 core.PuregoSafeRegister(&xVec2Divide, libs, "graphene_vec2_divide")
306 core.PuregoSafeRegister(&xVec2Dot, libs, "graphene_vec2_dot")
307 core.PuregoSafeRegister(&xVec2Equal, libs, "graphene_vec2_equal")
308 core.PuregoSafeRegister(&xVec2Free, libs, "graphene_vec2_free")
309 core.PuregoSafeRegister(&xVec2GetX, libs, "graphene_vec2_get_x")
310 core.PuregoSafeRegister(&xVec2GetY, libs, "graphene_vec2_get_y")
311 core.PuregoSafeRegister(&xVec2Init, libs, "graphene_vec2_init")
312 core.PuregoSafeRegister(&xVec2InitFromFloat, libs, "graphene_vec2_init_from_float")
313 core.PuregoSafeRegister(&xVec2InitFromVec2, libs, "graphene_vec2_init_from_vec2")
314 core.PuregoSafeRegister(&xVec2Interpolate, libs, "graphene_vec2_interpolate")
315 core.PuregoSafeRegister(&xVec2Length, libs, "graphene_vec2_length")
316 core.PuregoSafeRegister(&xVec2Max, libs, "graphene_vec2_max")
317 core.PuregoSafeRegister(&xVec2Min, libs, "graphene_vec2_min")
318 core.PuregoSafeRegister(&xVec2Multiply, libs, "graphene_vec2_multiply")
319 core.PuregoSafeRegister(&xVec2Near, libs, "graphene_vec2_near")
320 core.PuregoSafeRegister(&xVec2Negate, libs, "graphene_vec2_negate")
321 core.PuregoSafeRegister(&xVec2Normalize, libs, "graphene_vec2_normalize")
322 core.PuregoSafeRegister(&xVec2Scale, libs, "graphene_vec2_scale")
323 core.PuregoSafeRegister(&xVec2Subtract, libs, "graphene_vec2_subtract")
324 core.PuregoSafeRegister(&xVec2ToFloat, libs, "graphene_vec2_to_float")
325
326}