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