]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: src/dfb/cursor.cpp | |
3 | // Purpose: wxCursor implementation | |
4 | // Author: Vaclav Slavik | |
5 | // Created: 2006-08-08 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2006 REA Elektronik GmbH | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | // For compilers that support precompilation, includes "wx.h". | |
12 | #include "wx/wxprec.h" | |
13 | ||
14 | #ifdef __BORLANDC__ | |
15 | #pragma hdrstop | |
16 | #endif | |
17 | ||
18 | #include "wx/cursor.h" | |
19 | #include "wx/bitmap.h" | |
20 | ||
21 | //----------------------------------------------------------------------------- | |
22 | // wxCursorRefData | |
23 | //----------------------------------------------------------------------------- | |
24 | ||
25 | class wxCursorRefData : public wxGDIRefData | |
26 | { | |
27 | public: | |
28 | wxCursorRefData(const wxBitmap& bmp = wxNullBitmap, int id = -1) | |
29 | : m_id(id), m_bitmap(bmp) {} | |
30 | ||
31 | virtual bool IsOk() const { return m_bitmap.IsOk(); } | |
32 | ||
33 | // Create a deep copy of this object. | |
34 | wxCursorRefData *Clone() const | |
35 | { | |
36 | wxBitmap bitmapCopy(m_bitmap); | |
37 | bitmapCopy.UnShare(); | |
38 | ||
39 | return new wxCursorRefData(bitmapCopy, m_id); | |
40 | } | |
41 | ||
42 | int m_id; | |
43 | wxBitmap m_bitmap; | |
44 | }; | |
45 | ||
46 | #define M_CURSOR_OF(c) ((wxCursorRefData*)((c).m_refData)) | |
47 | #define M_CURSOR M_CURSOR_OF(*this) | |
48 | ||
49 | //----------------------------------------------------------------------------- | |
50 | // wxCursor | |
51 | //----------------------------------------------------------------------------- | |
52 | ||
53 | IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxObject) | |
54 | ||
55 | void wxCursor::InitFromStock(wxStockCursor cursorId) | |
56 | { | |
57 | #warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)" | |
58 | } | |
59 | ||
60 | wxCursor::wxCursor(const wxString& cursor_file, | |
61 | wxBitmapType type, | |
62 | int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY)) | |
63 | { | |
64 | #warning "FIXME" | |
65 | } | |
66 | ||
67 | wxGDIRefData *wxCursor::CreateGDIRefData() const | |
68 | { | |
69 | return new wxCursorRefData; | |
70 | } | |
71 | ||
72 | wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const | |
73 | { | |
74 | return static_cast<const wxCursorRefData *>(data)->Clone(); | |
75 | } | |
76 | ||
77 | ||
78 | // ---------------------------------------------------------------------------- | |
79 | // Global cursor setting | |
80 | // ---------------------------------------------------------------------------- | |
81 | ||
82 | void wxSetCursor(const wxCursor& cursor) | |
83 | { | |
84 | #warning "FIXME: implement" | |
85 | } | |
86 | ||
87 | ||
88 | ||
89 | //----------------------------------------------------------------------------- | |
90 | // busy cursor routines | |
91 | //----------------------------------------------------------------------------- | |
92 | ||
93 | #warning "FIXME: this should be common code" | |
94 | #if 0 | |
95 | static wxCursor gs_savedCursor = wxNullCursor; | |
96 | static int gs_busyCount = 0; | |
97 | ||
98 | const wxCursor &wxBusyCursor::GetStoredCursor() | |
99 | { | |
100 | return gs_savedCursor; | |
101 | } | |
102 | ||
103 | const wxCursor wxBusyCursor::GetBusyCursor() | |
104 | { | |
105 | return gs_globalCursor; | |
106 | } | |
107 | #endif | |
108 | ||
109 | void wxEndBusyCursor() | |
110 | { | |
111 | #warning "FIXME - do this logic in common code?" | |
112 | } | |
113 | ||
114 | void wxBeginBusyCursor(const wxCursor *cursor) | |
115 | { | |
116 | #warning "FIXME" | |
117 | } | |
118 | ||
119 | bool wxIsBusy() | |
120 | { | |
121 | #warning "FIXME" | |
122 | return false; | |
123 | } |