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