2009-05-05 10:40:58 -04:00
|
|
|
! Copyright (C) 2006, 2009 Slava Pestov
|
2007-09-20 18:09:08 -04:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2018-03-13 16:21:21 -04:00
|
|
|
USING: assocs cocoa.messages compiler.units core-foundation.bundles
|
2014-10-31 19:52:40 -04:00
|
|
|
hashtables init io kernel lexer namespaces sequences vocabs ;
|
2007-09-20 18:09:08 -04:00
|
|
|
IN: cocoa
|
|
|
|
|
|
2018-08-04 21:53:05 -04:00
|
|
|
INITIALIZED-SYMBOL: sent-messages [ H{ } clone ]
|
2014-10-31 14:33:19 -04:00
|
|
|
|
2007-09-20 18:09:08 -04:00
|
|
|
: remember-send ( selector -- )
|
2018-03-13 16:21:21 -04:00
|
|
|
dup sent-messages get set-at ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2018-03-23 18:59:10 -04:00
|
|
|
SYNTAX: \send:
|
|
|
|
|
scan-token unescape-token dup remember-send
|
|
|
|
|
[ lookup-method suffix! ] [ suffix! ] bi \ send suffix! ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2018-03-15 12:48:24 -04:00
|
|
|
SYNTAX: \?send:
|
2018-03-19 00:09:46 -04:00
|
|
|
dup last cache-stubs
|
2018-03-15 12:48:24 -04:00
|
|
|
scan-token unescape-token dup remember-send
|
2018-03-23 18:59:10 -04:00
|
|
|
suffix! \ send suffix! ;
|
2017-06-01 12:55:08 -04:00
|
|
|
|
2017-08-27 13:19:37 -04:00
|
|
|
SYNTAX: \selector:
|
2018-08-02 08:21:52 -04:00
|
|
|
scan-token unescape-token
|
|
|
|
|
[ remember-send ]
|
|
|
|
|
[ <selector> suffix! \ cocoa.messages:selector suffix! ] bi ;
|
2013-03-30 16:44:11 -04:00
|
|
|
|
2018-08-04 21:53:05 -04:00
|
|
|
INITIALIZED-SYMBOL: super-sent-messages [ H{ } clone ]
|
2007-09-20 18:09:08 -04:00
|
|
|
|
|
|
|
|
: remember-super-send ( selector -- )
|
2018-03-13 16:21:21 -04:00
|
|
|
dup super-sent-messages get set-at ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2018-03-15 12:48:24 -04:00
|
|
|
SYNTAX: \super:
|
|
|
|
|
scan-token unescape-token dup remember-super-send
|
2018-03-23 18:59:10 -04:00
|
|
|
[ lookup-method suffix! ] [ suffix! ] bi \ super-send suffix! ;
|
2008-10-02 08:10:22 -04:00
|
|
|
|
2018-08-04 21:53:05 -04:00
|
|
|
INITIALIZED-SYMBOL: frameworks [ V{ } clone ]
|
2008-10-02 08:10:22 -04:00
|
|
|
|
2009-10-19 22:17:02 -04:00
|
|
|
[ frameworks get [ load-framework ] each ] "cocoa" add-startup-hook
|
2008-10-02 08:10:22 -04:00
|
|
|
|
2017-08-26 15:20:04 -04:00
|
|
|
SYNTAX: \FRAMEWORK: scan-token [ load-framework ] [ frameworks get push ] bi ;
|
2008-10-02 08:10:22 -04:00
|
|
|
|
2017-08-26 15:20:04 -04:00
|
|
|
SYNTAX: \IMPORT: scan-token [ ] import-objc-class ;
|
2008-10-02 08:10:22 -04:00
|
|
|
|
2009-05-05 10:40:58 -04:00
|
|
|
"Importing Cocoa classes..." print
|
2007-09-20 18:09:08 -04:00
|
|
|
|
|
|
|
|
"cocoa.classes" create-vocab drop
|
|
|
|
|
|
2008-01-09 01:36:11 -05:00
|
|
|
[
|
|
|
|
|
{
|
2010-02-23 22:28:57 -05:00
|
|
|
"NSAlert"
|
2013-10-10 18:52:05 -04:00
|
|
|
"NSAppleScript"
|
2008-01-09 01:36:11 -05:00
|
|
|
"NSApplication"
|
|
|
|
|
"NSArray"
|
|
|
|
|
"NSAutoreleasePool"
|
2010-06-27 15:29:21 -04:00
|
|
|
"NSBitmapImageRep"
|
2008-01-09 01:36:11 -05:00
|
|
|
"NSBundle"
|
2017-05-29 13:36:35 -04:00
|
|
|
"NSButton"
|
2010-06-27 15:29:21 -04:00
|
|
|
"NSColorSpace"
|
2017-05-30 13:09:02 -04:00
|
|
|
"NSCustomTouchBarItem"
|
2008-07-13 15:18:35 -04:00
|
|
|
"NSData"
|
2008-04-05 09:30:02 -04:00
|
|
|
"NSDictionary"
|
2008-01-09 01:36:11 -05:00
|
|
|
"NSError"
|
|
|
|
|
"NSEvent"
|
|
|
|
|
"NSException"
|
|
|
|
|
"NSMenu"
|
|
|
|
|
"NSMenuItem"
|
2008-04-05 09:30:02 -04:00
|
|
|
"NSMutableDictionary"
|
2008-01-09 01:36:11 -05:00
|
|
|
"NSNib"
|
|
|
|
|
"NSNotification"
|
|
|
|
|
"NSNotificationCenter"
|
2008-07-13 15:18:35 -04:00
|
|
|
"NSNumber"
|
2008-01-09 01:36:11 -05:00
|
|
|
"NSObject"
|
|
|
|
|
"NSOpenGLContext"
|
|
|
|
|
"NSOpenGLPixelFormat"
|
|
|
|
|
"NSOpenGLView"
|
|
|
|
|
"NSOpenPanel"
|
2009-06-17 23:47:51 -04:00
|
|
|
"NSPanel"
|
2008-01-09 01:36:11 -05:00
|
|
|
"NSPasteboard"
|
2008-07-19 18:17:12 -04:00
|
|
|
"NSPropertyListSerialization"
|
2008-01-09 01:36:11 -05:00
|
|
|
"NSResponder"
|
|
|
|
|
"NSSavePanel"
|
2008-02-09 03:17:24 -05:00
|
|
|
"NSScreen"
|
2008-07-13 13:42:35 -04:00
|
|
|
"NSString"
|
2017-05-29 13:36:35 -04:00
|
|
|
"NSTouchBar"
|
|
|
|
|
"NSTouchBarItem"
|
2008-01-09 01:36:11 -05:00
|
|
|
"NSView"
|
|
|
|
|
"NSWindow"
|
|
|
|
|
"NSWorkspace"
|
|
|
|
|
} [
|
|
|
|
|
[ ] import-objc-class
|
|
|
|
|
] each
|
|
|
|
|
] with-compilation-unit
|