]>
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 wxObjectRefData
28 wxCursorRefData(const wxBitmap
& bmp
= wxNullBitmap
, int id
= -1)
29 : m_id(id
), m_bitmap(bmp
) {}
35 #define M_CURSOR_OF(c) ((wxCursorRefData*)((c).m_refData))
36 #define M_CURSOR M_CURSOR_OF(*this)
38 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
42 IMPLEMENT_DYNAMIC_CLASS(wxCursor
, wxObject
)
44 wxCursor::wxCursor(int cursorId
)
46 #warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)"
49 wxCursor::wxCursor(const char WXUNUSED(bits
)[],
52 int WXUNUSED(hotSpotX
), int WXUNUSED(hotSpotY
),
53 const char WXUNUSED(maskBits
)[],
54 wxColour
* WXUNUSED(fg
), wxColour
* WXUNUSED(bg
) )
59 wxCursor::wxCursor(const wxString
& cursor_file
,
61 int WXUNUSED(hotSpotX
), int WXUNUSED(hotSpotY
))
66 bool wxCursor::IsOk() const
68 return m_refData
&& M_CURSOR
->m_bitmap
.Ok();
71 wxObjectRefData
*wxCursor::CreateRefData() const
73 return new wxCursorRefData
;
76 wxObjectRefData
*wxCursor::CloneRefData(const wxObjectRefData
*data
) const
78 return new wxCursorRefData(*(wxCursorRefData
*)data
);
82 // ----------------------------------------------------------------------------
83 // Global cursor setting
84 // ----------------------------------------------------------------------------
86 void wxSetCursor(const wxCursor
& cursor
)
88 #warning "FIXME: implement"
93 //-----------------------------------------------------------------------------
94 // busy cursor routines
95 //-----------------------------------------------------------------------------
97 #warning "FIXME: this should be common code"
99 static wxCursor gs_savedCursor
= wxNullCursor
;
100 static int gs_busyCount
= 0;
102 const wxCursor
&wxBusyCursor::GetStoredCursor()
104 return gs_savedCursor
;
107 const wxCursor
wxBusyCursor::GetBusyCursor()
109 return gs_globalCursor
;
113 void wxEndBusyCursor()
115 #warning "FIXME - do this logic in common code?"
118 void wxBeginBusyCursor(const wxCursor
*cursor
)