Merge branch 'master' of erg@factorcode.org:/git/factor

db4
Doug Coleman 2009-05-14 15:42:51 -05:00
commit 47b0f1237a
2 changed files with 8 additions and 1 deletions
basis
ui/backend/cocoa

View File

@ -110,10 +110,14 @@ FUNCTION: CGDirectDisplayID CGMainDisplayID ( ) ;
FUNCTION: CGError CGDisplayHideCursor ( CGDirectDisplayID display ) ;
FUNCTION: CGError CGDisplayShowCursor ( CGDirectDisplayID display ) ;
FUNCTION: CGError CGDisplayMoveCursorToPoint ( CGDirectDisplayID display, CGPoint point ) ;
FUNCTION: CGError CGAssociateMouseAndMouseCursorPosition ( boolean_t connected ) ;
FUNCTION: CGError CGWarpMouseCursorPosition ( CGPoint newCursorPosition ) ;
FUNCTION: uint GetCurrentButtonState ( ) ;
<PRIVATE
: bitmap-flags ( -- flags )

View File

@ -126,7 +126,10 @@ M: cocoa-ui-backend (grab-input) ( handle -- )
0 CGAssociateMouseAndMouseCursorPosition drop
CGMainDisplayID CGDisplayHideCursor drop
window>> -> frame CGRect>rect rect-center
first2 <CGPoint> CGWarpMouseCursorPosition drop ;
NSScreen -> screens 0 -> objectAtIndex: -> frame CGRect-h
[ drop first ] [ swap second - ] 2bi <CGPoint>
[ GetCurrentButtonState zero? not ] [ yield ] while
CGWarpMouseCursorPosition drop ;
M: cocoa-ui-backend (ungrab-input) ( handle -- )
drop