summaryrefslogtreecommitdiff
path: root/navit/gui.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-11-18 17:09:51 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-11-18 17:09:51 +0000
commitc41ac062f77ebd800a56f6cf9000fe086cefbeb4 (patch)
tree79cdf78598a97ab0938b59339c10fca043f93fa5 /navit/gui.c
parentdeb3cfd322384b9bd786056f31ad7901ae5d863e (diff)
downloadnavit-c41ac062f77ebd800a56f6cf9000fe086cefbeb4.tar.gz
Add:gui_internal:Further work on flexible menus
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2760 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/gui.c')
-rw-r--r--navit/gui.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/navit/gui.c b/navit/gui.c
index 3f4b9316d..f05a90d6a 100644
--- a/navit/gui.c
+++ b/navit/gui.c
@@ -31,6 +31,7 @@ struct gui {
struct gui_methods meth;
struct gui_priv *priv;
struct attr **attrs;
+ struct attr parent;
};
struct gui *
@@ -54,12 +55,23 @@ gui_new(struct attr *parent, struct attr **attrs)
cbl.u.callback_list=callback_list_new();
this_->attrs=attr_generic_add_attr(this_->attrs, &cbl);
this_->priv=guitype_new(parent->u.navit, &this_->meth, this_->attrs);
+ this_->parent=*parent;
return this_;
}
int
gui_get_attr(struct gui *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
{
+ int ret;
+ if (this_->meth.get_attr) {
+ ret=this_->meth.get_attr(this_->priv, type, attr);
+ if (ret)
+ return ret;
+ }
+ if (type == this_->parent.type) {
+ *attr=this_->parent;
+ return 1;
+ }
return attr_generic_get_attr(this_->attrs, NULL, type, attr, iter);
}