210QWindowsCursor::PixmapCursor QWindowsCursor::customCursor(Qt::CursorShape cursorShape,
211 const QPlatformScreen *screen)
214 static const uchar vsplit_bits[] = {
215 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
216 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
217 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00,
218 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
219 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00,
220 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00,
221 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
222 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00,
223 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
224 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
225 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
226 static const uchar vsplitm_bits[] = {
227 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
228 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
229 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x07, 0x00,
230 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
231 0x00, 0xc0, 0x01, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00,
232 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00,
233 0x80, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
234 0x00, 0xc0, 0x01, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x07, 0x00,
235 0x00, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00,
236 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
237 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
238 static const uchar hsplit_bits[] = {
239 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
240 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
241 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
242 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
243 0x00, 0x41, 0x82, 0x00, 0x80, 0x41, 0x82, 0x01, 0xc0, 0x7f, 0xfe, 0x03,
244 0x80, 0x41, 0x82, 0x01, 0x00, 0x41, 0x82, 0x00, 0x00, 0x40, 0x02, 0x00,
245 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
246 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
247 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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 hsplitm_bits[] = {
251 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
252 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
253 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
254 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe2, 0x47, 0x00, 0x00, 0xe3, 0xc7, 0x00,
255 0x80, 0xe3, 0xc7, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07,
256 0xc0, 0xff, 0xff, 0x03, 0x80, 0xe3, 0xc7, 0x01, 0x00, 0xe3, 0xc7, 0x00,
257 0x00, 0xe2, 0x47, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
258 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
259 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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 static const uchar openhand_bits[] = {
263 0x80,0x01,0x58,0x0e,0x64,0x12,0x64,0x52,0x48,0xb2,0x48,0x92,
264 0x16,0x90,0x19,0x80,0x11,0x40,0x02,0x40,0x04,0x40,0x04,0x20,
265 0x08,0x20,0x10,0x10,0x20,0x10,0x00,0x00};
266 static const uchar openhandm_bits[] = {
267 0x80,0x01,0xd8,0x0f,0xfc,0x1f,0xfc,0x5f,0xf8,0xff,0xf8,0xff,
268 0xf6,0xff,0xff,0xff,0xff,0x7f,0xfe,0x7f,0xfc,0x7f,0xfc,0x3f,
269 0xf8,0x3f,0xf0,0x1f,0xe0,0x1f,0x00,0x00};
270 static const uchar closedhand_bits[] = {
271 0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x0d,0x48,0x32,0x08,0x50,
272 0x10,0x40,0x18,0x40,0x04,0x40,0x04,0x20,0x08,0x20,0x10,0x10,
273 0x20,0x10,0x20,0x10,0x00,0x00,0x00,0x00};
274 static const uchar closedhandm_bits[] = {
275 0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x0d,0xf8,0x3f,0xf8,0x7f,
276 0xf0,0x7f,0xf8,0x7f,0xfc,0x7f,0xfc,0x3f,0xf8,0x3f,0xf0,0x1f,
277 0xe0,0x1f,0xe0,0x1f,0x00,0x00,0x00,0x00};
279 static const char *
const moveDragCursorXpmC[] = {
305 static const char *
const copyDragCursorXpmC[] = {
310 "XX......................",
311 "XaX.....................",
312 "XaaX....................",
313 "XaaaX...................",
314 "XaaaaX..................",
315 "XaaaaaX.................",
316 "XaaaaaaX................",
317 "XaaaaaaaX...............",
318 "XaaaaaaaaX..............",
319 "XaaaaaaaaaX.............",
320 "XaaaaaaXXXX.............",
321 "XaaaXaaX................",
322 "XaaXXaaX................",
323 "XaX..XaaX...............",
324 "XX...XaaX...............",
325 "X.....XaaX..............",
326 "......XaaX..............",
327 ".......XaaX.............",
328 ".......XaaX.............",
329 "........XX...aaaaaaaaaaa",
330 ".............aXXXXXXXXXa",
331 ".............aXXXXXXXXXa",
332 ".............aXXXXaXXXXa",
333 ".............aXXXXaXXXXa",
334 ".............aXXaaaaaXXa",
335 ".............aXXXXaXXXXa",
336 ".............aXXXXaXXXXa",
337 ".............aXXXXXXXXXa",
338 ".............aXXXXXXXXXa",
339 ".............aaaaaaaaaaa"};
341 static const char *
const linkDragCursorXpmC[] = {
346 "XX......................",
347 "XaX.....................",
348 "XaaX....................",
349 "XaaaX...................",
350 "XaaaaX..................",
351 "XaaaaaX.................",
352 "XaaaaaaX................",
353 "XaaaaaaaX...............",
354 "XaaaaaaaaX..............",
355 "XaaaaaaaaaX.............",
356 "XaaaaaaXXXX.............",
357 "XaaaXaaX................",
358 "XaaXXaaX................",
359 "XaX..XaaX...............",
360 "XX...XaaX...............",
361 "X.....XaaX..............",
362 "......XaaX..............",
363 ".......XaaX.............",
364 ".......XaaX.............",
365 "........XX...aaaaaaaaaaa",
366 ".............aXXXXXXXXXa",
367 ".............aXXXaaaaXXa",
368 ".............aXXXXaaaXXa",
369 ".............aXXXaaaaXXa",
370 ".............aXXaaaXaXXa",
371 ".............aXXaaXXXXXa",
372 ".............aXXaXXXXXXa",
373 ".............aXXXaXXXXXa",
374 ".............aXXXXXXXXXa",
375 ".............aaaaaaaaaaa"};
377 switch (cursorShape) {
378 case Qt::SplitVCursor:
379 return createPixmapCursorFromData(screenCursorSize(screen), standardCursorSize(), 32, vsplit_bits, vsplitm_bits);
380 case Qt::SplitHCursor:
381 return createPixmapCursorFromData(screenCursorSize(screen), standardCursorSize(), 32, hsplit_bits, hsplitm_bits);
382 case Qt::OpenHandCursor:
383 return createPixmapCursorFromData(screenCursorSize(screen), standardCursorSize(), 16, openhand_bits, openhandm_bits);
384 case Qt::ClosedHandCursor:
385 return createPixmapCursorFromData(screenCursorSize(screen), standardCursorSize(), 16, closedhand_bits, closedhandm_bits);
386 case Qt::DragCopyCursor:
387 return QWindowsCursor::PixmapCursor(QPixmap(copyDragCursorXpmC), QPoint(0, 0));
388 case Qt::DragMoveCursor:
389 return QWindowsCursor::PixmapCursor(QPixmap(moveDragCursorXpmC), QPoint(0, 0));
390 case Qt::DragLinkCursor:
391 return QWindowsCursor::PixmapCursor(QPixmap(linkDragCursorXpmC), QPoint(0, 0));
394 return QWindowsCursor::PixmapCursor();