libgimpmodule: move docs from templates to inline comments

This commit is contained in:
Michael Natterer 2010-06-29 22:35:34 +02:00
parent 1330ca2ea8
commit fcc0a5a424
7 changed files with 107 additions and 328 deletions

View File

@ -12,6 +12,7 @@
/libgimpmodule-undeclared.txt /libgimpmodule-undeclared.txt
/libgimpmodule-undocumented.txt /libgimpmodule-undocumented.txt
/html /html
/tmpl
/xml /xml
/version /version
/.libs /.libs

View File

@ -1,2 +0,0 @@
/libgimpmodule-unused.sgml
/*.bak

View File

@ -1,217 +0,0 @@
<!-- ##### SECTION Title ##### -->
GimpModule
<!-- ##### SECTION Short_Description ##### -->
A #GTypeModule subclass which implements module loading using #GModule.
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GTypeModule subclass which implements module loading using #GModule.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GModule
</para>
<para>
#GTypeModule
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GimpModule ##### -->
<para>
#GimpModule is a generic mechanism to dynamically load modules into
GIMP. It is a #GTypeModule subclass, implementing module loading
using #GModule. #GimpModule does not know which functionality is
implemented by the modules, it just provides a framework to get
arbitrary #GType implementations loaded from disk.
</para>
@filename:
@verbose:
@state:
@on_disk:
@load_inhibit:
@info:
@last_module_error:
<!-- ##### SIGNAL GimpModule::modified ##### -->
<para>
</para>
@gimpmodule: the object which received the signal.
<!-- ##### STRUCT GimpModuleInfo ##### -->
<para>
This structure contains information about a loadable module.
</para>
@abi_version: The #GIMP_MODULE_ABI_VERSION the module was compiled against.
@purpose: The module's general purpose.
@author: The module's author.
@version: The module's version.
@copyright: The module's copyright.
@date: The module's release date.
<!-- ##### ENUM GimpModuleState ##### -->
<para>
The possible states a #GimpModule can be in.
</para>
@GIMP_MODULE_STATE_ERROR: Missing gimp_module_register() function
or other error.
@GIMP_MODULE_STATE_LOADED: An instance of a type implemented by
this module is allocated.
@GIMP_MODULE_STATE_LOAD_FAILED: gimp_module_register() returned #FALSE.
@GIMP_MODULE_STATE_NOT_LOADED: There are no instances allocated of
types implemented by this module.
<!-- ##### USER_FUNCTION GimpModuleQueryFunc ##### -->
<para>
The signature of the query function a loadable GIMP module must
implement. In the module, the function must be called
gimp_module_query().
</para>
<para>
#GimpModule will copy the returned #GimpModuleInfo struct, so the
module doesn't need to keep these values around (however in most cases
the module will just return a pointer to a constant structure).
</para>
@module: The #GimpModule responsible for this loadable module.
@Returns: The #GimpModuleInfo struct describing the module.
<!-- ##### USER_FUNCTION GimpModuleRegisterFunc ##### -->
<para>
The signature of the register function a loadable GIMP module must
implement. In the module, the function must be called
gimp_module_register().
</para>
<para>
When this function is called, the module should register all the types
it implements with the passed @module.
</para>
@module: The #GimpModule responsible for this loadable module.
@Returns: #TRUE on success, #FALSE otherwise.
<!-- ##### MACRO GIMP_MODULE_ABI_VERSION ##### -->
<para>
The version of the module system's ABI. Modules put this value into
#GimpModuleInfo's @abi_version field so the code loading the modules
can check if it was compiled against the same module ABI the modules
are compiled against.
</para>
<!-- ##### MACRO GIMP_MODULE_PARAM_SERIALIZE ##### -->
<para>
</para>
<!-- ##### FUNCTION gimp_module_new ##### -->
<para>
</para>
@filename:
@load_inhibit:
@verbose:
@Returns:
<!-- ##### FUNCTION gimp_module_modified ##### -->
<para>
</para>
@module:
<!-- ##### FUNCTION gimp_module_query_module ##### -->
<para>
</para>
@module:
@Returns:
<!-- ##### FUNCTION gimp_module_set_load_inhibit ##### -->
<para>
</para>
@module:
@load_inhibit:
<!-- ##### FUNCTION gimp_module_state_name ##### -->
<para>
</para>
@state:
@Returns:
<!-- ##### FUNCTION gimp_module_register_enum ##### -->
<para>
</para>
@module:
@name:
@const_static_values:
@Returns:
<!-- ##### FUNCTION gimp_module_info_new ##### -->
<para>
</para>
@abi_version:
@purpose:
@author:
@version:
@copyright:
@date:
@Returns:
<!-- ##### FUNCTION gimp_module_info_copy ##### -->
<para>
</para>
@info:
@Returns:
<!-- ##### FUNCTION gimp_module_info_free ##### -->
<para>
</para>
@info:
<!-- ##### FUNCTION gimp_module_error_quark ##### -->
<para>
</para>
@Returns:

View File

@ -1,94 +0,0 @@
<!-- ##### SECTION Title ##### -->
GimpModuleDB
<!-- ##### SECTION Short_Description ##### -->
Keeps a list of #GimpModule's found in a given searchpath.
<!-- ##### SECTION Long_Description ##### -->
<para>
Keeps a list of #GimpModule's found in a given searchpath.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GimpModuleDB ##### -->
<para>
The #GimpModuleDB struct contains no public members.
</para>
<!-- ##### SIGNAL GimpModuleDB::add ##### -->
<para>
</para>
@gimpmoduledb: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GimpModuleDB::module-modified ##### -->
<para>
</para>
@gimpmoduledb: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GimpModuleDB::remove ##### -->
<para>
</para>
@gimpmoduledb: the object which received the signal.
@arg1:
<!-- ##### FUNCTION gimp_module_db_new ##### -->
<para>
</para>
@verbose:
@Returns:
<!-- ##### FUNCTION gimp_module_db_set_load_inhibit ##### -->
<para>
</para>
@db:
@load_inhibit:
<!-- ##### FUNCTION gimp_module_db_get_load_inhibit ##### -->
<para>
</para>
@db:
@Returns:
<!-- ##### FUNCTION gimp_module_db_load ##### -->
<para>
</para>
@db:
@module_path:
<!-- ##### FUNCTION gimp_module_db_refresh ##### -->
<para>
</para>
@db:
@module_path:

View File

@ -33,6 +33,17 @@
#include "libgimp/libgimp-intl.h" #include "libgimp/libgimp-intl.h"
/**
* SECTION: gimpmodule
* @title: GimpModule
* @short_description: A #GTypeModule subclass which implements module
* loading using #GModule.
* @see_also: #GModule, #GTypeModule
*
* A #GTypeModule subclass which implements module loading using #GModule.
**/
enum enum
{ {
MODIFIED, MODIFIED,

View File

@ -31,28 +31,43 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/* increment the ABI version each time one of the following changes: /**
* GIMP_MODULE_ABI_VERSION:
*
* The version of the module system's ABI. Modules put this value into
* #GimpModuleInfo's @abi_version field so the code loading the modules
* can check if it was compiled against the same module ABI the modules
* are compiled against.
*
* GIMP_MODULE_ABI_VERSION is incremented each time one of the
* following changes:
* *
* - the libgimpmodule implementation (if the change affects modules). * - the libgimpmodule implementation (if the change affects modules).
* - one of the classes implemented by modules (currently GimpColorDisplay, *
* GimpColorSelector and GimpController). * - one of the classes implemented by modules (currently #GimpColorDisplay,
*/ * #GimpColorSelector and #GimpController).
**/
#define GIMP_MODULE_ABI_VERSION 0x0004 #define GIMP_MODULE_ABI_VERSION 0x0004
/**
* GimpModuleState:
* @GIMP_MODULE_STATE_ERROR: Missing gimp_module_register() function
* or other error.
* @GIMP_MODULE_STATE_LOADED: An instance of a type implemented by
* this module is allocated.
* @GIMP_MODULE_STATE_LOAD_FAILED: gimp_module_register() returned %FALSE.
* @GIMP_MODULE_STATE_NOT_LOADED: There are no instances allocated of
* types implemented by this module.
*
* The possible states a #GimpModule can be in.
**/
typedef enum typedef enum
{ {
GIMP_MODULE_STATE_ERROR, /* missing gimp_module_register function GIMP_MODULE_STATE_ERROR,
* or other error GIMP_MODULE_STATE_LOADED,
*/ GIMP_MODULE_STATE_LOAD_FAILED,
GIMP_MODULE_STATE_LOADED, /* an instance of a type implemented by GIMP_MODULE_STATE_NOT_LOADED
* this module is allocated
*/
GIMP_MODULE_STATE_LOAD_FAILED, /* gimp_module_register returned FALSE
*/
GIMP_MODULE_STATE_NOT_LOADED /* there are no instances allocated of
* types implemented by this module
*/
} GimpModuleState; } GimpModuleState;
@ -66,6 +81,17 @@ typedef enum
} GimpModuleError; } GimpModuleError;
/**
* GimpModuleInfo:
* @abi_version: The #GIMP_MODULE_ABI_VERSION the module was compiled against.
* @purpose: The module's general purpose.
* @author: The module's author.
* @version: The module's version.
* @copyright: The module's copyright.
* @date: The module's release date.
*
* This structure contains information about a loadable module.
**/
struct _GimpModuleInfo struct _GimpModuleInfo
{ {
guint32 abi_version; guint32 abi_version;
@ -77,9 +103,37 @@ struct _GimpModuleInfo
}; };
/**
* GimpModuleQueryFunc:
* @module: The #GimpModule responsible for this loadable module.
* @Returns: The #GimpModuleInfo struct describing the module.
*
* The signature of the query function a loadable GIMP module must
* implement. In the module, the function must be called
* gimp_module_query().
*
* #GimpModule will copy the returned #GimpModuleInfo struct, so the
* module doesn't need to keep these values around (however in most
* cases the module will just return a pointer to a constant
* structure).
**/
typedef const GimpModuleInfo * (* GimpModuleQueryFunc) (GTypeModule *module); typedef const GimpModuleInfo * (* GimpModuleQueryFunc) (GTypeModule *module);
/**
* GimpModuleRegisterFunc:
* @module: The #GimpModule responsible for this loadable module.
* @Returns: %TRUE on success, %FALSE otherwise.
*
* The signature of the register function a loadable GIMP module must
* implement. In the module, the function must be called
* gimp_module_register().
*
* When this function is called, the module should register all the types
* it implements with the passed @module.
**/
typedef gboolean (* GimpModuleRegisterFunc) (GTypeModule *module); typedef gboolean (* GimpModuleRegisterFunc) (GTypeModule *module);
/* GimpModules have to implement these */ /* GimpModules have to implement these */
G_MODULE_EXPORT const GimpModuleInfo * gimp_module_query (GTypeModule *module); G_MODULE_EXPORT const GimpModuleInfo * gimp_module_query (GTypeModule *module);
G_MODULE_EXPORT gboolean gimp_module_register (GTypeModule *module); G_MODULE_EXPORT gboolean gimp_module_register (GTypeModule *module);
@ -95,6 +149,22 @@ G_MODULE_EXPORT gboolean gimp_module_register (GTypeModule *module
typedef struct _GimpModuleClass GimpModuleClass; typedef struct _GimpModuleClass GimpModuleClass;
/**
* GimpModule:
* @filename:
* @verbose:
* @state:
* @on_disk:
* @load_inhibit:
* @info:
* @last_module_error:
*
* #GimpModule is a generic mechanism to dynamically load modules into
* GIMP. It is a #GTypeModule subclass, implementing module loading
* using #GModule. #GimpModule does not know which functionality is
* implemented by the modules, it just provides a framework to get
* arbitrary #GType implementations loaded from disk.
**/
struct _GimpModule struct _GimpModule
{ {
GTypeModule parent_instance; GTypeModule parent_instance;

View File

@ -30,6 +30,16 @@
#include "gimpmoduledb.h" #include "gimpmoduledb.h"
/**
* SECTION: gimpmoduledb
* @title: GimpModuleDB
* @short_description: Keeps a list of #GimpModule's found in a given
* searchpath.
*
* Keeps a list of #GimpModule's found in a given searchpath.
**/
enum enum
{ {
ADD, ADD,