! Copyright (C) 2006, 2010 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types alien.syntax io kernel namespaces
-core-foundation core-foundation.strings cocoa.messages cocoa
-cocoa.classes cocoa.runtime sequences init summary
-kernel.private assocs ;
+USING: alien.c-types alien.syntax cocoa cocoa.classes
+cocoa.runtime core-foundation.strings kernel sequences ;
IN: cocoa.application
: <NSString> ( str -- alien ) <CFString> -> autorelease ;
CONSTANT: NSAnyEventMask 0xffffffff
-FUNCTION: void NSBeep ( ) ;
+FUNCTION: void NSBeep ( )
: with-cocoa ( quot -- )
[ NSApp drop call ] with-autorelease-pool ; inline
-> alloc -> init -> setDelegate: ;
: running.app? ( -- ? )
- #! Test if we're running a .app.
- ".app"
+ ! Test if we're running a .app.
NSBundle -> mainBundle -> bundlePath CF>string
- subseq? ;
+ ".app" subseq-of? ;
: assert.app ( message -- )
running.app? [