// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gdk import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject/types" ) // Creates `GdkContentFormats` objects. type ContentFormatsBuilder struct { _ structs.HostLayout } var xContentFormatsBuilderGLibType func() types.GType func ContentFormatsBuilderGLibType() types.GType { return xContentFormatsBuilderGLibType() } func (x *ContentFormatsBuilder) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xNewContentFormatsBuilder func() *ContentFormatsBuilder // Create a new `GdkContentFormatsBuilder` object. // // The resulting builder would create an empty `GdkContentFormats`. // Use addition functions to add types to it. func NewContentFormatsBuilder() *ContentFormatsBuilder { cret := xNewContentFormatsBuilder() return cret } var xContentFormatsBuilderAddFormats func(uintptr, *ContentFormats) // Appends all formats from @formats to @builder, skipping those that // already exist. func (x *ContentFormatsBuilder) AddFormats(FormatsVar *ContentFormats) { xContentFormatsBuilderAddFormats(x.GoPointer(), FormatsVar) } var xContentFormatsBuilderAddGtype func(uintptr, types.GType) // Appends @type to @builder if it has not already been added. func (x *ContentFormatsBuilder) AddGtype(TypeVar types.GType) { xContentFormatsBuilderAddGtype(x.GoPointer(), TypeVar) } var xContentFormatsBuilderAddMimeType func(uintptr, string) // Appends @mime_type to @builder if it has not already been added. func (x *ContentFormatsBuilder) AddMimeType(MimeTypeVar string) { xContentFormatsBuilderAddMimeType(x.GoPointer(), MimeTypeVar) } var xContentFormatsBuilderFreeToFormats func(uintptr) *ContentFormats // Creates a new `GdkContentFormats` from the current state of the // given @builder, and frees the @builder instance. func (x *ContentFormatsBuilder) FreeToFormats() *ContentFormats { cret := xContentFormatsBuilderFreeToFormats(x.GoPointer()) return cret } var xContentFormatsBuilderRef func(uintptr) *ContentFormatsBuilder // Acquires a reference on the given @builder. // // This function is intended primarily for bindings. // `GdkContentFormatsBuilder` objects should not be kept around. func (x *ContentFormatsBuilder) Ref() *ContentFormatsBuilder { cret := xContentFormatsBuilderRef(x.GoPointer()) return cret } var xContentFormatsBuilderToFormats func(uintptr) *ContentFormats // Creates a new `GdkContentFormats` from the given @builder. // // The given `GdkContentFormatsBuilder` is reset once this function returns; // you cannot call this function multiple times on the same @builder instance. // // This function is intended primarily for bindings. C code should use // [method@Gdk.ContentFormatsBuilder.free_to_formats]. func (x *ContentFormatsBuilder) ToFormats() *ContentFormats { cret := xContentFormatsBuilderToFormats(x.GoPointer()) return cret } var xContentFormatsBuilderUnref func(uintptr) // Releases a reference on the given @builder. func (x *ContentFormatsBuilder) Unref() { xContentFormatsBuilderUnref(x.GoPointer()) } // An opaque type representing a list of files. type FileList struct { _ structs.HostLayout } var xFileListGLibType func() types.GType func FileListGLibType() types.GType { return xFileListGLibType() } func (x *FileList) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xNewFileListFromArray func(uintptr, uint) *FileList // Creates a new `GdkFileList` for the given array of files. // // This function is meant to be used by language bindings. func NewFileListFromArray(FilesVar uintptr, NFilesVar uint) *FileList { cret := xNewFileListFromArray(FilesVar, NFilesVar) return cret } var xNewFileListFromList func(*glib.SList) *FileList // Creates a new files list container from a singly linked list of // `GFile` instances. // // This function is meant to be used by language bindings func NewFileListFromList(FilesVar *glib.SList) *FileList { cret := xNewFileListFromList(FilesVar) return cret } var xFileListGetFiles func(uintptr) *glib.SList // Retrieves the list of files inside a `GdkFileList`. // // This function is meant for language bindings. func (x *FileList) GetFiles() *glib.SList { cret := xFileListGetFiles(x.GoPointer()) return cret } var xContentFormatsParse func(string) *ContentFormats // Parses the given @string into `GdkContentFormats` and // returns the formats. // // Strings printed via [method@Gdk.ContentFormats.to_string] // can be read in again successfully using this function. // // If @string does not describe valid content formats, %NULL // is returned. func ContentFormatsParse(StringVar string) *ContentFormats { cret := xContentFormatsParse(StringVar) return cret } var xInternMimeType func(string) string // Canonicalizes the given mime type and interns the result. // // If @string is not a valid mime type, %NULL is returned instead. // See RFC 2048 for the syntax if mime types. func InternMimeType(StringVar string) string { cret := xInternMimeType(StringVar) return cret } func init() { core.SetPackageName("GDK", "gtk4") core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GDK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xContentFormatsParse, libs, "gdk_content_formats_parse") core.PuregoSafeRegister(&xInternMimeType, libs, "gdk_intern_mime_type") core.PuregoSafeRegister(&xContentFormatsBuilderGLibType, libs, "gdk_content_formats_builder_get_type") core.PuregoSafeRegister(&xNewContentFormatsBuilder, libs, "gdk_content_formats_builder_new") core.PuregoSafeRegister(&xContentFormatsBuilderAddFormats, libs, "gdk_content_formats_builder_add_formats") core.PuregoSafeRegister(&xContentFormatsBuilderAddGtype, libs, "gdk_content_formats_builder_add_gtype") core.PuregoSafeRegister(&xContentFormatsBuilderAddMimeType, libs, "gdk_content_formats_builder_add_mime_type") core.PuregoSafeRegister(&xContentFormatsBuilderFreeToFormats, libs, "gdk_content_formats_builder_free_to_formats") core.PuregoSafeRegister(&xContentFormatsBuilderRef, libs, "gdk_content_formats_builder_ref") core.PuregoSafeRegister(&xContentFormatsBuilderToFormats, libs, "gdk_content_formats_builder_to_formats") core.PuregoSafeRegister(&xContentFormatsBuilderUnref, libs, "gdk_content_formats_builder_unref") core.PuregoSafeRegister(&xFileListGLibType, libs, "gdk_file_list_get_type") core.PuregoSafeRegister(&xNewFileListFromArray, libs, "gdk_file_list_new_from_array") core.PuregoSafeRegister(&xNewFileListFromList, libs, "gdk_file_list_new_from_list") core.PuregoSafeRegister(&xFileListGetFiles, libs, "gdk_file_list_get_files") }