]>
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 wxObjectRefData | |
26 | { | |
27 | public: | |
28 | wxCursorRefData(const wxBitmap& bmp = wxNullBitmap, int id = -1) | |
29 | : m_id(id), m_bitmap(bmp) {} | |
30 | ||
31 | int m_id; | |
32 | wxBitmap m_bitmap; | |
33 | }; | |
34 | ||
35 | #define M_CURSOR_OF(c) ((wxCursorRefData*)((c).m_refData)) | |
36 | #define M_CURSOR M_CURSOR_OF(*this) | |
37 | ||
38 | //----------------------------------------------------------------------------- | |
39 | // wxCursor | |
40 | //----------------------------------------------------------------------------- | |
41 | ||
42 | IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxObject) | |
43 | ||
44 | wxCursor::wxCursor(int cursorId) | |
45 | { | |
46 | #warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)" | |
47 | } | |
48 | ||
49 | wxCursor::wxCursor(const char WXUNUSED(bits)[], | |
50 | int WXUNUSED(width), | |
51 | int WXUNUSED(height), | |
52 | int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), | |
53 | const char WXUNUSED(maskBits)[], | |
54 | wxColour * WXUNUSED(fg), wxColour * WXUNUSED(bg) ) | |
55 | { | |
56 | #warning "FIXME" | |
57 | } | |
58 | ||
59 | wxCursor::wxCursor(const wxString& cursor_file, | |
60 | long flags, | |
61 | int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY)) | |
62 | { | |
63 | #warning "FIXME" | |
64 | } | |
65 | ||
66 | bool wxCursor::IsOk() const | |
67 | { | |
68 | return m_refData && M_CURSOR->m_bitmap.Ok(); | |
69 | } | |
70 | ||
71 | bool wxCursor::operator==(const wxCursor& cursor) const | |
72 | { | |
73 | if ( Ok() ) | |
74 | { | |
75 | if ( !cursor.Ok() ) | |
76 | return false; | |
77 | else if ( M_CURSOR->m_id != M_CURSOR_OF(cursor)->m_id ) | |
78 | return false; | |
79 | else if ( M_CURSOR->m_id == -1 ) // non-stock cursor | |
80 | return (m_refData == cursor.m_refData); | |
81 | else | |
82 | return true; // IDs != -1 and are the same | |
83 | } | |
84 | else | |
85 | { | |
86 | return !cursor.Ok(); | |
87 | } | |
88 | } | |
89 | ||
90 | wxObjectRefData *wxCursor::CreateRefData() const | |
91 | { | |
92 | return new wxCursorRefData; | |
93 | } | |
94 | ||
95 | wxObjectRefData *wxCursor::CloneRefData(const wxObjectRefData *data) const | |
96 | { | |
97 | return new wxCursorRefData(*(wxCursorRefData *)data); | |
98 | } | |
99 | ||
100 | ||
101 | // ---------------------------------------------------------------------------- | |
102 | // Global cursor setting | |
103 | // ---------------------------------------------------------------------------- | |
104 | ||
105 | void wxSetCursor(const wxCursor& cursor) | |
106 | { | |
107 | #warning "FIXME: implement" | |
108 | } | |
109 | ||
110 | ||
111 | ||
112 | //----------------------------------------------------------------------------- | |
113 | // busy cursor routines | |
114 | //----------------------------------------------------------------------------- | |
115 | ||
116 | #warning "FIXME: this should be common code" | |
117 | #if 0 | |
118 | static wxCursor gs_savedCursor = wxNullCursor; | |
119 | static int gs_busyCount = 0; | |
120 | ||
121 | const wxCursor &wxBusyCursor::GetStoredCursor() | |
122 | { | |
123 | return gs_savedCursor; | |
124 | } | |
125 | ||
126 | const wxCursor wxBusyCursor::GetBusyCursor() | |
127 | { | |
128 | return gs_globalCursor; | |
129 | } | |
130 | #endif | |
131 | ||
132 | void wxEndBusyCursor() | |
133 | { | |
134 | #warning "FIXME - do this logic in common code?" | |
135 | } | |
136 | ||
137 | void wxBeginBusyCursor(const wxCursor *cursor) | |
138 | { | |
139 | #warning "FIXME" | |
140 | } | |
141 | ||
142 | bool wxIsBusy() | |
143 | { | |
144 | #warning "FIXME" | |
145 | return false; | |
146 | } |