]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/uma.h
Updated to use correct value for wxSTC_MASK_FOLDERS
[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
93f0fe75
GD
57#if TARGET_CARBON && PM_USE_SESSION_APIS
58OSStatus UMAPrOpen(PMPrintSession *macPrintSession) ;
59OSStatus UMAPrClose(PMPrintSession *macPrintSession) ;
0ab25937 60#else
5b781a67
SC
61OSStatus UMAPrOpen() ;
62OSStatus UMAPrClose() ;
0ab25937 63#endif
05adb9d2 64
cfcc3671
UJ
65// window manager
66
67GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) ;
68void UMADisposeWindow( WindowRef inWindowRef ) ;
69void UMASetWTitleC( WindowRef inWindowRef , const char *title ) ;
70void UMAGetWTitleC( WindowRef inWindowRef , char *title ) ;
71
72void UMADrawGrowIcon( WindowRef inWindowRef ) ;
72055702
SC
73//void UMAShowWindow( WindowRef inWindowRef ) ;
74//void UMAHideWindow( WindowRef inWindowRef ) ;
cfcc3671 75void UMAShowHide( WindowRef inWindowRef , Boolean show) ;
72055702
SC
76//void UMASelectWindow( WindowRef inWindowRef ) ;
77//void UMABringToFront( WindowRef inWindowRef ) ;
78//void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ;
79// void UMACloseWindow(WindowRef inWindowRef) ;
cfcc3671
UJ
80
81// appearance manager
82
83void UMADrawControl( ControlHandle inControl ) ;
84
fdaf613a
SC
85void UMAEnableControl( ControlHandle inControl ) ;
86void UMADisableControl( ControlHandle inControl ) ;
cfcc3671
UJ
87void UMAActivateControl( ControlHandle inControl ) ;
88void UMADeactivateControl( ControlHandle inControl ) ;
72055702
SC
89//void UMAApplyThemeBackground (ThemeBackgroundKind inKind,
90// const Rect * bounds,
91// ThemeDrawState inState,
92// SInt16 inDepth,
93// Boolean inColorDev);
94//void UMASetThemeWindowBackground (WindowRef inWindow,
95// ThemeBrush inBrush,
96// Boolean inUpdate) ;
97/*
98ControlHandle ::NewControl(WindowPtr owningWindow,
cfcc3671
UJ
99 const Rect * boundsRect,
100 ConstStr255Param controlTitle,
101 Boolean initiallyVisible,
102 SInt16 initialValue,
103 SInt16 minimumValue,
104 SInt16 maximumValue,
105 SInt16 procID,
106 SInt32 controlReference) ;
72055702
SC
107*/
108//void UMADisposeControl (ControlHandle theControl) ;
109//void UMAHiliteControl (ControlHandle theControl,
110// ControlPartCode hiliteState) ;
cfcc3671 111void UMAShowControl (ControlHandle theControl) ;
efaf6efc 112void UMAHideControl (ControlHandle theControl);
72055702
SC
113//void UMASetControlVisibility (ControlHandle inControl,
114// Boolean inIsVisible,
115// Boolean inDoDraw);
cfcc3671 116
72055702
SC
117//bool UMAIsControlActive (ControlHandle inControl);
118//bool UMAIsControlVisible (ControlHandle inControl);
cfcc3671
UJ
119void UMAActivateControl (ControlHandle inControl);
120void UMADeactivateControl (ControlHandle inControl);
121
72055702
SC
122//OSErr UMAGetBestControlRect (ControlHandle inControl,
123// Rect * outRect,
124// SInt16 * outBaseLineOffset);
125//OSErr UMASetControlFontStyle (ControlHandle inControl,
126// const ControlFontStyleRec * inStyle) ;
cfcc3671
UJ
127
128
129void UMAMoveControl( ControlHandle inControl , short x , short y ) ;
130void UMASizeControl( ControlHandle inControl , short x , short y ) ;
131// control hierarchy
132
72055702
SC
133//OSErr UMACreateRootControl (WindowPtr inWindow,
134// ControlHandle * outControl) ;
cfcc3671 135
72055702
SC
136//OSErr UMAEmbedControl (ControlHandle inControl,
137// ControlHandle inContainer);
cfcc3671
UJ
138
139// keyboard focus
140OSErr UMASetKeyboardFocus (WindowPtr inWindow,
141 ControlHandle inControl,
142 ControlFocusPart inPart) ;
143
144
145// events
146
72055702
SC
147//ControlPartCode UMAHandleControlClick (ControlHandle inControl,
148// Point inWhere,
149// SInt16 inModifiers,
150// ControlActionUPP inAction) ;
151//SInt16 UMAHandleControlKey (ControlHandle inControl,
152// SInt16 inKeyCode,
153// SInt16 inCharCode,
154// SInt16 inModifiers);
cfcc3671 155
72055702 156//void UMAIdleControls (WindowPtr inWindow) ;
cfcc3671
UJ
157
158void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ;
159OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ;
160
161// handling control data
72055702
SC
162/*
163OSErr ::SetControlData (ControlHandle inControl,
cfcc3671
UJ
164 ControlPartCode inPart,
165 ResType inTagName,
166 Size inSize,
167 Ptr inData) ;
168
72055702 169OSErr ::GetControlData (ControlHandle inControl,
cfcc3671
UJ
170 ControlPartCode inPart,
171 ResType inTagName,
172 Size inBufferSize,
173 Ptr outBuffer,
174 Size * outActualSize) ;
72055702 175OSErr ::GetControlDataSize (ControlHandle inControl,
cfcc3671
UJ
176 ControlPartCode inPart,
177 ResType inTagName,
178 Size * outMaxSize);
179
180
181// system 8.0
182
183short UMAFindWindow( Point inPoint , WindowRef *outWindow ) ;
184OSStatus UMAGetWindowFeatures( WindowRef inWindowRef , UInt32 *outFeatures ) ;
185OSStatus UMAGetWindowRegion( WindowRef inWindowRef , WindowRegionCode inRegionCode , RgnHandle ioWinRgn ) ;
186OSStatus UMACollapseWindow( WindowRef inWindowRef , Boolean inCollapseIt ) ;
187OSStatus UMACollapseAllWindows( Boolean inCollapseEm ) ;
188Boolean UMAIsWindowCollapsed( WindowRef inWindowRef ) ;
189Boolean UMAIsWindowCollapsable( WindowRef inWindowRef ) ;
190
191// system 8.5
192
193OSStatus UMACreateNewWindow( WindowClass windowClass , WindowAttributes attributes , const Rect *bounds, WindowRef *outWindow ) ;
194OSStatus UMAGetWindowClass( WindowRef inWindowRef , WindowClass *outWindowClass ) ;
195OSStatus UMAGetWindowAttributes( WindowRef inWindowRef , WindowAttributes *outAttributes ) ;
196
197void UMAShowFloatingWindows() ;
198void UMAHideFloatingWindows() ;
199Boolean UMAAreFloatingWindowsVisible() ;
200WindowRef UMAFrontWindow() ;
201WindowRef UMAFrontNonFloatingWindow() ;
202
203// floaters support
72055702 204*/
cfcc3671
UJ
205bool UMAIsWindowFloating( WindowRef inWindow ) ;
206bool UMAIsWindowModal( WindowRef inWindow ) ;
72055702 207/*
cfcc3671
UJ
208WindowRef UMAGetActiveWindow() ;
209WindowRef UMAGetActiveNonFloatingWindow() ;
72055702 210*/
cfcc3671
UJ
211void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
212
56a38bbe
SC
213OSStatus UMAGetHelpMenu(
214 MenuRef * outHelpMenu,
215 MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
216
5273bf2f
SC
217// Appearance Drawing
218
219OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
220
221// accessor helpers
222
05adb9d2 223#if !TARGET_CARBON
5273bf2f
SC
224#define ClearCurrentScrap() ZeroScrap() ;
225/*
05adb9d2
SC
226#define GetPortTextFont( p) ((p)->txFont )
227#define GetPortTextSize( p) ((p)->txSize )
228#define GetPortTextFace( p) ((p)->txFace )
229#define GetPortTextMode( p) ((p)->txMode )
230#define GetRegionBounds( r , b) ((*b) = (**r).rgnBBox)
231#define GetPortBounds( p , b) ((*b) = p->portRect )
232#define GetWindowPortBounds( p , b) ((*b) = p->portRect )
233#define GetPortVisibleRegion( p, r ) CopyRgn( p->visRgn , r )
234#define GetQDGlobalsWhite( a ) (&((*a) = qd.white))
235#define GetQDGlobalsBlack( a ) (&((*a) = qd.black))
e42e45a9 236#define GetQDGlobalsScreenBits( a ) ((*a) = qd.screenBits)
05adb9d2 237#define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow))
c36f0244 238#define GetControlBounds( c , b ) &((*b) = (**c).contrlRect )
05adb9d2 239#define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap ))
e42e45a9 240#define GetControlOwner( control ) ((**control).contrlOwner)
5273bf2f 241
e42e45a9
SC
242#define GetPortPenMode( p ) (p->pnMode)
243#define SetPortPenMode( p , mode ) (p->pnMode = mode )
244// control manager
245
246#define GetControlReference( control ) ((**control).contrlRfCon)
247
248// list manager
249
250#define SetListSelectionFlags( list , options ) (**list).selFlags = options
251#define GetListRefCon( list ) (**list).refCon
5273bf2f
SC
252*/
253#else
254
255// calls not in carbon
256
e42e45a9 257
72055702 258#endif
72055702 259#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn )
cfcc3671 260
03e11df5 261#endif