X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f3078f075bd2ccaa86a681b2f37314fa1bb1a4c7..3ab296d9eb6d351eb1d2238f3e6ff2f5e6123861:/src/mac/carbon/cursor.cpp diff --git a/src/mac/carbon/cursor.cpp b/src/mac/carbon/cursor.cpp index eec2374c9a..bf87cc5a88 100644 --- a/src/mac/carbon/cursor.cpp +++ b/src/mac/carbon/cursor.cpp @@ -6,15 +6,19 @@ // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" -#include "wx/app.h" #include "wx/cursor.h" -#include "wx/icon.h" -#include "wx/image.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/icon.h" + #include "wx/image.h" +#endif // WX_PRECOMP + #include "wx/xpmdecod.h" #include "wx/mac/private.h" @@ -32,7 +36,7 @@ class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData public: wxCursorRefData(); - ~wxCursorRefData(); + virtual ~wxCursorRefData(); protected: WXHCURSOR m_hCursor; @@ -195,6 +199,13 @@ CursHandle wxGetStockCursor( int number ) CursHandle c = (CursHandle) NewHandle( sizeof(Cursor) ) ; memcpy( *c, &gMacCursors[number], sizeof(Cursor) ) ; +#ifndef WORDS_BIGENDIAN + short *sptr = (short*) *c ; + for ( int i = 0 ; i < 2 * 16 /* image and mask */ ; ++i, ++sptr ) + { + *sptr = CFSwapInt16( *sptr ) ; + } +#endif return c ; } @@ -255,10 +266,10 @@ wxCursor::wxCursor(char **bits) bool wxCursor::CreateFromXpm(const char **bits) { #if wxUSE_IMAGE - wxCHECK_MSG( bits != NULL, false, wxT("invalid cursor data") ) + wxCHECK_MSG( bits != NULL, false, wxT("invalid cursor data") ); wxXPMDecoder decoder; wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), false, wxT("invalid cursor data") ) + wxCHECK_MSG( img.Ok(), false, wxT("invalid cursor data") ); CreateFromImage( img ) ; return true; #else @@ -418,9 +429,13 @@ void wxCursor::CreateFromImage(const wxImage & image) *((*(**ch).crsrData) + y * bytesPerRow + x) = GetCTabIndex( newColors , &col) ; } - +#ifdef WORDS_BIGENDIAN (**ch).crsr1Data[y] = rowbits ; (**ch).crsrMask[y] = maskbits ; +#else + (**ch).crsr1Data[y] = CFSwapInt16(rowbits) ; + (**ch).crsrMask[y] = CFSwapInt16(maskbits) ; +#endif } if ( !bHasMask )