Basics
Guides
API Reference
Basics
Guides
API Reference
[39:7] extends: object
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 be of a certain type (or derived
thereof). Use [func@Gio.IOExtensionPoint.register] to register an extension
point, and [method@Gio.IOExtensionPoint.set_required_type] to set a required
type. A module can implement an extension point by specifying the
[type@GObject.Type] that implements the functionality. Additionally, each
implementation of an extension point has a name, and a priority. Use
[func@Gio.IOExtensionPoint.implement] to implement an extension point. c GIOExtensionPoint *ep; // Register an extension point ep = g_io_extension_point_register ("my-extension-point"); g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE); c // Implement an extension point G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE) g_io_extension_point_implement ("my-extension-point", my_example_impl_get_type (), "my-example", 10); 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.
GIOExtensionPoint (Handle = null)
Creates a new
IOExtensionPointby wrapping a native handle or another wrapper.
Handle is the native handle or another wrapper whose handle to adopt.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.get_extension_by_name (string name)
Finds a #GIOExtension for an extension point by name.
name is the name of the extension to get.the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name.get_extensions ()
Gets a list of all extensions that implement this extension point. The list is sorted by priority, beginning with the highest priority.
a #GList of #GIOExtensions. The list is owned by GIO and should not be modified..get_required_type ()
Gets the required type for @extension_point.
the #GType that all implementations must have, or %G_TYPE_INVALID if the extension point has no required type.set_required_type (int type)
Sets the required type for @extension_point to @type. All implementations must henceforth have this type.
type is the #GType to require.None.extensions ()
Returns
get_extensionsas an Aussom list of wrapper objects. This companion method materializes the full collection up front; useget_extensions()when lazy or change-notify access is required.
An Aussom list of elements.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.