From e745426003e8bcf2e5920038d30b71ac10d27a78 Mon Sep 17 00:00:00 2001 From: martin-s Date: Sat, 26 Jul 2008 20:36:27 +0000 Subject: Add:Core:Made detail level for layouts configurable git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1231 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/layout.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'navit/layout.c') diff --git a/navit/layout.c b/navit/layout.c index 8e2cb0e58..653d2b512 100644 --- a/navit/layout.c +++ b/navit/layout.c @@ -19,16 +19,26 @@ #include #include +#include "item.h" #include "layout.h" -struct layout * layout_new(const char *name, struct color *color) +struct layout * layout_new(struct attr *parent, struct attr **attrs) { struct layout *l; + struct color def_color = {0xffff, 0xefef, 0xb7b7, 0xffff}; + struct attr *name_attr,*color_attr,*order_delta_attr; + + if (! (name_attr=attr_search(attrs, NULL, attr_name))) + return NULL; l = g_new0(struct layout, 1); - l->name = g_strdup(name); - l->color = g_new0(struct color,1); - *(l->color) = *color; + l->name = g_strdup(name_attr->u.str); + if ((color_attr=attr_search(attrs, NULL, attr_color))) + l->color = *color_attr->u.color; + else + l->color = def_color; + if ((order_delta_attr=attr_search(attrs, NULL, attr_order_delta))) + l->order_delta=order_delta_attr->u.num; return l; } -- cgit v1.2.1