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 size.
15type Size struct {
16 _ structs.HostLayout
17
18 Width float32
19
20 Height float32
21}
22
23var xSizeGLibType func() types.GType
24
25func SizeGLibType() types.GType {
26 return xSizeGLibType()
27}
28
29func (x *Size) GoPointer() uintptr {
30 return uintptr(unsafe.Pointer(x))
31}
32
33var xSizeAlloc func() *Size
34
35// Allocates a new #graphene_size_t.
36//
37// The contents of the returned value are undefined.
38func SizeAlloc() *Size {
39
40 cret := xSizeAlloc()
41 return cret
42}
43
44var xSizeEqual func(uintptr, *Size) bool
45
46// Checks whether the two give #graphene_size_t are equal.
47func (x *Size) Equal(BVar *Size) bool {
48
49 cret := xSizeEqual(x.GoPointer(), BVar)
50 return cret
51}
52
53var xSizeFree func(uintptr)
54
55// Frees the resources allocated by graphene_size_alloc().
56func (x *Size) Free() {
57
58 xSizeFree(x.GoPointer())
59
60}
61
62var xSizeInit func(uintptr, float32, float32) *Size
63
64// Initializes a #graphene_size_t using the given @width and @height.
65func (x *Size) Init(WidthVar float32, HeightVar float32) *Size {
66
67 cret := xSizeInit(x.GoPointer(), WidthVar, HeightVar)
68 return cret
69}
70
71var xSizeInitFromSize func(uintptr, *Size) *Size
72
73// Initializes a #graphene_size_t using the width and height of
74// the given @src.
75func (x *Size) InitFromSize(SrcVar *Size) *Size {
76
77 cret := xSizeInitFromSize(x.GoPointer(), SrcVar)
78 return cret
79}
80
81var xSizeInterpolate func(uintptr, *Size, float64, *Size)
82
83// Linearly interpolates the two given #graphene_size_t using the given
84// interpolation @factor.
85func (x *Size) Interpolate(BVar *Size, FactorVar float64, ResVar *Size) {
86
87 xSizeInterpolate(x.GoPointer(), BVar, FactorVar, ResVar)
88
89}
90
91var xSizeScale func(uintptr, float32, *Size)
92
93// Scales the components of a #graphene_size_t using the given @factor.
94func (x *Size) Scale(FactorVar float32, ResVar *Size) {
95
96 xSizeScale(x.GoPointer(), FactorVar, ResVar)
97
98}
99
100var xSizeZero func() *Size
101
102// A constant pointer to a zero #graphene_size_t, useful for
103// equality checks and interpolations.
104func SizeZero() *Size {
105
106 cret := xSizeZero()
107 return cret
108}
109
110func init() {
111 core.SetPackageName("GRAPHENE", "graphene-gobject-1.0")
112 core.SetSharedLibraries("GRAPHENE", []string{"libgraphene-1.0.so.0"})
113 var libs []uintptr
114 for _, libPath := range core.GetPaths("GRAPHENE") {
115 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
116 if err != nil {
117 panic(err)
118 }
119 libs = append(libs, lib)
120 }
121
122 core.PuregoSafeRegister(&xSizeZero, libs, "graphene_size_zero")
123
124 core.PuregoSafeRegister(&xSizeGLibType, libs, "graphene_size_get_type")
125
126 core.PuregoSafeRegister(&xSizeAlloc, libs, "graphene_size_alloc")
127
128 core.PuregoSafeRegister(&xSizeEqual, libs, "graphene_size_equal")
129 core.PuregoSafeRegister(&xSizeFree, libs, "graphene_size_free")
130 core.PuregoSafeRegister(&xSizeInit, libs, "graphene_size_init")
131 core.PuregoSafeRegister(&xSizeInitFromSize, libs, "graphene_size_init_from_size")
132 core.PuregoSafeRegister(&xSizeInterpolate, libs, "graphene_size_interpolate")
133 core.PuregoSafeRegister(&xSizeScale, libs, "graphene_size_scale")
134
135}