From 595430993252adf48bb2cdf2e5ea1b90a1ab86a8 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Fri, 6 Nov 2015 17:14:33 +0100 Subject: Add:port_android:OSD button and command to show Android menu Signed-off-by: mvglasow --- navit/osd/core/osd_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'navit/osd/core') diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index 56bcd2325..8166e54a2 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -1414,6 +1414,9 @@ 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; @@ -1513,7 +1516,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 @@ -2003,6 +2006,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; -- cgit v1.2.1 From 719cabfa36380f855f8b68d29d849d4d3c3c2869 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Sun, 8 Nov 2015 13:03:02 +0100 Subject: Refactor:osd_core:Document osd_button_adjust_sizes() --- navit/osd/core/osd_core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'navit/osd/core') diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index 8166e54a2..4754cc392 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -1423,6 +1423,20 @@ struct osd_button { }; +/** + * @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) { -- cgit v1.2.1