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
14// The `PangoColor` structure is used to
15// represent a color in an uncalibrated RGB color-space.
16type Color struct {
17 _ structs.HostLayout
18
19 Red uint16
20
21 Green uint16
22
23 Blue uint16
24}
25
26var xColorGLibType func() types.GType
27
28func ColorGLibType() types.GType {
29 return xColorGLibType()
30}
31
32func (x *Color) GoPointer() uintptr {
33 return uintptr(unsafe.Pointer(x))
34}
35
36var xColorCopy func(uintptr) *Color
37
38// Creates a copy of @src.
39//
40// The copy should be freed with [method@Pango.Color.free].
41// Primarily used by language bindings, not that useful
42// otherwise (since colors can just be copied by assignment
43// in C).
44func (x *Color) Copy() *Color {
45
46 cret := xColorCopy(x.GoPointer())
47 return cret
48}
49
50var xColorFree func(uintptr)
51
52// Frees a color allocated by [method@Pango.Color.copy].
53func (x *Color) Free() {
54
55 xColorFree(x.GoPointer())
56
57}
58
59var xColorParse func(uintptr, string) bool
60
61// Fill in the fields of a color from a string specification.
62//
63// The string can either one of a large set of standard names.
64// (Taken from the CSS Color [specification](https://www.w3.org/TR/css-color-4/#named-colors),
65// or it can be a value in the form `#rgb`, `#rrggbb`,
66// `#rrrgggbbb` or `#rrrrggggbbbb`, where `r`, `g` and `b`
67// are hex digits of the red, green, and blue components
68// of the color, respectively. (White in the four forms is
69// `#fff`, `#ffffff`, `#fffffffff` and `#ffffffffffff`.)
70func (x *Color) Parse(SpecVar string) bool {
71
72 cret := xColorParse(x.GoPointer(), SpecVar)
73 return cret
74}
75
76var xColorParseWithAlpha func(uintptr, *uint16, string) bool
77
78// Fill in the fields of a color from a string specification.
79//
80// The string can either one of a large set of standard names.
81// (Taken from the CSS Color [specification](https://www.w3.org/TR/css-color-4/#named-colors),
82// or it can be a hexadecimal value in the form `#rgb`,
83// `#rrggbb`, `#rrrgggbbb` or `#rrrrggggbbbb` where `r`, `g`
84// and `b` are hex digits of the red, green, and blue components
85// of the color, respectively. (White in the four forms is
86// `#fff`, `#ffffff`, `#fffffffff` and `#ffffffffffff`.)
87//
88// Additionally, parse strings of the form `#rgba`, `#rrggbbaa`,
89// `#rrrrggggbbbbaaaa`, if @alpha is not %NULL, and set @alpha
90// to the value specified by the hex digits for `a`. If no alpha
91// component is found in @spec, @alpha is set to 0xffff (for a
92// solid color).
93func (x *Color) ParseWithAlpha(AlphaVar *uint16, SpecVar string) bool {
94
95 cret := xColorParseWithAlpha(x.GoPointer(), AlphaVar, SpecVar)
96 return cret
97}
98
99var xColorToString func(uintptr) string
100
101// Returns a textual specification of @color.
102//
103// The string is in the hexadecimal form `#rrrrggggbbbb`,
104// where `r`, `g` and `b` are hex digits representing the
105// red, green, and blue components respectively.
106func (x *Color) ToString() string {
107
108 cret := xColorToString(x.GoPointer())
109 return cret
110}
111
112func init() {
113 core.SetPackageName("PANGO", "pango")
114 core.SetSharedLibraries("PANGO", []string{"libpango-1.0.so.0"})
115 var libs []uintptr
116 for _, libPath := range core.GetPaths("PANGO") {
117 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
118 if err != nil {
119 panic(err)
120 }
121 libs = append(libs, lib)
122 }
123
124 core.PuregoSafeRegister(&xColorGLibType, libs, "pango_color_get_type")
125
126 core.PuregoSafeRegister(&xColorCopy, libs, "pango_color_copy")
127 core.PuregoSafeRegister(&xColorFree, libs, "pango_color_free")
128 core.PuregoSafeRegister(&xColorParse, libs, "pango_color_parse")
129 core.PuregoSafeRegister(&xColorParseWithAlpha, libs, "pango_color_parse_with_alpha")
130 core.PuregoSafeRegister(&xColorToString, libs, "pango_color_to_string")
131
132}