fixed AList_To_XWindowAttributes, changed all function from returning

lists to returning vectors.
This commit is contained in:
frese 2001-07-30 14:22:22 +00:00
parent aa52bf5b67
commit def9eb131a
1 changed files with 31 additions and 29 deletions

View File

@ -178,14 +178,15 @@ s48_value Configure_Window (s48_value Xwindow, s48_value Xdisplay,
s48_value alist) { s48_value alist) {
unsigned long mask = 0; unsigned long mask = 0;
XWindowChanges WC; XWindowChanges WC;
s48_value l; 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)) {
name = S48_CAR(l); p = S48_CAR(l);
value = S48_CDR(l); name = S48_CAR(p);
value = S48_CDR(p);
cname = s48_extract_string(S48_SYMBOL_TO_STRING(name)); cname = s48_extract_string(S48_SYMBOL_TO_STRING(name));
cvalue = (int)s48_extract_integer(value); // only ints here cvalue = (int)s48_extract_integer(value); // only ints here
@ -277,19 +278,20 @@ s48_value Query_Tree (s48_value Xwindow, s48_value Xdisplay) {
XQueryTree (EXTRACT_DISPLAY(Xdisplay), EXTRACT_WINDOW(Xwindow), XQueryTree (EXTRACT_DISPLAY(Xdisplay), EXTRACT_WINDOW(Xwindow),
&root, &parent, &children, &n); &root, &parent, &children, &n);
S48_GC_PROTECT_2 (v, ret); ret = s48_make_vector(3, S48_FALSE);
v = S48_FALSE;
ret = S48_NULL; S48_GC_PROTECT_2 (v, ret);
// vector of child-windows // vector of child-windows
v = s48_make_vector (n, S48_FALSE); v = s48_make_vector (n, S48_FALSE);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
S48_VECTOR_SET(v, i, ENTER_WINDOW(children[i])); S48_VECTOR_SET(v, i, ENTER_WINDOW(children[i]));
} }
ret = s48_cons(v, ret);
ret = s48_cons(ENTER_WINDOW(parent), ret); S48_VECTOR_SET(ret, 0, ENTER_WINDOW(root));
ret = s48_cons(ENTER_WINDOW(root), ret); S48_VECTOR_SET(ret, 1, ENTER_WINDOW(parent));
S48_VECTOR_SET(ret, 2, v);
S48_GC_UNPROTECT(); S48_GC_UNPROTECT();
return ret; return ret;
@ -300,7 +302,7 @@ s48_value Translate_Coordinates (s48_value Xdisplay, s48_value srcXwindow,
s48_value dstXwindow) { s48_value dstXwindow) {
int rx, ry; int rx, ry;
Window child; Window child;
s48_value l; s48_value v = S48_FALSE;
S48_DECLARE_GC_PROTECT(1); S48_DECLARE_GC_PROTECT(1);
@ -312,20 +314,20 @@ s48_value Translate_Coordinates (s48_value Xdisplay, s48_value srcXwindow,
&rx, &ry, &child)) &rx, &ry, &child))
return S48_FALSE; return S48_FALSE;
S48_GC_PROTECT_1 (l); S48_GC_PROTECT_1 (v);
v = s48_make_vector(3, S48_FALSE);
S48_VECTOR_SET(v, 0, s48_enter_integer(rx));
S48_VECTOR_SET(v, 1, s48_enter_integer(ry));
S48_VECTOR_SET(v, 2, ENTER_WINDOW(child));
l = S48_NULL;
l = s48_cons( ENTER_WINDOW(child), l );
l = s48_cons( s48_enter_integer(ry), l );
l = s48_cons( s48_enter_integer(rx), l );
S48_GC_UNPROTECT(); S48_GC_UNPROTECT();
return l; return v;
} }
s48_value Query_Pointer (s48_value Xdisplay, s48_value Xwindow) { s48_value Query_Pointer (s48_value Xdisplay, s48_value Xwindow) {
s48_value l; s48_value v;
Bool ret; Bool ret;
Window root, child; Window root, child;
int r_x, r_y, x, y; int r_x, r_y, x, y;
@ -335,20 +337,20 @@ s48_value Query_Pointer (s48_value Xdisplay, s48_value Xwindow) {
ret = XQueryPointer (EXTRACT_DISPLAY(Xdisplay), EXTRACT_WINDOW(Xwindow), ret = XQueryPointer (EXTRACT_DISPLAY(Xdisplay), EXTRACT_WINDOW(Xwindow),
&root, &child, &r_x, &r_y, &x, &y, &mask); &root, &child, &r_x, &r_y, &x, &y, &mask);
S48_GC_PROTECT_1(l); v = s48_make_vector(8, S48_FALSE);
S48_GC_PROTECT_1(v);
S48_VECTOR_SET(v, 0, s48_enter_integer(x));
S48_VECTOR_SET(v, 1, s48_enter_integer(y));
S48_VECTOR_SET(v, 2, ret ? S48_TRUE : S48_FALSE);
S48_VECTOR_SET(v, 3, ENTER_WINDOW(root));
S48_VECTOR_SET(v, 4, s48_enter_integer(r_x));
S48_VECTOR_SET(v, 5, s48_enter_integer(r_y));
S48_VECTOR_SET(v, 6, ENTER_WINDOW(child));
S48_VECTOR_SET(v, 7, Bits_To_Symbols ((unsigned long)mask, State_Syms));
l = S48_NULL;
l = s48_cons(Bits_To_Symbols ((unsigned long)mask, State_Syms), l);
l = s48_cons(ENTER_WINDOW(child), l);
l = s48_cons(s48_enter_integer(r_y), l);
l = s48_cons(s48_enter_integer(r_x), l);
l = s48_cons(ENTER_WINDOW(root), l);
l = ret ? S48_TRUE : S48_FALSE;
l = s48_cons(s48_enter_integer(y), l);
l = s48_cons(s48_enter_integer(x), l);
S48_GC_UNPROTECT(); S48_GC_UNPROTECT();
return l; return v;
} }
s48_value Get_Geometry(s48_value Xdisplay, s48_value Xdrawable) { s48_value Get_Geometry(s48_value Xdisplay, s48_value Xdrawable) {