// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gio 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" "github.com/bnema/puregotk/v4/gobject/types" ) type IOModuleClass struct { _ structs.HostLayout } func (x *IOModuleClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Represents a scope for loading IO modules. A scope can be used for blocking // duplicate modules, or blocking a module you don't want to load. // // The scope can be used with g_io_modules_load_all_in_directory_with_scope() // or g_io_modules_scan_all_in_directory_with_scope(). type IOModuleScope struct { _ structs.HostLayout } func (x *IOModuleScope) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xIOModuleScopeBlock func(uintptr, string) // Block modules with the given @basename from being loaded when // this scope is used with g_io_modules_scan_all_in_directory_with_scope() // or g_io_modules_load_all_in_directory_with_scope(). func (x *IOModuleScope) Block(BasenameVar string) { xIOModuleScopeBlock(x.GoPointer(), BasenameVar) } var xIOModuleScopeFree func(uintptr) // Free a module scope. func (x *IOModuleScope) Free() { xIOModuleScopeFree(x.GoPointer()) } var xIoExtensionPointImplement func(string, types.GType, string, int) *IOExtension // Registers @type as extension for the extension point with name // @extension_point_name. // // If @type has already been registered as an extension for this // extension point, the existing #GIOExtension object is returned. func IoExtensionPointImplement(ExtensionPointNameVar string, TypeVar types.GType, ExtensionNameVar string, PriorityVar int) *IOExtension { cret := xIoExtensionPointImplement(ExtensionPointNameVar, TypeVar, ExtensionNameVar, PriorityVar) return cret } var xIoExtensionPointLookup func(string) *IOExtensionPoint // Looks up an existing extension point. func IoExtensionPointLookup(NameVar string) *IOExtensionPoint { cret := xIoExtensionPointLookup(NameVar) return cret } var xIoExtensionPointRegister func(string) *IOExtensionPoint // Registers an extension point. func IoExtensionPointRegister(NameVar string) *IOExtensionPoint { cret := xIoExtensionPointRegister(NameVar) return cret } var xIoModulesLoadAllInDirectory func(string) *glib.List // Loads all the modules in the specified directory. // // If don't require all modules to be initialized (and thus registering // all gtypes) then you can use g_io_modules_scan_all_in_directory() // which allows delayed/lazy loading of modules. func IoModulesLoadAllInDirectory(DirnameVar string) *glib.List { cret := xIoModulesLoadAllInDirectory(DirnameVar) return cret } var xIoModulesLoadAllInDirectoryWithScope func(string, *IOModuleScope) *glib.List // Loads all the modules in the specified directory. // // If don't require all modules to be initialized (and thus registering // all gtypes) then you can use g_io_modules_scan_all_in_directory() // which allows delayed/lazy loading of modules. func IoModulesLoadAllInDirectoryWithScope(DirnameVar string, ScopeVar *IOModuleScope) *glib.List { cret := xIoModulesLoadAllInDirectoryWithScope(DirnameVar, ScopeVar) return cret } var xIoModulesScanAllInDirectory func(string) // Scans all the modules in the specified directory, ensuring that // any extension point implemented by a module is registered. // // This may not actually load and initialize all the types in each // module, some modules may be lazily loaded and initialized when // an extension point it implements is used with e.g. // g_io_extension_point_get_extensions() or // g_io_extension_point_get_extension_by_name(). // // If you need to guarantee that all types are loaded in all the modules, // use g_io_modules_load_all_in_directory(). func IoModulesScanAllInDirectory(DirnameVar string) { xIoModulesScanAllInDirectory(DirnameVar) } var xIoModulesScanAllInDirectoryWithScope func(string, *IOModuleScope) // Scans all the modules in the specified directory, ensuring that // any extension point implemented by a module is registered. // // This may not actually load and initialize all the types in each // module, some modules may be lazily loaded and initialized when // an extension point it implements is used with e.g. // g_io_extension_point_get_extensions() or // g_io_extension_point_get_extension_by_name(). // // If you need to guarantee that all types are loaded in all the modules, // use g_io_modules_load_all_in_directory(). func IoModulesScanAllInDirectoryWithScope(DirnameVar string, ScopeVar *IOModuleScope) { xIoModulesScanAllInDirectoryWithScope(DirnameVar, ScopeVar) } // Provides an interface and default functions for loading and unloading // modules. This is used internally to make GIO extensible, but can also // be used by others to implement module loading. type IOModule struct { gobject.TypeModule } var xIOModuleGLibType func() types.GType func IOModuleGLibType() types.GType { return xIOModuleGLibType() } func IOModuleNewFromInternalPtr(ptr uintptr) *IOModule { cls := &IOModule{} cls.Ptr = ptr return cls } var xNewIOModule func(string) uintptr // Creates a new GIOModule that will load the specific // shared library when in use. func NewIOModule(FilenameVar string) *IOModule { var cls *IOModule cret := xNewIOModule(FilenameVar) if cret == 0 { return nil } cls = &IOModule{} cls.Ptr = cret return cls } var xIOModuleLoad func(uintptr) // Required API for GIO modules to implement. // // This function is run after the module has been loaded into GIO, // to initialize the module. Typically, this function will call // g_io_extension_point_implement(). // // Since 2.56, this function should be named `g_io_<modulename>_load`, where // `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and // everything after the first dot removed, and with `-` replaced with `_` // throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`. // Using the new symbol names avoids name clashes when building modules // statically. The old symbol names continue to be supported, but cannot be used // for static builds. func (x *IOModule) Load() { xIOModuleLoad(x.GoPointer()) } var xIOModuleUnload func(uintptr) // Required API for GIO modules to implement. // // This function is run when the module is being unloaded from GIO, // to finalize the module. // // Since 2.56, this function should be named `g_io_<modulename>_unload`, where // `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and // everything after the first dot removed, and with `-` replaced with `_` // throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`. // Using the new symbol names avoids name clashes when building modules // statically. The old symbol names continue to be supported, but cannot be used // for static builds. func (x *IOModule) Unload() { xIOModuleUnload(x.GoPointer()) } func (c *IOModule) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *IOModule) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // Calls the @complete_interface_info function from the // #GTypePluginClass of @plugin. There should be no need to use this // function outside of the GObject type system itself. func (x *IOModule) CompleteInterfaceInfo(InstanceTypeVar types.GType, InterfaceTypeVar types.GType, InfoVar *gobject.InterfaceInfo) { gobject.XGTypePluginCompleteInterfaceInfo(x.GoPointer(), InstanceTypeVar, InterfaceTypeVar, InfoVar) } // Calls the @complete_type_info function from the #GTypePluginClass of @plugin. // There should be no need to use this function outside of the GObject // type system itself. func (x *IOModule) CompleteTypeInfo(GTypeVar types.GType, InfoVar *gobject.TypeInfo, ValueTableVar *gobject.TypeValueTable) { gobject.XGTypePluginCompleteTypeInfo(x.GoPointer(), GTypeVar, InfoVar, ValueTableVar) } // Calls the @unuse_plugin function from the #GTypePluginClass of // @plugin. There should be no need to use this function outside of // the GObject type system itself. func (x *IOModule) Unuse() { gobject.XGTypePluginUnuse(x.GoPointer()) } // Calls the @use_plugin function from the #GTypePluginClass of // @plugin. There should be no need to use this function outside of // the GObject type system itself. func (x *IOModule) Use() { gobject.XGTypePluginUse(x.GoPointer()) } var xIOModuleQuery func() []string // Optional API for GIO modules to implement. // // Should return a list of all the extension points that may be // implemented in this module. // // This method will not be called in normal use, however it may be // called when probing existing modules and recording which extension // points that this model is used for. This means we won't have to // load and initialize this module unless its needed. // // If this function is not implemented by the module the module will // always be loaded, initialized and then unloaded on application // startup so that it can register its extension points during init. // // Note that a module need not actually implement all the extension // points that g_io_module_query() returns, since the exact list of // extension may depend on runtime issues. However all extension // points actually implemented must be returned by g_io_module_query() // (if defined). // // When installing a module that implements g_io_module_query() you must // run gio-querymodules in order to build the cache files required for // lazy loading. // // Since 2.56, this function should be named `g_io_<modulename>_query`, where // `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and // everything after the first dot removed, and with `-` replaced with `_` // throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`. // Using the new symbol names avoids name clashes when building modules // statically. The old symbol names continue to be supported, but cannot be used // for static builds. func IOModuleQuery() []string { cret := xIOModuleQuery() return cret } func init() { core.SetPackageName("GIO", "gio-2.0") core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GIO") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xIoExtensionPointImplement, libs, "g_io_extension_point_implement") core.PuregoSafeRegister(&xIoExtensionPointLookup, libs, "g_io_extension_point_lookup") core.PuregoSafeRegister(&xIoExtensionPointRegister, libs, "g_io_extension_point_register") core.PuregoSafeRegister(&xIoModulesLoadAllInDirectory, libs, "g_io_modules_load_all_in_directory") core.PuregoSafeRegister(&xIoModulesLoadAllInDirectoryWithScope, libs, "g_io_modules_load_all_in_directory_with_scope") core.PuregoSafeRegister(&xIoModulesScanAllInDirectory, libs, "g_io_modules_scan_all_in_directory") core.PuregoSafeRegister(&xIoModulesScanAllInDirectoryWithScope, libs, "g_io_modules_scan_all_in_directory_with_scope") core.PuregoSafeRegister(&xIOModuleScopeBlock, libs, "g_io_module_scope_block") core.PuregoSafeRegister(&xIOModuleScopeFree, libs, "g_io_module_scope_free") core.PuregoSafeRegister(&xIOModuleGLibType, libs, "g_io_module_get_type") core.PuregoSafeRegister(&xNewIOModule, libs, "g_io_module_new") core.PuregoSafeRegister(&xIOModuleLoad, libs, "g_io_module_load") core.PuregoSafeRegister(&xIOModuleUnload, libs, "g_io_module_unload") core.PuregoSafeRegister(&xIOModuleQuery, libs, "g_io_module_query") }