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

Contents of /navit/navit/layout.h

Parent Directory Parent Directory | Revision Log Revision Log


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

   
Visit the ZANavi Wiki