]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/mac/uma.h
Use wxClientDataDictionary for client data.
[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#include "wx/mac/private.h"
16
17void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
18void UMACleanupToolbox() ;
19long UMAGetSystemVersion() ;
20bool UMAHasAppearance() ;
21long UMAGetAppearanceVersion() ;
22bool UMAHasWindowManager() ;
23long UMAGetWindowManagerAttr() ;
24bool UMAHasAquaLayout() ;
25bool UMASystemIsInitialized() ;
26
27// process manager
28
29long UMAGetProcessMode() ;
30bool UMAGetProcessModeDoesActivateOnFGSwitch() ;
31
32// menu manager
33
34void UMASetMenuTitle( MenuRef menu , StringPtr title ) ;
35UInt32 UMAMenuEvent( EventRecord *inEvent ) ;
36void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
37void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
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 ) ;
42// void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ;
43
44// MenuRef ::NewMenu( SInt16 menuid , StringPtr label ) ;
45// void UMADisposeMenu( MenuRef menu ) ;
46
47// handling the menubar
48
49// void UMADeleteMenu( SInt16 menuId ) ;
50// void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ;
51// void UMADrawMenuBar() ;
52
53// quickdraw
54
55void UMAShowWatchCursor() ;
56void UMAShowArrowCursor() ;
57
58OSStatus UMAPrOpen(void *macPrintSession) ;
59OSStatus UMAPrClose(void *macPrintSession) ;
60
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 ) ;
69//void UMAShowWindow( WindowRef inWindowRef ) ;
70//void UMAHideWindow( WindowRef inWindowRef ) ;
71void UMAShowHide( WindowRef inWindowRef , Boolean show) ;
72//void UMASelectWindow( WindowRef inWindowRef ) ;
73//void UMABringToFront( WindowRef inWindowRef ) ;
74//void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ;
75// void UMACloseWindow(WindowRef inWindowRef) ;
76
77// appearance manager
78
79void UMADrawControl( ControlHandle inControl ) ;
80
81void UMAEnableControl( ControlHandle inControl ) ;
82void UMADisableControl( ControlHandle inControl ) ;
83void UMAActivateControl( ControlHandle inControl ) ;
84void UMADeactivateControl( ControlHandle inControl ) ;
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,
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) ;
103*/
104//void UMADisposeControl (ControlHandle theControl) ;
105//void UMAHiliteControl (ControlHandle theControl,
106// ControlPartCode hiliteState) ;
107void UMAShowControl (ControlHandle theControl) ;
108void UMAHideControl (ControlHandle theControl);
109//void UMASetControlVisibility (ControlHandle inControl,
110// Boolean inIsVisible,
111// Boolean inDoDraw);
112
113//bool UMAIsControlActive (ControlHandle inControl);
114//bool UMAIsControlVisible (ControlHandle inControl);
115void UMAActivateControl (ControlHandle inControl);
116void UMADeactivateControl (ControlHandle inControl);
117
118//OSErr UMAGetBestControlRect (ControlHandle inControl,
119// Rect * outRect,
120// SInt16 * outBaseLineOffset);
121//OSErr UMASetControlFontStyle (ControlHandle inControl,
122// const ControlFontStyleRec * inStyle) ;
123
124
125void UMAMoveControl( ControlHandle inControl , short x , short y ) ;
126void UMASizeControl( ControlHandle inControl , short x , short y ) ;
127// control hierarchy
128
129//OSErr UMACreateRootControl (WindowPtr inWindow,
130// ControlHandle * outControl) ;
131
132//OSErr UMAEmbedControl (ControlHandle inControl,
133// ControlHandle inContainer);
134
135// keyboard focus
136OSErr UMASetKeyboardFocus (WindowPtr inWindow,
137 ControlHandle inControl,
138 ControlFocusPart inPart) ;
139
140
141// events
142
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);
151
152//void UMAIdleControls (WindowPtr inWindow) ;
153
154void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ;
155OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ;
156
157// handling control data
158/*
159OSErr ::SetControlData (ControlHandle inControl,
160 ControlPartCode inPart,
161 ResType inTagName,
162 Size inSize,
163 Ptr inData) ;
164
165OSErr ::GetControlData (ControlHandle inControl,
166 ControlPartCode inPart,
167 ResType inTagName,
168 Size inBufferSize,
169 Ptr outBuffer,
170 Size * outActualSize) ;
171OSErr ::GetControlDataSize (ControlHandle inControl,
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
200*/
201bool UMAIsWindowFloating( WindowRef inWindow ) ;
202bool UMAIsWindowModal( WindowRef inWindow ) ;
203/*
204WindowRef UMAGetActiveWindow() ;
205WindowRef UMAGetActiveNonFloatingWindow() ;
206*/
207void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
208
209OSStatus UMAGetHelpMenu(
210 MenuRef * outHelpMenu,
211 MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
212
213// Appearance Drawing
214
215OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
216
217// accessor helpers
218
219#if !TARGET_CARBON
220#define ClearCurrentScrap() ZeroScrap() ;
221/*
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))
232#define GetQDGlobalsScreenBits( a ) ((*a) = qd.screenBits)
233#define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow))
234#define GetControlBounds( c , b ) &((*b) = (**c).contrlRect )
235#define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap ))
236#define GetControlOwner( control ) ((**control).contrlOwner)
237
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
248*/
249#define GetApplicationScript() smSystemScript
250#else
251
252// calls not in carbon
253
254
255#endif
256#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn )
257
258#endif