Cairo-Dock  3.4.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cairo-dock-module-manager.h File Reference

Data Structures

struct  _GldiVisitCard
 Definition of the visit card of a module. Contains everything that is statically defined for a module. More...
 
struct  _GldiModuleInterface
 Definition of the interface of a module. More...
 
struct  _GldiModule
 Definition of an external module. More...
 

Macros

#define GLDI_OBJECT_IS_MODULE(obj)
 

Typedefs

typedef gboolean(* GldiModulePreInit )(GldiVisitCard *pVisitCard, GldiModuleInterface *pInterface)
 Pre-init function of a module. Fills the visit card and the interface of a module.
 

Enumerations

enum  GldiModuleCategory
 Categories a module can be in.
 

Functions

GldiModulegldi_module_new (GldiVisitCard *pVisitCard, GldiModuleInterface *pInterface)
 
GldiModulegldi_module_new_from_so_file (const gchar *cSoFilePath)
 
void gldi_modules_new_from_directory (const gchar *cModuleDirPath, GError **erreur)
 
gchar * gldi_module_get_config_dir (GldiModule *pModule)
 
GldiModulegldi_module_get (const gchar *cModuleName)
 
void gldi_module_activate (GldiModule *module)
 
void gldi_module_deactivate (GldiModule *module)
 
void gldi_module_add_instance (GldiModule *pModule)
 should maybe be in the module-instance too...
 

Detailed Description

This class manages the external modules of Cairo-Dock.

A module has an interface and a visit card :

  • the visit card allows it to define itself (name, category, default icon, etc)
  • the interface defines the entry points for init, stop, reload, read config, and reset data.

Modules can be instanciated several times; each time they are, an instance _GldiModuleInstance is created. Each instance holds a set of data: the icon and its container, the config structure and its conf file, the data structure and a slot to plug datas into containers and icons. All these data are optionnal; a module that has an icon is also called an applet.

Macro Definition Documentation

#define GLDI_OBJECT_IS_MODULE (   obj)

Say if an object is a Module.

Parameters
objthe object.
Returns
TRUE if the object is a Module.

Function Documentation

GldiModule* gldi_module_new ( GldiVisitCard pVisitCard,
GldiModuleInterface pInterface 
)

Create a new module. The module takes ownership of the 2 arguments, unless an error occured.

Parameters
pVisitCardthe visit card of the module
pInterfacethe interface of the module
Returns
the new module, or NULL if the visit card is invalid.
GldiModule* gldi_module_new_from_so_file ( const gchar *  cSoFilePath)

Create a new module from a .so file.

Parameters
cSoFilePathpath to the .so file
Returns
the new module, or NULL if an error occured.
void gldi_modules_new_from_directory ( const gchar *  cModuleDirPath,
GError **  erreur 
)

Create new modules from all the .so files contained in the given folder.

Parameters
cModuleDirPathpath to the folder
erreuran error
Returns
the new module, or NULL if an error occured.
gchar* gldi_module_get_config_dir ( GldiModule pModule)

Get the path to the folder containing the config files of a module (one file per instance). The folder is created if needed. If the module is not configurable, or if the folder couldn't be created, NULL is returned.

Parameters
pModulethe module
Returns
the path to the folder (free it after use).
GldiModule* gldi_module_get ( const gchar *  cModuleName)

Get the module which has a given name.

Parameters
cModuleNamethe unique name of the module.
Returns
the module, or NULL if not found.
void gldi_module_activate ( GldiModule module)

Create and initialize all the instances of a module.

Parameters
modulethe module to activate.
void gldi_module_deactivate ( GldiModule module)

Stop and destroy all the instances of a module.

Parameters
modulethe module to deactivate