1// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gdk
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/types"
13)
14
15// Creates `GdkContentFormats` objects.
16type ContentFormatsBuilder struct {
17 _ structs.HostLayout
18}
19
20var xContentFormatsBuilderGLibType func() types.GType
21
22func ContentFormatsBuilderGLibType() types.GType {
23 return xContentFormatsBuilderGLibType()
24}
25
26func (x *ContentFormatsBuilder) GoPointer() uintptr {
27 return uintptr(unsafe.Pointer(x))
28}
29
30var xNewContentFormatsBuilder func() *ContentFormatsBuilder
31
32// Create a new `GdkContentFormatsBuilder` object.
33//
34// The resulting builder would create an empty `GdkContentFormats`.
35// Use addition functions to add types to it.
36func NewContentFormatsBuilder() *ContentFormatsBuilder {
37
38 cret := xNewContentFormatsBuilder()
39 return cret
40}
41
42var xContentFormatsBuilderAddFormats func(uintptr, *ContentFormats)
43
44// Appends all formats from @formats to @builder, skipping those that
45// already exist.
46func (x *ContentFormatsBuilder) AddFormats(FormatsVar *ContentFormats) {
47
48 xContentFormatsBuilderAddFormats(x.GoPointer(), FormatsVar)
49
50}
51
52var xContentFormatsBuilderAddGtype func(uintptr, types.GType)
53
54// Appends @type to @builder if it has not already been added.
55func (x *ContentFormatsBuilder) AddGtype(TypeVar types.GType) {
56
57 xContentFormatsBuilderAddGtype(x.GoPointer(), TypeVar)
58
59}
60
61var xContentFormatsBuilderAddMimeType func(uintptr, string)
62
63// Appends @mime_type to @builder if it has not already been added.
64func (x *ContentFormatsBuilder) AddMimeType(MimeTypeVar string) {
65
66 xContentFormatsBuilderAddMimeType(x.GoPointer(), MimeTypeVar)
67
68}
69
70var xContentFormatsBuilderFreeToFormats func(uintptr) *ContentFormats
71
72// Creates a new `GdkContentFormats` from the current state of the
73// given @builder, and frees the @builder instance.
74func (x *ContentFormatsBuilder) FreeToFormats() *ContentFormats {
75
76 cret := xContentFormatsBuilderFreeToFormats(x.GoPointer())
77 return cret
78}
79
80var xContentFormatsBuilderRef func(uintptr) *ContentFormatsBuilder
81
82// Acquires a reference on the given @builder.
83//
84// This function is intended primarily for bindings.
85// `GdkContentFormatsBuilder` objects should not be kept around.
86func (x *ContentFormatsBuilder) Ref() *ContentFormatsBuilder {
87
88 cret := xContentFormatsBuilderRef(x.GoPointer())
89 return cret
90}
91
92var xContentFormatsBuilderToFormats func(uintptr) *ContentFormats
93
94// Creates a new `GdkContentFormats` from the given @builder.
95//
96// The given `GdkContentFormatsBuilder` is reset once this function returns;
97// you cannot call this function multiple times on the same @builder instance.
98//
99// This function is intended primarily for bindings. C code should use
100// [method@Gdk.ContentFormatsBuilder.free_to_formats].
101func (x *ContentFormatsBuilder) ToFormats() *ContentFormats {
102
103 cret := xContentFormatsBuilderToFormats(x.GoPointer())
104 return cret
105}
106
107var xContentFormatsBuilderUnref func(uintptr)
108
109// Releases a reference on the given @builder.
110func (x *ContentFormatsBuilder) Unref() {
111
112 xContentFormatsBuilderUnref(x.GoPointer())
113
114}
115
116// An opaque type representing a list of files.
117type FileList struct {
118 _ structs.HostLayout
119}
120
121var xFileListGLibType func() types.GType
122
123func FileListGLibType() types.GType {
124 return xFileListGLibType()
125}
126
127func (x *FileList) GoPointer() uintptr {
128 return uintptr(unsafe.Pointer(x))
129}
130
131var xNewFileListFromArray func(uintptr, uint) *FileList
132
133// Creates a new `GdkFileList` for the given array of files.
134//
135// This function is meant to be used by language bindings.
136func NewFileListFromArray(FilesVar uintptr, NFilesVar uint) *FileList {
137
138 cret := xNewFileListFromArray(FilesVar, NFilesVar)
139 return cret
140}
141
142var xNewFileListFromList func(*glib.SList) *FileList
143
144// Creates a new files list container from a singly linked list of
145// `GFile` instances.
146//
147// This function is meant to be used by language bindings
148func NewFileListFromList(FilesVar *glib.SList) *FileList {
149
150 cret := xNewFileListFromList(FilesVar)
151 return cret
152}
153
154var xFileListGetFiles func(uintptr) *glib.SList
155
156// Retrieves the list of files inside a `GdkFileList`.
157//
158// This function is meant for language bindings.
159func (x *FileList) GetFiles() *glib.SList {
160
161 cret := xFileListGetFiles(x.GoPointer())
162 return cret
163}
164
165var xContentFormatsParse func(string) *ContentFormats
166
167// Parses the given @string into `GdkContentFormats` and
168// returns the formats.
169//
170// Strings printed via [method@Gdk.ContentFormats.to_string]
171// can be read in again successfully using this function.
172//
173// If @string does not describe valid content formats, %NULL
174// is returned.
175func ContentFormatsParse(StringVar string) *ContentFormats {
176
177 cret := xContentFormatsParse(StringVar)
178 return cret
179}
180
181var xInternMimeType func(string) string
182
183// Canonicalizes the given mime type and interns the result.
184//
185// If @string is not a valid mime type, %NULL is returned instead.
186// See RFC 2048 for the syntax if mime types.
187func InternMimeType(StringVar string) string {
188
189 cret := xInternMimeType(StringVar)
190 return cret
191}
192
193func init() {
194 core.SetPackageName("GDK", "gtk4")
195 core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"})
196 var libs []uintptr
197 for _, libPath := range core.GetPaths("GDK") {
198 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
199 if err != nil {
200 panic(err)
201 }
202 libs = append(libs, lib)
203 }
204
205 core.PuregoSafeRegister(&xContentFormatsParse, libs, "gdk_content_formats_parse")
206 core.PuregoSafeRegister(&xInternMimeType, libs, "gdk_intern_mime_type")
207
208 core.PuregoSafeRegister(&xContentFormatsBuilderGLibType, libs, "gdk_content_formats_builder_get_type")
209
210 core.PuregoSafeRegister(&xNewContentFormatsBuilder, libs, "gdk_content_formats_builder_new")
211
212 core.PuregoSafeRegister(&xContentFormatsBuilderAddFormats, libs, "gdk_content_formats_builder_add_formats")
213 core.PuregoSafeRegister(&xContentFormatsBuilderAddGtype, libs, "gdk_content_formats_builder_add_gtype")
214 core.PuregoSafeRegister(&xContentFormatsBuilderAddMimeType, libs, "gdk_content_formats_builder_add_mime_type")
215 core.PuregoSafeRegister(&xContentFormatsBuilderFreeToFormats, libs, "gdk_content_formats_builder_free_to_formats")
216 core.PuregoSafeRegister(&xContentFormatsBuilderRef, libs, "gdk_content_formats_builder_ref")
217 core.PuregoSafeRegister(&xContentFormatsBuilderToFormats, libs, "gdk_content_formats_builder_to_formats")
218 core.PuregoSafeRegister(&xContentFormatsBuilderUnref, libs, "gdk_content_formats_builder_unref")
219
220 core.PuregoSafeRegister(&xFileListGLibType, libs, "gdk_file_list_get_type")
221
222 core.PuregoSafeRegister(&xNewFileListFromArray, libs, "gdk_file_list_new_from_array")
223 core.PuregoSafeRegister(&xNewFileListFromList, libs, "gdk_file_list_new_from_list")
224
225 core.PuregoSafeRegister(&xFileListGetFiles, libs, "gdk_file_list_get_files")
226
227}