Blender  V2.93
wm_cursors.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2005-2007 Blender Foundation
17  * All rights reserved.
18  */
19 
26 #include <stdio.h>
27 #include <string.h>
28 
29 #include "GHOST_C-api.h"
30 
31 #include "BLI_utildefines.h"
32 
33 #include "BLI_sys_types.h"
34 
35 #include "DNA_listBase.h"
36 #include "DNA_userdef_types.h"
37 #include "DNA_workspace_types.h"
38 
39 #include "BKE_context.h"
40 #include "BKE_global.h"
41 #include "BKE_main.h"
42 
43 #include "WM_api.h"
44 #include "WM_types.h"
45 #include "wm_cursors.h"
46 #include "wm_window.h"
47 
48 /* Blender custom cursor. */
49 typedef struct BCursor {
50  char *bitmap;
51  char *mask;
52  char hotx;
53  char hoty;
56 
58 
59 /* Blender cursor to GHOST standard cursor conversion. */
61 {
62  switch (curs) {
63  case WM_CURSOR_DEFAULT:
65  case WM_CURSOR_WAIT:
67  case WM_CURSOR_EDIT:
68  case WM_CURSOR_CROSS:
70  case WM_CURSOR_X_MOVE:
72  case WM_CURSOR_Y_MOVE:
74  case WM_CURSOR_COPY:
76  case WM_CURSOR_HAND:
78  case WM_CURSOR_H_SPLIT:
80  case WM_CURSOR_V_SPLIT:
82  case WM_CURSOR_STOP:
84  case WM_CURSOR_KNIFE:
94  case WM_CURSOR_N_ARROW:
96  case WM_CURSOR_S_ARROW:
98  case WM_CURSOR_PAINT:
100  case WM_CURSOR_DOT:
102  case WM_CURSOR_CROSSC:
104  case WM_CURSOR_ERASER:
106  case WM_CURSOR_ZOOM_IN:
108  case WM_CURSOR_ZOOM_OUT:
110  case WM_CURSOR_TEXT_EDIT:
114  case WM_CURSOR_E_ARROW:
116  case WM_CURSOR_W_ARROW:
118  default:
120  }
121 }
122 
124  wmWindow *win, const uchar mask[16][2], const uchar bitmap[16][2], int hotx, int hoty)
125 {
127  win->ghostwin, (GHOST_TUns8 *)bitmap, (GHOST_TUns8 *)mask, 16, 16, hotx, hoty, true);
128 }
129 
130 static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor)
131 {
133  (GHOST_TUns8 *)cursor->bitmap,
134  (GHOST_TUns8 *)cursor->mask,
135  16,
136  16,
137  cursor->hotx,
138  cursor->hoty,
139  cursor->can_invert_color);
140 }
141 
142 void WM_cursor_set(wmWindow *win, int curs)
143 {
144  if (win == NULL || G.background) {
145  return; /* Can't set custom cursor before Window init */
146  }
147 
148  if (curs == WM_CURSOR_DEFAULT && win->modalcursor) {
149  curs = win->modalcursor;
150  }
151 
152  if (curs == WM_CURSOR_NONE) {
154  return;
155  }
156 
158 
159  if (win->cursor == curs) {
160  return; /* Cursor is already set */
161  }
162 
163  win->cursor = curs;
164 
165  if (curs < 0 || curs >= WM_CURSOR_NUM) {
166  BLI_assert(!"Invalid cursor number");
167  return;
168  }
169 
171 
172  if (ghost_cursor != GHOST_kStandardCursorCustom &&
173  GHOST_HasCursorShape(win->ghostwin, ghost_cursor)) {
174  /* Use native GHOST cursor when available. */
175  GHOST_SetCursorShape(win->ghostwin, ghost_cursor);
176  }
177  else {
178  BCursor *bcursor = BlenderCursor[curs];
179  if (bcursor) {
180  /* Use custom bitmap cursor. */
181  window_set_custom_cursor_ex(win, bcursor);
182  }
183  else {
184  /* Fallback to default cursor if no bitmap found. */
186  }
187  }
188 }
189 
190 bool WM_cursor_set_from_tool(struct wmWindow *win, const ScrArea *area, const ARegion *region)
191 {
192  if (region && (region->regiontype != RGN_TYPE_WINDOW)) {
193  return false;
194  }
195 
196  bToolRef_Runtime *tref_rt = (area && area->runtime.tool) ? area->runtime.tool->runtime : NULL;
197  if (tref_rt && tref_rt->cursor != WM_CURSOR_DEFAULT) {
198  if (win->modalcursor == 0) {
199  WM_cursor_set(win, tref_rt->cursor);
200  win->cursor = tref_rt->cursor;
201  return true;
202  }
203  }
204  return false;
205 }
206 
207 void WM_cursor_modal_set(wmWindow *win, int val)
208 {
209  if (win->lastcursor == 0) {
210  win->lastcursor = win->cursor;
211  }
212  win->modalcursor = val;
213  WM_cursor_set(win, val);
214 }
215 
217 {
218  win->modalcursor = 0;
219  if (win->lastcursor) {
220  WM_cursor_set(win, win->lastcursor);
221  }
222  win->lastcursor = 0;
223 }
224 
225 /* to allow usage all over, we do entire WM */
226 void WM_cursor_wait(bool val)
227 {
228  if (!G.background) {
229  wmWindowManager *wm = G_MAIN->wm.first;
230  wmWindow *win = wm ? wm->windows.first : NULL;
231 
232  for (; win; win = win->next) {
233  if (val) {
235  }
236  else {
238  }
239  }
240  }
241 }
242 
246 void WM_cursor_grab_enable(wmWindow *win, int wrap, bool hide, int bounds[4])
247 {
248  /* Only grab cursor when not running debug.
249  * It helps not to get a stuck WM when hitting a break-point. */
252 
253  if (bounds) {
256  }
257 
258  if (hide) {
259  mode = GHOST_kGrabHide;
260  }
261  else if (wrap) {
262  mode = GHOST_kGrabWrap;
263 
264  if (wrap == WM_CURSOR_WRAP_X) {
265  mode_axis = GHOST_kAxisX;
266  }
267  if (wrap == WM_CURSOR_WRAP_Y) {
268  mode_axis = GHOST_kGrabAxisY;
269  }
270  }
271 
272  if ((G.debug & G_DEBUG) == 0) {
273  if (win->ghostwin) {
274  if (win->eventstate->tablet.is_motion_absolute == false) {
275  GHOST_SetCursorGrab(win->ghostwin, mode, mode_axis, bounds, NULL);
276  }
277 
278  win->grabcursor = mode;
279  }
280  }
281 }
282 
283 void WM_cursor_grab_disable(wmWindow *win, const int mouse_ungrab_xy[2])
284 {
285  if ((G.debug & G_DEBUG) == 0) {
286  if (win && win->ghostwin) {
287  if (mouse_ungrab_xy) {
288  int mouse_xy[2] = {mouse_ungrab_xy[0], mouse_ungrab_xy[1]};
289  wm_cursor_position_to_ghost(win, &mouse_xy[0], &mouse_xy[1]);
292  }
293  else {
295  }
296 
298  }
299  }
300 }
301 
302 static void wm_cursor_warp_relative(wmWindow *win, int x, int y)
303 {
304  /* note: don't use wmEvent coords because of continuous grab T36409. */
305  int cx, cy;
306  wm_cursor_position_get(win, &cx, &cy);
307  WM_cursor_warp(win, cx + x, cy + y);
308 }
309 
310 /* give it a modal keymap one day? */
311 bool wm_cursor_arrow_move(wmWindow *win, const wmEvent *event)
312 {
313  if (win && event->val == KM_PRESS) {
314  /* Must move at least this much to avoid rounding in WM_cursor_warp. */
315  float fac = GHOST_GetNativePixelSize(win->ghostwin);
316 
317  if (event->type == EVT_UPARROWKEY) {
318  wm_cursor_warp_relative(win, 0, fac);
319  return 1;
320  }
321  if (event->type == EVT_DOWNARROWKEY) {
322  wm_cursor_warp_relative(win, 0, -fac);
323  return 1;
324  }
325  if (event->type == EVT_LEFTARROWKEY) {
326  wm_cursor_warp_relative(win, -fac, 0);
327  return 1;
328  }
329  if (event->type == EVT_RIGHTARROWKEY) {
330  wm_cursor_warp_relative(win, fac, 0);
331  return 1;
332  }
333  }
334  return 0;
335 }
336 
337 /* after this you can call restore too */
338 void WM_cursor_time(wmWindow *win, int nr)
339 {
340  /* 10 8x8 digits */
341  const char number_bitmaps[10][8] = {
342  {0, 56, 68, 68, 68, 68, 68, 56},
343  {0, 24, 16, 16, 16, 16, 16, 56},
344  {0, 60, 66, 32, 16, 8, 4, 126},
345  {0, 124, 32, 16, 56, 64, 66, 60},
346  {0, 32, 48, 40, 36, 126, 32, 32},
347  {0, 124, 4, 60, 64, 64, 68, 56},
348  {0, 56, 4, 4, 60, 68, 68, 56},
349  {0, 124, 64, 32, 16, 8, 8, 8},
350  {0, 60, 66, 66, 60, 66, 66, 60},
351  {0, 56, 68, 68, 120, 64, 68, 56},
352  };
353  uchar mask[16][2];
354  uchar bitmap[16][2] = {{0}};
355 
356  if (win->lastcursor == 0) {
357  win->lastcursor = win->cursor;
358  }
359 
360  memset(&mask, 0xFF, sizeof(mask));
361 
362  /* print number bottom right justified */
363  for (int idx = 3; nr && idx >= 0; idx--) {
364  const char *digit = number_bitmaps[nr % 10];
365  int x = idx % 2;
366  int y = idx / 2;
367 
368  for (int i = 0; i < 8; i++) {
369  bitmap[i + y * 8][x] = digit[i];
370  }
371  nr /= 10;
372  }
373 
374  window_set_custom_cursor(win, mask, bitmap, 7, 7);
375  /* Unset current cursor value so it's properly reset to wmWindow.lastcursor. */
376  win->cursor = 0;
377 }
378 
410 #define BEGIN_CURSOR_BLOCK \
411  { \
412  ((void)0)
413 #define END_CURSOR_BLOCK \
414  } \
415  ((void)0)
416 
418 {
419  /********************** NW_ARROW Cursor **************************/
421  static char nw_bitmap[] = {
422  0x00, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x1e, 0x00, 0x3e,
423  0x00, 0x7e, 0x00, 0xfe, 0x00, 0xfe, 0x01, 0xfe, 0x03, 0xfe, 0x07,
424  0x7e, 0x00, 0x6e, 0x00, 0xc6, 0x00, 0xc2, 0x00, 0x00, 0x00,
425  };
426 
427  static char nw_mask[] = {
428  0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x3f, 0x00, 0x7f,
429  0x00, 0xff, 0x00, 0xff, 0x01, 0xff, 0x03, 0xff, 0x07, 0xff, 0x0f,
430  0xff, 0x0f, 0xff, 0x00, 0xef, 0x01, 0xe7, 0x01, 0xc3, 0x00,
431  };
432 
433  static BCursor NWArrowCursor = {
434  nw_bitmap,
435  nw_mask,
436  0,
437  0,
438  true,
439  };
440 
441  BlenderCursor[WM_CURSOR_DEFAULT] = &NWArrowCursor;
442  BlenderCursor[WM_CURSOR_COPY] = &NWArrowCursor;
443  BlenderCursor[WM_CURSOR_NW_ARROW] = &NWArrowCursor;
445 
446  /************************ NS_ARROW Cursor *************************/
448  static char ns_bitmap[] = {
449  0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0x80,
450  0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00,
451  0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00, 0x00, 0x00,
452  };
453 
454  static char ns_mask[] = {
455  0x80, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f, 0xfc,
456  0x1f, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xfc, 0x1f,
457  0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00,
458  };
459 
460  static BCursor NSArrowCursor = {
461  ns_bitmap,
462  ns_mask,
463  7,
464  7,
465  true,
466  };
467 
468  BlenderCursor[WM_CURSOR_Y_MOVE] = &NSArrowCursor;
469  BlenderCursor[WM_CURSOR_NS_ARROW] = &NSArrowCursor;
471 
472  /********************** EW_ARROW Cursor *************************/
474  static char ew_bitmap[] = {
475  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x18,
476  0x18, 0x1c, 0x38, 0xfe, 0x7f, 0x1c, 0x38, 0x18, 0x18, 0x10, 0x08,
477  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
478  };
479 
480  static char ew_mask[] = {
481  0x00, 0x00, 0x00, 0x00, 0x20, 0x04, 0x30, 0x0c, 0x38, 0x1c, 0x3c,
482  0x3c, 0xfe, 0x7f, 0xff, 0xff, 0xfe, 0x7f, 0x3c, 0x3c, 0x38, 0x1c,
483  0x30, 0x0c, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
484  };
485 
486  static BCursor EWArrowCursor = {
487  ew_bitmap,
488  ew_mask,
489  7,
490  7,
491  true,
492  };
493 
494  BlenderCursor[WM_CURSOR_X_MOVE] = &EWArrowCursor;
495  BlenderCursor[WM_CURSOR_EW_ARROW] = &EWArrowCursor;
497 
498  /********************** Wait Cursor *****************************/
500  static char wait_bitmap[] = {
501  0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0xf0, 0x07, 0xb0, 0x06, 0x60,
502  0x03, 0xc0, 0x01, 0x80, 0x00, 0x80, 0x00, 0xc0, 0x01, 0x60, 0x03,
503  0x30, 0x06, 0x10, 0x04, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00,
504  };
505 
506  static char wait_mask[] = {
507  0xfc, 0x1f, 0xfc, 0x1f, 0xf8, 0x0f, 0xf8, 0x0f, 0xf8, 0x0f, 0xf0,
508  0x07, 0xe0, 0x03, 0xc0, 0x01, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07,
509  0xf8, 0x0f, 0xf8, 0x0f, 0xf8, 0x0f, 0xfc, 0x1f, 0xfc, 0x1f,
510  };
511 
512  static BCursor WaitCursor = {
513  wait_bitmap,
514  wait_mask,
515  7,
516  7,
517  false,
518  };
519 
520  BlenderCursor[WM_CURSOR_WAIT] = &WaitCursor;
522 
523  /********************** Mute Cursor ***********************/
525  static char mute_bitmap[] = {
526  0x00, 0x00, 0x22, 0x00, 0x14, 0x00, 0x08, 0x03, 0x14, 0x03, 0x22,
527  0x03, 0x00, 0x03, 0x00, 0x03, 0xf8, 0x7c, 0xf8, 0x7c, 0x00, 0x03,
528  0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00,
529  };
530 
531  static char mute_mask[] = {
532  0x63, 0x00, 0x77, 0x00, 0x3e, 0x03, 0x1c, 0x03, 0x3e, 0x03, 0x77,
533  0x03, 0x63, 0x03, 0x80, 0x07, 0xfc, 0xfc, 0xfc, 0xfc, 0x80, 0x07,
534  0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
535  };
536 
537  static BCursor MuteCursor = {
538  mute_bitmap,
539  mute_mask,
540  9,
541  8,
542  true,
543  };
544 
545  BlenderCursor[WM_CURSOR_MUTE] = &MuteCursor;
547 
548  /****************** Normal Cross Cursor ************************/
550  static char cross_bitmap[] = {
551  0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80,
552  0x01, 0x00, 0x00, 0x3e, 0x7c, 0x3e, 0x7c, 0x00, 0x00, 0x80, 0x01,
553  0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00,
554  };
555 
556  static char cross_mask[] = {
557  0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0,
558  0x03, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0xff, 0xff, 0xc0, 0x03,
559  0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03,
560  };
561 
562  static BCursor CrossCursor = {
563  cross_bitmap,
564  cross_mask,
565  7,
566  7,
567  false,
568  };
569 
570  BlenderCursor[WM_CURSOR_EDIT] = &CrossCursor;
571  BlenderCursor[WM_CURSOR_CROSS] = &CrossCursor;
573 
574  /****************** Painting Cursor ************************/
576  static char paint_bitmap[] = {
577  0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
578  0x00, 0x00, 0x00, 0x8f, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
579  0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
580  };
581 
582  static char paint_mask[] = {
583  0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0x00, 0x00, 0x00,
584  0x00, 0x8f, 0x78, 0xcf, 0x79, 0x8f, 0x78, 0x00, 0x00, 0x00, 0x00,
585  0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0x00, 0x00,
586  };
587 
588  static BCursor PaintCursor = {
589  paint_bitmap,
590  paint_mask,
591  7,
592  7,
593  false,
594  };
595 
596  BlenderCursor[WM_CURSOR_PAINT] = &PaintCursor;
598 
599  /********************** Dot Cursor ***********************/
601  static char dot_bitmap[] = {
602  0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
603  0x00, 0x00, 0x00, 0x8f, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
604  0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
605  };
606 
607  static char dot_mask[] = {
608  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
609  0x00, 0x80, 0x00, 0xc0, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
610  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
611  };
612 
613  static BCursor DotCursor = {
614  dot_bitmap,
615  dot_mask,
616  7,
617  7,
618  false,
619  };
620 
621  BlenderCursor[WM_CURSOR_DOT] = &DotCursor;
623 
624  /************* Minimal Crosshair Cursor ***************/
626  static char crossc_bitmap[] = {
627  0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
628  0x00, 0x80, 0x00, 0x55, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00,
629  0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
630  };
631 
632  static char crossc_mask[] = {
633  0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80,
634  0x00, 0x80, 0x00, 0x7f, 0x7f, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00,
635  0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
636  };
637 
638  static BCursor CrossCursorC = {
639  crossc_bitmap,
640  crossc_mask,
641  7,
642  7,
643  false,
644  };
645 
646  BlenderCursor[WM_CURSOR_CROSSC] = &CrossCursorC;
648 
649  /********************** Knife Cursor ***********************/
651  static char knife_bitmap[] = {
652  0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00,
653  0x0c, 0x00, 0x06, 0x00, 0x0f, 0x80, 0x07, 0xc0, 0x03, 0xe0, 0x01,
654  0xf0, 0x00, 0x78, 0x00, 0x3c, 0x00, 0x0e, 0x00, 0x00, 0x00,
655  };
656 
657  static char knife_mask[] = {
658  0x00, 0x40, 0x00, 0xe0, 0x00, 0xf0, 0x00, 0x78, 0x00, 0x3c, 0x00,
659  0x1e, 0x00, 0x0f, 0x80, 0x1f, 0xc0, 0x0f, 0xe0, 0x07, 0xf0, 0x03,
660  0xf8, 0x01, 0xfc, 0x00, 0x7e, 0x00, 0x3f, 0x00, 0x0f, 0x00,
661  };
662 
663  static BCursor KnifeCursor = {
664  knife_bitmap,
665  knife_mask,
666  0,
667  15,
668  false,
669  };
670 
671  BlenderCursor[WM_CURSOR_KNIFE] = &KnifeCursor;
673 
674  /********************** Loop Select Cursor ***********************/
676  static char vloop_bitmap[] = {
677  0x00, 0x00, 0x7e, 0x00, 0x3e, 0x00, 0x1e, 0x00, 0xfe, 0xf0, 0x96,
678  0x9f, 0x92, 0x90, 0xf0, 0xf0, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40,
679  0x20, 0x40, 0xf0, 0xf0, 0x90, 0x90, 0x90, 0x9f, 0xf0, 0xf0,
680  };
681 
682  static char vloop_mask[] = {
683  0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00, 0xff, 0xf0, 0xff,
684  0xff, 0xf7, 0xff, 0xf3, 0xf0, 0x61, 0x60, 0x60, 0x60, 0x60, 0x60,
685  0x60, 0x60, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xf0,
686  };
687 
688  static BCursor VLoopCursor = {
689  vloop_bitmap,
690  vloop_mask,
691  0,
692  0,
693  false,
694  };
695 
696  BlenderCursor[WM_CURSOR_VERTEX_LOOP] = &VLoopCursor;
698 
699  /********************** TextEdit Cursor ***********************/
701  static char textedit_bitmap[] = {
702  0x00, 0x00, 0x70, 0x07, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80,
703  0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00,
704  0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x70, 0x07, 0x00, 0x00,
705  };
706 
707  static char textedit_mask[] = {
708  0x70, 0x07, 0xf8, 0x0f, 0xf0, 0x07, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
709  0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
710  0xc0, 0x01, 0xc0, 0x01, 0xf0, 0x07, 0xf8, 0x0f, 0x70, 0x07,
711  };
712 
713  static BCursor TextEditCursor = {
714  textedit_bitmap,
715  textedit_mask,
716  7,
717  7,
718  false,
719  };
720 
721  BlenderCursor[WM_CURSOR_TEXT_EDIT] = &TextEditCursor;
723 
724  /********************** Paintbrush Cursor ***********************/
726  static char paintbrush_bitmap[] = {
727  0x00, 0x00, 0x00, 0x30, 0x00, 0x78, 0x00, 0x74, 0x00, 0x2e, 0x00,
728  0x1f, 0x80, 0x0f, 0xc0, 0x07, 0xe0, 0x03, 0xf0, 0x01, 0xf8, 0x00,
729  0x7c, 0x00, 0x3e, 0x00, 0x1e, 0x00, 0x0e, 0x00, 0x00, 0x00,
730  };
731 
732  static char paintbrush_mask[] = {
733  0x00, 0x30, 0x00, 0x78, 0x00, 0xfc, 0x00, 0xfe, 0x00, 0x7f, 0x80,
734  0x3f, 0xc0, 0x1f, 0xe0, 0x0f, 0xf0, 0x07, 0xf8, 0x03, 0xfc, 0x01,
735  0xfe, 0x00, 0x7f, 0x00, 0x3f, 0x00, 0x1f, 0x00, 0x0f, 0x00,
736  };
737 
738  static BCursor PaintBrushCursor = {
739  paintbrush_bitmap,
740  paintbrush_mask,
741  0,
742  15,
743  false,
744  };
745 
746  BlenderCursor[WM_CURSOR_PAINT_BRUSH] = &PaintBrushCursor;
748 
749  /********************** Eraser Cursor ***********************/
751  static char eraser_bitmap[] = {
752  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
753  0x00, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f, 0xfc, 0x07,
754  0xfe, 0x03, 0xfe, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00,
755  };
756 
757  static char eraser_mask[] = {
758  0x00, 0x00, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x1f, 0x80, 0x3f, 0xc0,
759  0x7f, 0xe0, 0xff, 0xf0, 0x7f, 0xf8, 0x3f, 0xfc, 0x1f, 0xfe, 0x0f,
760  0xff, 0x07, 0xff, 0x03, 0xff, 0x01, 0xff, 0x00, 0x00, 0x00,
761  };
762 
763  static BCursor EraserCursor = {
764  eraser_bitmap,
765  eraser_mask,
766  0,
767  14,
768  false,
769  };
770 
771  BlenderCursor[WM_CURSOR_ERASER] = &EraserCursor;
773 
774  /********************** Hand Cursor ***********************/
776  static char hand_bitmap[] = {
777  0x00, 0x00, 0x80, 0x01, 0x80, 0x0d, 0x98, 0x6d, 0xb8, 0x6d, 0xb0,
778  0x6d, 0xb0, 0x6d, 0xe0, 0x6f, 0xe6, 0x7f, 0xee, 0x7f, 0x7c, 0x35,
779  0x78, 0x35, 0x70, 0x15, 0x60, 0x15, 0xc0, 0x1f, 0xc0, 0x1f,
780  };
781 
782  static char hand_mask[] = {
783  0x80, 0x01, 0xc0, 0x0f, 0xd8, 0x7f, 0xfc, 0xff, 0xfc, 0xff, 0xf8,
784  0xff, 0xf8, 0xff, 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f,
785  0xfc, 0x7f, 0xf8, 0x3f, 0xf0, 0x3f, 0xe0, 0x3f, 0xe0, 0x3f,
786  };
787 
788  static BCursor HandCursor = {
789  hand_bitmap,
790  hand_mask,
791  8,
792  8,
793  false,
794  };
795 
796  BlenderCursor[WM_CURSOR_HAND] = &HandCursor;
798 
799  /********************** NSEW Scroll Cursor ***********************/
801  static char nsewscroll_bitmap[] = {
802  0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0x40, 0x02, 0x00, 0x00, 0x00,
803  0x00, 0x0c, 0x30, 0x06, 0x60, 0x06, 0x60, 0x0c, 0x30, 0x00, 0x00,
804  0x00, 0x00, 0x40, 0x02, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
805  };
806 
807  static char nsewscroll_mask[] = {
808  0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07, 0x40, 0x02, 0x0c,
809  0x30, 0x1e, 0x78, 0x0f, 0xf0, 0x0f, 0xf8, 0x1e, 0x78, 0x0c, 0x30,
810  0x40, 0x02, 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
811  };
812 
813  static BCursor NSEWScrollCursor = {
814  nsewscroll_bitmap,
815  nsewscroll_mask,
816  7,
817  7,
818  true,
819  };
820 
821  BlenderCursor[WM_CURSOR_NSEW_SCROLL] = &NSEWScrollCursor;
823 
824  /********************** NS Scroll Cursor ***********************/
826  static char nsscroll_bitmap[] = {
827  0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0x70, 0x07, 0x20,
828  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x02,
829  0x70, 0x07, 0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00, 0x00, 0x00,
830  };
831 
832  static char nsscroll_mask[] = {
833  0x80, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f, 0x70,
834  0x07, 0x20, 0x02, 0x00, 0x00, 0x00, 0x00, 0x20, 0x02, 0x70, 0x07,
835  0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00,
836  };
837 
838  static BCursor NSScrollCursor = {
839  nsscroll_bitmap,
840  nsscroll_mask,
841  7,
842  7,
843  true,
844  };
845 
846  BlenderCursor[WM_CURSOR_NS_SCROLL] = &NSScrollCursor;
848 
849  /********************** EW Scroll Cursor ***********************/
851  static char ewscroll_bitmap[] = {
852  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38,
853  0x1c, 0x1c, 0x38, 0x0e, 0x70, 0x1c, 0x38, 0x38, 0x1c, 0x10, 0x08,
854  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
855  };
856 
857  static char ewscroll_mask[] = {
858  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c, 0x7c,
859  0x3e, 0x3e, 0x7c, 0x1f, 0xf8, 0x3e, 0x7c, 0x7c, 0x3e, 0x38, 0x1c,
860  0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
861  };
862 
863  static BCursor EWScrollCursor = {
864  ewscroll_bitmap,
865  ewscroll_mask,
866  7,
867  7,
868  true,
869  };
870 
871  BlenderCursor[WM_CURSOR_EW_SCROLL] = &EWScrollCursor;
873 
874  /********************** Eyedropper Cursor ***********************/
876  static char eyedropper_bitmap[] = {
877  0x00, 0x00, 0x00, 0x60, 0x00, 0x70, 0x00, 0x3a, 0x00, 0x17, 0x00,
878  0x0e, 0x00, 0x1d, 0x80, 0x0b, 0xc0, 0x01, 0xe0, 0x00, 0x70, 0x00,
879  0x38, 0x00, 0x1c, 0x00, 0x0c, 0x00, 0x02, 0x00, 0x00, 0x00,
880  };
881 
882  static char eyedropper_mask[] = {
883  0x00, 0x60, 0x00, 0xf0, 0x00, 0xfa, 0x00, 0x7f, 0x80, 0x3f, 0x00,
884  0x1f, 0x80, 0x3f, 0xc0, 0x1f, 0xe0, 0x0b, 0xf0, 0x01, 0xf8, 0x00,
885  0x7c, 0x00, 0x3e, 0x00, 0x1e, 0x00, 0x0f, 0x00, 0x03, 0x00,
886  };
887 
888  static BCursor EyedropperCursor = {
889  eyedropper_bitmap,
890  eyedropper_mask,
891  0,
892  15,
893  false,
894  };
895 
896  BlenderCursor[WM_CURSOR_EYEDROPPER] = &EyedropperCursor;
898 
899  /********************** Swap Area Cursor ***********************/
901  static char swap_bitmap[] = {
902  0xc0, 0xff, 0x40, 0x80, 0x40, 0xbc, 0x40, 0xb8, 0x40, 0xb8, 0x40,
903  0xa4, 0x00, 0x82, 0xfe, 0x81, 0x7e, 0x81, 0xbe, 0xfd, 0xda, 0x01,
904  0xe2, 0x01, 0xe2, 0x01, 0xc2, 0x01, 0xfe, 0x01, 0x00, 0x00,
905  };
906 
907  static char swap_mask[] = {
908  0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, 0xc0,
909  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
910  0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03,
911  };
912 
913  static BCursor SwapCursor = {
914  swap_bitmap,
915  swap_mask,
916  7,
917  7,
918  false,
919  };
920 
921  BlenderCursor[WM_CURSOR_SWAP_AREA] = &SwapCursor;
923 
924  /********************** Vertical Split Cursor ***********************/
926  static char vsplit_bitmap[] = {
927  0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x88,
928  0x11, 0x8c, 0x31, 0x86, 0x61, 0x86, 0x61, 0x8c, 0x31, 0x88, 0x11,
929  0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
930  };
931 
932  static char vsplit_mask[] = {
933  0xe0, 0x07, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc8, 0x13, 0xdc,
934  0x3b, 0xde, 0x7b, 0xcf, 0xf3, 0xcf, 0xf3, 0xde, 0x7b, 0xdc, 0x3b,
935  0xc8, 0x13, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xe0, 0x07,
936  };
937 
938  static BCursor VSplitCursor = {
939  vsplit_bitmap,
940  vsplit_mask,
941  7,
942  7,
943  true,
944  };
945 
946  BlenderCursor[WM_CURSOR_V_SPLIT] = &VSplitCursor;
948 
949  /********************** Horizontal Split Cursor ***********************/
951  static char hsplit_bitmap[] = {
952  0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0x60, 0x06, 0x00, 0x00, 0x00,
953  0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
954  0x00, 0x00, 0x60, 0x06, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
955  };
956 
957  static char hsplit_mask[] = {
958  0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0x60, 0x06, 0x01,
959  0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x80,
960  0x60, 0x06, 0xf0, 0x0f, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
961  };
962 
963  static BCursor HSplitCursor = {
964  hsplit_bitmap,
965  hsplit_mask,
966  7,
967  7,
968  true,
969  };
970 
971  BlenderCursor[WM_CURSOR_H_SPLIT] = &HSplitCursor;
973 
974  /********************** North Arrow Cursor ***********************/
976  static char narrow_bitmap[] = {
977  0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8,
978  0x0f, 0x7c, 0x1f, 0x3e, 0x3e, 0x1c, 0x1c, 0x08, 0x08, 0x00, 0x00,
979  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
980  };
981 
982  static char narrow_mask[] = {
983  0x80, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f, 0xfc,
984  0x1f, 0xfe, 0x3f, 0x7f, 0x7f, 0x3e, 0x3e, 0x1c, 0x1c, 0x08, 0x08,
985  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
986  };
987 
988  static BCursor NArrowCursor = {
989  narrow_bitmap,
990  narrow_mask,
991  7,
992  5,
993  true,
994  };
995 
996  BlenderCursor[WM_CURSOR_N_ARROW] = &NArrowCursor;
998 
999  /********************** South Arrow Cursor ***********************/
1001  static char sarrow_bitmap[] = {
1002  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1003  0x00, 0x08, 0x08, 0x1c, 0x1c, 0x3e, 0x3e, 0x7c, 0x1f, 0xf8, 0x0f,
1004  0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00, 0x00, 0x00,
1005  };
1006 
1007  static char sarrow_mask[] = {
1008  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
1009  0x08, 0x1c, 0x1c, 0x3e, 0x3e, 0x7f, 0x7f, 0xfe, 0x3f, 0xfc, 0x1f,
1010  0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00,
1011  };
1012 
1013  static BCursor SArrowCursor = {
1014  sarrow_bitmap,
1015  sarrow_mask,
1016  7,
1017  10,
1018  true,
1019  };
1020 
1021  BlenderCursor[WM_CURSOR_S_ARROW] = &SArrowCursor;
1023 
1024  /********************** East Arrow Cursor ***********************/
1026  static char earrow_bitmap[] = {
1027  0x00, 0x00, 0x00, 0x01, 0x80, 0x03, 0xc0, 0x07, 0x80, 0x0f, 0x00,
1028  0x1f, 0x00, 0x3e, 0x00, 0x7c, 0x00, 0x3e, 0x00, 0x1f, 0x80, 0x0f,
1029  0xc0, 0x07, 0x80, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
1030  };
1031 
1032  static char earrow_mask[] = {
1033  0x00, 0x01, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0xc0, 0x1f, 0x80,
1034  0x3f, 0x00, 0x7f, 0x00, 0xfe, 0x00, 0x7f, 0x80, 0x3f, 0xc0, 0x1f,
1035  0xe0, 0x0f, 0xc0, 0x07, 0x80, 0x03, 0x00, 0x01, 0x00, 0x00,
1036  };
1037 
1038  static BCursor EArrowCursor = {
1039  earrow_bitmap,
1040  earrow_mask,
1041  10,
1042  7,
1043  true,
1044  };
1045 
1046  BlenderCursor[WM_CURSOR_E_ARROW] = &EArrowCursor;
1048 
1049  /********************** West Arrow Cursor ***********************/
1051  static char warrow_bitmap[] = {
1052  0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x01, 0xf8,
1053  0x00, 0x7c, 0x00, 0x3e, 0x00, 0x7c, 0x00, 0xf8, 0x00, 0xf0, 0x01,
1054  0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
1055  };
1056 
1057  static char warrow_mask[] = {
1058  0x80, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x03, 0xfc,
1059  0x01, 0xfe, 0x00, 0x7f, 0x00, 0xfe, 0x00, 0xfc, 0x01, 0xf8, 0x03,
1060  0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00, 0x00, 0x00,
1061  };
1062 
1063  static BCursor WArrowCursor = {
1064  warrow_bitmap,
1065  warrow_mask,
1066  5,
1067  7,
1068  true,
1069  };
1070 
1071  BlenderCursor[WM_CURSOR_W_ARROW] = &WArrowCursor;
1073 
1074  /********************** Stop Sign Cursor ***********************/
1076  static char stop_bitmap[] = {
1077  0x00, 0x00, 0xe0, 0x07, 0xf8, 0x1f, 0x1c, 0x3c, 0x3c, 0x30, 0x76,
1078  0x70, 0xe6, 0x60, 0xc6, 0x61, 0x86, 0x63, 0x06, 0x67, 0x0e, 0x6e,
1079  0x0c, 0x3c, 0x3c, 0x38, 0xf8, 0x1f, 0xe0, 0x07, 0x00, 0x00,
1080  };
1081 
1082  static char stop_mask[] = {
1083  0xe0, 0x07, 0xf8, 0x1f, 0xfc, 0x3f, 0xfe, 0x7f, 0x7e, 0x7c, 0xff,
1084  0xf8, 0xff, 0xf1, 0xef, 0xf3, 0xcf, 0xf7, 0x8f, 0xff, 0x1f, 0xff,
1085  0x3e, 0x7e, 0xfe, 0x7f, 0xfc, 0x3f, 0xf8, 0x1f, 0xe0, 0x07,
1086  };
1087 
1088  static BCursor StopCursor = {
1089  stop_bitmap,
1090  stop_mask,
1091  7,
1092  7,
1093  false,
1094  };
1095 
1096  BlenderCursor[WM_CURSOR_STOP] = &StopCursor;
1098 
1099  /********************** Zoom In Cursor ***********************/
1101  static char zoomin_bitmap[] = {
1102  0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xf8, 0x03, 0xb8, 0x03, 0xbc,
1103  0x07, 0x0c, 0x06, 0xbc, 0x07, 0xb8, 0x03, 0xf8, 0x0b, 0xe0, 0x14,
1104  0x00, 0x22, 0x00, 0x44, 0x00, 0x88, 0x00, 0x90, 0x00, 0x60,
1105  };
1106 
1107  static char zoomin_mask[] = {
1108  0x00, 0x00, 0xe0, 0x00, 0xf8, 0x03, 0xfc, 0x07, 0xfc, 0x07, 0xfe,
1109  0x0f, 0xfe, 0x0f, 0xfe, 0x0f, 0xfc, 0x07, 0xfc, 0x0f, 0xf8, 0x1f,
1110  0xe0, 0x3e, 0x00, 0x7c, 0x00, 0xf8, 0x00, 0xf0, 0x00, 0x60,
1111  };
1112 
1113  static BCursor ZoomInCursor = {
1114  zoomin_bitmap,
1115  zoomin_mask,
1116  6,
1117  6,
1118  false,
1119  };
1120 
1121  BlenderCursor[WM_CURSOR_ZOOM_IN] = &ZoomInCursor;
1123 
1124  /********************** Zoom Out Cursor ***********************/
1126  static char zoomout_bitmap[] = {
1127  0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xf8, 0x03, 0xf8, 0x03, 0xfc,
1128  0x07, 0x0c, 0x06, 0xfc, 0x07, 0xf8, 0x03, 0xf8, 0x0b, 0xe0, 0x14,
1129  0x00, 0x22, 0x00, 0x44, 0x00, 0x88, 0x00, 0x90, 0x00, 0x60,
1130  };
1131 
1132  static char zoomout_mask[] = {
1133  0x00, 0x00, 0xe0, 0x00, 0xf8, 0x03, 0xfc, 0x07, 0xfc, 0x07, 0xfe,
1134  0x0f, 0xfe, 0x0f, 0xfe, 0x0f, 0xfc, 0x07, 0xfc, 0x0f, 0xf8, 0x1f,
1135  0xe0, 0x3e, 0x00, 0x7c, 0x00, 0xf8, 0x00, 0xf0, 0x00, 0x60,
1136  };
1137 
1138  static BCursor ZoomOutCursor = {
1139  zoomout_bitmap,
1140  zoomout_mask,
1141  6,
1142  6,
1143  false,
1144  };
1145 
1146  BlenderCursor[WM_CURSOR_ZOOM_OUT] = &ZoomOutCursor;
1148 
1149  /********************** Put the cursors in the array ***********************/
1150 }
#define G_MAIN
Definition: BKE_global.h:232
@ G_DEBUG
Definition: BKE_global.h:133
#define BLI_assert(a)
Definition: BLI_assert.h:58
unsigned char uchar
Definition: BLI_sys_types.h:86
These structs are the foundation for all linked lists in the library system.
@ RGN_TYPE_WINDOW
GHOST C-API function and type declarations.
GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle, int visible)
GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle, GHOST_TStandardCursor cursorshape)
GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle, GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, GHOST_TUns8 canInvertColor)
float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_HasCursorShape(GHOST_WindowHandle windowhandle, GHOST_TStandardCursor cursorshape)
GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle, GHOST_TGrabCursorMode mode, GHOST_TAxisFlag warp_axis, int bounds[4], const int mouse_ungrab_xy[2])
GHOST_TStandardCursor
Definition: GHOST_Types.h:222
@ GHOST_kStandardCursorZoomIn
Definition: GHOST_Types.h:244
@ GHOST_kStandardCursorVerticalSplit
Definition: GHOST_Types.h:239
@ GHOST_kStandardCursorCopy
Definition: GHOST_Types.h:261
@ GHOST_kStandardCursorWait
Definition: GHOST_Types.h:230
@ GHOST_kStandardCursorHorizontalSplit
Definition: GHOST_Types.h:240
@ GHOST_kStandardCursorStop
Definition: GHOST_Types.h:250
@ GHOST_kStandardCursorCrosshair
Definition: GHOST_Types.h:232
@ GHOST_kStandardCursorCustom
Definition: GHOST_Types.h:262
@ GHOST_kStandardCursorNSEWScroll
Definition: GHOST_Types.h:247
@ GHOST_kStandardCursorLeftRight
Definition: GHOST_Types.h:252
@ GHOST_kStandardCursorPencil
Definition: GHOST_Types.h:236
@ GHOST_kStandardCursorNSScroll
Definition: GHOST_Types.h:248
@ GHOST_kStandardCursorCrosshairA
Definition: GHOST_Types.h:233
@ GHOST_kStandardCursorUpDown
Definition: GHOST_Types.h:251
@ GHOST_kStandardCursorUpArrow
Definition: GHOST_Types.h:237
@ GHOST_kStandardCursorEyedropper
Definition: GHOST_Types.h:243
@ GHOST_kStandardCursorKnife
Definition: GHOST_Types.h:242
@ GHOST_kStandardCursorMove
Definition: GHOST_Types.h:246
@ GHOST_kStandardCursorCrosshairB
Definition: GHOST_Types.h:234
@ GHOST_kStandardCursorDownArrow
Definition: GHOST_Types.h:238
@ GHOST_kStandardCursorEraser
Definition: GHOST_Types.h:241
@ GHOST_kStandardCursorDefault
Definition: GHOST_Types.h:224
@ GHOST_kStandardCursorEWScroll
Definition: GHOST_Types.h:249
@ GHOST_kStandardCursorRightArrow
Definition: GHOST_Types.h:225
@ GHOST_kStandardCursorCrosshairC
Definition: GHOST_Types.h:235
@ GHOST_kStandardCursorZoomOut
Definition: GHOST_Types.h:245
@ GHOST_kStandardCursorText
Definition: GHOST_Types.h:231
@ GHOST_kStandardCursorLeftArrow
Definition: GHOST_Types.h:226
GHOST_TAxisFlag
Definition: GHOST_Types.h:423
@ GHOST_kAxisX
Definition: GHOST_Types.h:426
@ GHOST_kGrabAxisNone
Definition: GHOST_Types.h:425
@ GHOST_kGrabAxisY
Definition: GHOST_Types.h:427
GHOST_TGrabCursorMode
Definition: GHOST_Types.h:412
@ GHOST_kGrabWrap
Definition: GHOST_Types.h:418
@ GHOST_kGrabDisable
Definition: GHOST_Types.h:414
@ GHOST_kGrabHide
Definition: GHOST_Types.h:420
@ GHOST_kGrabNormal
Definition: GHOST_Types.h:416
unsigned char GHOST_TUns8
Definition: GHOST_Types.h:60
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
@ WM_CURSOR_WRAP_X
Definition: WM_types.h:186
@ WM_CURSOR_WRAP_Y
Definition: WM_types.h:187
#define KM_PRESS
Definition: WM_types.h:242
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition: btDbvt.cpp:299
static void area(int d1, int d2, int e1, int e2, float weights[2])
static GPUContext * wrap(Context *ctx)
short regiontype
char hoty
Definition: wm_cursors.c:53
char * mask
Definition: wm_cursors.c:51
bool can_invert_color
Definition: wm_cursors.c:54
char hotx
Definition: wm_cursors.c:52
char * bitmap
Definition: wm_cursors.c:50
void * first
Definition: DNA_listBase.h:47
short val
Definition: WM_types.h:579
wmTabletData tablet
Definition: WM_types.h:623
short type
Definition: WM_types.h:577
char is_motion_absolute
Definition: WM_types.h:547
struct wmEvent * eventstate
struct wmWindow * next
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
#define G(x, y, z)
void WM_cursor_modal_set(wmWindow *win, int val)
Definition: wm_cursors.c:207
static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor)
Definition: wm_cursors.c:130
void WM_cursor_set(wmWindow *win, int curs)
Definition: wm_cursors.c:142
bool wm_cursor_arrow_move(wmWindow *win, const wmEvent *event)
Definition: wm_cursors.c:311
#define BEGIN_CURSOR_BLOCK
Definition: wm_cursors.c:410
static BCursor * BlenderCursor[WM_CURSOR_NUM]
Definition: wm_cursors.c:57
void WM_cursor_grab_enable(wmWindow *win, int wrap, bool hide, int bounds[4])
Definition: wm_cursors.c:246
static void window_set_custom_cursor(wmWindow *win, const uchar mask[16][2], const uchar bitmap[16][2], int hotx, int hoty)
Definition: wm_cursors.c:123
bool WM_cursor_set_from_tool(struct wmWindow *win, const ScrArea *area, const ARegion *region)
Definition: wm_cursors.c:190
void WM_cursor_modal_restore(wmWindow *win)
Definition: wm_cursors.c:216
static GHOST_TStandardCursor convert_to_ghost_standard_cursor(WMCursorType curs)
Definition: wm_cursors.c:60
void WM_cursor_wait(bool val)
Definition: wm_cursors.c:226
#define END_CURSOR_BLOCK
Definition: wm_cursors.c:413
void WM_cursor_time(wmWindow *win, int nr)
Definition: wm_cursors.c:338
void wm_init_cursor_data(void)
Definition: wm_cursors.c:417
static void wm_cursor_warp_relative(wmWindow *win, int x, int y)
Definition: wm_cursors.c:302
struct BCursor BCursor
void WM_cursor_grab_disable(wmWindow *win, const int mouse_ungrab_xy[2])
Definition: wm_cursors.c:283
WMCursorType
Definition: wm_cursors.h:33
@ WM_CURSOR_WAIT
Definition: wm_cursors.h:36
@ WM_CURSOR_COPY
Definition: wm_cursors.h:39
@ WM_CURSOR_HAND
Definition: wm_cursors.h:40
@ WM_CURSOR_NSEW_SCROLL
Definition: wm_cursors.h:67
@ WM_CURSOR_CROSS
Definition: wm_cursors.h:42
@ WM_CURSOR_DEFAULT
Definition: wm_cursors.h:34
@ WM_CURSOR_H_SPLIT
Definition: wm_cursors.h:56
@ WM_CURSOR_PAINT
Definition: wm_cursors.h:43
@ WM_CURSOR_S_ARROW
Definition: wm_cursors.h:63
@ WM_CURSOR_Y_MOVE
Definition: wm_cursors.h:55
@ WM_CURSOR_TEXT_EDIT
Definition: wm_cursors.h:35
@ WM_CURSOR_PAINT_BRUSH
Definition: wm_cursors.h:49
@ WM_CURSOR_NS_SCROLL
Definition: wm_cursors.h:68
@ WM_CURSOR_EW_ARROW
Definition: wm_cursors.h:61
@ WM_CURSOR_E_ARROW
Definition: wm_cursors.h:64
@ WM_CURSOR_DOT
Definition: wm_cursors.h:44
@ WM_CURSOR_ZOOM_OUT
Definition: wm_cursors.h:72
@ WM_CURSOR_EDIT
Definition: wm_cursors.h:38
@ WM_CURSOR_ZOOM_IN
Definition: wm_cursors.h:71
@ WM_CURSOR_N_ARROW
Definition: wm_cursors.h:62
@ WM_CURSOR_KNIFE
Definition: wm_cursors.h:47
@ WM_CURSOR_NW_ARROW
Definition: wm_cursors.h:59
@ WM_CURSOR_STOP
Definition: wm_cursors.h:37
@ WM_CURSOR_CROSSC
Definition: wm_cursors.h:45
@ WM_CURSOR_EYEDROPPER
Definition: wm_cursors.h:51
@ WM_CURSOR_VERTEX_LOOP
Definition: wm_cursors.h:48
@ WM_CURSOR_ERASER
Definition: wm_cursors.h:50
@ WM_CURSOR_EW_SCROLL
Definition: wm_cursors.h:69
@ WM_CURSOR_V_SPLIT
Definition: wm_cursors.h:57
@ WM_CURSOR_SWAP_AREA
Definition: wm_cursors.h:53
@ WM_CURSOR_MUTE
Definition: wm_cursors.h:75
@ WM_CURSOR_NONE
Definition: wm_cursors.h:74
@ WM_CURSOR_X_MOVE
Definition: wm_cursors.h:54
@ WM_CURSOR_W_ARROW
Definition: wm_cursors.h:65
@ WM_CURSOR_NUM
Definition: wm_cursors.h:78
@ WM_CURSOR_NS_ARROW
Definition: wm_cursors.h:60
@ EVT_DOWNARROWKEY
@ EVT_RIGHTARROWKEY
@ EVT_UPARROWKEY
@ EVT_LEFTARROWKEY
void WM_cursor_warp(wmWindow *win, int x, int y)
Definition: wm_window.c:2091
void wm_cursor_position_to_ghost(wmWindow *win, int *x, int *y)
Definition: wm_window.c:975
void wm_cursor_position_get(wmWindow *win, int *r_x, int *r_y)
Definition: wm_window.c:986