]> git.saurik.com Git - wxWidgets.git/blame - src/dfb/cursor.cpp
Always link with expat in monolithic build.
[wxWidgets.git] / src / dfb / cursor.cpp
CommitLineData
b3c86150
VS
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
8f884a0d 25class wxCursorRefData : public wxGDIRefData
b3c86150
VS
26{
27public:
28 wxCursorRefData(const wxBitmap& bmp = wxNullBitmap, int id = -1)
29 : m_id(id), m_bitmap(bmp) {}
30
8f884a0d
VZ
31 virtual bool IsOk() const { return m_bitmap.IsOk(); }
32
fd324b29
VZ
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
b3c86150
VS
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
53IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxObject)
54
0ef5b1da 55void wxCursor::InitFromStock(wxStockCursor cursorId)
b3c86150
VS
56{
57#warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)"
58}
59
b3c86150 60wxCursor::wxCursor(const wxString& cursor_file,
0ef5b1da 61 wxBitmapType type,
b3c86150
VS
62 int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY))
63{
64#warning "FIXME"
65}
66
8f884a0d 67wxGDIRefData *wxCursor::CreateGDIRefData() const
b3c86150
VS
68{
69 return new wxCursorRefData;
70}
71
8f884a0d 72wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const
b3c86150 73{
fd324b29 74 return static_cast<const wxCursorRefData *>(data)->Clone();
b3c86150
VS
75}
76
77
78// ----------------------------------------------------------------------------
79// Global cursor setting
80// ----------------------------------------------------------------------------
81
82void 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
95static wxCursor gs_savedCursor = wxNullCursor;
96static int gs_busyCount = 0;
97
98const wxCursor &wxBusyCursor::GetStoredCursor()
99{
100 return gs_savedCursor;
101}
102
103const wxCursor wxBusyCursor::GetBusyCursor()
104{
105 return gs_globalCursor;
106}
107#endif
108
109void wxEndBusyCursor()
110{
111 #warning "FIXME - do this logic in common code?"
112}
113
114void wxBeginBusyCursor(const wxCursor *cursor)
115{
116 #warning "FIXME"
117}
118
119bool wxIsBusy()
120{
121 #warning "FIXME"
122 return false;
123}