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