== interface ==
authorMatt Ebb <matt@mke3.net>
Sun, 29 Jan 2006 22:25:53 +0000 (22:25 +0000)
committerMatt Ebb <matt@mke3.net>
Sun, 29 Jan 2006 22:25:53 +0000 (22:25 +0000)
Two new mouse cursors (paintbrush and text I-bar) made by basse (he even made the patch!), inspired by Bart's page.

I also changed screenmain() ever so slightly, so that the standard cursor is always used when the mouse is over a window header.

source/blender/include/BIF_cursors.h
source/blender/include/BIF_graphics.h
source/blender/src/cursors.c
source/blender/src/ghostwinlay.c

index c68c9b607c869528882f2fa399de244b19d38724..b3a285d5b86afb0fc4cfd79b4fc2a36a197e7cd0 100644 (file)
@@ -75,6 +75,8 @@ enum {
        BC_BOXSELCURSOR,
        BC_KNIFECURSOR,
        BC_VLOOPCURSOR,
+       BC_TEXTEDITCURSOR,
+       BC_PAINTBRUSHCURSOR,
 /* --- ALWAYS LAST ----- */
        BC_NUMCURSORS,
 };
index 05e0883e81d546c611dfa8447f3eb34cca3953d0..51aa2ceeb01298ac6b23ad7bde40fc9a47963610 100644 (file)
@@ -48,7 +48,8 @@ enum {
        CURSOR_HELP, 
        CURSOR_STD, 
        CURSOR_NONE,
-       CURSOR_PENCIL
+       CURSOR_PENCIL,
+       CURSOR_TEXTEDIT
 };
 
 void set_cursor(int curs);
index f4d6c8278f7f8cf3e778b73e574aa4f52a2177be..259c1dd09d0627ecf436506ec30161ad2fcaaf5d 100644 (file)
@@ -573,6 +573,78 @@ static char vloop_lmsk[]={
 
 END_CURSOR_BLOCK       
        
+
+       /********************** EditCross Cursor ***********************/       
+BEGIN_CURSOR_BLOCK
+       static char textedit_sbm[]={
+               0xe0,  0x03,  0x10,  0x04,  0x60,  0x03,  0x40,  0x01,
+               0x40,  0x01,  0x40,  0x01,  0x40,  0x01,  0x40,  0x01,
+               0x40,  0x01,  0x40,  0x01,  0x40,  0x01,  0x40,  0x01,
+               0x40,  0x01,  0x60,  0x03,  0x10,  0x04,  0xe0,  0x03,
+       };
+
+       static char textedit_smsk[]={
+               0xe0,  0x03,  0xf0,  0x07,  0xe0,  0x03,  0xc0,  0x01,
+               0xc0,  0x01,  0xc0,  0x01,  0xc0,  0x01,  0xc0,  0x01,
+               0xc0,  0x01,  0xc0,  0x01,  0xc0,  0x01,  0xc0,  0x01,
+               0xc0,  0x01,  0xe0,  0x03,  0xf0,  0x07,  0xe0,  0x03,
+       };
+
+       static BCursor TextEditCursor = {
+               /*small*/
+               textedit_sbm, textedit_smsk,
+               16, 16, 
+               9,  8,
+               /*big*/
+               NULL, NULL,
+               32,32, 
+               15, 15,
+               /*color*/
+               BC_BLACK, BC_WHITE
+       };
+
+       BlenderCursor[BC_TEXTEDITCURSOR]=&TextEditCursor;
+END_CURSOR_BLOCK
+
+
+       /********************** EditCross Cursor ***********************/       
+BEGIN_CURSOR_BLOCK
+       static char paintbrush_sbm[]={
+
+               0x00,  0xe0,  0x00,  0x98,  0x00,  0x44,  0x00,  0x42,
+               0x00,  0x21,  0x80,  0x20,  0x40,  0x13,  0x40,  0x17,
+               0xa0,  0x0b,  0x98,  0x05,  0x04,  0x02,  0x02,  0x01,
+               0x02,  0x01,  0x02,  0x01,  0x81,  0x00,  0x7f,  0x00,
+
+
+
+       };
+
+       static char paintbrush_smsk[]={
+               0x00,  0xe0,  0x00,  0xf8,  0x00,  0x7c,  0x00,  0x7e,
+               0x00,  0x3f,  0x80,  0x3f,  0xc0,  0x1f,  0xc0,  0x1f,
+               0xe0,  0x0f,  0xf8,  0x07,  0xfc,  0x03,  0xfe,  0x01,
+               0xfe,  0x01,  0xfe,  0x01,  0xff,  0x00,  0x7f,  0x00,
+
+
+       };
+
+       static BCursor PaintBrushCursor = {
+               /*small*/
+               paintbrush_sbm, paintbrush_smsk,
+               16, 16, 
+               9,  8,
+               /*big*/
+               NULL, NULL,
+               32,32, 
+               15, 15,
+               /*color*/
+               BC_BLACK, BC_WHITE
+       };
+
+       BlenderCursor[BC_PAINTBRUSHCURSOR]=&PaintBrushCursor;
+END_CURSOR_BLOCK
+
        /********************** Put the cursors in the array ***********************/
        
 }
index 88beb6ea87406caffa3cd0d8e719dc783a2dd67f..e28b604935a46b78046f340c0496a64a009c43e9 100644 (file)
@@ -414,8 +414,11 @@ void window_set_cursor(Window *win, int curs) {
                
                /* detect if we use system cursor or Blender cursor */
                switch(curs) {
+                       case CURSOR_TEXTEDIT:
+                               SetBlenderCursor(BC_TEXTEDITCURSOR);
+                               break;
                        case CURSOR_VPAINT:
-                               SetBlenderCursor(BC_KNIFECURSOR);
+                               SetBlenderCursor(BC_PAINTBRUSHCURSOR);
                                break;
                        default:
                                GHOST_SetCursorShape(win->ghostwin, convert_cursor(curs));