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