diff options
author | mvglasow <michael@vonglasow.com> | 2016-01-03 14:30:58 +0100 |
---|---|---|
committer | mvglasow <michael@vonglasow.com> | 2016-01-03 14:30:58 +0100 |
commit | f1dda621779deb4528e6eca50d1b8db09a2ad55d (patch) | |
tree | 658be6d1b97b918614c1fe40b3f566d0f264549a /navit/osd | |
parent | 92cbe432f829b2738fb6a39433cffdbe075b132a (diff) | |
parent | 7c59b3cbf0b8cce38164f63ad666eab60b7fe183 (diff) | |
download | navit-f1dda621779deb4528e6eca50d1b8db09a2ad55d.tar.gz |
Merge pull request #52 from mvglasow/trac1325.rebasedR6505
Add:port_android:OSD button to show Android menu
Diffstat (limited to 'navit/osd')
-rw-r--r-- | navit/osd/core/osd_core.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index 47fd5e49c..cd19aeb55 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -1412,12 +1412,29 @@ osd_compass_new(struct navit *nav, struct osd_methods *meth, struct osd_button { int use_overlay; + /* FIXME: do we need navit_init_cb? It is set in two places but never read. + * osd_button_new sets it to osd_button_init (init callback), and + * osd_button_init sets it to osd_std_click (click callback). */ struct callback *draw_cb,*navit_init_cb; struct graphics_image *img; char *src_dir,*src; }; +/** + * @brief Adjusts width and height of an OSD item to fit the image it displays. + * + * A width or height of 0%, stored in relative attributes as {@code ATTR_REL_RELSHIFT}, is used as a flag + * indicating that the respective dimension is unset, i.e. determined by the dimensions of its image. + * + * If this is the case for height and/or width, the respective dimension will be updated to fit the image. + * + * Note that this method is used by several OSD items, notably {@code osd_image}, {@code osd_button} and + * {@code osd_android_menu}. + * + * @param opc The OSD item + * @param img The image displayed by the item + */ static void osd_button_adjust_sizes(struct osd_priv_common *opc, struct graphics_image *img) { @@ -1511,7 +1528,7 @@ osd_button_icon_path(struct osd_button *this_, char *src) { if (!this_->src_dir) return graphics_icon_path(src); - return g_strdup_printf("%s%s%s",this_->src_dir, G_DIR_SEPARATOR_S, src); + return g_strdup_printf("%s%s%s", this_->src_dir, G_DIR_SEPARATOR_S, src); } int @@ -2001,6 +2018,7 @@ osd_nav_next_turn_new(struct navit *nav, struct osd_methods *meth, struct nav_toggle_announcer { int w,h; + /* FIXME this is actually the click callback, which is set once but never read. Do we need this? */ struct callback *navit_init_cb; char *icon_src; int icon_h, icon_w, active, last_state; |