Add:Core:Changed layout_func to new scheme
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 16 Jul 2012 11:34:07 +0000 (11:34 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 16 Jul 2012 11:34:07 +0000 (11:34 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5189 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/layout.c
navit/navit/xmlconfig.c
navit/navit/xmlconfig.h

index 1115811..21d10ab 100644 (file)
@@ -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,
+};
+
index 0276485..9dd102c 100644 (file)
@@ -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:
index 3a7079e..a984105 100644 (file)
@@ -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)