diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-26 17:22:04 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-26 17:26:04 +0300 |
commit | da84bd3c117590c6bd981e5c24a0591347d9d689 (patch) | |
tree | 045a16726276668e6ee184e94902a569d0cf9447 /source/blender/windowmanager | |
parent | da63ac5576334d2654856f45b627e1d04f31c134 (diff) |
Cleanup: cursor header file
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_cursors.c | 26 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_cursors.h | 66 |
2 files changed, 47 insertions, 45 deletions
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 38297dbd8ba..96353fc472a 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -45,6 +45,29 @@ #include "wm_cursors.h" #include "wm_window.h" +/* Blender custom cursor. */ +typedef struct BCursor { + char *small_bm; + char *small_mask; + + char small_sizex; + char small_sizey; + char small_hotx; + char small_hoty; + + char *big_bm; + char *big_mask; + + char big_sizex; + char big_sizey; + char big_hotx; + char big_hoty; + + bool can_invert_color; +} BCursor; + +static BCursor *BlenderCursor[WM_CURSOR_NUM] = {0}; + /* Blender cursor to GHOST standard cursor conversion. */ static GHOST_TStandardCursor convert_to_ghost_standard_cursor(WMCursorType curs) { @@ -143,9 +166,6 @@ static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor) } } -/* Cursor Globals */ -static BCursor *BlenderCursor[WM_CURSOR_NUM] = {0}; - void WM_cursor_set(wmWindow *win, int curs) { if (win == NULL || G.background) { diff --git a/source/blender/windowmanager/wm_cursors.h b/source/blender/windowmanager/wm_cursors.h index d13f455c6a8..29d84eeb151 100644 --- a/source/blender/windowmanager/wm_cursors.h +++ b/source/blender/windowmanager/wm_cursors.h @@ -24,63 +24,47 @@ #ifndef __WM_CURSORS_H__ #define __WM_CURSORS_H__ -void wm_init_cursor_data(void); - -// typedef struct BCursor_s BCursor; -typedef struct BCursor { - - char *small_bm; - char *small_mask; - - char small_sizex; - char small_sizey; - char small_hotx; - char small_hoty; - - char *big_bm; - char *big_mask; - - char big_sizex; - char big_sizey; - char big_hotx; - char big_hoty; - - bool can_invert_color; - -} BCursor; +struct wmEvent; +struct wmWindow; typedef enum WMCursorType { WM_CURSOR_DEFAULT = 1, + WM_CURSOR_TEXT_EDIT, WM_CURSOR_WAIT, + WM_CURSOR_STOP, WM_CURSOR_EDIT, - WM_CURSOR_X_MOVE, - WM_CURSOR_Y_MOVE, WM_CURSOR_COPY, - WM_CURSOR_NW_ARROW, - WM_CURSOR_NS_ARROW, - WM_CURSOR_EW_ARROW, + WM_CURSOR_HAND, + WM_CURSOR_CROSS, + WM_CURSOR_CROSSA, + WM_CURSOR_CROSSB, + WM_CURSOR_CROSSC, + WM_CURSOR_KNIFE, WM_CURSOR_VERTEX_LOOP, - WM_CURSOR_TEXT_EDIT, WM_CURSOR_PAINT_BRUSH, - WM_CURSOR_HAND, - WM_CURSOR_NSEW_SCROLL, - WM_CURSOR_NS_SCROLL, - WM_CURSOR_EW_SCROLL, + WM_CURSOR_ERASER, WM_CURSOR_EYEDROPPER, + WM_CURSOR_SWAP_AREA, + WM_CURSOR_X_MOVE, + WM_CURSOR_Y_MOVE, WM_CURSOR_H_SPLIT, WM_CURSOR_V_SPLIT, + + WM_CURSOR_NW_ARROW, + WM_CURSOR_NS_ARROW, + WM_CURSOR_EW_ARROW, WM_CURSOR_N_ARROW, WM_CURSOR_S_ARROW, WM_CURSOR_E_ARROW, WM_CURSOR_W_ARROW, - WM_CURSOR_STOP, - WM_CURSOR_CROSSA, - WM_CURSOR_CROSSB, - WM_CURSOR_CROSSC, - WM_CURSOR_ERASER, + + WM_CURSOR_NSEW_SCROLL, + WM_CURSOR_NS_SCROLL, + WM_CURSOR_EW_SCROLL, + WM_CURSOR_ZOOM_IN, WM_CURSOR_ZOOM_OUT, @@ -90,9 +74,7 @@ typedef enum WMCursorType { WM_CURSOR_NUM, } WMCursorType; -struct wmEvent; -struct wmWindow; - +void wm_init_cursor_data(void); bool wm_cursor_arrow_move(struct wmWindow *win, const struct wmEvent *event); #endif /* __WM_CURSORS_H__ */ |