4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2005-2007 Blender Foundation
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): Matt Ebb
27 * ***** END GPL/BL DUAL LICENSE BLOCK *****
33 #include "GHOST_C-api.h"
35 #include "DNA_listBase.h"
36 #include "DNA_userdef_types.h"
38 #include "BKE_global.h"
41 #include "wm_cursors.h"
43 /* XXX this still is mess from old code */
47 /* Some simple ghost <-> blender conversions */
48 static GHOST_TStandardCursor convert_cursor(int curs)
52 case CURSOR_STD: return GHOST_kStandardCursorDefault;
53 case CURSOR_FACESEL: return GHOST_kStandardCursorRightArrow;
54 case CURSOR_WAIT: return GHOST_kStandardCursorWait;
55 case CURSOR_EDIT: return GHOST_kStandardCursorCrosshair;
56 case CURSOR_HELP: return GHOST_kStandardCursorHelp;
57 case CURSOR_X_MOVE: return GHOST_kStandardCursorLeftRight;
58 case CURSOR_Y_MOVE: return GHOST_kStandardCursorUpDown;
59 case CURSOR_PENCIL: return GHOST_kStandardCursorPencil;
63 void window_set_custom_cursor(wmWindow *win, unsigned char mask[16][2],
64 unsigned char bitmap[16][2], int hotx, int hoty)
66 GHOST_SetCustomCursorShape(win->ghostwin, bitmap, mask, hotx, hoty);
69 static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor, int useBig)
72 GHOST_SetCustomCursorShapeEx(win->ghostwin,
73 (GHOST_TUns8 *)cursor->big_bm, (GHOST_TUns8 *)cursor->big_mask,
74 cursor->big_sizex,cursor->big_sizey,
75 cursor->big_hotx,cursor->big_hoty,
76 cursor->fg_color, cursor->bg_color);
78 GHOST_SetCustomCursorShapeEx(win->ghostwin,
79 (GHOST_TUns8 *)cursor->small_bm, (GHOST_TUns8 *)cursor->small_mask,
80 cursor->small_sizex,cursor->small_sizey,
81 cursor->small_hotx,cursor->small_hoty,
82 cursor->fg_color, cursor->bg_color);
88 static BCursor *BlenderCursor[BC_NUMCURSORS]; /*Points to static BCursor Structs */
89 static short CurrentCursor=-1, LastCursor=-1;
91 void WM_set_cursor(bContext *C, int curs)
93 wmWindow *win= C->window;
95 if (win==NULL) return; /* Can't set custom cursor before Window init */
98 if (curs==CURSOR_NONE) {
99 GHOST_SetCursorVisibility(win->ghostwin, 0);
103 GHOST_SetCursorVisibility(win->ghostwin, 1);
105 LastCursor=CurrentCursor;
108 /* previous cursor? */
109 if (curs==LASTCURSOR) curs=LastCursor;
111 /* detect if we use system cursor or Blender cursor */
112 if(curs>=BC_GHOST_CURSORS) {
113 GHOST_SetCursorShape(win->ghostwin, convert_cursor(curs));
116 if ((curs<LASTCURSOR)||(curs>=BC_NUMCURSORS)) return;
118 if (curs==SYSCURSOR) { /* System default Cursor */
119 GHOST_SetCursorShape(win->ghostwin, convert_cursor(CURSOR_STD));
121 else if ( (U.curssize==0) || (BlenderCursor[curs]->big_bm == NULL) ) {
122 window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
125 window_set_custom_cursor_ex(win, BlenderCursor[curs], 1);
130 void WM_waitcursor(bContext *C, int val)
134 WM_set_cursor(C, CURSOR_WAIT);
136 WM_set_cursor(C, LASTCURSOR);
141 void WM_timecursor(bContext *C, int nr)
144 static char number_bitmaps[10][8]= {
145 {0, 56, 68, 68, 68, 68, 68, 56},
146 {0, 24, 16, 16, 16, 16, 16, 56},
147 {0, 60, 66, 32, 16, 8, 4, 126},
148 {0, 124, 32, 16, 56, 64, 66, 60},
149 {0, 32, 48, 40, 36, 126, 32, 32},
150 {0, 124, 4, 60, 64, 64, 68, 56},
151 {0, 56, 4, 4, 60, 68, 68, 56},
152 {0, 124, 64, 32, 16, 8, 8, 8},
153 {0, 60, 66, 66, 60, 66, 66, 60},
154 {0, 56, 68, 68, 120, 64, 68, 56}
156 unsigned char mask[16][2];
157 unsigned char bitmap[16][2];
160 memset(&bitmap, 0x00, sizeof(bitmap));
161 memset(&mask, 0xFF, sizeof(mask));
163 /* print number bottom right justified */
164 for (idx= 3; nr && idx>=0; idx--) {
165 char *digit= number_bitmaps[nr%10];
170 bitmap[i + y*8][x]= digit[i];
174 window_set_custom_cursor(C->window, mask, bitmap, 7, 7);
178 /* ******************************************************************
179 Custom Cursor Description:
181 Each bit represents a pixel, so 1 byte = 8 pixels,
182 the bytes go Left to Right. Top to bottom
183 the bits in a byte go right to left
184 (ie; 0x01, 0x80 represents a line of 16 pix with the first and last pix set.)
186 A 0 in the bitmap = bg_color, a 1 fg_color
187 a 0 in the mask = transparent pix.
189 Until 32x32 cursors are supported on all platforms, the size of the
190 small cursors MUST be 16x16.
192 Large cursors have a MAXSIZE of 32x32.
194 Other than that, the specified size of the cursors is just a guideline,
195 However, the char array that defines the BM and MASK must be byte aligned.
196 ie a 17x17 cursor needs 3 bytes (cols) * 17 bytes (rows)
197 (3 bytes = 17 bits rounded up to nearest whole byte). Pad extra bits
200 Setting big_bm=NULL disables the large version of the cursor.
202 *******************************************************************
204 There is a nice Python GUI utility that can be used for drawing cursors in
205 this format in the Blender source distribution, in
206 blender/source/tools/MakeCursor.py . Start it with $ python MakeCursor.py
207 It will copy its output to the console when you press 'Do it'.
211 /* Because defining a cursor mixes declarations and executable code
212 each cursor needs it's own scoping block or it would be split up
213 over several hundred lines of code. To enforce/document this better
214 I define 2 pretty braindead macros so it's obvious what the extra "[]"
217 #define BEGIN_CURSOR_BLOCK {
218 #define END_CURSOR_BLOCK }
220 void WM_init_cursor_data(void){
222 /********************** NW_ARROW Cursor **************************/
224 static char nw_sbm[]={
225 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, 0x11, 0x00,
226 0x21, 0x00, 0x41, 0x00, 0x81, 0x00, 0x01, 0x01,
227 0x01, 0x02, 0xc1, 0x03, 0x49, 0x00, 0x8d, 0x00,
228 0x8b, 0x00, 0x10, 0x01, 0x90, 0x01, 0x60, 0x00,
231 static char nw_smsk[]={
232 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00,
233 0x3f, 0x00, 0x7f, 0x00, 0xff, 0x00, 0xff, 0x01,
234 0xff, 0x03, 0xff, 0x03, 0x7f, 0x00, 0xff, 0x00,
235 0xfb, 0x00, 0xf0, 0x01, 0xf0, 0x01, 0x60, 0x00,
238 static BCursor NWArrowCursor = {
251 BlenderCursor[BC_NW_ARROWCURSOR]=&NWArrowCursor;
254 ///********************** NS_ARROW Cursor *************************/
256 static char ns_sbm[]={
257 0x40, 0x01, 0x20, 0x02, 0x10, 0x04, 0x08, 0x08,
258 0x04, 0x10, 0x3c, 0x1e, 0x20, 0x02, 0x20, 0x02,
259 0x20, 0x02, 0x20, 0x02, 0x3c, 0x1e, 0x04, 0x10,
260 0x08, 0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x01
263 static char ns_smsk[]={
264 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f,
265 0xfc, 0x1f, 0xfc, 0x1f, 0xe0, 0x03, 0xe0, 0x03,
266 0xe0, 0x03, 0xe0, 0x03, 0xfc, 0x1f, 0xfc, 0x1f,
267 0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01
270 static BCursor NSArrowCursor = {
283 BlenderCursor[BC_NS_ARROWCURSOR]=&NSArrowCursor;
286 /********************** EW_ARROW Cursor *************************/
288 static char ew_sbm[]={
289 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c,
290 0x2c, 0x34, 0xe6, 0x67, 0x03, 0xc0, 0x01, 0x80,
291 0x03, 0xc0, 0xe6, 0x67, 0x2c, 0x34, 0x38, 0x1c,
292 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
295 static char ew_smsk[]={
296 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c,
297 0x3c, 0x3c, 0xfe, 0x7f, 0xff, 0xff, 0x3f, 0xfc,
298 0xff, 0xff, 0xfe, 0x7f, 0x3c, 0x3c, 0x38, 0x1c,
299 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
302 static BCursor EWArrowCursor = {
315 BlenderCursor[BC_EW_ARROWCURSOR]=&EWArrowCursor;
318 /********************** Wait Cursor *****************************/
320 static char wait_sbm[]={
321 0xfe, 0x7f, 0x02, 0x40, 0x02, 0x40, 0x84, 0x21,
322 0xc8, 0x13, 0xd0, 0x0b, 0xa0, 0x04, 0x20, 0x05,
323 0xa0, 0x04, 0x10, 0x09, 0x88, 0x11, 0xc4, 0x23,
324 0xe2, 0x47, 0xfa, 0x5f, 0x02, 0x40, 0xfe, 0x7f,
327 static char wait_smsk[]={
328 0xfe, 0x7f, 0xfe, 0x7f, 0x06, 0x60, 0x8c, 0x31,
329 0xd8, 0x1b, 0xf0, 0x0f, 0xe0, 0x06, 0x60, 0x07,
330 0xe0, 0x06, 0x30, 0x0d, 0x98, 0x19, 0xcc, 0x33,
331 0xe6, 0x67, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f,
334 static char wait_lbm[]={
335 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
336 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x30,
337 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x18,
338 0x18, 0xc0, 0x03, 0x0c, 0x30, 0x20, 0x07, 0x06,
339 0x60, 0xf0, 0x0f, 0x03, 0xc0, 0xd0, 0x8d, 0x01,
340 0x80, 0x79, 0xcf, 0x00, 0x00, 0xf3, 0x67, 0x00,
341 0x00, 0x66, 0x37, 0x00, 0x00, 0x8c, 0x33, 0x00,
342 0x00, 0x0c, 0x32, 0x00, 0x00, 0xcc, 0x33, 0x00,
343 0x00, 0x8c, 0x30, 0x00, 0x00, 0x46, 0x61, 0x00,
344 0x00, 0x03, 0xc3, 0x00, 0x80, 0x01, 0x83, 0x01,
345 0xc0, 0xc0, 0x03, 0x03, 0x60, 0xa0, 0x05, 0x06,
346 0x30, 0xf0, 0x0f, 0x0c, 0x18, 0xf8, 0x1d, 0x18,
347 0x0c, 0x5c, 0x3f, 0x30, 0x0c, 0xff, 0x5f, 0x30,
348 0x0c, 0xf7, 0xfe, 0x31, 0xcc, 0xfb, 0x9f, 0x33,
349 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x30,
350 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
353 static char wait_lmsk[]={
354 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
355 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
356 0x3c, 0x00, 0x00, 0x3c, 0x3c, 0x00, 0x00, 0x1e,
357 0x78, 0xc0, 0x03, 0x0f, 0xf0, 0xa0, 0x87, 0x07,
358 0xe0, 0xf1, 0xcf, 0x03, 0xc0, 0xf3, 0xef, 0x01,
359 0x80, 0xff, 0xff, 0x00, 0x00, 0xff, 0x7f, 0x00,
360 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00,
361 0x00, 0x3c, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00,
362 0x00, 0xbc, 0x3c, 0x00, 0x00, 0xde, 0x79, 0x00,
363 0x00, 0x0f, 0xf3, 0x00, 0x80, 0x07, 0xe3, 0x01,
364 0xc0, 0xc3, 0xc3, 0x03, 0xe0, 0xe1, 0x87, 0x07,
365 0xf0, 0xf0, 0x0f, 0x0f, 0x78, 0xf8, 0x1f, 0x1e,
366 0x3c, 0x7c, 0x3f, 0x3c, 0x3c, 0xff, 0x7f, 0x3c,
367 0xbc, 0xff, 0xff, 0x3d, 0xfc, 0xfb, 0xbf, 0x3f,
368 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
369 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
372 static BCursor WaitCursor = {
385 BlenderCursor[BC_WAITCURSOR]=&WaitCursor;
388 /********************** Cross Cursor ***************************/
390 static char cross_sbm[]={
391 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
392 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x7e, 0x7e,
393 0x7e, 0x7e, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
394 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00,
397 static char cross_smsk[]={
398 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
399 0x80, 0x01, 0x80, 0x01, 0xc0, 0x03, 0x7f, 0xfe,
400 0x7f, 0xfe, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01,
401 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
403 static char cross_lbm[]={
404 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
405 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
406 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
407 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
408 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
409 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00,
410 0x00, 0xc0, 0x03, 0x00, 0x00, 0x40, 0x02, 0x00,
411 0x00, 0x78, 0x1e, 0x00, 0xfc, 0x1f, 0xf8, 0x3f,
412 0xfc, 0x1f, 0xf8, 0x3f, 0x00, 0x78, 0x1e, 0x00,
413 0x00, 0x40, 0x02, 0x00, 0x00, 0xc0, 0x03, 0x00,
414 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00,
415 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
416 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
417 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
418 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
419 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
422 static char cross_lmsk[]={
423 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
424 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
425 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
426 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
427 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
428 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00,
429 0x00, 0xe0, 0x07, 0x00, 0x00, 0x70, 0x0e, 0x00,
430 0x00, 0x78, 0x1e, 0x00, 0xff, 0x1f, 0xf8, 0xff,
431 0xff, 0x1f, 0xf8, 0xff, 0x00, 0x78, 0x1e, 0x00,
432 0x00, 0x70, 0x0e, 0x00, 0x00, 0xe0, 0x07, 0x00,
433 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00,
434 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
435 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
436 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
437 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
438 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
441 static BCursor CrossCursor = {
443 cross_sbm, cross_smsk,
447 cross_lbm, cross_lmsk,
454 BlenderCursor[BC_CROSSCURSOR]=&CrossCursor;
457 /********************** EditCross Cursor ***********************/
459 static char editcross_sbm[]={
460 0x0e, 0x00, 0x11, 0x00, 0x1d, 0x00, 0x19, 0x03,
461 0x1d, 0x03, 0x11, 0x03, 0x0e, 0x03, 0x00, 0x03,
462 0xf8, 0x7c, 0xf8, 0x7c, 0x00, 0x03, 0x00, 0x03,
463 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00,
466 static char editcross_smsk[]={
467 0x0e, 0x00, 0x1f, 0x00, 0x1f, 0x03, 0x1f, 0x03,
468 0x1f, 0x03, 0x1f, 0x03, 0x0e, 0x03, 0x80, 0x07,
469 0xfc, 0xfc, 0xfc, 0xfc, 0x80, 0x07, 0x00, 0x03,
470 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
473 static BCursor EditCrossCursor = {
475 editcross_sbm, editcross_smsk,
486 BlenderCursor[BC_EDITCROSSCURSOR]=&EditCrossCursor;
489 /********************** Box Select *************************/
491 static char box_sbm[32]={
492 0x7f, 0x00, 0x41, 0x00, 0x41, 0x00, 0x41, 0x06,
493 0x41, 0x06, 0x41, 0x06, 0x7f, 0x06, 0x00, 0x06,
494 0xe0, 0x79, 0xe0, 0x79, 0x00, 0x06, 0x00, 0x06,
495 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00,
498 static char box_smsk[32]={
499 0x7f, 0x00, 0x7f, 0x00, 0x63, 0x06, 0x63, 0x06,
500 0x63, 0x06, 0x7f, 0x06, 0x7f, 0x06, 0x00, 0x0f,
501 0xf0, 0xf9, 0xf0, 0xf9, 0x00, 0x0f, 0x00, 0x06,
502 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06,
506 static BCursor BoxSelCursor = {
519 BlenderCursor[BC_BOXSELCURSOR]=&BoxSelCursor;
522 /********************** Knife Cursor ***********************/
524 static char knife_sbm[]={
525 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c,
526 0x00, 0x5a, 0x00, 0x34, 0x00, 0x2a, 0x00, 0x17,
527 0x80, 0x06, 0x40, 0x03, 0xa0, 0x03, 0xd0, 0x01,
528 0x68, 0x00, 0x1c, 0x00, 0x06, 0x00, 0x00, 0x00
531 static char knife_smsk[]={
532 0x00, 0x60, 0x00, 0xf0, 0x00, 0xfc, 0x00, 0xfe,
533 0x00, 0xfe, 0x00, 0x7e, 0x00, 0x7f, 0x80, 0x3f,
534 0xc0, 0x0e, 0x60, 0x07, 0xb0, 0x07, 0xd8, 0x03,
535 0xec, 0x01, 0x7e, 0x00, 0x1f, 0x00, 0x07, 0x00
538 static char knife_lbm[]={
539 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
540 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
541 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c,
542 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7f,
543 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0xc0, 0x5f,
544 0x00, 0x00, 0xc0, 0x6f, 0x00, 0x00, 0xc0, 0x37,
545 0x00, 0x00, 0xa8, 0x1b, 0x00, 0x00, 0x54, 0x0d,
546 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x54, 0x00,
547 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x53, 0x00,
548 0x00, 0xc0, 0x07, 0x00, 0x00, 0xe0, 0x0f, 0x00,
549 0x00, 0xd0, 0x0f, 0x00, 0x00, 0xe8, 0x07, 0x00,
550 0x00, 0xf4, 0x07, 0x00, 0x00, 0xfa, 0x00, 0x00,
551 0x00, 0x3d, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00,
552 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
553 0x30, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
554 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
558 static char knife_lmsk[]={
559 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
560 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
561 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7e,
562 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x80, 0xff,
563 0x00, 0x00, 0xc0, 0xbf, 0x00, 0x00, 0xe0, 0xdf,
564 0x00, 0x00, 0xe0, 0xef, 0x00, 0x00, 0xf8, 0x77,
565 0x00, 0x00, 0xfc, 0x3b, 0x00, 0x00, 0xfe, 0x1d,
566 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xfe, 0x01,
567 0x00, 0x00, 0xff, 0x01, 0x00, 0xc0, 0xff, 0x00,
568 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xf0, 0x1f, 0x00,
569 0x00, 0xd8, 0x1f, 0x00, 0x00, 0xec, 0x0f, 0x00,
570 0x00, 0xf6, 0x0f, 0x00, 0x00, 0xfb, 0x06, 0x00,
571 0x80, 0xbd, 0x01, 0x00, 0xc0, 0x6e, 0x00, 0x00,
572 0xe0, 0x1b, 0x00, 0x00, 0xf0, 0x06, 0x00, 0x00,
573 0xb8, 0x01, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
574 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
578 static BCursor KnifeCursor = {
580 knife_sbm, knife_smsk,
584 knife_lbm, knife_lmsk,
591 BlenderCursor[BC_KNIFECURSOR]=&KnifeCursor;
595 /********************** Loop Select Cursor ***********************/
598 static char vloop_sbm[]={
599 0x00, 0x00, 0x7e, 0x00, 0x3e, 0x00, 0x1e, 0x00,
600 0x0e, 0x00, 0x66, 0x60, 0x62, 0x6f, 0x00, 0x00,
601 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
602 0x00, 0x00, 0x60, 0x60, 0x60, 0x6f, 0x00, 0x00,
605 static char vloop_smsk[]={
606 0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00,
607 0xff, 0xf0, 0xff, 0xff, 0xf7, 0xff, 0xf3, 0xf0,
608 0x61, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
609 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xf0,
614 static char vloop_lbm[]={
615 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
616 0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00,
617 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00,
618 0xfc, 0x03, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
619 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00,
620 0x3c, 0x3c, 0x00, 0x3c, 0x3c, 0x3c, 0x00, 0x3c,
621 0x0c, 0x3c, 0xff, 0x3c, 0x0c, 0x3c, 0xff, 0x3c,
622 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
623 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
624 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
625 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
626 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
627 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
628 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
629 0x00, 0x3c, 0xff, 0x3c, 0x00, 0x3c, 0xff, 0x3c,
630 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
633 static char vloop_lmsk[]={
634 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00,
635 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
636 0xff, 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00,
637 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
638 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff,
639 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
640 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
641 0x0f, 0xff, 0x00, 0xff, 0x0f, 0xff, 0x00, 0xff,
642 0x03, 0x3c, 0x00, 0x3c, 0x03, 0x3c, 0x00, 0x3c,
643 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
644 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
645 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
646 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
647 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
648 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
649 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
654 static BCursor VLoopCursor = {
656 vloop_sbm, vloop_smsk,
660 vloop_lbm, vloop_lmsk,
667 BlenderCursor[BC_VLOOPCURSOR]=&VLoopCursor;
672 /********************** TextEdit Cursor ***********************/
674 static char textedit_sbm[]={
675 0xe0, 0x03, 0x10, 0x04, 0x60, 0x03, 0x40, 0x01,
676 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01,
677 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01,
678 0x40, 0x01, 0x60, 0x03, 0x10, 0x04, 0xe0, 0x03,
681 static char textedit_smsk[]={
682 0xe0, 0x03, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01,
683 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
684 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
685 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xe0, 0x03,
688 static BCursor TextEditCursor = {
690 textedit_sbm, textedit_smsk,
701 BlenderCursor[BC_TEXTEDITCURSOR]=&TextEditCursor;
705 /********************** Paintbrush Cursor ***********************/
707 static char paintbrush_sbm[]={
709 0x00, 0xe0, 0x00, 0x98, 0x00, 0x44, 0x00, 0x42,
710 0x00, 0x21, 0x80, 0x20, 0x40, 0x13, 0x40, 0x17,
711 0xa0, 0x0b, 0x98, 0x05, 0x04, 0x02, 0x02, 0x01,
712 0x02, 0x01, 0x02, 0x01, 0x81, 0x00, 0x7f, 0x00,
718 static char paintbrush_smsk[]={
719 0x00, 0xe0, 0x00, 0xf8, 0x00, 0x7c, 0x00, 0x7e,
720 0x00, 0x3f, 0x80, 0x3f, 0xc0, 0x1f, 0xc0, 0x1f,
721 0xe0, 0x0f, 0xf8, 0x07, 0xfc, 0x03, 0xfe, 0x01,
722 0xfe, 0x01, 0xfe, 0x01, 0xff, 0x00, 0x7f, 0x00,
727 static BCursor PaintBrushCursor = {
729 paintbrush_sbm, paintbrush_smsk,
740 BlenderCursor[BC_PAINTBRUSHCURSOR]=&PaintBrushCursor;
744 /********************** Hand Cursor ***********************/
747 static char hand_sbm[]={
748 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x0d,
749 0x98, 0x6d, 0x98, 0x6d, 0xb0, 0x6d, 0xb0, 0x6d,
750 0xe0, 0x6f, 0xe6, 0x7f, 0xee, 0x7f, 0xfc, 0x3f,
751 0xf8, 0x3f, 0xf0, 0x1f, 0xc0, 0x1f, 0xc0, 0x1f,
754 static char hand_smsk[]={
755 0x00, 0x00, 0x80, 0x01, 0xc0, 0x0f, 0xd8, 0x7f,
756 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xf8, 0xff,
757 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f,
758 0xfc, 0x7f, 0xf8, 0x3f, 0xf0, 0x3f, 0xe0, 0x3f,
762 static BCursor HandCursor = {
775 BlenderCursor[BC_HANDCURSOR]=&HandCursor;
779 /********************** NSEW Scroll Cursor ***********************/
782 static char nsewscroll_sbm[]={
783 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03,
784 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70,
785 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00,
786 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
789 static char nsewscroll_smsk[]={
790 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07,
791 0xc0, 0x03, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8,
792 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0xc0, 0x03,
793 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
797 static BCursor NSEWScrollCursor = {
799 nsewscroll_sbm, nsewscroll_smsk,
810 BlenderCursor[BC_NSEW_SCROLLCURSOR]=&NSEWScrollCursor;
815 /********************** NS Scroll Cursor ***********************/
818 static char nsscroll_sbm[]={
819 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03,
820 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
821 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
822 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
825 static char nsscroll_smsk[]={
826 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07,
827 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
828 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03,
829 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
833 static BCursor NSScrollCursor = {
835 nsscroll_sbm, nsscroll_smsk,
846 BlenderCursor[BC_NS_SCROLLCURSOR]=&NSScrollCursor;
851 /********************** EW Scroll Cursor ***********************/
854 static char ewscroll_sbm[]={
855 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
856 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70,
857 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00,
858 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
861 static char ewscroll_smsk[]={
862 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
863 0x00, 0x00, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8,
864 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0x00, 0x00,
865 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
869 static BCursor EWScrollCursor = {
871 ewscroll_sbm, ewscroll_smsk,
882 BlenderCursor[BC_EW_SCROLLCURSOR]=&EWScrollCursor;
886 /********************** Eyedropper Cursor ***********************/
889 static char eyedropper_sbm[]={
890 0x00, 0x30, 0x00, 0x48, 0x00, 0x85, 0x80, 0x82,
891 0x40, 0x40, 0x80, 0x20, 0x40, 0x11, 0xa0, 0x23,
892 0xd0, 0x15, 0xe8, 0x0a, 0x74, 0x01, 0xb4, 0x00,
893 0x4a, 0x00, 0x35, 0x00, 0x08, 0x00, 0x04, 0x00,
896 static char eyedropper_smsk[]={
897 0x00, 0x30, 0x00, 0x78, 0x00, 0xfd, 0x80, 0xff,
898 0xc0, 0x7f, 0x80, 0x3f, 0xc0, 0x1f, 0xe0, 0x3f,
899 0xf0, 0x1f, 0xf8, 0x0b, 0xfc, 0x01, 0xfc, 0x00,
900 0x7e, 0x00, 0x3f, 0x00, 0x0c, 0x00, 0x04, 0x00,
904 static BCursor EyedropperCursor = {
906 eyedropper_sbm, eyedropper_smsk,
917 BlenderCursor[BC_EYEDROPPER_CURSOR]=&EyedropperCursor;
921 /********************** Put the cursors in the array ***********************/