X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/179c2d913671b785ca9c9982bb753aa0817e5182..ff534ba469473a9ace193e736ca131144df307f9:/src/osx/carbon/cursor.cpp diff --git a/src/osx/carbon/cursor.cpp b/src/osx/carbon/cursor.cpp index 751ea2b6f7..fba9efb8f5 100644 --- a/src/osx/carbon/cursor.cpp +++ b/src/osx/carbon/cursor.cpp @@ -66,7 +66,7 @@ protected: friend class wxCursor; - DECLARE_NO_ASSIGN_CLASS(wxCursorRefData) + wxDECLARE_NO_ASSIGN_CLASS(wxCursorRefData); }; #define M_CURSORDATA static_cast(m_refData) @@ -196,6 +196,14 @@ ClassicCursor gMacCursors[kwxCursorLast+1] = {0x000A, 0x0006} }, +{ +{0x07E0, 0x07E0, 0x07E0, 0x07E0, 0x0810, 0x1088, 0x1088, 0x1088, +0x1388, 0x1008, 0x1008, 0x0810, 0x07E0, 0x07E0, 0x07E0, 0x07E0}, +{0x07E0, 0x07E0, 0x07E0, 0x07E0, 0x0FF0, 0x1FF8, 0x1FF8, 0x1FF8, +0x1FF8, 0x1FF8, 0x1FF8, 0x0FF0, 0x07E0, 0x07E0, 0x07E0, 0x07E0}, +{0x0008, 0x0008} +}, + }; #endif @@ -231,14 +239,14 @@ wxCursorRefData::wxCursorRefData() #endif } -wxCursorRefData::wxCursorRefData(const wxCursorRefData& cursor) +wxCursorRefData::wxCursorRefData(const wxCursorRefData& cursor) : wxGDIRefData() { - // FIXME: need to copy the cursor m_hCursor = NULL; #if wxOSX_USE_COCOA - wxUnusedVar(cursor); + m_hCursor = (WX_NSCursor) wxMacCocoaRetain(cursor.m_hCursor); #elif wxOSX_USE_CARBON + // FIXME: need to copy the cursor m_disposeHandle = false; m_releaseHandle = false; m_isColorCursor = cursor.m_isColorCursor; @@ -281,11 +289,6 @@ wxCursor::wxCursor( const wxImage &image ) #endif } -wxCursor::wxCursor(const char* const* bits) -{ - (void) CreateFromXpm(bits); -} - wxGDIRefData *wxCursor::CreateGDIRefData() const { return new wxCursorRefData; @@ -296,20 +299,6 @@ wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const return new wxCursorRefData(*static_cast(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 -} - WXHCURSOR wxCursor::GetHCURSOR() const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); @@ -538,7 +527,7 @@ wxCursor::wxCursor(const wxString& cursor_file, wxBitmapType flags, int hotSpotX #if wxUSE_IMAGE wxImage image ; image.LoadFile( cursor_file, flags ) ; - if ( image.Ok() ) + if ( image.IsOk() ) { image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX ) ; image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, hotSpotY ) ; @@ -654,7 +643,7 @@ void wxCursor::InitFromStock(wxStockCursor cursor_type) case wxCURSOR_CLOSED_HAND: M_CURSORDATA->m_themeCursor = kThemeClosedHandCursor; break; - + case wxCURSOR_CHAR: case wxCURSOR_ARROW: case wxCURSOR_LEFT_BUTTON: