pango-fontset-simple.go RawHistoryFolder
1// Package pango was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package pango
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
14type FontsetSimpleClass struct {
15 _ structs.HostLayout
16}
17
18func (x *FontsetSimpleClass) GoPointer() uintptr {
19 return uintptr(unsafe.Pointer(x))
20}
21
22// `PangoFontsetSimple` is a implementation of the abstract
23// `PangoFontset` base class as an array of fonts.
24//
25// When creating a `PangoFontsetSimple`, you have to provide
26// the array of fonts that make up the fontset.
27type FontsetSimple struct {
28 Fontset
29}
30
31var xFontsetSimpleGLibType func() types.GType
32
33func FontsetSimpleGLibType() types.GType {
34 return xFontsetSimpleGLibType()
35}
36
37func FontsetSimpleNewFromInternalPtr(ptr uintptr) *FontsetSimple {
38 cls := &FontsetSimple{}
39 cls.Ptr = ptr
40 return cls
41}
42
43var xNewFontsetSimple func(*Language) uintptr
44
45// Creates a new `PangoFontsetSimple` for the given language.
46func NewFontsetSimple(LanguageVar *Language) *FontsetSimple {
47 var cls *FontsetSimple
48
49 cret := xNewFontsetSimple(LanguageVar)
50
51 if cret == 0 {
52 return nil
53 }
54 cls = &FontsetSimple{}
55 cls.Ptr = cret
56 return cls
57}
58
59var xFontsetSimpleAppend func(uintptr, uintptr)
60
61// Adds a font to the fontset.
62//
63// The fontset takes ownership of @font.
64func (x *FontsetSimple) Append(FontVar *Font) {
65
66 xFontsetSimpleAppend(x.GoPointer(), FontVar.GoPointer())
67
68}
69
70var xFontsetSimpleSize func(uintptr) int
71
72// Returns the number of fonts in the fontset.
73func (x *FontsetSimple) Size() int {
74
75 cret := xFontsetSimpleSize(x.GoPointer())
76 return cret
77}
78
79func (c *FontsetSimple) GoPointer() uintptr {
80 if c == nil {
81 return 0
82 }
83 return c.Ptr
84}
85
86func (c *FontsetSimple) SetGoPointer(ptr uintptr) {
87 c.Ptr = ptr
88}
89
90func init() {
91 core.SetPackageName("PANGO", "pango")
92 core.SetSharedLibraries("PANGO", []string{"libpango-1.0.so.0"})
93 var libs []uintptr
94 for _, libPath := range core.GetPaths("PANGO") {
95 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
96 if err != nil {
97 panic(err)
98 }
99 libs = append(libs, lib)
100 }
101
102 core.PuregoSafeRegister(&xFontsetSimpleGLibType, libs, "pango_fontset_simple_get_type")
103
104 core.PuregoSafeRegister(&xNewFontsetSimple, libs, "pango_fontset_simple_new")
105
106 core.PuregoSafeRegister(&xFontsetSimpleAppend, libs, "pango_fontset_simple_append")
107 core.PuregoSafeRegister(&xFontsetSimpleSize, libs, "pango_fontset_simple_size")
108
109}