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