Update Unicode docs
[factor/jcg.git] / basis / cocoa / cocoa.factor
blob44252a3b19fd35aa1b6e7314fb91573ff25a62d6
1 ! Copyright (C) 2006 Slava Pestov
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: compiler io kernel cocoa.runtime cocoa.subclassing
4 cocoa.messages cocoa.types sequences words vocabs parser
5 core-foundation.bundles namespaces assocs hashtables
6 compiler.units lexer init ;
7 IN: cocoa
9 : (remember-send) ( selector variable -- )
10     global [ dupd ?set-at ] change-at ;
12 SYMBOL: sent-messages
14 : remember-send ( selector -- )
15     sent-messages (remember-send) ;
17 : ->
18     scan dup remember-send parsed \ send parsed ;
19     parsing
21 SYMBOL: super-sent-messages
23 : remember-super-send ( selector -- )
24     super-sent-messages (remember-send) ;
26 : SUPER->
27     scan dup remember-super-send parsed \ super-send parsed ;
28     parsing
30 SYMBOL: frameworks
32 frameworks global [ V{ } clone or ] change-at
34 [ frameworks get [ load-framework ] each ] "cocoa.messages" add-init-hook
36 : FRAMEWORK: scan [ load-framework ] [ frameworks get push ] bi ; parsing
38 : IMPORT: scan [ ] import-objc-class ; parsing
40 "Compiling Objective C bridge..." print
42 "cocoa.classes" create-vocab drop
45     "cocoa" "cocoa.runtime" "cocoa.messages" "cocoa.subclassing"
46 } [ words ] map concat compile
48 "Importing Cocoa classes..." print
51     {
52         "NSApplication"
53         "NSArray"
54         "NSAutoreleasePool"
55         "NSBundle"
56         "NSData"
57         "NSDictionary"
58         "NSError"
59         "NSEvent"
60         "NSException"
61         "NSMenu"
62         "NSMenuItem"
63         "NSMutableDictionary"
64         "NSNib"
65         "NSNotification"
66         "NSNotificationCenter"
67         "NSNumber"
68         "NSObject"
69         "NSOpenGLContext"
70         "NSOpenGLPixelFormat"
71         "NSOpenGLView"
72         "NSOpenPanel"
73         "NSPasteboard"
74         "NSPropertyListSerialization"
75         "NSResponder"
76         "NSSavePanel"
77         "NSScreen"
78         "NSString"
79         "NSView"
80         "NSWindow"
81         "NSWorkspace"
82     } [
83         [ ] import-objc-class
84     ] each
85 ] with-compilation-unit