docs: Move the GIOModule and GIOExtensionPoint SECTIONs

Move them to the struct docs.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
This commit is contained in:
Philip Withnall 2023-11-14 14:15:17 +00:00
parent fe8785862a
commit 2abbaac589
2 changed files with 26 additions and 43 deletions

View File

@ -77,53 +77,47 @@
#undef __GLIB_H_INSIDE__
/**
* SECTION:giomodule
* @short_description: Loadable GIO Modules
* @include: gio/gio.h
* GIOModule:
*
* 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.
*
**/
*/
/**
* SECTION:extensionpoints
* @short_description: Extension Points
* @include: gio.h
* @see_also: [Extending GIO][extending-gio]
* GIOExtensionPoint:
*
* #GIOExtensionPoint provides a mechanism for modules to extend the
* `GIOExtensionPoint` provides a mechanism for modules to extend the
* functionality of the library or application that loaded it in an
* organized fashion.
* 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 g_io_extension_point_register() to register an
* extension point, and g_io_extension_point_set_required_type() to
* 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 #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.
* 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.
*
* |[<!-- language="C" -->
* GIOExtensionPoint *ep;
* ```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);
* ]|
* // Register an extension point
* ep = g_io_extension_point_register ("my-extension-point");
* g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
* ```
*
* |[<!-- language="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);
* ]|
* ```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.
@ -133,7 +127,7 @@
*
* To avoid opening all modules just to find out what extension
* points they implement, GIO makes use of a caching mechanism,
* see [gio-querymodules][gio-querymodules].
* see [gio-querymodules](gio-querymodules.html).
* You are expected to run this command after installing a
* GIO module.
*
@ -267,12 +261,6 @@ struct _GIOExtension {
gint priority;
};
/**
* GIOExtensionPoint:
*
* #GIOExtensionPoint is an opaque data structure and can only be accessed
* using the following functions.
*/
struct _GIOExtensionPoint {
GType required_type;
char *name;

View File

@ -49,11 +49,6 @@ void g_io_module_scope_block (GIOModuleScope *scope,
#define G_IO_IS_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_IO_TYPE_MODULE))
#define G_IO_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_IO_TYPE_MODULE, GIOModuleClass))
/**
* GIOModule:
*
* Opaque module base class for extending GIO.
**/
typedef struct _GIOModuleClass GIOModuleClass;
GIO_AVAILABLE_IN_ALL