diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-04-28 15:18:17 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-04-28 15:18:17 +0000 |
commit | fe57f914b4ab318c3dd41607e3c6c8bb5bf407de (patch) | |
tree | 3e4e90ad0969e251b941f49f50f0b5ca6ffa4f09 /navit/osd | |
parent | 25c3ba43b0dc899af1ce9691a964b4647016380d (diff) | |
download | navit-fe57f914b4ab318c3dd41607e3c6c8bb5bf407de.tar.gz |
Add:Core:Improved osd interface
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5455 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/osd')
-rw-r--r-- | navit/osd/core/osd_core.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index f10beffcd..4e862d95a 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -81,7 +81,7 @@ struct osd_priv_common { struct odometer; -int set_std_osd_attr(struct osd_priv_common*opc, struct attr*the_attr); +int set_std_osd_attr(struct osd_priv *priv, struct attr*the_attr); static void osd_odometer_reset(struct osd_priv_common *opc, int flags); static void osd_cmd_odometer_reset(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid); static void osd_odometer_draw(struct osd_priv_common *opc, struct navit *nav, struct vehicle *v); @@ -219,8 +219,9 @@ format_float_0(double num) return g_strdup_printf("%.0f", num); } -int set_std_osd_attr(struct osd_priv_common*opc, struct attr*the_attr) +int set_std_osd_attr(struct osd_priv *priv, struct attr*the_attr) { + struct osd_priv_common *opc=(struct osd_priv_common *)priv; if(opc && the_attr && ATTR_IS_INT(the_attr->type)) { if(attr_w == the_attr->type) { opc->osd_item.w = the_attr->u.num; @@ -443,7 +444,7 @@ osd_route_guard_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.navit = nav; opc->osd_item.font_size = 200; opc->osd_item.meth.draw = osd_draw_cast(osd_route_guard_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr)) set_std_osd_attr; + meth->set_attr = set_std_osd_attr; osd_set_std_attr(attrs, &opc->osd_item, 2); attr = attr_search(attrs, NULL, attr_min_dist); @@ -920,7 +921,7 @@ osd_odometer_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.navit = nav; opc->osd_item.font_size = 200; opc->osd_item.meth.draw = osd_draw_cast(osd_odometer_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; this->bActive = 0; //do not count on init this->sum_dist = 0; @@ -1141,7 +1142,7 @@ osd_cmd_interface_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.meth.draw = osd_draw_cast(osd_cmd_interface_draw); opc->spec_set_attr_func = osd_cmd_interface_set_attr; - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; osd_set_std_attr(attrs, &opc->osd_item, 2); @@ -1300,7 +1301,7 @@ osd_stopwatch_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.navit = nav; opc->osd_item.font_size = 200; opc->osd_item.meth.draw = osd_draw_cast(osd_stopwatch_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; this->bActive = 0; //do not count on init this->current_base_time = 0; @@ -1414,7 +1415,7 @@ osd_compass_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.navit = nav; opc->osd_item.font_size = 200; opc->osd_item.meth.draw = osd_draw_cast(osd_compass_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; osd_set_std_attr(attrs, &opc->osd_item, 2); attr = attr_search(attrs, NULL, attr_width); this->width=attr ? attr->u.num : 2; @@ -1543,7 +1544,7 @@ osd_button_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.navit = nav; opc->osd_item.meth.draw = osd_draw_cast(osd_button_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; opc->spec_set_attr_func = osd_button_set_attr; attr=attr_search(attrs, NULL, attr_use_overlay); @@ -1624,7 +1625,7 @@ osd_image_new(struct navit *nav, struct osd_methods *meth, opc->data = (void*)this; opc->osd_item.navit = nav; opc->osd_item.meth.draw = osd_draw_cast(osd_button_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; opc->spec_set_attr_func = osd_button_set_attr; osd_set_std_attr(attrs, &opc->osd_item, 1); @@ -1767,7 +1768,7 @@ osd_nav_next_turn_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.h = 70; opc->osd_item.font_size = 200; opc->osd_item.meth.draw = osd_draw_cast(osd_nav_next_turn_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; osd_set_std_attr(attrs, &opc->osd_item, 0); this->icon_w = -1; @@ -1899,7 +1900,7 @@ osd_nav_toggle_announcer_new(struct navit *nav, struct osd_methods *meth, struct opc->osd_item.navit = nav; opc->osd_item.p.y = 76; opc->osd_item.meth.draw = osd_draw_cast(osd_nav_toggle_announcer_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; osd_set_std_attr(attrs, &opc->osd_item, 0); @@ -2192,7 +2193,7 @@ osd_speed_cam_new(struct navit *nav, struct osd_methods *meth, struct attr **att opc->osd_item.navit = nav; opc->osd_item.font_size = 200; opc->osd_item.meth.draw = osd_draw_cast(osd_speed_cam_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; osd_set_std_attr(attrs, &opc->osd_item, 2); attr = attr_search(attrs, NULL, attr_width); @@ -2427,7 +2428,7 @@ osd_speed_warner_new(struct navit *nav, struct osd_methods *meth, struct attr ** opc->osd_item.h=60; this->active=-1; opc->osd_item.meth.draw = osd_draw_cast(osd_speed_warner_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; attr = attr_search(attrs, NULL, attr_speed_exceed_limit_offset); if (attr) { @@ -3092,7 +3093,7 @@ osd_text_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.navit = nav; opc->osd_item.font_size = 200; opc->osd_item.meth.draw = osd_draw_cast(osd_text_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; opc->spec_set_attr_func = osd_text_set_attr; osd_set_std_attr(attrs, &opc->osd_item, 2); @@ -3203,7 +3204,7 @@ osd_gps_status_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.h = 40; opc->osd_item.font_size = 200; opc->osd_item.meth.draw = osd_draw_cast(osd_gps_status_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; osd_set_std_attr(attrs, &opc->osd_item, 0); this->icon_w = -1; @@ -3314,7 +3315,7 @@ osd_volume_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.h = 40; opc->osd_item.font_size = 200; opc->osd_item.meth.draw = osd_draw_cast(osd_volume_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; osd_set_std_attr(attrs, &opc->osd_item, 0); this->icon_w = -1; @@ -3480,7 +3481,7 @@ osd_scale_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.navit = nav; opc->osd_item.meth.draw = osd_draw_cast(osd_scale_draw); - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; osd_set_std_attr(attrs, &opc->osd_item, 3); @@ -3584,7 +3585,7 @@ osd_auxmap_new(struct navit *nav, struct osd_methods *meth, struct attr **attrs) opc->osd_item.w = 60; opc->osd_item.h = 40; opc->osd_item.font_size = 200; - meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr; + meth->set_attr = set_std_osd_attr; osd_set_std_attr(attrs, &opc->osd_item, 0); navit_add_callback(nav, callback_new_attr_1(callback_cast(osd_auxmap_init), attr_navit, opc)); |