]>
Commit | Line | Data |
---|---|---|
cfcc3671 UJ |
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 | |
292d1a2f | 9 | // Licence: wxWindows licence |
cfcc3671 UJ |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef H_UMA | |
13 | #define H_UMA | |
14 | ||
5273bf2f | 15 | #include "wx/mac/private.h" |
cfcc3671 UJ |
16 | |
17 | void UMAInitToolbox( UInt16 inMoreMastersCalls) ; | |
5b781a67 | 18 | void UMACleanupToolbox() ; |
cfcc3671 UJ |
19 | bool UMAHasAppearance() ; |
20 | long UMAGetAppearanceVersion() ; | |
72055702 SC |
21 | bool UMAHasWindowManager() ; |
22 | long UMAGetWindowManagerAttr() ; | |
78c0e83b | 23 | bool UMAHasAquaLayout() ; |
0e5a4d20 | 24 | bool UMASystemIsInitialized() ; |
cfcc3671 UJ |
25 | |
26 | // process manager | |
27 | ||
28 | long UMAGetProcessMode() ; | |
29 | bool UMAGetProcessModeDoesActivateOnFGSwitch() ; | |
30 | ||
31 | // menu manager | |
32 | ||
05adb9d2 SC |
33 | void UMASetMenuTitle( MenuRef menu , StringPtr title ) ; |
34 | UInt32 UMAMenuEvent( EventRecord *inEvent ) ; | |
cfcc3671 UJ |
35 | void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ; |
36 | void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ; | |
05adb9d2 SC |
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 ) ; | |
72055702 | 41 | // void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ; |
05adb9d2 | 42 | |
72055702 SC |
43 | // MenuRef ::NewMenu( SInt16 menuid , StringPtr label ) ; |
44 | // void UMADisposeMenu( MenuRef menu ) ; | |
05adb9d2 SC |
45 | |
46 | // handling the menubar | |
47 | ||
72055702 SC |
48 | // void UMADeleteMenu( SInt16 menuId ) ; |
49 | // void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ; | |
50 | // void UMADrawMenuBar() ; | |
05adb9d2 | 51 | |
cfcc3671 UJ |
52 | // quickdraw |
53 | ||
54 | void UMAShowWatchCursor() ; | |
55 | void UMAShowArrowCursor() ; | |
56 | ||
93f0fe75 GD |
57 | #if TARGET_CARBON && PM_USE_SESSION_APIS |
58 | OSStatus UMAPrOpen(PMPrintSession *macPrintSession) ; | |
59 | OSStatus UMAPrClose(PMPrintSession *macPrintSession) ; | |
0ab25937 | 60 | #else |
5b781a67 SC |
61 | OSStatus UMAPrOpen() ; |
62 | OSStatus UMAPrClose() ; | |
0ab25937 | 63 | #endif |
05adb9d2 | 64 | |
cfcc3671 UJ |
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 ) ; | |
72055702 SC |
73 | //void UMAShowWindow( WindowRef inWindowRef ) ; |
74 | //void UMAHideWindow( WindowRef inWindowRef ) ; | |
cfcc3671 | 75 | void UMAShowHide( WindowRef inWindowRef , Boolean show) ; |
72055702 SC |
76 | //void UMASelectWindow( WindowRef inWindowRef ) ; |
77 | //void UMABringToFront( WindowRef inWindowRef ) ; | |
78 | //void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ; | |
79 | // void UMACloseWindow(WindowRef inWindowRef) ; | |
cfcc3671 UJ |
80 | |
81 | // appearance manager | |
82 | ||
83 | void UMADrawControl( ControlHandle inControl ) ; | |
84 | ||
fdaf613a SC |
85 | void UMAEnableControl( ControlHandle inControl ) ; |
86 | void UMADisableControl( ControlHandle inControl ) ; | |
cfcc3671 UJ |
87 | void UMAActivateControl( ControlHandle inControl ) ; |
88 | void UMADeactivateControl( ControlHandle inControl ) ; | |
72055702 SC |
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, | |
cfcc3671 UJ |
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) ; | |
72055702 SC |
107 | */ |
108 | //void UMADisposeControl (ControlHandle theControl) ; | |
109 | //void UMAHiliteControl (ControlHandle theControl, | |
110 | // ControlPartCode hiliteState) ; | |
cfcc3671 | 111 | void UMAShowControl (ControlHandle theControl) ; |
efaf6efc | 112 | void UMAHideControl (ControlHandle theControl); |
72055702 SC |
113 | //void UMASetControlVisibility (ControlHandle inControl, |
114 | // Boolean inIsVisible, | |
115 | // Boolean inDoDraw); | |
cfcc3671 | 116 | |
72055702 SC |
117 | //bool UMAIsControlActive (ControlHandle inControl); |
118 | //bool UMAIsControlVisible (ControlHandle inControl); | |
cfcc3671 UJ |
119 | void UMAActivateControl (ControlHandle inControl); |
120 | void UMADeactivateControl (ControlHandle inControl); | |
121 | ||
72055702 SC |
122 | //OSErr UMAGetBestControlRect (ControlHandle inControl, |
123 | // Rect * outRect, | |
124 | // SInt16 * outBaseLineOffset); | |
125 | //OSErr UMASetControlFontStyle (ControlHandle inControl, | |
126 | // const ControlFontStyleRec * inStyle) ; | |
cfcc3671 UJ |
127 | |
128 | ||
129 | void UMAMoveControl( ControlHandle inControl , short x , short y ) ; | |
130 | void UMASizeControl( ControlHandle inControl , short x , short y ) ; | |
131 | // control hierarchy | |
132 | ||
72055702 SC |
133 | //OSErr UMACreateRootControl (WindowPtr inWindow, |
134 | // ControlHandle * outControl) ; | |
cfcc3671 | 135 | |
72055702 SC |
136 | //OSErr UMAEmbedControl (ControlHandle inControl, |
137 | // ControlHandle inContainer); | |
cfcc3671 UJ |
138 | |
139 | // keyboard focus | |
140 | OSErr UMASetKeyboardFocus (WindowPtr inWindow, | |
141 | ControlHandle inControl, | |
142 | ControlFocusPart inPart) ; | |
143 | ||
144 | ||
145 | // events | |
146 | ||
72055702 SC |
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); | |
cfcc3671 | 155 | |
72055702 | 156 | //void UMAIdleControls (WindowPtr inWindow) ; |
cfcc3671 UJ |
157 | |
158 | void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ; | |
159 | OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ; | |
160 | ||
161 | // handling control data | |
72055702 SC |
162 | /* |
163 | OSErr ::SetControlData (ControlHandle inControl, | |
cfcc3671 UJ |
164 | ControlPartCode inPart, |
165 | ResType inTagName, | |
166 | Size inSize, | |
167 | Ptr inData) ; | |
168 | ||
72055702 | 169 | OSErr ::GetControlData (ControlHandle inControl, |
cfcc3671 UJ |
170 | ControlPartCode inPart, |
171 | ResType inTagName, | |
172 | Size inBufferSize, | |
173 | Ptr outBuffer, | |
174 | Size * outActualSize) ; | |
72055702 | 175 | OSErr ::GetControlDataSize (ControlHandle inControl, |
cfcc3671 UJ |
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 | |
72055702 | 204 | */ |
cfcc3671 UJ |
205 | bool UMAIsWindowFloating( WindowRef inWindow ) ; |
206 | bool UMAIsWindowModal( WindowRef inWindow ) ; | |
72055702 | 207 | /* |
cfcc3671 UJ |
208 | WindowRef UMAGetActiveWindow() ; |
209 | WindowRef UMAGetActiveNonFloatingWindow() ; | |
72055702 | 210 | */ |
cfcc3671 UJ |
211 | void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ; |
212 | ||
56a38bbe SC |
213 | OSStatus UMAGetHelpMenu( |
214 | MenuRef * outHelpMenu, | |
215 | MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */ | |
216 | ||
5273bf2f SC |
217 | // Appearance Drawing |
218 | ||
219 | OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ; | |
220 | ||
221 | // accessor helpers | |
222 | ||
05adb9d2 | 223 | #if !TARGET_CARBON |
5273bf2f SC |
224 | #define ClearCurrentScrap() ZeroScrap() ; |
225 | /* | |
05adb9d2 SC |
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)) | |
e42e45a9 | 236 | #define GetQDGlobalsScreenBits( a ) ((*a) = qd.screenBits) |
05adb9d2 | 237 | #define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow)) |
c36f0244 | 238 | #define GetControlBounds( c , b ) &((*b) = (**c).contrlRect ) |
05adb9d2 | 239 | #define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap )) |
e42e45a9 | 240 | #define GetControlOwner( control ) ((**control).contrlOwner) |
5273bf2f | 241 | |
e42e45a9 SC |
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 | |
5273bf2f SC |
252 | */ |
253 | #else | |
254 | ||
255 | // calls not in carbon | |
256 | ||
e42e45a9 | 257 | |
72055702 | 258 | #endif |
72055702 | 259 | #define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) |
cfcc3671 | 260 | |
03e11df5 | 261 | #endif |