- fixed bugs in wait-event, property type

- added atom constants from Xatom.h
This commit is contained in:
frese 2003-03-26 14:43:03 +00:00
parent 9967c456ee
commit c813f7466b
7 changed files with 102 additions and 7 deletions

View File

@ -57,7 +57,8 @@ SCM_FILES = scheme/xlib/display.scm \
scheme/xlib/pixmap.scm \ scheme/xlib/pixmap.scm \
scheme/xlib/visual.scm \ scheme/xlib/visual.scm \
scheme/xlib/client.scm \ scheme/xlib/client.scm \
scheme/xlib/utility.scm scheme/xlib/utility.scm \
scheme/xlib/atom.scm
# scheme/libs/xpm.scm # scheme/libs/xpm.scm
SCM_CONFIG_FILES = scheme/xlib/xlib-interfaces.scm \ SCM_CONFIG_FILES = scheme/xlib/xlib-interfaces.scm \

View File

@ -124,22 +124,26 @@ s48_value scx_enter_property(Atom type, int format, char* data,
S48_GC_PROTECT_2(p, l); S48_GC_PROTECT_2(p, l);
S48_RECORD_SET(p, 0, scx_enter_atom(type)); S48_RECORD_SET(p, 0, scx_enter_atom(type));
S48_RECORD_SET(p, 1, S48_ENTER_ENUM((format >> 3) - 1,
"scx-property-formats"));
switch (format) { switch (format) {
case 8: case 8:
S48_RECORD_SET(p, 1, S48_ENTER_ENUM(0, "scx-property-formats"));
S48_RECORD_SET(p, 2, s48_enter_substring(data, nelements)); S48_RECORD_SET(p, 2, s48_enter_substring(data, nelements));
break; break;
case 16: case 16:
S48_RECORD_SET(p, 1, S48_ENTER_ENUM(1, "scx-property-formats"));
for (i = nelements-1; i >= 0; i--) for (i = nelements-1; i >= 0; i--)
l = s48_cons(s48_enter_integer(((short*)data)[i]), l); l = s48_cons(s48_enter_integer(((short*)data)[i]), l);
S48_RECORD_SET(p, 2, l); S48_RECORD_SET(p, 2, l);
break; break;
case 32: case 32:
S48_RECORD_SET(p, 1, S48_ENTER_ENUM(2, "scx-property-formats"));
for (i = nelements-1; i >= 0; i--) for (i = nelements-1; i >= 0; i--)
l = s48_cons(s48_enter_integer(((long*)data)[i]), l); l = s48_cons(s48_enter_integer(((long*)data)[i]), l);
S48_RECORD_SET(p, 2, l); S48_RECORD_SET(p, 2, l);
break; break;
default: // should not be possible
S48_RECORD_SET(p, 1, s48_enter_integer(format));
S48_RECORD_SET(p, 2, S48_FALSE);
} }
S48_GC_UNPROTECT(); S48_GC_UNPROTECT();
return p; return p;

72
scheme/xlib/atom.scm Normal file
View File

@ -0,0 +1,72 @@
(define (enter-atom x) x)
(define XA_PRIMARY 1)
(define XA_SECONDARY 2)
(define XA_ARC 3)
(define XA_ATOM 4)
(define XA_BITMAP 5)
(define XA_CARDINAL 6)
(define XA_COLORMAP 7)
(define XA_CURSOR 8)
(define XA_CUT_BUFFER0 9)
(define XA_CUT_BUFFER1 10)
(define XA_CUT_BUFFER2 11)
(define XA_CUT_BUFFER3 12)
(define XA_CUT_BUFFER4 13)
(define XA_CUT_BUFFER5 14)
(define XA_CUT_BUFFER6 15)
(define XA_CUT_BUFFER7 16)
(define XA_DRAWABLE 17)
(define XA_FONT 18)
(define XA_INTEGER 19)
(define XA_PIXMAP 20)
(define XA_POINT 21)
(define XA_RECTANGLE 22)
(define XA_RESOURCE_MANAGER 23)
(define XA_RGB_COLOR_MAP 24)
(define XA_RGB_BEST_MAP 25)
(define XA_RGB_BLUE_MAP 26)
(define XA_RGB_DEFAULT_MAP 27)
(define XA_RGB_GRAY_MAP 28)
(define XA_RGB_GREEN_MAP 29)
(define XA_RGB_RED_MAP 30)
(define XA_STRING 31)
(define XA_VISUALID 32)
(define XA_WINDOW 33)
(define XA_WM_COMMAND 34)
(define XA_WM_HINTS 35)
(define XA_WM_CLIENT_MACHINE 36)
(define XA_WM_ICON_NAME 37)
(define XA_WM_ICON_SIZE 38)
(define XA_WM_NAME 39)
(define XA_WM_NORMAL_HINTS 40)
(define XA_WM_SIZE_HINTS 41)
(define XA_WM_ZOOM_HINTS 42)
(define XA_MIN_SPACE 43)
(define XA_NORM_SPACE 44)
(define XA_MAX_SPACE 45)
(define XA_END_SPACE 46)
(define XA_SUPERSCRIPT_X 47)
(define XA_SUPERSCRIPT_Y 48)
(define XA_SUBSCRIPT_X 49)
(define XA_SUBSCRIPT_Y 50)
(define XA_UNDERLINE_POSITION 51)
(define XA_UNDERLINE_THICKNESS 52)
(define XA_STRIKEOUT_ASCENT 53)
(define XA_STRIKEOUT_DESCENT 54)
(define XA_ITALIC_ANGLE 55)
(define XA_X_HEIGHT 56)
(define XA_QUAD_WIDTH 57)
(define XA_WEIGHT 58)
(define XA_POINT_SIZE 59)
(define XA_RESOLUTION 60)
(define XA_COPYRIGHT 61)
(define XA_NOTICE 62)
(define XA_FONT_NAME 63)
(define XA_FAMILY_NAME 64)
(define XA_FULL_NAME 65)
(define XA_CAP_HEIGHT 66)
(define XA_WM_CLASS 67)
(define XA_WM_TRANSIENT_FOR 68)
;;#define XA_LAST_PREDEFINED ((Atom) 68)

View File

@ -8,7 +8,7 @@
(next-event dpy) (next-event dpy)
(begin (begin
;;(sleep-display dpy) ;;(sleep-display dpy)
(block-on-message-inport dpy) (block-on-message-inport dpy 0.1)
(wait-event dpy)))) (wait-event dpy))))
;(define (block-on-message-inport dpy) ; needs ports, locks ;(define (block-on-message-inport dpy) ; needs ports, locks

View File

@ -45,7 +45,7 @@
(define-enumerated-type fill-style :fill-style (define-enumerated-type fill-style :fill-style
fill-style? fill-styles fill-style-name fill-style-index fill-style? fill-styles fill-style-name fill-style-index
(solid tiled strippled opaque-strippled)) (solid tiled stippled opaque-stippled))
(define-exported-binding "scx-fill-style" :fill-style) (define-exported-binding "scx-fill-style" :fill-style)
(define-exported-binding "scx-fill-styles" fill-styles) (define-exported-binding "scx-fill-styles" fill-styles)

View File

@ -798,4 +798,21 @@
parse-geometry parse-geometry
store-buffer store-bytes fetch-buffer fetch-bytes rotate-buffers store-buffer store-bytes fetch-buffer fetch-bytes rotate-buffers
;; atom.scm *******************************************************
((XA_PRIMARY XA_SECONDARY XA_ARC XA_ATOM XA_BITMAP XA_CARDINAL
XA_COLORMAP XA_CURSOR XA_CUT_BUFFER0 XA_CUT_BUFFER1 XA_CUT_BUFFER2
XA_CUT_BUFFER3 XA_CUT_BUFFER4 XA_CUT_BUFFER5 XA_CUT_BUFFER6
XA_CUT_BUFFER7 XA_DRAWABLE XA_FONT XA_INTEGER XA_PIXMAP XA_POINT
XA_RECTANGLE XA_RESOURCE_MANAGER XA_RGB_COLOR_MAP XA_RGB_BEST_MAP
XA_RGB_BLUE_MAP XA_RGB_DEFAULT_MAP XA_RGB_GRAY_MAP XA_RGB_GREEN_MAP
XA_RGB_RED_MAP XA_STRING XA_VISUALID XA_WINDOW XA_WM_COMMAND
XA_WM_HINTS XA_WM_CLIENT_MACHINE XA_WM_ICON_NAME XA_WM_ICON_SIZE
XA_WM_NAME XA_WM_NORMAL_HINTS XA_WM_SIZE_HINTS XA_WM_ZOOM_HINTS
XA_MIN_SPACE XA_NORM_SPACE XA_MAX_SPACE XA_END_SPACE XA_SUPERSCRIPT_X
XA_SUPERSCRIPT_Y XA_SUBSCRIPT_X XA_SUBSCRIPT_Y XA_UNDERLINE_POSITION
XA_UNDERLINE_THICKNESS XA_STRIKEOUT_ASCENT XA_STRIKEOUT_DESCENT
XA_ITALIC_ANGLE XA_X_HEIGHT XA_QUAD_WIDTH XA_WEIGHT XA_POINT_SIZE
XA_RESOLUTION XA_COPYRIGHT XA_NOTICE XA_FONT_NAME XA_FAMILY_NAME
XA_FULL_NAME XA_CAP_HEIGHT XA_WM_CLASS XA_WM_TRANSIENT_FOR)
:number)
)) ))

View File

@ -50,4 +50,5 @@
window window
wm wm
client client
utility)) utility
atom))