From: martin-s Date: Thu, 10 Mar 2011 12:14:18 +0000 (+0000) Subject: Fix:Core:Make vehicle cursor have priority over layout cursor X-Git-Tag: navit-0.5.0.5194svn~872 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0aeac6b074888ec2bd41ed1661b70cc4ede5c855;p=profile%2Fivi%2Fnavit.git Fix:Core:Make vehicle cursor have priority over layout cursor git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4323 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/navit/navit.c b/navit/navit/navit.c index de342bb..73a5810 100644 --- a/navit/navit/navit.c +++ b/navit/navit/navit.c @@ -1750,7 +1750,7 @@ navit_set_cursors(struct navit *this_) c=layout_get_cursor(this_->layout_current, name.u.str); } else c=layout_get_cursor(this_->layout_current, "default"); - vehicle_set_cursor(nv->vehicle, c); + vehicle_set_cursor(nv->vehicle, c, 0); v=g_list_next(v); } return; diff --git a/navit/navit/vehicle.c b/navit/navit/vehicle.c index ae404fc..bec635e 100644 --- a/navit/navit/vehicle.c +++ b/navit/navit/vehicle.c @@ -50,6 +50,7 @@ struct vehicle { // cursor struct cursor *cursor; + int cursor_fixed; struct callback *animate_callback; struct event_timeout *animate_timer; struct point cursor_pnt; @@ -235,7 +236,8 @@ vehicle_add_attr(struct vehicle *this_, struct attr *attr) break; // currently supporting oldstyle cursor config. case attr_cursor: - vehicle_set_cursor(this_, attr->u.cursor); + this_->cursor_fixed=1; + vehicle_set_cursor(this_, attr->u.cursor, 1); break; default: break; @@ -284,9 +286,11 @@ vehicle_remove_attr(struct vehicle *this_, struct attr *attr) * @author Ralph Sennhauser (10/2009) */ void -vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor) +vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor, int overwrite) { struct point sc; + if (this_->cursor_fixed && !overwrite) + return; if (this_->animate_callback) { event_remove_timeout(this_->animate_timer); this_->animate_timer=NULL; // dangling pointer! prevent double freeing. diff --git a/navit/navit/vehicle.h b/navit/navit/vehicle.h index 3c1dcda..d2a52a4 100644 --- a/navit/navit/vehicle.h +++ b/navit/navit/vehicle.h @@ -49,7 +49,7 @@ int vehicle_get_attr(struct vehicle *this_, enum attr_type type, struct attr *at int vehicle_set_attr(struct vehicle *this_, struct attr *attr); int vehicle_add_attr(struct vehicle *this_, struct attr *attr); int vehicle_remove_attr(struct vehicle *this_, struct attr *attr); -void vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor); +void vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor, int overwrite); void vehicle_draw(struct vehicle *this_, struct graphics *gra, struct point *pnt, int lazy, int angle, int speed); int vehicle_get_cursor_data(struct vehicle *this_, struct point *pnt, int *angle, int *speed); void vehicle_log_gpx_add_tag(char *tag, char **logstr);