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 *****
32 #include "GHOST_C-api.h"
34 #include "DNA_listBase.h"
35 #include "DNA_userdef_types.h"
37 #include "BKE_global.h"
40 #include "wm_cursors.h"
42 /* XXX this still is mess from old code */
46 /* Some simple ghost <-> blender conversions */
47 static GHOST_TStandardCursor convert_cursor(int curs)
51 case CURSOR_STD: return GHOST_kStandardCursorDefault;
52 case CURSOR_FACESEL: return GHOST_kStandardCursorRightArrow;
53 case CURSOR_WAIT: return GHOST_kStandardCursorWait;
54 case CURSOR_EDIT: return GHOST_kStandardCursorCrosshair;
55 case CURSOR_HELP: return GHOST_kStandardCursorHelp;
56 case CURSOR_X_MOVE: return GHOST_kStandardCursorLeftRight;
57 case CURSOR_Y_MOVE: return GHOST_kStandardCursorUpDown;
58 case CURSOR_PENCIL: return GHOST_kStandardCursorPencil;
62 void window_set_custom_cursor(wmWindow *win, unsigned char mask[16][2],
63 unsigned char bitmap[16][2], int hotx, int hoty)
65 GHOST_SetCustomCursorShape(win->ghostwin, bitmap, mask, hotx, hoty);
68 static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor, int useBig)
71 GHOST_SetCustomCursorShapeEx(win->ghostwin,
72 (GHOST_TUns8 *)cursor->big_bm, (GHOST_TUns8 *)cursor->big_mask,
73 cursor->big_sizex,cursor->big_sizey,
74 cursor->big_hotx,cursor->big_hoty,
75 cursor->fg_color, cursor->bg_color);
77 GHOST_SetCustomCursorShapeEx(win->ghostwin,
78 (GHOST_TUns8 *)cursor->small_bm, (GHOST_TUns8 *)cursor->small_mask,
79 cursor->small_sizex,cursor->small_sizey,
80 cursor->small_hotx,cursor->small_hoty,
81 cursor->fg_color, cursor->bg_color);
87 static BCursor *BlenderCursor[BC_NUMCURSORS]; /*Points to static BCursor Structs */
88 static short CurrentCursor=-1, LastCursor=-1;
90 void WM_set_cursor(bContext *C, int curs)
92 wmWindow *win= C->window;
94 if (win==NULL) return; /* Can't set custom cursor before Window init */
97 if (curs==CURSOR_NONE) {
98 GHOST_SetCursorVisibility(win->ghostwin, 0);
102 GHOST_SetCursorVisibility(win->ghostwin, 1);
104 /* detect if we use system cursor or Blender cursor */
105 if(curs>=BC_GHOST_CURSORS) {
106 GHOST_SetCursorShape(win->ghostwin, convert_cursor(curs));
110 if ((curs<LASTCURSOR)||(curs>=BC_NUMCURSORS)) return;
113 LastCursor=CurrentCursor;
116 if (curs==LASTCURSOR) curs=LastCursor;
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);
129 /* ******************************************************************
130 Custom Cursor Description:
132 Each bit represents a pixel, so 1 byte = 8 pixels,
133 the bytes go Left to Right. Top to bottom
134 the bits in a byte go right to left
135 (ie; 0x01, 0x80 represents a line of 16 pix with the first and last pix set.)
137 A 0 in the bitmap = bg_color, a 1 fg_color
138 a 0 in the mask = transparent pix.
140 Until 32x32 cursors are supported on all platforms, the size of the
141 small cursors MUST be 16x16.
143 Large cursors have a MAXSIZE of 32x32.
145 Other than that, the specified size of the cursors is just a guideline,
146 However, the char array that defines the BM and MASK must be byte aligned.
147 ie a 17x17 cursor needs 3 bytes (cols) * 17 bytes (rows)
148 (3 bytes = 17 bits rounded up to nearest whole byte). Pad extra bits
151 Setting big_bm=NULL disables the large version of the cursor.
153 *******************************************************************
155 There is a nice Python GUI utility that can be used for drawing cursors in
156 this format in the Blender source distribution, in
157 blender/source/tools/MakeCursor.py . Start it with $ python MakeCursor.py
158 It will copy its output to the console when you press 'Do it'.
162 /* Because defining a cursor mixes declarations and executable code
163 each cursor needs it's own scoping block or it would be split up
164 over several hundred lines of code. To enforce/document this better
165 I define 2 pretty braindead macros so it's obvious what the extra "[]"
168 #define BEGIN_CURSOR_BLOCK {
169 #define END_CURSOR_BLOCK }
171 void WM_init_cursor_data(void){
173 /********************** NW_ARROW Cursor **************************/
175 static char nw_sbm[]={
176 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, 0x11, 0x00,
177 0x21, 0x00, 0x41, 0x00, 0x81, 0x00, 0x01, 0x01,
178 0x01, 0x02, 0xc1, 0x03, 0x49, 0x00, 0x8d, 0x00,
179 0x8b, 0x00, 0x10, 0x01, 0x90, 0x01, 0x60, 0x00,
182 static char nw_smsk[]={
183 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00,
184 0x3f, 0x00, 0x7f, 0x00, 0xff, 0x00, 0xff, 0x01,
185 0xff, 0x03, 0xff, 0x03, 0x7f, 0x00, 0xff, 0x00,
186 0xfb, 0x00, 0xf0, 0x01, 0xf0, 0x01, 0x60, 0x00,
189 static BCursor NWArrowCursor = {
202 BlenderCursor[BC_NW_ARROWCURSOR]=&NWArrowCursor;
205 ///********************** NS_ARROW Cursor *************************/
207 static char ns_sbm[]={
208 0x40, 0x01, 0x20, 0x02, 0x10, 0x04, 0x08, 0x08,
209 0x04, 0x10, 0x3c, 0x1e, 0x20, 0x02, 0x20, 0x02,
210 0x20, 0x02, 0x20, 0x02, 0x3c, 0x1e, 0x04, 0x10,
211 0x08, 0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x01
214 static char ns_smsk[]={
215 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f,
216 0xfc, 0x1f, 0xfc, 0x1f, 0xe0, 0x03, 0xe0, 0x03,
217 0xe0, 0x03, 0xe0, 0x03, 0xfc, 0x1f, 0xfc, 0x1f,
218 0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01
221 static BCursor NSArrowCursor = {
234 BlenderCursor[BC_NS_ARROWCURSOR]=&NSArrowCursor;
237 /********************** EW_ARROW Cursor *************************/
239 static char ew_sbm[]={
240 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c,
241 0x2c, 0x34, 0xe6, 0x67, 0x03, 0xc0, 0x01, 0x80,
242 0x03, 0xc0, 0xe6, 0x67, 0x2c, 0x34, 0x38, 0x1c,
243 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
246 static char ew_smsk[]={
247 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c,
248 0x3c, 0x3c, 0xfe, 0x7f, 0xff, 0xff, 0x3f, 0xfc,
249 0xff, 0xff, 0xfe, 0x7f, 0x3c, 0x3c, 0x38, 0x1c,
250 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
253 static BCursor EWArrowCursor = {
266 BlenderCursor[BC_EW_ARROWCURSOR]=&EWArrowCursor;
269 /********************** Wait Cursor *****************************/
271 static char wait_sbm[]={
272 0xfe, 0x7f, 0x02, 0x40, 0x02, 0x40, 0x84, 0x21,
273 0xc8, 0x13, 0xd0, 0x0b, 0xa0, 0x04, 0x20, 0x05,
274 0xa0, 0x04, 0x10, 0x09, 0x88, 0x11, 0xc4, 0x23,
275 0xe2, 0x47, 0xfa, 0x5f, 0x02, 0x40, 0xfe, 0x7f,
278 static char wait_smsk[]={
279 0xfe, 0x7f, 0xfe, 0x7f, 0x06, 0x60, 0x8c, 0x31,
280 0xd8, 0x1b, 0xf0, 0x0f, 0xe0, 0x06, 0x60, 0x07,
281 0xe0, 0x06, 0x30, 0x0d, 0x98, 0x19, 0xcc, 0x33,
282 0xe6, 0x67, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f,
285 static char wait_lbm[]={
286 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
287 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x30,
288 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x18,
289 0x18, 0xc0, 0x03, 0x0c, 0x30, 0x20, 0x07, 0x06,
290 0x60, 0xf0, 0x0f, 0x03, 0xc0, 0xd0, 0x8d, 0x01,
291 0x80, 0x79, 0xcf, 0x00, 0x00, 0xf3, 0x67, 0x00,
292 0x00, 0x66, 0x37, 0x00, 0x00, 0x8c, 0x33, 0x00,
293 0x00, 0x0c, 0x32, 0x00, 0x00, 0xcc, 0x33, 0x00,
294 0x00, 0x8c, 0x30, 0x00, 0x00, 0x46, 0x61, 0x00,
295 0x00, 0x03, 0xc3, 0x00, 0x80, 0x01, 0x83, 0x01,
296 0xc0, 0xc0, 0x03, 0x03, 0x60, 0xa0, 0x05, 0x06,
297 0x30, 0xf0, 0x0f, 0x0c, 0x18, 0xf8, 0x1d, 0x18,
298 0x0c, 0x5c, 0x3f, 0x30, 0x0c, 0xff, 0x5f, 0x30,
299 0x0c, 0xf7, 0xfe, 0x31, 0xcc, 0xfb, 0x9f, 0x33,
300 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x30,
301 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
304 static char wait_lmsk[]={
305 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
306 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
307 0x3c, 0x00, 0x00, 0x3c, 0x3c, 0x00, 0x00, 0x1e,
308 0x78, 0xc0, 0x03, 0x0f, 0xf0, 0xa0, 0x87, 0x07,
309 0xe0, 0xf1, 0xcf, 0x03, 0xc0, 0xf3, 0xef, 0x01,
310 0x80, 0xff, 0xff, 0x00, 0x00, 0xff, 0x7f, 0x00,
311 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00,
312 0x00, 0x3c, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00,
313 0x00, 0xbc, 0x3c, 0x00, 0x00, 0xde, 0x79, 0x00,
314 0x00, 0x0f, 0xf3, 0x00, 0x80, 0x07, 0xe3, 0x01,
315 0xc0, 0xc3, 0xc3, 0x03, 0xe0, 0xe1, 0x87, 0x07,
316 0xf0, 0xf0, 0x0f, 0x0f, 0x78, 0xf8, 0x1f, 0x1e,
317 0x3c, 0x7c, 0x3f, 0x3c, 0x3c, 0xff, 0x7f, 0x3c,
318 0xbc, 0xff, 0xff, 0x3d, 0xfc, 0xfb, 0xbf, 0x3f,
319 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
320 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
323 static BCursor WaitCursor = {
336 BlenderCursor[BC_WAITCURSOR]=&WaitCursor;
339 /********************** Cross Cursor ***************************/
341 static char cross_sbm[]={
342 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
343 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x7e, 0x7e,
344 0x7e, 0x7e, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
345 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00,
348 static char cross_smsk[]={
349 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
350 0x80, 0x01, 0x80, 0x01, 0xc0, 0x03, 0x7f, 0xfe,
351 0x7f, 0xfe, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01,
352 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
354 static char cross_lbm[]={
355 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
356 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
357 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
358 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
359 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
360 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00,
361 0x00, 0xc0, 0x03, 0x00, 0x00, 0x40, 0x02, 0x00,
362 0x00, 0x78, 0x1e, 0x00, 0xfc, 0x1f, 0xf8, 0x3f,
363 0xfc, 0x1f, 0xf8, 0x3f, 0x00, 0x78, 0x1e, 0x00,
364 0x00, 0x40, 0x02, 0x00, 0x00, 0xc0, 0x03, 0x00,
365 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00,
366 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
367 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
368 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
369 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
370 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
373 static char cross_lmsk[]={
374 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
375 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
376 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
377 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
378 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
379 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00,
380 0x00, 0xe0, 0x07, 0x00, 0x00, 0x70, 0x0e, 0x00,
381 0x00, 0x78, 0x1e, 0x00, 0xff, 0x1f, 0xf8, 0xff,
382 0xff, 0x1f, 0xf8, 0xff, 0x00, 0x78, 0x1e, 0x00,
383 0x00, 0x70, 0x0e, 0x00, 0x00, 0xe0, 0x07, 0x00,
384 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00,
385 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
386 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
387 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
388 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
389 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
392 static BCursor CrossCursor = {
394 cross_sbm, cross_smsk,
398 cross_lbm, cross_lmsk,
405 BlenderCursor[BC_CROSSCURSOR]=&CrossCursor;
408 /********************** EditCross Cursor ***********************/
410 static char editcross_sbm[]={
411 0x0e, 0x00, 0x11, 0x00, 0x1d, 0x00, 0x19, 0x03,
412 0x1d, 0x03, 0x11, 0x03, 0x0e, 0x03, 0x00, 0x03,
413 0xf8, 0x7c, 0xf8, 0x7c, 0x00, 0x03, 0x00, 0x03,
414 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00,
417 static char editcross_smsk[]={
418 0x0e, 0x00, 0x1f, 0x00, 0x1f, 0x03, 0x1f, 0x03,
419 0x1f, 0x03, 0x1f, 0x03, 0x0e, 0x03, 0x80, 0x07,
420 0xfc, 0xfc, 0xfc, 0xfc, 0x80, 0x07, 0x00, 0x03,
421 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
424 static BCursor EditCrossCursor = {
426 editcross_sbm, editcross_smsk,
437 BlenderCursor[BC_EDITCROSSCURSOR]=&EditCrossCursor;
440 /********************** Box Select *************************/
442 static char box_sbm[32]={
443 0x7f, 0x00, 0x41, 0x00, 0x41, 0x00, 0x41, 0x06,
444 0x41, 0x06, 0x41, 0x06, 0x7f, 0x06, 0x00, 0x06,
445 0xe0, 0x79, 0xe0, 0x79, 0x00, 0x06, 0x00, 0x06,
446 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00,
449 static char box_smsk[32]={
450 0x7f, 0x00, 0x7f, 0x00, 0x63, 0x06, 0x63, 0x06,
451 0x63, 0x06, 0x7f, 0x06, 0x7f, 0x06, 0x00, 0x0f,
452 0xf0, 0xf9, 0xf0, 0xf9, 0x00, 0x0f, 0x00, 0x06,
453 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06,
457 static BCursor BoxSelCursor = {
470 BlenderCursor[BC_BOXSELCURSOR]=&BoxSelCursor;
473 /********************** Knife Cursor ***********************/
475 static char knife_sbm[]={
476 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c,
477 0x00, 0x5a, 0x00, 0x34, 0x00, 0x2a, 0x00, 0x17,
478 0x80, 0x06, 0x40, 0x03, 0xa0, 0x03, 0xd0, 0x01,
479 0x68, 0x00, 0x1c, 0x00, 0x06, 0x00, 0x00, 0x00
482 static char knife_smsk[]={
483 0x00, 0x60, 0x00, 0xf0, 0x00, 0xfc, 0x00, 0xfe,
484 0x00, 0xfe, 0x00, 0x7e, 0x00, 0x7f, 0x80, 0x3f,
485 0xc0, 0x0e, 0x60, 0x07, 0xb0, 0x07, 0xd8, 0x03,
486 0xec, 0x01, 0x7e, 0x00, 0x1f, 0x00, 0x07, 0x00
489 static char knife_lbm[]={
490 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
491 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
492 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c,
493 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7f,
494 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0xc0, 0x5f,
495 0x00, 0x00, 0xc0, 0x6f, 0x00, 0x00, 0xc0, 0x37,
496 0x00, 0x00, 0xa8, 0x1b, 0x00, 0x00, 0x54, 0x0d,
497 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x54, 0x00,
498 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x53, 0x00,
499 0x00, 0xc0, 0x07, 0x00, 0x00, 0xe0, 0x0f, 0x00,
500 0x00, 0xd0, 0x0f, 0x00, 0x00, 0xe8, 0x07, 0x00,
501 0x00, 0xf4, 0x07, 0x00, 0x00, 0xfa, 0x00, 0x00,
502 0x00, 0x3d, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00,
503 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
504 0x30, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
505 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
509 static char knife_lmsk[]={
510 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
511 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
512 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7e,
513 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x80, 0xff,
514 0x00, 0x00, 0xc0, 0xbf, 0x00, 0x00, 0xe0, 0xdf,
515 0x00, 0x00, 0xe0, 0xef, 0x00, 0x00, 0xf8, 0x77,
516 0x00, 0x00, 0xfc, 0x3b, 0x00, 0x00, 0xfe, 0x1d,
517 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xfe, 0x01,
518 0x00, 0x00, 0xff, 0x01, 0x00, 0xc0, 0xff, 0x00,
519 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xf0, 0x1f, 0x00,
520 0x00, 0xd8, 0x1f, 0x00, 0x00, 0xec, 0x0f, 0x00,
521 0x00, 0xf6, 0x0f, 0x00, 0x00, 0xfb, 0x06, 0x00,
522 0x80, 0xbd, 0x01, 0x00, 0xc0, 0x6e, 0x00, 0x00,
523 0xe0, 0x1b, 0x00, 0x00, 0xf0, 0x06, 0x00, 0x00,
524 0xb8, 0x01, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
525 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
529 static BCursor KnifeCursor = {
531 knife_sbm, knife_smsk,
535 knife_lbm, knife_lmsk,
542 BlenderCursor[BC_KNIFECURSOR]=&KnifeCursor;
546 /********************** Loop Select Cursor ***********************/
549 static char vloop_sbm[]={
550 0x00, 0x00, 0x7e, 0x00, 0x3e, 0x00, 0x1e, 0x00,
551 0x0e, 0x00, 0x66, 0x60, 0x62, 0x6f, 0x00, 0x00,
552 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
553 0x00, 0x00, 0x60, 0x60, 0x60, 0x6f, 0x00, 0x00,
556 static char vloop_smsk[]={
557 0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00,
558 0xff, 0xf0, 0xff, 0xff, 0xf7, 0xff, 0xf3, 0xf0,
559 0x61, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
560 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xf0,
565 static char vloop_lbm[]={
566 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
567 0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00,
568 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00,
569 0xfc, 0x03, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
570 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00,
571 0x3c, 0x3c, 0x00, 0x3c, 0x3c, 0x3c, 0x00, 0x3c,
572 0x0c, 0x3c, 0xff, 0x3c, 0x0c, 0x3c, 0xff, 0x3c,
573 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
574 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
575 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
576 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
577 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
578 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
579 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
580 0x00, 0x3c, 0xff, 0x3c, 0x00, 0x3c, 0xff, 0x3c,
581 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
584 static char vloop_lmsk[]={
585 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00,
586 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
587 0xff, 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00,
588 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
589 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff,
590 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
591 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
592 0x0f, 0xff, 0x00, 0xff, 0x0f, 0xff, 0x00, 0xff,
593 0x03, 0x3c, 0x00, 0x3c, 0x03, 0x3c, 0x00, 0x3c,
594 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
595 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
596 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
597 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
598 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
599 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
600 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
605 static BCursor VLoopCursor = {
607 vloop_sbm, vloop_smsk,
611 vloop_lbm, vloop_lmsk,
618 BlenderCursor[BC_VLOOPCURSOR]=&VLoopCursor;
623 /********************** TextEdit Cursor ***********************/
625 static char textedit_sbm[]={
626 0xe0, 0x03, 0x10, 0x04, 0x60, 0x03, 0x40, 0x01,
627 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01,
628 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01,
629 0x40, 0x01, 0x60, 0x03, 0x10, 0x04, 0xe0, 0x03,
632 static char textedit_smsk[]={
633 0xe0, 0x03, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01,
634 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
635 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
636 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xe0, 0x03,
639 static BCursor TextEditCursor = {
641 textedit_sbm, textedit_smsk,
652 BlenderCursor[BC_TEXTEDITCURSOR]=&TextEditCursor;
656 /********************** Paintbrush Cursor ***********************/
658 static char paintbrush_sbm[]={
660 0x00, 0xe0, 0x00, 0x98, 0x00, 0x44, 0x00, 0x42,
661 0x00, 0x21, 0x80, 0x20, 0x40, 0x13, 0x40, 0x17,
662 0xa0, 0x0b, 0x98, 0x05, 0x04, 0x02, 0x02, 0x01,
663 0x02, 0x01, 0x02, 0x01, 0x81, 0x00, 0x7f, 0x00,
669 static char paintbrush_smsk[]={
670 0x00, 0xe0, 0x00, 0xf8, 0x00, 0x7c, 0x00, 0x7e,
671 0x00, 0x3f, 0x80, 0x3f, 0xc0, 0x1f, 0xc0, 0x1f,
672 0xe0, 0x0f, 0xf8, 0x07, 0xfc, 0x03, 0xfe, 0x01,
673 0xfe, 0x01, 0xfe, 0x01, 0xff, 0x00, 0x7f, 0x00,
678 static BCursor PaintBrushCursor = {
680 paintbrush_sbm, paintbrush_smsk,
691 BlenderCursor[BC_PAINTBRUSHCURSOR]=&PaintBrushCursor;
695 /********************** Hand Cursor ***********************/
698 static char hand_sbm[]={
699 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x0d,
700 0x98, 0x6d, 0x98, 0x6d, 0xb0, 0x6d, 0xb0, 0x6d,
701 0xe0, 0x6f, 0xe6, 0x7f, 0xee, 0x7f, 0xfc, 0x3f,
702 0xf8, 0x3f, 0xf0, 0x1f, 0xc0, 0x1f, 0xc0, 0x1f,
705 static char hand_smsk[]={
706 0x00, 0x00, 0x80, 0x01, 0xc0, 0x0f, 0xd8, 0x7f,
707 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xf8, 0xff,
708 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f,
709 0xfc, 0x7f, 0xf8, 0x3f, 0xf0, 0x3f, 0xe0, 0x3f,
713 static BCursor HandCursor = {
726 BlenderCursor[BC_HANDCURSOR]=&HandCursor;
730 /********************** NSEW Scroll Cursor ***********************/
733 static char nsewscroll_sbm[]={
734 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03,
735 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70,
736 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00,
737 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
740 static char nsewscroll_smsk[]={
741 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07,
742 0xc0, 0x03, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8,
743 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0xc0, 0x03,
744 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
748 static BCursor NSEWScrollCursor = {
750 nsewscroll_sbm, nsewscroll_smsk,
761 BlenderCursor[BC_NSEW_SCROLLCURSOR]=&NSEWScrollCursor;
766 /********************** NS Scroll Cursor ***********************/
769 static char nsscroll_sbm[]={
770 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03,
771 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
772 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
773 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
776 static char nsscroll_smsk[]={
777 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07,
778 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
779 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03,
780 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
784 static BCursor NSScrollCursor = {
786 nsscroll_sbm, nsscroll_smsk,
797 BlenderCursor[BC_NS_SCROLLCURSOR]=&NSScrollCursor;
802 /********************** EW Scroll Cursor ***********************/
805 static char ewscroll_sbm[]={
806 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
807 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70,
808 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00,
809 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
812 static char ewscroll_smsk[]={
813 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
814 0x00, 0x00, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8,
815 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0x00, 0x00,
816 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
820 static BCursor EWScrollCursor = {
822 ewscroll_sbm, ewscroll_smsk,
833 BlenderCursor[BC_EW_SCROLLCURSOR]=&EWScrollCursor;
837 /********************** Eyedropper Cursor ***********************/
840 static char eyedropper_sbm[]={
841 0x00, 0x30, 0x00, 0x48, 0x00, 0x85, 0x80, 0x82,
842 0x40, 0x40, 0x80, 0x20, 0x40, 0x11, 0xa0, 0x23,
843 0xd0, 0x15, 0xe8, 0x0a, 0x74, 0x01, 0xb4, 0x00,
844 0x4a, 0x00, 0x35, 0x00, 0x08, 0x00, 0x04, 0x00,
847 static char eyedropper_smsk[]={
848 0x00, 0x30, 0x00, 0x78, 0x00, 0xfd, 0x80, 0xff,
849 0xc0, 0x7f, 0x80, 0x3f, 0xc0, 0x1f, 0xe0, 0x3f,
850 0xf0, 0x1f, 0xf8, 0x0b, 0xfc, 0x01, 0xfc, 0x00,
851 0x7e, 0x00, 0x3f, 0x00, 0x0c, 0x00, 0x04, 0x00,
855 static BCursor EyedropperCursor = {
857 eyedropper_sbm, eyedropper_smsk,
868 BlenderCursor[BC_EYEDROPPER_CURSOR]=&EyedropperCursor;
872 /********************** Put the cursors in the array ***********************/