]>
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
7 // Copyright: (c) 2006 REA Elektronik GmbH
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
18 #include "wx/cursor.h"
19 #include "wx/bitmap.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 class wxCursorRefData
: public wxGDIRefData
28 wxCursorRefData(const wxBitmap
& bmp
= wxNullBitmap
, int id
= -1)
29 : m_id(id
), m_bitmap(bmp
) {}
31 virtual bool IsOk() const { return m_bitmap
.IsOk(); }
33 // Create a deep copy of this object.
34 wxCursorRefData
*Clone() const
36 wxBitmap
bitmapCopy(m_bitmap
);
39 return new wxCursorRefData(bitmapCopy
, m_id
);
46 #define M_CURSOR_OF(c) ((wxCursorRefData*)((c).m_refData))
47 #define M_CURSOR M_CURSOR_OF(*this)
49 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
53 IMPLEMENT_DYNAMIC_CLASS(wxCursor
, wxObject
)
55 void wxCursor::InitFromStock(wxStockCursor cursorId
)
57 #warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)"
60 wxCursor::wxCursor(const wxString
& cursor_file
,
62 int WXUNUSED(hotSpotX
), int WXUNUSED(hotSpotY
))
67 wxGDIRefData
*wxCursor::CreateGDIRefData() const
69 return new wxCursorRefData
;
72 wxGDIRefData
*wxCursor::CloneGDIRefData(const wxGDIRefData
*data
) const
74 return static_cast<const wxCursorRefData
*>(data
)->Clone();
78 // ----------------------------------------------------------------------------
79 // Global cursor setting
80 // ----------------------------------------------------------------------------
82 void wxSetCursor(const wxCursor
& cursor
)
84 #warning "FIXME: implement"
89 //-----------------------------------------------------------------------------
90 // busy cursor routines
91 //-----------------------------------------------------------------------------
93 #warning "FIXME: this should be common code"
95 static wxCursor gs_savedCursor
= wxNullCursor
;
96 static int gs_busyCount
= 0;
98 const wxCursor
&wxBusyCursor::GetStoredCursor()
100 return gs_savedCursor
;
103 const wxCursor
wxBusyCursor::GetBusyCursor()
105 return gs_globalCursor
;
109 void wxEndBusyCursor()
111 #warning "FIXME - do this logic in common code?"
114 void wxBeginBusyCursor(const wxCursor
*cursor
)