X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55ccdb93e4ae4b606a4068cb37492c1ec3ed77a6..e28cc3ca0aa9bb1c7e9613c447ca94b13a8bc858:/src/dfb/cursor.cpp diff --git a/src/dfb/cursor.cpp b/src/dfb/cursor.cpp index c5465f52fc..e013a91295 100644 --- a/src/dfb/cursor.cpp +++ b/src/dfb/cursor.cpp @@ -22,12 +22,23 @@ // wxCursorRefData //----------------------------------------------------------------------------- -class wxCursorRefData: public wxObjectRefData +class wxCursorRefData : public wxGDIRefData { public: wxCursorRefData(const wxBitmap& bmp = wxNullBitmap, int id = -1) : m_id(id), m_bitmap(bmp) {} + virtual bool IsOk() const { return m_bitmap.IsOk(); } + + // Create a deep copy of this object. + wxCursorRefData *Clone() const + { + wxBitmap bitmapCopy(m_bitmap); + bitmapCopy.UnShare(); + + return new wxCursorRefData(bitmapCopy, m_id); + } + int m_id; wxBitmap m_bitmap; }; @@ -41,41 +52,26 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxObject) -wxCursor::wxCursor(int cursorId) +void wxCursor::InitFromStock(wxStockCursor cursorId) { #warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)" } -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) ) -{ -#warning "FIXME" -} - wxCursor::wxCursor(const wxString& cursor_file, - long flags, + wxBitmapType type, int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY)) { #warning "FIXME" } -bool wxCursor::IsOk() const -{ - return m_refData && M_CURSOR->m_bitmap.Ok(); -} - -wxObjectRefData *wxCursor::CreateRefData() const +wxGDIRefData *wxCursor::CreateGDIRefData() const { return new wxCursorRefData; } -wxObjectRefData *wxCursor::CloneRefData(const wxObjectRefData *data) const +wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxCursorRefData(*(wxCursorRefData *)data); + return static_cast(data)->Clone(); }