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:
2025-10-23 14:46:56 -04:00
parent 5b593fb19a
commit f3961ba66f
32 changed files with 3417 additions and 1966 deletions
+11 -9
View File
@@ -1603,11 +1603,13 @@ static WMPropList *make_icon_state(WAppIcon *btn)
snprintf(buffer, sizeof(buffer), "%hi,%hi", wAppIconGetXIndex(btn), wAppIconGetYIndex(btn));
position = WMCreatePLString(buffer);
node = WMCreatePLDictionary(dCommand, command,
dName, name,
dAutoLaunch, autolaunch,
dLock, lock,
dForced, forced, dBuggyApplication, buggy, dPosition, position, NULL);
node = WMCreatePLDictionary(dCommand, command);
WMPutInPLDictionary(node, dName, name);
WMPutInPLDictionary(node, dAutoLaunch, autolaunch);
WMPutInPLDictionary(node, dLock, lock);
WMPutInPLDictionary(node, dForced, forced);
WMPutInPLDictionary(node, dBuggyApplication, buggy);
WMPutInPLDictionary(node, dPosition, position);
WMReleasePropList(command);
WMReleasePropList(name);
WMReleasePropList(position);
@@ -1642,7 +1644,7 @@ static WMPropList *dockSaveState(WDock *dock)
WMPropList *value, *key;
char buffer[256];
list = WMCreatePLArray(NULL);
list = WMCreateEmptyPLArray();
for (i = (dock->type == WM_DOCK ? 0 : 1); i < dock->max_icons; i++) {
WAppIcon *btn = dock->icon_array[i];
@@ -1657,7 +1659,7 @@ static WMPropList *dockSaveState(WDock *dock)
}
}
dock_state = WMCreatePLDictionary(dApplications, list, NULL);
dock_state = WMCreatePLDictionary(dApplications, list);
if (dock->type == WM_DOCK) {
snprintf(buffer, sizeof(buffer), "Applications%i", dock->screen_ptr->scr_height);
@@ -5072,7 +5074,7 @@ static WMPropList *drawerSaveState(WDock *drawer)
ai = drawer->icon_array[0];
/* Store its name */
pstr = WMCreatePLString(wAppIconGetWmInstance(ai));
drawer_state = WMCreatePLDictionary(dName, pstr, NULL); /* we need this final NULL */
drawer_state = WMCreatePLDictionary(dName, pstr);
WMReleasePropList(pstr);
/* Store its position */
@@ -5114,7 +5116,7 @@ void wDrawersSaveState(WScreen *scr)
make_keys();
all_drawers = WMCreatePLArray(NULL);
all_drawers = WMCreateEmptyPLArray();
for (i=0, dc = scr->drawers;
i < scr->drawer_count;
i++, dc = dc->next) {