]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/uma.h
added wxRTII macros to wxPopupWindow under MSW
[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
6e040042 15#if defined(__POWERPC__)
6e040042 16 #if defined(__DARWIN__)
03e11df5
GD
17 #include <Carbon/Carbon.h>
18 #endif
cfcc3671
UJ
19#endif
20
21#if !TARGET_CARBON
05adb9d2
SC
22// this is now defined in the latest headers
23// typedef short MenuItemIndex ;
cfcc3671
UJ
24#endif
25
26void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
5b781a67 27void UMACleanupToolbox() ;
cfcc3671
UJ
28bool UMAHasAppearance() ;
29long UMAGetAppearanceVersion() ;
72055702
SC
30bool UMAHasWindowManager() ;
31long UMAGetWindowManagerAttr() ;
78c0e83b 32bool UMAHasAquaLayout() ;
cfcc3671
UJ
33
34// process manager
35
36long UMAGetProcessMode() ;
37bool UMAGetProcessModeDoesActivateOnFGSwitch() ;
38
39// menu manager
40
05adb9d2
SC
41void UMASetMenuTitle( MenuRef menu , StringPtr title ) ;
42UInt32 UMAMenuEvent( EventRecord *inEvent ) ;
cfcc3671
UJ
43void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
44void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
05adb9d2
SC
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 ) ;
72055702 49// void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ;
05adb9d2 50
72055702
SC
51// MenuRef ::NewMenu( SInt16 menuid , StringPtr label ) ;
52// void UMADisposeMenu( MenuRef menu ) ;
05adb9d2
SC
53
54// handling the menubar
55
72055702
SC
56// void UMADeleteMenu( SInt16 menuId ) ;
57// void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ;
58// void UMADrawMenuBar() ;
05adb9d2 59
cfcc3671
UJ
60// quickdraw
61
62void UMAShowWatchCursor() ;
63void UMAShowArrowCursor() ;
64
93f0fe75
GD
65#if TARGET_CARBON && PM_USE_SESSION_APIS
66OSStatus UMAPrOpen(PMPrintSession *macPrintSession) ;
67OSStatus UMAPrClose(PMPrintSession *macPrintSession) ;
0ab25937 68#else
5b781a67
SC
69OSStatus UMAPrOpen() ;
70OSStatus UMAPrClose() ;
0ab25937 71#endif
05adb9d2 72
cfcc3671
UJ
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 ) ;
72055702
SC
81//void UMAShowWindow( WindowRef inWindowRef ) ;
82//void UMAHideWindow( WindowRef inWindowRef ) ;
cfcc3671 83void UMAShowHide( WindowRef inWindowRef , Boolean show) ;
72055702
SC
84//void UMASelectWindow( WindowRef inWindowRef ) ;
85//void UMABringToFront( WindowRef inWindowRef ) ;
86//void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ;
87// void UMACloseWindow(WindowRef inWindowRef) ;
cfcc3671
UJ
88
89// appearance manager
90
91void UMADrawControl( ControlHandle inControl ) ;
92
fdaf613a
SC
93void UMAEnableControl( ControlHandle inControl ) ;
94void UMADisableControl( ControlHandle inControl ) ;
cfcc3671
UJ
95void UMAActivateControl( ControlHandle inControl ) ;
96void UMADeactivateControl( ControlHandle inControl ) ;
72055702
SC
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,
cfcc3671
UJ
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) ;
72055702
SC
115*/
116//void UMADisposeControl (ControlHandle theControl) ;
117//void UMAHiliteControl (ControlHandle theControl,
118// ControlPartCode hiliteState) ;
cfcc3671 119void UMAShowControl (ControlHandle theControl) ;
efaf6efc 120void UMAHideControl (ControlHandle theControl);
72055702
SC
121//void UMASetControlVisibility (ControlHandle inControl,
122// Boolean inIsVisible,
123// Boolean inDoDraw);
cfcc3671 124
72055702
SC
125//bool UMAIsControlActive (ControlHandle inControl);
126//bool UMAIsControlVisible (ControlHandle inControl);
cfcc3671
UJ
127void UMAActivateControl (ControlHandle inControl);
128void UMADeactivateControl (ControlHandle inControl);
129
72055702
SC
130//OSErr UMAGetBestControlRect (ControlHandle inControl,
131// Rect * outRect,
132// SInt16 * outBaseLineOffset);
133//OSErr UMASetControlFontStyle (ControlHandle inControl,
134// const ControlFontStyleRec * inStyle) ;
cfcc3671
UJ
135
136
137void UMAMoveControl( ControlHandle inControl , short x , short y ) ;
138void UMASizeControl( ControlHandle inControl , short x , short y ) ;
139// control hierarchy
140
72055702
SC
141//OSErr UMACreateRootControl (WindowPtr inWindow,
142// ControlHandle * outControl) ;
cfcc3671 143
72055702
SC
144//OSErr UMAEmbedControl (ControlHandle inControl,
145// ControlHandle inContainer);
cfcc3671
UJ
146
147// keyboard focus
148OSErr UMASetKeyboardFocus (WindowPtr inWindow,
149 ControlHandle inControl,
150 ControlFocusPart inPart) ;
151
152
153// events
154
72055702
SC
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);
cfcc3671 163
72055702 164//void UMAIdleControls (WindowPtr inWindow) ;
cfcc3671
UJ
165
166void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ;
167OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ;
168
169// handling control data
72055702
SC
170/*
171OSErr ::SetControlData (ControlHandle inControl,
cfcc3671
UJ
172 ControlPartCode inPart,
173 ResType inTagName,
174 Size inSize,
175 Ptr inData) ;
176
72055702 177OSErr ::GetControlData (ControlHandle inControl,
cfcc3671
UJ
178 ControlPartCode inPart,
179 ResType inTagName,
180 Size inBufferSize,
181 Ptr outBuffer,
182 Size * outActualSize) ;
72055702 183OSErr ::GetControlDataSize (ControlHandle inControl,
cfcc3671
UJ
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
72055702 212*/
cfcc3671
UJ
213bool UMAIsWindowFloating( WindowRef inWindow ) ;
214bool UMAIsWindowModal( WindowRef inWindow ) ;
72055702 215/*
cfcc3671
UJ
216WindowRef UMAGetActiveWindow() ;
217WindowRef UMAGetActiveNonFloatingWindow() ;
72055702 218*/
cfcc3671
UJ
219void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
220
56a38bbe
SC
221OSStatus UMAGetHelpMenu(
222 MenuRef * outHelpMenu,
223 MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
224
05adb9d2
SC
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))
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)
72055702 241#define InvalWindowRgn( window , rgn ) InvalRgn( rgn )
e42e45a9
SC
242#define GetPortPenMode( p ) (p->pnMode)
243#define SetPortPenMode( p , mode ) (p->pnMode = mode )
419f362d 244#define ClearCurrentScrap() ZeroScrap() ;
e42e45a9
SC
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
72055702
SC
254#endif
255#if TARGET_CARBON
256#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn )
05adb9d2 257#endif
05adb9d2
SC
258// Appearance Drawing
259
260OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
cfcc3671 261
03e11df5 262#endif