navit  0.5.3-trunk
layout.c File Reference
#include <glib.h>
#include <string.h>
#include "item.h"
#include "attr.h"
#include "xmlconfig.h"
#include "layout.h"
#include "coord.h"
#include "debug.h"
#include "navit.h"

Data Structures

struct  attr_iter
 

Functions

struct layoutlayout_new (struct attr *parent, struct attr **attrs)
 Create a new layout object and attach it to a navit parent. More...
 
struct attr_iterlayout_attr_iter_new (void *unused)
 
void layout_attr_iter_destroy (struct attr_iter *iter)
 
int layout_get_attr (struct layout *layout, enum attr_type type, struct attr *attr, struct attr_iter *iter)
 
int layout_add_attr (struct layout *layout, struct attr *attr)
 
struct cursorlayout_get_cursor (struct layout *this_, char *name)
 
struct cursorcursor_new (struct attr *parent, struct attr **attrs)
 
void cursor_destroy (struct cursor *this_)
 
int cursor_add_attr (struct cursor *this_, struct attr *attr)
 
static int layer_set_attr_do (struct layer *l, struct attr *attr, int init)
 
struct layerlayer_new (struct attr *parent, struct attr **attrs)
 
int layer_get_attr (struct layer *layer, enum attr_type type, struct attr *attr, struct attr_iter *iter)
 
int layer_add_attr (struct layer *layer, struct attr *attr)
 
int layer_set_attr (struct layer *layer, struct attr *attr)
 
static void layer_destroy (struct layer *layer)
 
struct itemgraitemgra_new (struct attr *parent, struct attr **attrs)
 
int itemgra_add_attr (struct itemgra *itemgra, struct attr *attr)
 
static void element_set_oneway (struct element *e, struct attr **attrs)
 
static void element_set_color (struct element *e, struct attr **attrs)
 
static void element_set_background_color (struct color *c, struct attr **attrs)
 
static void element_set_text_size (struct element *e, struct attr **attrs)
 
static void element_set_arrows_width (struct element *e, struct attr **attrs)
 
static void element_set_spikes_width (struct element *e, struct attr **attrs)
 
static void element_set_spikes_distance (struct element *e, struct attr **attrs)
 
static void element_set_polyline_width (struct element *e, struct attr **attrs)
 
static void element_set_polyline_directed (struct element *e, struct attr **attrs)
 
static void element_set_polyline_dash (struct element *e, struct attr **attrs)
 
static void element_set_polyline_offset (struct element *e, struct attr **attrs)
 
static void element_set_circle_width (struct element *e, struct attr **attrs)
 
static void element_set_circle_radius (struct element *e, struct attr **attrs)
 
struct polygon * polygon_new (struct attr *parent, struct attr **attrs)
 
struct polyline * polyline_new (struct attr *parent, struct attr **attrs)
 
struct circlecircle_new (struct attr *parent, struct attr **attrs)
 
struct text * text_new (struct attr *parent, struct attr **attrs)
 
struct icon * icon_new (struct attr *parent, struct attr **attrs)
 
struct image * image_new (struct attr *parent, struct attr **attrs)
 
struct arrows * arrows_new (struct attr *parent, struct attr **attrs)
 
struct spikes * spikes_new (struct attr *parent, struct attr **attrs)
 
int element_add_attr (struct element *e, struct attr *attr)
 

Variables

struct object_func layout_func
 
struct object_func layer_func
 

Function Documentation

◆ arrows_new()

struct arrows* arrows_new ( struct attr parent,
struct attr **  attrs 
)

◆ circle_new()

◆ cursor_add_attr()

int cursor_add_attr ( struct cursor this_,
struct attr attr 
)

◆ cursor_destroy()

void cursor_destroy ( struct cursor this_)

◆ cursor_new()

struct cursor* cursor_new ( struct attr parent,
struct attr **  attrs 
)

◆ element_add_attr()

int element_add_attr ( struct element e,
struct attr attr 
)

◆ element_set_arrows_width()

static void element_set_arrows_width ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_background_color()

static void element_set_background_color ( struct color c,
struct attr **  attrs 
)
static

References attr_search(), attr::attrs, c, and attr::color.

Referenced by circle_new(), and text_new().

◆ element_set_circle_radius()

static void element_set_circle_radius ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_circle_width()

static void element_set_circle_width ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_color()

static void element_set_color ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_oneway()

static void element_set_oneway ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_polyline_dash()

static void element_set_polyline_dash ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_polyline_directed()

static void element_set_polyline_directed ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_polyline_offset()

static void element_set_polyline_offset ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_polyline_width()

static void element_set_polyline_width ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_spikes_distance()

static void element_set_spikes_distance ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_spikes_width()

static void element_set_spikes_width ( struct element e,
struct attr **  attrs 
)
static

◆ element_set_text_size()

static void element_set_text_size ( struct element e,
struct attr **  attrs 
)
static

◆ icon_new()

struct icon* icon_new ( struct attr parent,
struct attr **  attrs 
)

◆ image_new()

struct image* image_new ( struct attr parent,
struct attr **  attrs 
)

◆ itemgra_add_attr()

int itemgra_add_attr ( struct itemgra itemgra,
struct attr attr 
)

◆ itemgra_new()

