]>
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(); }
37 #define M_CURSOR_OF(c) ((wxCursorRefData*)((c).m_refData))
38 #define M_CURSOR M_CURSOR_OF(*this)
40 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
44 IMPLEMENT_DYNAMIC_CLASS(wxCursor
, wxObject
)
46 void wxCursor::InitFromStock(wxStockCursor cursorId
)
48 #warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)"
51 wxCursor::wxCursor(const wxString
& cursor_file
,
53 int WXUNUSED(hotSpotX
), int WXUNUSED(hotSpotY
))
58 wxGDIRefData
*wxCursor::CreateGDIRefData() const
60 return new wxCursorRefData
;
63 wxGDIRefData
*wxCursor::CloneGDIRefData(const wxGDIRefData
*data
) const
65 return new wxCursorRefData(*(wxCursorRefData
*)data
);
69 // ----------------------------------------------------------------------------
70 // Global cursor setting
71 // ----------------------------------------------------------------------------
73 void wxSetCursor(const wxCursor
& cursor
)
75 #warning "FIXME: implement"
80 //-----------------------------------------------------------------------------
81 // busy cursor routines
82 //-----------------------------------------------------------------------------
84 #warning "FIXME: this should be common code"
86 static wxCursor gs_savedCursor
= wxNullCursor
;
87 static int gs_busyCount
= 0;
89 const wxCursor
&wxBusyCursor::GetStoredCursor()
91 return gs_savedCursor
;
94 const wxCursor
wxBusyCursor::GetBusyCursor()
96 return gs_globalCursor
;
100 void wxEndBusyCursor()
102 #warning "FIXME - do this logic in common code?"
105 void wxBeginBusyCursor(const wxCursor
*cursor
)