Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / SCClassLibrary / Platform / osx / scide_scapp / CocoaGUI.sc
blobe891a7ca8c0b9befd661b035ffcfed9511f72dfc
1 /**
2  *      This is the Cocoa framework GUI implementation
3  *      for Mac OS X. It can be accessed from the GUI
4  *      class using GUI.cocoa, GUI.fromID( \cocoa ) or GUI.get( \cocoa ).
5  *
6  *      @version        0.14, 17-Jan-08
7  */
8 CocoaGUI {
9         classvar extraClasses;
11         *initClass {
12                 Class.initClassTree( Event );
13                 extraClasses = Event.new;
14                 Class.initClassTree( GUI );
15                 GUI.add( this );
16         }
18         *id { ^\cocoa }
20         *put { arg key, object;
21                 extraClasses.put( key, object );
22         }
24         *doesNotUnderstand { arg selector ... args;
25                 ^extraClasses.perform( selector, *args );
26         }
28         ///////////////// Common -> GUI /////////////////
30         *freqScope     { ^PlusFreqScopeWindow }
31         *freqScopeView { ^PlusFreqScope }
32         *scopeView { ^SCScope }
33         *stethoscope { ^SCStethoscope }
35         ///////////////// Common -> GUI -> Base /////////////////
37         *view { ^SCView }
38         *window { ^SCWindow }
39         *compositeView { ^SCCompositeView }
40         *hLayoutView { ^SCHLayoutView }
41         *vLayoutView { ^SCVLayoutView }
42         *slider { ^SCSlider }
43         *rangeSlider { ^SCRangeSlider }
44         *slider2D { ^SC2DSlider }
45         *tabletSlider2D { ^SC2DTabletSlider }
46         *button { ^SCButton }
47         *popUpMenu { ^SCPopUpMenu }
48         *staticText { ^SCStaticText }
49         *listView { ^SCListView }
50         *dragSource { ^SCDragSource }
51         *dragSink { ^SCDragSink }
52         *dragBoth { ^SCDragBoth }
53         *numberBox { ^SCNumberBox }
54         *textField { ^SCTextField }
55         *userView { ^SCUserView }
56         *multiSliderView { ^SCMultiSliderView }
57         *envelopeView { ^SCEnvelopeView }
58         *tabletView { ^SCTabletView }
59         *soundFileView { ^SCSoundFileView }
60         *movieView { ^SCMovieView }
61         *textView { ^SCTextView }
62         *quartzComposerView { ^SCQuartzComposerView }
63         *scrollView { ^SCScrollView }
64         *ezScroller { ^EZScroller }
65         *ezSlider { ^EZSlider }
66         *ezListView { ^EZListView }
67         *ezPopUpMenu { ^EZPopUpMenu}
68         *ezNumber { ^EZNumber}
69         *ezRanger { ^EZRanger }
70         *menuItem { ^CocoaMenuItem }
71         *levelIndicator { ^SCLevelIndicator }
73         *knob { ^SCKnob }
75         *font { ^SCFont }
76         *pen { ^SCPen }
77         *image { ^SCImage }
78         *webView {^SCWebView }
80         ///////////////// Common -> Audio /////////////////
82         *mouseX { ^MouseX }
83         *mouseY { ^MouseY }
84         *mouseButton { ^MouseButton }
85         *keyState { ^KeyState }
87         ///////////////// Common -> OSX /////////////////
89         *dialog { ^CocoaDialog }
90         *speech { ^Speech }
92         ///////////////// extras /////////////////
94 //      checkBox: SCCheckBox,
95 //      tabbedPane: SCTabbedPane
97         ///////////////// crucial /////////////////
98         // no longer needed b/c SwingOSC can add the StartRow class directly
99         // as of at least 0.56
100 //      *startRow { ^StartRow }
102         ///////////////// support methods with different GUI scheme implementations /////////////////
103         *stringBounds { |string, font|
104                 ^string.prBounds(Rect.new, font)
105         }