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).
This commit is contained in:
parent
4b314ade40
commit
b352b3d4c5
|
@ -174,15 +174,12 @@ s48_value scx_Get_Window_Attributes(s48_value Xdisplay, s48_value Xwindow) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
s48_value scx_Configure_Window (s48_value Xwindow, s48_value Xdisplay,
|
unsigned long AList_To_XWindowChanges(s48_value alist, XWindowChanges* WC) {
|
||||||
s48_value alist) {
|
|
||||||
unsigned long mask = 0;
|
unsigned long mask = 0;
|
||||||
XWindowChanges WC;
|
|
||||||
s48_value l, p;
|
s48_value l, p;
|
||||||
char* cname;
|
char* cname;
|
||||||
int cvalue;
|
int cvalue;
|
||||||
s48_value name, value;
|
s48_value name, value;
|
||||||
|
|
||||||
for (l = alist; !S48_NULL_P(l); l = S48_CDR(l)) {
|
for (l = alist; !S48_NULL_P(l); l = S48_CDR(l)) {
|
||||||
p = S48_CAR(l);
|
p = S48_CAR(l);
|
||||||
name = S48_CAR(p);
|
name = S48_CAR(p);
|
||||||
|
@ -191,28 +188,35 @@ s48_value scx_Configure_Window (s48_value Xwindow, s48_value Xdisplay,
|
||||||
cvalue = (int)s48_extract_integer(value); // only ints here
|
cvalue = (int)s48_extract_integer(value); // only ints here
|
||||||
|
|
||||||
if (strcmp(cname, "x") == 0) {
|
if (strcmp(cname, "x") == 0) {
|
||||||
WC.x = cvalue;
|
WC->x = cvalue;
|
||||||
mask |= CWX;
|
mask |= CWX;
|
||||||
} else if (strcmp(cname, "y") == 0) {
|
} else if (strcmp(cname, "y") == 0) {
|
||||||
WC.y = cvalue;
|
WC->y = cvalue;
|
||||||
mask |= CWY;
|
mask |= CWY;
|
||||||
} else if (strcmp(cname, "width") == 0) {
|
} else if (strcmp(cname, "width") == 0) {
|
||||||
WC.width = cvalue;
|
WC->width = cvalue;
|
||||||
mask |= CWWidth;
|
mask |= CWWidth;
|
||||||
} else if (strcmp(cname, "height") == 0) {
|
} else if (strcmp(cname, "height") == 0) {
|
||||||
WC.height = cvalue;
|
WC->height = cvalue;
|
||||||
mask |= CWHeight;
|
mask |= CWHeight;
|
||||||
} else if (strcmp(cname, "border-width") == 0) {
|
} else if (strcmp(cname, "border-width") == 0) {
|
||||||
WC.border_width = cvalue;
|
WC->border_width = cvalue;
|
||||||
mask |= CWBorderWidth;
|
mask |= CWBorderWidth;
|
||||||
} else if (strcmp(cname, "sibling") == 0) {
|
} else if (strcmp(cname, "sibling") == 0) {
|
||||||
WC.sibling = (Window)s48_extract_integer(value);
|
WC->sibling = (Window)s48_extract_integer(value);
|
||||||
mask |= CWSibling;
|
mask |= CWSibling;
|
||||||
} else if (strcmp(cname, "stack-mode") == 0) {
|
} else if (strcmp(cname, "stack-mode") == 0) {
|
||||||
WC.stack_mode = cvalue;
|
WC->stack_mode = cvalue;
|
||||||
mask |= CWStackMode;
|
mask |= CWStackMode;
|
||||||
}
|
}
|
||||||
} // for
|
} // for
|
||||||
|
return mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
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),
|
XConfigureWindow (SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow),
|
||||||
mask, &WC);
|
mask, &WC);
|
||||||
|
|
Loading…
Reference in New Issue