]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/uma.h
merged in fix for GetValue() from the 2.2 branch
[wxWidgets.git] / include / wx / mac / uma.h
CommitLineData
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
15// define this to be 1 if you have the 8.6 libs (weak linked)
16
17#define UMA_USE_8_6 0
18
05adb9d2 19#if __POWERPC__
cfcc3671
UJ
20#define UMA_USE_APPEARANCE 1
21#define UMA_USE_WINDOWMGR 1
05adb9d2
SC
22#else
23#define UMA_USE_APPEARANCE 0
24#define UMA_USE_WINDOWMGR 0
25#endif
cfcc3671
UJ
26
27#if !UMA_USE_8_6 && UMA_USE_WINDOWMGR
28#undef UMA_USE_WINDOWMGR
29#define UMA_USE_WINDOWMGR 0
30#endif
31
32#if !TARGET_CARBON
05adb9d2
SC
33// this is now defined in the latest headers
34// typedef short MenuItemIndex ;
cfcc3671
UJ
35#endif
36
37void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
38bool UMAHasAppearance() ;
39long UMAGetAppearanceVersion() ;
40
41// process manager
42
43long UMAGetProcessMode() ;
44bool UMAGetProcessModeDoesActivateOnFGSwitch() ;
45
46// menu manager
47
05adb9d2
SC
48void UMASetMenuTitle( MenuRef menu , StringPtr title ) ;
49UInt32 UMAMenuEvent( EventRecord *inEvent ) ;
cfcc3671
UJ
50void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
51void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
05adb9d2
SC
52void UMAAppendSubMenuItem( MenuRef menu , StringPtr label , SInt16 submenuid ) ;
53void UMAInsertSubMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 submenuid ) ;
54void UMAAppendMenuItem( MenuRef menu , StringPtr label , SInt16 key= 0, UInt8 modifiers = 0 ) ;
55void UMAInsertMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 key = 0 , UInt8 modifiers = 0 ) ;
56void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ;
57
58MenuRef UMANewMenu( SInt16 menuid , StringPtr label ) ;
59void UMADisposeMenu( MenuRef menu ) ;
60
61// handling the menubar
62
63void UMADeleteMenu( SInt16 menuId ) ;
64void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ;
65void UMADrawMenuBar() ;
66
cfcc3671
UJ
67// quickdraw
68
69void UMAShowWatchCursor() ;
70void UMAShowArrowCursor() ;
71
05adb9d2
SC
72void UMAPrOpen() ;
73void UMAPrClose() ;
74
cfcc3671
UJ
75// window manager
76
77GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) ;
78void UMADisposeWindow( WindowRef inWindowRef ) ;
79void UMASetWTitleC( WindowRef inWindowRef , const char *title ) ;
80void UMAGetWTitleC( WindowRef inWindowRef , char *title ) ;
81
82void UMADrawGrowIcon( WindowRef inWindowRef ) ;
83void UMAShowWindow( WindowRef inWindowRef ) ;
84void UMAHideWindow( WindowRef inWindowRef ) ;
85void UMAShowHide( WindowRef inWindowRef , Boolean show) ;
86void UMASelectWindow( WindowRef inWindowRef ) ;
87void UMABringToFront( WindowRef inWindowRef ) ;
88void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ;
89void UMACloseWindow(WindowRef inWindowRef) ;
90
91// appearance manager
92
93void UMADrawControl( ControlHandle inControl ) ;
94
95void UMAActivateControl( ControlHandle inControl ) ;
96void UMADeactivateControl( ControlHandle inControl ) ;
05adb9d2
SC
97void UMAApplyThemeBackground (ThemeBackgroundKind inKind,
98 const Rect * bounds,
99 ThemeDrawState inState,
100 SInt16 inDepth,
101 Boolean inColorDev);
cfcc3671
UJ
102void UMASetThemeWindowBackground (WindowRef inWindow,
103 ThemeBrush inBrush,
104 Boolean inUpdate) ;
105ControlHandle UMANewControl(WindowPtr owningWindow,
106 const Rect * boundsRect,
107 ConstStr255Param controlTitle,
108 Boolean initiallyVisible,
109 SInt16 initialValue,
110 SInt16 minimumValue,
111 SInt16 maximumValue,
112 SInt16 procID,
113 SInt32 controlReference) ;
114void UMADisposeControl (ControlHandle theControl) ;
115void UMAHiliteControl (ControlHandle theControl,
116 ControlPartCode hiliteState) ;
117void UMAShowControl (ControlHandle theControl) ;
118void UMAHideControl (ControlHandle theControl);
119void UMASetControlVisibility (ControlHandle inControl,
120 Boolean inIsVisible,
121 Boolean inDoDraw);
122
123bool UMAIsControlActive (ControlHandle inControl);
124bool UMAIsControlVisible (ControlHandle inControl);
125void UMAActivateControl (ControlHandle inControl);
126void UMADeactivateControl (ControlHandle inControl);
127
128OSErr UMAGetBestControlRect (ControlHandle inControl,
129 Rect * outRect,
130 SInt16 * outBaseLineOffset);
131OSErr UMASetControlFontStyle (ControlHandle inControl,
132 const ControlFontStyleRec * inStyle) ;
133
134
135void UMAMoveControl( ControlHandle inControl , short x , short y ) ;
136void UMASizeControl( ControlHandle inControl , short x , short y ) ;
137// control hierarchy
138
139OSErr UMACreateRootControl (WindowPtr inWindow,
140 ControlHandle * outControl) ;
141
142OSErr UMAEmbedControl (ControlHandle inControl,
143 ControlHandle inContainer);
144
145// keyboard focus
146OSErr UMASetKeyboardFocus (WindowPtr inWindow,
147 ControlHandle inControl,
148 ControlFocusPart inPart) ;
149
150
151// events
152
153ControlPartCode UMAHandleControlClick (ControlHandle inControl,
154 Point inWhere,
155 SInt16 inModifiers,
156 ControlActionUPP inAction) ;
157SInt16 UMAHandleControlKey (ControlHandle inControl,
158 SInt16 inKeyCode,
159 SInt16 inCharCode,
160 SInt16 inModifiers);
161
162void UMAIdleControls (WindowPtr inWindow) ;
163
164void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ;
165OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ;
166
167// handling control data
168
169OSErr UMASetControlData (ControlHandle inControl,
170 ControlPartCode inPart,
171 ResType inTagName,
172 Size inSize,
173 Ptr inData) ;
174
175OSErr UMAGetControlData (ControlHandle inControl,
176 ControlPartCode inPart,
177 ResType inTagName,
178 Size inBufferSize,
179 Ptr outBuffer,
180 Size * outActualSize) ;
181OSErr UMAGetControlDataSize (ControlHandle inControl,
182 ControlPartCode inPart,
183 ResType inTagName,
184 Size * outMaxSize);
185
186
187// system 8.0
188
189short UMAFindWindow( Point inPoint , WindowRef *outWindow ) ;
190OSStatus UMAGetWindowFeatures( WindowRef inWindowRef , UInt32 *outFeatures ) ;
191OSStatus UMAGetWindowRegion( WindowRef inWindowRef , WindowRegionCode inRegionCode , RgnHandle ioWinRgn ) ;
192OSStatus UMACollapseWindow( WindowRef inWindowRef , Boolean inCollapseIt ) ;
193OSStatus UMACollapseAllWindows( Boolean inCollapseEm ) ;
194Boolean UMAIsWindowCollapsed( WindowRef inWindowRef ) ;
195Boolean UMAIsWindowCollapsable( WindowRef inWindowRef ) ;
196
197// system 8.5
198
199OSStatus UMACreateNewWindow( WindowClass windowClass , WindowAttributes attributes , const Rect *bounds, WindowRef *outWindow ) ;
200OSStatus UMAGetWindowClass( WindowRef inWindowRef , WindowClass *outWindowClass ) ;
201OSStatus UMAGetWindowAttributes( WindowRef inWindowRef , WindowAttributes *outAttributes ) ;
202
203void UMAShowFloatingWindows() ;
204void UMAHideFloatingWindows() ;
205Boolean UMAAreFloatingWindowsVisible() ;
206WindowRef UMAFrontWindow() ;
207WindowRef UMAFrontNonFloatingWindow() ;
208
209// floaters support
210
211bool UMAIsWindowFloating( WindowRef inWindow ) ;
212bool UMAIsWindowModal( WindowRef inWindow ) ;
213WindowRef UMAGetActiveWindow() ;
214WindowRef UMAGetActiveNonFloatingWindow() ;
215
216void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
217
05adb9d2
SC
218#if !TARGET_CARBON
219#define GetPortTextFont( p) ((p)->txFont )
220#define GetPortTextSize( p) ((p)->txSize )
221#define GetPortTextFace( p) ((p)->txFace )
222#define GetPortTextMode( p) ((p)->txMode )
223#define GetRegionBounds( r , b) ((*b) = (**r).rgnBBox)
224#define GetPortBounds( p , b) ((*b) = p->portRect )
225#define GetWindowPortBounds( p , b) ((*b) = p->portRect )
226#define GetPortVisibleRegion( p, r ) CopyRgn( p->visRgn , r )
227#define GetQDGlobalsWhite( a ) (&((*a) = qd.white))
228#define GetQDGlobalsBlack( a ) (&((*a) = qd.black))
229#define GetQDGlobalsScreenBits( a ) (*a) = qd.screenBits
230#define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow))
231#define GetControlBounds( c , b ) ((*b) = (**c).contrlRect )
232#define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap ))
233#endif
234
235// Appearance Drawing
236
237OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
cfcc3671
UJ
238
239#endif