1// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gio
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/glib"
12 "github.com/bnema/puregotk/v4/gobject"
13 "github.com/bnema/puregotk/v4/gobject/types"
14)
15
16type EmblemedIconClass struct {
17 _ structs.HostLayout
18
19 ParentClass gobject.ObjectClass
20}
21
22func (x *EmblemedIconClass) GoPointer() uintptr {
23 return uintptr(unsafe.Pointer(x))
24}
25
26type EmblemedIconPrivate struct {
27 _ structs.HostLayout
28}
29
30func (x *EmblemedIconPrivate) GoPointer() uintptr {
31 return uintptr(unsafe.Pointer(x))
32}
33
34// `GEmblemedIcon` is an implementation of [iface@Gio.Icon] that supports
35// adding an emblem to an icon. Adding multiple emblems to an
36// icon is ensured via [method@Gio.EmblemedIcon.add_emblem].
37//
38// Note that `GEmblemedIcon` allows no control over the position
39// of the emblems. See also [class@Gio.Emblem] for more information.
40type EmblemedIcon struct {
41 gobject.Object
42}
43
44var xEmblemedIconGLibType func() types.GType
45
46func EmblemedIconGLibType() types.GType {
47 return xEmblemedIconGLibType()
48}
49
50func EmblemedIconNewFromInternalPtr(ptr uintptr) *EmblemedIcon {
51 cls := &EmblemedIcon{}
52 cls.Ptr = ptr
53 return cls
54}
55
56var xNewEmblemedIcon func(uintptr, uintptr) uintptr
57
58// Creates a new emblemed icon for @icon with the emblem @emblem.
59func NewEmblemedIcon(IconVar Icon, EmblemVar *Emblem) *EmblemedIcon {
60 var cls *EmblemedIcon
61
62 cret := xNewEmblemedIcon(IconVar.GoPointer(), EmblemVar.GoPointer())
63
64 if cret == 0 {
65 return nil
66 }
67 cls = &EmblemedIcon{}
68 cls.Ptr = cret
69 return cls
70}
71
72var xEmblemedIconAddEmblem func(uintptr, uintptr)
73
74// Adds @emblem to the #GList of #GEmblems.
75func (x *EmblemedIcon) AddEmblem(EmblemVar *Emblem) {
76
77 xEmblemedIconAddEmblem(x.GoPointer(), EmblemVar.GoPointer())
78
79}
80
81var xEmblemedIconClearEmblems func(uintptr)
82
83// Removes all the emblems from @icon.
84func (x *EmblemedIcon) ClearEmblems() {
85
86 xEmblemedIconClearEmblems(x.GoPointer())
87
88}
89
90var xEmblemedIconGetEmblems func(uintptr) *glib.List
91
92// Gets the list of emblems for the @icon.
93func (x *EmblemedIcon) GetEmblems() *glib.List {
94
95 cret := xEmblemedIconGetEmblems(x.GoPointer())
96 return cret
97}
98
99var xEmblemedIconGetIcon func(uintptr) uintptr
100
101// Gets the main icon for @emblemed.
102func (x *EmblemedIcon) GetIcon() *IconBase {
103 var cls *IconBase
104
105 cret := xEmblemedIconGetIcon(x.GoPointer())
106
107 if cret == 0 {
108 return nil
109 }
110 gobject.IncreaseRef(cret)
111 cls = &IconBase{}
112 cls.Ptr = cret
113 return cls
114}
115
116func (c *EmblemedIcon) GoPointer() uintptr {
117 if c == nil {
118 return 0
119 }
120 return c.Ptr
121}
122
123func (c *EmblemedIcon) SetGoPointer(ptr uintptr) {
124 c.Ptr = ptr
125}
126
127// Checks if two icons are equal.
128func (x *EmblemedIcon) Equal(Icon2Var Icon) bool {
129
130 cret := XGIconEqual(x.GoPointer(), Icon2Var.GoPointer())
131 return cret
132}
133
134// Gets a hash for an icon.
135func (x *EmblemedIcon) Hash() uint {
136
137 cret := XGIconHash(x.GoPointer())
138 return cret
139}
140
141// Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved
142// back by calling g_icon_deserialize() on the returned value.
143// As serialization will avoid using raw icon data when possible, it only
144// makes sense to transfer the #GVariant between processes on the same machine,
145// (as opposed to over the network), and within the same file system namespace.
146func (x *EmblemedIcon) Serialize() *glib.Variant {
147
148 cret := XGIconSerialize(x.GoPointer())
149 return cret
150}
151
152// Generates a textual representation of @icon that can be used for
153// serialization such as when passing @icon to a different process or
154// saving it to persistent storage. Use g_icon_new_for_string() to
155// get @icon back from the returned string.
156//
157// The encoding of the returned string is proprietary to #GIcon except
158// in the following two cases
159//
160// - If @icon is a #GFileIcon, the returned string is a native path
161// (such as `/path/to/my icon.png`) without escaping
162// if the #GFile for @icon is a native file. If the file is not
163// native, the returned string is the result of g_file_get_uri()
164// (such as `sftp://path/to/my%20icon.png`).
165//
166// - If @icon is a #GThemedIcon with exactly one name and no fallbacks,
167// the encoding is simply the name (such as `network-server`).
168func (x *EmblemedIcon) ToString() string {
169
170 cret := XGIconToString(x.GoPointer())
171 return cret
172}
173
174func init() {
175 core.SetPackageName("GIO", "gio-2.0")
176 core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
177 var libs []uintptr
178 for _, libPath := range core.GetPaths("GIO") {
179 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
180 if err != nil {
181 panic(err)
182 }
183 libs = append(libs, lib)
184 }
185
186 core.PuregoSafeRegister(&xEmblemedIconGLibType, libs, "g_emblemed_icon_get_type")
187
188 core.PuregoSafeRegister(&xNewEmblemedIcon, libs, "g_emblemed_icon_new")
189
190 core.PuregoSafeRegister(&xEmblemedIconAddEmblem, libs, "g_emblemed_icon_add_emblem")
191 core.PuregoSafeRegister(&xEmblemedIconClearEmblems, libs, "g_emblemed_icon_clear_emblems")
192 core.PuregoSafeRegister(&xEmblemedIconGetEmblems, libs, "g_emblemed_icon_get_emblems")
193 core.PuregoSafeRegister(&xEmblemedIconGetIcon, libs, "g_emblemed_icon_get_icon")
194
195}