X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3c7fc996a73e9f6a83067bc28a3c5581a3fee65..65fd2fc2616552e4204223b7c2b69d9bc87c1f2d:/src/mac/carbon/cursor.cpp diff --git a/src/mac/carbon/cursor.cpp b/src/mac/carbon/cursor.cpp index bf87cc5a88..cee91f767c 100644 --- a/src/mac/carbon/cursor.cpp +++ b/src/mac/carbon/cursor.cpp @@ -46,8 +46,7 @@ protected: long m_themeCursor; }; -#define M_CURSORDATA ((wxCursorRefData *)m_refData) -#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData) +#define M_CURSORDATA wx_static_cast(wxCursorRefData*, m_refData) const short kwxCursorBullseye = 0; const short kwxCursorBlank = 1; @@ -224,7 +223,9 @@ wxCursorRefData::~wxCursorRefData() { if ( m_isColorCursor ) { - ::DisposeCCursor( (CCrsrHandle) m_hCursor ) ; +#ifndef __LP64__ + ::DisposeCCursor( (CCrsrHandle) m_hCursor ) ; +#endif } else if ( m_disposeHandle ) { @@ -282,7 +283,7 @@ WXHCURSOR wxCursor::GetHCURSOR() const return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); } -bool wxCursor::Ok() const +bool wxCursor::IsOk() const { return (m_refData != NULL && ( M_CURSORDATA->m_hCursor != NULL || M_CURSORDATA->m_themeCursor != -1 ) ) ; } @@ -314,6 +315,7 @@ void wxCursor::CreateFromImage(const wxImage & image) { m_refData = new wxCursorRefData; +#ifndef __LP64__ int w = 16; int h = 16; @@ -444,6 +446,8 @@ void wxCursor::CreateFromImage(const wxImage & image) HUnlock( (Handle)ch ) ; M_CURSORDATA->m_hCursor = ch ; M_CURSORDATA->m_isColorCursor = true ; +#endif + } #endif //wxUSE_IMAGE @@ -453,6 +457,7 @@ wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int ho m_refData = new wxCursorRefData; if ( flags == wxBITMAP_TYPE_MACCURSOR_RESOURCE ) { +#ifndef __LP64__ Str255 theName ; wxMacStringToPascal( cursor_file , theName ) ; @@ -485,6 +490,7 @@ wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int ho M_CURSORDATA->m_releaseHandle = true ; } } +#endif } else { @@ -495,7 +501,8 @@ wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int ho { image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX ) ; image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, hotSpotY ) ; - delete m_refData ; + m_refData->DecRef() ; + m_refData = NULL ; CreateFromImage( image ) ; } #endif @@ -620,10 +627,12 @@ void wxCursor::MacInstall() const } 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 ) ; else ::SetCursor( * (CursHandle) M_CURSORDATA->m_hCursor ) ; +#endif } else {