New patch to cope both with libgps18 and libgps19
[navit-package] / navit / layout.h
1 /**
2  * Navit, a modular navigation system.
3  * Copyright (C) 2005-2009 Navit Team
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library 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 Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License 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 #ifndef NAVIT_LAYOUT_H
21 #define NAVIT_LAYOUT_H
22
23 #include "item.h"
24 #include "color.h"
25
26 struct element {
27         enum { element_point, element_polyline, element_polygon, element_circle, element_text, element_icon, element_image, element_arrows } type;
28         struct color color;
29         int text_size;
30         union {
31                 struct element_point {
32                 } point;
33                 struct element_polyline {
34                         int width;
35                         int directed;
36                         int dash_num;
37                         int offset;
38                         unsigned char dash_table[4];
39                 } polyline;
40                 struct element_polygon {
41                 } polygon;
42                 struct element_circle {
43                         int width;
44                         int radius;
45                 } circle;
46                 struct element_icon {
47                         char *src;
48                         int width;
49                         int height;
50                         int rotation;
51                 } icon;
52         } u;
53         int coord_count;
54         struct coord *coord;
55 };
56
57
58 struct itemgra { 
59         struct range order,sequence_range,speed_range,angle_range;
60         GList *type;
61         GList *elements;
62 };
63
64 struct layer { char *name; int details; GList *itemgras; };
65
66 struct cursor {
67         struct attr **attrs;
68         struct range *sequence_range;
69         char *name;
70         int w,h;
71         int interval;
72 };
73
74 struct layout { char *name; char* dayname; char* nightname; char *font; struct color color; GList *layers; GList *cursors; int order_delta; };
75
76 /* prototypes */
77 struct layout *layout_new(struct attr *parent, struct attr **attrs);
78 int layout_add_attr(struct layout *layout, struct attr *attr);
79 struct cursor *layout_get_cursor(struct layout *this_, char *name);
80 struct cursor *cursor_new(struct attr *parent, struct attr **attrs);
81 void cursor_destroy(struct cursor *this_);
82 int cursor_add_attr(struct cursor *this_, struct attr *attr);
83 struct layer *layer_new(struct attr *parent, struct attr **attrs);
84 int layer_add_attr(struct layer *layer, struct attr *attr);
85 struct itemgra *itemgra_new(struct attr *parent, struct attr **attrs);
86 int itemgra_add_attr(struct itemgra *itemgra, struct attr *attr);
87 struct polygon *polygon_new(struct attr *parent, struct attr **attrs);
88 struct polyline *polyline_new(struct attr *parent, struct attr **attrs);
89 struct circle *circle_new(struct attr *parent, struct attr **attrs);
90 struct text *text_new(struct attr *parent, struct attr **attrs);
91 struct icon *icon_new(struct attr *parent, struct attr **attrs);
92 struct image *image_new(struct attr *parent, struct attr **attrs);
93 struct arrows *arrows_new(struct attr *parent, struct attr **attrs);
94 int element_add_attr(struct element *e, struct attr *attr);
95 #endif
96