Mouse events now work in X11 backend
parent
3c55513324
commit
b40168c416
|
@ -3,14 +3,26 @@ USING: arrays errors freetype gadgets gadgets-launchpad
|
||||||
gadgets-layouts gadgets-listener hashtables kernel
|
gadgets-layouts gadgets-listener hashtables kernel
|
||||||
kernel-internals math namespaces opengl sequences x11 ;
|
kernel-internals math namespaces opengl sequences x11 ;
|
||||||
|
|
||||||
M: world handle-expose-event ( event world -- ) nip draw-world ;
|
M: world expose-event ( event world -- ) nip draw-world ;
|
||||||
|
|
||||||
M: world handle-resize-event ( event world -- )
|
M: world resize-event ( event world -- )
|
||||||
>r
|
>r
|
||||||
dup XConfigureEvent-width swap XConfigureEvent-height 0
|
dup XConfigureEvent-width swap XConfigureEvent-height 0
|
||||||
3array
|
3array
|
||||||
r> set-gadget-dim ;
|
r> set-gadget-dim ;
|
||||||
|
|
||||||
|
M: world button-down-event ( event world -- )
|
||||||
|
drop XButtonEvent-button send-button-down ;
|
||||||
|
|
||||||
|
M: world button-up-event ( event world -- )
|
||||||
|
drop XButtonEvent-button send-button-up ;
|
||||||
|
|
||||||
|
M: world motion-event ( event world -- )
|
||||||
|
>r dup XMotionEvent-x swap XMotionEvent-y 0 3array r>
|
||||||
|
move-hand ;
|
||||||
|
|
||||||
|
M: world key-event ( event world -- ) 2drop ;
|
||||||
|
|
||||||
: gadget-window ( world -- window )
|
: gadget-window ( world -- window )
|
||||||
dup rect-dim first2 choose-visual [
|
dup rect-dim first2 choose-visual [
|
||||||
create-window 2dup windows get set-hash dup map-window
|
create-window 2dup windows get set-hash dup map-window
|
||||||
|
@ -43,4 +55,4 @@ IN: shells
|
||||||
|
|
||||||
IN: kernel
|
IN: kernel
|
||||||
|
|
||||||
! : default-shell "DISPLAY" getenv empty? "tty" "ui" ? ;
|
! : default-shell "DISPLAY" os-env empty? "tty" "ui" ? ;
|
||||||
|
|
|
@ -17,12 +17,20 @@ SYMBOL: root
|
||||||
dpy get root get rot XVisualInfo-visual AllocNone
|
dpy get root get rot XVisualInfo-visual AllocNone
|
||||||
XCreateColormap ;
|
XCreateColormap ;
|
||||||
|
|
||||||
|
: event-mask ( -- n )
|
||||||
|
StructureNotifyMask ExposureMask bitor
|
||||||
|
KeyPressMask bitor
|
||||||
|
KeyReleaseMask bitor
|
||||||
|
ButtonPressMask bitor
|
||||||
|
ButtonReleaseMask bitor
|
||||||
|
PointerMotionMask bitor ;
|
||||||
|
|
||||||
: window-attributes ( visinfo -- attributes )
|
: window-attributes ( visinfo -- attributes )
|
||||||
"XSetWindowAttributes" <c-object>
|
"XSetWindowAttributes" <c-object>
|
||||||
0 over set-XSetWindowAttributes-background_pixel
|
0 over set-XSetWindowAttributes-background_pixel
|
||||||
0 over set-XSetWindowAttributes-border_pixel
|
0 over set-XSetWindowAttributes-border_pixel
|
||||||
[ >r create-colormap r> set-XSetWindowAttributes-colormap ] keep
|
[ >r create-colormap r> set-XSetWindowAttributes-colormap ] keep
|
||||||
StructureNotifyMask ExposureMask bitor over set-XSetWindowAttributes-event_mask ;
|
event-mask over set-XSetWindowAttributes-event_mask ;
|
||||||
|
|
||||||
: create-window ( w h visinfo -- window )
|
: create-window ( w h visinfo -- window )
|
||||||
>r >r >r dpy get root get 0 0 r> r> 0 r>
|
>r >r >r dpy get root get 0 0 r> r> 0 r>
|
||||||
|
@ -69,14 +77,26 @@ SYMBOL: root
|
||||||
QueuedAfterFlush events-queued 0 >
|
QueuedAfterFlush events-queued 0 >
|
||||||
[ next-event ] [ ui-step wait-event ] if ;
|
[ next-event ] [ ui-step wait-event ] if ;
|
||||||
|
|
||||||
GENERIC: handle-expose-event ( event window -- )
|
GENERIC: expose-event ( event window -- )
|
||||||
|
|
||||||
GENERIC: handle-resize-event ( event window -- )
|
GENERIC: resize-event ( event window -- )
|
||||||
|
|
||||||
|
GENERIC: button-down-event ( event window -- )
|
||||||
|
|
||||||
|
GENERIC: button-up-event ( event window -- )
|
||||||
|
|
||||||
|
GENERIC: motion-event ( event window -- )
|
||||||
|
|
||||||
|
GENERIC: key-event ( event window -- )
|
||||||
|
|
||||||
: handle-event ( event window -- )
|
: handle-event ( event window -- )
|
||||||
over XAnyEvent-type {
|
over XAnyEvent-type {
|
||||||
{ [ dup Expose = ] [ drop handle-expose-event ] }
|
{ [ dup Expose = ] [ drop expose-event ] }
|
||||||
{ [ dup ConfigureNotify = ] [ drop handle-resize-event ] }
|
{ [ dup ConfigureNotify = ] [ drop resize-event ] }
|
||||||
|
{ [ dup ButtonPress = ] [ drop button-down-event ] }
|
||||||
|
{ [ dup ButtonRelease = ] [ drop button-up-event ] }
|
||||||
|
{ [ dup MotionNotify = ] [ drop motion-event ] }
|
||||||
|
{ [ dup KeyPress = ] [ drop key-event ] }
|
||||||
{ [ t ] [ 3drop ] }
|
{ [ t ] [ 3drop ] }
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
|
|
|
@ -80,21 +80,21 @@ FUNCTION: int XCloseDisplay ( Display* display ) ;
|
||||||
|
|
||||||
! 3.2 - Window Attributes
|
! 3.2 - Window Attributes
|
||||||
|
|
||||||
: CWBackPixmap 1 0 shift ;
|
: CWBackPixmap 1 0 shift ; inline
|
||||||
: CWBackPixel 1 1 shift ;
|
: CWBackPixel 1 1 shift ; inline
|
||||||
: CWBorderPixmap 1 2 shift ;
|
: CWBorderPixmap 1 2 shift ; inline
|
||||||
: CWBorderPixel 1 3 shift ;
|
: CWBorderPixel 1 3 shift ; inline
|
||||||
: CWBitGravity 1 4 shift ;
|
: CWBitGravity 1 4 shift ; inline
|
||||||
: CWWinGravity 1 5 shift ;
|
: CWWinGravity 1 5 shift ; inline
|
||||||
: CWBackingStore 1 6 shift ;
|
: CWBackingStore 1 6 shift ; inline
|
||||||
: CWBackingPlanes 1 7 shift ;
|
: CWBackingPlanes 1 7 shift ; inline
|
||||||
: CWBackingPixel 1 8 shift ;
|
: CWBackingPixel 1 8 shift ; inline
|
||||||
: CWOverrideRedirect 1 9 shift ;
|
: CWOverrideRedirect 1 9 shift ; inline
|
||||||
: CWSaveUnder 1 10 shift ;
|
: CWSaveUnder 1 10 shift ; inline
|
||||||
: CWEventMask 1 11 shift ;
|
: CWEventMask 1 11 shift ; inline
|
||||||
: CWDontPropagate 1 12 shift ;
|
: CWDontPropagate 1 12 shift ; inline
|
||||||
: CWColormap 1 13 shift ;
|
: CWColormap 1 13 shift ; inline
|
||||||
: CWCursor 1 14 shift ;
|
: CWCursor 1 14 shift ; inline
|
||||||
|
|
||||||
BEGIN-STRUCT: XSetWindowAttributes
|
BEGIN-STRUCT: XSetWindowAttributes
|
||||||
FIELD: Pixmap background_pixmap
|
FIELD: Pixmap background_pixmap
|
||||||
|
@ -114,19 +114,19 @@ BEGIN-STRUCT: XSetWindowAttributes
|
||||||
FIELD: Cursor cursor
|
FIELD: Cursor cursor
|
||||||
END-STRUCT
|
END-STRUCT
|
||||||
|
|
||||||
: UnmapGravity 0 ;
|
: UnmapGravity 0 ; inline
|
||||||
|
|
||||||
: ForgetGravity 0 ;
|
: ForgetGravity 0 ; inline
|
||||||
: NorthWestGravity 1 ;
|
: NorthWestGravity 1 ; inline
|
||||||
: NorthGravity 2 ;
|
: NorthGravity 2 ; inline
|
||||||
: NorthEastGravity 3 ;
|
: NorthEastGravity 3 ; inline
|
||||||
: WestGravity 4 ;
|
: WestGravity 4 ; inline
|
||||||
: CenterGravity 5 ;
|
: CenterGravity 5 ; inline
|
||||||
: EastGravity 6 ;
|
: EastGravity 6 ; inline
|
||||||
: SouthWestGravity 7 ;
|
: SouthWestGravity 7 ; inline
|
||||||
: SouthGravity 8 ;
|
: SouthGravity 8 ; inline
|
||||||
: SouthEastGravity 9 ;
|
: SouthEastGravity 9 ; inline
|
||||||
: StaticGravity 10 ;
|
: StaticGravity 10 ; inline
|
||||||
|
|
||||||
! 3.3 - Creating Windows
|
! 3.3 - Creating Windows
|
||||||
|
|
||||||
|
@ -144,13 +144,13 @@ FUNCTION: int XMapRaised ( Display* display, Window w ) ;
|
||||||
|
|
||||||
! 3.7 - Configuring Windows
|
! 3.7 - Configuring Windows
|
||||||
|
|
||||||
: CWX 1 0 shift ;
|
: CWX 1 0 shift ; inline
|
||||||
: CWY 1 1 shift ;
|
: CWY 1 1 shift ; inline
|
||||||
: CWWidth 1 2 shift ;
|
: CWWidth 1 2 shift ; inline
|
||||||
: CWHeight 1 3 shift ;
|
: CWHeight 1 3 shift ; inline
|
||||||
: CWBorderWidth 1 4 shift ;
|
: CWBorderWidth 1 4 shift ; inline
|
||||||
: CWSibling 1 5 shift ;
|
: CWSibling 1 5 shift ; inline
|
||||||
: CWStackMode 1 6 shift ;
|
: CWStackMode 1 6 shift ; inline
|
||||||
|
|
||||||
BEGIN-STRUCT: XWindowChanges
|
BEGIN-STRUCT: XWindowChanges
|
||||||
FIELD: int x
|
FIELD: int x
|
||||||
|
@ -221,9 +221,9 @@ END-STRUCT
|
||||||
|
|
||||||
FUNCTION: Status XGetWindowAttributes ( Display* display, Window w, XWindowAttributes* attr ) ;
|
FUNCTION: Status XGetWindowAttributes ( Display* display, Window w, XWindowAttributes* attr ) ;
|
||||||
|
|
||||||
: IsUnmapped 0 ;
|
: IsUnmapped 0 ; inline
|
||||||
: IsUnviewable 1 ;
|
: IsUnviewable 1 ; inline
|
||||||
: IsViewable 2 ;
|
: IsViewable 2 ; inline
|
||||||
|
|
||||||
FUNCTION: Status XGetGeometry (
|
FUNCTION: Status XGetGeometry (
|
||||||
Display* display,
|
Display* display,
|
||||||
|
@ -285,46 +285,46 @@ FUNCTION: Colormap XCreateColormap ( Display* display, Window w, Visual* visual,
|
||||||
! 7 - Graphics Context Functions
|
! 7 - Graphics Context Functions
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: GCFunction 1 0 shift ;
|
: GCFunction 1 0 shift ; inline
|
||||||
: GCPlaneMask 1 1 shift ;
|
: GCPlaneMask 1 1 shift ; inline
|
||||||
: GCForeground 1 2 shift ;
|
: GCForeground 1 2 shift ; inline
|
||||||
: GCBackground 1 3 shift ;
|
: GCBackground 1 3 shift ; inline
|
||||||
: GCLineWidth 1 4 shift ;
|
: GCLineWidth 1 4 shift ; inline
|
||||||
: GCLineStyle 1 5 shift ;
|
: GCLineStyle 1 5 shift ; inline
|
||||||
: GCCapStyle 1 6 shift ;
|
: GCCapStyle 1 6 shift ; inline
|
||||||
: GCJoinStyle 1 7 shift ;
|
: GCJoinStyle 1 7 shift ; inline
|
||||||
: GCFillStyle 1 8 shift ;
|
: GCFillStyle 1 8 shift ; inline
|
||||||
: GCFillRule 1 9 shift ;
|
: GCFillRule 1 9 shift ; inline
|
||||||
: GCTile 1 10 shift ;
|
: GCTile 1 10 shift ; inline
|
||||||
: GCStipple 1 11 shift ;
|
: GCStipple 1 11 shift ; inline
|
||||||
: GCTileStipXOrigin 1 12 shift ;
|
: GCTileStipXOrigin 1 12 shift ; inline
|
||||||
: GCTileStipYOrigin 1 13 shift ;
|
: GCTileStipYOrigin 1 13 shift ; inline
|
||||||
: GCFont 1 14 shift ;
|
: GCFont 1 14 shift ; inline
|
||||||
: GCSubwindowMode 1 15 shift ;
|
: GCSubwindowMode 1 15 shift ; inline
|
||||||
: GCGraphicsExposures 1 16 shift ;
|
: GCGraphicsExposures 1 16 shift ; inline
|
||||||
: GCClipXOrigin 1 17 shift ;
|
: GCClipXOrigin 1 17 shift ; inline
|
||||||
: GCClipYOrigin 1 18 shift ;
|
: GCClipYOrigin 1 18 shift ; inline
|
||||||
: GCClipMask 1 19 shift ;
|
: GCClipMask 1 19 shift ; inline
|
||||||
: GCDashOffset 1 20 shift ;
|
: GCDashOffset 1 20 shift ; inline
|
||||||
: GCDashList 1 21 shift ;
|
: GCDashList 1 21 shift ; inline
|
||||||
: GCArcMode 1 22 shift ;
|
: GCArcMode 1 22 shift ; inline
|
||||||
|
|
||||||
: GXclear HEX: 0 ;
|
: GXclear HEX: 0 ; inline
|
||||||
: GXand HEX: 1 ;
|
: GXand HEX: 1 ; inline
|
||||||
: GXandReverse HEX: 2 ;
|
: GXandReverse HEX: 2 ; inline
|
||||||
: GXcopy HEX: 3 ;
|
: GXcopy HEX: 3 ; inline
|
||||||
: GXandInverted HEX: 4 ;
|
: GXandInverted HEX: 4 ; inline
|
||||||
: GXnoop HEX: 5 ;
|
: GXnoop HEX: 5 ; inline
|
||||||
: GXxor HEX: 6 ;
|
: GXxor HEX: 6 ; inline
|
||||||
: GXor HEX: 7 ;
|
: GXor HEX: 7 ; inline
|
||||||
: GXnor HEX: 8 ;
|
: GXnor HEX: 8 ; inline
|
||||||
: GXequiv HEX: 9 ;
|
: GXequiv HEX: 9 ; inline
|
||||||
: GXinvert HEX: a ;
|
: GXinvert HEX: a ; inline
|
||||||
: GXorReverse HEX: b ;
|
: GXorReverse HEX: b ; inline
|
||||||
: GXcopyInverted HEX: c ;
|
: GXcopyInverted HEX: c ; inline
|
||||||
: GXorInverted HEX: d ;
|
: GXorInverted HEX: d ; inline
|
||||||
: GXnand HEX: e ;
|
: GXnand HEX: e ; inline
|
||||||
: GXset HEX: f ;
|
: GXset HEX: f ; inline
|
||||||
|
|
||||||
BEGIN-STRUCT: XGCValues
|
BEGIN-STRUCT: XGCValues
|
||||||
FIELD: int function
|
FIELD: int function
|
||||||
|
@ -360,8 +360,8 @@ FUNCTION: Status XSetBackground ( Display* display, GC gc, ulong background ) ;
|
||||||
FUNCTION: Status XSetFunction ( Display* display, GC gc, int function ) ;
|
FUNCTION: Status XSetFunction ( Display* display, GC gc, int function ) ;
|
||||||
FUNCTION: Status XSetSubwindowMode ( Display* display, GC gc, int subwindow_mode ) ;
|
FUNCTION: Status XSetSubwindowMode ( Display* display, GC gc, int subwindow_mode ) ;
|
||||||
|
|
||||||
: ClipByChildren 0 ;
|
: ClipByChildren 0 ; inline
|
||||||
: IncludeInferiors 1 ;
|
: IncludeInferiors 1 ; inline
|
||||||
|
|
||||||
FUNCTION: Status XSetFont ( Display* display, GC gc, Font font ) ;
|
FUNCTION: Status XSetFont ( Display* display, GC gc, Font font ) ;
|
||||||
|
|
||||||
|
@ -439,67 +439,67 @@ FUNCTION: Status XKillClient ( Display* display, XID resource ) ;
|
||||||
|
|
||||||
! 10.3 - Event Masks
|
! 10.3 - Event Masks
|
||||||
|
|
||||||
: NoEventMask 0 ;
|
: NoEventMask 0 ; inline
|
||||||
: KeyPressMask 1 0 shift ;
|
: KeyPressMask 1 0 shift ; inline
|
||||||
: KeyReleaseMask 1 1 shift ;
|
: KeyReleaseMask 1 1 shift ; inline
|
||||||
: ButtonPressMask 1 2 shift ;
|
: ButtonPressMask 1 2 shift ; inline
|
||||||
: ButtonReleaseMask 1 3 shift ;
|
: ButtonReleaseMask 1 3 shift ; inline
|
||||||
: EnterWindowMask 1 4 shift ;
|
: EnterWindowMask 1 4 shift ; inline
|
||||||
: LeaveWindowMask 1 5 shift ;
|
: LeaveWindowMask 1 5 shift ; inline
|
||||||
: PointerMotionMask 1 6 shift ;
|
: PointerMotionMask 1 6 shift ; inline
|
||||||
: PointerMotionHintMask 1 7 shift ;
|
: PointerMotionHintMask 1 7 shift ; inline
|
||||||
: Button1MotionMask 1 8 shift ;
|
: Button1MotionMask 1 8 shift ; inline
|
||||||
: Button2MotionMask 1 9 shift ;
|
: Button2MotionMask 1 9 shift ; inline
|
||||||
: Button3MotionMask 1 10 shift ;
|
: Button3MotionMask 1 10 shift ; inline
|
||||||
: Button4MotionMask 1 11 shift ;
|
: Button4MotionMask 1 11 shift ; inline
|
||||||
: Button5MotionMask 1 12 shift ;
|
: Button5MotionMask 1 12 shift ; inline
|
||||||
: ButtonMotionMask 1 13 shift ;
|
: ButtonMotionMask 1 13 shift ; inline
|
||||||
: KeymapStateMask 1 14 shift ;
|
: KeymapStateMask 1 14 shift ; inline
|
||||||
: ExposureMask 1 15 shift ;
|
: ExposureMask 1 15 shift ; inline
|
||||||
: VisibilityChangeMask 1 16 shift ;
|
: VisibilityChangeMask 1 16 shift ; inline
|
||||||
: StructureNotifyMask 1 17 shift ;
|
: StructureNotifyMask 1 17 shift ; inline
|
||||||
: ResizeRedirectMask 1 18 shift ;
|
: ResizeRedirectMask 1 18 shift ; inline
|
||||||
: SubstructureNotifyMask 1 19 shift ;
|
: SubstructureNotifyMask 1 19 shift ; inline
|
||||||
: SubstructureRedirectMask 1 20 shift ;
|
: SubstructureRedirectMask 1 20 shift ; inline
|
||||||
: FocusChangeMask 1 21 shift ;
|
: FocusChangeMask 1 21 shift ; inline
|
||||||
: PropertyChangeMask 1 22 shift ;
|
: PropertyChangeMask 1 22 shift ; inline
|
||||||
: ColormapChangeMask 1 23 shift ;
|
: ColormapChangeMask 1 23 shift ; inline
|
||||||
: OwnerGrabButtonMask 1 24 shift ;
|
: OwnerGrabButtonMask 1 24 shift ; inline
|
||||||
|
|
||||||
: KeyPress 2 ;
|
: KeyPress 2 ; inline
|
||||||
: KeyRelease 3 ;
|
: KeyRelease 3 ; inline
|
||||||
: ButtonPress 4 ;
|
: ButtonPress 4 ; inline
|
||||||
: ButtonRelease 5 ;
|
: ButtonRelease 5 ; inline
|
||||||
: MotionNotify 6 ;
|
: MotionNotify 6 ; inline
|
||||||
: EnterNotify 7 ;
|
: EnterNotify 7 ; inline
|
||||||
: LeaveNotify 8 ;
|
: LeaveNotify 8 ; inline
|
||||||
: FocusIn 9 ;
|
: FocusIn 9 ; inline
|
||||||
: FocusOut 10 ;
|
: FocusOut 10 ; inline
|
||||||
: KeymapNotify 11 ;
|
: KeymapNotify 11 ; inline
|
||||||
: Expose 12 ;
|
: Expose 12 ; inline
|
||||||
: GraphicsExpose 13 ;
|
: GraphicsExpose 13 ; inline
|
||||||
: NoExpose 14 ;
|
: NoExpose 14 ; inline
|
||||||
: VisibilityNotify 15 ;
|
: VisibilityNotify 15 ; inline
|
||||||
: CreateNotify 16 ;
|
: CreateNotify 16 ; inline
|
||||||
: DestroyNotify 17 ;
|
: DestroyNotify 17 ; inline
|
||||||
: UnmapNotify 18 ;
|
: UnmapNotify 18 ; inline
|
||||||
: MapNotify 19 ;
|
: MapNotify 19 ; inline
|
||||||
: MapRequest 20 ;
|
: MapRequest 20 ; inline
|
||||||
: ReparentNotify 21 ;
|
: ReparentNotify 21 ; inline
|
||||||
: ConfigureNotify 22 ;
|
: ConfigureNotify 22 ; inline
|
||||||
: ConfigureRequest 23 ;
|
: ConfigureRequest 23 ; inline
|
||||||
: GravityNotify 24 ;
|
: GravityNotify 24 ; inline
|
||||||
: ResizeRequest 25 ;
|
: ResizeRequest 25 ; inline
|
||||||
: CirculateNotify 26 ;
|
: CirculateNotify 26 ; inline
|
||||||
: CirculateRequest 27 ;
|
: CirculateRequest 27 ; inline
|
||||||
: PropertyNotify 28 ;
|
: PropertyNotify 28 ; inline
|
||||||
: SelectionClear 29 ;
|
: SelectionClear 29 ; inline
|
||||||
: SelectionRequest 30 ;
|
: SelectionRequest 30 ; inline
|
||||||
: SelectionNotify 31 ;
|
: SelectionNotify 31 ; inline
|
||||||
: ColormapNotify 32 ;
|
: ColormapNotify 32 ; inline
|
||||||
: ClientMessage 33 ;
|
: ClientMessage 33 ; inline
|
||||||
: MappingNotify 34 ;
|
: MappingNotify 34 ; inline
|
||||||
: LASTEvent 35 ;
|
: LASTEvent 35 ; inline
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -515,26 +515,26 @@ END-STRUCT
|
||||||
|
|
||||||
! 10.5 Keyboard and Pointer Events
|
! 10.5 Keyboard and Pointer Events
|
||||||
|
|
||||||
: Button1 1 ;
|
: Button1 1 ; inline
|
||||||
: Button2 2 ;
|
: Button2 2 ; inline
|
||||||
: Button3 3 ;
|
: Button3 3 ; inline
|
||||||
: Button4 4 ;
|
: Button4 4 ; inline
|
||||||
: Button5 5 ;
|
: Button5 5 ; inline
|
||||||
|
|
||||||
: Button1Mask 1 8 shift ;
|
: Button1Mask 1 8 shift ; inline
|
||||||
: Button2Mask 1 9 shift ;
|
: Button2Mask 1 9 shift ; inline
|
||||||
: Button3Mask 1 10 shift ;
|
: Button3Mask 1 10 shift ; inline
|
||||||
: Button4Mask 1 11 shift ;
|
: Button4Mask 1 11 shift ; inline
|
||||||
: Button5Mask 1 12 shift ;
|
: Button5Mask 1 12 shift ; inline
|
||||||
|
|
||||||
: ShiftMask 1 0 shift ;
|
: ShiftMask 1 0 shift ; inline
|
||||||
: LockMask 1 1 shift ;
|
: LockMask 1 1 shift ; inline
|
||||||
: ControlMask 1 2 shift ;
|
: ControlMask 1 2 shift ; inline
|
||||||
: Mod1Mask 1 3 shift ;
|
: Mod1Mask 1 3 shift ; inline
|
||||||
: Mod2Mask 1 4 shift ;
|
: Mod2Mask 1 4 shift ; inline
|
||||||
: Mod3Mask 1 5 shift ;
|
: Mod3Mask 1 5 shift ; inline
|
||||||
: Mod4Mask 1 6 shift ;
|
: Mod4Mask 1 6 shift ; inline
|
||||||
: Mod5Mask 1 7 shift ;
|
: Mod5Mask 1 7 shift ; inline
|
||||||
|
|
||||||
BEGIN-STRUCT: XButtonEvent
|
BEGIN-STRUCT: XButtonEvent
|
||||||
FIELD: int type
|
FIELD: int type
|
||||||
|
@ -557,12 +557,6 @@ END-STRUCT
|
||||||
TYPEDEF: XButtonEvent XButtonPressedEvent
|
TYPEDEF: XButtonEvent XButtonPressedEvent
|
||||||
TYPEDEF: XButtonEvent XButtonReleasedEvent
|
TYPEDEF: XButtonEvent XButtonReleasedEvent
|
||||||
|
|
||||||
: XButtonEvent-position ( event -- { x y } )
|
|
||||||
dup XButtonEvent-x swap XButtonEvent-y 2array ;
|
|
||||||
|
|
||||||
: XButtonEvent-root-position ( event -- { x y } )
|
|
||||||
dup XButtonEvent-x swap XButtonEvent-y 2array ;
|
|
||||||
|
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
@ -1081,9 +1075,9 @@ FUNCTION: Status XMaskEvent ( Display* display, long event_mask, XEvent* event_r
|
||||||
|
|
||||||
! 11.3 - Event Queue Management
|
! 11.3 - Event Queue Management
|
||||||
|
|
||||||
: QueuedAlready 0 ;
|
: QueuedAlready 0 ; inline
|
||||||
: QueuedAfterReading 1 ;
|
: QueuedAfterReading 1 ; inline
|
||||||
: QueuedAfterFlush 2 ;
|
: QueuedAfterFlush 2 ; inline
|
||||||
|
|
||||||
FUNCTION: int XEventsQueued ( Display* display, int mode ) ;
|
FUNCTION: int XEventsQueued ( Display* display, int mode ) ;
|
||||||
FUNCTION: int XPending ( Display* display ) ;
|
FUNCTION: int XPending ( Display* display ) ;
|
||||||
|
@ -1100,15 +1094,15 @@ FUNCTION: int XSetErrorHandler ( void* handler ) ;
|
||||||
! 12 - Input Device Functions
|
! 12 - Input Device Functions
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: None 0 ;
|
: None 0 ; inline
|
||||||
: PointerRoot 1 ;
|
: PointerRoot 1 ; inline
|
||||||
|
|
||||||
: RevertToNone None ;
|
: RevertToNone None ; inline
|
||||||
: RevertToPointerRoot PointerRoot ;
|
: RevertToPointerRoot PointerRoot ; inline
|
||||||
: RevertToParent 2 ;
|
: RevertToParent 2 ; inline
|
||||||
|
|
||||||
: GrabModeSync 0 ;
|
: GrabModeSync 0 ; inline
|
||||||
: GrabModeAsync 1 ;
|
: GrabModeAsync 1 ; inline
|
||||||
|
|
||||||
|
|
||||||
FUNCTION: int XGrabPointer (
|
FUNCTION: int XGrabPointer (
|
||||||
|
@ -1143,18 +1137,18 @@ FUNCTION: Status XGetTransientForHint ( Display* display, Window w, Window* prop
|
||||||
|
|
||||||
! 17.1.7 - Setting and Reading the WM_NORMAL_HINTS Property
|
! 17.1.7 - Setting and Reading the WM_NORMAL_HINTS Property
|
||||||
|
|
||||||
: USPosition 1 0 shift ;
|
: USPosition 1 0 shift ; inline
|
||||||
: USSize 1 1 shift ;
|
: USSize 1 1 shift ; inline
|
||||||
: PPosition 1 2 shift ;
|
: PPosition 1 2 shift ; inline
|
||||||
: PSize 1 3 shift ;
|
: PSize 1 3 shift ; inline
|
||||||
: PMinSize 1 4 shift ;
|
: PMinSize 1 4 shift ; inline
|
||||||
: PMaxSize 1 5 shift ;
|
: PMaxSize 1 5 shift ; inline
|
||||||
: PResizeInc 1 6 shift ;
|
: PResizeInc 1 6 shift ; inline
|
||||||
: PAspect 1 7 shift ;
|
: PAspect 1 7 shift ; inline
|
||||||
: PBaseSize 1 8 shift ;
|
: PBaseSize 1 8 shift ; inline
|
||||||
: PWinGravity 1 9 shift ;
|
: PWinGravity 1 9 shift ; inline
|
||||||
: PAllHints [ PPosition PSize PMinSize PMaxSize PResizeInc PAspect ]
|
: PAllHints [ PPosition PSize PMinSize PMaxSize PResizeInc PAspect ]
|
||||||
0 [ execute bitor ] reduce ;
|
0 [ execute bitor ] reduce ; inline
|
||||||
|
|
||||||
BEGIN-STRUCT: XSizeHints
|
BEGIN-STRUCT: XSizeHints
|
||||||
FIELD: long flags
|
FIELD: long flags
|
||||||
|
@ -1194,17 +1188,17 @@ FUNCTION: int XLookupString (
|
||||||
|
|
||||||
! 16.7 Determining the Appropriate Visual Type
|
! 16.7 Determining the Appropriate Visual Type
|
||||||
|
|
||||||
: VisualNoMask HEX: 0 ;
|
: VisualNoMask HEX: 0 ; inline
|
||||||
: VisualIDMask HEX: 1 ;
|
: VisualIDMask HEX: 1 ; inline
|
||||||
: VisualScreenMask HEX: 2 ;
|
: VisualScreenMask HEX: 2 ; inline
|
||||||
: VisualDepthMask HEX: 4 ;
|
: VisualDepthMask HEX: 4 ; inline
|
||||||
: VisualClassMask HEX: 8 ;
|
: VisualClassMask HEX: 8 ; inline
|
||||||
: VisualRedMaskMask HEX: 10 ;
|
: VisualRedMaskMask HEX: 10 ; inline
|
||||||
: VisualGreenMaskMask HEX: 20 ;
|
: VisualGreenMaskMask HEX: 20 ; inline
|
||||||
: VisualBlueMaskMask HEX: 40 ;
|
: VisualBlueMaskMask HEX: 40 ; inline
|
||||||
: VisualColormapSizeMask HEX: 80 ;
|
: VisualColormapSizeMask HEX: 80 ; inline
|
||||||
: VisualBitsPerRGBMask HEX: 100 ;
|
: VisualBitsPerRGBMask HEX: 100 ; inline
|
||||||
: VisualAllMask HEX: 1FF ;
|
: VisualAllMask HEX: 1FF ; inline
|
||||||
|
|
||||||
BEGIN-STRUCT: XVisualInfo
|
BEGIN-STRUCT: XVisualInfo
|
||||||
FIELD: Visual* visual
|
FIELD: Visual* visual
|
||||||
|
@ -1235,79 +1229,79 @@ FUNCTION: Status XSetStandardProperties (
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: CurrentTime 0 ;
|
: CurrentTime 0 ; inline
|
||||||
|
|
||||||
: XA_PRIMARY 1 ;
|
: XA_PRIMARY 1 ; inline
|
||||||
: XA_SECONDARY 2 ;
|
: XA_SECONDARY 2 ; inline
|
||||||
: XA_ARC 3 ;
|
: XA_ARC 3 ; inline
|
||||||
: XA_ATOM 4 ;
|
: XA_ATOM 4 ; inline
|
||||||
: XA_BITMAP 5 ;
|
: XA_BITMAP 5 ; inline
|
||||||
: XA_CARDINAL 6 ;
|
: XA_CARDINAL 6 ; inline
|
||||||
: XA_COLORMAP 7 ;
|
: XA_COLORMAP 7 ; inline
|
||||||
: XA_CURSOR 8 ;
|
: XA_CURSOR 8 ; inline
|
||||||
: XA_CUT_BUFFER0 9 ;
|
: XA_CUT_BUFFER0 9 ; inline
|
||||||
: XA_CUT_BUFFER1 10 ;
|
: XA_CUT_BUFFER1 10 ; inline
|
||||||
: XA_CUT_BUFFER2 11 ;
|
: XA_CUT_BUFFER2 11 ; inline
|
||||||
: XA_CUT_BUFFER3 12 ;
|
: XA_CUT_BUFFER3 12 ; inline
|
||||||
: XA_CUT_BUFFER4 13 ;
|
: XA_CUT_BUFFER4 13 ; inline
|
||||||
: XA_CUT_BUFFER5 14 ;
|
: XA_CUT_BUFFER5 14 ; inline
|
||||||
: XA_CUT_BUFFER6 15 ;
|
: XA_CUT_BUFFER6 15 ; inline
|
||||||
: XA_CUT_BUFFER7 16 ;
|
: XA_CUT_BUFFER7 16 ; inline
|
||||||
: XA_DRAWABLE 17 ;
|
: XA_DRAWABLE 17 ; inline
|
||||||
: XA_FONT 18 ;
|
: XA_FONT 18 ; inline
|
||||||
: XA_INTEGER 19 ;
|
: XA_INTEGER 19 ; inline
|
||||||
: XA_PIXMAP 20 ;
|
: XA_PIXMAP 20 ; inline
|
||||||
: XA_POINT 21 ;
|
: XA_POINT 21 ; inline
|
||||||
: XA_RECTANGLE 22 ;
|
: XA_RECTANGLE 22 ; inline
|
||||||
: XA_RESOURCE_MANAGER 23 ;
|
: XA_RESOURCE_MANAGER 23 ; inline
|
||||||
: XA_RGB_COLOR_MAP 24 ;
|
: XA_RGB_COLOR_MAP 24 ; inline
|
||||||
: XA_RGB_BEST_MAP 25 ;
|
: XA_RGB_BEST_MAP 25 ; inline
|
||||||
: XA_RGB_BLUE_MAP 26 ;
|
: XA_RGB_BLUE_MAP 26 ; inline
|
||||||
: XA_RGB_DEFAULT_MAP 27 ;
|
: XA_RGB_DEFAULT_MAP 27 ; inline
|
||||||
: XA_RGB_GRAY_MAP 28 ;
|
: XA_RGB_GRAY_MAP 28 ; inline
|
||||||
: XA_RGB_GREEN_MAP 29 ;
|
: XA_RGB_GREEN_MAP 29 ; inline
|
||||||
: XA_RGB_RED_MAP 30 ;
|
: XA_RGB_RED_MAP 30 ; inline
|
||||||
: XA_STRING 31 ;
|
: XA_STRING 31 ; inline
|
||||||
: XA_VISUALID 32 ;
|
: XA_VISUALID 32 ; inline
|
||||||
: XA_WINDOW 33 ;
|
: XA_WINDOW 33 ; inline
|
||||||
: XA_WM_COMMAND 34 ;
|
: XA_WM_COMMAND 34 ; inline
|
||||||
: XA_WM_HINTS 35 ;
|
: XA_WM_HINTS 35 ; inline
|
||||||
: XA_WM_CLIENT_MACHINE 36 ;
|
: XA_WM_CLIENT_MACHINE 36 ; inline
|
||||||
: XA_WM_ICON_NAME 37 ;
|
: XA_WM_ICON_NAME 37 ; inline
|
||||||
: XA_WM_ICON_SIZE 38 ;
|
: XA_WM_ICON_SIZE 38 ; inline
|
||||||
: XA_WM_NAME 39 ;
|
: XA_WM_NAME 39 ; inline
|
||||||
: XA_WM_NORMAL_HINTS 40 ;
|
: XA_WM_NORMAL_HINTS 40 ; inline
|
||||||
: XA_WM_SIZE_HINTS 41 ;
|
: XA_WM_SIZE_HINTS 41 ; inline
|
||||||
: XA_WM_ZOOM_HINTS 42 ;
|
: XA_WM_ZOOM_HINTS 42 ; inline
|
||||||
: XA_MIN_SPACE 43 ;
|
: XA_MIN_SPACE 43 ; inline
|
||||||
: XA_NORM_SPACE 44 ;
|
: XA_NORM_SPACE 44 ; inline
|
||||||
: XA_MAX_SPACE 45 ;
|
: XA_MAX_SPACE 45 ; inline
|
||||||
: XA_END_SPACE 46 ;
|
: XA_END_SPACE 46 ; inline
|
||||||
: XA_SUPERSCRIPT_X 47 ;
|
: XA_SUPERSCRIPT_X 47 ; inline
|
||||||
: XA_SUPERSCRIPT_Y 48 ;
|
: XA_SUPERSCRIPT_Y 48 ; inline
|
||||||
: XA_SUBSCRIPT_X 49 ;
|
: XA_SUBSCRIPT_X 49 ; inline
|
||||||
: XA_SUBSCRIPT_Y 50 ;
|
: XA_SUBSCRIPT_Y 50 ; inline
|
||||||
: XA_UNDERLINE_POSITION 51 ;
|
: XA_UNDERLINE_POSITION 51 ; inline
|
||||||
: XA_UNDERLINE_THICKNESS 52 ;
|
: XA_UNDERLINE_THICKNESS 52 ; inline
|
||||||
: XA_STRIKEOUT_ASCENT 53 ;
|
: XA_STRIKEOUT_ASCENT 53 ; inline
|
||||||
: XA_STRIKEOUT_DESCENT 54 ;
|
: XA_STRIKEOUT_DESCENT 54 ; inline
|
||||||
: XA_ITALIC_ANGLE 55 ;
|
: XA_ITALIC_ANGLE 55 ; inline
|
||||||
: XA_X_HEIGHT 56 ;
|
: XA_X_HEIGHT 56 ; inline
|
||||||
: XA_QUAD_WIDTH 57 ;
|
: XA_QUAD_WIDTH 57 ; inline
|
||||||
: XA_WEIGHT 58 ;
|
: XA_WEIGHT 58 ; inline
|
||||||
: XA_POINT_SIZE 59 ;
|
: XA_POINT_SIZE 59 ; inline
|
||||||
: XA_RESOLUTION 60 ;
|
: XA_RESOLUTION 60 ; inline
|
||||||
: XA_COPYRIGHT 61 ;
|
: XA_COPYRIGHT 61 ; inline
|
||||||
: XA_NOTICE 62 ;
|
: XA_NOTICE 62 ; inline
|
||||||
: XA_FONT_NAME 63 ;
|
: XA_FONT_NAME 63 ; inline
|
||||||
: XA_FAMILY_NAME 64 ;
|
: XA_FAMILY_NAME 64 ; inline
|
||||||
: XA_FULL_NAME 65 ;
|
: XA_FULL_NAME 65 ; inline
|
||||||
: XA_CAP_HEIGHT 66 ;
|
: XA_CAP_HEIGHT 66 ; inline
|
||||||
: XA_WM_CLASS 67 ;
|
: XA_WM_CLASS 67 ; inline
|
||||||
: XA_WM_TRANSIENT_FOR 68 ;
|
: XA_WM_TRANSIENT_FOR 68 ; inline
|
||||||
|
|
||||||
: XA_LAST_PREDEFINED 68 ;
|
: XA_LAST_PREDEFINED 68 ; inline
|
||||||
|
|
||||||
: PropModeReplace 0 ;
|
: PropModeReplace 0 ; inline
|
||||||
: PropModePrepend 1 ;
|
: PropModePrepend 1 ; inline
|
||||||
: PropModeAppend 2 ;
|
: PropModeAppend 2 ; inline
|
||||||
|
|
Loading…
Reference in New Issue