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