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