Update old accessors from 'ui.cocoa'

db4
dharmatech 2008-09-01 18:57:12 -05:00
parent 2b8f2b3589
commit f958bf4ebc
1 changed files with 13 additions and 13 deletions

View File

@ -24,10 +24,10 @@ TUPLE: pasteboard handle ;
C: <pasteboard> pasteboard C: <pasteboard> pasteboard
M: pasteboard clipboard-contents M: pasteboard clipboard-contents
pasteboard-handle pasteboard-string ; handle>> pasteboard-string ;
M: pasteboard set-clipboard-contents M: pasteboard set-clipboard-contents
pasteboard-handle set-pasteboard-string ; handle>> set-pasteboard-string ;
: init-clipboard ( -- ) : init-clipboard ( -- )
NSPasteboard -> generalPasteboard <pasteboard> NSPasteboard -> generalPasteboard <pasteboard>
@ -47,26 +47,26 @@ M: pasteboard set-clipboard-contents
] keep set-world-handle ; ] keep set-world-handle ;
M: cocoa-ui-backend set-title ( string world -- ) M: cocoa-ui-backend set-title ( string world -- )
world-handle handle-window swap <NSString> -> setTitle: ; world-handle window>> swap <NSString> -> setTitle: ;
: enter-fullscreen ( world -- ) : enter-fullscreen ( world -- )
world-handle handle-view world-handle view>>
NSScreen -> mainScreen NSScreen -> mainScreen
f -> enterFullScreenMode:withOptions: f -> enterFullScreenMode:withOptions:
drop ; drop ;
: exit-fullscreen ( world -- ) : exit-fullscreen ( world -- )
world-handle handle-view f -> exitFullScreenModeWithOptions: ; world-handle view>> f -> exitFullScreenModeWithOptions: ;
M: cocoa-ui-backend set-fullscreen* ( ? world -- ) M: cocoa-ui-backend set-fullscreen* ( ? world -- )
swap [ enter-fullscreen ] [ exit-fullscreen ] if ; swap [ enter-fullscreen ] [ exit-fullscreen ] if ;
M: cocoa-ui-backend fullscreen* ( world -- ? ) M: cocoa-ui-backend fullscreen* ( world -- ? )
world-handle handle-view -> isInFullScreenMode zero? not ; world-handle view>> -> isInFullScreenMode zero? not ;
: auto-position ( world -- ) : auto-position ( world -- )
dup window-loc>> { 0 0 } = [ dup window-loc>> { 0 0 } = [
world-handle handle-window -> center world-handle window>> -> center
] [ ] [
drop drop
] if ; ] if ;
@ -74,29 +74,29 @@ M: cocoa-ui-backend fullscreen* ( world -- ? )
M: cocoa-ui-backend (open-window) ( world -- ) M: cocoa-ui-backend (open-window) ( world -- )
dup gadget-window dup gadget-window
dup auto-position dup auto-position
world-handle handle-window f -> makeKeyAndOrderFront: ; world-handle window>> f -> makeKeyAndOrderFront: ;
M: cocoa-ui-backend (close-window) ( handle -- ) M: cocoa-ui-backend (close-window) ( handle -- )
handle-window -> release ; window>> -> release ;
M: cocoa-ui-backend close-window ( gadget -- ) M: cocoa-ui-backend close-window ( gadget -- )
find-world [ find-world [
world-handle [ world-handle [
handle-window f -> performClose: window>> f -> performClose:
] when* ] when*
] when* ; ] when* ;
M: cocoa-ui-backend raise-window* ( world -- ) M: cocoa-ui-backend raise-window* ( world -- )
world-handle [ world-handle [
handle-window dup f -> orderFront: -> makeKeyWindow window>> dup f -> orderFront: -> makeKeyWindow
NSApp 1 -> activateIgnoringOtherApps: NSApp 1 -> activateIgnoringOtherApps:
] when* ; ] when* ;
M: cocoa-ui-backend select-gl-context ( handle -- ) M: cocoa-ui-backend select-gl-context ( handle -- )
handle-view -> openGLContext -> makeCurrentContext ; view>> -> openGLContext -> makeCurrentContext ;
M: cocoa-ui-backend flush-gl-context ( handle -- ) M: cocoa-ui-backend flush-gl-context ( handle -- )
handle-view -> openGLContext -> flushBuffer ; view>> -> openGLContext -> flushBuffer ;
M: cocoa-ui-backend beep ( -- ) M: cocoa-ui-backend beep ( -- )
NSBeep ; NSBeep ;