X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b2680ced12cbbed16990007c5fa3ea7730700122..c84030e020e56735cb4b7c1534e99d21a8bb48c0:/src/osx/carbon/cursor.cpp diff --git a/src/osx/carbon/cursor.cpp b/src/osx/carbon/cursor.cpp index b7849bc732..cc6358b4a7 100644 --- a/src/osx/carbon/cursor.cpp +++ b/src/osx/carbon/cursor.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/carbon/cursor.cpp +// Name: src/osx/carbon/cursor.cpp // Purpose: wxCursor class // Author: Stefan Csomor // Modified by: @@ -66,10 +66,10 @@ protected: friend class wxCursor; - DECLARE_NO_ASSIGN_CLASS(wxCursorRefData) + wxDECLARE_NO_ASSIGN_CLASS(wxCursorRefData); }; -#define M_CURSORDATA wx_static_cast(wxCursorRefData*, m_refData) +#define M_CURSORDATA static_cast(m_refData) #if wxOSX_USE_COCOA_OR_CARBON @@ -274,11 +274,6 @@ wxCursor::wxCursor() { } -wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height), - int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), const char WXUNUSED(maskBits)[]) -{ -} - wxCursor::wxCursor( const wxImage &image ) { #if wxUSE_IMAGE @@ -286,11 +281,6 @@ wxCursor::wxCursor( const wxImage &image ) #endif } -wxCursor::wxCursor(const char* const* bits) -{ - (void) CreateFromXpm(bits); -} - wxGDIRefData *wxCursor::CreateGDIRefData() const { return new wxCursorRefData; @@ -298,21 +288,7 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data)); -} - -bool wxCursor::CreateFromXpm(const char* const* bits) -{ -#if wxUSE_IMAGE - 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") ); - CreateFromImage( img ) ; - return true; -#else - return false; -#endif + return new wxCursorRefData(*static_cast(data)); } WXHCURSOR wxCursor::GetHCURSOR() const @@ -355,7 +331,7 @@ void wxCursor::CreateFromImage(const wxImage & image) CGImageRef cgimage = wxMacCreateCGImageFromBitmap(bmp); if ( cgimage ) { - M_CURSORDATA->m_hCursor = wxMacCocoaCreateCursorFromCGImage( cgimage, hotSpotX, hotSpotY ); + M_CURSORDATA->m_hCursor = wxMacCocoaCreateCursorFromCGImage( cgimage, hotSpotX, hotSpotY ); CFRelease( cgimage ); } #elif wxOSX_USE_CARBON @@ -556,7 +532,7 @@ wxCursor::wxCursor(const wxString& cursor_file, wxBitmapType flags, int hotSpotX } // Cursors by stock number -wxCursor::wxCursor(int cursor_type) +void wxCursor::InitFromStock(wxStockCursor cursor_type) { m_refData = new wxCursorRefData; #if wxOSX_USE_COCOA @@ -652,6 +628,14 @@ wxCursor::wxCursor(int cursor_type) M_CURSORDATA->m_hCursor = wxGetStockCursor(kwxCursorRoller); break; + case wxCURSOR_OPEN_HAND: + M_CURSORDATA->m_themeCursor = kThemeOpenHandCursor; + break; + + case wxCURSOR_CLOSED_HAND: + M_CURSORDATA->m_themeCursor = kThemeClosedHandCursor; + break; + case wxCURSOR_CHAR: case wxCURSOR_ARROW: case wxCURSOR_LEFT_BUTTON: