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

Functions

void cairo_dock_update_conf_file (const gchar *cConfFilePath, GType iFirstDataType,...)
 
void cairo_dock_write_keys_to_conf_file (GKeyFile *pKeyFile, const gchar *cConfFilePath)
 
gboolean cairo_dock_export_current_theme (const gchar *cNewThemeName, gboolean bSaveBehavior, gboolean bSaveLaunchers)
 
gboolean cairo_dock_package_current_theme (const gchar *cThemeName, const gchar *cDirPath)
 
gchar * cairo_dock_depackage_theme (const gchar *cPackagePath)
 
gboolean cairo_dock_delete_themes (gchar **cThemesList)
 
gboolean cairo_dock_import_theme (const gchar *cThemeName, gboolean bLoadBehavior, gboolean bLoadLaunchers)
 
GldiTaskcairo_dock_import_theme_async (const gchar *cThemeName, gboolean bLoadBehavior, gboolean bLoadLaunchers, GFunc pCallback, gpointer data)
 
void cairo_dock_set_paths (gchar *cRootDataDirPath, gchar *cExtraDirPath, gchar *cThemesDirPath, gchar *cCurrentThemeDirPath, gchar *cLocalThemeDirPath, gchar *cDistantThemeDirName, gchar *cThemeServerAdress)
 

Detailed Description

This class defines the structure of the global theme (launchers, icons, plug-ins, configuration files, etc). It also provides methods to manage the themes, like exporting the current theme, importing new themes, deleting themes, etc.

Function Documentation

void cairo_dock_update_conf_file ( const gchar *  cConfFilePath,
GType  iFirstDataType,
  ... 
)

Update a conf file with a list of values of the form : {type, name of the groupe, name of the key, value}. Must end with G_TYPE_INVALID.

Parameters
cConfFilePathpath to the conf file.
iFirstDataTypetype of the first value.
void cairo_dock_write_keys_to_conf_file ( GKeyFile *  pKeyFile,
const gchar *  cConfFilePath 
)

Write a key file on the disk.

Parameters
pKeyFilethe key-file
cConfFilePathits path on the disk
gboolean cairo_dock_export_current_theme ( const gchar *  cNewThemeName,
gboolean  bSaveBehavior,
gboolean  bSaveLaunchers 
)

Export the current theme to a given name. Exported themes can be imported directly from the Theme Manager.

Parameters
cNewThemeNamename to export the theme to.
bSaveBehaviorwhether to save the behavior parameters too.
bSaveLauncherswhether to save the launchers too.
Returns
TRUE if the theme could be exported succefuly.
gboolean cairo_dock_package_current_theme ( const gchar *  cThemeName,
const gchar *  cDirPath 
)

Create a package of the current theme. Packages can be distributed easily, and imported into the dock by a mere drag and drop into the Theme Manager. The package is placed in the cDirPath directory (or $HOME if cDirPath is wrong).

Parameters
cThemeNamename of the package.
cDirPathpath to the directory
Returns
TRUE if the theme could be packaged succefuly.
gchar* cairo_dock_depackage_theme ( const gchar *  cPackagePath)

Extract a package into the themes folder. Does not load it.

Parameters
cPackagePathpath of a package. If the package is distant, it is first downoladed.
Returns
the path of the theme folder, or NULL if anerror occured.
gboolean cairo_dock_delete_themes ( gchar **  cThemesList)

Remove some exported themes from the hard-disk.

Parameters
cThemesLista list of theme names, NULL-terminated.
Returns
TRUE if the themes has been succefuly deleted.
gboolean cairo_dock_import_theme ( const gchar *  cThemeName,
gboolean  bLoadBehavior,
gboolean  bLoadLaunchers 
)

Import a theme, which can be : a local theme, a user theme, a distant theme, or even the path to a packaged theme.

Parameters
cThemeNamename of the theme to import.
bLoadBehaviorwhether to import the behavior parameters too.
bLoadLauncherswhether to import the launchers too.
Returns
TRUE if the theme could be imported succefuly.
GldiTask* cairo_dock_import_theme_async ( const gchar *  cThemeName,
gboolean  bLoadBehavior,
gboolean  bLoadLaunchers,
GFunc  pCallback,
gpointer  data 
)

Asynchronously import a theme, which can be : a local theme, a user theme, a distant theme, or even the path to a packaged theme. This function is non-blocking, you'll get a CairoTask that you can discard at any time, and you'll get the result of the import as the first argument of the callback (the second being the data you passed to this function). Note that only downloading or unpacking the theme is done asynchronously, actually copying the files in the current theme folder is not (because it couldn't be cancelled without first making a backup).

Parameters
cThemeNamename of the theme to import.
bLoadBehaviorwhether to import the behavior parameters too.
bLoadLauncherswhether to import the launchers too.
pCallbackfunction called when the download is finished. It takes the result of the import (TRUE for a successful import) and the data you've set here.
datadata to be passed to the callback.
Returns
the Task that is doing the job. Keep it and use cairo_dock_discard_task if you want to discard the download before it's completed (for instance if the user cancels it), or cairo_dock_free_task inside your callback.
void cairo_dock_set_paths ( gchar *  cRootDataDirPath,
gchar *  cExtraDirPath,
gchar *  cThemesDirPath,
gchar *  cCurrentThemeDirPath,
gchar *  cLocalThemeDirPath,
gchar *  cDistantThemeDirName,
gchar *  cThemeServerAdress 
)

Define the paths of themes. Do it just after 'gldi_init'.

Parameters
cRootDataDirPathpath to the root folder of libgldi
cExtraDirPathpath to the extras themes (plug-in themes)
cThemesDirPathpath to the user themes
cCurrentThemeDirPathpath to the current theme
cLocalThemeDirPathpath to the installed themes (default themes)
cDistantThemeDirNamefolder of the themes on the server
cThemeServerAdressadress of the themes server