1 |
zoff99 |
2 |
/**
|
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 |
|
|
char stub;
|
33 |
|
|
} point;
|
34 |
|
|
struct element_polyline {
|
35 |
|
|
int width;
|
36 |
|
|
int directed;
|
37 |
|
|
int dash_num;
|
38 |
|
|
int offset;
|
39 |
|
|
unsigned char dash_table[4];
|
40 |
|
|
} polyline;
|
41 |
|
|
struct element_polygon {
|
42 |
|
|
char stub;
|
43 |
|
|
} polygon;
|
44 |
|
|
struct element_circle {
|
45 |
|
|
int width;
|
46 |
|
|
int radius;
|
47 |
|
|
struct color background_color;
|
48 |
|
|
} circle;
|
49 |
|
|
struct element_icon {
|
50 |
|
|
char *src;
|
51 |
|
|
int width;
|
52 |
|
|
int height;
|
53 |
|
|
int rotation;
|
54 |
|
|
} icon;
|
55 |
|
|
struct element_text {
|
56 |
|
|
struct color background_color;
|
57 |
|
|
} text;
|
58 |
|
|
} u;
|
59 |
|
|
int coord_count;
|
60 |
|
|
struct coord *coord;
|
61 |
|
|
};
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
struct itemgra {
|
65 |
|
|
struct range order,sequence_range,speed_range,angle_range;
|
66 |
|
|
GList *type;
|
67 |
|
|
GList *elements;
|
68 |
|
|
};
|
69 |
|
|
|
70 |
|
|
struct layer {
|
71 |
|
|
char *name;
|
72 |
|
|
int details;
|
73 |
|
|
GList *itemgras;
|
74 |
|
|
int active;
|
75 |
|
|
};
|
76 |
|
|
|
77 |
|
|
struct cursor {
|
78 |
|
|
struct attr **attrs;
|
79 |
|
|
struct range *sequence_range;
|
80 |
|
|
char *name;
|
81 |
|
|
int w,h;
|
82 |
|
|
int interval;
|
83 |
|
|
};
|
84 |
|
|
|
85 |
|
|
struct layout { char *name; char* dayname; char* nightname; char *font; struct color color; GList *layers; GList *cursors; int order_delta; int active; };
|
86 |
|
|
|
87 |
|
|
/* prototypes */
|
88 |
|
|
enum attr_type;
|
89 |
|
|
struct arrows;
|
90 |
|
|
struct attr;
|
91 |
|
|
struct attr_iter;
|
92 |
|
|
struct circle;
|
93 |
|
|
struct cursor;
|
94 |
|
|
struct element;
|
95 |
|
|
struct icon;
|
96 |
|
|
struct image;
|
97 |
|
|
struct itemgra;
|
98 |
|
|
struct layer;
|
99 |
|
|
struct layout;
|
100 |
|
|
struct polygon;
|
101 |
|
|
struct polyline;
|
102 |
|
|
struct text;
|
103 |
|
|
struct layout *layout_new(struct attr *parent, struct attr **attrs);
|
104 |
|
|
struct attr_iter *layout_attr_iter_new(void);
|
105 |
|
|
void layout_attr_iter_destroy(struct attr_iter *iter);
|
106 |
|
|
int layout_get_attr(struct layout *layout, enum attr_type type, struct attr *attr, struct attr_iter *iter);
|
107 |
|
|
int layout_add_attr(struct layout *layout, struct attr *attr);
|
108 |
|
|
struct cursor *layout_get_cursor(struct layout *this_, char *name);
|
109 |
|
|
struct cursor *cursor_new(struct attr *parent, struct attr **attrs);
|
110 |
|
|
void cursor_destroy(struct cursor *this_);
|
111 |
|
|
int cursor_add_attr(struct cursor *this_, struct attr *attr);
|
112 |
|
|
struct layer *layer_new(struct attr *parent, struct attr **attrs);
|
113 |
|
|
int layer_get_attr(struct layer *layer, enum attr_type type, struct attr *attr, struct attr_iter *iter);
|
114 |
|
|
int layer_add_attr(struct layer *layer, struct attr *attr);
|
115 |
|
|
int layer_set_attr(struct layer *layer, struct attr *attr);
|
116 |
|
|
struct itemgra *itemgra_new(struct attr *parent, struct attr **attrs);
|
117 |
|
|
int itemgra_add_attr(struct itemgra *itemgra, struct attr *attr);
|
118 |
|
|
struct polygon *polygon_new(struct attr *parent, struct attr **attrs);
|
119 |
|
|
struct polyline *polyline_new(struct attr *parent, struct attr **attrs);
|
120 |
|
|
struct circle *circle_new(struct attr *parent, struct attr **attrs);
|
121 |
|
|
struct text *text_new(struct attr *parent, struct attr **attrs);
|
122 |
|
|
struct icon *icon_new(struct attr *parent, struct attr **attrs);
|
123 |
|
|
struct image *image_new(struct attr *parent, struct attr **attrs);
|
124 |
|
|
struct arrows *arrows_new(struct attr *parent, struct attr **attrs);
|
125 |
|
|
int element_add_attr(struct element *e, struct attr *attr);
|
126 |
|
|
/* end of prototypes */
|
127 |
|
|
#endif
|