From b352b3d4c56fded936e91ad9f679d74a09071dad Mon Sep 17 00:00:00 2001 From: frese Date: Tue, 21 Aug 2001 08:26:54 +0000 Subject: [PATCH] Abstracted over the input of an XWindowChanges structure as an alist, to use in scx_Configure_Window as well as in scx_Reconfigure_Wm_Window (client.c). --- c/xlib/window.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/c/xlib/window.c b/c/xlib/window.c index 862e5fd..d81d015 100644 --- a/c/xlib/window.c +++ b/c/xlib/window.c @@ -174,15 +174,12 @@ s48_value scx_Get_Window_Attributes(s48_value Xdisplay, s48_value Xwindow) { return res; } -s48_value scx_Configure_Window (s48_value Xwindow, s48_value Xdisplay, - s48_value alist) { +unsigned long AList_To_XWindowChanges(s48_value alist, XWindowChanges* WC) { unsigned long mask = 0; - XWindowChanges WC; s48_value l, p; char* cname; int cvalue; s48_value name, value; - for (l = alist; !S48_NULL_P(l); l = S48_CDR(l)) { p = S48_CAR(l); name = S48_CAR(p); @@ -191,30 +188,37 @@ s48_value scx_Configure_Window (s48_value Xwindow, s48_value Xdisplay, cvalue = (int)s48_extract_integer(value); // only ints here if (strcmp(cname, "x") == 0) { - WC.x = cvalue; + WC->x = cvalue; mask |= CWX; } else if (strcmp(cname, "y") == 0) { - WC.y = cvalue; + WC->y = cvalue; mask |= CWY; } else if (strcmp(cname, "width") == 0) { - WC.width = cvalue; + WC->width = cvalue; mask |= CWWidth; } else if (strcmp(cname, "height") == 0) { - WC.height = cvalue; + WC->height = cvalue; mask |= CWHeight; } else if (strcmp(cname, "border-width") == 0) { - WC.border_width = cvalue; + WC->border_width = cvalue; mask |= CWBorderWidth; } else if (strcmp(cname, "sibling") == 0) { - WC.sibling = (Window)s48_extract_integer(value); + WC->sibling = (Window)s48_extract_integer(value); mask |= CWSibling; } else if (strcmp(cname, "stack-mode") == 0) { - WC.stack_mode = cvalue; + WC->stack_mode = cvalue; mask |= CWStackMode; } } // for + return mask; +} - XConfigureWindow (SCX_EXTRACT_DISPLAY(Xdisplay),SCX_EXTRACT_WINDOW(Xwindow), +s48_value scx_Configure_Window (s48_value Xwindow, s48_value Xdisplay, + s48_value alist) { + XWindowChanges WC; + unsigned long mask = AList_To_XWindowChanges(alist, &WC); + + XConfigureWindow (SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow), mask, &WC); return S48_UNSPECIFIC; }