IOExtensionPoint

GIOExtensionPoint provides a mechanism for modules to extend the functionality of the library or application that loaded it in an organized fashion.

An extension point is identified by a name, and it may optionally require that any implementation must by of a certain type (or derived thereof). Use g_io_extension_point_register() to register an extension point, and g_io_extension_point_set_required_type() to set a required type.

A module can implement an extension point by specifying the GType that implements the functionality. Additionally, each implementation of an extension point has a name, and a priority. Use g_io_extension_point_implement() to implement an extension point.

It is up to the code that registered the extension point how it uses the implementations that have been associated with it. Depending on the use case, it may use all implementations, or only the one with the highest priority, or pick a specific one by name.

To avoid opening all modules just to find out what extension points they implement, GIO makes use of a caching mechanism, see gio-querymodules. You are expected to run this command after installing a GIO module.

The GIO_EXTRA_MODULES environment variable can be used to specify additional directories to automatically load modules from. This environment variable has the same syntax as the PATH. If two modules have the same base name in different directories, then the latter one will be ignored. If additional directories are specified GIO will load modules from the built-in directory last.

Constructors

this
this(GIOExtensionPoint* gIOExtensionPoint)

Sets our main struct and passes it to the parent class

Members

Functions

getExtensionByName
IOExtension getExtensionByName(string name)

Finds a GIOExtension for an extension point by name.

getExtensions
ListG getExtensions()

Gets a list of all extensions that implement this extension point. The list is sorted by priority, beginning with the highest priority.

getIOExtensionPointStruct
GIOExtensionPoint* getIOExtensionPointStruct()

Get the main Gtk struct

getRequiredType
GType getRequiredType()

Gets the required type for extension_point.

getStruct
void* getStruct()

the main Gtk struct as a void*

setRequiredType
void setRequiredType(GType type)

Sets the required type for extension_point to type. All implementations must henceforth have this type.

Static functions

implement
IOExtension implement(string extensionPointName, GType type, string extensionName, int priority)

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.

lookup
IOExtensionPoint lookup(string name)

Looks up an existing extension point.

register
IOExtensionPoint register(string name)

Registers an extension point.

Variables

gIOExtensionPoint
GIOExtensionPoint* gIOExtensionPoint;

the main Gtk struct

Meta