struct itemgra* itemgra_new ( struct attr parent,
struct attr **  attrs 
)

◆ layer_add_attr()

int layer_add_attr ( struct layer layer,
struct attr attr 
)

◆ layer_destroy()

static void layer_destroy ( struct layer layer)
static

References attr_list_free(), and layer::name.

◆ layer_get_attr()

int layer_get_attr ( struct layer layer,
enum attr_type  type,
struct attr attr,
struct attr_iter iter 
)

◆ layer_new()

struct layer* layer_new ( struct attr parent,
struct attr **  attrs 
)

◆ layer_set_attr()

int layer_set_attr ( struct layer layer,
struct attr attr 
)

References layer_set_attr_do().

◆ layer_set_attr_do()

static int layer_set_attr_do ( struct layer l,
struct attr attr,
int  init 
)
static

◆ layout_add_attr()

int layout_add_attr ( struct layout layout,
struct attr attr 
)

◆ layout_attr_iter_destroy()

void layout_attr_iter_destroy ( struct attr_iter iter)

References attr_iter::iter.

◆ layout_attr_iter_new()

struct attr_iter* layout_attr_iter_new ( void *  unused)

◆ layout_get_attr()

int layout_get_attr ( struct layout layout,
enum attr_type  type,
struct attr attr,
struct attr_iter iter 
)

◆ layout_get_cursor()

struct cursor* layout_get_cursor ( struct layout this_,
char *  name 
)

Searchs the layout for a cursor with the given name.

Parameters
layoutThe layout
nameThe name
Returns
A pointer to cursor with the given name or the name default or NULL.
Author
Ralph Sennhauser (10/2009)

References c, layout::cursors, and name.

Referenced by navit_set_cursors().

◆ layout_new()

struct layout* layout_new ( struct attr parent,
struct attr **  attrs 
)

Create a new layout object and attach it to a navit parent.

Navit, a modular navigation system. Copyright (C) 2005-2009 Navit Team

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Parameters
parentThe parent for this layout (a navit attr)
attrsAn array of attributes that for this layout
Returns
The newly created layout object

References layout::active, attr_search(), attr::attrs, attr::color, layout::color, COLOR_BACKGROUND_, layout::dayname, dbg, layout::font, layout::icon_h, layout::icon_w, layout_func, lvl_warning, layout::name, eval::navit, layout::navit, navit_get_layout_by_name(), navit_object_ref(), layout::nightname, attr::num, layout::order_delta, attr::str, attr::u, layout::underground_alpha, and UNDERGROUND_ALPHA_.

◆ polygon_new()

struct polygon* polygon_new ( struct attr parent,
struct attr **  attrs 
)

◆ polyline_new()

◆ spikes_new()

struct spikes* spikes_new ( struct attr parent,
struct attr **  attrs 
)

◆ text_new()

Variable Documentation

◆ layer_func

struct object_func layer_func
Initial value:
= {
attr_layer,
}
int layer_set_attr(struct layer *layer, struct attr *attr)
Definition: layout.c:344
int layer_get_attr(struct layer *layer, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: layout.c:313
struct layer * layer_new(struct attr *parent, struct attr **attrs)
Definition: layout.c:293
int layer_add_attr(struct layer *layer, struct attr *attr)
Definition: layout.c:334
static void layer_destroy(struct layer *layer)
Definition: layout.c:348
void * navit_object_unref(struct navit_object *obj)
Definition: xmlconfig.c:1313
struct navit_object * navit_object_ref(struct navit_object *obj)
Definition: xmlconfig.c:1307
void(* object_func_iter_destroy)(struct attr_iter *)
Definition: xmlconfig.h:57
void *(* object_func_new)(struct attr *parent, struct attr **attrs)
Definition: xmlconfig.h:54
int(* object_func_remove_attr)(void *, struct attr *attr)
Definition: xmlconfig.h:60
void *(* object_func_ref)(void *)
Definition: xmlconfig.h:64
struct attr_iter *(* object_func_iter_new)(void *)
Definition: xmlconfig.h:56
int(* object_func_init)(void *)
Definition: xmlconfig.h:61
void *(* object_func_dup)(void *)
Definition: xmlconfig.h:63
int(* object_func_add_attr)(void *, struct attr *attr)
Definition: xmlconfig.h:59
void(* object_func_destroy)(void *)
Definition: xmlconfig.h:62
int(* object_func_set_attr)(void *, struct attr *attr)
Definition: xmlconfig.h:58
int(* object_func_get_attr)(void *, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: xmlconfig.h:55
void *(* object_func_unref)(void *)
Definition: xmlconfig.h:65

Referenced by layer_new(), and object_func_lookup().

◆ layout_func

struct object_func layout_func
Initial value:
= {
attr_layout,
}
void layout_attr_iter_destroy(struct attr_iter *iter)
Definition: layout.c:105
int layout_get_attr(struct layout *layout, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: layout.c:109
int layout_add_attr(struct layout *layout, struct attr *attr)
Definition: layout.c:156
struct layout * layout_new(struct attr *parent, struct attr **attrs)
Create a new layout object and attach it to a navit parent.
Definition: layout.c:38
struct attr_iter * layout_attr_iter_new(void *unused)
Definition: layout.c:101

Referenced by layout_new(), and object_func_lookup().