summaryrefslogtreecommitdiffstats
Unidiff
-rw-r--r--src/model/selection_info.h41
-rw-r--r--src/model/selection_info_init.c12
-rw-r--r--src/model/selection_info_init.h8
-rw-r--r--src/model/selection_purposes.h17
-rw-r--r--src/model/zoom_info.h21
-rw-r--r--src/model/zoom_info_init.c9
-rw-r--r--src/model/zoom_info_init.h8
7 files changed, 116 insertions, 0 deletions
diff --git a/src/model/selection_info.h b/src/model/selection_info.h
new file mode 100644
index 0000000..970ecec
--- a/dev/null
+++ b/src/model/selection_info.h
@@ -0,0 +1,41 @@
1#ifndef SELECTION_INFO_H
2#define SELECTION_INFO_H
3
4#include "selection_purposes.h"
5#include <stdbool.h>
6
7/*
8 * Vertices in the graph.
9 */
10#define ROWS 83905
11
12typedef struct {
13
14 /*
15 * Selection list.
16 */
17 bool set[ROWS];
18
19 /*
20 * A selection is being performed.
21 */
22 bool active;
23
24 /*
25 * Indicate if the user is currently defining a selection.
26 */
27 SELECTION_PURPOSES purpose;
28
29 /*
30 * X coordinate of mouse when selection mode initiated.
31 */
32 int x;
33
34 /*
35 * Y coordinate of mouse when selection mode initiated.
36 */
37 int y;
38
39} SELECTION_INFO;
40
41#endif // SELECTION_INFO_H
diff --git a/src/model/selection_info_init.c b/src/model/selection_info_init.c
new file mode 100644
index 0000000..e01b2b8
--- a/dev/null
+++ b/src/model/selection_info_init.c
@@ -0,0 +1,12 @@
1#include "selection_info_init.h"
2
3void
4selection_info_init (SELECTION_INFO* s)
5{
6 s->active = false;
7 s->purpose = SET;
8 s->x = 0;
9 s->y = 0;
10
11 return;
12}
diff --git a/src/model/selection_info_init.h b/src/model/selection_info_init.h
new file mode 100644
index 0000000..8ce56c5
--- a/dev/null
+++ b/src/model/selection_info_init.h
@@ -0,0 +1,8 @@
1#ifndef SELECTION_INFO_INIT_H
2#define SELECTION_INFO_INIT_H
3
4#include "selection_info.h"
5
6void selection_info_init (SELECTION_INFO* s);
7
8#endif // SELECTION_INFO_INIT_H
diff --git a/src/model/selection_purposes.h b/src/model/selection_purposes.h
new file mode 100644
index 0000000..12d6ec7
--- a/dev/null
+++ b/src/model/selection_purposes.h
@@ -0,0 +1,17 @@
1#ifndef SELECTION_PURPOSES_H
2#define SELECTION_PURPOSES_H
3
4typedef enum
5 {
6 /*
7 * The selection will define a new set.
8 */
9 SET,
10
11 /*
12 * The selection will define a zoom region.
13 */
14 ZOOM
15 } SELECTION_PURPOSES;
16
17#endif // SELECTION_PURPOSES_H
diff --git a/src/model/zoom_info.h b/src/model/zoom_info.h
new file mode 100644
index 0000000..0b935c8
--- a/dev/null
+++ b/src/model/zoom_info.h
@@ -0,0 +1,21 @@
1#ifndef ZOOM_INFO_H
2#define ZOOM_INFO_H
3
4#include <stdbool.h>
5
6/*
7 * Maintain information for zooming.
8 */
9typedef struct {
10 /*
11 * A zoomed region has been selection.
12 */
13 bool active;
14
15 /*
16 * Left, right, bottom and top of zoom region in world coordinates.
17 */
18 double coords[4];
19} ZOOM_INFO;
20
21#endif // ZOOM_INFO_H
diff --git a/src/model/zoom_info_init.c b/src/model/zoom_info_init.c
new file mode 100644
index 0000000..c5a3b1d
--- a/dev/null
+++ b/src/model/zoom_info_init.c
@@ -0,0 +1,9 @@
1#include "zoom_info_init.h"
2
3void
4zoom_info_init (ZOOM_INFO* z)
5{
6 z->active = false;
7
8 return;
9}
diff --git a/src/model/zoom_info_init.h b/src/model/zoom_info_init.h
new file mode 100644
index 0000000..262d408
--- a/dev/null
+++ b/src/model/zoom_info_init.h
@@ -0,0 +1,8 @@
1#ifndef ZOOM_INFO_INIT_H
2#define ZOOM_INFO_INIT_H
3
4#include "zoom_info.h"
5
6void zoom_info_init (ZOOM_INFO* z);
7
8#endif // ZOOM_INFO_INIT_H

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.