navit  0.5.3-trunk
layout.h
Go to the documentation of this file.
1 
20 #ifndef NAVIT_LAYOUT_H
21 #define NAVIT_LAYOUT_H
22 
23 #include "item.h"
24 #include "color.h"
25 #include "coord.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 struct poly_hole {
33  struct coord coord[1];
34 };
35 
36 struct element {
38  struct color color;
39  int text_size;
40  int oneway;
41  union {
42  struct element_point {
43  char stub;
44  } point;
45  struct element_polyline {
46  int width;
47  int directed;
48  int dash_num;
49  int offset;
50  unsigned char dash_table[4];
52  struct element_polygon {
53  /* for texture */
54  char *src;
55  int width;
56  int height;
57  int rotation;
58  int x;
59  int y;
61  struct element_circle {
62  int width;
63  int radius;
64  struct color background_color;
65  } circle;
66  struct element_icon {
67  char *src;
68  int width;
69  int height;
70  int rotation;
71  int x;
72  int y;
73  } icon;
74  struct element_text {
75  struct color background_color;
76  } text;
77  struct element_arrows {
78  int width;
79  } arrows;
80  } u;
82  struct coord *coord;
83 };
84 
85 
86 struct itemgra {
87  struct range order,sequence_range,speed_range,angle_range;
90 };
91 
92 struct layer {
94  struct navit *navit;
95  char *name;
96  int details;
98  int active;
99  struct layer *ref;
100 };
101 
102 struct cursor {
103  struct attr **attrs;
105  char *name;
106  int w,h;
107  int interval;
108 };
109 
110 struct layout {
112  struct navit *navit;
113  char *name;
114  char* dayname;
115  char* nightname;
116  char *font;
117  struct color color;
119  int icon_w;
120  int icon_h;
124  int active;
125 };
126 
127 /* prototypes */
128 enum attr_type;
129 struct arrows;
130 struct attr;
131 struct attr_iter;
132 struct circle;
133 struct cursor;
134 struct element;
135 struct icon;
136 struct image;
137 struct itemgra;
138 struct layer;
139 struct layout;
140 struct polygon;
141 struct polyline;
142 struct text;
143 struct layout *layout_new(struct attr *parent, struct attr **attrs);
144 struct attr_iter *layout_attr_iter_new(void* unused);
146 int layout_get_attr(struct layout *layout, enum attr_type type, struct attr *attr, struct attr_iter *iter);
147 int layout_add_attr(struct layout *layout, struct attr *attr);
148 struct cursor *layout_get_cursor(struct layout *this_, char *name);
149 struct cursor *cursor_new(struct attr *parent, struct attr **attrs);
150 void cursor_destroy(struct cursor *this_);
151 int cursor_add_attr(struct cursor *this_, struct attr *attr);
152 struct layer *layer_new(struct attr *parent, struct attr **attrs);
153 int layer_get_attr(struct layer *layer, enum attr_type type, struct attr *attr, struct attr_iter *iter);
154 int layer_add_attr(struct layer *layer, struct attr *attr);
155 int layer_set_attr(struct layer *layer, struct attr *attr);
156 struct itemgra *itemgra_new(struct attr *parent, struct attr **attrs);
157 int itemgra_add_attr(struct itemgra *itemgra, struct attr *attr);
158 struct polygon *polygon_new(struct attr *parent, struct attr **attrs);
159 struct polyline *polyline_new(struct attr *parent, struct attr **attrs);
160 struct circle *circle_new(struct attr *parent, struct attr **attrs);
161 struct text *text_new(struct attr *parent, struct attr **attrs);
162 struct icon *icon_new(struct attr *parent, struct attr **attrs);
163 struct image *image_new(struct attr *parent, struct attr **attrs);
164 struct arrows *arrows_new(struct attr *parent, struct attr **attrs);
165 int element_add_attr(struct element *e, struct attr *attr);
166 /* end of prototypes */
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #endif
attr_type
Definition: attr.h:34
char type[3]
Definition: garmin_img.c:2
void layout_attr_iter_destroy(struct attr_iter *iter)
Definition: layout.c:105
int layout_get_attr(struct layout *layout, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: layout.c:109
struct image * image_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:634
struct polygon * polygon_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:500
int itemgra_add_attr(struct itemgra *itemgra, struct attr *attr)
Definition: layout.c:393
struct circle * circle_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:563
struct arrows * arrows_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:644
int layout_add_attr(struct layout *layout, struct attr *attr)
Definition: layout.c:156
struct layout * layout_new(struct attr *parent, struct attr **attrs)
Create a new layout object and attach it to a navit parent.
Definition: layout.c:38
int layer_set_attr(struct layer *layer, struct attr *attr)
Definition: layout.c:344
int cursor_add_attr(struct cursor *this_, struct attr *attr)
Definition: layout.c:240
int layer_get_attr(struct layer *layer, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: layout.c:313
struct layer * layer_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:293
struct cursor * layout_get_cursor(struct layout *this_, char *name)
Definition: layout.c:180
void cursor_destroy(struct cursor *this_)
Definition: layout.c:231
int layer_add_attr(struct layer *layer, struct attr *attr)
Definition: layout.c:334
struct cursor * cursor_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:198
struct attr_iter * layout_attr_iter_new(void *unused)
Definition: layout.c:101
int element_add_attr(struct element *e, struct attr *attr)
Definition: layout.c:654
struct polyline * polyline_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:548
struct text * text_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:583
struct icon * icon_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:601
struct itemgra * itemgra_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:354
struct _GList GList
Definition: navit.h:30
char name[0]
Definition: street.c:3
Definition: config_.c:47
void * iter
Definition: config_.c:48
Definition: attr.h:157
Definition: graphics.c:1743
Definition: color.h:23
Definition: coord.h:34
Definition: layout.h:102
int interval
Definition: layout.h:107
int h
Definition: layout.h:106
char * name
Definition: layout.h:105
struct attr ** attrs
Definition: layout.h:103
int w
Definition: layout.h:106
struct range * sequence_range
Definition: layout.h:104
Definition: layout.h:36
int width
Definition: layout.h:46
struct element::@3::element_polygon polygon
int x
Definition: layout.h:58
enum element::@2 type
union element::@3 u
struct element::@3::element_text text
struct color background_color
Definition: layout.h:64
int y
Definition: layout.h:59
int dash_num
Definition: layout.h:48
int radius
Definition: layout.h:63
int offset
Definition: layout.h:49
struct element::@3::element_point point
char * src
Definition: layout.h:54
unsigned char dash_table[4]
Definition: layout.h:50
struct element::@3::element_circle circle
int text_size
Definition: layout.h:39
struct element::@3::element_arrows arrows
int oneway
Definition: layout.h:40
struct element::@3::element_polyline polyline
struct element::@3::element_icon icon
int coord_count
Definition: layout.h:81
char stub
Definition: layout.h:43
int directed
Definition: layout.h:47
struct coord * coord
Definition: layout.h:82
int rotation
Definition: layout.h:57
int height
Definition: layout.h:56
@ element_polyline
Definition: layout.h:37
@ element_arrows
Definition: layout.h:37
@ element_icon
Definition: layout.h:37
@ element_polygon
Definition: layout.h:37
@ element_point
Definition: layout.h:37
@ element_text
Definition: layout.h:37
@ element_circle
Definition: layout.h:37
@ element_image
Definition: layout.h:37
Definition: layout.h:86
struct range order sequence_range speed_range angle_range
Definition: layout.h:87
GList * type
Definition: layout.h:88
GList * elements
Definition: layout.h:89
Definition: layout.h:92
struct layer * ref
Definition: layout.h:99
int active
Definition: layout.h:98
int details
Definition: layout.h:96
NAVIT_OBJECT struct navit * navit
Definition: layout.h:94
char * name
Definition: layout.h:95
GList * itemgras
Definition: layout.h:97
Definition: layout.h:110
GList * cursors
Definition: layout.h:122
int underground_alpha
Definition: layout.h:118
char * font
Definition: layout.h:116
int active
Definition: layout.h:124
int order_delta
Definition: layout.h:123
int icon_h
Definition: layout.h:120
GList * layers
Definition: layout.h:121
int icon_w
Definition: layout.h:119
char * nightname
Definition: layout.h:115
char * name
Definition: layout.h:113
NAVIT_OBJECT struct navit * navit
Definition: layout.h:112
char * dayname
Definition: layout.h:114
Definition: navit.c:112
Definition: gpx2navit_txt.h:51
Definition: layout.h:31
int coord_count
Definition: layout.h:32
Definition: attr.h:153
#define NAVIT_OBJECT
Definition: xmlconfig.h:121