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

Contents of /navit/navit/layout.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 27 - (show annotations) (download)
Mon Apr 9 21:27:36 2012 UTC (10 years, 7 months ago) by zoff99
File MIME type: text/plain
File size: 4679 byte(s)
lots of new stuff, tranlsations, bug fixes ...
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 { element_point, element_polyline, element_polygon, element_circle, element_text, element_icon, element_image, element_arrows } type;
48 struct color color;
49 int text_size;
50 union {
51 struct element_point {
52 char stub;
53 } point;
54 struct element_polyline
55 {
56 int width;
57 int directed;
58 int dash_num;
59 int offset;
60 //unsigned char dash_table[4];
61 short dash_table[4];
62 } polyline;
63 struct element_polygon {
64 char stub;
65 } polygon;
66 struct element_circle {
67 int width;
68 int radius;
69 struct color background_color;
70 } circle;
71 struct element_icon {
72 char *src;
73 int width;
74 int height;
75 int rotation;
76 } icon;
77 struct element_text {
78 struct color background_color;
79 } text;
80 } u;
81 int coord_count;
82 struct coord *coord;
83 };
84
85
86 struct itemgra {
87 struct range order,sequence_range,speed_range,angle_range;
88 GList *type;
89 GList *elements;
90 };
91
92 struct layer {
93 char *name;
94 int details;
95 GList *itemgras;
96 int active;
97 };
98
99 struct cursor {
100 struct attr **attrs;
101 struct range *sequence_range;
102 char *name;
103 int w,h;
104 int interval;
105 };
106
107 struct layout { char *name; char* dayname; char* nightname; char *font; struct color color; GList *layers; GList *cursors; int order_delta; int active; };
108
109 /* prototypes */
110 enum attr_type;
111 struct arrows;
112 struct attr;
113 struct attr_iter;
114 struct circle;
115 struct cursor;
116 struct element;
117 struct icon;
118 struct image;
119 struct itemgra;
120 struct layer;
121 struct layout;
122 struct polygon;
123 struct polyline;
124 struct text;
125 struct layout *layout_new(struct attr *parent, struct attr **attrs);
126 struct attr_iter *layout_attr_iter_new(void);
127 void layout_attr_iter_destroy(struct attr_iter *iter);
128 int layout_get_attr(struct layout *layout, enum attr_type type, struct attr *attr, struct attr_iter *iter);
129 int layout_add_attr(struct layout *layout, struct attr *attr);
130 struct cursor *layout_get_cursor(struct layout *this_, char *name);
131 struct cursor *cursor_new(struct attr *parent, struct attr **attrs);
132 void cursor_destroy(struct cursor *this_);
133 int cursor_add_attr(struct cursor *this_, struct attr *attr);
134 struct layer *layer_new(struct attr *parent, struct attr **attrs);
135 int layer_get_attr(struct layer *layer, enum attr_type type, struct attr *attr, struct attr_iter *iter);
136 int layer_add_attr(struct layer *layer, struct attr *attr);
137 int layer_set_attr(struct layer *layer, struct attr *attr);
138 struct itemgra *itemgra_new(struct attr *parent, struct attr **attrs);
139 int itemgra_add_attr(struct itemgra *itemgra, struct attr *attr);
140 struct polygon *polygon_new(struct attr *parent, struct attr **attrs);
141 struct polyline *polyline_new(struct attr *parent, struct attr **attrs);
142 struct circle *circle_new(struct attr *parent, struct attr **attrs);
143 struct text *text_new(struct attr *parent, struct attr **attrs);
144 struct icon *icon_new(struct attr *parent, struct attr **attrs);
145 struct image *image_new(struct attr *parent, struct attr **attrs);
146 struct arrows *arrows_new(struct attr *parent, struct attr **attrs);
147 int element_add_attr(struct element *e, struct attr *attr);
148 /* end of prototypes */
149 #endif

   
Visit the ZANavi Wiki