Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-06-07 17:43:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-07 17:43:52 +0300
commit863e395ad8bc0c921a9c836018e2c17262340f46 (patch)
tree1077f0622f1bb560e70324d3f1d4cf54586c4ca7 /source/blender/windowmanager/intern/wm_gesture.c
parente19686a35a7e12204117f871a04e6f6b5a71cc2b (diff)
Cleanup: trailing space for windowmanager
Diffstat (limited to 'source/blender/windowmanager/intern/wm_gesture.c')
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index 1a4381a1275..a0a38c5bc3f 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -65,22 +65,22 @@ wmGesture *WM_gesture_new(bContext *C, const wmEvent *event, int type)
wmWindow *window = CTX_wm_window(C);
ARegion *ar = CTX_wm_region(C);
int sx, sy;
-
+
BLI_addtail(&window->gesture, gesture);
-
+
gesture->type = type;
gesture->event_type = event->type;
gesture->swinid = ar->swinid; /* means only in area-region context! */
gesture->userdata_free = true; /* Free if userdata is set. */
gesture->modal_state = GESTURE_MODAL_NOP;
-
+
wm_subwindow_origin_get(window, gesture->swinid, &sx, &sy);
-
+
if (ELEM(type, WM_GESTURE_RECT, WM_GESTURE_CROSS_RECT, WM_GESTURE_TWEAK,
WM_GESTURE_CIRCLE, WM_GESTURE_STRAIGHTLINE))
{
rcti *rect = MEM_callocN(sizeof(rcti), "gesture rect new");
-
+
gesture->customdata = rect;
rect->xmin = event->x - sx;
rect->ymin = event->y - sy;
@@ -100,14 +100,14 @@ wmGesture *WM_gesture_new(bContext *C, const wmEvent *event, int type)
lasso[1] = event->y - sy;
gesture->points = 1;
}
-
+
return gesture;
}
void WM_gesture_end(bContext *C, wmGesture *gesture)
{
wmWindow *win = CTX_wm_window(C);
-
+
if (win->tweak == gesture)
win->tweak = NULL;
BLI_remlink(&win->gesture, gesture);
@@ -121,7 +121,7 @@ void WM_gesture_end(bContext *C, wmGesture *gesture)
void WM_gestures_remove(bContext *C)
{
wmWindow *win = CTX_wm_window(C);
-
+
while (win->gesture.first)
WM_gesture_end(C, win->gesture.first);
}
@@ -145,7 +145,7 @@ int wm_gesture_evaluate(wmGesture *gesture)
else if (theta == -1) val = EVT_GESTURE_SE;
else if (theta == -2) val = EVT_GESTURE_S;
else if (theta == -3) val = EVT_GESTURE_SW;
-
+
#if 0
/* debug */
if (val == 1) printf("tweak north\n");
@@ -169,7 +169,7 @@ int wm_gesture_evaluate(wmGesture *gesture)
static void wm_gesture_draw_rect(wmGesture *gt)
{
rcti *rect = (rcti *)gt->customdata;
-
+
glEnable(GL_BLEND);
glColor4f(1.0, 1.0, 1.0, 0.05);
glBegin(GL_QUADS);
@@ -179,7 +179,7 @@ static void wm_gesture_draw_rect(wmGesture *gt)
glVertex2s(rect->xmin, rect->ymin);
glEnd();
glDisable(GL_BLEND);
-
+
GPU_basic_shader_bind(GPU_SHADER_LINE | GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR);
glColor3ub(96, 96, 96);
GPU_basic_shader_line_stipple(1, 0xCCCC);
@@ -193,7 +193,7 @@ static void wm_gesture_draw_rect(wmGesture *gt)
static void wm_gesture_draw_line(wmGesture *gt)
{
rcti *rect = (rcti *)gt->customdata;
-
+
GPU_basic_shader_bind(GPU_SHADER_LINE | GPU_SHADER_STIPPLE);
glColor3ub(96, 96, 96);
GPU_basic_shader_line_stipple(1, 0xAAAA);
@@ -203,7 +203,7 @@ static void wm_gesture_draw_line(wmGesture *gt)
sdrawline(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
-
+
}
static void wm_gesture_draw_circle(wmGesture *gt)
@@ -216,7 +216,7 @@ static void wm_gesture_draw_circle(wmGesture *gt)
glColor4f(1.0, 1.0, 1.0, 0.05);
glutil_draw_filled_arc(0.0, M_PI * 2.0, rect->xmax, 40);
glDisable(GL_BLEND);
-
+
// for USE_GLSL works bad because of no relation between lines
GPU_basic_shader_bind(GPU_SHADER_LINE | GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR);
glColor3ub(96, 96, 96);
@@ -225,10 +225,10 @@ static void wm_gesture_draw_circle(wmGesture *gt)
glColor3ub(255, 255, 255);
GPU_basic_shader_line_stipple(1, 0x5555);
glutil_draw_lined_arc(0.0, M_PI * 2.0, rect->xmax, 40);
-
+
GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
glTranslatef(-rect->xmin, -rect->ymin, 0.0f);
-
+
}
struct LassoFillData {
@@ -323,7 +323,7 @@ static void wm_gesture_draw_lasso(wmWindow *win, wmGesture *gt, bool filled)
if (gt->type == WM_GESTURE_LASSO)
glVertex2sv((short *)gt->customdata);
glEnd();
-
+
glColor3ub(255, 255, 255);
GPU_basic_shader_line_stipple(1, 0x5555);
glBegin(GL_LINE_STRIP);
@@ -333,9 +333,9 @@ static void wm_gesture_draw_lasso(wmWindow *win, wmGesture *gt, bool filled)
if (gt->type == WM_GESTURE_LASSO)
glVertex2sv((short *)gt->customdata);
glEnd();
-
+
GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
-
+
}
static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
@@ -349,7 +349,7 @@ static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
GPU_basic_shader_line_stipple(1, 0xCCCC);
sdrawline(rect->xmin - winsize_x, rect->ymin, rect->xmin + winsize_x, rect->ymin);
sdrawline(rect->xmin, rect->ymin - winsize_y, rect->xmin, rect->ymin + winsize_y);
-
+
glColor3ub(255, 255, 255);
GPU_basic_shader_line_stipple(1, 0x3333);
sdrawline(rect->xmin - winsize_x, rect->ymin, rect->xmin + winsize_x, rect->ymin);
@@ -361,12 +361,12 @@ static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
void wm_gesture_draw(wmWindow *win)
{
wmGesture *gt = (wmGesture *)win->gesture.first;
-
+
GPU_basic_shader_line_width(1);
for (; gt; gt = gt->next) {
/* all in subwindow space */
wmSubWindowSet(win, gt->swinid);
-
+
if (gt->type == WM_GESTURE_RECT)
wm_gesture_draw_rect(gt);
// else if (gt->type == WM_GESTURE_TWEAK)
@@ -395,7 +395,7 @@ void wm_gesture_tag_redraw(bContext *C)
wmWindow *win = CTX_wm_window(C);
bScreen *screen = CTX_wm_screen(C);
ARegion *ar = CTX_wm_region(C);
-
+
if (screen)
screen->do_draw_gesture = true;