]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/uma.h
Updated to use correct value for wxSTC_MASK_FOLDERS
[wxWidgets.git] / include / wx / mac / uma.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: uma.h
3 // Purpose: Universal MacOS API
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 03/02/99
7 // RCS-ID: $Id:
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef H_UMA
13 #define H_UMA
14
15 #include "wx/mac/private.h"
16
17 void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
18 void UMACleanupToolbox() ;
19 bool UMAHasAppearance() ;
20 long UMAGetAppearanceVersion() ;
21 bool UMAHasWindowManager() ;
22 long UMAGetWindowManagerAttr() ;
23 bool UMAHasAquaLayout() ;
24 bool UMASystemIsInitialized() ;
25
26 // process manager
27
28 long UMAGetProcessMode() ;
29 bool UMAGetProcessModeDoesActivateOnFGSwitch() ;
30
31 // menu manager
32
33 void UMASetMenuTitle( MenuRef menu , StringPtr title ) ;
34 UInt32 UMAMenuEvent( EventRecord *inEvent ) ;
35 void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
36 void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
37 void UMAAppendSubMenuItem( MenuRef menu , StringPtr label , SInt16 submenuid ) ;
38 void UMAInsertSubMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 submenuid ) ;
39 void UMAAppendMenuItem( MenuRef menu , StringPtr label , SInt16 key= 0, UInt8 modifiers = 0 ) ;
40 void UMAInsertMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 key = 0 , UInt8 modifiers = 0 ) ;
41 // void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ;
42
43 // MenuRef ::NewMenu( SInt16 menuid , StringPtr label ) ;
44 // void UMADisposeMenu( MenuRef menu ) ;
45
46 // handling the menubar
47
48 // void UMADeleteMenu( SInt16 menuId ) ;
49 // void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ;
50 // void UMADrawMenuBar() ;
51
52 // quickdraw
53
54 void UMAShowWatchCursor() ;
55 void UMAShowArrowCursor() ;
56
57 #if TARGET_CARBON && PM_USE_SESSION_APIS
58 OSStatus UMAPrOpen(PMPrintSession *macPrintSession) ;
59 OSStatus UMAPrClose(PMPrintSession *macPrintSession) ;
60 #else
61 OSStatus UMAPrOpen() ;
62 OSStatus UMAPrClose() ;
63 #endif
64
65 // window manager
66
67 GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) ;
68 void UMADisposeWindow( WindowRef inWindowRef ) ;
69 void UMASetWTitleC( WindowRef inWindowRef , const char *title ) ;
70 void UMAGetWTitleC( WindowRef inWindowRef , char *title ) ;
71
72 void UMADrawGrowIcon( WindowRef inWindowRef ) ;
73 //void UMAShowWindow( WindowRef inWindowRef ) ;
74 //void UMAHideWindow( WindowRef inWindowRef ) ;
75 void UMAShowHide( WindowRef inWindowRef , Boolean show) ;
76 //void UMASelectWindow( WindowRef inWindowRef ) ;
77 //void UMABringToFront( WindowRef inWindowRef ) ;
78 //void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ;
79 // void UMACloseWindow(WindowRef inWindowRef) ;
80
81 // appearance manager
82
83 void UMADrawControl( ControlHandle inControl ) ;
84
85 void UMAEnableControl( ControlHandle inControl ) ;
86 void UMADisableControl( ControlHandle inControl ) ;
87 void UMAActivateControl( ControlHandle inControl ) ;
88 void UMADeactivateControl( ControlHandle inControl ) ;
89 //void UMAApplyThemeBackground (ThemeBackgroundKind inKind,
90 // const Rect * bounds,
91 // ThemeDrawState inState,
92 // SInt16 inDepth,
93 // Boolean inColorDev);
94 //void UMASetThemeWindowBackground (WindowRef inWindow,
95 // ThemeBrush inBrush,
96 // Boolean inUpdate) ;
97 /*
98 ControlHandle ::NewControl(WindowPtr owningWindow,
99 const Rect * boundsRect,
100 ConstStr255Param controlTitle,
101 Boolean initiallyVisible,
102 SInt16 initialValue,
103 SInt16 minimumValue,
104 SInt16 maximumValue,
105 SInt16 procID,
106 SInt32 controlReference) ;
107 */
108 //void UMADisposeControl (ControlHandle theControl) ;
109 //void UMAHiliteControl (ControlHandle theControl,
110 // ControlPartCode hiliteState) ;
111 void UMAShowControl (ControlHandle theControl) ;
112 void UMAHideControl (ControlHandle theControl);
113 //void UMASetControlVisibility (ControlHandle inControl,
114 // Boolean inIsVisible,
115 // Boolean inDoDraw);
116
117 //bool UMAIsControlActive (ControlHandle inControl);
118 //bool UMAIsControlVisible (ControlHandle inControl);
119 void UMAActivateControl (ControlHandle inControl);
120 void UMADeactivateControl (ControlHandle inControl);
121
122 //OSErr UMAGetBestControlRect (ControlHandle inControl,
123 // Rect * outRect,
124 // SInt16 * outBaseLineOffset);
125 //OSErr UMASetControlFontStyle (ControlHandle inControl,
126 // const ControlFontStyleRec * inStyle) ;
127
128
129 void UMAMoveControl( ControlHandle inControl , short x , short y ) ;
130 void UMASizeControl( ControlHandle inControl , short x , short y ) ;
131 // control hierarchy
132
133 //OSErr UMACreateRootControl (WindowPtr inWindow,
134 // ControlHandle * outControl) ;
135
136 //OSErr UMAEmbedControl (ControlHandle inControl,
137 // ControlHandle inContainer);
138
139 // keyboard focus
140 OSErr UMASetKeyboardFocus (WindowPtr inWindow,
141 ControlHandle inControl,
142 ControlFocusPart inPart) ;
143
144
145 // events
146
147 //ControlPartCode UMAHandleControlClick (ControlHandle inControl,
148 // Point inWhere,
149 // SInt16 inModifiers,
150 // ControlActionUPP inAction) ;
151 //SInt16 UMAHandleControlKey (ControlHandle inControl,
152 // SInt16 inKeyCode,
153 // SInt16 inCharCode,
154 // SInt16 inModifiers);
155
156 //void UMAIdleControls (WindowPtr inWindow) ;
157
158 void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ;
159 OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ;
160
161 // handling control data
162 /*
163 OSErr ::SetControlData (ControlHandle inControl,
164 ControlPartCode inPart,
165 ResType inTagName,
166 Size inSize,
167 Ptr inData) ;
168
169 OSErr ::GetControlData (ControlHandle inControl,
170 ControlPartCode inPart,
171 ResType inTagName,
172 Size inBufferSize,
173 Ptr outBuffer,
174 Size * outActualSize) ;
175 OSErr ::GetControlDataSize (ControlHandle inControl,
176 ControlPartCode inPart,
177 ResType inTagName,
178 Size * outMaxSize);
179
180
181 // system 8.0
182
183 short UMAFindWindow( Point inPoint , WindowRef *outWindow ) ;
184 OSStatus UMAGetWindowFeatures( WindowRef inWindowRef , UInt32 *outFeatures ) ;
185 OSStatus UMAGetWindowRegion( WindowRef inWindowRef , WindowRegionCode inRegionCode , RgnHandle ioWinRgn ) ;
186 OSStatus UMACollapseWindow( WindowRef inWindowRef , Boolean inCollapseIt ) ;
187 OSStatus UMACollapseAllWindows( Boolean inCollapseEm ) ;
188 Boolean UMAIsWindowCollapsed( WindowRef inWindowRef ) ;
189 Boolean UMAIsWindowCollapsable( WindowRef inWindowRef ) ;
190
191 // system 8.5
192
193 OSStatus UMACreateNewWindow( WindowClass windowClass , WindowAttributes attributes , const Rect *bounds, WindowRef *outWindow ) ;
194 OSStatus UMAGetWindowClass( WindowRef inWindowRef , WindowClass *outWindowClass ) ;
195 OSStatus UMAGetWindowAttributes( WindowRef inWindowRef , WindowAttributes *outAttributes ) ;
196
197 void UMAShowFloatingWindows() ;
198 void UMAHideFloatingWindows() ;
199 Boolean UMAAreFloatingWindowsVisible() ;
200 WindowRef UMAFrontWindow() ;
201 WindowRef UMAFrontNonFloatingWindow() ;
202
203 // floaters support
204 */
205 bool UMAIsWindowFloating( WindowRef inWindow ) ;
206 bool UMAIsWindowModal( WindowRef inWindow ) ;
207 /*
208 WindowRef UMAGetActiveWindow() ;
209 WindowRef UMAGetActiveNonFloatingWindow() ;
210 */
211 void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
212
213 OSStatus UMAGetHelpMenu(
214 MenuRef * outHelpMenu,
215 MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
216
217 // Appearance Drawing
218
219 OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
220
221 // accessor helpers
222
223 #if !TARGET_CARBON
224 #define ClearCurrentScrap() ZeroScrap() ;
225 /*
226 #define GetPortTextFont( p) ((p)->txFont )
227 #define GetPortTextSize( p) ((p)->txSize )
228 #define GetPortTextFace( p) ((p)->txFace )
229 #define GetPortTextMode( p) ((p)->txMode )
230 #define GetRegionBounds( r , b) ((*b) = (**r).rgnBBox)
231 #define GetPortBounds( p , b) ((*b) = p->portRect )
232 #define GetWindowPortBounds( p , b) ((*b) = p->portRect )
233 #define GetPortVisibleRegion( p, r ) CopyRgn( p->visRgn , r )
234 #define GetQDGlobalsWhite( a ) (&((*a) = qd.white))
235 #define GetQDGlobalsBlack( a ) (&((*a) = qd.black))
236 #define GetQDGlobalsScreenBits( a ) ((*a) = qd.screenBits)
237 #define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow))
238 #define GetControlBounds( c , b ) &((*b) = (**c).contrlRect )
239 #define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap ))
240 #define GetControlOwner( control ) ((**control).contrlOwner)
241
242 #define GetPortPenMode( p ) (p->pnMode)
243 #define SetPortPenMode( p , mode ) (p->pnMode = mode )
244 // control manager
245
246 #define GetControlReference( control ) ((**control).contrlRfCon)
247
248 // list manager
249
250 #define SetListSelectionFlags( list , options ) (**list).selFlags = options
251 #define GetListRefCon( list ) (**list).refCon
252 */
253 #else
254
255 // calls not in carbon
256
257
258 #endif
259 #define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn )
260
261 #endif