Module

The glib.Module struct is an opaque data structure to represent a [dynamically-loaded module][glib-Dynamic-Loading-of-Modules]. It should only be accessed via the following functions.

Constructors

this
this(GModule* gModule, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

close
bool close()

Closes a module.

getModuleStruct
GModule* getModuleStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

makeResident
void makeResident()

Ensures that a module will never be unloaded. Any future Module.close calls on the module will be ignored.

name
string name()

Returns the filename that the module was opened with.

symbol
bool symbol(string symbolName, void** symbol)

Gets a symbol pointer from a module, such as one exported by G_MODULE_EXPORT Note that a valid symbol can be NULL.

Static functions

buildPath
string buildPath(string directory, string moduleName)

A portable way to build the filename of a module. The platform-specific prefix and suffix are added to the filename, if needed, and the result is added to the directory, using the correct separator character.

error
string error()

Gets a string describing the last module error.

open
Module open(string fileName, GModuleFlags flags)

Opens a module. If the module has already been opened, its reference count is incremented.

supported
bool supported()

Checks if modules are supported on the current platform.

Variables

gModule
GModule* gModule;

the main Gtk struct