/[zanavi_public1]/navit/navit/layout.h
ZANavi

Contents of /navit/navit/layout.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (show annotations) (download)
Mon Feb 4 17:41:59 2013 UTC (11 years, 2 months ago) by zoff99
File MIME type: text/plain
File size: 4704 byte(s)
new map version, lots of fixes and experimental new features
1 /**
2 * ZANavi, Zoff Android Navigation system.
3 * Copyright (C) 2011 Zoff <zoff@zoff.cc>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 /**
21 * Navit, a modular navigation system.
22 * Copyright (C) 2005-2009 Navit Team
23 *
24 * This program is free software; you can redistribute it and/or
25 * modify it under the terms of the GNU Library General Public License
26 * version 2 as published by the Free Software Foundation.
27 *
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU Library General Public License for more details.
32 *
33 * You should have received a copy of the GNU Library General Public
34 * License along with this program; if not, write to the
35 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
36 * Boston, MA 02110-1301, USA.
37 */
38
39 #ifndef NAVIT_LAYOUT_H
40 #define NAVIT_LAYOUT_H
41
42 #include "item.h"
43 #include "color.h"
44
45 struct element
46 {
47 enum
48 {
49 element_point, element_polyline, element_polygon, element_circle, element_text, element_icon, element_image, element_arrows
50 } type;
51 struct color color;
52 int text_size;
53 union
54 {
55 struct element_point
56 {
57 char stub;
58 } point;
59 struct element_polyline
60 {
61 int width;
62 int directed;
63 int dash_num;
64 int offset;
65 //unsigned char dash_table[4];
66 short dash_table[4];
67 } polyline;
68 struct element_polygon
69 {
70 char stub;
71 } polygon;
72 struct element_circle
73 {
74 int width;
75 int radius;
76 struct color background_color;
77 } circle;
78 struct element_icon
79 {
80 char *src;
81 int width;
82 int height;
83 int rotation;
84 } icon;
85 struct element_text
86 {
87 struct color background_color;
88 } text;
89 } u;
90 int coord_count;
91 struct coord *coord;
92 };
93
94 struct itemgra
95 {
96 struct range order, sequence_range, speed_range, angle_range;
97 GList *type;
98 GList *elements;
99 };
100
101 struct layer
102 {
103 char *name;
104 int details;
105 GList *itemgras;
106 int active;
107 };
108
109 struct cursor
110 {
111 struct attr **attrs;
112 struct range *sequence_range;
113 char *name;
114 int w, h;
115 int interval;
116 };
117
118 struct layout
119 {
120 char *name;
121 char* dayname;
122 char* nightname;
123 char *font;
124 struct color color;
125 GList *layers;
126 GList *cursors;
127 int order_delta;
128 int active;
129 };
130
131 /* prototypes */
132 enum attr_type;
133 struct arrows;
134 struct attr;
135 struct attr_iter;
136 struct circle;
137 struct cursor;
138 struct element;
139 struct icon;
140 struct image;
141 struct itemgra;
142 struct layer;
143 struct layout;
144 struct polygon;
145 struct polyline;
146 struct text;
147 struct layout *layout_new(struct attr *parent, struct attr **attrs);
148 struct attr_iter *layout_attr_iter_new(void);
149 void layout_attr_iter_destroy(struct attr_iter *iter);
150 int layout_get_attr(struct layout *layout, enum attr_type type, struct attr *attr, struct attr_iter *iter);
151 int layout_add_attr(struct layout *layout, struct attr *attr);
152 struct cursor *layout_get_cursor(struct layout *this_, char *name);
153 struct cursor *cursor_new(struct attr *parent, struct attr **attrs);
154 void cursor_destroy(struct cursor *this_);
155 int cursor_add_attr(struct cursor *this_, struct attr *attr);
156 struct layer *layer_new(struct attr *parent, struct attr **attrs);
157 int layer_get_attr(struct layer *layer, enum attr_type type, struct attr *attr, struct attr_iter *iter);
158 int layer_add_attr(struct layer *layer, struct attr *attr);
159 int layer_set_attr(struct layer *layer, struct attr *attr);
160 struct itemgra *itemgra_new(struct attr *parent, struct attr **attrs);
161 int itemgra_add_attr(struct itemgra *itemgra, struct attr *attr);
162 struct polygon *polygon_new(struct attr *parent, struct attr **attrs);
163 struct polyline *polyline_new(struct attr *parent, struct attr **attrs);
164 struct circle *circle_new(struct attr *parent, struct attr **attrs);
165 struct text *text_new(struct attr *parent, struct attr **attrs);
166 struct icon *icon_new(struct attr *parent, struct attr **attrs);
167 struct image *image_new(struct attr *parent, struct attr **attrs);
168 struct arrows *arrows_new(struct attr *parent, struct attr **attrs);
169 int element_add_attr(struct element *e, struct attr *attr);
170 /* end of prototypes */
171 #endif

   
Visit the ZANavi Wiki