Class IOModule
- All Implemented Interfaces:
Proxy
,TypePlugin
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
IOModule.Builder<B extends IOModule.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.TypeModule
TypeModule.TypeModuleClass, TypeModule.TypeModuleImpl
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gobject.TypePlugin
TypePlugin.TypePluginImpl
-
Constructor Summary
ConstructorDescriptionIOModule
(MemorySegment address) Create a IOModule proxy instance for the provided memory address.Creates a new GIOModule that will load the specific shared library when in use. -
Method Summary
Modifier and TypeMethodDescriptionprotected IOModule
asParent()
Returns this instance as if it were its parent type.static IOModule.Builder
<? extends IOModule.Builder> builder()
AIOModule.Builder
object constructs aIOModule
with the specified properties.static Type
getType()
Get the GType of the IOModule classvoid
Required API for GIO modules to implement.static String[]
query()
Optional API for GIO modules to implement.void
unload()
Required API for GIO modules to implement.Methods inherited from class org.gnome.gobject.TypeModule
addInterface, getMemoryLayout, load, registerEnum, registerFlags, registerType, registerType, setName, unuse, useTypeModule
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gobject.TypePlugin
completeInterfaceInfo, completeTypeInfo, unuse, use
-
Constructor Details
-
IOModule
Create a IOModule proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
IOModule
Creates a new GIOModule that will load the specific shared library when in use.- Parameters:
filename
- filename of the shared library module.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type.- Overrides:
asParent
in classTypeModule
-
query
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
, wheremodulename
is the plugin’s filename with thelib
orlibgio
prefix and everything after the first dot removed, and with-
replaced with_
throughout. For example,libgiognutls-helper.so
becomesgnutls_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.- Returns:
- A
null
-terminated array of strings, listing the supported extension points of the module. The array must be suitable for freeing with g_strfreev().
-
loadModule
public void loadModule()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
, wheremodulename
is the plugin’s filename with thelib
orlibgio
prefix and everything after the first dot removed, and with-
replaced with_
throughout. For example,libgiognutls-helper.so
becomesgnutls_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. -
unload
public void unload()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
, wheremodulename
is the plugin’s filename with thelib
orlibgio
prefix and everything after the first dot removed, and with-
replaced with_
throughout. For example,libgiognutls-helper.so
becomesgnutls_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.- Overrides:
unload
in classTypeModule
-
builder
AIOModule.Builder
object constructs aIOModule
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withIOModule.Builder.build()
.
-