X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c809f3be86c79dc44854433fec4ccfc030d4f7b9..3ce946d47ef03fcf330b0a28c0ff815ea480da55:/src/mac/carbon/uma.cpp?ds=sidebyside diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index f34db6bc39..3be88ef8ec 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -1,15 +1,20 @@ #include "wx/defs.h" +#include "wx/dc.h" #include "wx/mac/uma.h" #include "wx/mac/aga.h" #ifdef __UNIX__ - #include + #include #else #include #endif // init +#if !TARGET_CARBON +#define GetControlOwner( control ) (**control).contrlOwner +#endif + static bool sUMAHasAppearance = false ; static long sUMAAppearanceVersion = 0 ; extern int gAGABackgroundColor ; @@ -452,6 +457,8 @@ void UMACloseWindow(WindowRef inWindowRef) void UMAActivateControl( ControlHandle inControl ) { + RgnHandle updateRgn = NewRgn() ; + GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ; #if UMA_USE_APPEARANCE if ( UMAHasAppearance() ) { @@ -467,10 +474,13 @@ void UMAActivateControl( ControlHandle inControl ) { } #endif + InvalRgn( updateRgn ) ; } void UMADrawControl( ControlHandle inControl ) { + RgnHandle updateRgn = NewRgn() ; + GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ; #if UMA_USE_APPEARANCE if ( UMAHasAppearance() ) { @@ -486,10 +496,13 @@ void UMADrawControl( ControlHandle inControl ) { } #endif + InvalRgn( updateRgn ) ; } void UMAMoveControl( ControlHandle inControl , short x , short y ) { + RgnHandle updateRgn = NewRgn() ; + GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ; #if UMA_USE_APPEARANCE if ( UMAHasAppearance() ) { @@ -505,10 +518,13 @@ void UMAMoveControl( ControlHandle inControl , short x , short y ) { } #endif + InvalRgn( updateRgn ) ; } void UMASizeControl( ControlHandle inControl , short x , short y ) { + RgnHandle updateRgn = NewRgn() ; + GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ; #if UMA_USE_APPEARANCE if ( UMAHasAppearance() ) { @@ -524,10 +540,13 @@ void UMASizeControl( ControlHandle inControl , short x , short y ) { } #endif + InvalRgn( updateRgn ) ; } void UMADeactivateControl( ControlHandle inControl ) { + RgnHandle updateRgn = NewRgn() ; + GetWindowUpdateRgn( GetControlOwner(inControl) , updateRgn ) ; #if UMA_USE_APPEARANCE if ( UMAHasAppearance() ) { @@ -543,6 +562,7 @@ void UMADeactivateControl( ControlHandle inControl ) { } #endif + InvalRgn( updateRgn ) ; } void UMASetThemeWindowBackground (WindowRef inWindow, @@ -639,6 +659,8 @@ void UMADisposeControl (ControlHandle theControl) void UMAHiliteControl (ControlHandle theControl, ControlPartCode hiliteState) { + RgnHandle updateRgn = NewRgn() ; + GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ; if ( UMAHasAppearance() ) { ::HiliteControl( theControl , hiliteState ) ; @@ -647,11 +669,14 @@ void UMAHiliteControl (ControlHandle theControl, { ::HiliteControl( theControl , hiliteState ) ; } + InvalRgn( updateRgn ) ; } void UMAShowControl (ControlHandle theControl) { + RgnHandle updateRgn = NewRgn() ; + GetWindowUpdateRgn( GetControlOwner(theControl) , updateRgn ) ; if ( UMAHasAppearance() ) { ::ShowControl( theControl ) ; @@ -660,6 +685,7 @@ void UMAShowControl (ControlHandle theControl) { ::ShowControl( theControl ) ; } + InvalRgn( updateRgn ) ; } @@ -834,7 +860,6 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow, } #endif SetPort( port ) ; - wxDC::MacInvalidateSetup() ; return err ; } @@ -913,6 +938,8 @@ void UMAIdleControls (WindowPtr inWindow) void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) { + RgnHandle updateRgn = NewRgn() ; + GetWindowUpdateRgn( inWindow , updateRgn ) ; #if UMA_USE_APPEARANCE if ( UMAHasAppearance() ) { @@ -928,6 +955,7 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) { } #endif + InvalRgn( updateRgn ) ; } OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) @@ -1378,7 +1406,6 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) UMADeactivateControl( control ) ; } SetPort( port ) ; - wxDC::MacInvalidateSetup() ; } } OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )