From 66f75561893ea7b4bf429d1882d9cc0407ba932d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 15 Dec 2010 12:04:13 +0000 Subject: [PATCH] Compilation fixes for wx{X11,GTK1,Motif} after making ref data non copyable. Don't use wrong compiler-generated copy ctors in the other ports neither (see r66371..66373 for wxGTK fixes). This fixes compilation after r66374 without reducing functionality but just making it more clear where it is missing. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk1/cursor.cpp | 12 ++++++++++-- src/motif/cursor.cpp | 12 ++++++++++-- src/x11/cursor.cpp | 12 ++++++++++-- src/x11/palette.cpp | 7 +++++-- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index b402989ce0..50a08c7f90 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -38,6 +38,11 @@ public: virtual ~wxCursorRefData(); GdkCursor *m_cursor; + +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() @@ -325,9 +330,12 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const return new wxCursorRefData; } -wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const +wxGDIRefData * +wxCursor::CloneGDIRefData(const wxGDIRefData * WXUNUSED(data)) const { - return new wxCursorRefData(*static_cast(data)); + wxFAIL_MSG( wxS("Cloning cursors is not implemented in wxGTK.") ); + + return new wxCursorRefData; } //----------------------------------------------------------------------------- diff --git a/src/motif/cursor.cpp b/src/motif/cursor.cpp index 4500e6ebc2..22646e641a 100644 --- a/src/motif/cursor.cpp +++ b/src/motif/cursor.cpp @@ -59,6 +59,11 @@ public: wxXCursorList m_cursors; // wxXCursor objects, one per display wxStockCursor m_cursorId; // wxWidgets standard cursor id +private: + // There is no way to copy m_cursor so we can't implement a copy ctor + // properly. + wxDECLARE_NO_COPY_CLASS(wxCursorRefData); + friend class wxCursor; }; @@ -304,9 +309,12 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const return new wxCursorRefData; } -wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const +wxGDIRefData * +wxCursor::CloneGDIRefData(const wxGDIRefData * WXUNUSED(data)) const { - return new wxCursorRefData(*static_cast(data)); + wxFAIL_MSG( wxS("Cloning cursors is not implemented in wxMotif.") ); + + return new wxCursorRefData; } // Motif-specific: create/get a cursor for the current display diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp index 6688cfafee..d89db5b450 100644 --- a/src/x11/cursor.cpp +++ b/src/x11/cursor.cpp @@ -41,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() @@ -147,9 +152,12 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const return new wxCursorRefData; } -wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const +wxGDIRefData * +wxCursor::CloneGDIRefData(const wxGDIRefData * WXUNUSED(data)) const { - return new wxCursorRefData(*static_cast(data)); + wxFAIL_MSG( wxS("Cloning cursors is not implemented in wxX11.") ); + + return new wxCursorRefData; } WXCursor wxCursor::GetCursor() const diff --git a/src/x11/palette.cpp b/src/x11/palette.cpp index 82c455bd80..dc3f06801d 100644 --- a/src/x11/palette.cpp +++ b/src/x11/palette.cpp @@ -175,9 +175,12 @@ wxGDIRefData *wxPalette::CreateGDIRefData() const return new wxPaletteRefData; } -wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const +wxGDIRefData * +wxPalette::CloneGDIRefData(const wxGDIRefData * WXUNUSED(data)) const { - return new wxPaletteRefData(*static_cast(data)); + wxFAIL_MSG( wxS("Cloning palettes is not implemented in wxX11.") ); + + return new wxPaletteRefData; } int wxPalette::GetPixel(unsigned char WXUNUSED(red), -- 2.47.2