fixed AList_To_XWindowAttributes, changed all function from returning
lists to returning vectors.
This commit is contained in:
parent
aa52bf5b67
commit
def9eb131a
|
@ -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);
|
||||||
|
|
||||||
l = S48_NULL;
|
v = s48_make_vector(3, S48_FALSE);
|
||||||
l = s48_cons( ENTER_WINDOW(child), l );
|
S48_VECTOR_SET(v, 0, s48_enter_integer(rx));
|
||||||
l = s48_cons( s48_enter_integer(ry), l );
|
S48_VECTOR_SET(v, 1, s48_enter_integer(ry));
|
||||||
l = s48_cons( s48_enter_integer(rx), l );
|
S48_VECTOR_SET(v, 2, ENTER_WINDOW(child));
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
l = S48_NULL;
|
S48_VECTOR_SET(v, 0, s48_enter_integer(x));
|
||||||
l = s48_cons(Bits_To_Symbols ((unsigned long)mask, State_Syms), l);
|
S48_VECTOR_SET(v, 1, s48_enter_integer(y));
|
||||||
l = s48_cons(ENTER_WINDOW(child), l);
|
S48_VECTOR_SET(v, 2, ret ? S48_TRUE : S48_FALSE);
|
||||||
l = s48_cons(s48_enter_integer(r_y), l);
|
S48_VECTOR_SET(v, 3, ENTER_WINDOW(root));
|
||||||
l = s48_cons(s48_enter_integer(r_x), l);
|
S48_VECTOR_SET(v, 4, s48_enter_integer(r_x));
|
||||||
l = s48_cons(ENTER_WINDOW(root), l);
|
S48_VECTOR_SET(v, 5, s48_enter_integer(r_y));
|
||||||
l = ret ? S48_TRUE : S48_FALSE;
|
S48_VECTOR_SET(v, 6, ENTER_WINDOW(child));
|
||||||
l = s48_cons(s48_enter_integer(y), l);
|
S48_VECTOR_SET(v, 7, Bits_To_Symbols ((unsigned long)mask, State_Syms));
|
||||||
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) {
|
||||||
|
|
Loading…
Reference in New Issue