Cairo-Dock 2.4.0~1
cairo-dock-gui-manager.h File Reference

Data Structures

struct  _CairoDockGuiBackend
 Definition of the GUI interface for modules. More...

Defines

#define cairo_dock_reload_current_module_widget(pModuleInstance)
#define cairo_dock_build_generic_gui(cConfFilePath, cGettextDomain, cTitle, iWidth, iHeight, pAction, pUserData, pFreeUserData)

Typedefs

typedef gboolean(* CairoDockApplyConfigFunc )(gpointer data)
 Definition of the callback called when the user apply the config panel.

Functions

CairoDockGroupKeyWidgetcairo_dock_get_group_key_widget_from_name (CairoDockModuleInstance *pModuleInstance, const gchar *cGroupName, const gchar *cKeyName)
GtkWidget * cairo_dock_get_widget_from_name (CairoDockModuleInstance *pModuleInstance, const gchar *cGroupName, const gchar *cKeyName)
void cairo_dock_set_status_message (GtkWidget *pWindow, const gchar *cMessage)
void cairo_dock_set_status_message_printf (GtkWidget *pWindow, const gchar *cFormat,...) G_GNUC_PRINTF(2
void GtkWidget * cairo_dock_build_generic_gui_window (const gchar *cTitle, int iWidth, int iHeight, CairoDockApplyConfigFunc pAction, gpointer pUserData, GFreeFunc pFreeUserData)
void cairo_dock_reload_generic_gui (GtkWidget *pWindow)

Detailed Description

This class provides useful functions to build config panels from keyfiles.

GUIs are built from a .conf file; .conf files are normal group/key files, but with some special indications in the comments. Each key will be represented by a pre-defined widget, that is defined by the first caracter of its comment. The comment also contains a description of the key, and an optionnal tooltip. See cairo-dock-gui-factory.h for the list of pre-defined widgets and a short explanation on how to use them inside a conf file. The file 'cairo-dock.conf' can be an useful example.

The class defines the interface that a backend to the main GUI of Cairo-Dock should implement. It also provides a useful function to easily build a window from a conf file : cairo_dock_build_generic_gui


Define Documentation

#define cairo_dock_reload_current_module_widget (   pModuleInstance)

Reload the widget of a given module instance if it is currently opened (the current page is displayed). This is useful if the module has modified its conf file and wishes to display the changes.

Parameters:
pInstancean instance of a module.
#define cairo_dock_build_generic_gui (   cConfFilePath,
  cGettextDomain,
  cTitle,
  iWidth,
  iHeight,
  pAction,
  pUserData,
  pFreeUserData 
)

Load a conf file into a generic window, that contains 2 buttons apply and quit, and a statusbar. If no callback is provided, the window is blocking, until the user press one of the button; in this case, TRUE is returned if ok was pressed.

Parameters:
cConfFilePathconf file to load into the window.
cGettextDomaintranslation domain.
cTitletitle to set to the window.
iWidthwidth of the window.
iHeightheight of the window.
pActioncallback to be called when the apply button is pressed, or NULL.
pUserDatadata passed to the previous callback, or NULL.
pFreeUserDatacallback called when the window is destroyed, to free the previous data, or NULL.
Returns:
the new window.

Function Documentation

CairoDockGroupKeyWidget* cairo_dock_get_group_key_widget_from_name ( CairoDockModuleInstance pModuleInstance,
const gchar *  cGroupName,
const gchar *  cKeyName 
)

Retrieve the group-key widget in the current config panel, corresponding to the (group,key) pair in its conf file.

Parameters:
cGroupNamename of the group in the conf file.
cKeyNamename of the key in the conf file.
Returns:
the group-key widget that match the group and key, or NULL if none was found.
GtkWidget* cairo_dock_get_widget_from_name ( CairoDockModuleInstance pModuleInstance,
const gchar *  cGroupName,
const gchar *  cKeyName 
)

A mere wrapper around the previous function, that returns directly the GTK widget corresponding to the (group,key). Note that empty widgets will return NULL, so you can't you can't distinguish between an empty widget and an inexisant widget.

Parameters:
cGroupNamename of the group in the conf file.
cKeyNamename of the key in the conf file.
Returns:
the widget that match the group and key, or NULL if the widget is empty or if none was found.
void cairo_dock_set_status_message ( GtkWidget *  pWindow,
const gchar *  cMessage 
)

Display a message on a given window that has a status-bar. If no window is provided, the current config panel will be used.

Parameters:
pWindowwindow where the message should be displayed, or NULL to target the config panel.
cMessagethe message.
void cairo_dock_set_status_message_printf ( GtkWidget *  pWindow,
const gchar *  cFormat,
  ... 
)

Display a message on a given window that has a status-bar. If no window is provided, the current config panel will be used.

Parameters:
pWindowwindow where the message should be displayed, or NULL to target the config panel.
cFormatthe message, in a printf-like format
...arguments of the format.
void GtkWidget* cairo_dock_build_generic_gui_window ( const gchar *  cTitle,
int  iWidth,
int  iHeight,
CairoDockApplyConfigFunc  pAction,
gpointer  pUserData,
GFreeFunc  pFreeUserData 
)

Build a generic GUI window, that contains 2 buttons apply and quit, and a statusbar.

Parameters:
cTitletitle to set to the window.
iWidthwidth of the window.
iHeightheight of the window.
pActioncallback to be called when the apply button is pressed, or NULL.
pUserDatadata passed to the previous callback, or NULL.
pFreeUserDatacallback called when the window is destroyed, to free the previous data, or NULL.
Returns:
the new window.
void cairo_dock_reload_generic_gui ( GtkWidget *  pWindow)

Reload a generic window built upon a conf file, by parsing again the conf file.

Parameters:
pWindowthe window.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines