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.
|
2014-10-31 14:33:19 -04:00
|
|
|
USING: cocoa.messages compiler.units core-foundation.bundles
|
2014-10-31 19:52:40 -04:00
|
|
|
hashtables init io kernel lexer namespaces sequences vocabs ;
|
2015-08-12 09:49:02 -04:00
|
|
|
QUALIFIED: cocoa.messages
|
2007-09-20 18:09:08 -04:00
|
|
|
IN: cocoa
|
|
|
|
|
|
|
|
SYMBOL: sent-messages
|
|
|
|
|
2014-10-31 19:52:40 -04:00
|
|
|
: (remember-send) ( selector variable -- )
|
|
|
|
[ dupd ?set-at ] change-global ;
|
2014-10-31 14:33:19 -04:00
|
|
|
|
2007-09-20 18:09:08 -04:00
|
|
|
: remember-send ( selector -- )
|
2014-10-31 19:52:40 -04:00
|
|
|
sent-messages (remember-send) ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2011-09-27 16:20:07 -04:00
|
|
|
SYNTAX: -> scan-token dup remember-send suffix! \ send suffix! ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2013-03-30 16:44:11 -04:00
|
|
|
SYNTAX: SEL:
|
|
|
|
scan-token
|
|
|
|
[ remember-send ]
|
2015-08-12 09:49:02 -04:00
|
|
|
[ <selector> suffix! \ cocoa.messages:selector suffix! ] bi ;
|
2013-03-30 16:44:11 -04:00
|
|
|
|
2007-09-20 18:09:08 -04:00
|
|
|
SYMBOL: super-sent-messages
|
|
|
|
|
|
|
|
: remember-super-send ( selector -- )
|
2014-10-31 19:52:40 -04:00
|
|
|
super-sent-messages (remember-send) ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2011-09-27 16:20:07 -04:00
|
|
|
SYNTAX: SUPER-> scan-token dup remember-super-send suffix! \ super-send suffix! ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2008-10-02 08:10:22 -04:00
|
|
|
SYMBOL: frameworks
|
|
|
|
|
2009-02-10 17:16:12 -05:00
|
|
|
frameworks [ V{ } clone ] initialize
|
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
|
|
|
|
2011-09-27 16:20:07 -04:00
|
|
|
SYNTAX: FRAMEWORK: scan-token [ load-framework ] [ frameworks get push ] bi ;
|
2008-10-02 08:10:22 -04:00
|
|
|
|
2011-09-27 16:20:07 -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"
|
2010-06-27 15:29:21 -04:00
|
|
|
"NSColorSpace"
|
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"
|
2008-01-09 01:36:11 -05:00
|
|
|
"NSView"
|
|
|
|
"NSWindow"
|
|
|
|
"NSWorkspace"
|
|
|
|
} [
|
|
|
|
[ ] import-objc-class
|
|
|
|
] each
|
|
|
|
] with-compilation-unit
|