]>
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() ; |
2b5f62a0 | 19 | long UMAGetSystemVersion() ; |
cfcc3671 UJ |
20 | bool UMAHasAppearance() ; |
21 | long UMAGetAppearanceVersion() ; | |
72055702 SC |
22 | bool UMAHasWindowManager() ; |
23 | long UMAGetWindowManagerAttr() ; | |
78c0e83b | 24 | bool UMAHasAquaLayout() ; |
0e5a4d20 | 25 | bool UMASystemIsInitialized() ; |
cfcc3671 UJ |
26 | |
27 | // process manager | |
28 | ||
29 | long UMAGetProcessMode() ; | |
30 | bool UMAGetProcessModeDoesActivateOnFGSwitch() ; | |
31 | ||
32 | // menu manager | |
33 | ||
05adb9d2 SC |
34 | void UMASetMenuTitle( MenuRef menu , StringPtr title ) ; |
35 | UInt32 UMAMenuEvent( EventRecord *inEvent ) ; | |
cfcc3671 UJ |
36 | void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ; |
37 | void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ; | |
05adb9d2 SC |
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 ) ; | |
72055702 | 42 | // void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ; |
05adb9d2 | 43 | |
72055702 SC |
44 | // MenuRef ::NewMenu( SInt16 menuid , StringPtr label ) ; |
45 | // void UMADisposeMenu( MenuRef menu ) ; | |
05adb9d2 SC |
46 | |
47 | // handling the menubar | |
48 | ||
72055702 SC |
49 | // void UMADeleteMenu( SInt16 menuId ) ; |
50 | // void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ; | |
51 | // void UMADrawMenuBar() ; | |
05adb9d2 | 52 | |
cfcc3671 UJ |
53 | // quickdraw |
54 | ||
55 | void UMAShowWatchCursor() ; | |
56 | void UMAShowArrowCursor() ; | |
57 | ||
a3d3d3bf GD |
58 | OSStatus UMAPrOpen(void *macPrintSession) ; |
59 | OSStatus UMAPrClose(void *macPrintSession) ; | |
05adb9d2 | 60 | |
cfcc3671 UJ |
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 ) ; | |
72055702 SC |
69 | //void UMAShowWindow( WindowRef inWindowRef ) ; |
70 | //void UMAHideWindow( WindowRef inWindowRef ) ; | |
cfcc3671 | 71 | void UMAShowHide( WindowRef inWindowRef , Boolean show) ; |
72055702 SC |
72 | //void UMASelectWindow( WindowRef inWindowRef ) ; |
73 | //void UMABringToFront( WindowRef inWindowRef ) ; | |
74 | //void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ; | |
75 | // void UMACloseWindow(WindowRef inWindowRef) ; | |
cfcc3671 UJ |
76 | |
77 | // appearance manager | |
78 | ||
79 | void UMADrawControl( ControlHandle inControl ) ; | |
80 | ||
fdaf613a SC |
81 | void UMAEnableControl( ControlHandle inControl ) ; |
82 | void UMADisableControl( ControlHandle inControl ) ; | |
cfcc3671 UJ |
83 | void UMAActivateControl( ControlHandle inControl ) ; |
84 | void UMADeactivateControl( ControlHandle inControl ) ; | |
72055702 SC |
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, | |
cfcc3671 UJ |
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) ; | |
72055702 SC |
103 | */ |
104 | //void UMADisposeControl (ControlHandle theControl) ; | |
105 | //void UMAHiliteControl (ControlHandle theControl, | |
106 | // ControlPartCode hiliteState) ; | |
cfcc3671 | 107 | void UMAShowControl (ControlHandle theControl) ; |
efaf6efc | 108 | void UMAHideControl (ControlHandle theControl); |
72055702 SC |
109 | //void UMASetControlVisibility (ControlHandle inControl, |
110 | // Boolean inIsVisible, | |
111 | // Boolean inDoDraw); | |
cfcc3671 | 112 | |
72055702 SC |
113 | //bool UMAIsControlActive (ControlHandle inControl); |
114 | //bool UMAIsControlVisible (ControlHandle inControl); | |
cfcc3671 UJ |
115 | void UMAActivateControl (ControlHandle inControl); |
116 | void UMADeactivateControl (ControlHandle inControl); | |
117 | ||
72055702 SC |
118 | //OSErr UMAGetBestControlRect (ControlHandle inControl, |
119 | // Rect * outRect, | |
120 | // SInt16 * outBaseLineOffset); | |
121 | //OSErr UMASetControlFontStyle (ControlHandle inControl, | |
122 | // const ControlFontStyleRec * inStyle) ; | |
cfcc3671 UJ |
123 | |
124 | ||
125 | void UMAMoveControl( ControlHandle inControl , short x , short y ) ; | |
126 | void UMASizeControl( ControlHandle inControl , short x , short y ) ; | |
127 | // control hierarchy | |
128 | ||
72055702 SC |
129 | //OSErr UMACreateRootControl (WindowPtr inWindow, |
130 | // ControlHandle * outControl) ; | |
cfcc3671 | 131 | |
72055702 SC |
132 | //OSErr UMAEmbedControl (ControlHandle inControl, |
133 | // ControlHandle inContainer); | |
cfcc3671 UJ |
134 | |
135 | // keyboard focus | |
136 | OSErr UMASetKeyboardFocus (WindowPtr inWindow, | |
137 | ControlHandle inControl, | |
138 | ControlFocusPart inPart) ; | |
139 | ||
140 | ||
141 | // events | |
142 | ||
72055702 SC |
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); | |
cfcc3671 | 151 | |
72055702 | 152 | //void UMAIdleControls (WindowPtr inWindow) ; |
cfcc3671 UJ |
153 | |
154 | void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ; | |
155 | OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ; | |
156 | ||
157 | // handling control data | |
72055702 SC |
158 | /* |
159 | OSErr ::SetControlData (ControlHandle inControl, | |
cfcc3671 UJ |
160 | ControlPartCode inPart, |
161 | ResType inTagName, | |
162 | Size inSize, | |
163 | Ptr inData) ; | |
164 | ||
72055702 | 165 | OSErr ::GetControlData (ControlHandle inControl, |
cfcc3671 UJ |
166 | ControlPartCode inPart, |
167 | ResType inTagName, | |
168 | Size inBufferSize, | |
169 | Ptr outBuffer, | |
170 | Size * outActualSize) ; | |
72055702 | 171 | OSErr ::GetControlDataSize (ControlHandle inControl, |
cfcc3671 UJ |
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 | |
72055702 | 200 | */ |
cfcc3671 UJ |
201 | bool UMAIsWindowFloating( WindowRef inWindow ) ; |
202 | bool UMAIsWindowModal( WindowRef inWindow ) ; | |
72055702 | 203 | /* |
cfcc3671 UJ |
204 | WindowRef UMAGetActiveWindow() ; |
205 | WindowRef UMAGetActiveNonFloatingWindow() ; | |
72055702 | 206 | */ |
cfcc3671 UJ |
207 | void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ; |
208 | ||
56a38bbe SC |
209 | OSStatus UMAGetHelpMenu( |
210 | MenuRef * outHelpMenu, | |
211 | MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */ | |
212 | ||
5273bf2f SC |
213 | // Appearance Drawing |
214 | ||
215 | OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ; | |
216 | ||
217 | // accessor helpers | |
218 | ||
05adb9d2 | 219 | #if !TARGET_CARBON |
5273bf2f SC |
220 | #define ClearCurrentScrap() ZeroScrap() ; |
221 | /* | |
05adb9d2 SC |
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)) | |
e42e45a9 | 232 | #define GetQDGlobalsScreenBits( a ) ((*a) = qd.screenBits) |
05adb9d2 | 233 | #define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow)) |
c36f0244 | 234 | #define GetControlBounds( c , b ) &((*b) = (**c).contrlRect ) |
05adb9d2 | 235 | #define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap )) |
e42e45a9 | 236 | #define GetControlOwner( control ) ((**control).contrlOwner) |
5273bf2f | 237 | |
e42e45a9 SC |
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 | |
5273bf2f | 248 | */ |
35f6182b | 249 | #define GetApplicationScript() smSystemScript |
5273bf2f SC |
250 | #else |
251 | ||
252 | // calls not in carbon | |
253 | ||
e42e45a9 | 254 | |
72055702 | 255 | #endif |
72055702 | 256 | #define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) |
cfcc3671 | 257 | |
03e11df5 | 258 | #endif |