]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/uma.h
compilation fixes after the last commit
[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
5273bf2f 15#include "wx/mac/private.h"
cfcc3671
UJ
16
17void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
5b781a67 18void UMACleanupToolbox() ;
cfcc3671
UJ
19bool UMAHasAppearance() ;
20long UMAGetAppearanceVersion() ;
72055702
SC
21bool UMAHasWindowManager() ;
22long UMAGetWindowManagerAttr() ;
78c0e83b 23bool UMAHasAquaLayout() ;
0e5a4d20 24bool UMASystemIsInitialized() ;
cfcc3671
UJ
25
26// process manager
27
28long UMAGetProcessMode() ;
29bool UMAGetProcessModeDoesActivateOnFGSwitch() ;
30
31// menu manager
32
05adb9d2
SC
33void UMASetMenuTitle( MenuRef menu , StringPtr title ) ;
34UInt32 UMAMenuEvent( EventRecord *inEvent ) ;
cfcc3671
UJ
35void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
36void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
05adb9d2
SC
37void UMAAppendSubMenuItem( MenuRef menu , StringPtr label , SInt16 submenuid ) ;
38void UMAInsertSubMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 submenuid ) ;
39void UMAAppendMenuItem( MenuRef menu , StringPtr label , SInt16 key= 0, UInt8 modifiers = 0 ) ;
40void 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
54void UMAShowWatchCursor() ;
55void UMAShowArrowCursor() ;
56
a3d3d3bf
GD
57OSStatus UMAPrOpen(void *macPrintSession) ;
58OSStatus UMAPrClose(void *macPrintSession) ;
05adb9d2 59
cfcc3671
UJ
60// window manager
61
62GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) ;
63void UMADisposeWindow( WindowRef inWindowRef ) ;
64void UMASetWTitleC( WindowRef inWindowRef , const char *title ) ;
65void UMAGetWTitleC( WindowRef inWindowRef , char *title ) ;
66
67void UMADrawGrowIcon( WindowRef inWindowRef ) ;
72055702
SC
68//void UMAShowWindow( WindowRef inWindowRef ) ;
69//void UMAHideWindow( WindowRef inWindowRef ) ;
cfcc3671 70void 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
78void UMADrawControl( ControlHandle inControl ) ;
79
fdaf613a
SC
80void UMAEnableControl( ControlHandle inControl ) ;
81void UMADisableControl( ControlHandle inControl ) ;
cfcc3671
UJ
82void UMAActivateControl( ControlHandle inControl ) ;
83void 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/*
93ControlHandle ::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 106void UMAShowControl (ControlHandle theControl) ;
efaf6efc 107void 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
114void UMAActivateControl (ControlHandle inControl);
115void 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
124void UMAMoveControl( ControlHandle inControl , short x , short y ) ;
125void 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
135OSErr 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
153void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ;
154OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ;
155
156// handling control data
72055702
SC
157/*
158OSErr ::SetControlData (ControlHandle inControl,
cfcc3671
UJ
159 ControlPartCode inPart,
160 ResType inTagName,
161 Size inSize,
162 Ptr inData) ;
163
72055702 164OSErr ::GetControlData (ControlHandle inControl,
cfcc3671
UJ
165 ControlPartCode inPart,
166 ResType inTagName,
167 Size inBufferSize,
168 Ptr outBuffer,
169 Size * outActualSize) ;
72055702 170OSErr ::GetControlDataSize (ControlHandle inControl,
cfcc3671
UJ
171 ControlPartCode inPart,
172 ResType inTagName,
173 Size * outMaxSize);
174
175
176// system 8.0
177
178short UMAFindWindow( Point inPoint , WindowRef *outWindow ) ;
179OSStatus UMAGetWindowFeatures( WindowRef inWindowRef , UInt32 *outFeatures ) ;
180OSStatus UMAGetWindowRegion( WindowRef inWindowRef , WindowRegionCode inRegionCode , RgnHandle ioWinRgn ) ;
181OSStatus UMACollapseWindow( WindowRef inWindowRef , Boolean inCollapseIt ) ;
182OSStatus UMACollapseAllWindows( Boolean inCollapseEm ) ;
183Boolean UMAIsWindowCollapsed( WindowRef inWindowRef ) ;
184Boolean UMAIsWindowCollapsable( WindowRef inWindowRef ) ;
185
186// system 8.5
187
188OSStatus UMACreateNewWindow( WindowClass windowClass , WindowAttributes attributes , const Rect *bounds, WindowRef *outWindow ) ;
189OSStatus UMAGetWindowClass( WindowRef inWindowRef , WindowClass *outWindowClass ) ;
190OSStatus UMAGetWindowAttributes( WindowRef inWindowRef , WindowAttributes *outAttributes ) ;
191
192void UMAShowFloatingWindows() ;
193void UMAHideFloatingWindows() ;
194Boolean UMAAreFloatingWindowsVisible() ;
195WindowRef UMAFrontWindow() ;
196WindowRef UMAFrontNonFloatingWindow() ;
197
198// floaters support
72055702 199*/
cfcc3671
UJ
200bool UMAIsWindowFloating( WindowRef inWindow ) ;
201bool UMAIsWindowModal( WindowRef inWindow ) ;
72055702 202/*
cfcc3671
UJ
203WindowRef UMAGetActiveWindow() ;
204WindowRef UMAGetActiveNonFloatingWindow() ;
72055702 205*/
cfcc3671
UJ
206void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
207
56a38bbe
SC
208OSStatus UMAGetHelpMenu(
209 MenuRef * outHelpMenu,
210 MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
211
5273bf2f
SC
212// Appearance Drawing
213
214OSStatus 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
SC
247*/
248#else
249
250// calls not in carbon
251
e42e45a9 252
72055702 253#endif
72055702 254#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn )
cfcc3671 255
03e11df5 256#endif