1999-11-18 23:38:06 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: uma.h
|
|
|
|
// Purpose: Universal MacOS API
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 03/02/99
|
|
|
|
// RCS-ID: $Id:
|
|
|
|
// Copyright: (c) Stefan Csomor
|
2000-08-11 03:30:47 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-11-18 23:38:06 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef H_UMA
|
|
|
|
#define H_UMA
|
|
|
|
|
2002-01-04 17:13:39 +00:00
|
|
|
#include "wx/mac/private.h"
|
1999-11-18 23:38:06 +00:00
|
|
|
|
|
|
|
void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
|
2001-02-08 21:13:12 +00:00
|
|
|
void UMACleanupToolbox() ;
|
1999-11-18 23:38:06 +00:00
|
|
|
bool UMAHasAppearance() ;
|
|
|
|
long UMAGetAppearanceVersion() ;
|
2001-10-28 19:32:42 +00:00
|
|
|
bool UMAHasWindowManager() ;
|
|
|
|
long UMAGetWindowManagerAttr() ;
|
2002-01-01 09:54:17 +00:00
|
|
|
bool UMAHasAquaLayout() ;
|
1999-11-18 23:38:06 +00:00
|
|
|
|
|
|
|
// process manager
|
|
|
|
|
|
|
|
long UMAGetProcessMode() ;
|
|
|
|
bool UMAGetProcessModeDoesActivateOnFGSwitch() ;
|
|
|
|
|
|
|
|
// menu manager
|
|
|
|
|
2000-08-09 11:02:59 +00:00
|
|
|
void UMASetMenuTitle( MenuRef menu , StringPtr title ) ;
|
|
|
|
UInt32 UMAMenuEvent( EventRecord *inEvent ) ;
|
1999-11-18 23:38:06 +00:00
|
|
|
void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
|
|
|
|
void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
|
2000-08-09 11:02:59 +00:00
|
|
|
void UMAAppendSubMenuItem( MenuRef menu , StringPtr label , SInt16 submenuid ) ;
|
|
|
|
void UMAInsertSubMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 submenuid ) ;
|
|
|
|
void UMAAppendMenuItem( MenuRef menu , StringPtr label , SInt16 key= 0, UInt8 modifiers = 0 ) ;
|
|
|
|
void UMAInsertMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 key = 0 , UInt8 modifiers = 0 ) ;
|
2001-10-28 19:32:42 +00:00
|
|
|
// void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ;
|
2000-08-09 11:02:59 +00:00
|
|
|
|
2001-10-28 19:32:42 +00:00
|
|
|
// MenuRef ::NewMenu( SInt16 menuid , StringPtr label ) ;
|
|
|
|
// void UMADisposeMenu( MenuRef menu ) ;
|
2000-08-09 11:02:59 +00:00
|
|
|
|
|
|
|
// handling the menubar
|
|
|
|
|
2001-10-28 19:32:42 +00:00
|
|
|
// void UMADeleteMenu( SInt16 menuId ) ;
|
|
|
|
// void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ;
|
|
|
|
// void UMADrawMenuBar() ;
|
2000-08-09 11:02:59 +00:00
|
|
|
|
1999-11-18 23:38:06 +00:00
|
|
|
// quickdraw
|
|
|
|
|
|
|
|
void UMAShowWatchCursor() ;
|
|
|
|
void UMAShowArrowCursor() ;
|
|
|
|
|
2001-06-28 06:30:58 +00:00
|
|
|
#if TARGET_CARBON && PM_USE_SESSION_APIS
|
|
|
|
OSStatus UMAPrOpen(PMPrintSession *macPrintSession) ;
|
|
|
|
OSStatus UMAPrClose(PMPrintSession *macPrintSession) ;
|
2001-06-23 17:13:03 +00:00
|
|
|
#else
|
2001-02-08 21:13:12 +00:00
|
|
|
OSStatus UMAPrOpen() ;
|
|
|
|
OSStatus UMAPrClose() ;
|
2001-06-23 17:13:03 +00:00
|
|
|
#endif
|
2000-08-09 11:02:59 +00:00
|
|
|
|
1999-11-18 23:38:06 +00:00
|
|
|
// window manager
|
|
|
|
|
|
|
|
GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) ;
|
|
|
|
void UMADisposeWindow( WindowRef inWindowRef ) ;
|
|
|
|
void UMASetWTitleC( WindowRef inWindowRef , const char *title ) ;
|
|
|
|
void UMAGetWTitleC( WindowRef inWindowRef , char *title ) ;
|
|
|
|
|
|
|
|
void UMADrawGrowIcon( WindowRef inWindowRef ) ;
|
2001-10-28 19:32:42 +00:00
|
|
|
//void UMAShowWindow( WindowRef inWindowRef ) ;
|
|
|
|
//void UMAHideWindow( WindowRef inWindowRef ) ;
|
1999-11-18 23:38:06 +00:00
|
|
|
void UMAShowHide( WindowRef inWindowRef , Boolean show) ;
|
2001-10-28 19:32:42 +00:00
|
|
|
//void UMASelectWindow( WindowRef inWindowRef ) ;
|
|
|
|
//void UMABringToFront( WindowRef inWindowRef ) ;
|
|
|
|
//void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ;
|
|
|
|
// void UMACloseWindow(WindowRef inWindowRef) ;
|
1999-11-18 23:38:06 +00:00
|
|
|
|
|
|
|
// appearance manager
|
|
|
|
|
|
|
|
void UMADrawControl( ControlHandle inControl ) ;
|
|
|
|
|
2001-05-30 20:46:00 +00:00
|
|
|
void UMAEnableControl( ControlHandle inControl ) ;
|
|
|
|
void UMADisableControl( ControlHandle inControl ) ;
|
1999-11-18 23:38:06 +00:00
|
|
|
void UMAActivateControl( ControlHandle inControl ) ;
|
|
|
|
void UMADeactivateControl( ControlHandle inControl ) ;
|
2001-10-28 19:32:42 +00:00
|
|
|
//void UMAApplyThemeBackground (ThemeBackgroundKind inKind,
|
|
|
|
// const Rect * bounds,
|
|
|
|
// ThemeDrawState inState,
|
|
|
|
// SInt16 inDepth,
|
|
|
|
// Boolean inColorDev);
|
|
|
|
//void UMASetThemeWindowBackground (WindowRef inWindow,
|
|
|
|
// ThemeBrush inBrush,
|
|
|
|
// Boolean inUpdate) ;
|
|
|
|
/*
|
|
|
|
ControlHandle ::NewControl(WindowPtr owningWindow,
|
1999-11-18 23:38:06 +00:00
|
|
|
const Rect * boundsRect,
|
|
|
|
ConstStr255Param controlTitle,
|
|
|
|
Boolean initiallyVisible,
|
|
|
|
SInt16 initialValue,
|
|
|
|
SInt16 minimumValue,
|
|
|
|
SInt16 maximumValue,
|
|
|
|
SInt16 procID,
|
|
|
|
SInt32 controlReference) ;
|
2001-10-28 19:32:42 +00:00
|
|
|
*/
|
|
|
|
//void UMADisposeControl (ControlHandle theControl) ;
|
|
|
|
//void UMAHiliteControl (ControlHandle theControl,
|
|
|
|
// ControlPartCode hiliteState) ;
|
1999-11-18 23:38:06 +00:00
|
|
|
void UMAShowControl (ControlHandle theControl) ;
|
2001-12-19 21:33:33 +00:00
|
|
|
void UMAHideControl (ControlHandle theControl);
|
2001-10-28 19:32:42 +00:00
|
|
|
//void UMASetControlVisibility (ControlHandle inControl,
|
|
|
|
// Boolean inIsVisible,
|
|
|
|
// Boolean inDoDraw);
|
1999-11-18 23:38:06 +00:00
|
|
|
|
2001-10-28 19:32:42 +00:00
|
|
|
//bool UMAIsControlActive (ControlHandle inControl);
|
|
|
|
//bool UMAIsControlVisible (ControlHandle inControl);
|
1999-11-18 23:38:06 +00:00
|
|
|
void UMAActivateControl (ControlHandle inControl);
|
|
|
|
void UMADeactivateControl (ControlHandle inControl);
|
|
|
|
|
2001-10-28 19:32:42 +00:00
|
|
|
//OSErr UMAGetBestControlRect (ControlHandle inControl,
|
|
|
|
// Rect * outRect,
|
|
|
|
// SInt16 * outBaseLineOffset);
|
|
|
|
//OSErr UMASetControlFontStyle (ControlHandle inControl,
|
|
|
|
// const ControlFontStyleRec * inStyle) ;
|
1999-11-18 23:38:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
void UMAMoveControl( ControlHandle inControl , short x , short y ) ;
|
|
|
|
void UMASizeControl( ControlHandle inControl , short x , short y ) ;
|
|
|
|
// control hierarchy
|
|
|
|
|
2001-10-28 19:32:42 +00:00
|
|
|
//OSErr UMACreateRootControl (WindowPtr inWindow,
|
|
|
|
// ControlHandle * outControl) ;
|
1999-11-18 23:38:06 +00:00
|
|
|
|
2001-10-28 19:32:42 +00:00
|
|
|
//OSErr UMAEmbedControl (ControlHandle inControl,
|
|
|
|
// ControlHandle inContainer);
|
1999-11-18 23:38:06 +00:00
|
|
|
|
|
|
|
// keyboard focus
|
|
|
|
OSErr UMASetKeyboardFocus (WindowPtr inWindow,
|
|
|
|
ControlHandle inControl,
|
|
|
|
ControlFocusPart inPart) ;
|
|
|
|
|
|
|
|
|
|
|
|
// events
|
|
|
|
|
2001-10-28 19:32:42 +00:00
|
|
|
//ControlPartCode UMAHandleControlClick (ControlHandle inControl,
|
|
|
|
// Point inWhere,
|
|
|
|
// SInt16 inModifiers,
|
|
|
|
// ControlActionUPP inAction) ;
|
|
|
|
//SInt16 UMAHandleControlKey (ControlHandle inControl,
|
|
|
|
// SInt16 inKeyCode,
|
|
|
|
// SInt16 inCharCode,
|
|
|
|
// SInt16 inModifiers);
|
1999-11-18 23:38:06 +00:00
|
|
|
|
2001-10-28 19:32:42 +00:00
|
|
|
//void UMAIdleControls (WindowPtr inWindow) ;
|
1999-11-18 23:38:06 +00:00
|
|
|
|
|
|
|
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ;
|
|
|
|
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ;
|
|
|
|
|
|
|
|
// handling control data
|
2001-10-28 19:32:42 +00:00
|
|
|
/*
|
|
|
|
OSErr ::SetControlData (ControlHandle inControl,
|
1999-11-18 23:38:06 +00:00
|
|
|
ControlPartCode inPart,
|
|
|
|
ResType inTagName,
|
|
|
|
Size inSize,
|
|
|
|
Ptr inData) ;
|
|
|
|
|
2001-10-28 19:32:42 +00:00
|
|
|
OSErr ::GetControlData (ControlHandle inControl,
|
1999-11-18 23:38:06 +00:00
|
|
|
ControlPartCode inPart,
|
|
|
|
ResType inTagName,
|
|
|
|
Size inBufferSize,
|
|
|
|
Ptr outBuffer,
|
|
|
|
Size * outActualSize) ;
|
2001-10-28 19:32:42 +00:00
|
|
|
OSErr ::GetControlDataSize (ControlHandle inControl,
|
1999-11-18 23:38:06 +00:00
|
|
|
ControlPartCode inPart,
|
|
|
|
ResType inTagName,
|
|
|
|
Size * outMaxSize);
|
|
|
|
|
|
|
|
|
|
|
|
// system 8.0
|
|
|
|
|
|
|
|
short UMAFindWindow( Point inPoint , WindowRef *outWindow ) ;
|
|
|
|
OSStatus UMAGetWindowFeatures( WindowRef inWindowRef , UInt32 *outFeatures ) ;
|
|
|
|
OSStatus UMAGetWindowRegion( WindowRef inWindowRef , WindowRegionCode inRegionCode , RgnHandle ioWinRgn ) ;
|
|
|
|
OSStatus UMACollapseWindow( WindowRef inWindowRef , Boolean inCollapseIt ) ;
|
|
|
|
OSStatus UMACollapseAllWindows( Boolean inCollapseEm ) ;
|
|
|
|
Boolean UMAIsWindowCollapsed( WindowRef inWindowRef ) ;
|
|
|
|
Boolean UMAIsWindowCollapsable( WindowRef inWindowRef ) ;
|
|
|
|
|
|
|
|
// system 8.5
|
|
|
|
|
|
|
|
OSStatus UMACreateNewWindow( WindowClass windowClass , WindowAttributes attributes , const Rect *bounds, WindowRef *outWindow ) ;
|
|
|
|
OSStatus UMAGetWindowClass( WindowRef inWindowRef , WindowClass *outWindowClass ) ;
|
|
|
|
OSStatus UMAGetWindowAttributes( WindowRef inWindowRef , WindowAttributes *outAttributes ) ;
|
|
|
|
|
|
|
|
void UMAShowFloatingWindows() ;
|
|
|
|
void UMAHideFloatingWindows() ;
|
|
|
|
Boolean UMAAreFloatingWindowsVisible() ;
|
|
|
|
WindowRef UMAFrontWindow() ;
|
|
|
|
WindowRef UMAFrontNonFloatingWindow() ;
|
|
|
|
|
|
|
|
// floaters support
|
2001-10-28 19:32:42 +00:00
|
|
|
*/
|
1999-11-18 23:38:06 +00:00
|
|
|
bool UMAIsWindowFloating( WindowRef inWindow ) ;
|
|
|
|
bool UMAIsWindowModal( WindowRef inWindow ) ;
|
2001-10-28 19:32:42 +00:00
|
|
|
/*
|
1999-11-18 23:38:06 +00:00
|
|
|
WindowRef UMAGetActiveWindow() ;
|
|
|
|
WindowRef UMAGetActiveNonFloatingWindow() ;
|
2001-10-28 19:32:42 +00:00
|
|
|
*/
|
1999-11-18 23:38:06 +00:00
|
|
|
void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
|
|
|
|
|
2001-12-07 05:30:00 +00:00
|
|
|
OSStatus UMAGetHelpMenu(
|
|
|
|
MenuRef * outHelpMenu,
|
|
|
|
MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
|
|
|
|
|
2002-01-04 17:13:39 +00:00
|
|
|
// Appearance Drawing
|
|
|
|
|
|
|
|
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
|
|
|
|
|
|
|
|
// accessor helpers
|
|
|
|
|
2000-08-09 11:02:59 +00:00
|
|
|
#if !TARGET_CARBON
|
2002-01-04 17:13:39 +00:00
|
|
|
#define ClearCurrentScrap() ZeroScrap() ;
|
|
|
|
/*
|
2000-08-09 11:02:59 +00:00
|
|
|
#define GetPortTextFont( p) ((p)->txFont )
|
|
|
|
#define GetPortTextSize( p) ((p)->txSize )
|
|
|
|
#define GetPortTextFace( p) ((p)->txFace )
|
|
|
|
#define GetPortTextMode( p) ((p)->txMode )
|
|
|
|
#define GetRegionBounds( r , b) ((*b) = (**r).rgnBBox)
|
|
|
|
#define GetPortBounds( p , b) ((*b) = p->portRect )
|
|
|
|
#define GetWindowPortBounds( p , b) ((*b) = p->portRect )
|
|
|
|
#define GetPortVisibleRegion( p, r ) CopyRgn( p->visRgn , r )
|
|
|
|
#define GetQDGlobalsWhite( a ) (&((*a) = qd.white))
|
|
|
|
#define GetQDGlobalsBlack( a ) (&((*a) = qd.black))
|
2001-10-31 16:22:33 +00:00
|
|
|
#define GetQDGlobalsScreenBits( a ) ((*a) = qd.screenBits)
|
2000-08-09 11:02:59 +00:00
|
|
|
#define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow))
|
2001-06-03 10:29:00 +00:00
|
|
|
#define GetControlBounds( c , b ) &((*b) = (**c).contrlRect )
|
2000-08-09 11:02:59 +00:00
|
|
|
#define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap ))
|
2001-10-31 16:22:33 +00:00
|
|
|
#define GetControlOwner( control ) ((**control).contrlOwner)
|
2002-01-04 17:13:39 +00:00
|
|
|
|
2001-10-31 16:22:33 +00:00
|
|
|
#define GetPortPenMode( p ) (p->pnMode)
|
|
|
|
#define SetPortPenMode( p , mode ) (p->pnMode = mode )
|
|
|
|
// control manager
|
|
|
|
|
|
|
|
#define GetControlReference( control ) ((**control).contrlRfCon)
|
|
|
|
|
|
|
|
// list manager
|
|
|
|
|
|
|
|
#define SetListSelectionFlags( list , options ) (**list).selFlags = options
|
|
|
|
#define GetListRefCon( list ) (**list).refCon
|
2002-01-04 17:13:39 +00:00
|
|
|
*/
|
|
|
|
#else
|
|
|
|
|
|
|
|
// calls not in carbon
|
|
|
|
|
2001-10-31 16:22:33 +00:00
|
|
|
|
2001-10-28 19:32:42 +00:00
|
|
|
#endif
|
|
|
|
#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn )
|
1999-11-18 23:38:06 +00:00
|
|
|
|
2001-02-15 21:51:14 +00:00
|
|
|
#endif
|