1999-11-18 18:38:06 -05: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-10 23:30:47 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-11-18 18:38:06 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef H_UMA
|
|
|
|
#define H_UMA
|
|
|
|
|
2001-07-15 17:04:44 -04:00
|
|
|
#if defined(__POWERPC__)
|
|
|
|
#if defined(__DARWIN__)
|
2001-02-15 16:51:14 -05:00
|
|
|
#include <Carbon/Carbon.h>
|
|
|
|
#endif
|
1999-11-18 18:38:06 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !TARGET_CARBON
|
2000-08-09 07:02:59 -04:00
|
|
|
// this is now defined in the latest headers
|
|
|
|
// typedef short MenuItemIndex ;
|
1999-11-18 18:38:06 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
|
2001-02-08 16:13:12 -05:00
|
|
|
void UMACleanupToolbox() ;
|
1999-11-18 18:38:06 -05:00
|
|
|
bool UMAHasAppearance() ;
|
|
|
|
long UMAGetAppearanceVersion() ;
|
2001-10-28 14:32:42 -05:00
|
|
|
bool UMAHasWindowManager() ;
|
|
|
|
long UMAGetWindowManagerAttr() ;
|
2002-01-01 04:54:17 -05:00
|
|
|
bool UMAHasAquaLayout() ;
|
1999-11-18 18:38:06 -05:00
|
|
|
|
|
|
|
// process manager
|
|
|
|
|
|
|
|
long UMAGetProcessMode() ;
|
|
|
|
bool UMAGetProcessModeDoesActivateOnFGSwitch() ;
|
|
|
|
|
|
|
|
// menu manager
|
|
|
|
|
2000-08-09 07:02:59 -04:00
|
|
|
void UMASetMenuTitle( MenuRef menu , StringPtr title ) ;
|
|
|
|
UInt32 UMAMenuEvent( EventRecord *inEvent ) ;
|
1999-11-18 18:38:06 -05:00
|
|
|
void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
|
|
|
|
void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
|
2000-08-09 07:02:59 -04: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 14:32:42 -05:00
|
|
|
// void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ;
|
2000-08-09 07:02:59 -04:00
|
|
|
|
2001-10-28 14:32:42 -05:00
|
|
|
// MenuRef ::NewMenu( SInt16 menuid , StringPtr label ) ;
|
|
|
|
// void UMADisposeMenu( MenuRef menu ) ;
|
2000-08-09 07:02:59 -04:00
|
|
|
|
|
|
|
// handling the menubar
|
|
|
|
|
2001-10-28 14:32:42 -05:00
|
|
|
// void UMADeleteMenu( SInt16 menuId ) ;
|
|
|
|
// void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ;
|
|
|
|
// void UMADrawMenuBar() ;
|
2000-08-09 07:02:59 -04:00
|
|
|
|
1999-11-18 18:38:06 -05:00
|
|
|
// quickdraw
|
|
|
|
|
|
|
|
void UMAShowWatchCursor() ;
|
|
|
|
void UMAShowArrowCursor() ;
|
|
|
|
|
2001-06-28 02:30:58 -04:00
|
|
|
#if TARGET_CARBON && PM_USE_SESSION_APIS
|
|
|
|
OSStatus UMAPrOpen(PMPrintSession *macPrintSession) ;
|
|
|
|
OSStatus UMAPrClose(PMPrintSession *macPrintSession) ;
|
2001-06-23 13:13:03 -04:00
|
|
|
#else
|
2001-02-08 16:13:12 -05:00
|
|
|
OSStatus UMAPrOpen() ;
|
|
|
|
OSStatus UMAPrClose() ;
|
2001-06-23 13:13:03 -04:00
|
|
|
#endif
|
2000-08-09 07:02:59 -04:00
|
|
|
|
1999-11-18 18:38:06 -05: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 14:32:42 -05:00
|
|
|
//void UMAShowWindow( WindowRef inWindowRef ) ;
|
|
|
|
//void UMAHideWindow( WindowRef inWindowRef ) ;
|
1999-11-18 18:38:06 -05:00
|
|
|
void UMAShowHide( WindowRef inWindowRef , Boolean show) ;
|
2001-10-28 14:32:42 -05:00
|
|
|
//void UMASelectWindow( WindowRef inWindowRef ) ;
|
|
|
|
//void UMABringToFront( WindowRef inWindowRef ) ;
|
|
|
|
//void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ;
|
|
|
|
// void UMACloseWindow(WindowRef inWindowRef) ;
|
1999-11-18 18:38:06 -05:00
|
|
|
|
|
|
|
// appearance manager
|
|
|
|
|
|
|
|
void UMADrawControl( ControlHandle inControl ) ;
|
|
|
|
|
2001-05-30 16:46:00 -04:00
|
|
|
void UMAEnableControl( ControlHandle inControl ) ;
|
|
|
|
void UMADisableControl( ControlHandle inControl ) ;
|
1999-11-18 18:38:06 -05:00
|
|
|
void UMAActivateControl( ControlHandle inControl ) ;
|
|
|
|
void UMADeactivateControl( ControlHandle inControl ) ;
|
2001-10-28 14:32:42 -05: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 18:38:06 -05:00
|
|
|
const Rect * boundsRect,
|
|
|
|
ConstStr255Param controlTitle,
|
|
|
|
Boolean initiallyVisible,
|
|
|
|
SInt16 initialValue,
|
|
|
|
SInt16 minimumValue,
|
|
|
|
SInt16 maximumValue,
|
|
|
|
SInt16 procID,
|
|
|
|
SInt32 controlReference) ;
|
2001-10-28 14:32:42 -05:00
|
|
|
*/
|
|
|
|
//void UMADisposeControl (ControlHandle theControl) ;
|
|
|
|
//void UMAHiliteControl (ControlHandle theControl,
|
|
|
|
// ControlPartCode hiliteState) ;
|
1999-11-18 18:38:06 -05:00
|
|
|
void UMAShowControl (ControlHandle theControl) ;
|
2001-12-19 16:33:33 -05:00
|
|
|
void UMAHideControl (ControlHandle theControl);
|
2001-10-28 14:32:42 -05:00
|
|
|
//void UMASetControlVisibility (ControlHandle inControl,
|
|
|
|
// Boolean inIsVisible,
|
|
|
|
// Boolean inDoDraw);
|
1999-11-18 18:38:06 -05:00
|
|
|
|
2001-10-28 14:32:42 -05:00
|
|
|
//bool UMAIsControlActive (ControlHandle inControl);
|
|
|
|
//bool UMAIsControlVisible (ControlHandle inControl);
|
1999-11-18 18:38:06 -05:00
|
|
|
void UMAActivateControl (ControlHandle inControl);
|
|
|
|
void UMADeactivateControl (ControlHandle inControl);
|
|
|
|
|
2001-10-28 14:32:42 -05:00
|
|
|
//OSErr UMAGetBestControlRect (ControlHandle inControl,
|
|
|
|
// Rect * outRect,
|
|
|
|
// SInt16 * outBaseLineOffset);
|
|
|
|
//OSErr UMASetControlFontStyle (ControlHandle inControl,
|
|
|
|
// const ControlFontStyleRec * inStyle) ;
|
1999-11-18 18:38:06 -05:00
|
|
|
|
|
|
|
|
|
|
|
void UMAMoveControl( ControlHandle inControl , short x , short y ) ;
|
|
|
|
void UMASizeControl( ControlHandle inControl , short x , short y ) ;
|
|
|
|
// control hierarchy
|
|
|
|
|
2001-10-28 14:32:42 -05:00
|
|
|
//OSErr UMACreateRootControl (WindowPtr inWindow,
|
|
|
|
// ControlHandle * outControl) ;
|
1999-11-18 18:38:06 -05:00
|
|
|
|
2001-10-28 14:32:42 -05:00
|
|
|
//OSErr UMAEmbedControl (ControlHandle inControl,
|
|
|
|
// ControlHandle inContainer);
|
1999-11-18 18:38:06 -05:00
|
|
|
|
|
|
|
// keyboard focus
|
|
|
|
OSErr UMASetKeyboardFocus (WindowPtr inWindow,
|
|
|
|
ControlHandle inControl,
|
|
|
|
ControlFocusPart inPart) ;
|
|
|
|
|
|
|
|
|
|
|
|
// events
|
|
|
|
|
2001-10-28 14:32:42 -05:00
|
|
|
//ControlPartCode UMAHandleControlClick (ControlHandle inControl,
|
|
|
|
// Point inWhere,
|
|
|
|
// SInt16 inModifiers,
|
|
|
|
// ControlActionUPP inAction) ;
|
|
|
|
//SInt16 UMAHandleControlKey (ControlHandle inControl,
|
|
|
|
// SInt16 inKeyCode,
|
|
|
|
// SInt16 inCharCode,
|
|
|
|
// SInt16 inModifiers);
|
1999-11-18 18:38:06 -05:00
|
|
|
|
2001-10-28 14:32:42 -05:00
|
|
|
//void UMAIdleControls (WindowPtr inWindow) ;
|
1999-11-18 18:38:06 -05:00
|
|
|
|
|
|
|
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ;
|
|
|
|
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ;
|
|
|
|
|
|
|
|
// handling control data
|
2001-10-28 14:32:42 -05:00
|
|
|
/*
|
|
|
|
OSErr ::SetControlData (ControlHandle inControl,
|
1999-11-18 18:38:06 -05:00
|
|
|
ControlPartCode inPart,
|
|
|
|
ResType inTagName,
|
|
|
|
Size inSize,
|
|
|
|
Ptr inData) ;
|
|
|
|
|
2001-10-28 14:32:42 -05:00
|
|
|
OSErr ::GetControlData (ControlHandle inControl,
|
1999-11-18 18:38:06 -05:00
|
|
|
ControlPartCode inPart,
|
|
|
|
ResType inTagName,
|
|
|
|
Size inBufferSize,
|
|
|
|
Ptr outBuffer,
|
|
|
|
Size * outActualSize) ;
|
2001-10-28 14:32:42 -05:00
|
|
|
OSErr ::GetControlDataSize (ControlHandle inControl,
|
1999-11-18 18:38:06 -05: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 14:32:42 -05:00
|
|
|
*/
|
1999-11-18 18:38:06 -05:00
|
|
|
bool UMAIsWindowFloating( WindowRef inWindow ) ;
|
|
|
|
bool UMAIsWindowModal( WindowRef inWindow ) ;
|
2001-10-28 14:32:42 -05:00
|
|
|
/*
|
1999-11-18 18:38:06 -05:00
|
|
|
WindowRef UMAGetActiveWindow() ;
|
|
|
|
WindowRef UMAGetActiveNonFloatingWindow() ;
|
2001-10-28 14:32:42 -05:00
|
|
|
*/
|
1999-11-18 18:38:06 -05:00
|
|
|
void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
|
|
|
|
|
2001-12-07 00:30:00 -05:00
|
|
|
OSStatus UMAGetHelpMenu(
|
|
|
|
MenuRef * outHelpMenu,
|
|
|
|
MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
|
|
|
|
|
2000-08-09 07:02:59 -04:00
|
|
|
#if !TARGET_CARBON
|
|
|
|
#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 11:22:33 -05:00
|
|
|
#define GetQDGlobalsScreenBits( a ) ((*a) = qd.screenBits)
|
2000-08-09 07:02:59 -04:00
|
|
|
#define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow))
|
2001-06-03 06:29:00 -04:00
|
|
|
#define GetControlBounds( c , b ) &((*b) = (**c).contrlRect )
|
2000-08-09 07:02:59 -04:00
|
|
|
#define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap ))
|
2001-10-31 11:22:33 -05:00
|
|
|
#define GetControlOwner( control ) ((**control).contrlOwner)
|
2001-10-28 14:32:42 -05:00
|
|
|
#define InvalWindowRgn( window , rgn ) InvalRgn( rgn )
|
2001-10-31 11:22:33 -05:00
|
|
|
#define GetPortPenMode( p ) (p->pnMode)
|
|
|
|
#define SetPortPenMode( p , mode ) (p->pnMode = mode )
|
2001-11-23 17:23:45 -05:00
|
|
|
#define ClearCurrentScrap() ZeroScrap() ;
|
2001-10-31 11:22:33 -05:00
|
|
|
// control manager
|
|
|
|
|
|
|
|
#define GetControlReference( control ) ((**control).contrlRfCon)
|
|
|
|
|
|
|
|
// list manager
|
|
|
|
|
|
|
|
#define SetListSelectionFlags( list , options ) (**list).selFlags = options
|
|
|
|
#define GetListRefCon( list ) (**list).refCon
|
|
|
|
|
2001-10-28 14:32:42 -05:00
|
|
|
#endif
|
|
|
|
#if TARGET_CARBON
|
|
|
|
#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn )
|
2000-08-09 07:02:59 -04:00
|
|
|
#endif
|
|
|
|
// Appearance Drawing
|
|
|
|
|
|
|
|
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
|
1999-11-18 18:38:06 -05:00
|
|
|
|
2001-02-15 16:51:14 -05:00
|
|
|
#endif
|