X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/127eab18f80e5b298b8c0326609ed811035e6829..f254e2424a5220e559e48205ace1114ea3e87f3f:/src/mgl/cursor.cpp diff --git a/src/mgl/cursor.cpp b/src/mgl/cursor.cpp index d2334ba0d2..7f99c1e987 100644 --- a/src/mgl/cursor.cpp +++ b/src/mgl/cursor.cpp @@ -15,11 +15,14 @@ #endif #include "wx/cursor.h" -#include "wx/module.h" -#include "wx/utils.h" -#include "wx/log.h" -#include "wx/intl.h" -#include "wx/hashmap.h" + +#ifndef WX_PRECOMP + #include "wx/intl.h" + #include "wx/log.h" + #include "wx/utils.h" + #include "wx/hashmap.h" + #include "wx/module.h" +#endif #include "wx/mgl/private.h" @@ -33,14 +36,14 @@ class wxCursorRefData: public wxObjectRefData public: wxCursorRefData(); - ~wxCursorRefData(); + virtual ~wxCursorRefData(); MGLCursor *m_cursor; }; wxCursorRefData::wxCursorRefData() { - m_cursor = (MGLCursor*) NULL; + m_cursor = NULL; } wxCursorRefData::~wxCursorRefData() @@ -62,14 +65,14 @@ wxCursor::wxCursor() { } -wxCursor::wxCursor(int cursorId) +void wxCursor::InitFromStock(wxStockCursor cursorId) { if ( !gs_cursorsHash ) gs_cursorsHash = new wxCursorsHash; if ( gs_cursorsHash->find(cursorId) != gs_cursorsHash->end() ) { - wxLogTrace(_T("mglcursor"), _T("cursor id %i fetched from cache"), cursorId); + wxLogTrace(wxT("mglcursor"), wxT("cursor id %i fetched from cache"), cursorId); *this = (*gs_cursorsHash)[cursorId]; return; } @@ -132,26 +135,16 @@ wxCursor::wxCursor(int cursorId) else { (*gs_cursorsHash)[cursorId] = *this; - wxLogTrace(_T("mglcursor"), _T("cursor id %i added to cache (%s)"), + wxLogTrace(wxT("mglcursor"), wxT("cursor id %i added to cache (%s)"), cursorId, cursorname); } } -wxCursor::wxCursor(const char WXUNUSED(bits)[], - int WXUNUSED(width), - int WXUNUSED(height), - int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), - const char WXUNUSED(maskBits)[], - wxColour * WXUNUSED(fg), wxColour * WXUNUSED(bg) ) -{ - //FIXME_MGL -} - wxCursor::wxCursor(const wxString& cursor_file, - long flags, + wxBitmapType type, int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY)) { - if ( flags == wxBITMAP_TYPE_CUR || flags == wxBITMAP_TYPE_CUR_RESOURCE ) + if ( type == wxBITMAP_TYPE_CUR || type == wxBITMAP_TYPE_CUR_RESOURCE ) { m_refData = new wxCursorRefData(); M_CURSORDATA->m_cursor = new MGLCursor(cursor_file.mb_str()); @@ -167,39 +160,11 @@ wxCursor::wxCursor(const wxString& cursor_file, } } -wxCursor::wxCursor(const wxCursor &cursor) -{ - Ref(cursor); -} - wxCursor::~wxCursor() { // wxObject unrefs data } -wxCursor& wxCursor::operator = (const wxCursor& cursor) -{ - if ( *this == cursor ) - return (*this); - Ref(cursor); - return *this; -} - -bool wxCursor::operator == (const wxCursor& cursor) const -{ - return (m_refData == cursor.m_refData); -} - -bool wxCursor::operator != (const wxCursor& cursor) const -{ - return (m_refData != cursor.m_refData); -} - -bool wxCursor::Ok() const -{ - return (m_refData != NULL); -} - MGLCursor *wxCursor::GetMGLCursor() const { return M_CURSORDATA->m_cursor; @@ -256,7 +221,7 @@ void wxEndBusyCursor() gs_savedCursor = wxNullCursor; } -void wxBeginBusyCursor(wxCursor *cursor) +void wxBeginBusyCursor(const wxCursor *cursor) { if ( gs_busyCount++ > 0 ) return;