summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--navit/layout.c18
-rw-r--r--navit/xmlconfig.c3
-rw-r--r--navit/xmlconfig.h2
3 files changed, 21 insertions, 2 deletions
diff --git a/navit/layout.c b/navit/layout.c
index 111581155..21d10ab53 100644
--- a/navit/layout.c
+++ b/navit/layout.c
@@ -24,6 +24,7 @@
#include "layout.h"
#include "coord.h"
#include "debug.h"
+#include "xmlconfig.h"
struct layout * layout_new(struct attr *parent, struct attr **attrs)
@@ -566,3 +567,20 @@ element_add_attr(struct element *e, struct attr *attr)
return 0;
}
}
+
+struct object_func layout_func = {
+ attr_layout,
+ (object_func_new)layout_new,
+ (object_func_get_attr)layout_get_attr,
+ (object_func_iter_new)layout_attr_iter_new,
+ (object_func_iter_destroy)layout_attr_iter_destroy,
+ (object_func_set_attr)NULL,
+ (object_func_add_attr)layout_add_attr,
+ (object_func_remove_attr)NULL,
+ (object_func_init)NULL,
+ (object_func_destroy)NULL,
+ (object_func_dup)NULL,
+ (object_func_ref)NULL,
+ (object_func_unref)NULL,
+};
+
diff --git a/navit/xmlconfig.c b/navit/xmlconfig.c
index 027648570..9dd102cb8 100644
--- a/navit/xmlconfig.c
+++ b/navit/xmlconfig.c
@@ -255,7 +255,6 @@ static struct object_func object_funcs[] = {
{ attr_image, NEW(image_new)},
{ attr_itemgra, NEW(itemgra_new), NULL, NULL, NULL, NULL, ADD(itemgra_add_attr)},
{ attr_layer, NEW(layer_new), NULL, NULL, NULL, NULL, ADD(layer_add_attr)},
- { attr_layout, NEW(layout_new), NULL, NULL, NULL, NULL, ADD(layout_add_attr)},
{ attr_log, NEW(log_new)},
{ attr_navigation, NEW(navigation_new), GET(navigation_get_attr)},
{ attr_osd, NEW(osd_new), GET(osd_get_attr), NULL, NULL, SET(osd_set_attr) },
@@ -275,6 +274,8 @@ object_func_lookup(enum attr_type type)
{
int i;
switch (type) {
+ case attr_layout:
+ return &layout_func;
case attr_map:
return &map_func;
case attr_maps:
diff --git a/navit/xmlconfig.h b/navit/xmlconfig.h
index 3a7079e45..a984105c9 100644
--- a/navit/xmlconfig.h
+++ b/navit/xmlconfig.h
@@ -54,7 +54,7 @@ struct object_func {
void *(*unref)(void *);
};
-extern struct object_func map_func, mapset_func, navit_func, tracking_func, vehicle_func, maps_func;
+extern struct object_func map_func, mapset_func, navit_func, tracking_func, vehicle_func, maps_func, layout_func;
#define HAS_OBJECT_FUNC(x) ((x) == attr_map || (x) == attr_mapset || (x) == attr_navit || (x) == attr_trackingo || (x) == attr_vehicle)