diff options
author | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2014-12-21 13:29:22 +0000 |
---|---|---|
committer | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2014-12-21 13:29:22 +0000 |
commit | d065cdfe6ac448df5bf7108950a7e39168b18b22 (patch) | |
tree | 1e4a8296b43016fd2da3e33678d5446be86aca49 /navit | |
parent | 3560b11b512af661753137c6e75beb2ec941b6fc (diff) | |
download | navit-svn-d065cdfe6ac448df5bf7108950a7e39168b18b22.tar.gz |
Add:core:Allow to query graphics attributes (to allow graphics modules to export command interface functions)
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5978 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit')
-rw-r--r-- | navit/graphics.c | 9 | ||||
-rw-r--r-- | navit/xmlconfig.c | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/navit/graphics.c b/navit/graphics.c index c8d967e6..e637ef11 100644 --- a/navit/graphics.c +++ b/navit/graphics.c @@ -228,7 +228,7 @@ graphics_set_rect(struct graphics *gra, struct point_rect *pr) struct graphics * graphics_new(struct attr *parent, struct attr **attrs) { struct graphics *this_; - struct attr *type_attr; + struct attr *type_attr, cbl_attr; struct graphics_priv * (*graphicstype_new)(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl); if (! (type_attr=attr_search(attrs, NULL, attr_type))) { @@ -239,9 +239,12 @@ struct graphics * graphics_new(struct attr *parent, struct attr **attrs) if (! graphicstype_new) return NULL; this_=g_new0(struct graphics, 1); - this_->cbl=callback_list_new(); - this_->priv=(*graphicstype_new)(parent->u.navit, &this_->meth, attrs, this_->cbl); this_->attrs=attr_list_dup(attrs); + this_->cbl=callback_list_new(); + cbl_attr.type=attr_callback_list; + cbl_attr.u.callback_list=this_->cbl; + this_->attrs=attr_generic_add_attr(this_->attrs, &cbl_attr); + this_->priv=(*graphicstype_new)(parent->u.navit, &this_->meth, this_->attrs, this_->cbl); this_->brightness=0; this_->contrast=65536; this_->gamma=65536; diff --git a/navit/xmlconfig.c b/navit/xmlconfig.c index 3cbe20e4..66b73fd0 100644 --- a/navit/xmlconfig.c +++ b/navit/xmlconfig.c @@ -238,7 +238,7 @@ static struct object_func object_funcs[] = { { attr_coord, NEW(coord_new_from_attrs)}, { attr_cursor, NEW(cursor_new), NULL, NULL, NULL, NULL, ADD(cursor_add_attr)}, { attr_debug, NEW(debug_new)}, - { attr_graphics, NEW(graphics_new)}, + { attr_graphics, NEW(graphics_new), GET(graphics_get_attr)}, { attr_gui, NEW(gui_new), GET(gui_get_attr), NULL, NULL, SET(gui_set_attr), ADD(gui_add_attr)}, { attr_icon, NEW(icon_new), NULL, NULL, NULL, NULL, ADD(element_add_attr)}, { attr_image, NEW(image_new)}, |