forked from vitrine/wmaker
Reimplement the PropList data structure in Rust.
While this large change has some unit tests, it has not been integration tested thoroughly. Removing the global case insensitivity flag may be an issue in particular. A few of PropList API functions have been modified (mostly to get rid of varargs). The definition of one such function has been left in C for cleanup later.
This commit is contained in:
+6
-1
@@ -131,7 +131,12 @@ int main(int argc, char **argv)
|
||||
/* this contradicts big time with getstyle */
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
WMPLSetCaseSensitive(False);
|
||||
/*
|
||||
* Rust rewrite note: this API surface has been removed, but we leave in
|
||||
* a record of where it was invoked to set a value other than the
|
||||
* default, in case it helps to track down bugs in the future.
|
||||
*/
|
||||
/* WMPLSetCaseSensitive(False); */
|
||||
|
||||
style = WMReadPropListFromFile(file);
|
||||
if (!style) {
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ int main(int argc, char **argv)
|
||||
if (window_attrs && WMIsPLDictionary(window_attrs)) {
|
||||
icon_value = WMGetFromPLDictionary(window_attrs, icon_key);
|
||||
if (icon_value) {
|
||||
icondic = WMCreatePLDictionary(icon_key, icon_value, NULL);
|
||||
icondic = WMCreatePLDictionary(icon_key, icon_value);
|
||||
WMPutInPLDictionary(iconset, window_name, icondic);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-2
@@ -337,7 +337,12 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
WMPLSetCaseSensitive(False);
|
||||
/*
|
||||
* Rust rewrite note: this API surface has been removed, but we leave in
|
||||
* a record of where it was invoked to set a value other than the
|
||||
* default, in case it helps to track down bugs in the future.
|
||||
*/
|
||||
/* WMPLSetCaseSensitive(False); */
|
||||
|
||||
path = wdefaultspathfordomain("WindowMaker");
|
||||
|
||||
@@ -357,7 +362,7 @@ int main(int argc, char **argv)
|
||||
prop = val;
|
||||
}
|
||||
|
||||
style = WMCreatePLDictionary(NULL, NULL);
|
||||
style = WMCreateEmptyPLDictionary();
|
||||
|
||||
for (i = 0; options[i] != NULL; i++) {
|
||||
key = WMCreatePLString(options[i]);
|
||||
|
||||
+6
-1
@@ -427,7 +427,12 @@ int main(int argc, char **argv)
|
||||
|
||||
file = argv[0];
|
||||
|
||||
WMPLSetCaseSensitive(False);
|
||||
/*
|
||||
* Rust rewrite note: this API surface has been removed, but we leave in
|
||||
* a record of where it was invoked to set a value other than the
|
||||
* default, in case it helps to track down bugs in the future.
|
||||
*/
|
||||
/* WMPLSetCaseSensitive(False); */
|
||||
|
||||
path = wdefaultspathfordomain("WindowMaker");
|
||||
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ int main(int argc, char **argv)
|
||||
|
||||
dict = WMReadPropListFromFile(path);
|
||||
if (!dict) {
|
||||
dict = WMCreatePLDictionary(key, value, NULL);
|
||||
dict = WMCreatePLDictionary(key, value);
|
||||
} else {
|
||||
WMPutInPLDictionary(dict, key, value);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1199,14 +1199,14 @@ static void changeTextureForWorkspace(const char *domain, char *texture, int wor
|
||||
array = getValueForKey("WindowMaker", "WorkspaceSpecificBack");
|
||||
|
||||
if (!array) {
|
||||
array = WMCreatePLArray(NULL, NULL);
|
||||
array = WMCreateEmptyPLArray();
|
||||
}
|
||||
|
||||
j = WMGetPropListItemCount(array);
|
||||
if (workspace >= j) {
|
||||
WMPropList *empty;
|
||||
|
||||
empty = WMCreatePLArray(NULL, NULL);
|
||||
empty = WMCreateEmptyPLArray();
|
||||
|
||||
while (j++ < workspace - 1) {
|
||||
WMAddToPLArray(array, empty);
|
||||
|
||||
Reference in New Issue
Block a user