summaryrefslogtreecommitdiff
path: root/navit/osd.c
diff options
context:
space:
mode:
authormvglasow <michael -at- vonglasow.com>2015-11-11 15:58:49 +0100
committermvglasow <michael -at- vonglasow.com>2015-11-11 15:58:49 +0100
commit36b16c73223a09e2912c2a0918807cbccec60c75 (patch)
tree35ebc2957ab6911c002cb827c05b08be3197d526 /navit/osd.c
parent9768ab8641c6ba59d036902617960a995c2f9784 (diff)
downloadnavit-36b16c73223a09e2912c2a0918807cbccec60c75.tar.gz
Refactor:core:Add some docs and debug output to OSD and command code
Signed-off-by: mvglasow <michael -at- vonglasow.com>
Diffstat (limited to 'navit/osd.c')
-rw-r--r--navit/osd.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/navit/osd.c b/navit/osd.c
index d5841b1ec..8bc0eb50c 100644
--- a/navit/osd.c
+++ b/navit/osd.c
@@ -237,11 +237,24 @@ osd_std_keypress(struct osd_item *item, struct navit *nav, char *key)
osd_evaluate_command(item, nav);
}
+/**
+ * @brief Configures or unconfigures an OSD item.
+ *
+ * This method evaluates the result of the last execution of {@code cs}. If it evaluates to true, the
+ * item is configured, else it is unconfigured. (A configured item is displayed on the screen and can
+ * respond to user input, an unconfigured item is invisible and cannot receive user input.)
+ *
+ * If an error occurred during evaluation of {@code cs}, the item's configuration state is not changed.
+ *
+ * @param item The OSD item to reconfigure
+ * @param cs The command to evaluate
+ */
static void
osd_std_reconfigure(struct osd_item *item, struct command_saved *cs)
{
char *err = NULL; /* Error description */
+ dbg(lvl_debug, "enter, item=%p, cs=%p\n", item, cs);
if (!command_saved_error(cs)) {
item->configured = !! command_saved_get_int(cs);
if (item->gr && !(item->flags & 16))
@@ -336,7 +349,7 @@ osd_std_config(struct osd_item *item, struct navit *navit)
struct attr attr;
char *err = NULL; /* Error description */
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug, "enter, item=%p, enable_cs=%p\n", item, item->enable_cs);
if (item->enable_cs) {
item->reconfig_cb = callback_new_1(callback_cast(osd_std_reconfigure), item);
command_saved_set_cb(item->enable_cs, item->reconfig_cb);
@@ -360,6 +373,7 @@ osd_std_config(struct osd_item *item, struct navit *navit)
void
osd_set_std_config(struct navit *nav, struct osd_item *item)
{
+ dbg(lvl_debug, "enter, item=%p\n", item);
item->cb = callback_new_attr_2(callback_cast(osd_std_config), attr_osd_configuration, item, nav);
navit_add_callback(nav, item->cb);
osd_std_config(item, nav);