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