summaryrefslogtreecommitdiff
path: root/navit/graphics.c
diff options
context:
space:
mode:
authormdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2014-12-21 13:29:22 +0000
committermdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2014-12-21 13:29:22 +0000
commit626a2770e27003c59ddf68f3a65a0083e40c8b7e (patch)
tree1e4a8296b43016fd2da3e33678d5446be86aca49 /navit/graphics.c
parent2c38f2566d81b3bb98c4d08481bf83c127d8c9b7 (diff)
downloadnavit-626a2770e27003c59ddf68f3a65a0083e40c8b7e.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/graphics.c')
-rw-r--r--navit/graphics.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/navit/graphics.c b/navit/graphics.c
index c8d967e64..e637ef114 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;