2001-05-08 10:21:00 -04:00
|
|
|
#include "xlib.h"
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
unsigned long Attribs_To_XSetWindowAttributes(s48_value attribs,
|
|
|
|
XSetWindowAttributes* Xattrs) {
|
|
|
|
int i; unsigned long mask = 0;
|
|
|
|
for (i=0; i<15; i++) {
|
|
|
|
s48_value value = S48_VECTOR_REF(attribs, i);
|
|
|
|
if (S48_FALSE != value) {
|
|
|
|
switch (i) {
|
|
|
|
case 0: Xattrs->background_pixmap =
|
|
|
|
S48_SYMBOL_P(value) ? ParentRelative : SCX_EXTRACT_PIXMAP(value);
|
|
|
|
mask |= CWBackPixmap;
|
|
|
|
break;
|
|
|
|
case 1: Xattrs->background_pixel = s48_extract_integer(value);
|
|
|
|
mask |= CWBackPixel;
|
|
|
|
break;
|
|
|
|
case 2: Xattrs->border_pixmap =
|
|
|
|
S48_SYMBOL_P(value) ? CopyFromParent : s48_extract_integer(value);
|
|
|
|
mask |= CWBorderPixmap;
|
|
|
|
break;
|
|
|
|
case 3: Xattrs->border_pixel = s48_extract_integer(value);
|
|
|
|
mask |= CWBitGravity;
|
|
|
|
break;
|
|
|
|
case 4: Xattrs->bit_gravity = Symbol_To_Bit(value, Bit_Grav_Syms);
|
|
|
|
mask |= CWBitGravity;
|
|
|
|
break;
|
|
|
|
case 5: Xattrs->win_gravity = Symbol_To_Bit(value, Grav_Syms);
|
|
|
|
mask |= CWWinGravity;
|
|
|
|
break;
|
|
|
|
case 6: Xattrs->backing_store = Symbol_To_Bit(value, Backing_Store_Syms);
|
|
|
|
mask |= CWBackingStore;
|
|
|
|
break;
|
|
|
|
case 7: Xattrs->backing_planes = s48_extract_integer(value);
|
|
|
|
mask |= CWBackingPlanes;
|
|
|
|
break;
|
|
|
|
case 8: Xattrs->backing_pixel = s48_extract_integer(value);
|
|
|
|
mask |= CWBackingPixel;
|
|
|
|
break;
|
|
|
|
case 9: Xattrs->override_redirect = s48_extract_integer(value);
|
|
|
|
mask |= CWOverrideRedirect;
|
|
|
|
break;
|
|
|
|
case 10: Xattrs->save_under = s48_extract_integer(value);
|
|
|
|
mask |= CWSaveUnder;
|
|
|
|
break;
|
|
|
|
case 11: Xattrs->event_mask = Symbols_To_Bits(value, Event_Mask_Syms);
|
|
|
|
mask |= CWEventMask;
|
|
|
|
break;
|
|
|
|
case 12: Xattrs->do_not_propagate_mask =
|
|
|
|
Symbols_To_Bits(value, Event_Mask_Syms);
|
|
|
|
mask |= CWDontPropagate;
|
|
|
|
break;
|
|
|
|
case 13: Xattrs->colormap = s48_extract_integer(value);
|
|
|
|
mask |= CWColormap;
|
|
|
|
break;
|
|
|
|
case 14: Xattrs->cursor = s48_extract_integer(value);
|
|
|
|
mask |= CWCursor;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2001-06-11 11:25:39 -04:00
|
|
|
}
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
return mask;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
s48_value scx_Create_Window (s48_value Xdisplay, s48_value Xparent,
|
|
|
|
s48_value x, s48_value y,
|
|
|
|
s48_value width, s48_value height,
|
|
|
|
s48_value border_width, s48_value depth,
|
|
|
|
s48_value class, s48_value Xvisual,
|
|
|
|
s48_value attribs) {
|
2001-06-11 11:25:39 -04:00
|
|
|
Window win;
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
XSetWindowAttributes Xattrs;
|
|
|
|
unsigned long mask = Attribs_To_XSetWindowAttributes( attribs, &Xattrs );
|
|
|
|
int dep = S48_FALSE_P(depth) ? CopyFromParent : s48_extract_integer(depth);
|
|
|
|
int cla = 0;
|
2001-09-20 10:41:01 -04:00
|
|
|
Visual* vis = S48_FALSE_P(Xvisual) ? CopyFromParent :
|
|
|
|
SCX_EXTRACT_VISUAL(Xvisual);
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
|
|
|
|
switch (s48_extract_integer(class)) {
|
|
|
|
case 0: cla = InputOutput;
|
|
|
|
case 1: cla = InputOnly;
|
|
|
|
case 2: cla = CopyFromParent;
|
|
|
|
}
|
|
|
|
|
|
|
|
win = XCreateWindow( SCX_EXTRACT_DISPLAY(Xdisplay),
|
|
|
|
SCX_EXTRACT_WINDOW(Xparent),
|
2001-06-27 09:44:48 -04:00
|
|
|
(int)s48_extract_integer(x),
|
2001-06-11 11:25:39 -04:00
|
|
|
(int)s48_extract_integer(y),
|
|
|
|
(int)s48_extract_integer (width),
|
|
|
|
(int)s48_extract_integer (height),
|
|
|
|
(int)s48_extract_integer (border_width),
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
dep, cla, vis,
|
|
|
|
mask,&Xattrs );
|
2001-07-31 10:51:21 -04:00
|
|
|
return SCX_ENTER_WINDOW(win);
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Destroy_Window (s48_value Xdisplay, s48_value Xwindow) {
|
|
|
|
XDestroyWindow (SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow));
|
2001-06-11 11:25:39 -04:00
|
|
|
return S48_UNSPECIFIC;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Change_Window_Attributes(s48_value Xwindow, s48_value Xdisplay,
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
s48_value attribs) {
|
2001-05-08 10:21:00 -04:00
|
|
|
|
2001-06-11 11:25:39 -04:00
|
|
|
XSetWindowAttributes Xattrs;
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
unsigned long mask = Attribs_To_XSetWindowAttributes( attribs, &Xattrs );
|
|
|
|
|
|
|
|
XChangeWindowAttributes(SCX_EXTRACT_DISPLAY(Xdisplay),
|
|
|
|
SCX_EXTRACT_WINDOW(Xwindow),
|
|
|
|
mask, &Xattrs);
|
2001-06-11 11:25:39 -04:00
|
|
|
|
|
|
|
return S48_UNSPECIFIC;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Get_Window_Attributes(s48_value Xdisplay, s48_value Xwindow) {
|
2001-06-11 11:25:39 -04:00
|
|
|
XWindowAttributes WA;
|
2001-05-08 10:21:00 -04:00
|
|
|
|
2001-06-11 11:25:39 -04:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
2001-05-08 10:21:00 -04:00
|
|
|
|
2001-06-11 11:25:39 -04:00
|
|
|
s48_value res = S48_NULL;
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
if (!XGetWindowAttributes(SCX_EXTRACT_DISPLAY(Xdisplay),SCX_EXTRACT_WINDOW(Xwindow),
|
2001-06-27 09:44:48 -04:00
|
|
|
&WA))
|
2001-06-25 07:46:06 -04:00
|
|
|
res = S48_FALSE;
|
|
|
|
else {
|
2001-06-27 09:44:48 -04:00
|
|
|
S48_GC_PROTECT_1(res);
|
2001-06-11 11:25:39 -04:00
|
|
|
|
2001-06-27 09:44:48 -04:00
|
|
|
res = s48_make_vector(23, S48_FALSE);
|
|
|
|
|
|
|
|
S48_VECTOR_SET(res, 0, s48_enter_integer(WA.x));
|
|
|
|
S48_VECTOR_SET(res, 1, s48_enter_integer(WA.y));
|
|
|
|
S48_VECTOR_SET(res, 2, s48_enter_integer(WA.width));
|
|
|
|
S48_VECTOR_SET(res, 3, s48_enter_integer(WA.height));
|
|
|
|
S48_VECTOR_SET(res, 4, s48_enter_integer(WA.border_width));
|
|
|
|
S48_VECTOR_SET(res, 5, s48_enter_integer(WA.depth));
|
2001-07-31 10:51:21 -04:00
|
|
|
S48_VECTOR_SET(res, 6, SCX_ENTER_VISUAL(WA.visual));
|
|
|
|
S48_VECTOR_SET(res, 7, SCX_ENTER_WINDOW(WA.root));
|
2001-06-27 09:44:48 -04:00
|
|
|
S48_VECTOR_SET(res, 8, Bit_To_Symbol(WA.class, Class_Syms));
|
|
|
|
S48_VECTOR_SET(res, 9, Bit_To_Symbol(WA.bit_gravity, Bit_Grav_Syms));
|
|
|
|
S48_VECTOR_SET(res, 10, Bit_To_Symbol(WA.win_gravity, Grav_Syms));
|
|
|
|
S48_VECTOR_SET(res, 11, Bit_To_Symbol(WA.backing_store,
|
|
|
|
Backing_Store_Syms));
|
|
|
|
S48_VECTOR_SET(res, 12, s48_enter_integer(WA.backing_planes));
|
2001-07-31 10:51:21 -04:00
|
|
|
S48_VECTOR_SET(res, 13, SCX_ENTER_PIXEL(WA.backing_pixel));
|
2001-06-27 09:44:48 -04:00
|
|
|
S48_VECTOR_SET(res, 14, WA.save_under ? S48_TRUE : S48_FALSE );
|
2001-07-31 10:51:21 -04:00
|
|
|
S48_VECTOR_SET(res, 15, SCX_ENTER_COLORMAP( WA.colormap ));
|
2001-06-27 09:44:48 -04:00
|
|
|
S48_VECTOR_SET(res, 16, WA.map_installed ? S48_TRUE : S48_FALSE);
|
|
|
|
S48_VECTOR_SET(res, 17, Bit_To_Symbol( WA.map_state, Map_State_Syms));
|
2001-07-16 07:52:01 -04:00
|
|
|
S48_VECTOR_SET(res, 18, Bits_To_Symbols( WA.all_event_masks,
|
|
|
|
Event_Mask_Syms ));
|
|
|
|
S48_VECTOR_SET(res, 19, Bits_To_Symbols( WA.your_event_mask,
|
|
|
|
Event_Mask_Syms ));
|
|
|
|
S48_VECTOR_SET(res, 20, Bits_To_Symbols( WA.do_not_propagate_mask,
|
|
|
|
Event_Mask_Syms ));
|
2001-06-27 09:44:48 -04:00
|
|
|
S48_VECTOR_SET(res, 21, WA.override_redirect ? S48_TRUE : S48_FALSE);
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
|
|
|
|
S48_VECTOR_SET(res, 22, S48_FALSE);
|
|
|
|
//S48_VECTOR_SET(res, 22, s48_enter_integer((long)WA.screen));
|
|
|
|
// WA.screen not yet supported
|
2001-06-25 07:46:06 -04:00
|
|
|
}
|
2001-06-11 11:25:39 -04:00
|
|
|
|
|
|
|
S48_GC_UNPROTECT();
|
|
|
|
return res;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
s48_value Changes_To_XWindowChanges(s48_value changes, XWindowChanges* WC) {
|
|
|
|
int i; unsigned long mask = 0;
|
|
|
|
for (i=0; i<7; i++) {
|
|
|
|
s48_value value = S48_VECTOR_REF(changes, i);
|
|
|
|
if (S48_FALSE != value) {
|
|
|
|
switch (i) {
|
|
|
|
case 0: WC->x = s48_extract_integer(value);
|
|
|
|
mask |= CWX;
|
|
|
|
break;
|
|
|
|
case 2: WC->y = s48_extract_integer(value);
|
|
|
|
mask |= CWY;
|
|
|
|
break;
|
|
|
|
case 3: WC->width = s48_extract_integer(value);
|
|
|
|
mask |= CWWidth;
|
|
|
|
break;
|
|
|
|
case 4: WC->height = s48_extract_integer(value);
|
|
|
|
mask |= CWHeight;
|
|
|
|
break;
|
|
|
|
case 5: WC->sibling = SCX_EXTRACT_WINDOW(value);
|
|
|
|
mask |= CWSibling;
|
|
|
|
break;
|
|
|
|
case 6: WC->stack_mode = Symbol_To_Bit(value, Stack_Mode_Syms);
|
|
|
|
mask |= CWStackMode;
|
|
|
|
break;
|
|
|
|
}
|
2001-06-11 11:25:39 -04:00
|
|
|
}
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
}
|
2001-08-21 04:26:54 -04:00
|
|
|
return mask;
|
|
|
|
}
|
|
|
|
|
|
|
|
s48_value scx_Configure_Window (s48_value Xwindow, s48_value Xdisplay,
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
s48_value changes) {
|
2001-08-21 04:26:54 -04:00
|
|
|
XWindowChanges WC;
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
unsigned long mask = Changes_To_XWindowChanges(changes, &WC);
|
2001-06-11 11:25:39 -04:00
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
XConfigureWindow (SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow),
|
2001-06-27 09:44:48 -04:00
|
|
|
mask, &WC);
|
2001-06-11 11:25:39 -04:00
|
|
|
return S48_UNSPECIFIC;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Map_Window(s48_value Xwindow, s48_value Xdisplay) {
|
|
|
|
XMapWindow(SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow));
|
2001-06-11 11:25:39 -04:00
|
|
|
return S48_UNSPECIFIC;
|
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Unmap_Window(s48_value Xwindow, s48_value Xdisplay) {
|
|
|
|
XUnmapWindow(SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow));
|
2001-06-11 11:25:39 -04:00
|
|
|
return S48_UNSPECIFIC;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Destroy_Subwindows (s48_value Xwindow, s48_value Xdisplay) {
|
|
|
|
XDestroySubwindows(SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow));
|
2001-06-11 11:25:39 -04:00
|
|
|
return S48_UNSPECIFIC;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Map_Subwindows (s48_value Xwindow, s48_value Xdisplay) {
|
|
|
|
XMapSubwindows(SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow));
|
2001-06-11 11:25:39 -04:00
|
|
|
return S48_UNSPECIFIC;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Unmap_Subwindows (s48_value Xwindow, s48_value Xdisplay) {
|
|
|
|
XUnmapSubwindows(SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow));
|
2001-06-11 11:25:39 -04:00
|
|
|
return S48_UNSPECIFIC;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Circulate_Subwindows(s48_value Xwindow, s48_value Xdisplay,
|
2001-06-11 11:25:39 -04:00
|
|
|
s48_value dir) {
|
2001-07-31 10:51:21 -04:00
|
|
|
XCirculateSubwindows(SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow),
|
2001-06-27 09:44:48 -04:00
|
|
|
S48_FALSE_P(dir) ? RaiseLowest : LowerHighest);
|
2001-06-11 11:25:39 -04:00
|
|
|
return S48_UNSPECIFIC;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Query_Tree (s48_value Xwindow, s48_value Xdisplay) {
|
2001-06-27 09:44:48 -04:00
|
|
|
Window root, parent, *children;
|
|
|
|
int i;
|
|
|
|
unsigned n;
|
2001-05-08 10:21:00 -04:00
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value v = S48_FALSE, ret = S48_FALSE;
|
2001-06-27 09:44:48 -04:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
XQueryTree (SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow),
|
2001-06-27 09:44:48 -04:00
|
|
|
&root, &parent, &children, &n);
|
|
|
|
|
2001-07-30 10:22:22 -04:00
|
|
|
ret = s48_make_vector(3, S48_FALSE);
|
|
|
|
v = S48_FALSE;
|
2001-06-27 09:44:48 -04:00
|
|
|
|
2001-07-30 10:22:22 -04:00
|
|
|
S48_GC_PROTECT_2 (v, ret);
|
2001-06-27 09:44:48 -04:00
|
|
|
|
|
|
|
// vector of child-windows
|
|
|
|
v = s48_make_vector (n, S48_FALSE);
|
|
|
|
for (i = 0; i < n; i++) {
|
2001-07-31 10:51:21 -04:00
|
|
|
S48_VECTOR_SET(v, i, SCX_ENTER_WINDOW(children[i]));
|
2001-06-27 09:44:48 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
S48_VECTOR_SET(ret, 0, SCX_ENTER_WINDOW(root));
|
|
|
|
S48_VECTOR_SET(ret, 1, SCX_ENTER_WINDOW(parent));
|
2001-07-30 10:22:22 -04:00
|
|
|
S48_VECTOR_SET(ret, 2, v);
|
2001-06-27 09:44:48 -04:00
|
|
|
|
|
|
|
S48_GC_UNPROTECT();
|
|
|
|
return ret;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Translate_Coordinates (s48_value Xdisplay, s48_value srcXwindow,
|
2001-06-27 09:44:48 -04:00
|
|
|
s48_value x, s48_value y,
|
|
|
|
s48_value dstXwindow) {
|
|
|
|
int rx, ry;
|
|
|
|
Window child;
|
2001-07-30 10:22:22 -04:00
|
|
|
s48_value v = S48_FALSE;
|
2001-06-27 09:44:48 -04:00
|
|
|
|
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
if (!XTranslateCoordinates (SCX_EXTRACT_DISPLAY(Xdisplay),
|
|
|
|
SCX_EXTRACT_WINDOW(srcXwindow),
|
|
|
|
SCX_EXTRACT_WINDOW(dstXwindow),
|
2001-06-27 09:44:48 -04:00
|
|
|
(int)s48_extract_integer (x),
|
|
|
|
(int)s48_extract_integer (y),
|
|
|
|
&rx, &ry, &child))
|
|
|
|
return S48_FALSE;
|
|
|
|
|
2001-07-30 10:22:22 -04:00
|
|
|
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));
|
2001-07-31 10:51:21 -04:00
|
|
|
S48_VECTOR_SET(v, 2, SCX_ENTER_WINDOW(child));
|
2001-06-27 09:44:48 -04:00
|
|
|
|
|
|
|
S48_GC_UNPROTECT();
|
2001-07-30 10:22:22 -04:00
|
|
|
return v;
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Query_Pointer (s48_value Xdisplay, s48_value Xwindow) {
|
2001-06-11 11:25:39 -04:00
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value v = S48_FALSE;
|
2001-06-27 09:44:48 -04:00
|
|
|
Bool ret;
|
|
|
|
Window root, child;
|
|
|
|
int r_x, r_y, x, y;
|
|
|
|
unsigned int mask;
|
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
ret = XQueryPointer (SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_WINDOW(Xwindow),
|
2001-06-27 09:44:48 -04:00
|
|
|
&root, &child, &r_x, &r_y, &x, &y, &mask);
|
|
|
|
|
2001-07-30 10:22:22 -04:00
|
|
|
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);
|
2001-07-31 10:51:21 -04:00
|
|
|
S48_VECTOR_SET(v, 3, SCX_ENTER_WINDOW(root));
|
2001-07-30 10:22:22 -04:00
|
|
|
S48_VECTOR_SET(v, 4, s48_enter_integer(r_x));
|
|
|
|
S48_VECTOR_SET(v, 5, s48_enter_integer(r_y));
|
2001-07-31 10:51:21 -04:00
|
|
|
S48_VECTOR_SET(v, 6, SCX_ENTER_WINDOW(child));
|
2001-07-30 10:22:22 -04:00
|
|
|
S48_VECTOR_SET(v, 7, Bits_To_Symbols ((unsigned long)mask, State_Syms));
|
|
|
|
|
2001-06-27 09:44:48 -04:00
|
|
|
S48_GC_UNPROTECT();
|
2001-07-30 10:22:22 -04:00
|
|
|
return v;
|
2001-06-27 09:44:48 -04:00
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
s48_value scx_Get_Geometry(s48_value Xdisplay, s48_value Xdrawable) {
|
|
|
|
s48_value v = S48_FALSE;
|
2001-07-19 11:34:22 -04:00
|
|
|
Window root;
|
|
|
|
unsigned int x,y,width,height,border_width,depth;
|
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
XGetGeometry(SCX_EXTRACT_DISPLAY(Xdisplay), SCX_EXTRACT_DRAWABLE(Xdrawable),
|
2001-07-19 11:34:22 -04:00
|
|
|
&root, &x, &y, &width, &height, &border_width, &depth);
|
|
|
|
|
|
|
|
v = s48_make_vector(7, S48_FALSE);
|
|
|
|
S48_GC_PROTECT_1(v);
|
2001-07-31 10:51:21 -04:00
|
|
|
S48_VECTOR_SET(v, 0, SCX_ENTER_WINDOW(root));
|
2001-07-19 11:34:22 -04:00
|
|
|
S48_VECTOR_SET(v, 1, s48_enter_integer(x));
|
|
|
|
S48_VECTOR_SET(v, 2, s48_enter_integer(y));
|
|
|
|
S48_VECTOR_SET(v, 3, s48_enter_integer(width));
|
|
|
|
S48_VECTOR_SET(v, 4, s48_enter_integer(height));
|
|
|
|
S48_VECTOR_SET(v, 5, s48_enter_integer(border_width));
|
|
|
|
S48_VECTOR_SET(v, 6, s48_enter_integer(depth));
|
|
|
|
S48_GC_UNPROTECT();
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|
2001-07-31 10:51:21 -04:00
|
|
|
void scx_init_window(void) {
|
|
|
|
S48_EXPORT_FUNCTION(scx_Create_Window);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Destroy_Window);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Change_Window_Attributes);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Get_Window_Attributes);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Configure_Window);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Map_Window);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Unmap_Window);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Destroy_Subwindows);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Map_Subwindows);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Unmap_Subwindows);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Circulate_Subwindows);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Query_Tree);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Translate_Coordinates);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Query_Pointer);
|
|
|
|
S48_EXPORT_FUNCTION(scx_Get_Geometry);
|
2001-05-08 10:21:00 -04:00
|
|
|
}
|