X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fdaf613add176525ed8b6cafaf278dfd80f85074..544421165fa7f656d23b69801443b7aa69f71db8:/src/mac/uma.cpp diff --git a/src/mac/uma.cpp b/src/mac/uma.cpp index c96a8f93de..e0e3bdf35f 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 __UNIX__ #include #endif @@ -291,7 +289,11 @@ void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) int gPrOpenCounter = 0 ; -OSStatus UMAPrOpen() +#if PM_USE_SESSION_APIS +OSStatus UMAPrOpen(PMPrintSession *macPrintPort) +#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(macPrintPort) ; + #else + err = PMBegin() ; + #endif wxASSERT( err == noErr ) ; } return err ; #endif } -OSStatus UMAPrClose() +#if PM_USE_SESSION_APIS +OSStatus UMAPrClose(PMPrintSession *macPrintPort) +#else +OSStatus UMAPrClose() +#endif { #if !TARGET_CARBON OSErr err = noErr ; @@ -333,7 +343,11 @@ OSStatus UMAPrClose() wxASSERT( gPrOpenCounter >= 1 ) ; if ( gPrOpenCounter == 1 ) { - err = PMEnd() ; + #if PM_USE_SESSION_APIS + err = PMRelease(*macPrintPort) ; + #else + err = PMEnd() ; + #endif } --gPrOpenCounter ; return err ; @@ -471,7 +485,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 +545,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 +564,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 +588,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 +704,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) ) ; } }