conditional compilation for Universal Interfaces (3.4 or later)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -457,132 +457,177 @@ void UMACloseWindow(WindowRef inWindowRef)
|
|||||||
|
|
||||||
void UMAActivateControl( ControlHandle inControl )
|
void UMAActivateControl( ControlHandle inControl )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::ActivateControl( inControl ) ;
|
::ActivateControl( inControl ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGAActivateControl( inControl ) ;
|
AGAActivateControl( inControl ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMADrawControl( ControlHandle inControl )
|
void UMADrawControl( ControlHandle inControl )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::DrawControlInCurrentPort( inControl ) ;
|
::DrawControlInCurrentPort( inControl ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGADrawControl( inControl ) ;
|
AGADrawControl( inControl ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMAMoveControl( ControlHandle inControl , short x , short y )
|
void UMAMoveControl( ControlHandle inControl , short x , short y )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::MoveControl( inControl , x , y ) ;
|
::MoveControl( inControl , x , y ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGAMoveControl( inControl , x ,y ) ;
|
AGAMoveControl( inControl , x ,y ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMASizeControl( ControlHandle inControl , short x , short y )
|
void UMASizeControl( ControlHandle inControl , short x , short y )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::SizeControl( inControl , x , y ) ;
|
::SizeControl( inControl , x , y ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGASizeControl( inControl , x ,y ) ;
|
AGASizeControl( inControl , x ,y ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMADeactivateControl( ControlHandle inControl )
|
void UMADeactivateControl( ControlHandle inControl )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::DeactivateControl( inControl ) ;
|
::DeactivateControl( inControl ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGADeactivateControl( inControl ) ;
|
AGADeactivateControl( inControl ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMASetThemeWindowBackground (WindowRef inWindow,
|
void UMASetThemeWindowBackground (WindowRef inWindow,
|
||||||
ThemeBrush inBrush,
|
ThemeBrush inBrush,
|
||||||
Boolean inUpdate)
|
Boolean inUpdate)
|
||||||
{
|
{
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::SetThemeWindowBackground( inWindow ,inBrush , inUpdate ) ;
|
::SetThemeWindowBackground( inWindow ,inBrush , inUpdate ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGASetThemeWindowBackground( inWindow , inBrush , inUpdate ) ;
|
AGASetThemeWindowBackground( inWindow , inBrush , inUpdate ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -612,15 +657,15 @@ void UMAApplyThemeBackground (ThemeBackgroundKind inKind,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ControlHandle UMANewControl(WindowPtr owningWindow,
|
ControlHandle UMANewControl(WindowPtr owningWindow,
|
||||||
const Rect * boundsRect,
|
const Rect * boundsRect,
|
||||||
ConstStr255Param controlTitle,
|
ConstStr255Param controlTitle,
|
||||||
Boolean initiallyVisible,
|
Boolean initiallyVisible,
|
||||||
SInt16 initialValue,
|
SInt16 initialValue,
|
||||||
SInt16 minimumValue,
|
SInt16 minimumValue,
|
||||||
SInt16 maximumValue,
|
SInt16 maximumValue,
|
||||||
SInt16 procID,
|
SInt16 procID,
|
||||||
SInt32 controlReference)
|
SInt32 controlReference)
|
||||||
{
|
{
|
||||||
ControlHandle theControl = NULL ;
|
ControlHandle theControl = NULL ;
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
@@ -645,73 +690,90 @@ ControlHandle UMANewControl(WindowPtr owningWindow,
|
|||||||
|
|
||||||
void UMADisposeControl (ControlHandle theControl)
|
void UMADisposeControl (ControlHandle theControl)
|
||||||
{
|
{
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::DisposeControl( theControl ) ;
|
::DisposeControl( theControl ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
::DisposeControl( theControl ) ;
|
::DisposeControl( theControl ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UMAHiliteControl (ControlHandle theControl,
|
void UMAHiliteControl (ControlHandle inControl,
|
||||||
ControlPartCode hiliteState)
|
ControlPartCode hiliteState)
|
||||||
{
|
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
|
||||||
GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
|
|
||||||
if ( UMAHasAppearance() )
|
|
||||||
{
|
|
||||||
::HiliteControl( theControl , hiliteState ) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
::HiliteControl( theControl , hiliteState ) ;
|
|
||||||
}
|
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void UMAShowControl (ControlHandle theControl)
|
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
if ( UMAHasAppearance() )
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
{
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
::ShowControl( theControl ) ;
|
#else
|
||||||
}
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
else
|
#endif
|
||||||
{
|
if ( UMAHasAppearance() )
|
||||||
::ShowControl( theControl ) ;
|
{
|
||||||
}
|
::HiliteControl( inControl , hiliteState ) ;
|
||||||
InvalRgn( updateRgn ) ;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::HiliteControl( inControl , hiliteState ) ;
|
||||||
|
}
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMAShowControl (ControlHandle inControl)
|
||||||
|
{
|
||||||
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
|
if ( UMAHasAppearance() )
|
||||||
|
{
|
||||||
|
::ShowControl( inControl ) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::ShowControl( inControl ) ;
|
||||||
|
}
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UMAHideControl (ControlHandle theControl)
|
void UMAHideControl (ControlHandle inControl)
|
||||||
{
|
{
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::HideControl( theControl ) ;
|
::HideControl( inControl ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
::HideControl( theControl ) ;
|
::HideControl( inControl ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UMASetControlVisibility (ControlHandle inControl,
|
void UMASetControlVisibility (ControlHandle inControl,
|
||||||
Boolean inIsVisible,
|
Boolean inIsVisible,
|
||||||
Boolean inDoDraw)
|
Boolean inDoDraw)
|
||||||
{
|
{
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
::SetControlVisibility( inControl , inIsVisible, inDoDraw ) ;
|
::SetControlVisibility( inControl , inIsVisible, inDoDraw ) ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -938,24 +1000,32 @@ void UMAIdleControls (WindowPtr inWindow)
|
|||||||
|
|
||||||
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
|
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
GetWindowUpdateRgn( inWindow , updateRgn ) ;
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( inWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
UpdateControls( inWindow , inRgn ) ;
|
UpdateControls( inWindow , inRgn ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGAUpdateControls( inWindow , inRgn ) ;
|
AGAUpdateControls( inWindow , inRgn ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( inWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl )
|
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl )
|
||||||
|
372
src/mac/uma.cpp
372
src/mac/uma.cpp
@@ -457,132 +457,177 @@ void UMACloseWindow(WindowRef inWindowRef)
|
|||||||
|
|
||||||
void UMAActivateControl( ControlHandle inControl )
|
void UMAActivateControl( ControlHandle inControl )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::ActivateControl( inControl ) ;
|
::ActivateControl( inControl ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGAActivateControl( inControl ) ;
|
AGAActivateControl( inControl ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMADrawControl( ControlHandle inControl )
|
void UMADrawControl( ControlHandle inControl )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::DrawControlInCurrentPort( inControl ) ;
|
::DrawControlInCurrentPort( inControl ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGADrawControl( inControl ) ;
|
AGADrawControl( inControl ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMAMoveControl( ControlHandle inControl , short x , short y )
|
void UMAMoveControl( ControlHandle inControl , short x , short y )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::MoveControl( inControl , x , y ) ;
|
::MoveControl( inControl , x , y ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGAMoveControl( inControl , x ,y ) ;
|
AGAMoveControl( inControl , x ,y ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMASizeControl( ControlHandle inControl , short x , short y )
|
void UMASizeControl( ControlHandle inControl , short x , short y )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::SizeControl( inControl , x , y ) ;
|
::SizeControl( inControl , x , y ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGASizeControl( inControl , x ,y ) ;
|
AGASizeControl( inControl , x ,y ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMADeactivateControl( ControlHandle inControl )
|
void UMADeactivateControl( ControlHandle inControl )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::DeactivateControl( inControl ) ;
|
::DeactivateControl( inControl ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGADeactivateControl( inControl ) ;
|
AGADeactivateControl( inControl ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMASetThemeWindowBackground (WindowRef inWindow,
|
void UMASetThemeWindowBackground (WindowRef inWindow,
|
||||||
ThemeBrush inBrush,
|
ThemeBrush inBrush,
|
||||||
Boolean inUpdate)
|
Boolean inUpdate)
|
||||||
{
|
{
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::SetThemeWindowBackground( inWindow ,inBrush , inUpdate ) ;
|
::SetThemeWindowBackground( inWindow ,inBrush , inUpdate ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGASetThemeWindowBackground( inWindow , inBrush , inUpdate ) ;
|
AGASetThemeWindowBackground( inWindow , inBrush , inUpdate ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -612,15 +657,15 @@ void UMAApplyThemeBackground (ThemeBackgroundKind inKind,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ControlHandle UMANewControl(WindowPtr owningWindow,
|
ControlHandle UMANewControl(WindowPtr owningWindow,
|
||||||
const Rect * boundsRect,
|
const Rect * boundsRect,
|
||||||
ConstStr255Param controlTitle,
|
ConstStr255Param controlTitle,
|
||||||
Boolean initiallyVisible,
|
Boolean initiallyVisible,
|
||||||
SInt16 initialValue,
|
SInt16 initialValue,
|
||||||
SInt16 minimumValue,
|
SInt16 minimumValue,
|
||||||
SInt16 maximumValue,
|
SInt16 maximumValue,
|
||||||
SInt16 procID,
|
SInt16 procID,
|
||||||
SInt32 controlReference)
|
SInt32 controlReference)
|
||||||
{
|
{
|
||||||
ControlHandle theControl = NULL ;
|
ControlHandle theControl = NULL ;
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
@@ -645,73 +690,90 @@ ControlHandle UMANewControl(WindowPtr owningWindow,
|
|||||||
|
|
||||||
void UMADisposeControl (ControlHandle theControl)
|
void UMADisposeControl (ControlHandle theControl)
|
||||||
{
|
{
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::DisposeControl( theControl ) ;
|
::DisposeControl( theControl ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
::DisposeControl( theControl ) ;
|
::DisposeControl( theControl ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UMAHiliteControl (ControlHandle theControl,
|
void UMAHiliteControl (ControlHandle inControl,
|
||||||
ControlPartCode hiliteState)
|
ControlPartCode hiliteState)
|
||||||
{
|
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
|
||||||
GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
|
|
||||||
if ( UMAHasAppearance() )
|
|
||||||
{
|
|
||||||
::HiliteControl( theControl , hiliteState ) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
::HiliteControl( theControl , hiliteState ) ;
|
|
||||||
}
|
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void UMAShowControl (ControlHandle theControl)
|
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
if ( UMAHasAppearance() )
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
{
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
::ShowControl( theControl ) ;
|
#else
|
||||||
}
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
else
|
#endif
|
||||||
{
|
if ( UMAHasAppearance() )
|
||||||
::ShowControl( theControl ) ;
|
{
|
||||||
}
|
::HiliteControl( inControl , hiliteState ) ;
|
||||||
InvalRgn( updateRgn ) ;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::HiliteControl( inControl , hiliteState ) ;
|
||||||
|
}
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMAShowControl (ControlHandle inControl)
|
||||||
|
{
|
||||||
|
WindowRef theWindow = GetControlOwner(inControl) ;
|
||||||
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( theWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
|
if ( UMAHasAppearance() )
|
||||||
|
{
|
||||||
|
::ShowControl( inControl ) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::ShowControl( inControl ) ;
|
||||||
|
}
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( theWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UMAHideControl (ControlHandle theControl)
|
void UMAHideControl (ControlHandle inControl)
|
||||||
{
|
{
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
::HideControl( theControl ) ;
|
::HideControl( inControl ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
::HideControl( theControl ) ;
|
::HideControl( inControl ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UMASetControlVisibility (ControlHandle inControl,
|
void UMASetControlVisibility (ControlHandle inControl,
|
||||||
Boolean inIsVisible,
|
Boolean inIsVisible,
|
||||||
Boolean inDoDraw)
|
Boolean inDoDraw)
|
||||||
{
|
{
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
::SetControlVisibility( inControl , inIsVisible, inDoDraw ) ;
|
::SetControlVisibility( inControl , inIsVisible, inDoDraw ) ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -938,24 +1000,32 @@ void UMAIdleControls (WindowPtr inWindow)
|
|||||||
|
|
||||||
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
|
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
GetWindowUpdateRgn( inWindow , updateRgn ) ;
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) ;
|
||||||
|
#else
|
||||||
|
GetWindowUpdateRgn( inWindow , updateRgn ) ;
|
||||||
|
#endif
|
||||||
#if UMA_USE_APPEARANCE
|
#if UMA_USE_APPEARANCE
|
||||||
if ( UMAHasAppearance() )
|
if ( UMAHasAppearance() )
|
||||||
{
|
{
|
||||||
UpdateControls( inWindow , inRgn ) ;
|
UpdateControls( inWindow , inRgn ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
{
|
{
|
||||||
AGAUpdateControls( inWindow , inRgn ) ;
|
AGAUpdateControls( inWindow , inRgn ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||||
|
InvalWindowRgn( inWindow, updateRgn) ;
|
||||||
|
#else
|
||||||
|
InvalRgn( updateRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
InvalRgn( updateRgn ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl )
|
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl )
|
||||||
|
Reference in New Issue
Block a user