X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b7cacb43db1e69b87b257a67912b4d52995b070a..04fa04d8067d235ab45b5bc05b65f0679634b541:/src/x11/cursor.cpp?ds=sidebyside diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp index bd861353d6..c314e4f387 100644 --- a/src/x11/cursor.cpp +++ b/src/x11/cursor.cpp @@ -19,6 +19,7 @@ #include "wx/utils.h" #include "wx/icon.h" #include "wx/gdicmn.h" + #include "wx/image.h" #endif #include "wx/x11/private.h" @@ -31,7 +32,7 @@ // wxCursor //----------------------------------------------------------------------------- -class wxCursorRefData: public wxObjectRefData +class wxCursorRefData: public wxGDIRefData { public: @@ -40,6 +41,11 @@ public: WXCursor m_cursor; WXDisplay *m_display; + +private: + // There is no way to copy m_cursor so we can't implement a copy ctor + // properly. + wxDECLARE_NO_COPY_CLASS(wxCursorRefData); }; wxCursorRefData::wxCursorRefData() @@ -65,7 +71,7 @@ wxCursor::wxCursor() } -wxCursor::wxCursor( int cursorId ) +void wxCursor::InitFromStock( wxStockCursor cursorId ) { m_refData = new wxCursorRefData(); @@ -123,15 +129,15 @@ wxCursor::wxCursor( int cursorId ) #endif } -wxCursor::wxCursor(const char bits[], int width, int height, - int hotSpotX, int hotSpotY, - const char maskBits[], wxColour *fg, wxColour *bg) +wxCursor::wxCursor(const wxString& WXUNUSED(name), + wxBitmapType WXUNUSED(type), + int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY)) { - wxFAIL_MSG( wxT("wxCursor creation from bits not yet implemented") ); + wxFAIL_MSG( wxT("wxCursor creation from file not yet implemented") ); } #if wxUSE_IMAGE -wxCursor::wxCursor( const wxImage & image ) +wxCursor::wxCursor( const wxImage & WXUNUSED(image) ) { wxFAIL_MSG( wxT("wxCursor creation from wxImage not yet implemented") ); } @@ -141,19 +147,17 @@ wxCursor::~wxCursor() { } -bool wxCursor::operator == ( const wxCursor& cursor ) const +wxGDIRefData *wxCursor::CreateGDIRefData() const { - return m_refData == cursor.m_refData; + return new wxCursorRefData; } -bool wxCursor::operator != ( const wxCursor& cursor ) const +wxGDIRefData * +wxCursor::CloneGDIRefData(const wxGDIRefData * WXUNUSED(data)) const { - return m_refData != cursor.m_refData; -} + wxFAIL_MSG( wxS("Cloning cursors is not implemented in wxX11.") ); -bool wxCursor::IsOk() const -{ - return (m_refData != NULL); + return new wxCursorRefData; } WXCursor wxCursor::GetCursor() const @@ -197,7 +201,7 @@ void wxBeginBusyCursor( const wxCursor *WXUNUSED(cursor) ) if (gs_busyCount++ > 0) return; - wxASSERT_MSG( !gs_savedCursor.Ok(), + wxASSERT_MSG( !gs_savedCursor.IsOk(), wxT("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = g_globalCursor;