summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--navit/graphics.c9
-rw-r--r--navit/xmlconfig.c2
2 files changed, 7 insertions, 4 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;
diff --git a/navit/xmlconfig.c b/navit/xmlconfig.c
index 3cbe20e4a..66b73fd02 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)},