X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fdaf613add176525ed8b6cafaf278dfd80f85074..16d38102e8ad5534d185cc532b9aa8077a75e0a4:/src/mac/uma.cpp diff --git a/src/mac/uma.cpp b/src/mac/uma.cpp index c96a8f93de..2c70ef47b7 100644 --- a/src/mac/uma.cpp +++ b/src/mac/uma.cpp @@ -3,9 +3,7 @@ #include "wx/mac/uma.h" #include "wx/mac/aga.h" -#ifdef __UNIX__ - #include -#else +#ifndef __DARWIN__ #include #endif @@ -86,7 +84,7 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls ) #endif // UMA_USE_WINDOWMGR #endif -#ifndef __UNIX__ +#ifndef __DARWIN__ #if TARGET_CARBON // Call currently implicitely done : InitFloatingWindows() ; #else @@ -291,7 +289,11 @@ void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) int gPrOpenCounter = 0 ; -OSStatus UMAPrOpen() +#if TARGET_CARBON && PM_USE_SESSION_APIS +OSStatus UMAPrOpen(PMPrintSession *macPrintSession) +#else +OSStatus UMAPrOpen() +#endif { #if !TARGET_CARBON OSErr err = noErr ; @@ -308,14 +310,22 @@ OSStatus UMAPrOpen() ++gPrOpenCounter ; if ( gPrOpenCounter == 1 ) { - err = PMBegin() ; + #if PM_USE_SESSION_APIS + err = PMCreateSession(macPrintSession) ; + #else + err = PMBegin() ; + #endif wxASSERT( err == noErr ) ; } return err ; #endif } -OSStatus UMAPrClose() +#if TARGET_CARBON && PM_USE_SESSION_APIS +OSStatus UMAPrClose(PMPrintSession *macPrintSession) +#else +OSStatus UMAPrClose() +#endif { #if !TARGET_CARBON OSErr err = noErr ; @@ -333,7 +343,12 @@ OSStatus UMAPrClose() wxASSERT( gPrOpenCounter >= 1 ) ; if ( gPrOpenCounter == 1 ) { - err = PMEnd() ; + #if PM_USE_SESSION_APIS + err = PMRelease(*macPrintSession) ; + *macPrintSession = kPMNoReference; + #else + err = PMEnd() ; + #endif } --gPrOpenCounter ; return err ; @@ -471,7 +486,8 @@ void UMAActivateControl( ControlHandle inControl ) ::ActivateControl( inControl ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -530,12 +546,14 @@ void UMAMoveControl( ControlHandle inControl , short x , short y ) bool visible = UMAIsControlVisible( inControl ) ; if ( visible ) { SetControlVisibility( inControl , false , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } ::MoveControl( inControl , x , y ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -547,12 +565,14 @@ void UMASizeControl( ControlHandle inControl , short x , short y ) bool visible = UMAIsControlVisible( inControl ) ; if ( visible ) { SetControlVisibility( inControl , false , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } ::SizeControl( inControl , x , y ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -569,7 +589,8 @@ void UMADeactivateControl( ControlHandle inControl ) ::DeactivateControl( inControl ) ; if ( visible ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } } } @@ -684,11 +705,8 @@ void UMAShowControl (ControlHandle inControl) if ( UMAHasAppearance() ) { SetControlVisibility( inControl , true , false ) ; - InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ; - } - else - { - (**inControl).contrlVis = 255 ; + Rect ctrlBounds ; + InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; } }