annotate src/geo.c @ 847:dfe28355bded

Fix the location of the text elements.
author wycc
date Sun, 19 Sep 2010 19:28:33 +0800
parents 586e50f82c1f
children
rev   line source
822
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 235
diff changeset
1 // -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 4; -*-
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 235
diff changeset
2 // vim: sw=4:ts=8:sts=4
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
3 /*! \brief Determine who should be re-drawed.
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
4 * \file
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5 * When part of graphic are chagned, not mater size, shape, or position,
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6 * the components effected or overlaid should be re-drawed. This module
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
7 * figures out components that should be re-drawed.
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 */
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9 #include <stdio.h>
18
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 17
diff changeset
10 #include <string.h>
186
530bb7728546 Move header files to $(top_srcdir)/include/ and prefixed with 'mb_'.
Thinker K.F. Li <thinker@branda.to>
parents: 185
diff changeset
11 #include "mb_types.h"
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
12
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
13 static int is_scale_overlay(co_aix x1, co_aix w1, co_aix x2, co_aix w2) {
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
14 if(x1 > x2) {
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
15 if((x1 - x2) >= w2)
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
16 return 0;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
17 } else {
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
18 if((x2 - x1) >= w1)
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
19 return 0;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
20 }
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
21 return 1;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
22 }
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
23
235
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
24 static int _areas_are_overlay(area_t *r1, area_t *r2) {
143
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
25 if(is_scale_overlay(r1->x, r1->w, r2->x, r2->w) &&
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
26 is_scale_overlay(r1->y, r1->h, r2->y, r2->h))
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
27 return 1;
822
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 235
diff changeset
28
143
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
29 return 0;
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
30 }
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
31
235
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
32 int areas_are_overlay(area_t *r1, area_t *r2) {
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
33 return _areas_are_overlay(r1, r2);
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents: 10
diff changeset
34 }
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents: 10
diff changeset
35
15
c2ce186a5c37 X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents: 13
diff changeset
36 void area_init(area_t *area, int n_pos, co_aix pos[][2]) {
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
37 co_aix min_x, max_x;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
38 co_aix min_y, max_y;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
39 co_aix x, y;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
40 int i;
822
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 235
diff changeset
41
144
Thinker K.F. Li <thinker@branda.to>
parents: 143
diff changeset
42 /*! \note {x=0, y=0, w=0, h=0} geometry value for a n_pos=0 request
Thinker K.F. Li <thinker@branda.to>
parents: 143
diff changeset
43 * can prevent cursor flasing for Cairo XLib.
Thinker K.F. Li <thinker@branda.to>
parents: 143
diff changeset
44 * (see changeset 21db69d46835)
Thinker K.F. Li <thinker@branda.to>
parents: 143
diff changeset
45 */
143
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
46 if(n_pos == 0) {
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
47 area->x = 0;
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
48 area->w = 0;
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
49 area->y = 0;
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
50 area->h = 0;
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
51 return;
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
52 }
21db69d46835 Fix the problem that left-upper side of a moving shape will be flashed.
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
53
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
54 min_x = max_x = pos[0][0];
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
55 min_y = max_y = pos[0][1];
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
56 for(i = 1; i < n_pos; i++) {
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
57 x = pos[i][0];
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
58 if(x < min_x)
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
59 min_x = x;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
60 else if(x > max_x)
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
61 max_x = x;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
62 y = pos[i][1];
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
63 if(y < min_y)
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
64 min_y = y;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
65 else if(y > max_y)
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
66 max_y = y;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
67 }
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
68
15
c2ce186a5c37 X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents: 13
diff changeset
69 area->x = min_x;
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
70 area->w = max_x - min_x + 1;
15
c2ce186a5c37 X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents: 13
diff changeset
71 area->y = min_y;
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
72 area->h = max_y - min_y + 1;
15
c2ce186a5c37 X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents: 13
diff changeset
73 }
c2ce186a5c37 X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents: 13
diff changeset
74
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
75 void geo_init(geo_t *g) {
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
76 memset(g, 0, sizeof(geo_t));
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
77 g->cur_area = g->areas;
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
78 g->last_area = g->areas + 1;
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
79 }
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
80
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
81 void geo_from_positions(geo_t *g, int n_pos, co_aix pos[][2]) {
15
c2ce186a5c37 X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents: 13
diff changeset
82 area_init(g->cur_area, n_pos, pos);
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
83 }
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
84
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
85 void geo_mark_overlay(geo_t *g, int n_others, geo_t **others,
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
86 int *n_overlays, geo_t **overlays) {
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
87 int i, ov_idx;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
88
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
89 ov_idx = 0;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
90 for(i = 0; i < n_others; i++) {
235
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
91 if(_areas_are_overlay(g->cur_area, others[i]->cur_area))
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
92 overlays[ov_idx++] = others[i];
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
93 }
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
94 *n_overlays = ov_idx;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
95 }
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
96
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
97
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
98 #ifdef UNITTEST
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
99
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
100 #include <CUnit/Basic.h>
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
101
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
102 void test_geo_from_positions(void) {
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
103 co_aix data[][2] = {
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
104 {33, 25}, {49, 12},
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
105 {14, 28}, {39, 56}};
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
106 geo_t g;
822
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 235
diff changeset
107
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
108 geo_init(&g);
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
109 geo_from_positions(&g, 4, data);
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
110 CU_ASSERT(g.cur_area->x == 14);
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
111 CU_ASSERT(g.cur_area->w == 36);
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
112 CU_ASSERT(g.cur_area->y == 12);
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
113 CU_ASSERT(g.cur_area->h == 45);
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
114 }
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
115
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
116 void test_geo_mark_overlay(void) {
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
117 geo_t _geos[3], *geos[3], *overlays[3];
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
118 geo_t g;
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
119 co_aix pos[2][2];
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
120 int i, n_ov;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
121
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
122 for(i = 0; i < 3; i++) {
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
123 pos[0][0] = i * 50;
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
124 pos[0][1] = i * 50;
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
125 pos[1][0] = i * 50 + 55;
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
126 pos[1][1] = i * 50 + 66;
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
127 geo_init(_geos + i);
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
128 geo_from_positions(_geos + i, 2, pos);
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
129 geos[i] = _geos + i;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
130 }
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
131 pos[0][0] = 88;
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
132 pos[0][1] = 79;
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
133 pos[1][0] = 88 + 70;
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
134 pos[1][1] = 79 + 70;
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
135 geo_init(&g);
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
136 geo_from_positions(&g, 2, pos);
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
137
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
138 /* overlay with geos[1] and geos[2] */
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
139 geo_mark_overlay(&g, 3, geos, &n_ov, overlays);
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
140 CU_ASSERT(n_ov == 2);
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
141 CU_ASSERT(overlays[0] == geos[1]);
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
142 CU_ASSERT(overlays[1] == geos[2]);
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
143
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
144 /* right side of geos[1], and up side of geos[2] */
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
145 pos[0][0] = 106;
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
146 pos[0][1] = 51;
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
147 pos[1][0] = 106 + 49;
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
148 pos[1][1] = 51 + 49;
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
149 geo_from_positions(&g, 2, pos);
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
150 geo_mark_overlay(&g, 3, geos, &n_ov, overlays);
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
151 CU_ASSERT(n_ov == 1);
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
152 CU_ASSERT(overlays[0] == geos[2]);
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
153 }
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
154
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
155 CU_pSuite get_geo_suite(void) {
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
156 CU_pSuite suite;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
157
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
158 suite = CU_add_suite("Suite_geo", NULL, NULL);
17
41f0907b27ac Unittest for rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
159 CU_ADD_TEST(suite, test_geo_from_positions);
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
160 CU_ADD_TEST(suite, test_geo_mark_overlay);
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
161
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
162 return suite;
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
163 }
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
164
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
165 #endif