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