Blender  V3.3
wm_gesture.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. All rights reserved. */
3 
10 #include "DNA_screen_types.h"
11 #include "DNA_userdef_types.h"
12 #include "DNA_vec_types.h"
14 
15 #include "MEM_guardedalloc.h"
16 
17 #include "BLI_bitmap_draw_2d.h"
18 #include "BLI_blenlib.h"
19 #include "BLI_lasso_2d.h"
20 #include "BLI_math.h"
21 #include "BLI_utildefines.h"
22 
23 #include "BKE_context.h"
24 
25 #include "WM_api.h"
26 #include "WM_types.h"
27 
28 #include "wm.h"
29 #include "wm_draw.h"
30 
31 #include "GPU_immediate.h"
32 #include "GPU_immediate_util.h"
33 #include "GPU_state.h"
34 
35 #include "BIF_glutil.h"
36 
37 wmGesture *WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent *event, int type)
38 {
39  wmGesture *gesture = MEM_callocN(sizeof(wmGesture), "new gesture");
40 
41  BLI_addtail(&window->gesture, gesture);
42 
43  gesture->type = type;
44  gesture->event_type = event->type;
45  gesture->event_modifier = event->modifier;
46  gesture->event_keymodifier = event->keymodifier;
47  gesture->winrct = region->winrct;
48  gesture->user_data.use_free = true; /* Free if userdata is set. */
49  gesture->modal_state = GESTURE_MODAL_NOP;
50  gesture->move = false;
51 
52  int xy[2];
53  WM_event_drag_start_xy(event, xy);
54 
55  if (ELEM(type,
60  rcti *rect = MEM_callocN(sizeof(rcti), "gesture rect new");
61 
62  gesture->customdata = rect;
63  rect->xmin = xy[0] - gesture->winrct.xmin;
64  rect->ymin = xy[1] - gesture->winrct.ymin;
65  if (type == WM_GESTURE_CIRCLE) {
66  /* caller is responsible for initializing 'xmax' to radius. */
67  }
68  else {
69  rect->xmax = xy[0] - gesture->winrct.xmin;
70  rect->ymax = xy[1] - gesture->winrct.ymin;
71  }
72  }
74  short *lasso;
75  gesture->points_alloc = 1024;
76  gesture->customdata = lasso = MEM_mallocN(sizeof(short[2]) * gesture->points_alloc,
77  "lasso points");
78  lasso[0] = xy[0] - gesture->winrct.xmin;
79  lasso[1] = xy[1] - gesture->winrct.ymin;
80  gesture->points = 1;
81  }
82 
83  return gesture;
84 }
85 
86 void WM_gesture_end(wmWindow *win, wmGesture *gesture)
87 {
88  BLI_remlink(&win->gesture, gesture);
89  MEM_freeN(gesture->customdata);
91  MEM_freeN(gesture);
92 }
93 
95 {
96  while (win->gesture.first) {
97  WM_gesture_end(win, win->gesture.first);
98  }
99 }
100 
102 {
103  while (win->gesture.first) {
104  WM_gesture_end(win, win->gesture.first);
105  }
106 }
107 
109 {
110  if (gesture == NULL) {
111  return true;
112  }
113  return (gesture->is_active_prev == false);
114 }
115 
116 /* ******************* gesture draw ******************* */
117 
118 static void wm_gesture_draw_line_active_side(rcti *rect, const bool flip)
119 {
123 
126 
127  const float gradient_length = 150.0f * U.pixelsize;
128  float line_dir[2];
129  float gradient_dir[2];
130  float gradient_point[2][2];
131 
132  const float line_start[2] = {rect->xmin, rect->ymin};
133  const float line_end[2] = {rect->xmax, rect->ymax};
134  const float color_line_gradient_start[4] = {0.2f, 0.2f, 0.2f, 0.4f};
135  const float color_line_gradient_end[4] = {0.0f, 0.0f, 0.0f, 0.0f};
136 
137  sub_v2_v2v2(line_dir, line_end, line_start);
138  normalize_v2(line_dir);
139  ortho_v2_v2(gradient_dir, line_dir);
140  if (!flip) {
141  mul_v2_fl(gradient_dir, -1.0f);
142  }
143  mul_v2_fl(gradient_dir, gradient_length);
144  add_v2_v2v2(gradient_point[0], line_start, gradient_dir);
145  add_v2_v2v2(gradient_point[1], line_end, gradient_dir);
146 
148  immAttr4f(shdr_col, UNPACK4(color_line_gradient_start));
149  immVertex2f(shdr_pos, line_start[0], line_start[1]);
150  immAttr4f(shdr_col, UNPACK4(color_line_gradient_start));
151  immVertex2f(shdr_pos, line_end[0], line_end[1]);
152  immAttr4f(shdr_col, UNPACK4(color_line_gradient_end));
153  immVertex2f(shdr_pos, gradient_point[1][0], gradient_point[1][1]);
154 
155  immAttr4f(shdr_col, UNPACK4(color_line_gradient_start));
156  immVertex2f(shdr_pos, line_start[0], line_start[1]);
157  immAttr4f(shdr_col, UNPACK4(color_line_gradient_end));
158  immVertex2f(shdr_pos, gradient_point[1][0], gradient_point[1][1]);
159  immAttr4f(shdr_col, UNPACK4(color_line_gradient_end));
160  immVertex2f(shdr_pos, gradient_point[0][0], gradient_point[0][1]);
161  immEnd();
162 
165 }
166 
168 {
169  rcti *rect = (rcti *)gt->customdata;
170 
171  if (gt->draw_active_side) {
173  }
174 
175  uint shdr_pos = GPU_vertformat_attr_add(
177 
179 
180  float viewport_size[4];
181  GPU_viewport_size_get_f(viewport_size);
182  immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
183 
184  immUniform1i("colors_len", 2); /* "advanced" mode */
185  immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
186  immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
187  immUniform1f("dash_width", 8.0f);
188  immUniform1f("dash_factor", 0.5f);
189 
190  float xmin = (float)rect->xmin;
191  float ymin = (float)rect->ymin;
192 
194  immVertex2f(shdr_pos, xmin, ymin);
195  immVertex2f(shdr_pos, (float)rect->xmax, (float)rect->ymax);
196  immEnd();
197 
199 }
200 
202 {
203  rcti *rect = (rcti *)gt->customdata;
204 
205  uint shdr_pos = GPU_vertformat_attr_add(
207 
209 
211  immUniformColor4f(1.0f, 1.0f, 1.0f, 0.05f);
212 
213  immRecti(shdr_pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
214 
216 
218 
220 
222 
223  float viewport_size[4];
224  GPU_viewport_size_get_f(viewport_size);
225  immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
226 
227  immUniform1i("colors_len", 2); /* "advanced" mode */
228  immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
229  immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
230  immUniform1f("dash_width", 8.0f);
231  immUniform1f("dash_factor", 0.5f);
232 
234  shdr_pos, (float)rect->xmin, (float)rect->ymin, (float)rect->xmax, (float)rect->ymax);
235 
237 
238  /* draws a diagonal line in the lined box to test wm_gesture_draw_line */
239  // wm_gesture_draw_line(gt);
240 }
241 
243 {
244  rcti *rect = (rcti *)gt->customdata;
245 
247 
248  const uint shdr_pos = GPU_vertformat_attr_add(
250 
252 
253  immUniformColor4f(1.0f, 1.0f, 1.0f, 0.05f);
254  imm_draw_circle_fill_2d(shdr_pos, (float)rect->xmin, (float)rect->ymin, (float)rect->xmax, 40);
255 
257 
259 
261 
262  float viewport_size[4];
263  GPU_viewport_size_get_f(viewport_size);
264  immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
265 
266  immUniform1i("colors_len", 2); /* "advanced" mode */
267  immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
268  immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
269  immUniform1f("dash_width", 4.0f);
270  immUniform1f("dash_factor", 0.5f);
271 
272  imm_draw_circle_wire_2d(shdr_pos, (float)rect->xmin, (float)rect->ymin, (float)rect->xmax, 40);
273 
275 }
276 
278  unsigned char *px;
279  int width;
280 };
281 
282 static void draw_filled_lasso_px_cb(int x, int x_end, int y, void *user_data)
283 {
284  struct LassoFillData *data = user_data;
285  unsigned char *col = &(data->px[(y * data->width) + x]);
286  memset(col, 0x10, x_end - x);
287 }
288 
289 static void draw_filled_lasso(wmGesture *gt)
290 {
291  const short *lasso = (short *)gt->customdata;
292  const int mcoords_len = gt->points;
293  int(*mcoords)[2] = MEM_mallocN(sizeof(*mcoords) * (mcoords_len + 1), __func__);
294  int i;
295  rcti rect;
296  const float red[4] = {1.0f, 0.0f, 0.0f, 0.0f};
297 
298  for (i = 0; i < mcoords_len; i++, lasso += 2) {
299  mcoords[i][0] = lasso[0];
300  mcoords[i][1] = lasso[1];
301  }
302 
303  BLI_lasso_boundbox(&rect, mcoords, mcoords_len);
304 
305  BLI_rcti_translate(&rect, gt->winrct.xmin, gt->winrct.ymin);
306  BLI_rcti_isect(&gt->winrct, &rect, &rect);
307  BLI_rcti_translate(&rect, -gt->winrct.xmin, -gt->winrct.ymin);
308 
309  /* Highly unlikely this will fail, but could crash if (mcoords_len == 0). */
310  if (BLI_rcti_is_empty(&rect) == false) {
311  const int w = BLI_rcti_size_x(&rect);
312  const int h = BLI_rcti_size_y(&rect);
313  unsigned char *pixel_buf = MEM_callocN(sizeof(*pixel_buf) * w * h, __func__);
314  struct LassoFillData lasso_fill_data = {pixel_buf, w};
315 
317  rect.ymin,
318  rect.xmax,
319  rect.ymax,
320  mcoords,
321  mcoords_len,
323  &lasso_fill_data);
324 
326 
328  GPU_shader_bind(state.shader);
330  state.shader, GPU_shader_get_uniform(state.shader, "shuffle"), 4, 1, red);
331 
333  &state, rect.xmin, rect.ymin, w, h, GPU_R8, false, pixel_buf, 1.0f, 1.0f, NULL);
334 
336 
337  MEM_freeN(pixel_buf);
338 
340  }
341 
342  MEM_freeN(mcoords);
343 }
344 
345 static void wm_gesture_draw_lasso(wmGesture *gt, bool filled)
346 {
347  const short *lasso = (short *)gt->customdata;
348  int i;
349 
350  if (filled) {
351  draw_filled_lasso(gt);
352  }
353 
354  const int numverts = gt->points;
355 
356  /* Nothing to draw, do early output. */
357  if (numverts < 2) {
358  return;
359  }
360 
361  const uint shdr_pos = GPU_vertformat_attr_add(
363 
365 
366  float viewport_size[4];
367  GPU_viewport_size_get_f(viewport_size);
368  immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
369 
370  immUniform1i("colors_len", 2); /* "advanced" mode */
371  immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
372  immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
373  immUniform1f("dash_width", 2.0f);
374  immUniform1f("dash_factor", 0.5f);
375 
377 
378  for (i = 0; i < gt->points; i++, lasso += 2) {
379  immVertex2f(shdr_pos, (float)lasso[0], (float)lasso[1]);
380  }
381 
382  immEnd();
383 
385 }
386 
388 {
389  rcti *rect = (rcti *)gt->customdata;
390  const int winsize_x = WM_window_pixels_x(win);
391  const int winsize_y = WM_window_pixels_y(win);
392 
393  float x1, x2, y1, y2;
394 
395  const uint shdr_pos = GPU_vertformat_attr_add(
397 
399 
400  float viewport_size[4];
401  GPU_viewport_size_get_f(viewport_size);
402  immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
403 
404  immUniform1i("colors_len", 2); /* "advanced" mode */
405  immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
406  immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
407  immUniform1f("dash_width", 8.0f);
408  immUniform1f("dash_factor", 0.5f);
409 
411 
412  x1 = (float)(rect->xmin - winsize_x);
413  y1 = (float)rect->ymin;
414  x2 = (float)(rect->xmin + winsize_x);
415  y2 = y1;
416 
417  immVertex2f(shdr_pos, x1, y1);
418  immVertex2f(shdr_pos, x2, y2);
419 
420  x1 = (float)rect->xmin;
421  y1 = (float)(rect->ymin - winsize_y);
422  x2 = x1;
423  y2 = (float)(rect->ymin + winsize_y);
424 
425  immVertex2f(shdr_pos, x1, y1);
426  immVertex2f(shdr_pos, x2, y2);
427 
428  immEnd();
429 
431 }
432 
434 {
435  wmGesture *gt = (wmGesture *)win->gesture.first;
436 
437  GPU_line_width(1.0f);
438  for (; gt; gt = gt->next) {
439  /* all in subwindow space */
440  wmViewport(&gt->winrct);
441 
442  if (gt->type == WM_GESTURE_RECT) {
444  }
445  else if (gt->type == WM_GESTURE_CIRCLE) {
447  }
448  else if (gt->type == WM_GESTURE_CROSS_RECT) {
449  if (gt->is_active) {
451  }
452  else {
453  wm_gesture_draw_cross(win, gt);
454  }
455  }
456  else if (gt->type == WM_GESTURE_LINES) {
457  wm_gesture_draw_lasso(gt, false);
458  }
459  else if (gt->type == WM_GESTURE_LASSO) {
460  wm_gesture_draw_lasso(gt, true);
461  }
462  else if (gt->type == WM_GESTURE_STRAIGHTLINE) {
464  }
465  }
466 }
467 
469 {
470  bScreen *screen = WM_window_get_active_screen(win);
471 
472  if (screen) {
473  screen->do_draw_gesture = true;
474  }
475 }
typedef float(TangentPoint)[2]
void immDrawPixelsTexTiled(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:333
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin)
Definition: glutil.c:44
void BLI_bitmap_draw_2d_poly_v2i_n(int xmin, int ymin, int xmax, int ymax, const int verts[][2], 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], unsigned int mcoords_len)
Definition: lasso_2d.c:15
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:100
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:757
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:190
void BLI_rcti_translate(struct rcti *rect, int x, int y)
Definition: rct.c:559
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:186
bool BLI_rcti_is_empty(const struct rcti *rect)
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNPACK4(a)
#define ELEM(...)
void immUniform4f(const char *name, float x, float y, float z, float w)
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 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 y
_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
@ GPU_PRIM_LINE_LOOP
Definition: GPU_primitive.h:23
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:20
@ GPU_PRIM_LINE_STRIP
Definition: GPU_primitive.h:22
@ GPU_PRIM_TRIS
Definition: GPU_primitive.h:21
void GPU_shader_unbind(void)
Definition: gpu_shader.cc:513
int GPU_shader_get_uniform(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:559
void GPU_shader_uniform_vector(GPUShader *shader, int location, int length, int arraysize, const float *value)
Definition: gpu_shader.cc:630
void GPU_shader_bind(GPUShader *shader)
Definition: gpu_shader.cc:491
@ GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR
Definition: GPU_shader.h:349
@ GPU_SHADER_2D_SMOOTH_COLOR
Definition: GPU_shader.h:215
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:201
@ GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR
Definition: GPU_shader.h:281
@ GPU_BLEND_ADDITIVE_PREMULT
Definition: GPU_state.h:65
@ GPU_BLEND_NONE
Definition: GPU_state.h:60
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:62
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:39
void GPU_line_width(float width)
Definition: gpu_state.cc:158
void GPU_viewport_size_get_f(float coords[4])
Definition: gpu_state.cc:259
@ GPU_R8
Definition: GPU_texture.h:107
@ 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.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its red
#define WM_GESTURE_RECT
Definition: WM_types.h:537
#define WM_GESTURE_STRAIGHTLINE
Definition: WM_types.h:541
#define WM_GESTURE_LINES
Definition: WM_types.h:536
#define WM_GESTURE_LASSO
Definition: WM_types.h:539
#define WM_GESTURE_CIRCLE
Definition: WM_types.h:540
#define WM_GESTURE_CROSS_RECT
Definition: WM_types.h:538
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
const int state
format
Definition: logImageCore.h:38
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
unsigned char * px
Definition: wm_gesture.c:278
void * first
Definition: DNA_listBase.h:31
char do_draw_gesture
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63
int event_type
Definition: WM_types.h:549
uint is_active_prev
Definition: WM_types.h:573
int modal_state
Definition: WM_types.h:562
void * customdata
Definition: WM_types.h:592
int points_alloc
Definition: WM_types.h:561
wmGenericUserData user_data
Definition: WM_types.h:595
uint move
Definition: WM_types.h:577
struct wmGesture * next
Definition: WM_types.h:547
int type
Definition: WM_types.h:555
bool draw_active_side
Definition: WM_types.h:564
uint use_flip
Definition: WM_types.h:583
uint is_active
Definition: WM_types.h:571
short event_keymodifier
Definition: WM_types.h:553
uint8_t event_modifier
Definition: WM_types.h:551
rcti winrct
Definition: WM_types.h:557
int points
Definition: WM_types.h:559
int xy[2]
Definition: wm_draw.c:135
void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2])
@ GESTURE_MODAL_NOP
static void wm_gesture_draw_circle(wmGesture *gt)
Definition: wm_gesture.c:242
static void draw_filled_lasso_px_cb(int x, int x_end, int y, void *user_data)
Definition: wm_gesture.c:282
static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
Definition: wm_gesture.c:387
static void wm_gesture_draw_line_active_side(rcti *rect, const bool flip)
Definition: wm_gesture.c:118
wmGesture * WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent *event, int type)
Definition: wm_gesture.c:37
void wm_gesture_draw(wmWindow *win)
Definition: wm_gesture.c:433
static void wm_gesture_draw_rect(wmGesture *gt)
Definition: wm_gesture.c:201
void wm_gesture_tag_redraw(wmWindow *win)
Definition: wm_gesture.c:468
static void wm_gesture_draw_lasso(wmGesture *gt, bool filled)
Definition: wm_gesture.c:345
static void wm_gesture_draw_line(wmGesture *gt)
Definition: wm_gesture.c:167
bool WM_gesture_is_modal_first(const wmGesture *gesture)
Definition: wm_gesture.c:108
void WM_gestures_free_all(wmWindow *win)
Definition: wm_gesture.c:94
static void draw_filled_lasso(wmGesture *gt)
Definition: wm_gesture.c:289
void WM_gesture_end(wmWindow *win, wmGesture *gesture)
Definition: wm_gesture.c:86
void WM_gestures_remove(wmWindow *win)
Definition: wm_gesture.c:101
void wmViewport(const rcti *winrct)
Definition: wm_subwindow.c:21
void WM_generic_user_data_free(wmGenericUserData *wm_userdata)
Definition: wm_utils.c:45
int WM_window_pixels_y(const wmWindow *win)
Definition: wm_window.c:2082
bScreen * WM_window_get_active_screen(const wmWindow *win)
Definition: wm_window.c:2300
int WM_window_pixels_x(const wmWindow *win)
Definition: wm_window.c:2076