diff options
author | Harley Acheson <harley> | 2019-02-21 19:22:51 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-21 20:03:34 +0300 |
commit | 86bbadaaee949f39f28436ff65c65ae6b194a3c3 (patch) | |
tree | 53599ee21d7619d693a0ffa8dbd720ff589959bc | |
parent | a1e531ebbdc55d25be3f995e15ecb10571fd85d7 (diff) |
UI: improve corner splitting feedback by showing custom cursors.
* Two cursors for horizontal and vertical split.
* Four cursors for each join direction.
* One cursor to indicate when splitting is not possible.
Differential Revision: https://developer.blender.org/D4264
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 76 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_cursors.c | 506 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_cursors.h | 9 |
3 files changed, 564 insertions, 27 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 236c167904f..f28e58fca5f 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -940,12 +940,11 @@ static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event) /* Movement in dominant direction. */ const int delta_max = max_ii(ABS(delta_x), ABS(delta_y)); - /* Movement in secondary direction. */ - const int delta_min = min_ii(ABS(delta_x), ABS(delta_y)); - /* Movement required in dominant direction. */ - const int delta_threshold = (0.2 * U.widget_unit); - /* Must be over threshold and 2:1 ratio or more. */ - const int delta_okay = (delta_max > delta_threshold) && (delta_min * 2 <= delta_max); + + /* Movement in dominant direction before action taken. */ + const int join_threshold = (0.6 * U.widget_unit); + const int split_threshold = (1.2 * U.widget_unit); + const int area_threshold = (0.1 * U.widget_unit); /* Calculate gesture cardinal direction. */ if (delta_y > ABS(delta_x)) @@ -958,18 +957,41 @@ static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event) sad->gesture_dir = 'w'; if (sad->az->type == AZONE_AREA) { - const wmWindow *win = CTX_wm_window(C); + wmWindow *win = CTX_wm_window(C); rcti screen_rect; WM_window_screen_rect_calc(win, &screen_rect); - /* once we drag outside the actionzone, register a gesture - * check we're not on an edge so join finds the other area */ - is_gesture = (delta_okay && (screen_actionzone_find_xy(sc, &event->x) != sad->az) && - (screen_geom_area_map_find_active_scredge( - AREAMAP_FROM_SCREEN(sc), &screen_rect, event->x, event->y) == NULL)); + + /* Have we dragged off the zone and are not on an edge? */ + if ((ED_area_actionzone_find_xy(sad->sa1, &event->x) != sad->az) && + (screen_geom_area_map_find_active_scredge( + AREAMAP_FROM_SCREEN(sc), &screen_rect, event->x, event->y) == NULL)) { + /* Are we still in same area? */ + if (BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, event->x, event->y) == sad->sa1) { + /* Same area, so possible split. */ + WM_cursor_set(win, (ELEM(sad->gesture_dir, 'n', 's')) ? BC_V_SPLITCURSOR : BC_H_SPLITCURSOR); + is_gesture = (delta_max > split_threshold); + } + else { + /* Different area, so posible join. */ + if (sad->gesture_dir == 'n') + WM_cursor_set(win, BC_N_ARROWCURSOR); + else if (sad->gesture_dir == 's') + WM_cursor_set(win, BC_S_ARROWCURSOR); + else if (sad->gesture_dir == 'e') + WM_cursor_set(win, BC_E_ARROWCURSOR); + else + WM_cursor_set(win, BC_W_ARROWCURSOR); + is_gesture = (delta_max > join_threshold); + } + } + else { + WM_cursor_set(CTX_wm_window(C), BC_CROSSCURSOR); + is_gesture = false; + } } else { - is_gesture = delta_okay; + is_gesture = (delta_max > area_threshold); } /* gesture is large enough? */ @@ -1919,7 +1941,7 @@ static void area_split_preview_update_cursor(bContext *C, wmOperator *op) { wmWindow *win = CTX_wm_window(C); int dir = RNA_enum_get(op->ptr, "direction"); - WM_cursor_set(win, (dir == 'v') ? CURSOR_X_MOVE : CURSOR_Y_MOVE); + WM_cursor_set(win, (dir == 'n' || dir == 's') ? BC_V_SPLITCURSOR : BC_H_SPLITCURSOR); } /* UI callback, adds new handler */ @@ -3019,7 +3041,6 @@ static int area_join_init(bContext *C, wmOperator *op) sAreaJoinData *jd = NULL; int x1, y1; int x2, y2; - int shared = 0; /* required properties, make negative to get return 0 if not set by caller */ x1 = RNA_int_get(op->ptr, "min_x"); @@ -3043,16 +3064,6 @@ static int area_join_init(bContext *C, wmOperator *op) return 0; } - /* do areas share an edge? */ - if (sa1->v1 == sa2->v1 || sa1->v1 == sa2->v2 || sa1->v1 == sa2->v3 || sa1->v1 == sa2->v4) shared++; - if (sa1->v2 == sa2->v1 || sa1->v2 == sa2->v2 || sa1->v2 == sa2->v3 || sa1->v2 == sa2->v4) shared++; - if (sa1->v3 == sa2->v1 || sa1->v3 == sa2->v2 || sa1->v3 == sa2->v3 || sa1->v3 == sa2->v4) shared++; - if (sa1->v4 == sa2->v1 || sa1->v4 == sa2->v2 || sa1->v4 == sa2->v3 || sa1->v4 == sa2->v4) shared++; - if (shared != 2) { - printf("areas don't share edge\n"); - return 0; - } - jd = (sAreaJoinData *)MEM_callocN(sizeof(sAreaJoinData), "op_area_join"); jd->sa1 = sa1; @@ -3159,6 +3170,7 @@ static void area_join_cancel(bContext *C, wmOperator *op) static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event) { bScreen *sc = CTX_wm_screen(C); + wmWindow *win = CTX_wm_window(C); sAreaJoinData *jd = (sAreaJoinData *)op->customdata; /* execute the events */ @@ -3167,7 +3179,7 @@ static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event) case MOUSEMOVE: { ScrArea *sa = BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, event->x, event->y); - int dir; + int dir = -1; if (sa) { if (jd->sa1 != sa) { @@ -3211,6 +3223,18 @@ static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event) WM_event_add_notifier(C, NC_WINDOW, NULL); } } + + if (dir == 1) + WM_cursor_set(win, BC_N_ARROWCURSOR); + else if (dir == 3) + WM_cursor_set(win, BC_S_ARROWCURSOR); + else if (dir == 2) + WM_cursor_set(win, BC_E_ARROWCURSOR); + else if (dir == 0) + WM_cursor_set(win, BC_W_ARROWCURSOR); + else + WM_cursor_set(win, BC_STOPCURSOR); + break; } case LEFTMOUSE: diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 10f6a55c4ab..b0d74458bb7 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -1094,6 +1094,512 @@ BEGIN_CURSOR_BLOCK BlenderCursor[BC_SWAPAREA_CURSOR] = &SwapCursor; END_CURSOR_BLOCK + +/********************** Horizontal Split Cursor ***********************/ +BEGIN_CURSOR_BLOCK + + static char hsplit_sbm[] = { + 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, + 0x80, 0x00, 0x88, 0x08, 0x8C, 0x18, 0x8E, 0x38, + 0x8C, 0x18, 0x88, 0x08, 0x80, 0x00, 0x80, 0x00, + 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char hsplit_smsk[] = { + 0xC0, 0x01, 0xC0, 0x01, 0xC0, 0x01, 0xD0, 0x05, + 0xD8, 0x0D, 0xDC, 0x1D, 0xDE, 0x3D, 0xDF, 0x7D, + 0xDE, 0x3D, 0xDC, 0x1D, 0xD8, 0x0D, 0xD0, 0x05, + 0xC0, 0x01, 0xC0, 0x01, 0xC0, 0x01, 0x00, 0x00 + }; + + static char hsplit_lbm[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0x84, 0x21, 0x00, 0x00, 0x86, 0x61, 0x00, + 0x00, 0x87, 0xE1, 0x00, 0x80, 0x87, 0xE1, 0x01, + 0xC0, 0x87, 0xE1, 0x03, 0xE0, 0x87, 0xE1, 0x07, + 0xF0, 0x87, 0xE1, 0x0F, 0xF8, 0x87, 0xE1, 0x1F, + 0xF0, 0x87, 0xE1, 0x0F, 0xE0, 0x87, 0xE1, 0x07, + 0xC0, 0x87, 0xE1, 0x03, 0x80, 0x87, 0xE1, 0x01, + 0x00, 0x87, 0xE1, 0x00, 0x00, 0x86, 0x61, 0x00, + 0x00, 0x84, 0x21, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char hsplit_lmsk[] = { + 0x00, 0xC0, 0x03, 0x00, 0x00, 0xC0, 0x03, 0x00, + 0x00, 0xC0, 0x03, 0x00, 0x00, 0xC0, 0x03, 0x00, + 0x00, 0xC0, 0x03, 0x00, 0x00, 0xC8, 0x13, 0x00, + 0x00, 0xCC, 0x33, 0x00, 0x00, 0xCE, 0x73, 0x00, + 0x00, 0xCF, 0xF3, 0x00, 0x80, 0xCF, 0xF3, 0x01, + 0xC0, 0xCF, 0xF3, 0x03, 0xE0, 0xCF, 0xF3, 0x07, + 0xF0, 0xCF, 0xF3, 0x0F, 0xF8, 0xCF, 0xF3, 0x1F, + 0xFC, 0xCF, 0xF3, 0x3F, 0xFE, 0xCF, 0xF3, 0x7F, + 0xFC, 0xCF, 0xF3, 0x3F, 0xF8, 0xCF, 0xF3, 0x1F, + 0xF0, 0xCF, 0xF3, 0x0F, 0xE0, 0xCF, 0xF3, 0x07, + 0xC0, 0xCF, 0xF3, 0x03, 0x80, 0xCF, 0xF3, 0x01, + 0x00, 0xCF, 0xF3, 0x00, 0x00, 0xCE, 0x73, 0x00, + 0x00, 0xCC, 0x33, 0x00, 0x00, 0xC8, 0x13, 0x00, + 0x00, 0xC8, 0x03, 0x00, 0x00, 0xC0, 0x03, 0x00, + 0x00, 0xC0, 0x03, 0x00, 0x00, 0xC0, 0x03, 0x00, + 0x00, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static BCursor HSplitCursor = { + /*small*/ + hsplit_sbm, hsplit_smsk, + 16, 16, + 7, 7, + /*big*/ + hsplit_lbm, hsplit_lmsk, + 32, 32, + 15, 15, + /*color*/ + BC_BLACK, BC_WHITE + }; + + BlenderCursor[BC_H_SPLITCURSOR] = &HSplitCursor; + +END_CURSOR_BLOCK + +/********************** Vertical Split Cursor ***********************/ +BEGIN_CURSOR_BLOCK + + static char vsplit_sbm[] = { + 0x00, 0x00, 0x80, 0x00, 0xC0, 0x01, 0xE0, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x3F, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x03, + 0xC0, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char vsplit_smsk[] = { + 0x80, 0x00, 0xC0, 0x01, 0xE0, 0x03, 0xF0, 0x07, + 0xF8, 0x0F, 0x00, 0x00, 0xFF, 0x7F, 0xFF, 0x7F, + 0xFF, 0x7F, 0x00, 0x00, 0xF8, 0x0F, 0xF0, 0x07, + 0xE0, 0x03, 0xC0, 0x01, 0x80, 0x00, 0x00, 0x00 + }; + + static char vsplit_lbm[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x00, 0xC0, 0x01, 0x00, 0x00, 0xE0, 0x03, 0x00, + 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x0F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x3F, + 0xFE, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF0, 0x07, 0x00, + 0x00, 0xE0, 0x03, 0x00, 0x00, 0xC0, 0x01, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char vsplit_lmsk[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x00, 0xC0, 0x01, 0x00, 0x00, 0xE0, 0x03, 0x00, + 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x0F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0xFF, 0x00, + 0xC0, 0xFF, 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, + 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xE0, 0xFF, 0xFF, 0x03, 0xC0, 0xFF, 0xFF, 0x01, + 0x80, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x7F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF0, 0x07, 0x00, + 0x00, 0xE0, 0x03, 0x00, 0x00, 0xC0, 0x01, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static BCursor VSplitCursor = { + /*small*/ + vsplit_sbm, vsplit_smsk, + 16, 16, + 7, 7, + /*big*/ + vsplit_lbm, vsplit_lmsk, + 32, 32, + 15, 15, + /*color*/ + BC_BLACK, BC_WHITE + }; + + BlenderCursor[BC_V_SPLITCURSOR] = &VSplitCursor; + +END_CURSOR_BLOCK + +/********************** North Arrow Cursor ***********************/ +BEGIN_CURSOR_BLOCK + + static char narrow_sbm[] = { + 0x00, 0x00, 0x80, 0x00, 0xC0, 0x01, 0xE0, 0x03, + 0xF0, 0x07, 0xF8, 0x0F, 0xFC, 0x1F, 0xE0, 0x03, + 0xE0, 0x03, 0xE0, 0x03, 0xE0, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char narrow_smsk[] = { + 0x80, 0x00, 0xC0, 0x01, 0xE0, 0x03, 0xF0, 0x07, + 0xF8, 0x0F, 0xFC, 0x1F, 0xFE, 0x3F, 0xFF, 0x7F, + 0xF0, 0x07, 0xF0, 0x07, 0xF0, 0x07, 0xF0, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char narrow_lbm[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0xC0, 0x01, 0x00, + 0x00, 0xE0, 0x03, 0x00, 0x00, 0xF0, 0x07, 0x00, + 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFF, 0x7F, 0x00, + 0x80, 0xFF, 0xFF, 0x00, 0xC0, 0xFF, 0xFF, 0x01, + 0xE0, 0xFF, 0xFF, 0x03, 0xF0, 0xFF, 0xFF, 0x07, + 0xF8, 0xFF, 0xFF, 0x0F, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char narrow_lmsk[] = { + 0x00, 0x80, 0x00, 0x00, 0x00, 0xC0, 0x01, 0x00, + 0x00, 0xE0, 0x03, 0x00, 0x00, 0xF0, 0x07, 0x00, + 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFF, 0x7F, 0x00, + 0x80, 0xFF, 0xFF, 0x00, 0xC0, 0xFF, 0xFF, 0x01, + 0xE0, 0xFF, 0xFF, 0x03, 0xF0, 0xFF, 0xFF, 0x07, + 0xF8, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x1F, + 0xFE, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x7F, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static BCursor NArrowCursor = { + /*small*/ + narrow_sbm, narrow_smsk, + 16, 16, + 7, 4, + /*big*/ + narrow_lbm, narrow_lmsk, + 32, 32, + 15, 10, + /*color*/ + BC_BLACK, BC_WHITE + }; + + BlenderCursor[BC_N_ARROWCURSOR] = &NArrowCursor; + +END_CURSOR_BLOCK + +/********************** South Arrow Cursor ***********************/ +BEGIN_CURSOR_BLOCK + + static char sarrow_sbm[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0x03, 0xE0, 0x03, 0xE0, 0x03, + 0xE0, 0x03, 0xFC, 0x1F, 0xF8, 0x0F, 0xF0, 0x07, + 0xE0, 0x03, 0xC0, 0x01, 0x80, 0x00, 0x00, 0x00 + }; + + static char sarrow_smsk[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xF0, 0x07, 0xF0, 0x07, 0xF0, 0x07, 0xF0, 0x07, + 0xFF, 0x7F, 0xFE, 0x3F, 0xFC, 0x1F, 0xF8, 0x0F, + 0xF0, 0x07, 0xE0, 0x03, 0xC0, 0x01, 0x80, 0x00 + }; + + static char sarrow_lbm[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xFC, 0x1F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0xF8, 0xFF, 0xFF, 0x0F, + 0xF0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0x03, + 0xC0, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0x00, + 0x00, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xF8, 0x0F, 0x00, + 0x00, 0xF0, 0x07, 0x00, 0x00, 0xE0, 0x03, 0x00, + 0x00, 0xC0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char sarrow_lmsk[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0xFF, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, 0x3F, + 0xFC, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, 0x0F, + 0xF0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0x03, + 0xC0, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0x00, + 0x00, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0x3F, 0x00, + 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xF8, 0x0F, 0x00, + 0x00, 0xF0, 0x07, 0x00, 0x00, 0xE0, 0x03, 0x00, + 0x00, 0xC0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00 + }; + + static BCursor SArrowCursor = { + /*small*/ + sarrow_sbm, sarrow_smsk, + 16, 16, + 7, 11, + /*big*/ + sarrow_lbm, sarrow_lmsk, + 32, 32, + 15, 21, + /*color*/ + BC_BLACK, BC_WHITE + }; + + BlenderCursor[BC_S_ARROWCURSOR] = &SArrowCursor; + +END_CURSOR_BLOCK + +/********************** East Arrow Cursor ***********************/ +BEGIN_CURSOR_BLOCK + + static char earrow_sbm[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, + 0x00, 0x0E, 0xE0, 0x1F, 0xE0, 0x3F, 0xE0, 0x7F, + 0xE0, 0x3F, 0xE0, 0x1F, 0x00, 0x0E, 0x00, 0x06, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char earrow_smsk[] = { + 0x00, 0x01, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0F, + 0xF0, 0x1F, 0xF0, 0x3F, 0xF0, 0x7F, 0xF0, 0xFF, + 0xF0, 0x7F, 0xF0, 0x3F, 0xF0, 0x1F, 0x00, 0x0F, + 0x00, 0x07, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00 + }; + + static char earrow_lbm[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0E, 0x00, + 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x3E, 0x00, + 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0xFE, 0x00, + 0x00, 0xFF, 0xFF, 0x01, 0x00, 0xFF, 0xFF, 0x03, + 0x00, 0xFF, 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0x0F, + 0x00, 0xFF, 0xFF, 0x1F, 0x00, 0xFF, 0xFF, 0x3F, + 0x00, 0xFF, 0xFF, 0x1F, 0x00, 0xFF, 0xFF, 0x0F, + 0x00, 0xFF, 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0x03, + 0x00, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xFE, 0x00, + 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x3E, 0x00, + 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x0E, 0x00, + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char earrow_lmsk[] = { + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0F, 0x00, + 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x3F, 0x00, + 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x00, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0x03, + 0x80, 0xFF, 0xFF, 0x07, 0x80, 0xFF, 0xFF, 0x0F, + 0x80, 0xFF, 0xFF, 0x1F, 0x80, 0xFF, 0xFF, 0x3F, + 0x80, 0xFF, 0xFF, 0x7F, 0x80, 0xFF, 0xFF, 0xFF, + 0x80, 0xFF, 0xFF, 0x7F, 0x80, 0xFF, 0xFF, 0x3F, + 0x80, 0xFF, 0xFF, 0x1F, 0x80, 0xFF, 0xFF, 0x0F, + 0x80, 0xFF, 0xFF, 0x07, 0x80, 0xFF, 0xFF, 0x03, + 0x00, 0x00, 0xFF, 0x01, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x3F, 0x00, + 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x0F, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static BCursor EArrowCursor = { + /*small*/ + earrow_sbm, earrow_smsk, + 16, 16, + 11, 7, + /*big*/ + earrow_lbm, earrow_lmsk, + 32, 32, + 15, 22, + /*color*/ + BC_BLACK, BC_WHITE + }; + + BlenderCursor[BC_E_ARROWCURSOR] = &EArrowCursor; + +END_CURSOR_BLOCK + +/********************** West Arrow Cursor ***********************/ +BEGIN_CURSOR_BLOCK + + static char warrow_sbm[] = { + 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x00, + 0x70, 0x00, 0xF8, 0x07, 0xFC, 0x07, 0xFE, 0x07, + 0xFC, 0x07, 0xF8, 0x07, 0x70, 0x00, 0x60, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char warrow_smsk[] = { + 0x80, 0x00, 0xC0, 0x00, 0xE0, 0x00, 0xF0, 0x00, + 0xF8, 0x0F, 0xFC, 0x0F, 0xFE, 0x0F, 0xFF, 0x0F, + 0xFE, 0x0F, 0xFC, 0x0F, 0xF8, 0x0F, 0xF0, 0x00, + 0xE0, 0x00, 0xC0, 0x00, 0x80, 0x00, 0x00, 0x00 + }; + + static char warrow_lbm[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, 0x60, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x78, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, + 0x00, 0x7E, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, + 0x80, 0xFF, 0xFF, 0x00, 0xC0, 0xFF, 0xFF, 0x00, + 0xE0, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0x00, + 0xF8, 0xFF, 0xFF, 0x00, 0xFC, 0xFF, 0xFF, 0x00, + 0xF8, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0x00, + 0xE0, 0xFF, 0xFF, 0x00, 0xC0, 0xFF, 0xFF, 0x00, + 0x80, 0xFF, 0xFF, 0x00, 0x00, 0x7F, 0x00, 0x00, + 0x00, 0x7E, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, + 0x00, 0x78, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x60, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char warrow_lmsk[] = { + 0x00, 0x80, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, + 0x00, 0xE0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x00, 0xF8, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, + 0x00, 0xFE, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x80, 0xFF, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0x01, + 0xE0, 0xFF, 0xFF, 0x01, 0xF0, 0xFF, 0xFF, 0x01, + 0xF8, 0xFF, 0xFF, 0x01, 0xFC, 0xFF, 0xFF, 0x01, + 0xFE, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0x01, + 0xFE, 0xFF, 0xFF, 0x01, 0xFC, 0xFF, 0xFF, 0x01, + 0xF8, 0xFF, 0xFF, 0x01, 0xF0, 0xFF, 0xFF, 0x01, + 0xE0, 0xFF, 0xFF, 0x01, 0xC0, 0xFF, 0xFF, 0x01, + 0x80, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x00, 0xFE, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, + 0x00, 0xF8, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x00, 0xE0, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static BCursor WArrowCursor = { + /*small*/ + warrow_sbm, warrow_smsk, + 16, 16, + 4, 7, + /*big*/ + warrow_lbm, warrow_lmsk, + 32, 32, + 15, 15, + /*color*/ + BC_BLACK, BC_WHITE + }; + + BlenderCursor[BC_W_ARROWCURSOR] = &WArrowCursor; + +END_CURSOR_BLOCK + + +/********************** Stop Sign Cursor ***********************/ +BEGIN_CURSOR_BLOCK + + static char stop_sbm[] = { + 0x00, 0x00, 0xE0, 0x07, 0x38, 0x1C, 0x1C, 0x30, + 0x3C, 0x20, 0x76, 0x60, 0xE2, 0x40, 0xC2, 0x41, + 0x82, 0x43, 0x02, 0x47, 0x06, 0x6E, 0x04, 0x3C, + 0x0C, 0x38, 0x38, 0x1C, 0xE0, 0x07, 0x00, 0x00 + }; + + static char stop_smsk[] = { + 0xE0, 0x07, 0xF8, 0x1F, 0xFC, 0x3F, 0x3E, 0x7C, + 0x7E, 0x70, 0xFF, 0xF0, 0xF7, 0xE1, 0xE7, 0xE3, + 0xC7, 0xE7, 0x87, 0xEF, 0x0F, 0xFF, 0x0E, 0x7E, + 0x3E, 0x7C, 0xFC, 0x3F, 0xF8, 0x1F, 0xE0, 0x07 + }; + + static char stop_lbm[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, + 0x00, 0xFE, 0x7F, 0x00, 0x00, 0x0F, 0xF0, 0x00, + 0xC0, 0x03, 0xC0, 0x03, 0xE0, 0x01, 0x00, 0x07, + 0xF0, 0x01, 0x00, 0x0E, 0xF0, 0x01, 0x00, 0x0C, + 0xF8, 0x03, 0x00, 0x18, 0x1C, 0x07, 0x00, 0x38, + 0x0C, 0x0E, 0x00, 0x30, 0x0C, 0x1C, 0x00, 0x30, + 0x06, 0x38, 0x00, 0x60, 0x06, 0x70, 0x00, 0x60, + 0x06, 0xE0, 0x00, 0x60, 0x06, 0xC0, 0x01, 0x60, + 0x06, 0x80, 0x03, 0x60, 0x06, 0x00, 0x07, 0x60, + 0x06, 0x00, 0x0E, 0x60, 0x06, 0x00, 0x1C, 0x60, + 0x0C, 0x00, 0x38, 0x30, 0x0C, 0x00, 0x70, 0x30, + 0x1C, 0x00, 0xE0, 0x38, 0x18, 0x00, 0xC0, 0x1F, + 0x30, 0x00, 0x80, 0x0F, 0x70, 0x00, 0x80, 0x0F, + 0xE0, 0x00, 0x80, 0x07, 0xC0, 0x03, 0xC0, 0x03, + 0x00, 0x0F, 0xF0, 0x00, 0x00, 0xFE, 0x7F, 0x00, + 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char stop_lmsk[] = { + 0x00, 0xF0, 0x0F, 0x00, 0x00, 0xFE, 0x7F, 0x00, + 0x80, 0xFF, 0xFF, 0x01, 0xC0, 0xFF, 0xFF, 0x03, + 0xE0, 0x1F, 0xF8, 0x07, 0xF0, 0x03, 0xC0, 0x0F, + 0xF8, 0x03, 0x80, 0x1F, 0xFC, 0x07, 0x00, 0x3F, + 0xFC, 0x0F, 0x00, 0x3E, 0xFE, 0x1F, 0x00, 0x7C, + 0x9E, 0x3F, 0x00, 0x78, 0x1E, 0x7F, 0x00, 0x78, + 0x1F, 0xFE, 0x00, 0xF8, 0x0F, 0xFC, 0x01, 0xF0, + 0x0F, 0xF8, 0x03, 0xF0, 0x0F, 0xF0, 0x07, 0xF0, + 0x0F, 0xE0, 0x0F, 0xF0, 0x0F, 0xC0, 0x1F, 0xF0, + 0x0F, 0x80, 0x3F, 0xF0, 0x1F, 0x00, 0x7F, 0xF8, + 0x1E, 0x00, 0xFE, 0x78, 0x1E, 0x00, 0xFC, 0x79, + 0x3E, 0x00, 0xF8, 0x7F, 0x7C, 0x00, 0xF0, 0x3F, + 0xFC, 0x00, 0xE0, 0x3F, 0xF8, 0x01, 0xC0, 0x1F, + 0xF0, 0x03, 0xC0, 0x0F, 0xE0, 0x1F, 0xF8, 0x07, + 0xC0, 0xFF, 0xFF, 0x03, 0x80, 0xFF, 0xFF, 0x01, + 0x00, 0xFE, 0x7F, 0x00, 0x00, 0xF0, 0x0F, 0x00 + }; + + static BCursor StopCursor = { + /*small*/ + stop_sbm, stop_smsk, + 16, 16, + 7, 7, + /*big*/ + stop_lbm, stop_lmsk, + 32, 32, + 15, 15, + /*color*/ + BC_BLACK, BC_WHITE + }; + + BlenderCursor[BC_STOPCURSOR] = &StopCursor; + +END_CURSOR_BLOCK + /********************** Put the cursors in the array ***********************/ } diff --git a/source/blender/windowmanager/wm_cursors.h b/source/blender/windowmanager/wm_cursors.h index b43dc1f9a13..e42213bf362 100644 --- a/source/blender/windowmanager/wm_cursors.h +++ b/source/blender/windowmanager/wm_cursors.h @@ -86,7 +86,14 @@ enum { BC_EW_SCROLLCURSOR, BC_EYEDROPPER_CURSOR, BC_SWAPAREA_CURSOR, -/* --- ALWAYS LAST ----- */ + BC_H_SPLITCURSOR, + BC_V_SPLITCURSOR, + BC_N_ARROWCURSOR, + BC_S_ARROWCURSOR, + BC_E_ARROWCURSOR, + BC_W_ARROWCURSOR, + BC_STOPCURSOR, + /* --- ALWAYS LAST ----- */ BC_NUMCURSORS, }; |