Merging various recent changes from trunk into 34 - inc sc.app menu tweak, synthdef...
[supercollider.git] / common / build / SCClassLibrary / Platform / osx / scide_scapp / CocoaGUI.sc
blob0fb642b91cef7c3c18df244cfd881103c9f2ee49
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 { ^SCFreqScopeWindow }
31         *freqScopeView { ^SCFreqScope }
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 }
79         ///////////////// Common -> Audio /////////////////
81         *mouseX { ^MouseX }
82         *mouseY { ^MouseY }
83         *mouseButton { ^MouseButton }
84         *keyState { ^KeyState }
86         ///////////////// Common -> OSX /////////////////
88         *dialog { ^CocoaDialog }
89         *speech { ^Speech }
91         ///////////////// extras /////////////////
93 //      checkBox: SCCheckBox,
94 //      tabbedPane: SCTabbedPane
96         ///////////////// crucial /////////////////
97         // no longer needed b/c SwingOSC can add the StartRow class directly
98         // as of at least 0.56
99 //      *startRow { ^StartRow }
101         ///////////////// support methods with different GUI scheme implementations /////////////////
102         *stringBounds { |string, font|
103                 ^string.prBounds(Rect.new, font)
104         }