]>
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 | ||
a3d3d3bf GD |
57 | OSStatus UMAPrOpen(void *macPrintSession) ; |
58 | OSStatus UMAPrClose(void *macPrintSession) ; | |
05adb9d2 | 59 | |
cfcc3671 UJ |
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 ) ; | |
72055702 SC |
68 | //void UMAShowWindow( WindowRef inWindowRef ) ; |
69 | //void UMAHideWindow( WindowRef inWindowRef ) ; | |
cfcc3671 | 70 | void UMAShowHide( WindowRef inWindowRef , Boolean show) ; |
72055702 SC |
71 | //void UMASelectWindow( WindowRef inWindowRef ) ; |
72 | //void UMABringToFront( WindowRef inWindowRef ) ; | |
73 | //void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ; | |
74 | // void UMACloseWindow(WindowRef inWindowRef) ; | |
cfcc3671 UJ |
75 | |
76 | // appearance manager | |
77 | ||
78 | void UMADrawControl( ControlHandle inControl ) ; | |
79 | ||
fdaf613a SC |
80 | void UMAEnableControl( ControlHandle inControl ) ; |
81 | void UMADisableControl( ControlHandle inControl ) ; | |
cfcc3671 UJ |
82 | void UMAActivateControl( ControlHandle inControl ) ; |
83 | void UMADeactivateControl( ControlHandle inControl ) ; | |
72055702 SC |
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, | |
cfcc3671 UJ |
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) ; | |
72055702 SC |
102 | */ |
103 | //void UMADisposeControl (ControlHandle theControl) ; | |
104 | //void UMAHiliteControl (ControlHandle theControl, | |
105 | // ControlPartCode hiliteState) ; | |
cfcc3671 | 106 | void UMAShowControl (ControlHandle theControl) ; |
efaf6efc | 107 | void UMAHideControl (ControlHandle theControl); |
72055702 SC |
108 | //void UMASetControlVisibility (ControlHandle inControl, |
109 | // Boolean inIsVisible, | |
110 | // Boolean inDoDraw); | |
cfcc3671 | 111 | |
72055702 SC |
112 | //bool UMAIsControlActive (ControlHandle inControl); |
113 | //bool UMAIsControlVisible (ControlHandle inControl); | |
cfcc3671 UJ |
114 | void UMAActivateControl (ControlHandle inControl); |
115 | void UMADeactivateControl (ControlHandle inControl); | |
116 | ||
72055702 SC |
117 | //OSErr UMAGetBestControlRect (ControlHandle inControl, |
118 | // Rect * outRect, | |
119 | // SInt16 * outBaseLineOffset); | |
120 | //OSErr UMASetControlFontStyle (ControlHandle inControl, | |
121 | // const ControlFontStyleRec * inStyle) ; | |
cfcc3671 UJ |
122 | |
123 | ||
124 | void UMAMoveControl( ControlHandle inControl , short x , short y ) ; | |
125 | void UMASizeControl( ControlHandle inControl , short x , short y ) ; | |
126 | // control hierarchy | |
127 | ||
72055702 SC |
128 | //OSErr UMACreateRootControl (WindowPtr inWindow, |
129 | // ControlHandle * outControl) ; | |
cfcc3671 | 130 | |
72055702 SC |
131 | //OSErr UMAEmbedControl (ControlHandle inControl, |
132 | // ControlHandle inContainer); | |
cfcc3671 UJ |
133 | |
134 | // keyboard focus | |
135 | OSErr UMASetKeyboardFocus (WindowPtr inWindow, | |
136 | ControlHandle inControl, | |
137 | ControlFocusPart inPart) ; | |
138 | ||
139 | ||
140 | // events | |
141 | ||
72055702 SC |
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); | |
cfcc3671 | 150 | |
72055702 | 151 | //void UMAIdleControls (WindowPtr inWindow) ; |
cfcc3671 UJ |
152 | |
153 | void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ; | |
154 | OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ; | |
155 | ||
156 | // handling control data | |
72055702 SC |
157 | /* |
158 | OSErr ::SetControlData (ControlHandle inControl, | |
cfcc3671 UJ |
159 | ControlPartCode inPart, |
160 | ResType inTagName, | |
161 | Size inSize, | |
162 | Ptr inData) ; | |
163 | ||
72055702 | 164 | OSErr ::GetControlData (ControlHandle inControl, |
cfcc3671 UJ |
165 | ControlPartCode inPart, |
166 | ResType inTagName, | |
167 | Size inBufferSize, | |
168 | Ptr outBuffer, | |
169 | Size * outActualSize) ; | |
72055702 | 170 | OSErr ::GetControlDataSize (ControlHandle inControl, |
cfcc3671 UJ |
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 | |
72055702 | 199 | */ |
cfcc3671 UJ |
200 | bool UMAIsWindowFloating( WindowRef inWindow ) ; |
201 | bool UMAIsWindowModal( WindowRef inWindow ) ; | |
72055702 | 202 | /* |
cfcc3671 UJ |
203 | WindowRef UMAGetActiveWindow() ; |
204 | WindowRef UMAGetActiveNonFloatingWindow() ; | |
72055702 | 205 | */ |
cfcc3671 UJ |
206 | void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ; |
207 | ||
56a38bbe SC |
208 | OSStatus UMAGetHelpMenu( |
209 | MenuRef * outHelpMenu, | |
210 | MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */ | |
211 | ||
5273bf2f SC |
212 | // Appearance Drawing |
213 | ||
214 | OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ; | |
215 | ||
216 | // accessor helpers | |
217 | ||
05adb9d2 | 218 | #if !TARGET_CARBON |
5273bf2f SC |
219 | #define ClearCurrentScrap() ZeroScrap() ; |
220 | /* | |
05adb9d2 SC |
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)) | |
e42e45a9 | 231 | #define GetQDGlobalsScreenBits( a ) ((*a) = qd.screenBits) |
05adb9d2 | 232 | #define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow)) |
c36f0244 | 233 | #define GetControlBounds( c , b ) &((*b) = (**c).contrlRect ) |
05adb9d2 | 234 | #define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap )) |
e42e45a9 | 235 | #define GetControlOwner( control ) ((**control).contrlOwner) |
5273bf2f | 236 | |
e42e45a9 SC |
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 | |
5273bf2f | 247 | */ |
35f6182b | 248 | #define GetApplicationScript() smSystemScript |
5273bf2f SC |
249 | #else |
250 | ||
251 | // calls not in carbon | |
252 | ||
e42e45a9 | 253 | |
72055702 | 254 | #endif |
72055702 | 255 | #define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) |
cfcc3671 | 256 | |
03e11df5 | 257 | #endif |