summaryrefslogtreecommitdiffstats
Unidiff
-rw-r--r--README21
-rw-r--r--TODO3
-rw-r--r--src/Makefile.am27
-rw-r--r--src/controller/actions/pan.c57
-rw-r--r--src/controller/actions/pan.h2
-rw-r--r--src/controller/actions/sel_save.c2
-rw-r--r--src/controller/callbacks/keyboard.c2
-rw-r--r--src/controller/callbacks/mouse.c30
-rw-r--r--src/controller/callbacks/mouse_motion.c19
-rw-r--r--src/controller/callbacks/mouse_motion.h9
-rw-r--r--src/model/base.c417
-rw-r--r--src/model/base.h9
-rw-r--r--src/model/coordinates.h11
-rw-r--r--src/model/data/base.sqc (renamed from src/model/base.sqc)6
-rw-r--r--src/model/selection_info.h37
-rw-r--r--src/model/selection_info_init.c14
-rw-r--r--src/model/selection_info_init.h8
-rw-r--r--src/model/selection_purposes.h17
-rw-r--r--src/model/state/pan_info_init.h8
-rw-r--r--src/model/state/state.h (renamed from src/model/state.h)3
-rw-r--r--src/model/state/zoom_info.h (renamed from src/model/zoom_info.h)0
-rw-r--r--src/model/state/zoom_info_init.c (renamed from src/model/zoom_info_init.c)0
-rw-r--r--src/model/state/zoom_info_init.h (renamed from src/model/zoom_info_init.h)0
-rw-r--r--src/view/geometry.c8
-rw-r--r--src/view/init.c12
-rw-r--r--src/view/state0.h2
-rw-r--r--src/view/view.c4
27 files changed, 179 insertions, 549 deletions
diff --git a/src/controller/callbacks/mouse.c b/src/controller/callbacks/mouse.c
index 16e8b8b..f594c23 100644
--- a/src/controller/callbacks/mouse.c
+++ b/src/controller/callbacks/mouse.c
@@ -9,6 +9,7 @@
9#include "reshape.h"9#include "reshape.h"
10#include <GL/glut.h>10#include <GL/glut.h>
11#include <math.h>11#include <math.h>
12#include <stdio.h>
12#include <stdlib.h>13#include <stdlib.h>
1314
14/*15/*
@@ -19,8 +20,12 @@
19void20void
20mouse (int button, int state, int x, int y)21mouse (int button, int state, int x, int y)
21{22{
23 // Release left button.
22 if (button == GLUT_LEFT_BUTTON && state == GLUT_UP)24 if (button == GLUT_LEFT_BUTTON && state == GLUT_UP)
23 {25 {
26 // Deactive a panning event if one was happening.
27 S.pan.active = false;
28
24 if (S.selection.active && S.selection.purpose == ZOOM)29 if (S.selection.active && S.selection.purpose == ZOOM)
25 {30 {
26 /*31 /*
@@ -41,7 +46,9 @@ mouse (int button, int state, int x, int y)
41 /*46 /*
42 * Complete a selection if one was started and not cancelled.47 * Complete a selection if one was started and not cancelled.
43 */48 */
44 if (S.selection.active && S.selection.purpose == SET)49 if (S.selection.active &&
50 S.selection.purpose == SET &&
51 glutGetModifiers () == GLUT_ACTIVE_CTRL)
45 {52 {
4653
47 /*54 /*
@@ -116,12 +123,31 @@ mouse (int button, int state, int x, int y)
116123
117 }124 }
118125
119 if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN)126 // Begin selection.
127 if (button == GLUT_LEFT_BUTTON &&
128 state == GLUT_DOWN &&
129 glutGetModifiers () == GLUT_ACTIVE_CTRL)
120 {130 {
121 S.selection.active = true;131 S.selection.active = true;
122 S.selection.x = x;132 S.selection.x = x;
123 S.selection.y = y;133 S.selection.y = y;
124 }134 }
125135
136 // Pan.
137 if (button == GLUT_LEFT_BUTTON &&
138 state == GLUT_DOWN &&
139 glutGetModifiers () != GLUT_ACTIVE_CTRL)
140 {
141 /*
142 * Detection of the first point in a panning event.
143 */
144 if (S.pan.active == false)
145 {
146 S.pan.active = true;
147 S.pan.begin[0] = x;
148 S.pan.begin[1] = y;
149 }
150 }
151
126 return;152 return;
127}153}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.