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...




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


enum  GldiModuleCategory
 Categories a module can be in.


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.

objthe object.
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.

pVisitCardthe visit card of the module
pInterfacethe interface of the module
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.

cSoFilePathpath to the .so file
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.

cModuleDirPathpath to the folder
erreuran error
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.

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

Get the module which has a given name.

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

Create and initialize all the instances of a module.

modulethe module to activate.
void gldi_module_deactivate ( GldiModule module)

Stop and destroy all the instances of a module.

modulethe module to deactivate