|
|
|
@ -22,11 +22,11 @@
|
|
|
|
|
#include <tqdir.h>
|
|
|
|
|
|
|
|
|
|
#include <tdeconfig.h>
|
|
|
|
|
#include <tdesimpleconfig.h>
|
|
|
|
|
#include <ksimpleconfig.h>
|
|
|
|
|
#include <kdebug.h>
|
|
|
|
|
#include <tdeglobal.h>
|
|
|
|
|
#include <tdestandarddirs.h>
|
|
|
|
|
#include <tdeinstance.h>
|
|
|
|
|
#include <kstandarddirs.h>
|
|
|
|
|
#include <kinstance.h>
|
|
|
|
|
#include <tdeshortcut.h>
|
|
|
|
|
#include <kipc.h>
|
|
|
|
|
#include <tdeapplication.h>
|
|
|
|
@ -56,7 +56,7 @@ static TDEInstance *instance = NULL;
|
|
|
|
|
|
|
|
|
|
typedef struct _ConfigFiles
|
|
|
|
|
{
|
|
|
|
|
TDESimpleConfig *main;
|
|
|
|
|
KSimpleConfig *main;
|
|
|
|
|
TQString profile;
|
|
|
|
|
TDEConfig *twin;
|
|
|
|
|
TDEConfig *global;
|
|
|
|
@ -258,7 +258,7 @@ KdeBoolToCCS (CCSSetting *setting,
|
|
|
|
|
{
|
|
|
|
|
TDEConfig *cfg = (specialOptions[num].global) ? cFiles->global : cFiles->twin;
|
|
|
|
|
|
|
|
|
|
Bool val = cfg->readBoolEntry (specialOptions[num].kdeName);
|
|
|
|
|
Bool val = (cfg->readBoolEntry (specialOptions[num].kdeName))? TRUE : FALSE;
|
|
|
|
|
|
|
|
|
|
ccsSetBool (setting, val);
|
|
|
|
|
}
|
|
|
|
@ -350,7 +350,8 @@ readIntegratedOption (CCSSetting *setting)
|
|
|
|
|
}
|
|
|
|
|
else if (specialOptions[option].settingName == "click_to_focus")
|
|
|
|
|
{
|
|
|
|
|
Bool val = cFiles->twin->readEntry ("FocusPolicy") == "ClickToFocus";
|
|
|
|
|
Bool val = (cFiles->twin->readEntry ("FocusPolicy") ==
|
|
|
|
|
"ClickToFocus") ? TRUE : FALSE;
|
|
|
|
|
ccsSetBool (setting, val);
|
|
|
|
|
}
|
|
|
|
|
else if (specialOptions[option].settingName == "number_of_desktops")
|
|
|
|
@ -394,7 +395,7 @@ readIntegratedOption (CCSSetting *setting)
|
|
|
|
|
CCSSettingValueList list = ccsGetValueListFromIntArray (intList, 2,
|
|
|
|
|
setting);
|
|
|
|
|
ccsSetList (setting, list);
|
|
|
|
|
ccsSettingValueListFree (list, true);
|
|
|
|
|
ccsSettingValueListFree (list, TRUE);
|
|
|
|
|
}
|
|
|
|
|
else if (specialOptions[option].settingName == "resistance_distance" ||
|
|
|
|
|
specialOptions[option].settingName == "attraction_distance")
|
|
|
|
@ -428,7 +429,7 @@ readIntegratedOption (CCSSetting *setting)
|
|
|
|
|
num,
|
|
|
|
|
setting);
|
|
|
|
|
ccsSetList (setting, list);
|
|
|
|
|
ccsSettingValueListFree (list, true);
|
|
|
|
|
ccsSettingValueListFree (list, TRUE);
|
|
|
|
|
}
|
|
|
|
|
else if (specialOptions[option].settingName == "next_key" ||
|
|
|
|
|
specialOptions[option].settingName == "prev_key")
|
|
|
|
@ -503,9 +504,9 @@ readIntegratedOption (CCSSetting *setting)
|
|
|
|
|
int val = cFiles->twin->readNumEntry ("ElectricBorders");
|
|
|
|
|
|
|
|
|
|
if (val > 0)
|
|
|
|
|
ccsSetBool (setting, true);
|
|
|
|
|
ccsSetBool (setting, TRUE);
|
|
|
|
|
else
|
|
|
|
|
ccsSetBool (setting, false);
|
|
|
|
|
ccsSetBool (setting, FALSE);
|
|
|
|
|
}
|
|
|
|
|
else if (specialOptions[option].settingName == "edge_flip_pointer" ||
|
|
|
|
|
specialOptions[option].settingName == "edgeflip_pointer")
|
|
|
|
@ -513,9 +514,9 @@ readIntegratedOption (CCSSetting *setting)
|
|
|
|
|
int val = cFiles->twin->readNumEntry ("ElectricBorders");
|
|
|
|
|
|
|
|
|
|
if (val > 1)
|
|
|
|
|
ccsSetBool (setting, true);
|
|
|
|
|
ccsSetBool (setting, TRUE);
|
|
|
|
|
else
|
|
|
|
|
ccsSetBool (setting, false);
|
|
|
|
|
ccsSetBool (setting, FALSE);
|
|
|
|
|
}
|
|
|
|
|
else if (specialOptions[option].settingName == "mode" &&
|
|
|
|
|
specialOptions[option].pluginName == "place")
|
|
|
|
@ -558,7 +559,7 @@ getSettingIsReadOnly (CCSSetting *setting)
|
|
|
|
|
{
|
|
|
|
|
if (!ccsGetIntegrationEnabled (setting->parent->context)
|
|
|
|
|
|| !isIntegratedOption (setting) )
|
|
|
|
|
return false;
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
int option = 0;
|
|
|
|
|
|
|
|
|
@ -578,23 +579,23 @@ getSettingIsReadOnly (CCSSetting *setting)
|
|
|
|
|
case OptionSpecial:
|
|
|
|
|
if (specialOptions[option].settingName == "command11")
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else if (specialOptions[option].settingName == "map_on_shutdown")
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else if (specialOptions[option].settingName == "unmaximize_window_key"
|
|
|
|
|
|| specialOptions[option].settingName == "maximize_window_key"
|
|
|
|
|
|| specialOptions[option].settingName == "maximize_window_horizontally_key"
|
|
|
|
|
|| specialOptions[option].settingName == "maximize_window_vertically_key")
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else if (specialOptions[option].settingName == "snap_type" ||
|
|
|
|
|
specialOptions[option].settingName == "attraction_distance")
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
@ -602,7 +603,7 @@ getSettingIsReadOnly (CCSSetting *setting)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static CCSStringList
|
|
|
|
@ -640,7 +641,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
CCSSetting *setting)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
TDESimpleConfig *cfg = cFiles->main;
|
|
|
|
|
KSimpleConfig *cfg = cFiles->main;
|
|
|
|
|
|
|
|
|
|
TQString key (setting->name);
|
|
|
|
|
TQString group (setting->parent->name);
|
|
|
|
@ -689,7 +690,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
|
|
|
|
|
case TypeBool:
|
|
|
|
|
{
|
|
|
|
|
Bool val = cfg->readBoolEntry (key);
|
|
|
|
|
Bool val = (cfg->readBoolEntry (key) ) ? TRUE : FALSE;
|
|
|
|
|
ccsSetBool (setting, val);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -729,7 +730,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
|
|
|
|
|
for (it = list.begin(); it != list.end(); it++)
|
|
|
|
|
{
|
|
|
|
|
array[i] = ( (*it) ) ? true : false;
|
|
|
|
|
array[i] = ( (*it) ) ? TRUE : FALSE;
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -737,7 +738,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
|
|
|
|
|
ccsGetValueListFromBoolArray (array, i, setting);
|
|
|
|
|
ccsSetList (setting, l);
|
|
|
|
|
ccsSettingValueListFree (l, true);
|
|
|
|
|
ccsSettingValueListFree (l, TRUE);
|
|
|
|
|
delete array;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -761,7 +762,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
|
|
|
|
|
ccsGetValueListFromIntArray (array, i, setting);
|
|
|
|
|
ccsSetList (setting, l);
|
|
|
|
|
ccsSettingValueListFree (l, true);
|
|
|
|
|
ccsSettingValueListFree (l, TRUE);
|
|
|
|
|
delete array;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -789,7 +790,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
|
|
|
|
|
ccsGetValueListFromStringArray (array, i, setting);
|
|
|
|
|
ccsSetList (setting, l);
|
|
|
|
|
ccsSettingValueListFree (l, true);
|
|
|
|
|
ccsSettingValueListFree (l, TRUE);
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < i; j++)
|
|
|
|
|
free (array[j]);
|
|
|
|
@ -822,7 +823,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
|
|
|
|
|
ccsGetValueListFromStringArray (array, i, setting);
|
|
|
|
|
ccsSetList (setting, l);
|
|
|
|
|
ccsSettingValueListFree (l, true);
|
|
|
|
|
ccsSettingValueListFree (l, TRUE);
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < i; j++)
|
|
|
|
|
free (array[j]);
|
|
|
|
@ -851,7 +852,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
|
|
|
|
|
ccsGetValueListFromFloatArray (array, i, setting);
|
|
|
|
|
ccsSetList (setting, l);
|
|
|
|
|
ccsSettingValueListFree (l, true);
|
|
|
|
|
ccsSettingValueListFree (l, TRUE);
|
|
|
|
|
delete array;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -886,7 +887,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
|
|
|
|
|
ccsGetValueListFromColorArray (array, i, setting);
|
|
|
|
|
ccsSetList (setting, l);
|
|
|
|
|
ccsSettingValueListFree (l, true);
|
|
|
|
|
ccsSettingValueListFree (l, TRUE);
|
|
|
|
|
delete array;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -913,7 +914,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ccsSetList (setting, l);
|
|
|
|
|
ccsSettingValueListFree (l, true);
|
|
|
|
|
ccsSettingValueListFree (l, TRUE);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case TypeButton:
|
|
|
|
@ -938,7 +939,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ccsSetList (setting, l);
|
|
|
|
|
ccsSettingValueListFree (l, true);
|
|
|
|
|
ccsSettingValueListFree (l, TRUE);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case TypeEdge:
|
|
|
|
@ -960,7 +961,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ccsSetList (setting, l);
|
|
|
|
|
ccsSettingValueListFree (l, true);
|
|
|
|
|
ccsSettingValueListFree (l, TRUE);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case TypeBell:
|
|
|
|
@ -975,12 +976,12 @@ readSetting (CCSContext *c,
|
|
|
|
|
for (it = list.begin(); it != list.end(); it++)
|
|
|
|
|
{
|
|
|
|
|
val = (CCSSettingValue*) malloc (sizeof (CCSSettingValue));
|
|
|
|
|
val->value.asBell = ((*it)) ? true : false;
|
|
|
|
|
val->value.asBell = ((*it)) ? TRUE : FALSE;
|
|
|
|
|
l = ccsSettingValueListAppend (l, val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ccsSetList (setting, l);
|
|
|
|
|
ccsSettingValueListFree (l, true);
|
|
|
|
|
ccsSettingValueListFree (l, TRUE);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
@ -1025,7 +1026,7 @@ readSetting (CCSContext *c,
|
|
|
|
|
break;
|
|
|
|
|
case TypeBell:
|
|
|
|
|
{
|
|
|
|
|
Bool val = cfg->readBoolEntry (key);
|
|
|
|
|
Bool val = (cfg->readBoolEntry (key)) ? TRUE : FALSE;
|
|
|
|
|
ccsSetBell (setting, val);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -1393,7 +1394,7 @@ static void
|
|
|
|
|
writeSetting (CCSContext *c,
|
|
|
|
|
CCSSetting *setting)
|
|
|
|
|
{
|
|
|
|
|
TDESimpleConfig *cfg = cFiles->main;
|
|
|
|
|
KSimpleConfig *cfg = cFiles->main;
|
|
|
|
|
|
|
|
|
|
TQString key (setting->name);
|
|
|
|
|
TQString group (setting->parent->name);
|
|
|
|
@ -1778,13 +1779,13 @@ readInit (CCSContext *c)
|
|
|
|
|
TQString(), false) + configName;
|
|
|
|
|
createFile (wFile);
|
|
|
|
|
|
|
|
|
|
cFiles->main = new TDESimpleConfig (configName);
|
|
|
|
|
cFiles->main = new KSimpleConfig (configName);
|
|
|
|
|
ccsRemoveFileWatch (cFiles->watch);
|
|
|
|
|
cFiles->watch = ccsAddFileWatch (wFile.ascii(), true,
|
|
|
|
|
cFiles->watch = ccsAddFileWatch (wFile.ascii(), TRUE,
|
|
|
|
|
reload, (void *) c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
@ -1815,9 +1816,9 @@ writeInit (CCSContext *c)
|
|
|
|
|
|
|
|
|
|
createFile (wFile);
|
|
|
|
|
|
|
|
|
|
cFiles->main = new TDESimpleConfig (configName);
|
|
|
|
|
cFiles->main = new KSimpleConfig (configName);
|
|
|
|
|
ccsRemoveFileWatch (cFiles->watch);
|
|
|
|
|
cFiles->watch = ccsAddFileWatch (wFile.ascii(), true,
|
|
|
|
|
cFiles->watch = ccsAddFileWatch (wFile.ascii(), TRUE,
|
|
|
|
|
reload, (void *) c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1825,7 +1826,7 @@ writeInit (CCSContext *c)
|
|
|
|
|
ccsDisableFileWatch (cFiles->twinWatch);
|
|
|
|
|
ccsDisableFileWatch (cFiles->globalWatch);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
@ -1836,7 +1837,7 @@ writeDone (CCSContext *)
|
|
|
|
|
{
|
|
|
|
|
cFiles->twin->sync();
|
|
|
|
|
cFiles->global->sync();
|
|
|
|
|
DCOPClient *client = tdeApp->dcopClient();
|
|
|
|
|
DCOPClient *client = kapp->dcopClient();
|
|
|
|
|
if (!client->isAttached())
|
|
|
|
|
client->attach();
|
|
|
|
|
client->send("twin", "KWinInterface", "reconfigure()", TQString(""));
|
|
|
|
@ -1870,25 +1871,25 @@ init (CCSContext *c)
|
|
|
|
|
|
|
|
|
|
createFile (wFile);
|
|
|
|
|
|
|
|
|
|
cFiles->main = new TDESimpleConfig (configName);
|
|
|
|
|
cFiles->main = new KSimpleConfig (configName);
|
|
|
|
|
cFiles->twin = new TDEConfig ("twinrc");
|
|
|
|
|
cFiles->global = new TDEConfig ("kdeglobals");
|
|
|
|
|
|
|
|
|
|
cFiles->twin->setGroup ("Windows");
|
|
|
|
|
cFiles->global->setGroup ("Global Shortcuts");
|
|
|
|
|
|
|
|
|
|
cFiles->watch = ccsAddFileWatch (wFile.ascii(), true, reload, (void *) c);
|
|
|
|
|
cFiles->watch = ccsAddFileWatch (wFile.ascii(), TRUE, reload, (void *) c);
|
|
|
|
|
|
|
|
|
|
wFile = TDEGlobal::dirs()->saveLocation ("config",
|
|
|
|
|
TQString(), false) + "twinrc";
|
|
|
|
|
cFiles->twinWatch = ccsAddFileWatch (wFile.ascii(), true, reload,
|
|
|
|
|
cFiles->twinWatch = ccsAddFileWatch (wFile.ascii(), TRUE, reload,
|
|
|
|
|
(void *) c);
|
|
|
|
|
wFile = TDEGlobal::dirs()->saveLocation ("config",
|
|
|
|
|
TQString(), false) + "kdeglobals";
|
|
|
|
|
cFiles->globalWatch = ccsAddFileWatch (wFile.ascii(), true, reload,
|
|
|
|
|
cFiles->globalWatch = ccsAddFileWatch (wFile.ascii(), TRUE, reload,
|
|
|
|
|
(void *) c);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
@ -1914,7 +1915,7 @@ fini (CCSContext *)
|
|
|
|
|
|
|
|
|
|
cFiles = NULL;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
@ -1934,7 +1935,7 @@ deleteProfile (CCSContext *,
|
|
|
|
|
if (TQFile::exists (file) )
|
|
|
|
|
return TQFile::remove (file);
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static CCSBackendVTable tdeconfigVTable =
|
|
|
|
@ -1962,7 +1963,7 @@ static CCSBackendVTable tdeconfigVTable =
|
|
|
|
|
extern "C"
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
TDE_EXPORT CCSBackendVTable *
|
|
|
|
|
KDE_EXPORT CCSBackendVTable *
|
|
|
|
|
getBackendInfo (void)
|
|
|
|
|
{
|
|
|
|
|
return &tdeconfigVTable;
|
|
|
|
|