Blender  V2.93
wm_gesture.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) 2008 Blender Foundation.
17  * All rights reserved.
18  */
19 
26 #include "DNA_screen_types.h"
27 #include "DNA_userdef_types.h"
28 #include "DNA_vec_types.h"
30 
31 #include "MEM_guardedalloc.h"
32 
33 #include "BLI_bitmap_draw_2d.h"
34 #include "BLI_blenlib.h"
35 #include "BLI_lasso_2d.h"
36 #include "BLI_math.h"
37 #include "BLI_utildefines.h"
38 
39 #include "BKE_context.h"
40 
41 #include "WM_api.h"
42 #include "WM_types.h"
43 
44 #include "wm.h"
45 #include "wm_draw.h"
46 
47 #include "GPU_immediate.h"
48 #include "GPU_immediate_util.h"
49 #include "GPU_state.h"
50 
51 #include "BIF_glutil.h"
52 
53 /* context checked on having screen, window and area */
54 wmGesture *WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent *event, int type)
55 {
56  wmGesture *gesture = MEM_callocN(sizeof(wmGesture), "new gesture");
57 
58  BLI_addtail(&window->gesture, gesture);
59 
60  gesture->type = type;
61  gesture->event_type = event->type;
62  gesture->winrct = region->winrct;
63  gesture->user_data.use_free = true; /* Free if userdata is set. */
64  gesture->modal_state = GESTURE_MODAL_NOP;
65  gesture->move = false;
66 
67  if (ELEM(type,
73  rcti *rect = MEM_callocN(sizeof(rcti), "gesture rect new");
74 
75  gesture->customdata = rect;
76  rect->xmin = event->x - gesture->winrct.xmin;
77  rect->ymin = event->y - gesture->winrct.ymin;
78  if (type == WM_GESTURE_CIRCLE) {
79  /* caller is responsible for initializing 'xmax' to radius. */
80  }
81  else {
82  rect->xmax = event->x - gesture->winrct.xmin;
83  rect->ymax = event->y - gesture->winrct.ymin;
84  }
85  }
87  short *lasso;
88  gesture->points_alloc = 1024;
89  gesture->customdata = lasso = MEM_mallocN(sizeof(short[2]) * gesture->points_alloc,
90  "lasso points");
91  lasso[0] = event->x - gesture->winrct.xmin;
92  lasso[1] = event->y - gesture->winrct.ymin;
93  gesture->points = 1;
94  }
95 
96  return gesture;
97 }
98 
99 void WM_gesture_end(wmWindow *win, wmGesture *gesture)
100 {
101  if (win->tweak == gesture) {
102  win->tweak = NULL;
103  }
104  BLI_remlink(&win->gesture, gesture);
105  MEM_freeN(gesture->customdata);
107  MEM_freeN(gesture);
108 }
109 
111 {
112  while (win->gesture.first) {
113  WM_gesture_end(win, win->gesture.first);
114  }
115 }
116 
118 {
119  while (win->gesture.first) {
120  WM_gesture_end(win, win->gesture.first);
121  }
122 }
123 
125 {
126  if (gesture == NULL) {
127  return true;
128  }
129  return (gesture->is_active_prev == false);
130 }
131 
132 /* tweak and line gestures */
133 int wm_gesture_evaluate(wmGesture *gesture, const wmEvent *event)
134 {
135  if (gesture->type == WM_GESTURE_TWEAK) {
136  rcti *rect = gesture->customdata;
137  const int delta[2] = {
138  BLI_rcti_size_x(rect),
139  BLI_rcti_size_y(rect),
140  };
141 
142  if (WM_event_drag_test_with_delta(event, delta)) {
143  int theta = round_fl_to_int(4.0f * atan2f((float)delta[1], (float)delta[0]) / (float)M_PI);
144  int val = EVT_GESTURE_W;
145 
146  if (theta == 0) {
147  val = EVT_GESTURE_E;
148  }
149  else if (theta == 1) {
150  val = EVT_GESTURE_NE;
151  }
152  else if (theta == 2) {
153  val = EVT_GESTURE_N;
154  }
155  else if (theta == 3) {
156  val = EVT_GESTURE_NW;
157  }
158  else if (theta == -1) {
159  val = EVT_GESTURE_SE;
160  }
161  else if (theta == -2) {
162  val = EVT_GESTURE_S;
163  }
164  else if (theta == -3) {
165  val = EVT_GESTURE_SW;
166  }
167 
168 #if 0
169  /* debug */
170  if (val == 1) {
171  printf("tweak north\n");
172  }
173  if (val == 2) {
174  printf("tweak north-east\n");
175  }
176  if (val == 3) {
177  printf("tweak east\n");
178  }
179  if (val == 4) {
180  printf("tweak south-east\n");
181  }
182  if (val == 5) {
183  printf("tweak south\n");
184  }
185  if (val == 6) {
186  printf("tweak south-west\n");
187  }
188  if (val == 7) {
189  printf("tweak west\n");
190  }
191  if (val == 8) {
192  printf("tweak north-west\n");
193  }
194 #endif
195  return val;
196  }
197  }
198  return 0;
199 }
200 
201 /* ******************* gesture draw ******************* */
202 
203 static void wm_gesture_draw_line_active_side(rcti *rect, const bool flip)
204 {
208 
211 
212  const float gradient_length = 150.0f * U.pixelsize;
213  float line_dir[2];
214  float gradient_dir[2];
215  float gradient_point[2][2];
216 
217  const float line_start[2] = {rect->xmin, rect->ymin};
218  const float line_end[2] = {rect->xmax, rect->ymax};
219  const float color_line_gradient_start[4] = {0.2f, 0.2f, 0.2f, 0.4f};
220  const float color_line_gradient_end[4] = {0.0f, 0.0f, 0.0f, 0.0f};
221 
222  sub_v2_v2v2(line_dir, line_end, line_start);
223  normalize_v2(line_dir);
224  ortho_v2_v2(gradient_dir, line_dir);
225  if (!flip) {
226  mul_v2_fl(gradient_dir, -1.0f);
227  }
228  mul_v2_fl(gradient_dir, gradient_length);
229  add_v2_v2v2(gradient_point[0], line_start, gradient_dir);
230  add_v2_v2v2(gradient_point[1], line_end, gradient_dir);
231 
233  immAttr4f(shdr_col, UNPACK4(color_line_gradient_start));
234  immVertex2f(shdr_pos, line_start[0], line_start[1]);
235  immAttr4f(shdr_col, UNPACK4(color_line_gradient_start));
236  immVertex2f(shdr_pos, line_end[0], line_end[1]);
237  immAttr4f(shdr_col, UNPACK4(color_line_gradient_end));
238  immVertex2f(shdr_pos, gradient_point[1][0], gradient_point[1][1]);
239 
240  immAttr4f(shdr_col, UNPACK4(color_line_gradient_start));
241  immVertex2f(shdr_pos, line_start[0], line_start[1]);
242  immAttr4f(shdr_col, UNPACK4(color_line_gradient_end));
243  immVertex2f(shdr_pos, gradient_point[1][0], gradient_point[1][1]);
244  immAttr4f(shdr_col, UNPACK4(color_line_gradient_end));
245  immVertex2f(shdr_pos, gradient_point[0][0], gradient_point[0][1]);
246  immEnd();
247 
250 }
251 
253 {
254  rcti *rect = (rcti *)gt->customdata;
255 
256  if (gt->draw_active_side) {
258  }
259 
260  uint shdr_pos = GPU_vertformat_attr_add(
262 
264 
265  float viewport_size[4];
266  GPU_viewport_size_get_f(viewport_size);
267  immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
268 
269  immUniform1i("colors_len", 2); /* "advanced" mode */
271  "colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2);
272  immUniform1f("dash_width", 8.0f);
273  immUniform1f("dash_factor", 0.5f);
274 
275  float xmin = (float)rect->xmin;
276  float ymin = (float)rect->ymin;
277 
279  immVertex2f(shdr_pos, xmin, ymin);
280  immVertex2f(shdr_pos, (float)rect->xmax, (float)rect->ymax);
281  immEnd();
282 
284 }
285 
287 {
288  rcti *rect = (rcti *)gt->customdata;
289 
290  uint shdr_pos = GPU_vertformat_attr_add(
292 
294 
296  immUniformColor4f(1.0f, 1.0f, 1.0f, 0.05f);
297 
298  immRecti(shdr_pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
299 
301 
303 
305 
307 
308  float viewport_size[4];
309  GPU_viewport_size_get_f(viewport_size);
310  immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
311 
312  immUniform1i("colors_len", 2); /* "advanced" mode */
314  "colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2);
315  immUniform1f("dash_width", 8.0f);
316  immUniform1f("dash_factor", 0.5f);
317 
319  shdr_pos, (float)rect->xmin, (float)rect->ymin, (float)rect->xmax, (float)rect->ymax);
320 
322 
323  /* draws a diagonal line in the lined box to test wm_gesture_draw_line */
324  // wm_gesture_draw_line(gt);
325 }
326 
328 {
329  rcti *rect = (rcti *)gt->customdata;
330 
332 
333  const uint shdr_pos = GPU_vertformat_attr_add(
335 
337 
338  immUniformColor4f(1.0f, 1.0f, 1.0f, 0.05f);
339  imm_draw_circle_fill_2d(shdr_pos, (float)rect->xmin, (float)rect->ymin, (float)rect->xmax, 40);
340 
342 
344 
346 
347  float viewport_size[4];
348  GPU_viewport_size_get_f(viewport_size);
349  immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
350 
351  immUniform1i("colors_len", 2); /* "advanced" mode */
353  "colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2);
354  immUniform1f("dash_width", 4.0f);
355  immUniform1f("dash_factor", 0.5f);
356 
357  imm_draw_circle_wire_2d(shdr_pos, (float)rect->xmin, (float)rect->ymin, (float)rect->xmax, 40);
358 
360 }
361 
363  unsigned char *px;
364  int width;
365 };
366 
367 static void draw_filled_lasso_px_cb(int x, int x_end, int y, void *user_data)
368 {
369  struct LassoFillData *data = user_data;
370  unsigned char *col = &(data->px[(y * data->width) + x]);
371  memset(col, 0x10, x_end - x);
372 }
373 
374 static void draw_filled_lasso(wmGesture *gt)
375 {
376  const short *lasso = (short *)gt->customdata;
377  const int mcoords_len = gt->points;
378  int(*mcoords)[2] = MEM_mallocN(sizeof(*mcoords) * (mcoords_len + 1), __func__);
379  int i;
380  rcti rect;
381  const float red[4] = {1.0f, 0.0f, 0.0f, 0.0f};
382 
383  for (i = 0; i < mcoords_len; i++, lasso += 2) {
384  mcoords[i][0] = lasso[0];
385  mcoords[i][1] = lasso[1];
386  }
387 
388  BLI_lasso_boundbox(&rect, (const int(*)[2])mcoords, mcoords_len);
389 
390  BLI_rcti_translate(&rect, gt->winrct.xmin, gt->winrct.ymin);
391  BLI_rcti_isect(&gt->winrct, &rect, &rect);
392  BLI_rcti_translate(&rect, -gt->winrct.xmin, -gt->winrct.ymin);
393 
394  /* Highly unlikely this will fail, but could crash if (mcoords_len == 0). */
395  if (BLI_rcti_is_empty(&rect) == false) {
396  const int w = BLI_rcti_size_x(&rect);
397  const int h = BLI_rcti_size_y(&rect);
398  unsigned char *pixel_buf = MEM_callocN(sizeof(*pixel_buf) * w * h, __func__);
399  struct LassoFillData lasso_fill_data = {pixel_buf, w};
400 
402  rect.ymin,
403  rect.xmax,
404  rect.ymax,
405  (const int(*)[2])mcoords,
406  mcoords_len,
408  &lasso_fill_data);
409 
411 
413  GPU_shader_bind(state.shader);
415  state.shader, GPU_shader_get_uniform(state.shader, "shuffle"), 4, 1, red);
416 
418  &state, rect.xmin, rect.ymin, w, h, GPU_R8, false, pixel_buf, 1.0f, 1.0f, NULL);
419 
421 
422  MEM_freeN(pixel_buf);
423 
425  }
426 
427  MEM_freeN(mcoords);
428 }
429 
430 static void wm_gesture_draw_lasso(wmGesture *gt, bool filled)
431 {
432  const short *lasso = (short *)gt->customdata;
433  int i;
434 
435  if (filled) {
436  draw_filled_lasso(gt);
437  }
438 
439  const int numverts = gt->points;
440 
441  /* Nothing to draw, do early output. */
442  if (numverts < 2) {
443  return;
444  }
445 
446  const uint shdr_pos = GPU_vertformat_attr_add(
448 
450 
451  float viewport_size[4];
452  GPU_viewport_size_get_f(viewport_size);
453  immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
454 
455  immUniform1i("colors_len", 2); /* "advanced" mode */
457  "colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2);
458  immUniform1f("dash_width", 2.0f);
459  immUniform1f("dash_factor", 0.5f);
460 
462 
463  for (i = 0; i < gt->points; i++, lasso += 2) {
464  immVertex2f(shdr_pos, (float)lasso[0], (float)lasso[1]);
465  }
466 
467  immEnd();
468 
470 }
471 
473 {
474  rcti *rect = (rcti *)gt->customdata;
475  const int winsize_x = WM_window_pixels_x(win);
476  const int winsize_y = WM_window_pixels_y(win);
477 
478  float x1, x2, y1, y2;
479 
480  const uint shdr_pos = GPU_vertformat_attr_add(
482 
484 
485  float viewport_size[4];
486  GPU_viewport_size_get_f(viewport_size);
487  immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
488 
489  immUniform1i("colors_len", 2); /* "advanced" mode */
491  "colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2);
492  immUniform1f("dash_width", 8.0f);
493  immUniform1f("dash_factor", 0.5f);
494 
496 
497  x1 = (float)(rect->xmin - winsize_x);
498  y1 = (float)rect->ymin;
499  x2 = (float)(rect->xmin + winsize_x);
500  y2 = y1;
501 
502  immVertex2f(shdr_pos, x1, y1);
503  immVertex2f(shdr_pos, x2, y2);
504 
505  x1 = (float)rect->xmin;
506  y1 = (float)(rect->ymin - winsize_y);
507  x2 = x1;
508  y2 = (float)(rect->ymin + winsize_y);
509 
510  immVertex2f(shdr_pos, x1, y1);
511  immVertex2f(shdr_pos, x2, y2);
512 
513  immEnd();
514 
516 }
517 
518 /* called in wm_draw.c */
520 {
521  wmGesture *gt = (wmGesture *)win->gesture.first;
522 
523  GPU_line_width(1.0f);
524  for (; gt; gt = gt->next) {
525  /* all in subwindow space */
526  wmViewport(&gt->winrct);
527 
528  if (gt->type == WM_GESTURE_RECT) {
530  }
531 #if 0
532  else if (gt->type == WM_GESTURE_TWEAK) {
534  }
535 #endif
536  else if (gt->type == WM_GESTURE_CIRCLE) {
538  }
539  else if (gt->type == WM_GESTURE_CROSS_RECT) {
540  if (gt->is_active) {
542  }
543  else {
544  wm_gesture_draw_cross(win, gt);
545  }
546  }
547  else if (gt->type == WM_GESTURE_LINES) {
548  wm_gesture_draw_lasso(gt, false);
549  }
550  else if (gt->type == WM_GESTURE_LASSO) {
551  wm_gesture_draw_lasso(gt, true);
552  }
553  else if (gt->type == WM_GESTURE_STRAIGHTLINE) {
555  }
556  }
557 }
558 
560 {
561  bScreen *screen = WM_window_get_active_screen(win);
562 
563  if (screen) {
564  screen->do_draw_gesture = true;
565  }
566 }
typedef float(TangentPoint)[2]
void immDrawPixelsTex(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, void *rect, float xzoom, float yzoom, const float color[4])
Definition: glutil.c:298
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin)
Definition: glutil.c:66
void BLI_bitmap_draw_2d_poly_v2i_n(const int xmin, const int ymin, const int xmax, const int ymax, const int verts[][2], const int verts_len, void(*callback)(int x, int x_end, int y, void *), void *user_data)
void BLI_lasso_boundbox(struct rcti *rect, const int mcoords[][2], const unsigned int mcoords_len)
Definition: lasso_2d.c:31
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:133
MINLINE int round_fl_to_int(float a)
#define M_PI
Definition: BLI_math_base.h:38
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
void ortho_v2_v2(float out[2], const float v[2])
Definition: math_vector.c:903
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float normalize_v2(float r[2])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:157
void BLI_rcti_translate(struct rcti *rect, int x, int y)
Definition: rct.c:597
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:153
bool BLI_rcti_is_empty(const struct rcti *rect)
unsigned int uint
Definition: BLI_sys_types.h:83
#define UNPACK4(a)
#define ELEM(...)
void immUniform2f(const char *name, float x, float y)
void immUniformColor4f(float r, float g, float b, float a)
void immUnbindProgram(void)
void immVertex2f(uint attr_id, float x, float y)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
void immUniform1i(const char *name, int x)
void immUniform1f(const char *name, float x)
void immUniformArray4fv(const char *bare_name, const float *data, int count)
void immAttr4f(uint attr_id, float x, float y, float z, float w)
GPUVertFormat * immVertexFormat(void)
void immBegin(GPUPrimType, uint vertex_len)
void immEnd(void)
void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
void immRecti(uint pos, int x1, int y1, int x2, int y2)
void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
_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 GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble y1
_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 GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_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 type
_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
@ GPU_PRIM_LINE_LOOP
Definition: GPU_primitive.h:39
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:36
@ GPU_PRIM_LINE_STRIP
Definition: GPU_primitive.h:38
@ GPU_PRIM_TRIS
Definition: GPU_primitive.h:37
void GPU_shader_unbind(void)
Definition: gpu_shader.cc:516
int GPU_shader_get_uniform(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:551
void GPU_shader_uniform_vector(GPUShader *shader, int location, int length, int arraysize, const float *value)
Definition: gpu_shader.cc:617
void GPU_shader_bind(GPUShader *shader)
Definition: gpu_shader.cc:494
@ GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR
Definition: GPU_shader.h:365
@ GPU_SHADER_2D_SMOOTH_COLOR
Definition: GPU_shader.h:185
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:171
@ GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR
Definition: GPU_shader.h:251
@ GPU_BLEND_ADDITIVE_PREMULT
Definition: GPU_state.h:60
@ GPU_BLEND_NONE
Definition: GPU_state.h:55
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:57
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:55
void GPU_line_width(float width)
Definition: gpu_state.cc:173
void GPU_viewport_size_get_f(float coords[4])
Definition: gpu_state.cc:279
@ GPU_R8
Definition: GPU_texture.h:108
@ GPU_FETCH_FLOAT
@ GPU_FETCH_INT_TO_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
@ GPU_COMP_I32
Read Guarded memory(de)allocation.
#define WM_GESTURE_RECT
Definition: WM_types.h:477
#define WM_GESTURE_STRAIGHTLINE
Definition: WM_types.h:481
#define WM_GESTURE_LINES
Definition: WM_types.h:476
#define WM_GESTURE_LASSO
Definition: WM_types.h:479
#define WM_GESTURE_TWEAK
Definition: WM_types.h:475
#define WM_GESTURE_CIRCLE
Definition: WM_types.h:480
#define WM_GESTURE_CROSS_RECT
Definition: WM_types.h:478
unsigned int U
Definition: btGjkEpa3.h:78
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
void * user_data
uint col
#define atan2f(x, y)
format
Definition: logImageCore.h:47
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
static ulong state[N]
unsigned char * px
Definition: wm_gesture.c:363
void * first
Definition: DNA_listBase.h:47
char do_draw_gesture
int ymin
Definition: DNA_vec_types.h:80
int ymax
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
int xmax
Definition: DNA_vec_types.h:79
int event_type
Definition: WM_types.h:490
uint is_active_prev
Definition: WM_types.h:510
int modal_state
Definition: WM_types.h:499
void * customdata
Definition: WM_types.h:529
int points_alloc
Definition: WM_types.h:498
wmGenericUserData user_data
Definition: WM_types.h:532
uint move
Definition: WM_types.h:514
struct wmGesture * next
Definition: WM_types.h:488
int type
Definition: WM_types.h:492
bool draw_active_side
Definition: WM_types.h:501
uint use_flip
Definition: WM_types.h:520
uint is_active
Definition: WM_types.h:508
rcti winrct
Definition: WM_types.h:494
int points
Definition: WM_types.h:496
struct wmGesture * tweak
bool WM_event_drag_test_with_delta(const wmEvent *event, const int drag_delta[2])
@ GESTURE_MODAL_NOP
@ EVT_GESTURE_NW
@ EVT_GESTURE_SW
@ EVT_GESTURE_W
@ EVT_GESTURE_N
@ EVT_GESTURE_NE
@ EVT_GESTURE_SE
@ EVT_GESTURE_E
@ EVT_GESTURE_S
static void wm_gesture_draw_circle(wmGesture *gt)
Definition: wm_gesture.c:327
static void draw_filled_lasso_px_cb(int x, int x_end, int y, void *user_data)
Definition: wm_gesture.c:367
static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
Definition: wm_gesture.c:472
static void wm_gesture_draw_line_active_side(rcti *rect, const bool flip)
Definition: wm_gesture.c:203
wmGesture * WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent *event, int type)
Definition: wm_gesture.c:54
void wm_gesture_draw(wmWindow *win)
Definition: wm_gesture.c:519
static void wm_gesture_draw_rect(wmGesture *gt)
Definition: wm_gesture.c:286
void wm_gesture_tag_redraw(wmWindow *win)
Definition: wm_gesture.c:559
static void wm_gesture_draw_lasso(wmGesture *gt, bool filled)
Definition: wm_gesture.c:430
static void wm_gesture_draw_line(wmGesture *gt)
Definition: wm_gesture.c:252
int wm_gesture_evaluate(wmGesture *gesture, const wmEvent *event)
Definition: wm_gesture.c:133
bool WM_gesture_is_modal_first(const wmGesture *gesture)
Definition: wm_gesture.c:124
void WM_gestures_free_all(wmWindow *win)
Definition: wm_gesture.c:110
static void draw_filled_lasso(wmGesture *gt)
Definition: wm_gesture.c:374
void WM_gesture_end(wmWindow *win, wmGesture *gesture)
Definition: wm_gesture.c:99
void WM_gestures_remove(wmWindow *win)
Definition: wm_gesture.c:117
void wmViewport(const rcti *winrct)
Definition: wm_subwindow.c:37
void WM_generic_user_data_free(wmGenericUserData *wm_userdata)
Definition: wm_utils.c:59
int WM_window_pixels_y(const wmWindow *win)
Definition: wm_window.c:2136
bScreen * WM_window_get_active_screen(const wmWindow *win)
Definition: wm_window.c:2372
int WM_window_pixels_x(const wmWindow *win)
Definition: wm_window.c:2130