]> gitweb.factorcode.org Git - factor.git/blob - basis/cocoa/cocoa.factor
Create basis vocab root
[factor.git] / basis / cocoa / cocoa.factor
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 namespaces assocs hashtables compiler.units
6 lexer ;
7 IN: cocoa
8
9 : (remember-send) ( selector variable -- )
10     global [ dupd ?set-at ] change-at ;
11
12 SYMBOL: sent-messages
13
14 : remember-send ( selector -- )
15     sent-messages (remember-send) ;
16
17 : ->
18     scan dup remember-send parsed \ send parsed ;
19     parsing
20
21 SYMBOL: super-sent-messages
22
23 : remember-super-send ( selector -- )
24     super-sent-messages (remember-send) ;
25
26 : SUPER->
27     scan dup remember-super-send parsed \ super-send parsed ;
28     parsing
29
30 "Compiling Objective C bridge..." print
31
32 "cocoa.classes" create-vocab drop
33
34 {
35     "cocoa" "cocoa.runtime" "cocoa.messages" "cocoa.subclassing"
36 } [ words ] map concat compile
37
38 "Importing Cocoa classes..." print
39
40 [
41     {
42         "NSApplication"
43         "NSArray"
44         "NSAutoreleasePool"
45         "NSBundle"
46         "NSData"
47         "NSDictionary"
48         "NSError"
49         "NSEvent"
50         "NSException"
51         "NSMenu"
52         "NSMenuItem"
53         "NSMutableDictionary"
54         "NSNib"
55         "NSNotification"
56         "NSNotificationCenter"
57         "NSNumber"
58         "NSObject"
59         "NSOpenGLContext"
60         "NSOpenGLPixelFormat"
61         "NSOpenGLView"
62         "NSOpenPanel"
63         "NSPasteboard"
64         "NSPropertyListSerialization"
65         "NSResponder"
66         "NSSavePanel"
67         "NSScreen"
68         "NSString"
69         "NSView"
70         "NSWindow"
71         "NSWorkspace"
72     } [
73         [ ] import-objc-class
74     ] each
75 ] with-compilation-unit