From e737363e6bd7722246d0a7bef0fffa66f5784f7a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 11 Nov 2014 01:02:45 +0000 Subject: [PATCH] Introduce wxCursorBase class defining common wxCursor API. This is done in preparation for adding a new wxCursor method and will allow us to define it in a single place by default instead of having to provide stubs for all ports. See #16539. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78133 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cursor.h | 24 ++++++++++++++++-------- include/wx/dfb/cursor.h | 3 +-- include/wx/gtk/cursor.h | 3 +-- include/wx/gtk1/cursor.h | 3 +-- include/wx/motif/cursor.h | 3 +-- include/wx/msw/cursor.h | 4 +--- include/wx/osx/cursor.h | 2 +- include/wx/qt/cursor.h | 3 +-- include/wx/x11/cursor.h | 3 +-- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/wx/cursor.h b/include/wx/cursor.h index e48efe354b..f5cbdab5fc 100644 --- a/include/wx/cursor.h +++ b/include/wx/cursor.h @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// // Name: wx/cursor.h // Purpose: wxCursor base header -// Author: Julian Smart -// Modified by: +// Author: Julian Smart, Vadim Zeitlin // Created: // Copyright: (c) Julian Smart +// (c) 2014 Vadim Zeitlin (wxCursorBase) // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// @@ -13,12 +13,22 @@ #include "wx/defs.h" -/* - wxCursor classes should have the following public API: +#include "wx/gdiobj.h" -class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject +// Under most ports, wxCursor derives directly from wxGDIObject, but in wxMSW +// there is an intermediate wxGDIImage class. +#ifdef __WXMSW__ + #include "wx/msw/gdiimage.h" +#else + typedef wxGDIObject wxGDIImage; +#endif + +class WXDLLIMPEXP_CORE wxCursorBase : public wxGDIImage { public: +/* + wxCursor classes should provide the following ctors: + wxCursor(); wxCursor(const wxImage& image); wxCursor(const wxString& name, @@ -28,10 +38,8 @@ public: #if WXWIN_COMPATIBILITY_2_8 wxCursor(int id) { InitFromStock((wxStockCursor)id); } #endif - virtual ~wxCursor(); -}; - */ +}; #if defined(__WXMSW__) #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE diff --git a/include/wx/dfb/cursor.h b/include/wx/dfb/cursor.h index 32e102e8f3..6d0b44594b 100644 --- a/include/wx/dfb/cursor.h +++ b/include/wx/dfb/cursor.h @@ -10,7 +10,6 @@ #ifndef _WX_DFB_CURSOR_H_ #define _WX_DFB_CURSOR_H_ -#include "wx/gdiobj.h" #include "wx/gdicmn.h" class WXDLLIMPEXP_FWD_CORE wxBitmap; @@ -19,7 +18,7 @@ class WXDLLIMPEXP_FWD_CORE wxBitmap; // wxCursor //----------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject +class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: wxCursor() {} diff --git a/include/wx/gtk/cursor.h b/include/wx/gtk/cursor.h index 2c4b97aa13..bf3f22ba88 100644 --- a/include/wx/gtk/cursor.h +++ b/include/wx/gtk/cursor.h @@ -9,7 +9,6 @@ #ifndef _WX_GTK_CURSOR_H_ #define _WX_GTK_CURSOR_H_ -#include "wx/gdiobj.h" #include "wx/gdicmn.h" class WXDLLIMPEXP_FWD_CORE wxColour; @@ -19,7 +18,7 @@ class WXDLLIMPEXP_FWD_CORE wxImage; // wxCursor //----------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject +class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: wxCursor(); diff --git a/include/wx/gtk1/cursor.h b/include/wx/gtk1/cursor.h index 15b041183f..9832ef8e40 100644 --- a/include/wx/gtk1/cursor.h +++ b/include/wx/gtk1/cursor.h @@ -9,7 +9,6 @@ #ifndef __GTKCURSORH__ #define __GTKCURSORH__ -#include "wx/gdiobj.h" #include "wx/gdicmn.h" #if wxUSE_IMAGE @@ -20,7 +19,7 @@ // wxCursor //----------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject +class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: wxCursor(); diff --git a/include/wx/motif/cursor.h b/include/wx/motif/cursor.h index 3915d44335..b089ac8975 100644 --- a/include/wx/motif/cursor.h +++ b/include/wx/motif/cursor.h @@ -11,13 +11,12 @@ #ifndef _WX_CURSOR_H_ #define _WX_CURSOR_H_ -#include "wx/gdiobj.h" #include "wx/gdicmn.h" class WXDLLIMPEXP_FWD_CORE wxImage; // Cursor -class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject +class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: wxCursor(); diff --git a/include/wx/msw/cursor.h b/include/wx/msw/cursor.h index aef2e2a516..c3ec916fc9 100644 --- a/include/wx/msw/cursor.h +++ b/include/wx/msw/cursor.h @@ -11,12 +11,10 @@ #ifndef _WX_CURSOR_H_ #define _WX_CURSOR_H_ -#include "wx/msw/gdiimage.h" - class WXDLLIMPEXP_FWD_CORE wxImage; // Cursor -class WXDLLIMPEXP_CORE wxCursor : public wxGDIImage +class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: // constructors diff --git a/include/wx/osx/cursor.h b/include/wx/osx/cursor.h index 0dcf5be22d..b250839dc2 100644 --- a/include/wx/osx/cursor.h +++ b/include/wx/osx/cursor.h @@ -14,7 +14,7 @@ #include "wx/bitmap.h" // Cursor -class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject +class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: wxCursor(); diff --git a/include/wx/qt/cursor.h b/include/wx/qt/cursor.h index 26e3c0d93e..21287997ac 100644 --- a/include/wx/qt/cursor.h +++ b/include/wx/qt/cursor.h @@ -9,12 +9,11 @@ #define _WX_QT_CURSOR_H_ #include "wx/gdicmn.h" -#include "wx/gdiobj.h" #include "wx/image.h" #include -class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject +class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: wxCursor() { } diff --git a/include/wx/x11/cursor.h b/include/wx/x11/cursor.h index a4595ae31f..1e7fcba7c8 100644 --- a/include/wx/x11/cursor.h +++ b/include/wx/x11/cursor.h @@ -11,7 +11,6 @@ #ifndef _WX_CURSOR_H_ #define _WX_CURSOR_H_ -#include "wx/gdiobj.h" #include "wx/gdicmn.h" #include "wx/colour.h" @@ -21,7 +20,7 @@ class WXDLLIMPEXP_FWD_CORE wxImage; // wxCursor //----------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject +class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: wxCursor();