1// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gio
3
4import (
5 "github.com/ebitengine/purego"
6
7 "github.com/bnema/puregotk/pkg/core"
8 "github.com/bnema/puregotk/v4/glib"
9)
10
11var xContentTypeCanBeExecutable func(string) bool
12
13// Checks if a content type can be executable. Note that for instance
14// things like text files can be executables (i.e. scripts and batch files).
15func ContentTypeCanBeExecutable(TypeVar string) bool {
16
17 cret := xContentTypeCanBeExecutable(TypeVar)
18 return cret
19}
20
21var xContentTypeEquals func(string, string) bool
22
23// Compares two content types for equality.
24func ContentTypeEquals(Type1Var string, Type2Var string) bool {
25
26 cret := xContentTypeEquals(Type1Var, Type2Var)
27 return cret
28}
29
30var xContentTypeFromMimeType func(string) string
31
32// Tries to find a content type based on the mime type name.
33func ContentTypeFromMimeType(MimeTypeVar string) string {
34
35 cret := xContentTypeFromMimeType(MimeTypeVar)
36 return cret
37}
38
39var xContentTypeGetDescription func(string) string
40
41// Gets the human readable description of the content type.
42func ContentTypeGetDescription(TypeVar string) string {
43
44 cret := xContentTypeGetDescription(TypeVar)
45 return cret
46}
47
48var xContentTypeGetGenericIconName func(string) string
49
50// Gets the generic icon name for a content type.
51//
52// See the
53// [shared-mime-info](http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec)
54// specification for more on the generic icon name.
55func ContentTypeGetGenericIconName(TypeVar string) string {
56
57 cret := xContentTypeGetGenericIconName(TypeVar)
58 return cret
59}
60
61var xContentTypeGetIcon func(string) uintptr
62
63// Gets the icon for a content type.
64func ContentTypeGetIcon(TypeVar string) *IconBase {
65 var cls *IconBase
66
67 cret := xContentTypeGetIcon(TypeVar)
68
69 if cret == 0 {
70 return nil
71 }
72 cls = &IconBase{}
73 cls.Ptr = cret
74 return cls
75}
76
77var xContentTypeGetMimeDirs func() []string
78
79// Get the list of directories which MIME data is loaded from. See
80// g_content_type_set_mime_dirs() for details.
81func ContentTypeGetMimeDirs() []string {
82
83 cret := xContentTypeGetMimeDirs()
84 return cret
85}
86
87var xContentTypeGetMimeType func(string) string
88
89// Gets the mime type for the content type, if one is registered.
90func ContentTypeGetMimeType(TypeVar string) string {
91
92 cret := xContentTypeGetMimeType(TypeVar)
93 return cret
94}
95
96var xContentTypeGetSymbolicIcon func(string) uintptr
97
98// Gets the symbolic icon for a content type.
99func ContentTypeGetSymbolicIcon(TypeVar string) *IconBase {
100 var cls *IconBase
101
102 cret := xContentTypeGetSymbolicIcon(TypeVar)
103
104 if cret == 0 {
105 return nil
106 }
107 cls = &IconBase{}
108 cls.Ptr = cret
109 return cls
110}
111
112var xContentTypeGuess func(uintptr, []byte, uint, *bool) string
113
114// Guesses the content type based on example data. If the function is
115// uncertain, @result_uncertain will be set to %TRUE. Either @filename
116// or @data may be %NULL, in which case the guess will be based solely
117// on the other argument.
118func ContentTypeGuess(FilenameVar *string, DataVar []byte, DataSizeVar uint, ResultUncertainVar *bool) string {
119
120 FilenameVarPtr := core.GStrdupNullable(FilenameVar)
121 defer core.GFreeNullable(FilenameVarPtr)
122
123 cret := xContentTypeGuess(FilenameVarPtr, DataVar, DataSizeVar, ResultUncertainVar)
124 return cret
125}
126
127var xContentTypeGuessForTree func(uintptr) []string
128
129// Tries to guess the type of the tree with root @root, by
130// looking at the files it contains. The result is an array
131// of content types, with the best guess coming first.
132//
133// The types returned all have the form x-content/foo, e.g.
134// x-content/audio-cdda (for audio CDs) or x-content/image-dcf
135// (for a camera memory card). See the
136// [shared-mime-info](http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec)
137// specification for more on x-content types.
138//
139// This function is useful in the implementation of
140// g_mount_guess_content_type().
141func ContentTypeGuessForTree(RootVar File) []string {
142
143 cret := xContentTypeGuessForTree(RootVar.GoPointer())
144 return cret
145}
146
147var xContentTypeIsA func(string, string) bool
148
149// Determines if @type is a subset of @supertype.
150func ContentTypeIsA(TypeVar string, SupertypeVar string) bool {
151
152 cret := xContentTypeIsA(TypeVar, SupertypeVar)
153 return cret
154}
155
156var xContentTypeIsMimeType func(string, string) bool
157
158// Determines if @type is a subset of @mime_type.
159// Convenience wrapper around g_content_type_is_a().
160func ContentTypeIsMimeType(TypeVar string, MimeTypeVar string) bool {
161
162 cret := xContentTypeIsMimeType(TypeVar, MimeTypeVar)
163 return cret
164}
165
166var xContentTypeIsUnknown func(string) bool
167
168// Checks if the content type is the generic "unknown" type.
169// On UNIX this is the "application/octet-stream" mimetype,
170// while on win32 it is "*" and on OSX it is a dynamic type
171// or octet-stream.
172func ContentTypeIsUnknown(TypeVar string) bool {
173
174 cret := xContentTypeIsUnknown(TypeVar)
175 return cret
176}
177
178var xContentTypeSetMimeDirs func([]string)
179
180// Set the list of directories used by GIO to load the MIME database.
181// If @dirs is %NULL, the directories used are the default:
182//
183// - the `mime` subdirectory of the directory in `$XDG_DATA_HOME`
184// - the `mime` subdirectory of every directory in `$XDG_DATA_DIRS`
185//
186// This function is intended to be used when writing tests that depend on
187// information stored in the MIME database, in order to control the data.
188//
189// Typically, in case your tests use %G_TEST_OPTION_ISOLATE_DIRS, but they
190// depend on the system’s MIME database, you should call this function
191// with @dirs set to %NULL before calling g_test_init(), for instance:
192//
193// |[<!-- language="C" -->
194//
195// // Load MIME data from the system
196// g_content_type_set_mime_dirs (NULL);
197// // Isolate the environment
198// g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
199//
200// …
201//
202// return g_test_run ();
203//
204// ]|
205func ContentTypeSetMimeDirs(DirsVar []string) {
206
207 xContentTypeSetMimeDirs(DirsVar)
208
209}
210
211var xContentTypesGetRegistered func() *glib.List
212
213// Gets a list of strings containing all the registered content types
214// known to the system. The list and its data should be freed using
215// `g_list_free_full (list, g_free)`.
216func ContentTypesGetRegistered() *glib.List {
217
218 cret := xContentTypesGetRegistered()
219 return cret
220}
221
222func init() {
223 core.SetPackageName("GIO", "gio-2.0")
224 core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
225 var libs []uintptr
226 for _, libPath := range core.GetPaths("GIO") {
227 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
228 if err != nil {
229 panic(err)
230 }
231 libs = append(libs, lib)
232 }
233
234 core.PuregoSafeRegister(&xContentTypeCanBeExecutable, libs, "g_content_type_can_be_executable")
235 core.PuregoSafeRegister(&xContentTypeEquals, libs, "g_content_type_equals")
236 core.PuregoSafeRegister(&xContentTypeFromMimeType, libs, "g_content_type_from_mime_type")
237 core.PuregoSafeRegister(&xContentTypeGetDescription, libs, "g_content_type_get_description")
238 core.PuregoSafeRegister(&xContentTypeGetGenericIconName, libs, "g_content_type_get_generic_icon_name")
239 core.PuregoSafeRegister(&xContentTypeGetIcon, libs, "g_content_type_get_icon")
240 core.PuregoSafeRegister(&xContentTypeGetMimeDirs, libs, "g_content_type_get_mime_dirs")
241 core.PuregoSafeRegister(&xContentTypeGetMimeType, libs, "g_content_type_get_mime_type")
242 core.PuregoSafeRegister(&xContentTypeGetSymbolicIcon, libs, "g_content_type_get_symbolic_icon")
243 core.PuregoSafeRegister(&xContentTypeGuess, libs, "g_content_type_guess")
244 core.PuregoSafeRegister(&xContentTypeGuessForTree, libs, "g_content_type_guess_for_tree")
245 core.PuregoSafeRegister(&xContentTypeIsA, libs, "g_content_type_is_a")
246 core.PuregoSafeRegister(&xContentTypeIsMimeType, libs, "g_content_type_is_mime_type")
247 core.PuregoSafeRegister(&xContentTypeIsUnknown, libs, "g_content_type_is_unknown")
248 core.PuregoSafeRegister(&xContentTypeSetMimeDirs, libs, "g_content_type_set_mime_dirs")
249 core.PuregoSafeRegister(&xContentTypesGetRegistered, libs, "g_content_types_get_registered")
250
251}