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