X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b781a6729859abc77e6ca5b1f81cbaad974a78f..3417f6618c41a6b8a7adc29ad5a12ca8c0dad248:/src/mac/uma.cpp?ds=sidebyside diff --git a/src/mac/uma.cpp b/src/mac/uma.cpp index f95b4c52bd..13d4e27883 100644 --- a/src/mac/uma.cpp +++ b/src/mac/uma.cpp @@ -1,8 +1,13 @@ -#include -#include +#include "wx/defs.h" +#include "wx/dc.h" +#include "wx/mac/uma.h" +#include "wx/mac/aga.h" - -#include "Navigation.h" +#ifdef __UNIX__ + #include +#else + #include +#endif // init @@ -75,10 +80,16 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls ) #endif // UMA_USE_WINDOWMGR #endif +#ifndef __UNIX__ +#if TARGET_CARBON +// Call currently implicitely done : InitFloatingWindows() ; +#else if ( sUMAHasWindowManager ) InitFloatingWindows() ; else InitWindows(); +#endif +#endif if ( NavServicesAvailable() ) { @@ -387,13 +398,22 @@ void UMASetWTitleC( WindowRef inWindowRef , const char *title ) Str255 ptitle ; strncpy( (char*)ptitle , title , 96 ) ; ptitle[96] = 0 ; +#if TARGET_CARBON + c2pstrcpy( ptitle, (char *)ptitle ) ; +#else c2pstr( (char*)ptitle ) ; +#endif SetWTitle( inWindowRef , ptitle ) ; } + void UMAGetWTitleC( WindowRef inWindowRef , char *title ) { GetWTitle( inWindowRef , (unsigned char*)title ) ; +#if TARGET_CARBON + p2cstrcpy( title, (unsigned char *)title ) ; +#else p2cstr( (unsigned char*)title ) ; +#endif } void UMAShowWindow( WindowRef inWindowRef ) @@ -648,11 +668,11 @@ void UMAHideControl (ControlHandle theControl) { if ( UMAHasAppearance() ) { - ::HideControl( theControl ) ; + ::HideControl( theControl ) ; } else { - ::HideControl( theControl ) ; + ::HideControl( theControl ) ; } } @@ -815,6 +835,7 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow, } #endif SetPort( port ) ; + wxDC::MacInvalidateSetup() ; return err ; } @@ -1339,33 +1360,43 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) { // bool isHighlighted = IsWindowHighlited( inWindowRef ) ; // if ( inActivate != isHightlited ) - HiliteWindow( inWindowRef , inActivate ) ; - ControlHandle control = NULL ; - UMAGetRootControl( inWindowRef , & control ) ; - if ( control ) - { - if ( inActivate ) - UMAActivateControl( control ) ; - else - UMADeactivateControl( control ) ; - } + GrafPtr port ; + GetPort( &port ) ; +#if TARGET_CARBON + SetPort( GetWindowPort( inWindowRef ) ) ; +#else + SetPort( inWindowRef ) ; +#endif + SetOrigin( 0 , 0 ) ; + HiliteWindow( inWindowRef , inActivate ) ; + ControlHandle control = NULL ; + UMAGetRootControl( inWindowRef , & control ) ; + if ( control ) + { + if ( inActivate ) + UMAActivateControl( control ) ; + else + UMADeactivateControl( control ) ; + } + SetPort( port ) ; + wxDC::MacInvalidateSetup() ; } } OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) { #if UMA_USE_APPEARANCE - if ( UMAHasAppearance() ) - { - ::DrawThemePlacard( inRect , inState ) ; - } - else + if ( UMAHasAppearance() ) + { + ::DrawThemePlacard( inRect , inState ) ; + } + else #endif #if !TARGET_CARBON - { - } + { + } #else - { - } + { + } #endif }