#include "wx/mac/uma.h"
#include "wx/mac/aga.h"
-#ifdef __UNIX__
- #include <Carbon/Carbon.h>
-#else
+#ifndef __DARWIN__
#include <Navigation.h>
#endif
#endif // UMA_USE_WINDOWMGR
#endif
-#ifndef __UNIX__
+#ifndef __DARWIN__
#if TARGET_CARBON
// Call currently implicitely done : InitFloatingWindows() ;
#else
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 ;
++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 ;
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 ;
::ActivateControl( inControl ) ;
if ( visible ) {
SetControlVisibility( inControl , true , false ) ;
- InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ;
+ Rect ctrlBounds ;
+ InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ;
}
}
}
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) ) ;
}
}
}
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) ) ;
}
}
}
::DeactivateControl( inControl ) ;
if ( visible ) {
SetControlVisibility( inControl , true , false ) ;
- InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ;
+ Rect ctrlBounds ;
+ InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ;
}
}
}
if ( UMAHasAppearance() )
{
SetControlVisibility( inControl , true , false ) ;
- InvalWindowRect(GetControlOwner(inControl),&(**inControl).contrlRect ) ;
- }
- else
- {
- (**inControl).contrlVis = 255 ;
+ Rect ctrlBounds ;
+ InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ;
}
}