libcompizconfig: Changes to 'upstream-unstable'
VERSION | 2
backend/ini.c | 75 +++-
configure.ac | 2
include/ccs.h | 464 +++++++++++++++++---------
metadata/Makefile.am | 10
metadata/ccp.xml | 7
metadata/global.xml | 205 ++++++++++-
plugin/ccp.c | 881 +++++++++++++++++++++------------------------------
src/bindings.c | 224 +++++++++---
src/compiz.c | 473 +++++----------------------
src/ini.c | 360 ++++++++++++--------
src/lists.c | 68 ---
src/main.c | 489 ++++++++++++++++------------
13 files changed, 1702 insertions(+), 1558 deletions(-)
New commits:
commit 61c1a2db056db506ba4926d0e27377e0b30a5e5e
Author: Guillaume Seguin <guillaume@segu.in>
Date: Fri Apr 4 00:17:23 2008 +0200
* Bump version to 0.7.4
diff --git a/VERSION b/VERSION
index a48124b..8eafcce 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-VERSION=0.7.3
+VERSION=0.7.4
commit ecbea0902a1b2424f49b61c515b4d0912e65db51
Author: Dennis Kasprzyk <onestone@opencompositing.org>
Date: Tue Apr 1 21:45:11 2008 +0200
Make sure that symbols are only loaded locally.
diff --git a/src/main.c b/src/main.c
index 18262e8..742a1e8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -549,7 +549,7 @@ openBackend (char *backend)
asprintf (&dlname, "%s/.compizconfig/backends/lib%s.so",
home, backend);
dlerror ();
- dlhand = dlopen (dlname, RTLD_NOW | RTLD_NODELETE | RTLD_GLOBAL);
+ dlhand = dlopen (dlname, RTLD_NOW | RTLD_NODELETE | RTLD_LOCAL);
err = dlerror ();
}
@@ -560,7 +560,7 @@ openBackend (char *backend)
}
asprintf (&dlname, "%s/compizconfig/backends/lib%s.so",
LIBDIR, backend);
- dlhand = dlopen (dlname, RTLD_NOW | RTLD_NODELETE | RTLD_GLOBAL);
+ dlhand = dlopen (dlname, RTLD_NOW | RTLD_NODELETE | RTLD_LOCAL);
err = dlerror ();
}
@@ -2285,7 +2285,7 @@ addBackendInfo (CCSBackendInfoList * bl, char *file)
dlerror ();
- dlhand = dlopen (file, RTLD_LAZY);
+ dlhand = dlopen (file, RTLD_LAZY | RTLD_LOCAL);
err = dlerror ();
if (err || !dlhand)
return;
commit 97df78b25e32ac427f9d3d1c98d4897c864de572
Author: Danny Baumann <dannybaumann@web.de>
Date: Sun Mar 16 13:16:37 2008 +0100
Put focus stealing prevention level to Focus behaviour group.
diff --git a/metadata/global.xml b/metadata/global.xml
index 8d6a61c..870b56f 100644
--- a/metadata/global.xml
+++ b/metadata/global.xml
@@ -141,6 +141,7 @@
</group>
<group>
<short>Focus & Raise Behaviour</short>
+ <option name="focus_prevention_level" type="int"/>
<option name="focus_prevention_match" type="match"/>
</group>
</screen>
commit 9b50e002aa47da25ce110fb5f51d8b8957888561
Author: Danny Baumann <dannybaumann@web.de>
Date: Fri Mar 14 09:45:21 2008 +0100
Fix setting context from option changes (e.g. via dbus).
diff --git a/plugin/ccp.c b/plugin/ccp.c
index de90433..e0f383d 100644
--- a/plugin/ccp.c
+++ b/plugin/ccp.c
@@ -457,7 +457,7 @@ ccpSetContextFromOption (CompObject *object,
int screenNum = 0;
/* we currently only support screen and display opton types */
- if (object->type != COMP_OBJECT_TYPE_SCREEN ||
+ if (object->type != COMP_OBJECT_TYPE_SCREEN &&
object->type != COMP_OBJECT_TYPE_DISPLAY)
return;
@@ -619,7 +619,7 @@ ccpSetOptionForPlugin (CompObject *object,
status = (*core.setOptionForPlugin) (object, plugin, name, value);
WRAP (cc, &core, setOptionForPlugin, ccpSetOptionForPlugin);
- if (status && !cc->applyingSettings)
+ if (status && !cc->applyingSettings && !cc->reloadHandle)
{
CompPlugin *p;
commit 3b0d162ec791713ca262ca05cca7b99109986f8f
Author: Danny Baumann <dannybaumann@web.de>
Date: Mon Mar 10 07:54:39 2008 +0100
Add overlapping output handling option to display settings group.
diff --git a/metadata/global.xml b/metadata/global.xml
index 6c083d1..8d6a61c 100644
--- a/metadata/global.xml
+++ b/metadata/global.xml
@@ -126,6 +126,7 @@
<option name="detect_refresh_rate" type="bool"/>
<option name="refresh_rate" type="int"/>
<option name="detect_outputs" type="bool"/>
+ <option name="overlapping_outputs" type="int"/>
<option name="outputs" type="list"/>
<option name="sync_to_vblank" type="bool"/>
</group>
commit a43386a7c3953be4f7a3b4b20b3412ccc42442d4
Author: Guillaume Seguin <guillaume@segu.in>
Date: Thu Mar 6 22:46:34 2008 +0100
* Bump version to 0.7.3
diff --git a/VERSION b/VERSION
index 70d11ae..a48124b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-VERSION=0.7.2
+VERSION=0.7.3
commit c7354fb9a7115dd3fa7884556c83b20f99940f1c
Author: Guillaume Seguin <guillaume@segu.in>
Date: Thu Mar 6 22:46:33 2008 +0100
* Bump version to 0.7.2
diff --git a/VERSION b/VERSION
index 58d3865..70d11ae 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-VERSION=0.6.99
+VERSION=0.7.2
commit c31723c1ccb0900bd5547376012a670b134547fa
Author: Danny Baumann <dannybaumann@web.de>
Date: Sat Feb 23 16:28:05 2008 +0100
Differentiate between an empty list and a list with one empty item by adding a delimiter also after the last item.
diff --git a/src/ini.c b/src/ini.c
index ad304d6..7cba5e5 100644
--- a/src/ini.c
+++ b/src/ini.c
@@ -312,7 +312,7 @@ ccsIniGetList (IniDictionary *dictionary,
CCSSettingValueList list = NULL;
char *valueString, *valueStart, *valString;
char *token;
- int nItems = 1, i = 0;
+ int nItems = 1, i = 0, len;
valString = getIniString (dictionary, section, entry);
if (!valString)
@@ -327,6 +327,12 @@ ccsIniGetList (IniDictionary *dictionary,
valueString = strdup (valString);
valueStart = valueString;
+ /* remove trailing semicolon that we added to be able to differentiate
+ between an empty list and a list with one empty item */
+ len = strlen (valueString);
+ if (valueString[len - 1] == ';')
+ valueString[len - 1] = 0;
+
token = strchr (valueString, ';');
while (token)
{
@@ -741,8 +747,7 @@ ccsIniSetList (IniDictionary *dictionary,
/* as we filled our buffer, we have less space in it now; so
calculate the amount of space for the next run */
maxLen = STRINGBUFSIZE - strlen (stringBuffer) - 1;
- if (value->next)
- strncat (stringBuffer, ";", maxLen--);
+ strncat (stringBuffer, ";", maxLen--);
if (maxLen <= 0)
break;
commit d0de58f64cb12a91d8e3f9083ceeb1c5c4e9d4ac
Author: Danny Baumann <dannybaumann@web.de>
Date: Fri Feb 22 08:31:24 2008 +0100
Fix import of float values.
diff --git a/src/main.c b/src/main.c
index 4bf7945..18262e8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2562,6 +2562,15 @@ ccsImportFromFile (CCSContext *context,
ccsSetInt (setting, value);
}
break;
+ case TypeFloat:
+ {
+ float value;
+
+ if (ccsIniGetFloat (importFile, plugin->name,
+ keyName, &value))
+ ccsSetFloat (setting, value);
+ }
+ break;
case TypeString:
{
char *value;
commit 7fca10e102483d510db091d01f469a338605211f
Author: Dennis Kasprzyk <onestone@opencompositing.org>
Date: Fri Feb 15 16:14:34 2008 +0100
Parse core dependencies.
diff --git a/src/compiz.c b/src/compiz.c
index f9cfe0e..f89a724 100644
--- a/src/compiz.c
+++ b/src/compiz.c
@@ -1230,7 +1230,8 @@ addCoreSettingsFromXMLNode (CCSContext * context, xmlNode * node, char *file)
plugin->shortDesc = strdup ("General Options");
plugin->longDesc = strdup ("General Compiz Options");
}
-
+
+ initRulesFromRootNode (plugin, node);
D (D_FULL, "Adding core settings (%s)\n", plugin->shortDesc);
context->plugins = ccsPluginListAppend (context->plugins, plugin);
}
commit 2ee6038be8b2436d5fa6979bbe03e5367718da2a
Author: Dennis Kasprzyk <onestone@opencompositing.org>
Date: Fri Feb 15 16:05:30 2008 +0100
Don't add the same conflict multiple times to the list.
diff --git a/src/main.c b/src/main.c
index 1dfaa68..4bf7945 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2223,9 +2223,11 @@ ccsCanDisablePlugin (CCSContext * context, CCSPlugin * plugin)
}
pluginList = pluginList->next;
}
- if (conflict)
- list = ccsPluginConflictListAppend (list, conflict);
+
}
+ if (conflict)
+ list = ccsPluginConflictListAppend (list, conflict);
+ conflict = NULL;
sl = sl->next;
}
commit 08f8ebca29f655e04d9f42b0f124cae40b95fb30
Author: Dennis Kasprzyk <onestone@opencompositing.org>
Date: Fri Feb 15 15:58:10 2008 +0100
Fix feature conflict handling.
diff --git a/src/main.c b/src/main.c
index e41d56d..1dfaa68 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2201,7 +2201,7 @@ ccsCanDisablePlugin (CCSContext * context, CCSPlugin * plugin)
if (!ccsPluginIsActive (context, pl->data->name))
continue;
- pluginList = pl->data->requiresPlugin;
+ pluginList = pl->data->requiresFeature;
while (pluginList)
{
@@ -2214,7 +2214,7 @@ ccsCanDisablePlugin (CCSContext * context, CCSPlugin * plugin)
if (conflict)
{
conflict->value = strdup (sl->data);
- conflict->type = ConflictPluginNeeded;
+ conflict->type = ConflictFeatureNeeded;
}
}
if (conflict)
commit db29fc4b5200e4646b261bdd5670633038f1cadf
Author: Danny Baumann <dannybaumann@web.de>
Date: Thu Feb 14 17:29:12 2008 +0100
Fix float setting export.
diff --git a/src/main.c b/src/main.c
index f683292..e41d56d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2447,6 +2447,10 @@ ccsExportToFile (CCSContext *context,
ccsIniSetInt (exportFile, plugin->name, keyName,
setting->value->value.asInt);
break;
+ case TypeFloat:
+ ccsIniSetFloat (exportFile, plugin->name, keyName,
+ setting->value->value.asFloat);
+ break;
case TypeString:
ccsIniSetString (exportFile, plugin->name, keyName,
setting->value->value.asString);
commit 89d16d579a434d70468346c35d114c4e62d978fb
Author: Danny Baumann <dannybaumann@web.de>
Date: Thu Feb 14 10:33:07 2008 +0100
Clarify parameter name.
diff --git a/include/ccs.h b/include/ccs.h
index e9f5bd1..885597c 100644
--- a/include/ccs.h
+++ b/include/ccs.h
@@ -633,12 +633,12 @@ Bool ccsExportToFile (CCSContext *context,
const char *fileName,
Bool skipDefaults);
-/* Imports a profile from a file. If overwrite is TRUE, also overwrites
- settings that were non-default before. Returns TRUE on success, FALSE
- otherwise. */
+/* Imports a profile from a file. If overwriteNonDefault is TRUE, also
+ overwrites settings that were non-default before. Returns TRUE on success,
+ FALSE otherwise. */
Bool ccsImportFromFile (CCSContext *context,
const char *fileName,
- Bool overwrite);
+ Bool overwriteNonDefault);
/* File watch stuff */
diff --git a/src/main.c b/src/main.c
index 831113e..f683292 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2401,7 +2401,9 @@ ccsGetExistingBackends ()
}
Bool
-ccsExportToFile (CCSContext * context, const char * fileName, Bool skipDefaults)
+ccsExportToFile (CCSContext *context,
+ const char *fileName,
+ Bool skipDefaults)
{
IniDictionary *exportFile;
CCSPluginList p;
@@ -2492,7 +2494,9 @@ ccsExportToFile (CCSContext * context, const char * fileName, Bool skipDefaults)
}
Bool
-ccsImportFromFile (CCSContext * context, const char * fileName, Bool overwrite)
+ccsImportFromFile (CCSContext *context,
+ const char *fileName,
+ Bool overwriteNonDefault)
{
IniDictionary *importFile;
CCSPluginList p;
@@ -2523,7 +2527,7 @@ ccsImportFromFile (CCSContext * context, const char * fileName, Bool overwrite)
for (s = pPrivate->settings; s; s = s->next)
{
setting = s->data;
- if (!setting->isDefault && !overwrite)
+ if (!setting->isDefault && !overwriteNonDefault)
continue;
if (setting->isScreen)
commit 2921eba803d80e5f20221f724af04b922c5a2f91
Author: Danny Baumann <dannybaumann@web.de>
Date: Thu Feb 14 10:31:02 2008 +0100
Added some documentation for the most important functions.
diff --git a/include/ccs.h b/include/ccs.h
index 7b811fc..e9f5bd1 100644
--- a/include/ccs.h
+++ b/include/ccs.h
@@ -44,6 +44,43 @@
#define FALSE 0
#endif
+/**
+ * list functions:
+ * for each list there is a set of functions, explained using String as example
+ *
+ * ccsStringListAppend (list, item)
+ * Adds an item at the end of the list. Returns the new list.
+ *
+ * ccsStringListPrepend (list, item)
+ * Adds an item at the beginning of the list. Returns the new list.
+ *
+ * ccsStringListInsert (list, item, position)
+ * Adds an item at a given position. Position is 0-based. If position is
+ * larger than the amount of items in the list, the item is inserted at the
+ * end of the list. Returns the new list.
+ *
+ * ccsStringListInsertBefore (list, sibling, item)
+ * Inserts item before sibling into the list. If sibling is no list member,
+ * item is inserted at the end. Returns the new list.
+ *
+ * ccsStringListLength (list)
+ * Returns the amount of items in list.
+ *
+ * ccsStringListFind (list, item)
+ * Finds and returns an item matching <item>. If nothing is found, returns NULL.
+ *
+ * ccsStringListGetItem (list, index)
+ * Returns the list item at position <index>. If index is larger than the
+ * amount of items in the list, returns NULL.
+ *
+ * ccsStringListRemove (list, item, freeObj)
+ * Removes item from the list. If freeObj is TRUE, also frees the data item.
+ * Returns the new list.
+ *
+ * ccsStringListFree (list, freeObj)
+ * Frees the complete list. If freeObj is TRUE, also frees the data items.
+ * Returns the new list (NULL).
+ */
#define CCSLIST_HDR(type,dtype) \
typedef struct _CCS##type##List * CCS##type##List;\
struct _CCS##type##List \
@@ -84,46 +121,59 @@ CCSLIST_HDR (IntDesc, CCSIntDesc)
struct _CCSContext
{
- CCSPluginList plugins;
- CCSPluginCategory *categories;
- void *privatePtr;
- void *ccsPrivate;
-
- CCSSettingList changedSettings;
-
- unsigned int *screens;
- unsigned int numScreens;
+ CCSPluginList plugins; /* list of plugins settings
+ were loaded for */
+ CCSPluginCategory *categories; /* list of plugin categories */
+ void *privatePtr; /* private pointer that can be used
+ by the caller */
+ void *ccsPrivate; /* private pointer for compizconfig
+ internal usage */
+
+ CCSSettingList changedSettings; /* list of settings changed since last
+ settings write */
+
+ unsigned int *screens; /* numbers of the available screens */
+ unsigned int numScreens; /* number of screens */
};
struct _CCSBackendInfo
{
- char *name;
- char *shortDesc;
- char *longDesc;
- Bool integrationSupport;
- Bool profileSupport;
+ char *name; /* name of the backend */
+ char *shortDesc; /* backend's short description */
+ char *longDesc; /* backend's long description */
+ Bool integrationSupport; /* does the backend support DE integration? */
+ Bool profileSupport; /* does the backend support profiles? */
};
struct _CCSPlugin
{
- char *name;
- char *shortDesc; /* in current locale */
- char *longDesc; /* in current locale */
- char *hints;
- char *category; /* simple name */
-
- CCSStringList loadAfter;
- CCSStringList loadBefore;
- CCSStringList requiresPlugin;
- CCSStringList conflictPlugin;
- CCSStringList conflictFeature;
- CCSStringList providesFeature;
- CCSStringList requiresFeature;
-
- void *privatePtr;
- CCSContext *context;
-
- void *ccsPrivate;
+ char *name; /* plugin name */
+ char *shortDesc; /* plugin short description */
+ char *longDesc; /* plugin long description */
+ char *hints; /* currently unused */
+ char *category; /* plugin category name */
+
+ CCSStringList loadAfter; /* list of plugin names this plugin needs to
+ be loaded after */
+ CCSStringList loadBefore; /* list of plugin names this plugin needs to
+ be loaded before */
+ CCSStringList requiresPlugin; /* list of plugin names this plugin
+ requires */
+ CCSStringList conflictPlugin; /* list of plugin names this plugin
+ conflicts with */
+ CCSStringList conflictFeature; /* list of feature names this plugin
+ conflicts with */
+ CCSStringList providesFeature; /* list of feature names this plugin
+ provides */
+ CCSStringList requiresFeature; /* list of feature names this plugin
+ requires */
+
+ void *privatePtr; /* private pointer that can be used
+ by the caller */
+ CCSContext *context; /* context this plugin belongs to */
+
+ void *ccsPrivate; /* private pointer for compizconfig
+ internal usage */
};
typedef enum _CCSSettingType
@@ -144,14 +194,14 @@ typedef enum _CCSSettingType
struct _CCSSubGroup
{
- char *name; /* in current locale */
- CCSSettingList settings; /* list of CCSSetting */
+ char *name; /* sub group name in current locale */
+ CCSSettingList settings; /* list of settings in this sub group */
};
struct _CCSGroup
{
- char *name; /* in current locale */
- CCSSubGroupList subGroups; /* list of CCSSubGroup */
+ char *name; /* group name in current locale */
+ CCSSubGroupList subGroups; /* list of sub groups in this group */
};
typedef enum _CCSPluginConflictType
@@ -169,50 +219,45 @@ typedef enum _CCSPluginConflictType
struct _CCSPluginConflict
{
- char * value;
- CCSPluginConflictType type;
- CCSPluginList plugins;
+ char * value; /* item (plugin / feature) name that
+ caused the conflict */
+ CCSPluginConflictType type; /* type of the conflict */
+ CCSPluginList plugins; /* list of conflicting plugins */
};
union _CCSSettingInfo;
struct _CCSIntDesc
{
- int value;
- char *name;
+ int value; /* value the description is assigned to */
+ char *name; /* description */
};
typedef struct _CCSSettingIntInfo
{
- int min;
- int max;
- CCSIntDescList desc;
-}
-
-CCSSettingIntInfo;
+ int min; /* minimum value for this setting */
+ int max; /* maximum value */
+ CCSIntDescList desc; /* list of item descriptions */
+} CCSSettingIntInfo;
typedef struct _CCSSettingFloatInfo
{
- float min;
- float max;
- float precision;
-}
-
-CCSSettingFloatInfo;
+ float min; /* minimum value for this setting */
+ float max; /* maximum value */
+ float precision; /* precision (allowed increment) */
+} CCSSettingFloatInfo;
typedef struct _CCSSettingListInfo
{
- CCSSettingType listType;
- union _CCSSettingInfo *listInfo;
-}
-
-CCSSettingListInfo;
+ CCSSettingType listType; /* type of setting this list contains */
+ union _CCSSettingInfo *listInfo; /* list of settings */
+} CCSSettingListInfo;
typedef union _CCSSettingInfo
{
- CCSSettingIntInfo forInt;
- CCSSettingFloatInfo forFloat;
- CCSSettingListInfo forList;
+ CCSSettingIntInfo forInt;
+ CCSSettingFloatInfo forFloat;
+ CCSSettingListInfo forList;
} CCSSettingInfo;
typedef struct _CCSSettingColorValueColor
@@ -276,58 +321,81 @@ struct _CCSSettingValue
struct _CCSSetting
{
- char *name;
- char *shortDesc; /* in current locale */
- char *longDesc; /* in current locale */
+ char *name; /* setting name */
+ char *shortDesc; /* setting short description in current locale */
+ char *longDesc; /* setting long description in current locale */
- CCSSettingType type;
+ CCSSettingType type; /* setting type */
- Bool isScreen; /* support the 'screen/display' thing */
- unsigned int screenNum;
+ Bool isScreen; /* is this setting a screen setting? */
+ unsigned int screenNum; /* screen number this setting is assigned to, valid
+ if isScreen is TRUE */
- CCSSettingInfo info;
+ CCSSettingInfo info; /* information assigned to this setting,
+ valid if the setting is an int, float
+ or list setting */
- char *group; /* in current locale */
- char *subGroup; /* in current locale */
- char *hints; /* in current locale */
+ char *group; /* group name in current locale */
+ char *subGroup; /* sub group name in current locale */
+ char *hints; /* hints in current locale */
- CCSSettingValue defaultValue;
- CCSSettingValue *value; /* = &default_value if isDefault == TRUE */
- Bool isDefault;
+ CCSSettingValue defaultValue; /* default value of this setting */
+ CCSSettingValue *value; /* actual value of this setting */
+ Bool isDefault; /* does the actual value match the default
+ value? */
- CCSPlugin *parent;
- void *privatePtr;
+ CCSPlugin *parent; /* plugin this setting belongs to */
+ void *privatePtr; /* private pointer for usage by the caller */
};
struct _CCSPluginCategory
{
- const char *name;
- const char *shortDesc;
- const char *longDesc;
+ const char *name; /* plugin category name */
+ const char *shortDesc; /* plugin category short description */
+ const char *longDesc; /* plugin category long description */
- CCSStringList plugins;
+ CCSStringList plugins; /* list of plugins in this category */
};
/* set basic metadata to TRUE and no additional
metadata informations will be parsed */
void ccsSetBasicMetadata (Bool value);
+
+/* Creates a new context for the screens given in screens and numScreens.
+ Set numScreens to 0 to initialize for all screens.
+ All plugin settings are automatically enumerated. */
CCSContext* ccsContextNew (unsigned int *screens,
unsigned int numScreens);
+
+/* Creates a new context without auto-enumerating any plugin or setting.
+ Behaves otherwise exactly like ccsContextNew. */
CCSContext* ccsEmptyContextNew (unsigned int *screens,
unsigned int numScreens);
+
+/* Destroys the allocated context. */
void ccsContextDestroy (CCSContext * context);
+/* Load the plugin and setting metadata for a given plugin.
+ Returns TRUE on success, FALSE otherwise. */
Bool ccsLoadPlugin (CCSContext *context,
char *name);
+/* Searches for a plugin identified by its name in the context.
+ Returns the plugin struct if it could be found, NULL otherwise. */
CCSPlugin* ccsFindPlugin (CCSContext *context,
const char *name);
+/* Searches for a setting in a plugin. screenNum is only valid if isScreen is
+ TRUE. Returns the setting struct if the search was successful (setting with
+ name <name> found and isScreen and screenNum matched the values of the
+ setting), NULL otherwise. */
CCSSetting* ccsFindSetting (CCSPlugin *plugin,
const char *name,
Bool isScreen,
unsigned int screenNum);
+/* Returns TRUE if the named plugin is in the context and marked as currently
+ active in Compiz, FALSE otherwise. */
Bool ccsPluginIsActive (CCSContext *context,
char *name);
@@ -342,6 +410,9 @@ void ccsFreeBackendInfo (CCSBackendInfo *value);
void ccsFreeIntDesc (CCSIntDesc *value);
#define ccsFreeString(val) free(val)
+/* Setting setters. Set <setting> to value <data>. Return TRUE if new value
+ matches data. If the new value doesn't match the old value, the setting
+ is added to the context's changedSettings list. */
Bool ccsSetInt (CCSSetting *setting,
int data);
Bool ccsSetFloat (CCSSetting *setting,
@@ -367,6 +438,8 @@ Bool ccsSetList (CCSSetting *setting,
Bool ccsSetValue (CCSSetting *setting,
CCSSettingValue *data);
+/* Compares two setting values. Returns TRUE if values match,
+ FALSE otherwise. */
Bool ccsIsEqualColor (CCSSettingColorValue c1,
CCSSettingColorValue c2);
Bool ccsIsEqualKey (CCSSettingKeyValue c1,
@@ -374,6 +447,8 @@ Bool ccsIsEqualKey (CCSSettingKeyValue c1,
Bool ccsIsEqualButton (CCSSettingButtonValue c1,
CCSSettingButtonValue c2);
+/* Setting getters. Returns TRUE if the setting value was successfully
+ copied into <data>, FALSE otherwise. */
Bool ccsGetInt (CCSSetting *setting,
int *data);
Bool ccsGetFloat (CCSSetting *setting,
@@ -397,18 +472,32 @@ Bool ccsGetBell (CCSSetting *setting,
Bool ccsGetList (CCSSetting *setting,
CCSSettingValueList *data);
+/* Retrieves a list of settings in a plugin */
CCSSettingList ccsGetPluginSettings (CCSPlugin *plugin);
+
+/* Retrieves a list of setting groups in a plugin */
CCSGroupList ccsGetPluginGroups (CCSPlugin *plugin);
+/* Converts a string list into a list of string settings.
+ Return value needs to be freed by the caller. */
CCSSettingValueList ccsGetValueListFromStringList (CCSStringList list,
CCSSetting *parent);
+/* Converts a string setting value list into a string list.
+ Return value needs to be freed by the caller. */
CCSStringList ccsGetStringListFromValueList (CCSSettingValueList list);
+/* Converts a string list into a string array. If the return value is not
+ NULL, the item count is copied into <num>. Return value needs to be freed
+ by the caller. */
char** ccsGetStringArrayFromList (CCSStringList list,
int *num);
+/* Converts a string array with <num> items into a string list. Return value
+ needs to be freed by the caller. */
CCSStringList ccsGetListFromStringArray (char **array,
int num);
+/* Converts a setting value list into an array of the setting item data type.
+ Behaves similar to ccsGetStringArrayFromList. */
char** ccsGetStringArrayFromValueList (CCSSettingValueList list,
int *num);
char** ccsGetMatchArrayFromValueList (CCSSettingValueList list,
@@ -420,10 +509,11 @@ float* ccsGetFloatArrayFromValueList (CCSSettingValueList list,
int *num);
Bool * ccsGetBoolArrayFromValueList (CCSSettingValueList list,
int *num);
-
CCSSettingColorValue* ccsGetColorArrayFromValueList (CCSSettingValueList list,
int *num);
+/* Converts an array of data items to a setting value list. Behaves similar
+ to ccsGetListFromStringArray */
CCSSettingValueList ccsGetValueListFromStringArray (char **array,
int num,
CCSSetting *parent);
@@ -443,23 +533,47 @@ CCSSettingValueList ccsGetValueListFromColorArray (CCSSettingColorValue *array,
int num,
CCSSetting *parent);
+/* Retrieves a list of plugins marked as active in Compiz for this context */
CCSPluginList ccsGetActivePluginList (CCSContext *context);
+
+/* Retrieves a list of plugin names which are active in Compiz for a given
+ context, sorted as needed according to load after/before/etc. rules */
CCSStringList ccsGetSortedPluginStringList (CCSContext *context);
+/* Switches the backend for a context. Returns TRUE on successful switch,
+ FALSE otherwise. */
Bool ccsSetBackend (CCSContext *context,
char *name);
+/* Retrieves the name of the backend active for the context. */
char * ccsGetBackend (CCSContext *context);
+
+/* Enable/disable DE integration for a context. */
void ccsSetIntegrationEnabled (CCSContext *context,
Bool value);
+
+/* Sets the profile for a context. */
void ccsSetProfile (CCSContext *context,
char *name);
+
+/* Set plugin list autosort for a context. */
void ccsSetPluginListAutoSort (CCSContext *context,
Bool value);
+
+/* Retrieve current profile of the context. */
char * ccsGetProfile (CCSContext *context);
+
+/* Retrieves current DE integration status for a context */
Bool ccsGetIntegrationEnabled (CCSContext *context);
+
+/* Retrieves the autosort setting for a context. */
+Bool ccsGetPluginListAutoSort (CCSContext *context);
+
+/* Changes the plugin activeness status in compiz. If plugin list autosort
+ is enabled, automatically writes a new sorted plugin list to the
+ active_plugins setting. If autosort is disabled, it's up to the caller
+ to do that. */
Bool ccsPluginSetActive (CCSPlugin *plugin,
Bool value);
-Bool ccsGetPluginListAutoSort (CCSContext *context);
/* functions parsing/creating an action string -
the returned strings must be free'd after usage! */
@@ -497,18 +611,31 @@ Bool ccsStringToColor (const char *value,
void ccsProcessEvents (CCSContext *context,
unsigned int flags);
+/* Read all setting values from disk */
void ccsReadSettings (CCSContext *context);
+
+/* Read setting values for a given plugin */
void ccsReadPluginSettings (CCSPlugin *plugin);
+/* Write all settings to disk */
void ccsWriteSettings (CCSContext *context);
+
+/* Write changed settings to disk */
void ccsWriteChangedSettings (CCSContext *context);
+/* Reset all settings to defaults. Settings that were non-default
+ previously are added to the changedSettings list of the context. */
void ccsResetToDefault (CCSSetting * setting);
-/* File import / export */
+/* Exports a profile to a file. If skipDefaults is TRUE, only exports
+ non-default settings. Returns TRUE on successful export, FALSE otherwise. */
Bool ccsExportToFile (CCSContext *context,
const char *fileName,
Bool skipDefaults);
+
+/* Imports a profile from a file. If overwrite is TRUE, also overwrites
+ settings that were non-default before. Returns TRUE on success, FALSE
+ otherwise. */
Bool ccsImportFromFile (CCSContext *context,
const char *fileName,
Bool overwrite);
@@ -636,19 +763,31 @@ void ccsIniRemoveEntry (IniDictionary *dictionary,
const char *section,
const char *entry);
-/* plugin conflict handling */
+/* Checks if a plugin can be enabled. Returns a list of conflicts that
+ would occur when loading the plugin. A return value of NULL means that
+ the plugin can be enabled without problems. */
CCSPluginConflictList ccsCanEnablePlugin (CCSContext *context,
CCSPlugin *plugin);
+
+/* Checks if a plugin can be disabled. The meaning of the return value is the
+ same as for ccsCanEnablePlugin */
CCSPluginConflictList ccsCanDisablePlugin (CCSContext *context,
CCSPlugin *plugin);
+/* Enumerates the available profiles for the current backend. */
CCSStringList ccsGetExistingProfiles (CCSContext * context);
+
+/* Deletes the profile with the given name. */
void ccsDeleteProfile (CCSContext *context,
char *name);
+/* Enumerates the available backends. */
CCSBackendInfoList ccsGetExistingBackends (void);
+/* Checks if a given setting is integrated in the desktop environment. */
Bool ccsSettingIsIntegrated (CCSSetting *setting);
+
+/* Checks if a given setting is read-only. */
Bool ccsSettingIsReadOnly (CCSSetting *setting);
#endif
commit f59d602b7503337f46370059e2a9846efdc2825a
Author: Danny Baumann <dannybaumann@web.de>
Date: Thu Feb 14 09:08:43 2008 +0100
Do not autosave after import.
diff --git a/src/main.c b/src/main.c
index 919340f..831113e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2633,8 +2633,6 @@ ccsImportFromFile (CCSContext * context, const char * fileName, Bool overwrite)
}
}
- ccsWriteSettings (context);
-
ccsIniClose (importFile);
return TRUE;
commit b1e4bc37a466b1a7385eced8dc70bba5e2182607
Author: Danny Baumann <dannybaumann@web.de>
Date: Wed Feb 13 11:16:08 2008 +0100
Check for file existance before trying to import it.
diff --git a/src/main.c b/src/main.c
index ca8cbd6..919340f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2500,6 +2500,13 @@ ccsImportFromFile (CCSContext * context, const char * fileName, Bool overwrite)
CCSPlugin *plugin;
CCSSetting *setting;
char *keyName;
+ FILE *fp;
+
+ /* check if the file exists first */
+ fp = fopen (fileName, "r");
+ if (!fp)
+ return FALSE;
+ fclose (fp);
importFile = iniparser_new ((char *) fileName);
if (!importFile)
commit 45197f7114bddf662360c56f26ad3f4f68c6bf11
Author: Roland Baer <roland@Vista.(none)>
Date: Fri Aug 24 14:48:50 2007 +0300
Major review, fixes
diff --git a/src/main.c b/src/main.c
index 15b7b2f..ca8cbd6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -553,9 +553,11 @@ openBackend (char *backend)
err = dlerror ();
}
- if (err || !dlhand)
+ if (!dlhand)
{
- free (dlname);
+ if (dlname) {
+ free (dlname);
+ }
asprintf (&dlname, "%s/compizconfig/backends/lib%s.so",
LIBDIR, backend);
dlhand = dlopen (dlname, RTLD_NOW | RTLD_NODELETE | RTLD_GLOBAL);
@@ -564,10 +566,9 @@ openBackend (char *backend)
free (dlname);
- if (err || !dlhand)
+ if (err)
{
fprintf (stderr, "libccs: dlopen: %s\n", err);
- return NULL;
}
Reply to: