Navit SVN

/work/compile/navit/src/navit/layout.h

00001 
00020 #ifndef NAVIT_LAYOUT_H
00021 #define NAVIT_LAYOUT_H
00022 
00023 #include "item.h"
00024 #include "color.h"
00025 
00026 struct element {
00027         enum { element_point, element_polyline, element_polygon, element_circle, element_text, element_icon, element_image, element_arrows } type;
00028         struct color color;
00029         int text_size;
00030         union {
00031                 struct element_point {
00032                         char stub;
00033                 } point;
00034                 struct element_polyline {
00035                         int width;
00036                         int directed;
00037                         int dash_num;
00038                         int offset;
00039                         unsigned char dash_table[4];
00040                 } polyline;
00041                 struct element_polygon {
00042                         char stub;
00043                 } polygon;
00044                 struct element_circle {
00045                         int width;
00046                         int radius;
00047                         struct color background_color;
00048                 } circle;
00049                 struct element_icon {
00050                         char *src;
00051                         int width;
00052                         int height;
00053                         int rotation;
00054                 } icon;
00055                 struct element_text {
00056                         struct color background_color;
00057                 } text;
00058         } u;
00059         int coord_count;
00060         struct coord *coord;
00061 };
00062 
00063 
00064 struct itemgra { 
00065         struct range order,sequence_range,speed_range,angle_range;
00066         GList *type;
00067         GList *elements;
00068 };
00069 
00070 struct layer { 
00071         char *name;
00072         int details;
00073         GList *itemgras;
00074         int active;
00075 };
00076 
00077 struct cursor {
00078         struct attr **attrs;
00079         struct range *sequence_range;
00080         char *name;
00081         int w,h;
00082         int interval;
00083 };
00084 
00085 struct layout { char *name; char* dayname; char* nightname; char *font; struct color color; GList *layers; GList *cursors; int order_delta; int active; };
00086 
00087 /* prototypes */
00088 enum attr_type;
00089 struct arrows;
00090 struct attr;
00091 struct attr_iter;
00092 struct circle;
00093 struct cursor;
00094 struct element;
00095 struct icon;
00096 struct image;
00097 struct itemgra;
00098 struct layer;
00099 struct layout;
00100 struct polygon;
00101 struct polyline;
00102 struct text;
00103 struct layout *layout_new(struct attr *parent, struct attr **attrs);
00104 struct attr_iter *layout_attr_iter_new(void);
00105 void layout_attr_iter_destroy(struct attr_iter *iter);
00106 int layout_get_attr(struct layout *layout, enum attr_type type, struct attr *attr, struct attr_iter *iter);
00107 int layout_add_attr(struct layout *layout, struct attr *attr);
00108 struct cursor *layout_get_cursor(struct layout *this_, char *name);
00109 struct cursor *cursor_new(struct attr *parent, struct attr **attrs);
00110 void cursor_destroy(struct cursor *this_);
00111 int cursor_add_attr(struct cursor *this_, struct attr *attr);
00112 struct layer *layer_new(struct attr *parent, struct attr **attrs);
00113 int layer_get_attr(struct layer *layer, enum attr_type type, struct attr *attr, struct attr_iter *iter);
00114 int layer_add_attr(struct layer *layer, struct attr *attr);
00115 int layer_set_attr(struct layer *layer, struct attr *attr);
00116 struct itemgra *itemgra_new(struct attr *parent, struct attr **attrs);
00117 int itemgra_add_attr(struct itemgra *itemgra, struct attr *attr);
00118 struct polygon *polygon_new(struct attr *parent, struct attr **attrs);
00119 struct polyline *polyline_new(struct attr *parent, struct attr **attrs);
00120 struct circle *circle_new(struct attr *parent, struct attr **attrs);
00121 struct text *text_new(struct attr *parent, struct attr **attrs);
00122 struct icon *icon_new(struct attr *parent, struct attr **attrs);
00123 struct image *image_new(struct attr *parent, struct attr **attrs);
00124 struct arrows *arrows_new(struct attr *parent, struct attr **attrs);
00125 int element_add_attr(struct element *e, struct attr *attr);
00126 /* end of prototypes */
00127 #endif