summaryrefslogtreecommitdiff
path: root/src/layout.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout.h')
-rw-r--r--src/layout.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/layout.h b/src/layout.h
new file mode 100644
index 00000000..ed96838e
--- /dev/null
+++ b/src/layout.h
@@ -0,0 +1,59 @@
+#include "item.h"
+#include "color.h"
+
+struct element_line;
+struct element_text;
+
+struct element {
+ enum { element_point, element_polyline, element_polygon, element_circle, element_label, element_icon, element_image } type;
+ struct color color;
+ int label_size;
+ union {
+ struct element_point {
+ } point;
+ struct element_polyline {
+ int width;
+ } polyline;
+ struct element_polygon {
+ } polygon;
+ struct element_circle {
+ int width;
+ int radius;
+ } circle;
+ struct element_icon {
+ char *src;
+ } icon;
+ } u;
+};
+
+
+struct itemtype {
+ int zoom_min, zoom_max;
+ GList *type;
+ GList *elements;
+};
+
+struct layer { char *name; int details; GList *itemtypes; };
+
+struct layout { char *name; GList *layers; };
+
+/* prototypes */
+enum item_type;
+struct color;
+struct element;
+struct itemtype;
+struct layer;
+struct layout;
+struct layout *layout_new(const char *name);
+struct layer *layer_new(const char *name, int details);
+void layout_add_layer(struct layout *layout, struct layer *layer);
+struct itemtype *itemtype_new(int zoom_min, int zoom_max);
+void itemtype_add_type(struct itemtype *this, enum item_type type);
+void layer_add_itemtype(struct layer *layer, struct itemtype *itemtype);
+void itemtype_add_element(struct itemtype *itemtype, struct element *element);
+struct element *polygon_new(struct color *color);
+struct element *polyline_new(struct color *color, int width);
+struct element *circle_new(struct color *color, int radius, int width, int label_size);
+struct element *label_new(int label_size);
+struct element *icon_new(const char *src);
+struct element *image_new(void);