]>
git.saurik.com Git - wxWidgets.git/blob - src/dfb/cursor.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/dfb/cursor.cpp
3 // Purpose: wxCursor implementation
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2006 REA Elektronik GmbH
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
17 #include "wx/cursor.h"
18 #include "wx/bitmap.h"
20 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
24 class wxCursorRefData
: public wxGDIRefData
27 wxCursorRefData(const wxBitmap
& bmp
= wxNullBitmap
, int id
= -1)
28 : m_id(id
), m_bitmap(bmp
) {}
30 virtual bool IsOk() const { return m_bitmap
.IsOk(); }
32 // Create a deep copy of this object.
33 wxCursorRefData
*Clone() const
35 wxBitmap
bitmapCopy(m_bitmap
);
38 return new wxCursorRefData(bitmapCopy
, m_id
);
45 #define M_CURSOR_OF(c) ((wxCursorRefData*)((c).m_refData))
46 #define M_CURSOR M_CURSOR_OF(*this)
48 //-----------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------
52 IMPLEMENT_DYNAMIC_CLASS(wxCursor
, wxObject
)
54 void wxCursor::InitFromStock(wxStockCursor cursorId
)
56 #warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)"
59 wxCursor::wxCursor(const wxString
& cursor_file
,
61 int WXUNUSED(hotSpotX
), int WXUNUSED(hotSpotY
))
66 wxGDIRefData
*wxCursor::CreateGDIRefData() const
68 return new wxCursorRefData
;
71 wxGDIRefData
*wxCursor::CloneGDIRefData(const wxGDIRefData
*data
) const
73 return static_cast<const wxCursorRefData
*>(data
)->Clone();
77 // ----------------------------------------------------------------------------
78 // Global cursor setting
79 // ----------------------------------------------------------------------------
81 void wxSetCursor(const wxCursor
& cursor
)
83 #warning "FIXME: implement"
88 //-----------------------------------------------------------------------------
89 // busy cursor routines
90 //-----------------------------------------------------------------------------
92 #warning "FIXME: this should be common code"
94 static wxCursor gs_savedCursor
= wxNullCursor
;
95 static int gs_busyCount
= 0;
97 const wxCursor
&wxBusyCursor::GetStoredCursor()
99 return gs_savedCursor
;
102 const wxCursor
wxBusyCursor::GetBusyCursor()
104 return gs_globalCursor
;
108 void wxEndBusyCursor()
110 #warning "FIXME - do this logic in common code?"
113 void wxBeginBusyCursor(const wxCursor
*cursor
)