2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2005-2007 Blender Foundation
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): Matt Ebb
25 * ***** END GPL/BL DUAL LICENSE BLOCK *****
28 /** \file blender/windowmanager/intern/wm_cursors.c
36 #include "GHOST_C-api.h"
38 #include "BLO_sys_types.h"
40 #include "DNA_listBase.h"
41 #include "DNA_userdef_types.h"
43 #include "BKE_context.h"
44 #include "BKE_global.h"
49 #include "wm_cursors.h"
51 /* XXX this still is mess from old code */
55 /* Some simple ghost <-> blender conversions */
56 static GHOST_TStandardCursor convert_cursor(int curs)
60 case CURSOR_STD: return GHOST_kStandardCursorDefault;
61 case CURSOR_FACESEL: return GHOST_kStandardCursorRightArrow;
62 case CURSOR_WAIT: return GHOST_kStandardCursorWait;
63 case CURSOR_EDIT: return GHOST_kStandardCursorCrosshair;
66 return GHOST_kStandardCursorLeftRight;
68 return GHOST_kStandardCursorHelp;
70 case CURSOR_X_MOVE: return GHOST_kStandardCursorLeftRight;
71 case CURSOR_Y_MOVE: return GHOST_kStandardCursorUpDown;
72 case CURSOR_PENCIL: return GHOST_kStandardCursorPencil;
73 case CURSOR_COPY: return GHOST_kStandardCursorCopy;
77 static void window_set_custom_cursor(wmWindow *win, unsigned char mask[16][2],
78 unsigned char bitmap[16][2], int hotx, int hoty)
80 GHOST_SetCustomCursorShape(win->ghostwin, bitmap, mask, hotx, hoty);
83 static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor, int useBig)
86 GHOST_SetCustomCursorShapeEx(win->ghostwin,
87 (GHOST_TUns8 *)cursor->big_bm, (GHOST_TUns8 *)cursor->big_mask,
88 cursor->big_sizex, cursor->big_sizey,
89 cursor->big_hotx, cursor->big_hoty,
90 cursor->fg_color, cursor->bg_color);
93 GHOST_SetCustomCursorShapeEx(win->ghostwin,
94 (GHOST_TUns8 *)cursor->small_bm, (GHOST_TUns8 *)cursor->small_mask,
95 cursor->small_sizex, cursor->small_sizey,
96 cursor->small_hotx, cursor->small_hoty,
97 cursor->fg_color, cursor->bg_color);
103 static BCursor *BlenderCursor[BC_NUMCURSORS]; /*Points to static BCursor Structs */
105 void WM_cursor_set(wmWindow *win, int curs)
108 if (win == NULL) return; /* Can't set custom cursor before Window init */
110 if (curs == CURSOR_NONE) {
111 GHOST_SetCursorVisibility(win->ghostwin, 0);
116 /* the default win32 cross cursor is barely visible,
117 * only 1 pixel thick, use another one instead */
118 if (curs == CURSOR_EDIT)
119 curs = BC_CROSSCURSOR;
122 GHOST_SetCursorVisibility(win->ghostwin, 1);
124 if (curs == CURSOR_STD && win->modalcursor)
125 curs = win->modalcursor;
129 /* detect if we use system cursor or Blender cursor */
130 if (curs >= BC_GHOST_CURSORS) {
131 GHOST_SetCursorShape(win->ghostwin, convert_cursor(curs));
134 if ((curs < SYSCURSOR) || (curs >= BC_NUMCURSORS)) return;
136 if (curs == SYSCURSOR) { /* System default Cursor */
137 GHOST_SetCursorShape(win->ghostwin, convert_cursor(CURSOR_STD));
139 else if ( (U.curssize == 0) || (BlenderCursor[curs]->big_bm == NULL) ) {
140 window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
143 window_set_custom_cursor_ex(win, BlenderCursor[curs], 1);
148 void WM_cursor_modal(wmWindow *win, int val)
150 if (win->lastcursor == 0)
151 win->lastcursor = win->cursor;
152 win->modalcursor = val;
153 WM_cursor_set(win, val);
156 void WM_cursor_restore(wmWindow *win)
158 win->modalcursor = 0;
160 WM_cursor_set(win, win->lastcursor);
164 /* to allow usage all over, we do entire WM */
165 void WM_cursor_wait(int val)
168 wmWindowManager *wm = G.main->wm.first;
169 wmWindow *win = wm ? wm->windows.first : NULL;
171 for (; win; win = win->next) {
173 WM_cursor_modal(win, BC_WAITCURSOR);
176 WM_cursor_restore(win);
182 void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds)
184 /* Only grab cursor when not running debug.
185 * It helps not to get a stuck WM when hitting a breakpoint
187 GHOST_TGrabCursorMode mode = GHOST_kGrabNormal;
189 if (hide) mode = GHOST_kGrabHide;
190 else if (wrap) mode = GHOST_kGrabWrap;
191 if ((G.debug & G_DEBUG) == 0) {
192 if (win && win->ghostwin) {
193 const GHOST_TabletData *tabletdata = GHOST_GetTabletData(win->ghostwin);
194 // Note: There is no tabletdata on Windows if no tablet device is connected.
196 GHOST_SetCursorGrab(win->ghostwin, mode, bounds);
197 else if (tabletdata->Active == GHOST_kTabletModeNone)
198 GHOST_SetCursorGrab(win->ghostwin, mode, bounds);
200 win->grabcursor = mode;
205 void WM_cursor_ungrab(wmWindow *win)
207 if ((G.debug & G_DEBUG) == 0) {
208 if (win && win->ghostwin) {
209 GHOST_SetCursorGrab(win->ghostwin, GHOST_kGrabDisable, NULL);
210 win->grabcursor = GHOST_kGrabDisable;
215 /* give it a modal keymap one day? */
216 int wm_cursor_arrow_move(wmWindow *win, wmEvent *event)
218 if (win && event->val == KM_PRESS) {
220 if (event->type == UPARROWKEY) {
221 WM_cursor_warp(win, event->x, event->y + 1);
224 else if (event->type == DOWNARROWKEY) {
225 WM_cursor_warp(win, event->x, event->y - 1);
228 else if (event->type == LEFTARROWKEY) {
229 WM_cursor_warp(win, event->x - 1, event->y);
232 else if (event->type == RIGHTARROWKEY) {
233 WM_cursor_warp(win, event->x + 1, event->y);
241 /* afer this you can call restore too */
242 void WM_timecursor(wmWindow *win, int nr)
245 static char number_bitmaps[10][8] = {
246 {0, 56, 68, 68, 68, 68, 68, 56},
247 {0, 24, 16, 16, 16, 16, 16, 56},
248 {0, 60, 66, 32, 16, 8, 4, 126},
249 {0, 124, 32, 16, 56, 64, 66, 60},
250 {0, 32, 48, 40, 36, 126, 32, 32},
251 {0, 124, 4, 60, 64, 64, 68, 56},
252 {0, 56, 4, 4, 60, 68, 68, 56},
253 {0, 124, 64, 32, 16, 8, 8, 8},
254 {0, 60, 66, 66, 60, 66, 66, 60},
255 {0, 56, 68, 68, 120, 64, 68, 56}
257 unsigned char mask[16][2];
258 unsigned char bitmap[16][2] = {{0}};
261 if (win->lastcursor == 0)
262 win->lastcursor = win->cursor;
264 memset(&mask, 0xFF, sizeof(mask));
266 /* print number bottom right justified */
267 for (idx = 3; nr && idx >= 0; idx--) {
268 char *digit = number_bitmaps[nr % 10];
272 for (i = 0; i < 8; i++)
273 bitmap[i + y * 8][x] = digit[i];
277 window_set_custom_cursor(win, mask, bitmap, 7, 7);
281 /* ******************************************************************
282 * Custom Cursor Description:
284 * Each bit represents a pixel, so 1 byte = 8 pixels,
285 * the bytes go Left to Right. Top to bottom
286 * the bits in a byte go right to left
287 * (ie; 0x01, 0x80 represents a line of 16 pix with the first and last pix set.)
289 * A 0 in the bitmap = bg_color, a 1 fg_color
290 * a 0 in the mask = transparent pix.
292 * Until 32x32 cursors are supported on all platforms, the size of the
293 * small cursors MUST be 16x16.
295 * Large cursors have a MAXSIZE of 32x32.
297 * Other than that, the specified size of the cursors is just a guideline,
298 * However, the char array that defines the BM and MASK must be byte aligned.
299 * ie a 17x17 cursor needs 3 bytes (cols) * 17 bytes (rows)
300 * (3 bytes = 17 bits rounded up to nearest whole byte). Pad extra bits
303 * Setting big_bm=NULL disables the large version of the cursor.
305 * *******************************************************************
307 * There is a nice Python GUI utility that can be used for drawing cursors in
308 * this format in the Blender source distribution, in
309 * blender/source/tools/MakeCursor.py . Start it with $ python MakeCursor.py
310 * It will copy its output to the console when you press 'Do it'.
314 /* Because defining a cursor mixes declarations and executable code
315 * each cursor needs it's own scoping block or it would be split up
316 * over several hundred lines of code. To enforce/document this better
317 * I define 2 pretty braindead macros so it's obvious what the extra "[]"
320 #define BEGIN_CURSOR_BLOCK {
321 #define END_CURSOR_BLOCK }
323 void wm_init_cursor_data(void)
325 /********************** NW_ARROW Cursor **************************/
327 static char nw_sbm[] = {
328 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, 0x11, 0x00,
329 0x21, 0x00, 0x41, 0x00, 0x81, 0x00, 0x01, 0x01,
330 0x01, 0x02, 0xc1, 0x03, 0x49, 0x00, 0x8d, 0x00,
331 0x8b, 0x00, 0x10, 0x01, 0x90, 0x01, 0x60, 0x00,
334 static char nw_smsk[] = {
335 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00,
336 0x3f, 0x00, 0x7f, 0x00, 0xff, 0x00, 0xff, 0x01,
337 0xff, 0x03, 0xff, 0x03, 0x7f, 0x00, 0xff, 0x00,
338 0xfb, 0x00, 0xf0, 0x01, 0xf0, 0x01, 0x60, 0x00,
341 static BCursor NWArrowCursor = {
354 BlenderCursor[BC_NW_ARROWCURSOR] = &NWArrowCursor;
357 ///********************** NS_ARROW Cursor *************************/
359 static char ns_sbm[] = {
360 0x40, 0x01, 0x20, 0x02, 0x10, 0x04, 0x08, 0x08,
361 0x04, 0x10, 0x3c, 0x1e, 0x20, 0x02, 0x20, 0x02,
362 0x20, 0x02, 0x20, 0x02, 0x3c, 0x1e, 0x04, 0x10,
363 0x08, 0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x01
366 static char ns_smsk[] = {
367 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f,
368 0xfc, 0x1f, 0xfc, 0x1f, 0xe0, 0x03, 0xe0, 0x03,
369 0xe0, 0x03, 0xe0, 0x03, 0xfc, 0x1f, 0xfc, 0x1f,
370 0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01
373 static BCursor NSArrowCursor = {
386 BlenderCursor[BC_NS_ARROWCURSOR] = &NSArrowCursor;
389 /********************** EW_ARROW Cursor *************************/
391 static char ew_sbm[] = {
392 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c,
393 0x2c, 0x34, 0xe6, 0x67, 0x03, 0xc0, 0x01, 0x80,
394 0x03, 0xc0, 0xe6, 0x67, 0x2c, 0x34, 0x38, 0x1c,
395 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
398 static char ew_smsk[] = {
399 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c,
400 0x3c, 0x3c, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff,
401 0xff, 0xff, 0xfe, 0x7f, 0x3c, 0x3c, 0x38, 0x1c,
402 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
405 static BCursor EWArrowCursor = {
418 BlenderCursor[BC_EW_ARROWCURSOR] = &EWArrowCursor;
421 /********************** Wait Cursor *****************************/
423 static char wait_sbm[] = {
424 0xfe, 0x7f, 0x02, 0x40, 0x02, 0x40, 0x84, 0x21,
425 0xc8, 0x13, 0xd0, 0x0b, 0xa0, 0x04, 0x20, 0x05,
426 0xa0, 0x04, 0x10, 0x09, 0x88, 0x11, 0xc4, 0x23,
427 0xe2, 0x47, 0xfa, 0x5f, 0x02, 0x40, 0xfe, 0x7f,
430 static char wait_smsk[] = {
431 0xfe, 0x7f, 0xfe, 0x7f, 0x06, 0x60, 0x8c, 0x31,
432 0xd8, 0x1b, 0xf0, 0x0f, 0xe0, 0x06, 0x60, 0x07,
433 0xe0, 0x06, 0x30, 0x0d, 0x98, 0x19, 0xcc, 0x33,
434 0xe6, 0x67, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f,
437 static char wait_lbm[] = {
438 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
439 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x30,
440 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x18,
441 0x18, 0xc0, 0x03, 0x0c, 0x30, 0x20, 0x07, 0x06,
442 0x60, 0xf0, 0x0f, 0x03, 0xc0, 0xd0, 0x8d, 0x01,
443 0x80, 0x79, 0xcf, 0x00, 0x00, 0xf3, 0x67, 0x00,
444 0x00, 0x66, 0x37, 0x00, 0x00, 0x8c, 0x33, 0x00,
445 0x00, 0x0c, 0x32, 0x00, 0x00, 0xcc, 0x33, 0x00,
446 0x00, 0x8c, 0x30, 0x00, 0x00, 0x46, 0x61, 0x00,
447 0x00, 0x03, 0xc3, 0x00, 0x80, 0x01, 0x83, 0x01,
448 0xc0, 0xc0, 0x03, 0x03, 0x60, 0xa0, 0x05, 0x06,
449 0x30, 0xf0, 0x0f, 0x0c, 0x18, 0xf8, 0x1d, 0x18,
450 0x0c, 0x5c, 0x3f, 0x30, 0x0c, 0xff, 0x5f, 0x30,
451 0x0c, 0xf7, 0xfe, 0x31, 0xcc, 0xfb, 0x9f, 0x33,
452 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x30,
453 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
456 static char wait_lmsk[] = {
457 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
458 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
459 0x3c, 0x00, 0x00, 0x3c, 0x3c, 0x00, 0x00, 0x1e,
460 0x78, 0xc0, 0x03, 0x0f, 0xf0, 0xa0, 0x87, 0x07,
461 0xe0, 0xf1, 0xcf, 0x03, 0xc0, 0xf3, 0xef, 0x01,
462 0x80, 0xff, 0xff, 0x00, 0x00, 0xff, 0x7f, 0x00,
463 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00,
464 0x00, 0x3c, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00,
465 0x00, 0xbc, 0x3c, 0x00, 0x00, 0xde, 0x79, 0x00,
466 0x00, 0x0f, 0xf3, 0x00, 0x80, 0x07, 0xe3, 0x01,
467 0xc0, 0xc3, 0xc3, 0x03, 0xe0, 0xe1, 0x87, 0x07,
468 0xf0, 0xf0, 0x0f, 0x0f, 0x78, 0xf8, 0x1f, 0x1e,
469 0x3c, 0x7c, 0x3f, 0x3c, 0x3c, 0xff, 0x7f, 0x3c,
470 0xbc, 0xff, 0xff, 0x3d, 0xfc, 0xfb, 0xbf, 0x3f,
471 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
472 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
475 static BCursor WaitCursor = {
488 BlenderCursor[BC_WAITCURSOR] = &WaitCursor;
491 /********************** Cross Cursor ***************************/
493 static char cross_sbm[] = {
494 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
495 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x7e, 0x7e,
496 0x7e, 0x7e, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
497 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00,
500 static char cross_smsk[] = {
501 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
502 0x80, 0x01, 0x80, 0x01, 0xc0, 0x03, 0x7f, 0xfe,
503 0x7f, 0xfe, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01,
504 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
506 static char cross_lbm[] = {
507 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
508 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
509 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
510 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
511 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
512 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00,
513 0x00, 0xc0, 0x03, 0x00, 0x00, 0x40, 0x02, 0x00,
514 0x00, 0x78, 0x1e, 0x00, 0xfc, 0x1f, 0xf8, 0x3f,
515 0xfc, 0x1f, 0xf8, 0x3f, 0x00, 0x78, 0x1e, 0x00,
516 0x00, 0x40, 0x02, 0x00, 0x00, 0xc0, 0x03, 0x00,
517 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00,
518 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
519 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
520 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
521 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
522 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
525 static char cross_lmsk[] = {
526 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
527 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
528 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
529 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
530 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
531 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00,
532 0x00, 0xe0, 0x07, 0x00, 0x00, 0x70, 0x0e, 0x00,
533 0x00, 0x78, 0x1e, 0x00, 0xff, 0x1f, 0xf8, 0xff,
534 0xff, 0x1f, 0xf8, 0xff, 0x00, 0x78, 0x1e, 0x00,
535 0x00, 0x70, 0x0e, 0x00, 0x00, 0xe0, 0x07, 0x00,
536 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00,
537 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
538 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
539 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
540 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
541 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
544 static BCursor CrossCursor = {
546 cross_sbm, cross_smsk,
550 cross_lbm, cross_lmsk,
557 BlenderCursor[BC_CROSSCURSOR] = &CrossCursor;
560 /********************** EditCross Cursor ***********************/
562 static char editcross_sbm[] = {
563 0x0e, 0x00, 0x11, 0x00, 0x1d, 0x00, 0x19, 0x03,
564 0x1d, 0x03, 0x11, 0x03, 0x0e, 0x03, 0x00, 0x03,
565 0xf8, 0x7c, 0xf8, 0x7c, 0x00, 0x03, 0x00, 0x03,
566 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00,
569 static char editcross_smsk[] = {
570 0x0e, 0x00, 0x1f, 0x00, 0x1f, 0x03, 0x1f, 0x03,
571 0x1f, 0x03, 0x1f, 0x03, 0x0e, 0x03, 0x80, 0x07,
572 0xfc, 0xfc, 0xfc, 0xfc, 0x80, 0x07, 0x00, 0x03,
573 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
576 static BCursor EditCrossCursor = {
578 editcross_sbm, editcross_smsk,
589 BlenderCursor[BC_EDITCROSSCURSOR] = &EditCrossCursor;
592 /********************** Box Select *************************/
594 static char box_sbm[32] = {
595 0x7f, 0x00, 0x41, 0x00, 0x41, 0x00, 0x41, 0x06,
596 0x41, 0x06, 0x41, 0x06, 0x7f, 0x06, 0x00, 0x06,
597 0xe0, 0x79, 0xe0, 0x79, 0x00, 0x06, 0x00, 0x06,
598 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00,
601 static char box_smsk[32] = {
602 0x7f, 0x00, 0x7f, 0x00, 0x63, 0x06, 0x63, 0x06,
603 0x63, 0x06, 0x7f, 0x06, 0x7f, 0x06, 0x00, 0x0f,
604 0xf0, 0xf9, 0xf0, 0xf9, 0x00, 0x0f, 0x00, 0x06,
605 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06,
609 static BCursor BoxSelCursor = {
622 BlenderCursor[BC_BOXSELCURSOR] = &BoxSelCursor;
625 /********************** Knife Cursor ***********************/
627 static char knife_sbm[] = {
628 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c,
629 0x00, 0x5a, 0x00, 0x34, 0x00, 0x2a, 0x00, 0x17,
630 0x80, 0x06, 0x40, 0x03, 0xa0, 0x03, 0xd0, 0x01,
631 0x68, 0x00, 0x1c, 0x00, 0x06, 0x00, 0x00, 0x00
634 static char knife_smsk[] = {
635 0x00, 0x60, 0x00, 0xf0, 0x00, 0xfc, 0x00, 0xfe,
636 0x00, 0xfe, 0x00, 0x7e, 0x00, 0x7f, 0x80, 0x3f,
637 0xc0, 0x0e, 0x60, 0x07, 0xb0, 0x07, 0xd8, 0x03,
638 0xec, 0x01, 0x7e, 0x00, 0x1f, 0x00, 0x07, 0x00
641 static char knife_lbm[] = {
642 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
643 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
644 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c,
645 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7f,
646 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0xc0, 0x5f,
647 0x00, 0x00, 0xc0, 0x6f, 0x00, 0x00, 0xc0, 0x37,
648 0x00, 0x00, 0xa8, 0x1b, 0x00, 0x00, 0x54, 0x0d,
649 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x54, 0x00,
650 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x53, 0x00,
651 0x00, 0xc0, 0x07, 0x00, 0x00, 0xe0, 0x0f, 0x00,
652 0x00, 0xd0, 0x0f, 0x00, 0x00, 0xe8, 0x07, 0x00,
653 0x00, 0xf4, 0x07, 0x00, 0x00, 0xfa, 0x00, 0x00,
654 0x00, 0x3d, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00,
655 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
656 0x30, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
657 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
661 static char knife_lmsk[] = {
662 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
663 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
664 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7e,
665 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x80, 0xff,
666 0x00, 0x00, 0xc0, 0xbf, 0x00, 0x00, 0xe0, 0xdf,
667 0x00, 0x00, 0xe0, 0xef, 0x00, 0x00, 0xf8, 0x77,
668 0x00, 0x00, 0xfc, 0x3b, 0x00, 0x00, 0xfe, 0x1d,
669 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xfe, 0x01,
670 0x00, 0x00, 0xff, 0x01, 0x00, 0xc0, 0xff, 0x00,
671 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xf0, 0x1f, 0x00,
672 0x00, 0xd8, 0x1f, 0x00, 0x00, 0xec, 0x0f, 0x00,
673 0x00, 0xf6, 0x0f, 0x00, 0x00, 0xfb, 0x06, 0x00,
674 0x80, 0xbd, 0x01, 0x00, 0xc0, 0x6e, 0x00, 0x00,
675 0xe0, 0x1b, 0x00, 0x00, 0xf0, 0x06, 0x00, 0x00,
676 0xb8, 0x01, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
677 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
681 static BCursor KnifeCursor = {
683 knife_sbm, knife_smsk,
687 knife_lbm, knife_lmsk,
694 BlenderCursor[BC_KNIFECURSOR] = &KnifeCursor;
698 /********************** Loop Select Cursor ***********************/
701 static char vloop_sbm[] = {
702 0x00, 0x00, 0x7e, 0x00, 0x3e, 0x00, 0x1e, 0x00,
703 0x0e, 0x00, 0x66, 0x60, 0x62, 0x6f, 0x00, 0x00,
704 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
705 0x00, 0x00, 0x60, 0x60, 0x60, 0x6f, 0x00, 0x00,
708 static char vloop_smsk[] = {
709 0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00,
710 0xff, 0xf0, 0xff, 0xff, 0xf7, 0xff, 0xf3, 0xf0,
711 0x61, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
712 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xf0,
717 static char vloop_lbm[] = {
718 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
719 0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00,
720 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00,
721 0xfc, 0x03, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
722 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00,
723 0x3c, 0x3c, 0x00, 0x3c, 0x3c, 0x3c, 0x00, 0x3c,
724 0x0c, 0x3c, 0xff, 0x3c, 0x0c, 0x3c, 0xff, 0x3c,
725 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
726 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
727 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
728 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
729 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
730 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
731 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
732 0x00, 0x3c, 0xff, 0x3c, 0x00, 0x3c, 0xff, 0x3c,
733 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
736 static char vloop_lmsk[] = {
737 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00,
738 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
739 0xff, 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00,
740 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
741 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff,
742 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
743 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
744 0x0f, 0xff, 0x00, 0xff, 0x0f, 0xff, 0x00, 0xff,
745 0x03, 0x3c, 0x00, 0x3c, 0x03, 0x3c, 0x00, 0x3c,
746 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
747 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
748 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
749 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
750 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
751 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
752 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
757 static BCursor VLoopCursor = {
759 vloop_sbm, vloop_smsk,
763 vloop_lbm, vloop_lmsk,
770 BlenderCursor[BC_VLOOPCURSOR] = &VLoopCursor;
775 /********************** TextEdit Cursor ***********************/
777 static char textedit_sbm[] = {
778 0xe0, 0x03, 0x10, 0x04, 0x60, 0x03, 0x40, 0x01,
779 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01,
780 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01,
781 0x40, 0x01, 0x60, 0x03, 0x10, 0x04, 0xe0, 0x03,
784 static char textedit_smsk[] = {
785 0xe0, 0x03, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01,
786 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
787 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
788 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xe0, 0x03,
791 static BCursor TextEditCursor = {
793 textedit_sbm, textedit_smsk,
804 BlenderCursor[BC_TEXTEDITCURSOR] = &TextEditCursor;
808 /********************** Paintbrush Cursor ***********************/
810 static char paintbrush_sbm[] = {
812 0x00, 0xe0, 0x00, 0x98, 0x00, 0x44, 0x00, 0x42,
813 0x00, 0x21, 0x80, 0x20, 0x40, 0x13, 0x40, 0x17,
814 0xa0, 0x0b, 0x98, 0x05, 0x04, 0x02, 0x02, 0x01,
815 0x02, 0x01, 0x02, 0x01, 0x81, 0x00, 0x7f, 0x00,
821 static char paintbrush_smsk[] = {
822 0x00, 0xe0, 0x00, 0xf8, 0x00, 0x7c, 0x00, 0x7e,
823 0x00, 0x3f, 0x80, 0x3f, 0xc0, 0x1f, 0xc0, 0x1f,
824 0xe0, 0x0f, 0xf8, 0x07, 0xfc, 0x03, 0xfe, 0x01,
825 0xfe, 0x01, 0xfe, 0x01, 0xff, 0x00, 0x7f, 0x00,
830 static BCursor PaintBrushCursor = {
832 paintbrush_sbm, paintbrush_smsk,
843 BlenderCursor[BC_PAINTBRUSHCURSOR] = &PaintBrushCursor;
847 /********************** Hand Cursor ***********************/
850 static char hand_sbm[] = {
851 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x0d,
852 0x98, 0x6d, 0x98, 0x6d, 0xb0, 0x6d, 0xb0, 0x6d,
853 0xe0, 0x6f, 0xe6, 0x7f, 0xee, 0x7f, 0xfc, 0x3f,
854 0xf8, 0x3f, 0xf0, 0x1f, 0xc0, 0x1f, 0xc0, 0x1f,
857 static char hand_smsk[] = {
858 0x00, 0x00, 0x80, 0x01, 0xc0, 0x0f, 0xd8, 0x7f,
859 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xf8, 0xff,
860 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f,
861 0xfc, 0x7f, 0xf8, 0x3f, 0xf0, 0x3f, 0xe0, 0x3f,
865 static BCursor HandCursor = {
878 BlenderCursor[BC_HANDCURSOR] = &HandCursor;
882 /********************** NSEW Scroll Cursor ***********************/
885 static char nsewscroll_sbm[] = {
886 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03,
887 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70,
888 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00,
889 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
892 static char nsewscroll_smsk[] = {
893 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07,
894 0xc0, 0x03, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8,
895 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0xc0, 0x03,
896 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
900 static BCursor NSEWScrollCursor = {
902 nsewscroll_sbm, nsewscroll_smsk,
913 BlenderCursor[BC_NSEW_SCROLLCURSOR] = &NSEWScrollCursor;
918 /********************** NS Scroll Cursor ***********************/
921 static char nsscroll_sbm[] = {
922 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03,
923 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
924 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
925 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
928 static char nsscroll_smsk[] = {
929 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07,
930 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
931 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03,
932 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
936 static BCursor NSScrollCursor = {
938 nsscroll_sbm, nsscroll_smsk,
949 BlenderCursor[BC_NS_SCROLLCURSOR] = &NSScrollCursor;
954 /********************** EW Scroll Cursor ***********************/
957 static char ewscroll_sbm[] = {
958 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
959 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70,
960 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00,
961 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
964 static char ewscroll_smsk[] = {
965 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
966 0x00, 0x00, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8,
967 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0x00, 0x00,
968 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
972 static BCursor EWScrollCursor = {
974 ewscroll_sbm, ewscroll_smsk,
985 BlenderCursor[BC_EW_SCROLLCURSOR] = &EWScrollCursor;
989 /********************** Eyedropper Cursor ***********************/
992 static char eyedropper_sbm[] = {
993 0x00, 0x30, 0x00, 0x48, 0x00, 0x85, 0x80, 0x82,
994 0x40, 0x40, 0x80, 0x20, 0x40, 0x11, 0xa0, 0x23,
995 0xd0, 0x15, 0xe8, 0x0a, 0x74, 0x01, 0xb4, 0x00,
996 0x4a, 0x00, 0x35, 0x00, 0x08, 0x00, 0x04, 0x00,
999 static char eyedropper_smsk[] = {
1000 0x00, 0x30, 0x00, 0x78, 0x00, 0xfd, 0x80, 0xff,
1001 0xc0, 0x7f, 0x80, 0x3f, 0xc0, 0x1f, 0xe0, 0x3f,
1002 0xf0, 0x1f, 0xf8, 0x0b, 0xfc, 0x01, 0xfc, 0x00,
1003 0x7e, 0x00, 0x3f, 0x00, 0x0c, 0x00, 0x04, 0x00,
1007 static BCursor EyedropperCursor = {
1009 eyedropper_sbm, eyedropper_smsk,
1020 BlenderCursor[BC_EYEDROPPER_CURSOR] = &EyedropperCursor;
1024 /********************** Swap Area Cursor ***********************/
1026 static char swap_sbm[] = {
1027 0xc0, 0xff, 0x40, 0x80, 0x40, 0x80, 0x40, 0x9c,
1028 0x40, 0x98, 0x40, 0x94, 0x00, 0x82, 0xfe, 0x80,
1029 0x7e, 0xfd, 0xbe, 0x01, 0xda, 0x01, 0xe2, 0x01,
1030 0xe2, 0x01, 0xc2, 0x01, 0xfe, 0x01, 0x00, 0x00,
1033 static char swap_smsk[] = {
1034 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff,
1035 0xc0, 0xff, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff,
1036 0xff, 0xff, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03,
1037 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03,
1040 static BCursor SwapCursor = {
1042 swap_sbm, swap_smsk,
1053 BlenderCursor[BC_SWAPAREA_CURSOR] = &SwapCursor;
1056 /********************** Put the cursors in the array ***********************/