cleanup for 10.5
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -93,8 +93,10 @@ void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bi
|
|||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
info->contentType = kControlContentPictHandle ;
|
info->contentType = kControlContentPictHandle ;
|
||||||
info->u.picture = bmap->GetPictHandle() ;
|
info->u.picture = bmap->GetPictHandle() ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -176,10 +178,11 @@ bool wxBitmapRefData::Create( int w , int h , int d )
|
|||||||
|
|
||||||
m_hBitmap = NULL ;
|
m_hBitmap = NULL ;
|
||||||
Rect rect = { 0 , 0 , m_height , m_width } ;
|
Rect rect = { 0 , 0 , m_height , m_width } ;
|
||||||
|
#ifndef __LP64__
|
||||||
verify_noerr( NewGWorldFromPtr( (GWorldPtr*) &m_hBitmap , k32ARGBPixelFormat , &rect , NULL , NULL , 0 ,
|
verify_noerr( NewGWorldFromPtr( (GWorldPtr*) &m_hBitmap , k32ARGBPixelFormat , &rect , NULL , NULL , 0 ,
|
||||||
(char*) data , m_bytesPerRow ) ) ;
|
(char*) data , m_bytesPerRow ) ) ;
|
||||||
wxASSERT_MSG( m_hBitmap , wxT("Unable to create GWorld context") ) ;
|
wxASSERT_MSG( m_hBitmap , wxT("Unable to create GWorld context") ) ;
|
||||||
|
#endif
|
||||||
m_ok = ( m_hBitmap != NULL ) ;
|
m_ok = ( m_hBitmap != NULL ) ;
|
||||||
|
|
||||||
return m_ok ;
|
return m_ok ;
|
||||||
@@ -204,9 +207,11 @@ void wxBitmapRefData::UseAlpha( bool use )
|
|||||||
|
|
||||||
memset( data , 0 , size ) ;
|
memset( data , 0 , size ) ;
|
||||||
Rect rect = { 0 , 0 , height , width } ;
|
Rect rect = { 0 , 0 , height , width } ;
|
||||||
|
#ifndef __LP64__
|
||||||
verify_noerr( NewGWorldFromPtr( (GWorldPtr*) &m_hMaskBitmap , k32ARGBPixelFormat , &rect , NULL , NULL , 0 ,
|
verify_noerr( NewGWorldFromPtr( (GWorldPtr*) &m_hMaskBitmap , k32ARGBPixelFormat , &rect , NULL , NULL , 0 ,
|
||||||
(char*) data , m_maskBytesPerRow ) ) ;
|
(char*) data , m_maskBytesPerRow ) ) ;
|
||||||
wxASSERT_MSG( m_hMaskBitmap , wxT("Unable to create GWorld context for alpha mask") ) ;
|
wxASSERT_MSG( m_hMaskBitmap , wxT("Unable to create GWorld context for alpha mask") ) ;
|
||||||
|
#endif
|
||||||
m_maskMemBuf.UngetWriteBuf(size) ;
|
m_maskMemBuf.UngetWriteBuf(size) ;
|
||||||
|
|
||||||
#if !wxMAC_USE_CORE_GRAPHICS
|
#if !wxMAC_USE_CORE_GRAPHICS
|
||||||
@@ -215,7 +220,9 @@ void wxBitmapRefData::UseAlpha( bool use )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
DisposeGWorld( m_hMaskBitmap ) ;
|
DisposeGWorld( m_hMaskBitmap ) ;
|
||||||
|
#endif
|
||||||
m_hMaskBitmap = NULL ;
|
m_hMaskBitmap = NULL ;
|
||||||
m_maskBytesPerRow = 0 ;
|
m_maskBytesPerRow = 0 ;
|
||||||
}
|
}
|
||||||
@@ -423,6 +430,7 @@ PicHandle wxBitmapRefData::GetPictHandle()
|
|||||||
{
|
{
|
||||||
if ( m_pictHandle == NULL )
|
if ( m_pictHandle == NULL )
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
CGrafPtr origPort = NULL ;
|
CGrafPtr origPort = NULL ;
|
||||||
GDHandle origDev = NULL ;
|
GDHandle origDev = NULL ;
|
||||||
GWorldPtr wp = NULL ;
|
GWorldPtr wp = NULL ;
|
||||||
@@ -492,6 +500,7 @@ PicHandle wxBitmapRefData::GetPictHandle()
|
|||||||
SetGWorld( origPort , origDev ) ;
|
SetGWorld( origPort , origDev ) ;
|
||||||
if ( clipRgn )
|
if ( clipRgn )
|
||||||
DisposeRgn( clipRgn ) ;
|
DisposeRgn( clipRgn ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_pictHandle ;
|
return m_pictHandle ;
|
||||||
@@ -674,6 +683,7 @@ void wxBitmapRefData::Free()
|
|||||||
m_iconRef = NULL ;
|
m_iconRef = NULL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __LP64__
|
||||||
if ( m_pictHandle )
|
if ( m_pictHandle )
|
||||||
{
|
{
|
||||||
KillPicture( m_pictHandle ) ;
|
KillPicture( m_pictHandle ) ;
|
||||||
@@ -691,7 +701,7 @@ void wxBitmapRefData::Free()
|
|||||||
DisposeGWorld( MAC_WXHBITMAP(m_hMaskBitmap) ) ;
|
DisposeGWorld( MAC_WXHBITMAP(m_hMaskBitmap) ) ;
|
||||||
m_hMaskBitmap = NULL ;
|
m_hMaskBitmap = NULL ;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (m_bitmapMask)
|
if (m_bitmapMask)
|
||||||
{
|
{
|
||||||
delete m_bitmapMask;
|
delete m_bitmapMask;
|
||||||
@@ -1368,11 +1378,13 @@ wxMask::wxMask( const wxMemoryBuffer& data, int width , int height , int bytesPe
|
|||||||
|
|
||||||
wxMask::~wxMask()
|
wxMask::~wxMask()
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
if ( m_maskBitmap )
|
if ( m_maskBitmap )
|
||||||
{
|
{
|
||||||
DisposeGWorld( (GWorldPtr)m_maskBitmap ) ;
|
DisposeGWorld( (GWorldPtr)m_maskBitmap ) ;
|
||||||
m_maskBitmap = NULL ;
|
m_maskBitmap = NULL ;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMask::Init()
|
void wxMask::Init()
|
||||||
@@ -1391,6 +1403,7 @@ void *wxMask::GetRawAccess() const
|
|||||||
|
|
||||||
void wxMask::RealizeNative()
|
void wxMask::RealizeNative()
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
if ( m_maskBitmap )
|
if ( m_maskBitmap )
|
||||||
{
|
{
|
||||||
DisposeGWorld( (GWorldPtr)m_maskBitmap ) ;
|
DisposeGWorld( (GWorldPtr)m_maskBitmap ) ;
|
||||||
@@ -1403,6 +1416,7 @@ void wxMask::RealizeNative()
|
|||||||
(GWorldPtr*) &m_maskBitmap , k32ARGBPixelFormat , &rect , NULL , NULL , 0 ,
|
(GWorldPtr*) &m_maskBitmap , k32ARGBPixelFormat , &rect , NULL , NULL , 0 ,
|
||||||
(char*) m_memBuf.GetData() , m_bytesPerRow ) ;
|
(char*) m_memBuf.GetData() , m_bytesPerRow ) ;
|
||||||
verify_noerr( err ) ;
|
verify_noerr( err ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a mask from a mono bitmap (copies the bitmap).
|
// Create a mask from a mono bitmap (copies the bitmap).
|
||||||
|
@@ -223,7 +223,9 @@ wxCursorRefData::~wxCursorRefData()
|
|||||||
{
|
{
|
||||||
if ( m_isColorCursor )
|
if ( m_isColorCursor )
|
||||||
{
|
{
|
||||||
::DisposeCCursor( (CCrsrHandle) m_hCursor ) ;
|
#ifndef __LP64__
|
||||||
|
::DisposeCCursor( (CCrsrHandle) m_hCursor ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if ( m_disposeHandle )
|
else if ( m_disposeHandle )
|
||||||
{
|
{
|
||||||
@@ -313,6 +315,7 @@ void wxCursor::CreateFromImage(const wxImage & image)
|
|||||||
{
|
{
|
||||||
m_refData = new wxCursorRefData;
|
m_refData = new wxCursorRefData;
|
||||||
|
|
||||||
|
#ifndef __LP64__
|
||||||
int w = 16;
|
int w = 16;
|
||||||
int h = 16;
|
int h = 16;
|
||||||
|
|
||||||
@@ -443,6 +446,8 @@ void wxCursor::CreateFromImage(const wxImage & image)
|
|||||||
HUnlock( (Handle)ch ) ;
|
HUnlock( (Handle)ch ) ;
|
||||||
M_CURSORDATA->m_hCursor = ch ;
|
M_CURSORDATA->m_hCursor = ch ;
|
||||||
M_CURSORDATA->m_isColorCursor = true ;
|
M_CURSORDATA->m_isColorCursor = true ;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //wxUSE_IMAGE
|
#endif //wxUSE_IMAGE
|
||||||
@@ -452,6 +457,7 @@ wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int ho
|
|||||||
m_refData = new wxCursorRefData;
|
m_refData = new wxCursorRefData;
|
||||||
if ( flags == wxBITMAP_TYPE_MACCURSOR_RESOURCE )
|
if ( flags == wxBITMAP_TYPE_MACCURSOR_RESOURCE )
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
Str255 theName ;
|
Str255 theName ;
|
||||||
wxMacStringToPascal( cursor_file , theName ) ;
|
wxMacStringToPascal( cursor_file , theName ) ;
|
||||||
|
|
||||||
@@ -484,6 +490,7 @@ wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int ho
|
|||||||
M_CURSORDATA->m_releaseHandle = true ;
|
M_CURSORDATA->m_releaseHandle = true ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -619,10 +626,12 @@ void wxCursor::MacInstall() const
|
|||||||
}
|
}
|
||||||
else if ( m_refData && M_CURSORDATA->m_hCursor )
|
else if ( m_refData && M_CURSORDATA->m_hCursor )
|
||||||
{
|
{
|
||||||
if ( M_CURSORDATA->m_isColorCursor )
|
#ifndef __LP64__
|
||||||
|
if ( M_CURSORDATA->m_isColorCursor )
|
||||||
::SetCCursor( (CCrsrHandle) M_CURSORDATA->m_hCursor ) ;
|
::SetCCursor( (CCrsrHandle) M_CURSORDATA->m_hCursor ) ;
|
||||||
else
|
else
|
||||||
::SetCursor( * (CursHandle) M_CURSORDATA->m_hCursor ) ;
|
::SetCursor( * (CursHandle) M_CURSORDATA->m_hCursor ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -64,6 +64,7 @@ const short kUnsupportedMode = -2 ;
|
|||||||
|
|
||||||
extern TECObjectRef s_TECNativeCToUnicode ;
|
extern TECObjectRef s_TECNativeCToUnicode ;
|
||||||
|
|
||||||
|
#ifndef __LP64__
|
||||||
|
|
||||||
// TODO: update
|
// TODO: update
|
||||||
// The textctrl implementation still needs that (needs what?) for the non-HIView implementation
|
// The textctrl implementation still needs that (needs what?) for the non-HIView implementation
|
||||||
@@ -131,6 +132,7 @@ wxMacPortSetter::~wxMacPortSetter()
|
|||||||
{
|
{
|
||||||
// m_dc->MacCleanupPort(&m_ph) ;
|
// m_dc->MacCleanupPort(&m_ph) ;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Local functions
|
// Local functions
|
||||||
@@ -252,9 +254,10 @@ wxMacCGContext::~wxMacCGContext()
|
|||||||
CGContextRestoreGState( m_cgContext ) ;
|
CGContextRestoreGState( m_cgContext ) ;
|
||||||
CGContextRestoreGState( m_cgContext ) ;
|
CGContextRestoreGState( m_cgContext ) ;
|
||||||
}
|
}
|
||||||
|
#ifndef __LP64__
|
||||||
if ( m_qdPort )
|
if ( m_qdPort )
|
||||||
QDEndCGContext( m_qdPort, &m_cgContext ) ;
|
QDEndCGContext( m_qdPort, &m_cgContext ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -353,8 +356,11 @@ CGContextRef wxMacCGContext::GetNativeContext()
|
|||||||
if ( m_cgContext == NULL )
|
if ( m_cgContext == NULL )
|
||||||
{
|
{
|
||||||
Rect bounds ;
|
Rect bounds ;
|
||||||
|
OSStatus status = noErr;
|
||||||
|
#ifndef __LP64__
|
||||||
GetPortBounds( (CGrafPtr) m_qdPort , &bounds ) ;
|
GetPortBounds( (CGrafPtr) m_qdPort , &bounds ) ;
|
||||||
OSStatus status = QDBeginCGContext((CGrafPtr) m_qdPort , &m_cgContext) ;
|
status = QDBeginCGContext((CGrafPtr) m_qdPort , &m_cgContext) ;
|
||||||
|
#endif
|
||||||
CGContextSaveGState( m_cgContext ) ;
|
CGContextSaveGState( m_cgContext ) ;
|
||||||
|
|
||||||
wxASSERT_MSG( status == noErr , wxT("Cannot nest wxDCs on the same window") ) ;
|
wxASSERT_MSG( status == noErr , wxT("Cannot nest wxDCs on the same window") ) ;
|
||||||
@@ -1591,14 +1597,14 @@ bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const
|
|||||||
{
|
{
|
||||||
wxCHECK_MSG( Ok(), false, wxT("wxDC(cg)::DoGetPixel - invalid DC") );
|
wxCHECK_MSG( Ok(), false, wxT("wxDC(cg)::DoGetPixel - invalid DC") );
|
||||||
|
|
||||||
wxMacPortSaver helper((CGrafPtr)m_macPort) ;
|
|
||||||
RGBColor colour;
|
RGBColor colour;
|
||||||
|
#ifndef __LP64__
|
||||||
|
wxMacPortSaver helper((CGrafPtr)m_macPort) ;
|
||||||
// NB: GetCPixel is a deprecated QD call, and a slow one at that
|
// NB: GetCPixel is a deprecated QD call, and a slow one at that
|
||||||
GetCPixel(
|
GetCPixel(
|
||||||
XLOG2DEVMAC(x) + m_macLocalOriginInPort.x - m_macLocalOrigin.x,
|
XLOG2DEVMAC(x) + m_macLocalOriginInPort.x - m_macLocalOrigin.x,
|
||||||
YLOG2DEVMAC(y) + m_macLocalOriginInPort.y - m_macLocalOrigin.y, &colour );
|
YLOG2DEVMAC(y) + m_macLocalOriginInPort.y - m_macLocalOrigin.y, &colour );
|
||||||
|
#endif
|
||||||
// convert from Mac colour to wx
|
// convert from Mac colour to wx
|
||||||
col->Set( colour.red >> 8, colour.green >> 8, colour.blue >> 8 );
|
col->Set( colour.red >> 8, colour.green >> 8, colour.blue >> 8 );
|
||||||
|
|
||||||
|
@@ -62,7 +62,9 @@ public :
|
|||||||
virtual void GetSize( int *w , int *h) const ;
|
virtual void GetSize( int *w , int *h) const ;
|
||||||
virtual wxSize GetPPI() const ;
|
virtual wxSize GetPPI() const ;
|
||||||
private :
|
private :
|
||||||
|
#if !wxMAC_USE_CORE_GRAPHICS
|
||||||
GrafPtr m_macPrintFormerPort ;
|
GrafPtr m_macPrintFormerPort ;
|
||||||
|
#endif
|
||||||
wxCoord m_maxX ;
|
wxCoord m_maxX ;
|
||||||
wxCoord m_maxY ;
|
wxCoord m_maxY ;
|
||||||
wxSize m_ppi ;
|
wxSize m_ppi ;
|
||||||
@@ -71,8 +73,9 @@ private :
|
|||||||
|
|
||||||
wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data )
|
wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data )
|
||||||
{
|
{
|
||||||
|
#if !wxMAC_USE_CORE_GRAPHICS
|
||||||
::GetPort( & m_macPrintFormerPort ) ;
|
::GetPort( & m_macPrintFormerPort ) ;
|
||||||
|
#endif
|
||||||
m_err = noErr ;
|
m_err = noErr ;
|
||||||
wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) data->GetNativeData() ;
|
wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) data->GetNativeData() ;
|
||||||
|
|
||||||
@@ -85,14 +88,22 @@ wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data )
|
|||||||
m_maxY = wxCoord(rPage.bottom - rPage.top);
|
m_maxY = wxCoord(rPage.bottom - rPage.top);
|
||||||
|
|
||||||
PMResolution res;
|
PMResolution res;
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||||
|
PMPrinter printer;
|
||||||
|
PMSessionGetCurrentPrinter(native->m_macPrintSession, &printer);
|
||||||
|
PMPrinterGetOutputResolution( printer, native->m_macPrintSettings, &res) ;
|
||||||
|
#else
|
||||||
m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
|
m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
|
||||||
m_ppi = wxSize(int(res.hRes), int(res.vRes));
|
m_ppi = wxSize(int(res.hRes), int(res.vRes));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMacCarbonPrinterDC::~wxMacCarbonPrinterDC()
|
wxMacCarbonPrinterDC::~wxMacCarbonPrinterDC()
|
||||||
{
|
{
|
||||||
|
#if !wxMAC_USE_CORE_GRAPHICS
|
||||||
// nothing to release from print data, as wxPrinterDC has all data in its wxPrintData member
|
// nothing to release from print data, as wxPrinterDC has all data in its wxPrintData member
|
||||||
::SetPort( m_macPrintFormerPort ) ;
|
::SetPort( m_macPrintFormerPort ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxNativePrinterDC* wxNativePrinterDC::Create(wxPrintData* data)
|
wxNativePrinterDC* wxNativePrinterDC::Create(wxPrintData* data)
|
||||||
@@ -107,7 +118,7 @@ bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED
|
|||||||
|
|
||||||
wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().GetNativeData() ;
|
wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().GetNativeData() ;
|
||||||
|
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4 && wxMAC_USE_CORE_GRAPHICS
|
||||||
{
|
{
|
||||||
CFStringRef s[1] = { kPMGraphicsContextCoreGraphics };
|
CFStringRef s[1] = { kPMGraphicsContextCoreGraphics };
|
||||||
CFArrayRef graphicsContextsArray = CFArrayCreate(NULL, (const void**)s, 1, &kCFTypeArrayCallBacks);
|
CFArrayRef graphicsContextsArray = CFArrayCreate(NULL, (const void**)s, 1, &kCFTypeArrayCallBacks);
|
||||||
@@ -115,10 +126,17 @@ bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED
|
|||||||
CFRelease(graphicsContextsArray);
|
CFRelease(graphicsContextsArray);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 && wxMAC_USE_CORE_GRAPHICS
|
||||||
|
m_err = PMSessionBeginCGDocument(native->m_macPrintSession,
|
||||||
|
native->m_macPrintSettings,
|
||||||
|
native->m_macPageFormat);
|
||||||
|
#else
|
||||||
m_err = PMSessionBeginDocument(native->m_macPrintSession,
|
m_err = PMSessionBeginDocument(native->m_macPrintSession,
|
||||||
native->m_macPrintSettings,
|
native->m_macPrintSettings,
|
||||||
native->m_macPageFormat);
|
native->m_macPageFormat);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( m_err != noErr )
|
if ( m_err != noErr )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -131,7 +149,13 @@ bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED
|
|||||||
m_maxY = wxCoord(rPage.bottom - rPage.top);
|
m_maxY = wxCoord(rPage.bottom - rPage.top);
|
||||||
|
|
||||||
PMResolution res;
|
PMResolution res;
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||||
|
PMPrinter printer;
|
||||||
|
PMSessionGetCurrentPrinter(native->m_macPrintSession, &printer);
|
||||||
|
PMPrinterGetOutputResolution( printer, native->m_macPrintSettings, &res) ;
|
||||||
|
#else
|
||||||
m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
|
m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
|
||||||
|
#endif
|
||||||
m_ppi = wxSize(int(res.hRes), int(res.vRes));
|
m_ppi = wxSize(int(res.hRes), int(res.vRes));
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
@@ -163,9 +187,15 @@ void wxMacCarbonPrinterDC::StartPage( wxPrinterDC* dc )
|
|||||||
if ( m_err == noErr )
|
if ( m_err == noErr )
|
||||||
{
|
{
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||||
|
m_err = PMSessionGetCGGraphicsContext(native->m_macPrintSession,
|
||||||
|
&pageContext );
|
||||||
|
|
||||||
|
#else
|
||||||
m_err = PMSessionGetGraphicsContext(native->m_macPrintSession,
|
m_err = PMSessionGetGraphicsContext(native->m_macPrintSession,
|
||||||
kPMGraphicsContextCoreGraphics,
|
kPMGraphicsContextCoreGraphics,
|
||||||
(void**) &pageContext );
|
(void**) &pageContext );
|
||||||
|
#endif
|
||||||
dc->MacSetCGContext(pageContext) ;
|
dc->MacSetCGContext(pageContext) ;
|
||||||
#else
|
#else
|
||||||
m_err = PMSessionGetGraphicsContext(native->m_macPrintSession,
|
m_err = PMSessionGetGraphicsContext(native->m_macPrintSession,
|
||||||
|
@@ -20,6 +20,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
|
|||||||
// Create a DC representing the whole screen
|
// Create a DC representing the whole screen
|
||||||
wxScreenDC::wxScreenDC()
|
wxScreenDC::wxScreenDC()
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
m_macPort = CreateNewPort() ;
|
m_macPort = CreateNewPort() ;
|
||||||
GrafPtr port ;
|
GrafPtr port ;
|
||||||
GetPort( &port ) ;
|
GetPort( &port ) ;
|
||||||
@@ -51,6 +52,7 @@ wxScreenDC::wxScreenDC()
|
|||||||
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
|
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
m_ok = true ;
|
m_ok = true ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxScreenDC::~wxScreenDC()
|
wxScreenDC::~wxScreenDC()
|
||||||
@@ -60,6 +62,8 @@ wxScreenDC::~wxScreenDC()
|
|||||||
m_graphicContext = NULL ;
|
m_graphicContext = NULL ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __LP64__
|
||||||
if ( m_macPort )
|
if ( m_macPort )
|
||||||
DisposePort( (CGrafPtr) m_macPort ) ;
|
DisposePort( (CGrafPtr) m_macPort ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -161,9 +161,11 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
|||||||
if ( pItem->IsSeparator() )
|
if ( pItem->IsSeparator() )
|
||||||
{
|
{
|
||||||
if ( pos == (size_t)-1 )
|
if ( pos == (size_t)-1 )
|
||||||
MacAppendMenu(MAC_WXHMENU(m_hMenu), "\p-");
|
AppendMenuItemTextWithCFString( MAC_WXHMENU(m_hMenu),
|
||||||
|
CFSTR(""), kMenuItemAttrSeparator, 0,NULL);
|
||||||
else
|
else
|
||||||
MacInsertMenuItem(MAC_WXHMENU(m_hMenu), "\p-" , pos);
|
InsertMenuItemTextWithCFString( MAC_WXHMENU(m_hMenu),
|
||||||
|
CFSTR(""), pos, kMenuItemAttrSeparator, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -201,7 +203,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos , wxIdToMacCommand ( pItem->GetId() ) ) ;
|
SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos , wxIdToMacCommand ( pItem->GetId() ) ) ;
|
||||||
SetMenuItemRefCon( MAC_WXHMENU(m_hMenu) , pos , (UInt32) pItem ) ;
|
SetMenuItemRefCon( MAC_WXHMENU(m_hMenu) , pos , (URefCon) pItem ) ;
|
||||||
pItem->UpdateItemText() ;
|
pItem->UpdateItemText() ;
|
||||||
pItem->UpdateItemBitmap() ;
|
pItem->UpdateItemBitmap() ;
|
||||||
pItem->UpdateItemStatus() ;
|
pItem->UpdateItemStatus() ;
|
||||||
@@ -596,19 +598,19 @@ void wxMenuBar::MacInstallMenuBar()
|
|||||||
::SetMenuBar( menubar ) ;
|
::SetMenuBar( menubar ) ;
|
||||||
DisposeMenuBar( menubar ) ;
|
DisposeMenuBar( menubar ) ;
|
||||||
MenuHandle appleMenu = NULL ;
|
MenuHandle appleMenu = NULL ;
|
||||||
char appleMenuTitle[3] = { 01 , kMenuAppleLogoFilledGlyph , 0 } ;
|
|
||||||
|
|
||||||
verify_noerr( CreateNewMenu( kwxMacAppleMenuId , 0 , &appleMenu ) ) ;
|
verify_noerr( CreateNewMenu( kwxMacAppleMenuId , 0 , &appleMenu ) ) ;
|
||||||
verify_noerr( SetMenuTitle( appleMenu , (ConstStr255Param) appleMenuTitle ) );
|
verify_noerr( SetMenuTitleWithCFString( appleMenu , CFSTR( "\x14" ) ) );
|
||||||
|
|
||||||
// Add About/Preferences separator only on OS X
|
// Add About/Preferences separator only on OS X
|
||||||
// KH/RN: Separator is always present on 10.3 but not on 10.2
|
// KH/RN: Separator is always present on 10.3 but not on 10.2
|
||||||
// However, the change from 10.2 to 10.3 suggests it is preferred
|
// However, the change from 10.2 to 10.3 suggests it is preferred
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
MacInsertMenuItem( appleMenu , "\p-" , 0 ) ;
|
InsertMenuItemTextWithCFString( appleMenu,
|
||||||
|
CFSTR(""), 0, kMenuItemAttrSeparator, 0);
|
||||||
#endif
|
#endif
|
||||||
|
InsertMenuItemTextWithCFString( appleMenu,
|
||||||
MacInsertMenuItem( appleMenu , "\pAbout..." , 0 ) ;
|
CFSTR("About..."), 0, kMenuItemAttrSeparator, 0);
|
||||||
MacInsertMenu( appleMenu , 0 ) ;
|
MacInsertMenu( appleMenu , 0 ) ;
|
||||||
|
|
||||||
// clean-up the help menu before adding new items
|
// clean-up the help menu before adding new items
|
||||||
@@ -687,7 +689,8 @@ void wxMenuBar::MacInstallMenuBar()
|
|||||||
if ( item->IsSeparator() )
|
if ( item->IsSeparator() )
|
||||||
{
|
{
|
||||||
if ( mh )
|
if ( mh )
|
||||||
MacAppendMenu(mh, "\p-" );
|
AppendMenuItemTextWithCFString( mh,
|
||||||
|
CFSTR(""), kMenuItemAttrSeparator, 0,NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -704,7 +707,7 @@ void wxMenuBar::MacInstallMenuBar()
|
|||||||
{
|
{
|
||||||
UMAAppendMenuItem(mh, wxStripMenuCodes(item->GetText()) , wxFont::GetDefaultEncoding(), entry);
|
UMAAppendMenuItem(mh, wxStripMenuCodes(item->GetText()) , wxFont::GetDefaultEncoding(), entry);
|
||||||
SetMenuItemCommandID( mh , CountMenuItems(mh) , wxIdToMacCommand ( item->GetId() ) ) ;
|
SetMenuItemCommandID( mh , CountMenuItems(mh) , wxIdToMacCommand ( item->GetId() ) ) ;
|
||||||
SetMenuItemRefCon( mh , CountMenuItems(mh) , (UInt32)item ) ;
|
SetMenuItemRefCon( mh , CountMenuItems(mh) , (URefCon) item ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -732,7 +735,7 @@ void wxMenuBar::MacInstallMenuBar()
|
|||||||
UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , wxStripMenuCodes ( aboutMenuItem->GetText() ) , wxFont::GetDefaultEncoding() );
|
UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , wxStripMenuCodes ( aboutMenuItem->GetText() ) , wxFont::GetDefaultEncoding() );
|
||||||
UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true );
|
UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true );
|
||||||
SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , kHICommandAbout ) ;
|
SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , kHICommandAbout ) ;
|
||||||
SetMenuItemRefCon(GetMenuHandle( kwxMacAppleMenuId ) , 1 , (UInt32)aboutMenuItem ) ;
|
SetMenuItemRefCon(GetMenuHandle( kwxMacAppleMenuId ) , 1 , (URefCon)aboutMenuItem ) ;
|
||||||
UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ;
|
UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -61,12 +61,14 @@ wxMetafileRefData::~wxMetafileRefData()
|
|||||||
{
|
{
|
||||||
if (m_metafile)
|
if (m_metafile)
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
KillPicture( (PicHandle)m_metafile );
|
KillPicture( (PicHandle)m_metafile );
|
||||||
m_metafile = NULL;
|
m_metafile = NULL;
|
||||||
|
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
QDPictRelease( m_qdPictRef );
|
QDPictRelease( m_qdPictRef );
|
||||||
m_qdPictRef = NULL;
|
m_qdPictRef = NULL;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -142,12 +144,14 @@ void wxMetafile::SetHMETAFILE(WXHMETAFILE mf)
|
|||||||
membuf, data, sz, wxMacMemoryBufferReleaseProc );
|
membuf, data, sz, wxMacMemoryBufferReleaseProc );
|
||||||
M_METAFILEDATA->m_qdPictRef = NULL;
|
M_METAFILEDATA->m_qdPictRef = NULL;
|
||||||
|
|
||||||
|
#ifndef __LP64__
|
||||||
if (provider != NULL)
|
if (provider != NULL)
|
||||||
{
|
{
|
||||||
M_METAFILEDATA->m_qdPictRef = QDPictCreateWithProvider( provider );
|
M_METAFILEDATA->m_qdPictRef = QDPictCreateWithProvider( provider );
|
||||||
CGDataProviderRelease( provider );
|
CGDataProviderRelease( provider );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxMetaFile::Play(wxDC *dc)
|
bool wxMetaFile::Play(wxDC *dc)
|
||||||
@@ -160,6 +164,7 @@ bool wxMetaFile::Play(wxDC *dc)
|
|||||||
|
|
||||||
{
|
{
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
|
#ifndef __LP64__
|
||||||
QDPictRef cgPictRef = M_METAFILEDATA->m_qdPictRef;
|
QDPictRef cgPictRef = M_METAFILEDATA->m_qdPictRef;
|
||||||
CGContextRef cg = ((wxMacCGContext*)(dc->GetGraphicContext()))->GetNativeContext();
|
CGContextRef cg = ((wxMacCGContext*)(dc->GetGraphicContext()))->GetNativeContext();
|
||||||
CGRect bounds = QDPictGetBounds( cgPictRef );
|
CGRect bounds = QDPictGetBounds( cgPictRef );
|
||||||
@@ -169,6 +174,7 @@ bool wxMetaFile::Play(wxDC *dc)
|
|||||||
CGContextScaleCTM( cg, 1, -1 );
|
CGContextScaleCTM( cg, 1, -1 );
|
||||||
QDPictDrawToCGContext( cg, bounds, cgPictRef );
|
QDPictDrawToCGContext( cg, bounds, cgPictRef );
|
||||||
CGContextRestoreGState( cg );
|
CGContextRestoreGState( cg );
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
PicHandle pict = (PicHandle)GetHMETAFILE();
|
PicHandle pict = (PicHandle)GetHMETAFILE();
|
||||||
wxMacPortSetter helper( dc );
|
wxMacPortSetter helper( dc );
|
||||||
@@ -186,11 +192,13 @@ wxSize wxMetaFile::GetSize() const
|
|||||||
|
|
||||||
if (Ok())
|
if (Ok())
|
||||||
{
|
{
|
||||||
PicHandle pict = (PicHandle)GetHMETAFILE();
|
#ifndef __LP64__
|
||||||
|
PicHandle pict = (PicHandle)GetHMETAFILE();
|
||||||
Rect r;
|
Rect r;
|
||||||
wxMacGetPictureBounds( pict, &r );
|
wxMacGetPictureBounds( pict, &r );
|
||||||
dataSize.x = r.right - r.left;
|
dataSize.x = r.right - r.left;
|
||||||
dataSize.y = r.bottom - r.top;
|
dataSize.y = r.bottom - r.top;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return dataSize;
|
return dataSize;
|
||||||
@@ -244,8 +252,9 @@ void wxMetaFileDC::DoGetSize(int *width, int *height) const
|
|||||||
|
|
||||||
wxMetaFile *wxMetaFileDC::Close()
|
wxMetaFile *wxMetaFileDC::Close()
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
ClosePicture();
|
ClosePicture();
|
||||||
|
#endif
|
||||||
return m_metaFile;
|
return m_metaFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,7 +58,7 @@
|
|||||||
#include <CoreServices.h>
|
#include <CoreServices.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __LP64__
|
||||||
// START CODE SAMPLE FROM TECHNOTE 1002 (http://developer.apple.com/technotes/tn/tn1002.html)
|
// START CODE SAMPLE FROM TECHNOTE 1002 (http://developer.apple.com/technotes/tn/tn1002.html)
|
||||||
|
|
||||||
// IsRemoteVolume can be used to find out if the
|
// IsRemoteVolume can be used to find out if the
|
||||||
@@ -320,7 +320,7 @@ pascal OSErr FSpGetFullPath( const FSSpec *spec,
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
//
|
//
|
||||||
// On the mac there are two ways to open a file - one is through apple events and the
|
// On the mac there are two ways to open a file - one is through apple events and the
|
||||||
// finder, another is through mime types.
|
// finder, another is through mime types.
|
||||||
@@ -459,6 +459,7 @@ wxString wxFileTypeImpl::GetCommand(const wxString& verb) const
|
|||||||
|
|
||||||
#else //carbon/classic implementation
|
#else //carbon/classic implementation
|
||||||
|
|
||||||
|
|
||||||
wxString wxFileTypeImpl::GetCommand(const wxString& verb) const
|
wxString wxFileTypeImpl::GetCommand(const wxString& verb) const
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( m_manager != NULL , wxT("Bad wxFileType") );
|
wxASSERT_MSG( m_manager != NULL , wxT("Bad wxFileType") );
|
||||||
@@ -789,7 +790,9 @@ pascal OSStatus MoreProcGetProcessTypeSignature(
|
|||||||
|
|
||||||
infoRec.processInfoLength = sizeof(ProcessInfoRec);
|
infoRec.processInfoLength = sizeof(ProcessInfoRec);
|
||||||
infoRec.processName = NULL;
|
infoRec.processName = NULL;
|
||||||
|
#ifndef __LP64__
|
||||||
infoRec.processAppSpec = NULL;
|
infoRec.processAppSpec = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( pPSN == NULL )
|
if ( pPSN == NULL )
|
||||||
{
|
{
|
||||||
@@ -1693,8 +1696,18 @@ wxFileType* wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
|
|||||||
if (status == noErr)
|
if (status == noErr)
|
||||||
{
|
{
|
||||||
Str255 psCreatorName;
|
Str255 psCreatorName;
|
||||||
|
#ifndef __LP64__
|
||||||
FSSpec dummySpec;
|
FSSpec dummySpec;
|
||||||
status = FindApplication(creator, false, psCreatorName, &dummySpec);
|
status = FindApplication(creator, false, psCreatorName, &dummySpec);
|
||||||
|
#else
|
||||||
|
FSRef fsref;
|
||||||
|
status = LSFindApplicationForInfo( creator, NULL, NULL, &fsref ,NULL);
|
||||||
|
HFSUniStr255 name;
|
||||||
|
status = FSGetCatalogInfo(&fsref, kFSCatInfoNone, NULL, &name, NULL, NULL);
|
||||||
|
CFStringRef str = FSCreateStringFromHFSUniStr( 0 , &name );
|
||||||
|
CFStringGetPascalString(str, psCreatorName, 256, CFStringGetSystemEncoding());
|
||||||
|
CFRelease( str );
|
||||||
|
#endif
|
||||||
|
|
||||||
if (status == noErr)
|
if (status == noErr)
|
||||||
{
|
{
|
||||||
|
@@ -69,6 +69,8 @@
|
|||||||
<1> 1/25/02 JL MoreFilesX 1.0
|
<1> 1/25/02 JL MoreFilesX 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __LP64__
|
||||||
|
|
||||||
#if defined(__MACH__)
|
#if defined(__MACH__)
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -218,6 +220,8 @@ BadParameter:
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __LP64__
|
||||||
|
|
||||||
OSErr
|
OSErr
|
||||||
FSGetVolParms(
|
FSGetVolParms(
|
||||||
FSVolumeRefNum volRefNum,
|
FSVolumeRefNum volRefNum,
|
||||||
@@ -248,6 +252,8 @@ BadParameter:
|
|||||||
return ( result );
|
return ( result );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
OSErr
|
OSErr
|
||||||
@@ -2121,6 +2127,8 @@ BadParameter:
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __LP64__
|
||||||
|
|
||||||
OSErr
|
OSErr
|
||||||
FSLockRangeMoreFilesX(
|
FSLockRangeMoreFilesX(
|
||||||
SInt16 refNum,
|
SInt16 refNum,
|
||||||
@@ -2304,7 +2312,7 @@ BadParameter:
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
OSErr
|
OSErr
|
||||||
FSVolumeMount(
|
FSVolumeMountX(
|
||||||
const void *volMountInfo,
|
const void *volMountInfo,
|
||||||
FSVolumeRefNum *volRefNum)
|
FSVolumeRefNum *volRefNum)
|
||||||
{
|
{
|
||||||
@@ -2604,6 +2612,8 @@ BadParameter:
|
|||||||
return ( result );
|
return ( result );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#pragma mark ----- Utility Routines -----
|
#pragma mark ----- Utility Routines -----
|
||||||
@@ -2768,3 +2778,5 @@ BadParameter:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -1483,7 +1483,7 @@ FSGetVolMountInfo(
|
|||||||
#pragma mark FSVolumeMount
|
#pragma mark FSVolumeMount
|
||||||
|
|
||||||
OSErr
|
OSErr
|
||||||
FSVolumeMount(
|
FSVolumeMountX(
|
||||||
const void *volMountInfo,
|
const void *volMountInfo,
|
||||||
FSVolumeRefNum *volRefNum);
|
FSVolumeRefNum *volRefNum);
|
||||||
|
|
||||||
|
@@ -427,9 +427,13 @@ void wxNotebook::MacSetupTabs()
|
|||||||
m_peer->SetTabEnabled( ii + 1, true ) ;
|
m_peer->SetTabEnabled( ii + 1, true ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
|
Refresh();
|
||||||
|
#else
|
||||||
Rect bounds;
|
Rect bounds;
|
||||||
m_peer->GetRectInWindowCoords( &bounds ) ;
|
m_peer->GetRectInWindowCoords( &bounds ) ;
|
||||||
InvalWindowRect( (WindowRef)MacGetTopLevelWindowRef(), &bounds );
|
InvalWindowRect( (WindowRef)MacGetTopLevelWindowRef(), &bounds );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRect wxNotebook::GetPageRect() const
|
wxRect wxNotebook::GetPageRect() const
|
||||||
|
@@ -137,6 +137,7 @@ bool wxMacCarbonPrintData::TransferFrom( const wxPrintData &data )
|
|||||||
if ( !m_printerName.empty() )
|
if ( !m_printerName.empty() )
|
||||||
PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName , wxFont::GetDefaultEncoding() ) ) ;
|
PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName , wxFont::GetDefaultEncoding() ) ) ;
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef __LP64__
|
||||||
PMColorMode color ;
|
PMColorMode color ;
|
||||||
PMGetColorMode( (PMPrintSettings) m_macPrintSettings, &color ) ;
|
PMGetColorMode( (PMPrintSettings) m_macPrintSettings, &color ) ;
|
||||||
if ( data.GetColour() )
|
if ( data.GetColour() )
|
||||||
@@ -146,16 +147,24 @@ bool wxMacCarbonPrintData::TransferFrom( const wxPrintData &data )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
PMSetColorMode( (PMPrintSettings) m_macPrintSettings, kPMBlackAndWhite ) ;
|
PMSetColorMode( (PMPrintSettings) m_macPrintSettings, kPMBlackAndWhite ) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
// PMDuplexMode not yet accessible via API
|
// PMDuplexMode not yet accessible via API
|
||||||
// PMQualityMode not yet accessible via API
|
// PMQualityMode not yet accessible via API
|
||||||
// todo paperSize
|
// todo paperSize
|
||||||
|
|
||||||
PMResolution res;
|
PMResolution res;
|
||||||
PMPrinter printer;
|
PMPrinter printer;
|
||||||
PMTag tag = kPMMaxSquareResolution;
|
|
||||||
PMSessionGetCurrentPrinter(m_macPrintSession, &printer);
|
PMSessionGetCurrentPrinter(m_macPrintSession, &printer);
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||||
|
PMPrinterGetOutputResolution( printer,
|
||||||
|
(PMPrintSettings) m_macPrintSettings, &res) ;
|
||||||
|
// TODO transfer ? into page format ?
|
||||||
|
#else
|
||||||
|
PMTag tag = kPMMaxSquareResolution;
|
||||||
PMPrinterGetPrinterResolution(printer, tag, &res);
|
PMPrinterGetPrinterResolution(printer, tag, &res);
|
||||||
PMSetResolution((PMPageFormat) m_macPageFormat, &res);
|
PMSetResolution((PMPageFormat) m_macPageFormat, &res);
|
||||||
|
#endif
|
||||||
// after setting the new resolution the format has to be updated, otherwise the page rect remains
|
// after setting the new resolution the format has to be updated, otherwise the page rect remains
|
||||||
// at the 'old' scaling
|
// at the 'old' scaling
|
||||||
PMSessionValidatePageFormat((PMPrintSession) m_macPrintSession,
|
PMSessionValidatePageFormat((PMPrintSession) m_macPrintSession,
|
||||||
@@ -195,11 +204,12 @@ bool wxMacCarbonPrintData::TransferTo( wxPrintData &data )
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __LP64__
|
||||||
PMColorMode color ;
|
PMColorMode color ;
|
||||||
err = PMGetColorMode( m_macPrintSettings, &color ) ;
|
err = PMGetColorMode( m_macPrintSettings, &color ) ;
|
||||||
if ( err == noErr )
|
if ( err == noErr )
|
||||||
data.SetColour( !(color == kPMBlackAndWhite) ) ;
|
data.SetColour( !(color == kPMBlackAndWhite) ) ;
|
||||||
|
#endif
|
||||||
// PMDuplexMode not yet accessible via API
|
// PMDuplexMode not yet accessible via API
|
||||||
// PMQualityMode not yet accessible via API
|
// PMQualityMode not yet accessible via API
|
||||||
// todo paperSize
|
// todo paperSize
|
||||||
@@ -352,7 +362,13 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
|||||||
PMResolution res;
|
PMResolution res;
|
||||||
wxMacCarbonPrintData* nativeData = (wxMacCarbonPrintData*)
|
wxMacCarbonPrintData* nativeData = (wxMacCarbonPrintData*)
|
||||||
(m_printDialogData.GetPrintData().GetNativeData());
|
(m_printDialogData.GetPrintData().GetNativeData());
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||||
|
PMPrinter printer;
|
||||||
|
PMSessionGetCurrentPrinter(nativeData->m_macPrintSession, &printer);
|
||||||
|
PMPrinterGetOutputResolution( printer, nativeData->m_macPrintSettings, &res) ;
|
||||||
|
#else
|
||||||
PMGetResolution((PMPageFormat) (nativeData->m_macPageFormat), &res);
|
PMGetResolution((PMPageFormat) (nativeData->m_macPageFormat), &res);
|
||||||
|
#endif
|
||||||
printout->SetPPIPrinter(int(res.hRes), int(res.vRes));
|
printout->SetPPIPrinter(int(res.hRes), int(res.vRes));
|
||||||
|
|
||||||
// Set printout parameters
|
// Set printout parameters
|
||||||
@@ -434,10 +450,14 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
|||||||
if ( UMAGetSystemVersion() >= 0x1000 )
|
if ( UMAGetSystemVersion() >= 0x1000 )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#if !wxMAC_USE_CORE_GRAPHICS
|
||||||
GrafPtr thePort ;
|
GrafPtr thePort ;
|
||||||
GetPort( &thePort ) ;
|
GetPort( &thePort ) ;
|
||||||
|
#endif
|
||||||
wxSafeYield(win,true);
|
wxSafeYield(win,true);
|
||||||
|
#if !wxMAC_USE_CORE_GRAPHICS
|
||||||
SetPort( thePort ) ;
|
SetPort( thePort ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
dc->StartPage();
|
dc->StartPage();
|
||||||
keepGoing = printout->OnPrintPage(pn);
|
keepGoing = printout->OnPrintPage(pn);
|
||||||
|
@@ -186,7 +186,7 @@ pascal OSStatus wxDockEventHandler( EventHandlerCallRef inHandlerCallRef,
|
|||||||
wxMenuItem *item = NULL;
|
wxMenuItem *item = NULL;
|
||||||
|
|
||||||
if (id != 0) // get the wxMenuItem reference from the MenuRef
|
if (id != 0) // get the wxMenuItem reference from the MenuRef
|
||||||
GetMenuItemRefCon( menuRef, menuItemIndex, (UInt32*) &item );
|
GetMenuItemRefCon( menuRef, menuItemIndex, (URefCon*) &item );
|
||||||
|
|
||||||
if (item)
|
if (item)
|
||||||
{
|
{
|
||||||
|
@@ -481,6 +481,9 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
|||||||
forceMLTE = true ;
|
forceMLTE = true ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
||||||
|
forceMLTE = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __WXMAC_OSX__
|
#ifdef __WXMAC_OSX__
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
|
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
|
||||||
@@ -493,13 +496,20 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
|||||||
|
|
||||||
if ( !m_peer )
|
if ( !m_peer )
|
||||||
{
|
{
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
|
||||||
if ( !(m_windowStyle & wxTE_MULTILINE) && !forceMLTE )
|
if ( !(m_windowStyle & wxTE_MULTILINE) && !forceMLTE )
|
||||||
|
#endif
|
||||||
|
{
|
||||||
m_peer = new wxMacUnicodeTextControl( this , str , pos , size , style ) ;
|
m_peer = new wxMacUnicodeTextControl( this , str , pos , size , style ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// the horizontal single line scrolling bug that made us keep
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
|
||||||
if ( !m_peer )
|
if ( !m_peer )
|
||||||
m_peer = new wxMacMLTEClassicControl( this , str , pos , size , style ) ;
|
m_peer = new wxMacMLTEClassicControl( this , str , pos , size , style ) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
MacPostControlCreate(pos, size) ;
|
MacPostControlCreate(pos, size) ;
|
||||||
|
|
||||||
@@ -1710,7 +1720,9 @@ void wxMacMLTEControl::SetStringValue( const wxString &str )
|
|||||||
wxMacConvertNewlines10To13( &st );
|
wxMacConvertNewlines10To13( &st );
|
||||||
|
|
||||||
{
|
{
|
||||||
wxMacWindowClipper c( m_peer );
|
#ifndef __LP64__
|
||||||
|
wxMacWindowClipper c( m_peer ) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
wxMacEditHelper help( m_txn );
|
wxMacEditHelper help( m_txn );
|
||||||
@@ -1891,7 +1903,7 @@ void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , lo
|
|||||||
#else
|
#else
|
||||||
typeAttr[attrCount].tag = kTXNATSUIStyle ;
|
typeAttr[attrCount].tag = kTXNATSUIStyle ;
|
||||||
typeAttr[attrCount].size = kTXNATSUIStyleSize ;
|
typeAttr[attrCount].size = kTXNATSUIStyleSize ;
|
||||||
typeAttr[attrCount].data.dataValue = (UInt32)font.MacGetATSUStyle() ;
|
typeAttr[attrCount].data.dataPtr = font.MacGetATSUStyle() ;
|
||||||
attrCount++ ;
|
attrCount++ ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1985,7 +1997,9 @@ void wxMacMLTEControl::Replace( long from , long to , const wxString &str )
|
|||||||
wxMacConvertNewlines10To13( &value ) ;
|
wxMacConvertNewlines10To13( &value ) ;
|
||||||
|
|
||||||
wxMacEditHelper help( m_txn ) ;
|
wxMacEditHelper help( m_txn ) ;
|
||||||
|
#ifndef __LP64__
|
||||||
wxMacWindowClipper c( m_peer ) ;
|
wxMacWindowClipper c( m_peer ) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
TXNSetSelection( m_txn, from, to ) ;
|
TXNSetSelection( m_txn, from, to ) ;
|
||||||
TXNClear( m_txn ) ;
|
TXNClear( m_txn ) ;
|
||||||
@@ -1994,7 +2008,9 @@ void wxMacMLTEControl::Replace( long from , long to , const wxString &str )
|
|||||||
|
|
||||||
void wxMacMLTEControl::Remove( long from , long to )
|
void wxMacMLTEControl::Remove( long from , long to )
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
wxMacWindowClipper c( m_peer ) ;
|
wxMacWindowClipper c( m_peer ) ;
|
||||||
|
#endif
|
||||||
wxMacEditHelper help( m_txn ) ;
|
wxMacEditHelper help( m_txn ) ;
|
||||||
TXNSetSelection( m_txn , from , to ) ;
|
TXNSetSelection( m_txn , from , to ) ;
|
||||||
TXNClear( m_txn ) ;
|
TXNClear( m_txn ) ;
|
||||||
@@ -2007,7 +2023,9 @@ void wxMacMLTEControl::GetSelection( long* from, long* to) const
|
|||||||
|
|
||||||
void wxMacMLTEControl::SetSelection( long from , long to )
|
void wxMacMLTEControl::SetSelection( long from , long to )
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
wxMacWindowClipper c( m_peer ) ;
|
wxMacWindowClipper c( m_peer ) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
// change the selection
|
// change the selection
|
||||||
if ((from == -1) && (to == -1))
|
if ((from == -1) && (to == -1))
|
||||||
@@ -2026,7 +2044,9 @@ void wxMacMLTEControl::WriteText( const wxString& str )
|
|||||||
long start , end , dummy ;
|
long start , end , dummy ;
|
||||||
|
|
||||||
GetSelection( &start , &dummy ) ;
|
GetSelection( &start , &dummy ) ;
|
||||||
|
#ifndef __LP64__
|
||||||
wxMacWindowClipper c( m_peer ) ;
|
wxMacWindowClipper c( m_peer ) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
wxMacEditHelper helper( m_txn ) ;
|
wxMacEditHelper helper( m_txn ) ;
|
||||||
@@ -2040,7 +2060,9 @@ void wxMacMLTEControl::WriteText( const wxString& str )
|
|||||||
|
|
||||||
void wxMacMLTEControl::Clear()
|
void wxMacMLTEControl::Clear()
|
||||||
{
|
{
|
||||||
|
#ifndef __LP64__
|
||||||
wxMacWindowClipper c( m_peer ) ;
|
wxMacWindowClipper c( m_peer ) ;
|
||||||
|
#endif
|
||||||
wxMacEditHelper st( m_txn ) ;
|
wxMacEditHelper st( m_txn ) ;
|
||||||
TXNSetSelection( m_txn , kTXNStartOffset , kTXNEndOffset ) ;
|
TXNSetSelection( m_txn , kTXNStartOffset , kTXNEndOffset ) ;
|
||||||
TXNClear( m_txn ) ;
|
TXNClear( m_txn ) ;
|
||||||
@@ -2158,30 +2180,24 @@ bool wxMacMLTEControl::PositionToXY( long pos, long *x, long *y ) const
|
|||||||
|
|
||||||
void wxMacMLTEControl::ShowPosition( long pos )
|
void wxMacMLTEControl::ShowPosition( long pos )
|
||||||
{
|
{
|
||||||
#if TARGET_RT_MAC_MACHO && defined(AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
|
Point current, desired ;
|
||||||
{
|
TXNOffset selstart, selend;
|
||||||
Point current, desired ;
|
|
||||||
TXNOffset selstart, selend;
|
|
||||||
|
|
||||||
TXNGetSelection( m_txn, &selstart, &selend );
|
TXNGetSelection( m_txn, &selstart, &selend );
|
||||||
TXNOffsetToPoint( m_txn, selstart, ¤t );
|
TXNOffsetToPoint( m_txn, selstart, ¤t );
|
||||||
TXNOffsetToPoint( m_txn, pos, &desired );
|
TXNOffsetToPoint( m_txn, pos, &desired );
|
||||||
|
|
||||||
// TODO: use HIPoints for 10.3 and above
|
// TODO: use HIPoints for 10.3 and above
|
||||||
if ( (UInt32)TXNScroll != (UInt32)kUnresolvedCFragSymbolAddress )
|
|
||||||
{
|
|
||||||
OSErr theErr = noErr;
|
|
||||||
SInt32 dv = desired.v - current.v;
|
|
||||||
SInt32 dh = desired.h - current.h;
|
|
||||||
TXNShowSelection( m_txn, kTXNShowStart ) ; // NB: should this be kTXNShowStart or kTXNShowEnd ??
|
|
||||||
theErr = TXNScroll( m_txn, kTXNScrollUnitsInPixels, kTXNScrollUnitsInPixels, &dv, &dh );
|
|
||||||
|
|
||||||
// there will be an error returned for classic MLTE implementation when the control is
|
OSErr theErr = noErr;
|
||||||
// invisible, but HITextView works correctly, so we don't assert that one
|
long dv = desired.v - current.v;
|
||||||
// wxASSERT_MSG( theErr == noErr, _T("TXNScroll returned an error!") );
|
long dh = desired.h - current.h;
|
||||||
}
|
TXNShowSelection( m_txn, kTXNShowStart ) ; // NB: should this be kTXNShowStart or kTXNShowEnd ??
|
||||||
}
|
theErr = TXNScroll( m_txn, kTXNScrollUnitsInPixels, kTXNScrollUnitsInPixels, &dv, &dh );
|
||||||
#endif
|
|
||||||
|
// there will be an error returned for classic MLTE implementation when the control is
|
||||||
|
// invisible, but HITextView works correctly, so we don't assert that one
|
||||||
|
// wxASSERT_MSG( theErr == noErr, _T("TXNScroll returned an error!") );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacMLTEControl::SetTXNData( const wxString& st, TXNOffset start, TXNOffset end )
|
void wxMacMLTEControl::SetTXNData( const wxString& st, TXNOffset start, TXNOffset end )
|
||||||
@@ -2282,6 +2298,8 @@ int wxMacMLTEControl::GetLineLength(long lineNo) const
|
|||||||
return theLength ;
|
return theLength ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// MLTE control implementation (classic part)
|
// MLTE control implementation (classic part)
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -2969,6 +2987,7 @@ OSStatus wxMacMLTEClassicControl::DoCreate()
|
|||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// MLTE control implementation (OSX part)
|
// MLTE control implementation (OSX part)
|
||||||
@@ -3078,8 +3097,9 @@ wxMacMLTEHIViewControl::wxMacMLTEHIViewControl( wxTextCtrl *wxPeer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
AdjustCreationAttributes( *wxWHITE , true ) ;
|
AdjustCreationAttributes( *wxWHITE , true ) ;
|
||||||
|
#ifndef __LP64__
|
||||||
wxMacWindowClipper c( m_peer ) ;
|
wxMacWindowClipper c( m_peer ) ;
|
||||||
|
#endif
|
||||||
SetTXNData( st , kTXNStartOffset, kTXNEndOffset ) ;
|
SetTXNData( st , kTXNStartOffset, kTXNEndOffset ) ;
|
||||||
|
|
||||||
TXNSetSelection( m_txn, 0, 0 );
|
TXNSetSelection( m_txn, 0, 0 );
|
||||||
|
@@ -454,7 +454,7 @@ pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , Even
|
|||||||
UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ;
|
UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ;
|
||||||
|
|
||||||
UniChar* charBuf = NULL;
|
UniChar* charBuf = NULL;
|
||||||
UInt32 dataSize = 0 ;
|
ByteCount dataSize = 0 ;
|
||||||
int numChars = 0 ;
|
int numChars = 0 ;
|
||||||
UniChar buf[2] ;
|
UniChar buf[2] ;
|
||||||
if ( GetEventParameter( event, kEventParamTextInputSendText, typeUnicodeText, NULL, 0 , &dataSize, NULL ) == noErr )
|
if ( GetEventParameter( event, kEventParamTextInputSendText, typeUnicodeText, NULL, 0 , &dataSize, NULL ) == noErr )
|
||||||
@@ -1079,7 +1079,7 @@ void wxWindowMac::MacPostControlCreate(const wxPoint& pos, const wxSize& size)
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( m_peer != NULL && m_peer->Ok() , wxT("No valid mac control") ) ;
|
wxASSERT_MSG( m_peer != NULL && m_peer->Ok() , wxT("No valid mac control") ) ;
|
||||||
|
|
||||||
m_peer->SetReference( (long)this ) ;
|
m_peer->SetReference( (URefCon) this ) ;
|
||||||
GetParent()->AddChild( this );
|
GetParent()->AddChild( this );
|
||||||
|
|
||||||
MacInstallEventHandler( (WXWidget) m_peer->GetControlRef() );
|
MacInstallEventHandler( (WXWidget) m_peer->GetControlRef() );
|
||||||
@@ -1430,7 +1430,7 @@ void wxWindowMac::DoScreenToClient(int *x, int *y) const
|
|||||||
if (y)
|
if (y)
|
||||||
localwhere.v = *y ;
|
localwhere.v = *y ;
|
||||||
|
|
||||||
QDGlobalToLocalPoint( GetWindowPort( window ) , &localwhere ) ;
|
wxMacGlobalToLocal( window , &localwhere ) ;
|
||||||
|
|
||||||
if (x)
|
if (x)
|
||||||
*x = localwhere.h ;
|
*x = localwhere.h ;
|
||||||
@@ -1465,7 +1465,7 @@ void wxWindowMac::DoClientToScreen(int *x, int *y) const
|
|||||||
if (y)
|
if (y)
|
||||||
localwhere.v = *y ;
|
localwhere.v = *y ;
|
||||||
|
|
||||||
QDLocalToGlobalPoint( GetWindowPort( window ) , &localwhere ) ;
|
wxMacLocalToGlobal( window, &localwhere ) ;
|
||||||
|
|
||||||
if (x)
|
if (x)
|
||||||
*x = localwhere.h ;
|
*x = localwhere.h ;
|
||||||
@@ -1682,23 +1682,33 @@ bool wxWindowMac::SetCursor(const wxCursor& cursor)
|
|||||||
{
|
{
|
||||||
wxTopLevelWindowMac *tlw = MacGetTopLevelWindow() ;
|
wxTopLevelWindowMac *tlw = MacGetTopLevelWindow() ;
|
||||||
WindowRef window = (WindowRef) ( tlw ? tlw->MacGetWindowRef() : 0 ) ;
|
WindowRef window = (WindowRef) ( tlw ? tlw->MacGetWindowRef() : 0 ) ;
|
||||||
|
|
||||||
|
ControlPartCode part ;
|
||||||
|
ControlRef control ;
|
||||||
|
Point pt ;
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||||
|
HIPoint hiPoint ;
|
||||||
|
HIGetMousePosition(kHICoordSpaceWindow, window, &hiPoint);
|
||||||
|
pt.h = hiPoint.x;
|
||||||
|
pt.v = hiPoint.y;
|
||||||
|
#else
|
||||||
CGrafPtr savePort ;
|
CGrafPtr savePort ;
|
||||||
Boolean swapped = QDSwapPort( GetWindowPort( window ) , &savePort ) ;
|
Boolean swapped = QDSwapPort( GetWindowPort( window ) , &savePort ) ;
|
||||||
|
|
||||||
// TODO: If we ever get a GetCurrentEvent... replacement
|
// TODO: If we ever get a GetCurrentEvent... replacement
|
||||||
// for the mouse position, use it...
|
// for the mouse position, use it...
|
||||||
|
|
||||||
Point pt ;
|
|
||||||
ControlPartCode part ;
|
|
||||||
ControlRef control ;
|
|
||||||
|
|
||||||
GetMouse( &pt ) ;
|
GetMouse( &pt ) ;
|
||||||
|
#endif
|
||||||
control = wxMacFindControlUnderMouse( tlw , pt , window , &part ) ;
|
control = wxMacFindControlUnderMouse( tlw , pt , window , &part ) ;
|
||||||
if ( control )
|
if ( control )
|
||||||
mouseWin = wxFindControlFromMacControl( control ) ;
|
mouseWin = wxFindControlFromMacControl( control ) ;
|
||||||
|
|
||||||
if ( swapped )
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
|
||||||
|
if ( swapped )
|
||||||
QDSwapPort( savePort , NULL ) ;
|
QDSwapPort( savePort , NULL ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( mouseWin == this && !wxIsBusy() )
|
if ( mouseWin == this && !wxIsBusy() )
|
||||||
@@ -2407,8 +2417,7 @@ void wxWindowMac::MacPaintBorders( int leftOrigin , int rightOrigin )
|
|||||||
m_peer->GetRect( &rect ) ;
|
m_peer->GetRect( &rect ) ;
|
||||||
InsetRect( &rect, -1 , -1 ) ;
|
InsetRect( &rect, -1 , -1 ) ;
|
||||||
|
|
||||||
#if wxMAC_USE_CORE_GRAPHICS && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
if ( UMAGetSystemVersion() >= 0x1030 )
|
|
||||||
{
|
{
|
||||||
CGRect cgrect = CGRectMake( rect.left , rect.top , rect.right - rect.left ,
|
CGRect cgrect = CGRectMake( rect.left , rect.top , rect.right - rect.left ,
|
||||||
rect.bottom - rect.top ) ;
|
rect.bottom - rect.top ) ;
|
||||||
@@ -2455,8 +2464,7 @@ void wxWindowMac::MacPaintBorders( int leftOrigin , int rightOrigin )
|
|||||||
HIThemeDrawGrowBox( &cgpoint , &info , cgContext , kHIThemeOrientationNormal ) ;
|
HIThemeDrawGrowBox( &cgpoint , &info , cgContext , kHIThemeOrientationNormal ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
#else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
wxTopLevelWindowMac* top = MacGetTopLevelWindow();
|
wxTopLevelWindowMac* top = MacGetTopLevelWindow();
|
||||||
if ( top )
|
if ( top )
|
||||||
@@ -2480,6 +2488,7 @@ void wxWindowMac::MacPaintBorders( int leftOrigin , int rightOrigin )
|
|||||||
// DrawThemeStandaloneNoGrowBox
|
// DrawThemeStandaloneNoGrowBox
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::RemoveChild( wxWindowBase *child )
|
void wxWindowMac::RemoveChild( wxWindowBase *child )
|
||||||
@@ -2546,8 +2555,6 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
int width , height ;
|
int width , height ;
|
||||||
GetClientSize( &width , &height ) ;
|
GetClientSize( &width , &height ) ;
|
||||||
|
|
||||||
#if TARGET_API_MAC_OSX
|
|
||||||
if ( true )
|
|
||||||
{
|
{
|
||||||
// note there currently is a bug in OSX which makes inefficient refreshes in case an entire control
|
// note there currently is a bug in OSX which makes inefficient refreshes in case an entire control
|
||||||
// area is scrolled, this does not occur if width and height are 2 pixels less,
|
// area is scrolled, this does not occur if width and height are 2 pixels less,
|
||||||
@@ -2587,68 +2594,8 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
#else
|
#else
|
||||||
// this would be the preferred version for fast drawing controls
|
// this would be the preferred version for fast drawing controls
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
|
HIViewRender(m_peer->GetControlRef()) ;
|
||||||
if ( UMAGetSystemVersion() >= 0x1030 )
|
|
||||||
HIViewRender(m_peer->GetControlRef()) ;
|
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
Update() ;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
wxPoint pos;
|
|
||||||
pos.x =
|
|
||||||
pos.y = 0;
|
|
||||||
|
|
||||||
Rect scrollrect;
|
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
|
||||||
|
|
||||||
{
|
|
||||||
wxClientDC dc(this) ;
|
|
||||||
wxMacPortSetter helper(&dc) ;
|
|
||||||
|
|
||||||
m_peer->GetRectInWindowCoords( &scrollrect ) ;
|
|
||||||
//scrollrect.top += MacGetTopBorderSize() ;
|
|
||||||
//scrollrect.left += MacGetLeftBorderSize() ;
|
|
||||||
scrollrect.bottom = scrollrect.top + height ;
|
|
||||||
scrollrect.right = scrollrect.left + width ;
|
|
||||||
|
|
||||||
if ( rect )
|
|
||||||
{
|
|
||||||
Rect r = { dc.YLOG2DEVMAC(rect->y) , dc.XLOG2DEVMAC(rect->x) , dc.YLOG2DEVMAC(rect->y + rect->height) ,
|
|
||||||
dc.XLOG2DEVMAC(rect->x + rect->width) } ;
|
|
||||||
SectRect( &scrollrect , &r , &scrollrect ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
|
|
||||||
|
|
||||||
// now scroll the former update region as well and add the new update region
|
|
||||||
WindowRef rootWindow = (WindowRef) MacGetTopLevelWindowRef() ;
|
|
||||||
RgnHandle formerUpdateRgn = NewRgn() ;
|
|
||||||
RgnHandle scrollRgn = NewRgn() ;
|
|
||||||
RectRgn( scrollRgn , &scrollrect ) ;
|
|
||||||
GetWindowUpdateRgn( rootWindow , formerUpdateRgn ) ;
|
|
||||||
Point pt = {0, 0} ;
|
|
||||||
LocalToGlobal( &pt ) ;
|
|
||||||
OffsetRgn( formerUpdateRgn , -pt.h , -pt.v ) ;
|
|
||||||
SectRgn( formerUpdateRgn , scrollRgn , formerUpdateRgn ) ;
|
|
||||||
|
|
||||||
if ( !EmptyRgn( formerUpdateRgn ) )
|
|
||||||
{
|
|
||||||
MacOffsetRgn( formerUpdateRgn , dx , dy ) ;
|
|
||||||
SectRgn( formerUpdateRgn , scrollRgn , formerUpdateRgn ) ;
|
|
||||||
InvalWindowRgn( rootWindow, formerUpdateRgn ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
InvalWindowRgn(rootWindow, updateRgn ) ;
|
|
||||||
DisposeRgn( updateRgn ) ;
|
|
||||||
DisposeRgn( formerUpdateRgn ) ;
|
|
||||||
DisposeRgn( scrollRgn ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
Update() ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindowMac *child;
|
wxWindowMac *child;
|
||||||
@@ -3079,19 +3026,16 @@ bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time )
|
|||||||
eventNc.SetEventObject( child );
|
eventNc.SetEventObject( child );
|
||||||
if ( !child->GetEventHandler()->ProcessEvent( eventNc ) )
|
if ( !child->GetEventHandler()->ProcessEvent( eventNc ) )
|
||||||
{
|
{
|
||||||
#if wxMAC_USE_CORE_GRAPHICS && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
if ( UMAGetSystemVersion() >= 0x1030 )
|
child->MacPaintBorders(0, 0) ;
|
||||||
{
|
#else
|
||||||
child->MacPaintBorders(0, 0) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
wxWindowDC dc(this) ;
|
wxWindowDC dc(this) ;
|
||||||
dc.SetClippingRegion(wxRegion(updatergn));
|
dc.SetClippingRegion(wxRegion(updatergn));
|
||||||
wxMacPortSetter helper(&dc) ;
|
wxMacPortSetter helper(&dc) ;
|
||||||
child->MacPaintBorders(0, 0) ;
|
child->MacPaintBorders(0, 0) ;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user