#if !TARGET_CARBON
#define GetControlOwner( control ) (**control).contrlOwner
+// since we always call this in the right context we don't have to set and reset the port
+#define InvalWindowRgn( window , rgn ) InvalRgn( rgn )
#endif
static bool sUMAHasAppearance = false ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif
+ Point zero = { 0 , 0 } ;
+ LocalToGlobal( &zero ) ;
+ OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE
if ( UMAHasAppearance() )
{
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
#endif
+ DisposeRgn( updateRgn ) ;
+
+DisposeRgn( updateRgn ) ;
+
}
void UMADrawControl( ControlHandle inControl )
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif
+ Point zero = { 0 , 0 } ;
+ LocalToGlobal( &zero ) ;
+ OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE
if ( UMAHasAppearance() )
{
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
#endif
+ DisposeRgn( updateRgn ) ;
+
}
void UMAMoveControl( ControlHandle inControl , short x , short y )
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif
+ Point zero = { 0 , 0 } ;
+ LocalToGlobal( &zero ) ;
+ OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE
if ( UMAHasAppearance() )
{
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
#endif
+ DisposeRgn( updateRgn ) ;
+
}
void UMASizeControl( ControlHandle inControl , short x , short y )
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif
+ Point zero = { 0 , 0 } ;
+ LocalToGlobal( &zero ) ;
+ OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE
if ( UMAHasAppearance() )
{
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
#endif
+ DisposeRgn( updateRgn ) ;
+
+
}
void UMADeactivateControl( ControlHandle inControl )
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif
+ Point zero = { 0 , 0 } ;
+ LocalToGlobal( &zero ) ;
+ OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE
if ( UMAHasAppearance() )
{
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
#endif
+ DisposeRgn( updateRgn ) ;
+
}
void UMASetThemeWindowBackground (WindowRef inWindow,
}
}
-
void UMAHiliteControl (ControlHandle inControl,
ControlPartCode hiliteState)
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif
+ Point zero = { 0 , 0 } ;
+ LocalToGlobal( &zero ) ;
+ OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
if ( UMAHasAppearance() )
{
::HiliteControl( inControl , hiliteState ) ;
{
::HiliteControl( inControl , hiliteState ) ;
}
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
#endif
+ DisposeRgn( updateRgn ) ;
+
}
void UMAShowControl (ControlHandle inControl)
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if TARGET_CARBON
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
#endif
+ Point zero = { 0 , 0 } ;
+ LocalToGlobal( &zero ) ;
+ OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
if ( UMAHasAppearance() )
{
::ShowControl( inControl ) ;
{
::ShowControl( inControl ) ;
}
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
#endif
+ DisposeRgn( updateRgn ) ;
+
}
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if TARGET_CARBON
GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( inWindow , updateRgn ) ;
#endif
+ Point zero = { 0 , 0 } ;
+ LocalToGlobal( &zero ) ;
+ OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
#if UMA_USE_APPEARANCE
if ( UMAHasAppearance() )
{
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( inWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
#endif
+ DisposeRgn( updateRgn ) ;
+
}
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl )