Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | #include "qplatformcursor.h" | - |
40 | | - |
41 | #include <QPainter> | - |
42 | #include <QBitmap> | - |
43 | #include <QGuiApplication> | - |
44 | #include <QScreen> | - |
45 | #include <qpa/qplatformscreen.h> | - |
46 | #include <private/qguiapplication_p.h> | - |
47 | | - |
48 | #include <QDebug> | - |
49 | | - |
50 | QT_BEGIN_NAMESPACE | - |
51 | | - |
52 | QList<QPlatformCursor *> QPlatformCursorPrivate::getInstances() | - |
53 | { | - |
54 | QList<QPlatformCursor *> result; | - |
55 | foreachfor (const QScreen *screen ,: qAsConst(QGuiApplicationPrivate::screen_list))) { | - |
56 | if (QPlatformCursor *cursor = screen->handle()->cursor())TRUE | never evaluated | FALSE | never evaluated |
| 0 |
57 | result.push_back(cursor); never executed: result.push_back(cursor); | 0 |
58 | } never executed: end of block | 0 |
59 | return result; never executed: return result; | 0 |
60 | } | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | | - |
74 | | - |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | | - |
90 | | - |
91 | | - |
92 | | - |
93 | | - |
94 | | - |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | | - |
100 | | - |
101 | | - |
102 | | - |
103 | | - |
104 | | - |
105 | | - |
106 | | - |
107 | | - |
108 | | - |
109 | | - |
110 | | - |
111 | | - |
112 | QPlatformCursor::QPlatformCursor() | - |
113 | { | - |
114 | } | - |
115 | | - |
116 | QPoint QPlatformCursor::pos() const | - |
117 | { | - |
118 | | - |
119 | return QGuiApplicationPrivate::lastCursorPosition.toPoint(); | - |
120 | } | - |
121 | | - |
122 | void QPlatformCursor::setPos(const QPoint &pos) | - |
123 | { | - |
124 | static bool firstCall = true; | - |
125 | if (firstCall) { | - |
126 | firstCall = false; | - |
127 | qWarning("This plugin does not support QCursor::setPos()" | - |
128 | "; emulating movement within the application."); | - |
129 | } | - |
130 | QWindowSystemInterface::handleMouseEvent(0, pos, pos, Qt::NoButton); | - |
131 | } | - |
132 | | - |
133 | | - |
134 | | - |
135 | | - |
136 | | - |
137 | | - |
138 | | - |
139 | | - |
140 | | - |
141 | | - |
142 | | - |
143 | | - |
144 | | - |
145 | | - |
146 | | - |
147 | | - |
148 | | - |
149 | | - |
150 | static QPlatformCursorImage *systemCursorTable[Qt::LastCursor+1]; | - |
151 | static bool systemCursorTableInit = false; | - |
152 | | - |
153 | | - |
154 | static const uchar cur_arrow_bits[] = { | - |
155 | 0x07, 0x00, 0x39, 0x00, 0xc1, 0x01, 0x02, 0x0e, 0x02, 0x10, 0x02, 0x08, | - |
156 | 0x04, 0x04, 0x04, 0x02, 0x04, 0x04, 0x88, 0x08, 0x48, 0x11, 0x28, 0x22, | - |
157 | 0x10, 0x44, 0x00, 0x28, 0x00, 0x10, 0x00, 0x00 }; | - |
158 | static const uchar mcur_arrow_bits[] = { | - |
159 | 0x07, 0x00, 0x3f, 0x00, 0xff, 0x01, 0xfe, 0x0f, 0xfe, 0x1f, 0xfe, 0x0f, | - |
160 | 0xfc, 0x07, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x0f, 0x78, 0x1f, 0x38, 0x3e, | - |
161 | 0x10, 0x7c, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00 }; | - |
162 | | - |
163 | static const unsigned char cur_up_arrow_bits[] = { | - |
164 | 0x80, 0x00, 0x40, 0x01, 0x40, 0x01, 0x20, 0x02, 0x20, 0x02, 0x10, 0x04, | - |
165 | 0x10, 0x04, 0x08, 0x08, 0x78, 0x0f, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, | - |
166 | 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0xc0, 0x01}; | - |
167 | static const unsigned char mcur_up_arrow_bits[] = { | - |
168 | 0x80, 0x00, 0xc0, 0x01, 0xc0, 0x01, 0xe0, 0x03, 0xe0, 0x03, 0xf0, 0x07, | - |
169 | 0xf0, 0x07, 0xf8, 0x0f, 0xf8, 0x0f, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, | - |
170 | 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01}; | - |
171 | | - |
172 | static const unsigned char cur_cross_bits[] = { | - |
173 | 0xc0, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, | - |
174 | 0x7f, 0x7f, 0x01, 0x40, 0x7f, 0x7f, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, | - |
175 | 0x40, 0x01, 0x40, 0x01, 0xc0, 0x01, 0x00, 0x00}; | - |
176 | static const unsigned char mcur_cross_bits[] = { | - |
177 | 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, | - |
178 | 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, | - |
179 | 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0x00, 0x00}; | - |
180 | | - |
181 | static const uchar cur_ibeam_bits[] = { | - |
182 | 0x00, 0x00, 0xe0, 0x03, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, | - |
183 | 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, | - |
184 | 0x80, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00 }; | - |
185 | static const uchar mcur_ibeam_bits[] = { | - |
186 | 0xf0, 0x07, 0xf0, 0x07, 0xf0, 0x07, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, | - |
187 | 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, | - |
188 | 0xf0, 0x07, 0xf0, 0x07, 0xf0, 0x07, 0x00, 0x00 }; | - |
189 | | - |
190 | static const uchar cur_ver_bits[] = { | - |
191 | 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, | - |
192 | 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xf0, 0x0f, | - |
193 | 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00 }; | - |
194 | static const uchar mcur_ver_bits[] = { | - |
195 | 0x00, 0x00, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0xf8, 0x3f, | - |
196 | 0xfc, 0x7f, 0xc0, 0x07, 0xc0, 0x07, 0xc0, 0x07, 0xfc, 0x7f, 0xf8, 0x3f, | - |
197 | 0xf0, 0x1f, 0xe0, 0x0f, 0xc0, 0x07, 0x80, 0x03 }; | - |
198 | | - |
199 | static const uchar cur_hor_bits[] = { | - |
200 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08, 0x30, 0x18, | - |
201 | 0x38, 0x38, 0xfc, 0x7f, 0xfc, 0x7f, 0x38, 0x38, 0x30, 0x18, 0x20, 0x08, | - |
202 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
203 | static const uchar mcur_hor_bits[] = { | - |
204 | 0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x60, 0x0c, 0x70, 0x1c, 0x78, 0x3c, | - |
205 | 0xfc, 0x7f, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfc, 0x7f, 0x78, 0x3c, | - |
206 | 0x70, 0x1c, 0x60, 0x0c, 0x40, 0x04, 0x00, 0x00 }; | - |
207 | static const uchar cur_bdiag_bits[] = { | - |
208 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x3e, 0x00, 0x3c, 0x00, 0x3e, | - |
209 | 0x00, 0x37, 0x88, 0x23, 0xd8, 0x01, 0xf8, 0x00, 0x78, 0x00, 0xf8, 0x00, | - |
210 | 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
211 | static const uchar mcur_bdiag_bits[] = { | - |
212 | 0x00, 0x00, 0xc0, 0x7f, 0x80, 0x7f, 0x00, 0x7f, 0x00, 0x7e, 0x04, 0x7f, | - |
213 | 0x8c, 0x7f, 0xdc, 0x77, 0xfc, 0x63, 0xfc, 0x41, 0xfc, 0x00, 0xfc, 0x01, | - |
214 | 0xfc, 0x03, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00 }; | - |
215 | static const uchar cur_fdiag_bits[] = { | - |
216 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0xf8, 0x00, 0x78, 0x00, | - |
217 | 0xf8, 0x00, 0xd8, 0x01, 0x88, 0x23, 0x00, 0x37, 0x00, 0x3e, 0x00, 0x3c, | - |
218 | 0x00, 0x3e, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00 }; | - |
219 | static const uchar mcur_fdiag_bits[] = { | - |
220 | 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xfc, 0x03, 0xfc, 0x01, 0xfc, 0x00, | - |
221 | 0xfc, 0x41, 0xfc, 0x63, 0xdc, 0x77, 0x8c, 0x7f, 0x04, 0x7f, 0x00, 0x7e, | - |
222 | 0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x7f, 0x00, 0x00 }; | - |
223 | | - |
224 | | - |
225 | static const uchar forbidden_bits[] = { | - |
226 | 0x00,0x00,0x00,0x80,0x1f,0x00,0xe0,0x7f,0x00,0xf0,0xf0,0x00,0x38,0xc0,0x01, | - |
227 | 0x7c,0x80,0x03,0xec,0x00,0x03,0xce,0x01,0x07,0x86,0x03,0x06,0x06,0x07,0x06, | - |
228 | 0x06,0x0e,0x06,0x06,0x1c,0x06,0x0e,0x38,0x07,0x0c,0x70,0x03,0x1c,0xe0,0x03, | - |
229 | 0x38,0xc0,0x01,0xf0,0xe0,0x00,0xe0,0x7f,0x00,0x80,0x1f,0x00,0x00,0x00,0x00 }; | - |
230 | | - |
231 | static const uchar forbiddenm_bits[] = { | - |
232 | 0x80,0x1f,0x00,0xe0,0x7f,0x00,0xf0,0xff,0x00,0xf8,0xff,0x01,0xfc,0xf0,0x03, | - |
233 | 0xfe,0xc0,0x07,0xfe,0x81,0x07,0xff,0x83,0x0f,0xcf,0x07,0x0f,0x8f,0x0f,0x0f, | - |
234 | 0x0f,0x1f,0x0f,0x0f,0x3e,0x0f,0x1f,0xfc,0x0f,0x1e,0xf8,0x07,0x3e,0xf0,0x07, | - |
235 | 0xfc,0xe0,0x03,0xf8,0xff,0x01,0xf0,0xff,0x00,0xe0,0x7f,0x00,0x80,0x1f,0x00}; | - |
236 | | - |
237 | | - |
238 | static const uchar wait_data_bits[] = { | - |
239 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
240 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x00, | - |
241 | 0x00, 0x04, 0x40, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0x08, 0x20, 0x00, | - |
242 | 0x00, 0x08, 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, | - |
243 | 0x00, 0x50, 0x15, 0x00, 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x40, 0x05, 0x00, | - |
244 | 0x00, 0x80, 0x02, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x20, 0x08, 0x00, | - |
245 | 0x00, 0x10, 0x10, 0x00, 0x00, 0x08, 0x21, 0x00, 0x00, 0x88, 0x22, 0x00, | - |
246 | 0x00, 0x48, 0x25, 0x00, 0x00, 0xa8, 0x2a, 0x00, 0x00, 0xfc, 0x7f, 0x00, | - |
247 | 0x00, 0x04, 0x40, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
248 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
249 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
250 | static const uchar wait_mask_bits[] = { | - |
251 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
252 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x00, | - |
253 | 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xf8, 0x3f, 0x00, | - |
254 | 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, | - |
255 | 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xc0, 0x07, 0x00, | - |
256 | 0x00, 0x80, 0x03, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xe0, 0x0f, 0x00, | - |
257 | 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, | - |
258 | 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xfc, 0x7f, 0x00, | - |
259 | 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
260 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
261 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
262 | | - |
263 | static const uchar hsplit_bits[] = { | - |
264 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
265 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
266 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, | - |
267 | 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, | - |
268 | 0x00, 0x41, 0x82, 0x00, 0x80, 0x41, 0x82, 0x01, 0xc0, 0x7f, 0xfe, 0x03, | - |
269 | 0x80, 0x41, 0x82, 0x01, 0x00, 0x41, 0x82, 0x00, 0x00, 0x40, 0x02, 0x00, | - |
270 | 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, | - |
271 | 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
272 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
273 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
274 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
275 | static const uchar hsplitm_bits[] = { | - |
276 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
277 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
278 | 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, | - |
279 | 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe2, 0x47, 0x00, 0x00, 0xe3, 0xc7, 0x00, | - |
280 | 0x80, 0xe3, 0xc7, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07, | - |
281 | 0xc0, 0xff, 0xff, 0x03, 0x80, 0xe3, 0xc7, 0x01, 0x00, 0xe3, 0xc7, 0x00, | - |
282 | 0x00, 0xe2, 0x47, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, | - |
283 | 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
284 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
285 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
286 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
287 | static const uchar vsplit_bits[] = { | - |
288 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
289 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
290 | 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, | - |
291 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, | - |
292 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, | - |
293 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, | - |
294 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, | - |
295 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, | - |
296 | 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
297 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
298 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
299 | static const uchar vsplitm_bits[] = { | - |
300 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
301 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, | - |
302 | 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x07, 0x00, | - |
303 | 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, | - |
304 | 0x00, 0xc0, 0x01, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, | - |
305 | 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, | - |
306 | 0x80, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, | - |
307 | 0x00, 0xc0, 0x01, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x07, 0x00, | - |
308 | 0x00, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, | - |
309 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
310 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
311 | static const uchar phand_bits[] = { | - |
312 | 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, | - |
313 | 0x7e, 0x04, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x70, 0x08, 0x00, 0x00, | - |
314 | 0x08, 0x08, 0x00, 0x00, 0x70, 0x14, 0x00, 0x00, 0x08, 0x22, 0x00, 0x00, | - |
315 | 0x30, 0x41, 0x00, 0x00, 0xc0, 0x20, 0x00, 0x00, 0x40, 0x12, 0x00, 0x00, | - |
316 | 0x80, 0x08, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, | - |
317 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
318 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
319 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
320 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
321 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
322 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
323 | static const uchar phandm_bits[] = { | - |
324 | 0xfe, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, | - |
325 | 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, | - |
326 | 0xfc, 0x1f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, | - |
327 | 0xf8, 0xff, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, | - |
328 | 0xc0, 0x1f, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, | - |
329 | 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
330 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
331 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
332 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
333 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
334 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
335 | | - |
336 | static const uchar size_all_data_bits[] = { | - |
337 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
338 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
339 | 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, | - |
340 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, | - |
341 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x81, 0x40, 0x00, 0x80, 0x81, 0xc0, 0x00, | - |
342 | 0xc0, 0xff, 0xff, 0x01, 0x80, 0x81, 0xc0, 0x00, 0x00, 0x81, 0x40, 0x00, | - |
343 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, | - |
344 | 0x00, 0x80, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, | - |
345 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
346 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
347 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
348 | static const uchar size_all_mask_bits[] = { | - |
349 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
350 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, | - |
351 | 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x07, 0x00, | - |
352 | 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc2, 0x21, 0x00, | - |
353 | 0x00, 0xc3, 0x61, 0x00, 0x80, 0xc3, 0xe1, 0x00, 0xc0, 0xff, 0xff, 0x01, | - |
354 | 0xe0, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0x01, 0x80, 0xc3, 0xe1, 0x00, | - |
355 | 0x00, 0xc3, 0x61, 0x00, 0x00, 0xc2, 0x21, 0x00, 0x00, 0xc0, 0x01, 0x00, | - |
356 | 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0xe0, 0x03, 0x00, | - |
357 | 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
358 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
359 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | - |
360 | | - |
361 | static const uchar whatsthis_bits[] = { | - |
362 | 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0xf0, 0x07, 0x00, | - |
363 | 0x09, 0x18, 0x0e, 0x00, 0x11, 0x1c, 0x0e, 0x00, 0x21, 0x1c, 0x0e, 0x00, | - |
364 | 0x41, 0x1c, 0x0e, 0x00, 0x81, 0x1c, 0x0e, 0x00, 0x01, 0x01, 0x07, 0x00, | - |
365 | 0x01, 0x82, 0x03, 0x00, 0xc1, 0xc7, 0x01, 0x00, 0x49, 0xc0, 0x01, 0x00, | - |
366 | 0x95, 0xc0, 0x01, 0x00, 0x93, 0xc0, 0x01, 0x00, 0x21, 0x01, 0x00, 0x00, | - |
367 | 0x20, 0xc1, 0x01, 0x00, 0x40, 0xc2, 0x01, 0x00, 0x40, 0x02, 0x00, 0x00, | - |
368 | 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
369 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
370 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
371 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
372 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; | - |
373 | static const uchar whatsthism_bits[] = { | - |
374 | 0x01, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x07, 0x00, 0x07, 0xf8, 0x0f, 0x00, | - |
375 | 0x0f, 0xfc, 0x1f, 0x00, 0x1f, 0x3e, 0x1f, 0x00, 0x3f, 0x3e, 0x1f, 0x00, | - |
376 | 0x7f, 0x3e, 0x1f, 0x00, 0xff, 0x3e, 0x1f, 0x00, 0xff, 0x9d, 0x0f, 0x00, | - |
377 | 0xff, 0xc3, 0x07, 0x00, 0xff, 0xe7, 0x03, 0x00, 0x7f, 0xe0, 0x03, 0x00, | - |
378 | 0xf7, 0xe0, 0x03, 0x00, 0xf3, 0xe0, 0x03, 0x00, 0xe1, 0xe1, 0x03, 0x00, | - |
379 | 0xe0, 0xe1, 0x03, 0x00, 0xc0, 0xe3, 0x03, 0x00, 0xc0, 0xe3, 0x03, 0x00, | - |
380 | 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
381 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
382 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
383 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
384 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; | - |
385 | | - |
386 | static const uchar busy_bits[] = { | - |
387 | 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, | - |
388 | 0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, | - |
389 | 0x41, 0xe0, 0xff, 0x00, 0x81, 0x20, 0x80, 0x00, 0x01, 0xe1, 0xff, 0x00, | - |
390 | 0x01, 0x42, 0x40, 0x00, 0xc1, 0x47, 0x40, 0x00, 0x49, 0x40, 0x55, 0x00, | - |
391 | 0x95, 0x80, 0x2a, 0x00, 0x93, 0x00, 0x15, 0x00, 0x21, 0x01, 0x0a, 0x00, | - |
392 | 0x20, 0x01, 0x11, 0x00, 0x40, 0x82, 0x20, 0x00, 0x40, 0x42, 0x44, 0x00, | - |
393 | 0x80, 0x41, 0x4a, 0x00, 0x00, 0x40, 0x55, 0x00, 0x00, 0xe0, 0xff, 0x00, | - |
394 | 0x00, 0x20, 0x80, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
395 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
396 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
397 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; | - |
398 | static const uchar busym_bits[] = { | - |
399 | 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, | - |
400 | 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, | - |
401 | 0x7f, 0xe0, 0xff, 0x00, 0xff, 0xe0, 0xff, 0x00, 0xff, 0xe1, 0xff, 0x00, | - |
402 | 0xff, 0xc3, 0x7f, 0x00, 0xff, 0xc7, 0x7f, 0x00, 0x7f, 0xc0, 0x7f, 0x00, | - |
403 | 0xf7, 0x80, 0x3f, 0x00, 0xf3, 0x00, 0x1f, 0x00, 0xe1, 0x01, 0x0e, 0x00, | - |
404 | 0xe0, 0x01, 0x1f, 0x00, 0xc0, 0x83, 0x3f, 0x00, 0xc0, 0xc3, 0x7f, 0x00, | - |
405 | 0x80, 0xc1, 0x7f, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0xe0, 0xff, 0x00, | - |
406 | 0x00, 0xe0, 0xff, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
407 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
408 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | - |
409 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; | - |
410 | | - |
411 | | - |
412 | static const uchar openhand_bits[] = { | - |
413 | 0x80,0x01,0x58,0x0e,0x64,0x12,0x64,0x52,0x48,0xb2,0x48,0x92, | - |
414 | 0x16,0x90,0x19,0x80,0x11,0x40,0x02,0x40,0x04,0x40,0x04,0x20, | - |
415 | 0x08,0x20,0x10,0x10,0x20,0x10,0x00,0x00}; | - |
416 | static const uchar openhandm_bits[] = { | - |
417 | 0x80,0x01,0xd8,0x0f,0xfc,0x1f,0xfc,0x5f,0xf8,0xff,0xf8,0xff, | - |
418 | 0xfe,0xff,0xff,0xff,0xff,0x7f,0xfe,0x7f,0xfc,0x7f,0xfc,0x3f, | - |
419 | 0xf8,0x3f,0xf0,0x1f,0xe0,0x1f,0x00,0x00}; | - |
420 | static const uchar closedhand_bits[] = { | - |
421 | 0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x0d,0x48,0x32,0x08,0x50, | - |
422 | 0x10,0x40,0x18,0x40,0x04,0x40,0x04,0x20,0x08,0x20,0x10,0x10, | - |
423 | 0x20,0x10,0x20,0x10,0x00,0x00,0x00,0x00}; | - |
424 | static const uchar closedhandm_bits[] = { | - |
425 | 0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x0d,0xf8,0x3f,0xf8,0x7f, | - |
426 | 0xf0,0x7f,0xf8,0x7f,0xfc,0x7f,0xfc,0x3f,0xf8,0x3f,0xf0,0x1f, | - |
427 | 0xe0,0x1f,0xe0,0x1f,0x00,0x00,0x00,0x00}; | - |
428 | | - |
429 | void QPlatformCursorImage::createSystemCursor(int id) | - |
430 | { | - |
431 | if (!systemCursorTableInit) { | - |
432 | for (int i = 0; i <= Qt::LastCursor; i++) | - |
433 | systemCursorTable[i] = 0; | - |
434 | systemCursorTableInit = true; | - |
435 | } | - |
436 | switch (id) { | - |
437 | | - |
438 | case Qt::ArrowCursor: | - |
439 | systemCursorTable[Qt::ArrowCursor] = | - |
440 | new QPlatformCursorImage(cur_arrow_bits, mcur_arrow_bits, 16, 16, 0, 0); | - |
441 | break; | - |
442 | | - |
443 | case Qt::UpArrowCursor: | - |
444 | systemCursorTable[Qt::UpArrowCursor] = | - |
445 | new QPlatformCursorImage(cur_up_arrow_bits, mcur_up_arrow_bits, 16, 16, 7, 0); | - |
446 | break; | - |
447 | | - |
448 | case Qt::CrossCursor: | - |
449 | systemCursorTable[Qt::CrossCursor] = | - |
450 | new QPlatformCursorImage(cur_cross_bits, mcur_cross_bits, 16, 16, 7, 7); | - |
451 | break; | - |
452 | | - |
453 | case Qt::IBeamCursor: | - |
454 | systemCursorTable[Qt::IBeamCursor] = | - |
455 | new QPlatformCursorImage(cur_ibeam_bits, mcur_ibeam_bits, 16, 16, 7, 7); | - |
456 | break; | - |
457 | | - |
458 | case Qt::SizeVerCursor: | - |
459 | systemCursorTable[Qt::SizeVerCursor] = | - |
460 | new QPlatformCursorImage(cur_ver_bits, mcur_ver_bits, 16, 16, 7, 7); | - |
461 | break; | - |
462 | | - |
463 | case Qt::SizeHorCursor: | - |
464 | systemCursorTable[Qt::SizeHorCursor] = | - |
465 | new QPlatformCursorImage(cur_hor_bits, mcur_hor_bits, 16, 16, 7, 7); | - |
466 | break; | - |
467 | | - |
468 | case Qt::SizeBDiagCursor: | - |
469 | systemCursorTable[Qt::SizeBDiagCursor] = | - |
470 | new QPlatformCursorImage(cur_bdiag_bits, mcur_bdiag_bits, 16, 16, 7, 7); | - |
471 | break; | - |
472 | | - |
473 | case Qt::SizeFDiagCursor: | - |
474 | systemCursorTable[Qt::SizeFDiagCursor] = | - |
475 | new QPlatformCursorImage(cur_fdiag_bits, mcur_fdiag_bits, 16, 16, 7, 7); | - |
476 | break; | - |
477 | | - |
478 | case Qt::BlankCursor: | - |
479 | systemCursorTable[Qt::BlankCursor] = | - |
480 | new QPlatformCursorImage(0, 0, 0, 0, 0, 0); | - |
481 | break; | - |
482 | | - |
483 | | - |
484 | case Qt::ForbiddenCursor: | - |
485 | systemCursorTable[Qt::ForbiddenCursor] = | - |
486 | new QPlatformCursorImage(forbidden_bits, forbiddenm_bits, 20, 20, 10, 10); | - |
487 | break; | - |
488 | | - |
489 | | - |
490 | case Qt::WaitCursor: | - |
491 | systemCursorTable[Qt::WaitCursor] = | - |
492 | new QPlatformCursorImage(wait_data_bits, wait_mask_bits, 32, 32, 15, 15); | - |
493 | break; | - |
494 | | - |
495 | case Qt::SplitVCursor: | - |
496 | systemCursorTable[Qt::SplitVCursor] = | - |
497 | new QPlatformCursorImage(vsplit_bits, vsplitm_bits, 32, 32, 15, 15); | - |
498 | break; | - |
499 | | - |
500 | case Qt::SplitHCursor: | - |
501 | systemCursorTable[Qt::SplitHCursor] = | - |
502 | new QPlatformCursorImage(hsplit_bits, hsplitm_bits, 32, 32, 15, 15); | - |
503 | break; | - |
504 | | - |
505 | case Qt::SizeAllCursor: | - |
506 | systemCursorTable[Qt::SizeAllCursor] = | - |
507 | new QPlatformCursorImage(size_all_data_bits, size_all_mask_bits, 32, 32, 15, 15); | - |
508 | break; | - |
509 | | - |
510 | case Qt::PointingHandCursor: | - |
511 | systemCursorTable[Qt::PointingHandCursor] = | - |
512 | new QPlatformCursorImage(phand_bits, phandm_bits, 32, 32, 0, 0); | - |
513 | break; | - |
514 | | - |
515 | case Qt::WhatsThisCursor: | - |
516 | systemCursorTable[Qt::WhatsThisCursor] = | - |
517 | new QPlatformCursorImage(whatsthis_bits, whatsthism_bits, 32, 32, 0, 0); | - |
518 | break; | - |
519 | case Qt::BusyCursor: | - |
520 | systemCursorTable[Qt::BusyCursor] = | - |
521 | new QPlatformCursorImage(busy_bits, busym_bits, 32, 32, 0, 0); | - |
522 | break; | - |
523 | | - |
524 | case Qt::OpenHandCursor: | - |
525 | systemCursorTable[Qt::OpenHandCursor] = | - |
526 | new QPlatformCursorImage(openhand_bits, openhandm_bits, 16, 16, 8, 8); | - |
527 | break; | - |
528 | case Qt::ClosedHandCursor: | - |
529 | systemCursorTable[Qt::ClosedHandCursor] = | - |
530 | new QPlatformCursorImage(closedhand_bits, closedhandm_bits, 16, 16, 8, 8); | - |
531 | break; | - |
532 | default: | - |
533 | qWarning("Unknown system cursor %d", id); | - |
534 | } | - |
535 | } | - |
536 | | - |
537 | | - |
538 | | - |
539 | | - |
540 | | - |
541 | | - |
542 | | - |
543 | | - |
544 | | - |
545 | | - |
546 | | - |
547 | | - |
548 | void QPlatformCursorImage::set(Qt::CursorShape id) | - |
549 | { | - |
550 | QPlatformCursorImage *cursor = 0; | - |
551 | if (id >= 0 && id <= Qt::LastCursor) { | - |
552 | if (!systemCursorTable[id]) | - |
553 | createSystemCursor(id); | - |
554 | cursor = systemCursorTable[id]; | - |
555 | } | - |
556 | | - |
557 | if (cursor == 0) { | - |
558 | if (!systemCursorTable[Qt::ArrowCursor]) | - |
559 | createSystemCursor(Qt::ArrowCursor); | - |
560 | cursor = systemCursorTable[Qt::ArrowCursor]; | - |
561 | } | - |
562 | cursorImage = cursor->cursorImage; | - |
563 | hot = cursor->hot; | - |
564 | } | - |
565 | | - |
566 | | - |
567 | | - |
568 | | - |
569 | | - |
570 | | - |
571 | void QPlatformCursorImage::set(const QImage &image, int hx, int hy) | - |
572 | { | - |
573 | hot.setX(hx); | - |
574 | hot.setY(hy); | - |
575 | cursorImage = image; | - |
576 | } | - |
577 | | - |
578 | | - |
579 | | - |
580 | | - |
581 | | - |
582 | | - |
583 | | - |
584 | | - |
585 | | - |
586 | | - |
587 | | - |
588 | | - |
589 | | - |
590 | | - |
591 | | - |
592 | | - |
593 | void QPlatformCursorImage::set(const uchar *data, const uchar *mask, | - |
594 | int width, int height, int hx, int hy) | - |
595 | { | - |
596 | hot.setX(hx); | - |
597 | hot.setY(hy); | - |
598 | | - |
599 | cursorImage = QImage(width,height, QImage::Format_Indexed8); | - |
600 | | - |
601 | if (!width || !height || !data || !mask || cursorImage.isNull()) | - |
602 | return; | - |
603 | | - |
604 | cursorImage.setColorCount(3); | - |
605 | cursorImage.setColor(0, 0xff000000); | - |
606 | cursorImage.setColor(1, 0xffffffff); | - |
607 | cursorImage.setColor(2, 0x00000000); | - |
608 | | - |
609 | int bytesPerLine = (width + 7) / 8; | - |
610 | int p = 0; | - |
611 | int d, m; | - |
612 | | - |
613 | int x = -1, w = 0; | - |
614 | | - |
615 | uchar *cursor_data = cursorImage.bits(); | - |
616 | int bpl = cursorImage.bytesPerLine(); | - |
617 | for (int i = 0; i < height; i++) | - |
618 | { | - |
619 | for (int j = 0; j < bytesPerLine; j++, data++, mask++) | - |
620 | { | - |
621 | for (int b = 0; b < 8 && j*8+b < width; b++) | - |
622 | { | - |
623 | d = *data & (1 << b); | - |
624 | m = *mask & (1 << b); | - |
625 | if (d && m) p = 0; | - |
626 | else if (!d && m) p = 1; | - |
627 | else p = 2; | - |
628 | cursor_data[j*8+b] = p; | - |
629 | | - |
630 | | - |
631 | if (x < 0 && m) | - |
632 | x = j*8+b; | - |
633 | else if (x >= 0 && !m) { | - |
634 | x = -1; | - |
635 | w = 0; | - |
636 | } | - |
637 | if (m) | - |
638 | w++; | - |
639 | } | - |
640 | } | - |
641 | if (x >= 0) { | - |
642 | x = -1; | - |
643 | w = 0; | - |
644 | } | - |
645 | cursor_data += bpl; | - |
646 | } | - |
647 | | - |
648 | } | - |
649 | | - |
650 | | - |
651 | | - |
652 | | - |
653 | | - |
654 | | - |
655 | | - |
656 | | - |
657 | | - |
658 | | - |
659 | | - |
660 | | - |
661 | | - |
662 | | - |
663 | | - |
664 | | - |
665 | | - |
666 | | - |
667 | | - |
668 | | - |
669 | | - |
670 | | - |
671 | | - |
672 | QT_END_NAMESPACE | - |
| | |