Merge branch 'master' of git://factorcode.org/git/factor
commit
ea8c0594ab
|
@ -69,7 +69,7 @@ M: world configure-event
|
||||||
|
|
||||||
: key-down-event>gesture ( event world -- string gesture )
|
: key-down-event>gesture ( event world -- string gesture )
|
||||||
dupd
|
dupd
|
||||||
handle>> x11-handle-xic lookup-string
|
handle>> xic>> lookup-string
|
||||||
>r swap event-modifiers r> key-code <key-down> ;
|
>r swap event-modifiers r> key-code <key-down> ;
|
||||||
|
|
||||||
M: world key-down-event
|
M: world key-down-event
|
||||||
|
@ -116,14 +116,14 @@ M: world motion-event
|
||||||
|
|
||||||
M: world focus-in-event
|
M: world focus-in-event
|
||||||
nip
|
nip
|
||||||
dup handle>> x11-handle-xic XSetICFocus focus-world ;
|
dup handle>> xic>> XSetICFocus focus-world ;
|
||||||
|
|
||||||
M: world focus-out-event
|
M: world focus-out-event
|
||||||
nip
|
nip
|
||||||
dup handle>> x11-handle-xic XUnsetICFocus unfocus-world ;
|
dup handle>> xic>> XUnsetICFocus unfocus-world ;
|
||||||
|
|
||||||
M: world selection-notify-event
|
M: world selection-notify-event
|
||||||
[ handle>> x11-handle-window selection-from-event ] keep
|
[ handle>> window>> selection-from-event ] keep
|
||||||
world-focus user-input ;
|
world-focus user-input ;
|
||||||
|
|
||||||
: supported-type? ( atom -- ? )
|
: supported-type? ( atom -- ? )
|
||||||
|
@ -161,9 +161,9 @@ M: world selection-request-event
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
M: x11-ui-backend (close-window) ( handle -- )
|
M: x11-ui-backend (close-window) ( handle -- )
|
||||||
dup x11-handle-xic XDestroyIC
|
dup xic>> XDestroyIC
|
||||||
dup x11-handle-glx destroy-glx
|
dup glx>> destroy-glx
|
||||||
x11-handle-window dup unregister-window
|
window>> dup unregister-window
|
||||||
destroy-window ;
|
destroy-window ;
|
||||||
|
|
||||||
M: world client-event
|
M: world client-event
|
||||||
|
@ -172,7 +172,7 @@ M: world client-event
|
||||||
: gadget-window ( world -- )
|
: gadget-window ( world -- )
|
||||||
dup window-loc>> over rect-dim glx-window
|
dup window-loc>> over rect-dim glx-window
|
||||||
over "Factor" create-xic <x11-handle>
|
over "Factor" create-xic <x11-handle>
|
||||||
2dup x11-handle-window register-window
|
2dup window>> register-window
|
||||||
swap (>>handle) ;
|
swap (>>handle) ;
|
||||||
|
|
||||||
: wait-event ( -- event )
|
: wait-event ( -- event )
|
||||||
|
@ -189,14 +189,14 @@ M: x11-ui-backend do-events
|
||||||
|
|
||||||
: x-clipboard@ ( gadget clipboard -- prop win )
|
: x-clipboard@ ( gadget clipboard -- prop win )
|
||||||
x-clipboard-atom swap
|
x-clipboard-atom swap
|
||||||
find-world handle>> x11-handle-window ;
|
find-world handle>> window>> ;
|
||||||
|
|
||||||
M: x-clipboard copy-clipboard
|
M: x-clipboard copy-clipboard
|
||||||
[ x-clipboard@ own-selection ] keep
|
[ x-clipboard@ own-selection ] keep
|
||||||
set-x-clipboard-contents ;
|
set-x-clipboard-contents ;
|
||||||
|
|
||||||
M: x-clipboard paste-clipboard
|
M: x-clipboard paste-clipboard
|
||||||
>r find-world handle>> x11-handle-window
|
>r find-world handle>> window>>
|
||||||
r> x-clipboard-atom convert-selection ;
|
r> x-clipboard-atom convert-selection ;
|
||||||
|
|
||||||
: init-clipboard ( -- )
|
: init-clipboard ( -- )
|
||||||
|
@ -212,11 +212,11 @@ M: x-clipboard paste-clipboard
|
||||||
r> utf8 encode dup length XChangeProperty drop ;
|
r> utf8 encode dup length XChangeProperty drop ;
|
||||||
|
|
||||||
M: x11-ui-backend set-title ( string world -- )
|
M: x11-ui-backend set-title ( string world -- )
|
||||||
handle>> x11-handle-window swap dpy get -rot
|
handle>> window>> swap dpy get -rot
|
||||||
3dup set-title-old set-title-new ;
|
3dup set-title-old set-title-new ;
|
||||||
|
|
||||||
M: x11-ui-backend set-fullscreen* ( ? world -- )
|
M: x11-ui-backend set-fullscreen* ( ? world -- )
|
||||||
handle>> x11-handle-window "XClientMessageEvent" <c-object>
|
handle>> window>> "XClientMessageEvent" <c-object>
|
||||||
tuck set-XClientMessageEvent-window
|
tuck set-XClientMessageEvent-window
|
||||||
swap _NET_WM_STATE_ADD _NET_WM_STATE_REMOVE ?
|
swap _NET_WM_STATE_ADD _NET_WM_STATE_REMOVE ?
|
||||||
over set-XClientMessageEvent-data0
|
over set-XClientMessageEvent-data0
|
||||||
|
@ -230,20 +230,20 @@ M: x11-ui-backend set-fullscreen* ( ? world -- )
|
||||||
|
|
||||||
M: x11-ui-backend (open-window) ( world -- )
|
M: x11-ui-backend (open-window) ( world -- )
|
||||||
dup gadget-window
|
dup gadget-window
|
||||||
handle>> x11-handle-window dup set-closable map-window ;
|
handle>> window>> dup set-closable map-window ;
|
||||||
|
|
||||||
M: x11-ui-backend raise-window* ( world -- )
|
M: x11-ui-backend raise-window* ( world -- )
|
||||||
handle>> [
|
handle>> [
|
||||||
dpy get swap x11-handle-window XRaiseWindow drop
|
dpy get swap window>> XRaiseWindow drop
|
||||||
] when* ;
|
] when* ;
|
||||||
|
|
||||||
M: x11-ui-backend select-gl-context ( handle -- )
|
M: x11-ui-backend select-gl-context ( handle -- )
|
||||||
dpy get swap
|
dpy get swap
|
||||||
dup x11-handle-window swap x11-handle-glx glXMakeCurrent
|
dup window>> swap glx>> glXMakeCurrent
|
||||||
[ "Failed to set current GLX context" throw ] unless ;
|
[ "Failed to set current GLX context" throw ] unless ;
|
||||||
|
|
||||||
M: x11-ui-backend flush-gl-context ( handle -- )
|
M: x11-ui-backend flush-gl-context ( handle -- )
|
||||||
dpy get swap x11-handle-window glXSwapBuffers ;
|
dpy get swap window>> glXSwapBuffers ;
|
||||||
|
|
||||||
M: x11-ui-backend ui ( -- )
|
M: x11-ui-backend ui ( -- )
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue