From 1eb844ca53d3d64e42649c80006a39afd841a197 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 10 Jan 2015 04:32:10 +0100 Subject: [PATCH] (menu_navigation.c) Start documenting menu_navigation.c --- menu/menu_navigation.c | 37 +++++++++++++++++++++++++++++++++++-- menu/menu_navigation.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/menu/menu_navigation.c b/menu/menu_navigation.c index 8844a93eb1..cbde42f1a2 100644 --- a/menu/menu_navigation.c +++ b/menu/menu_navigation.c @@ -22,6 +22,13 @@ #include #include "menu_navigation.h" +/** + * menu_navigation_clear: + * @menu : menu handle + * @pending_push : pending push ? + * + * Clears the navigation pointer. + **/ void menu_navigation_clear(menu_handle_t *menu, bool pending_push) { menu->selection_ptr = 0; @@ -30,6 +37,12 @@ void menu_navigation_clear(menu_handle_t *menu, bool pending_push) driver.menu_ctx->navigation_clear(menu, pending_push); } +/** + * menu_navigation_decrement: + * @menu : menu handle + * + * Decrement the navigation pointer. + **/ void menu_navigation_decrement(menu_handle_t *menu) { menu->selection_ptr--; @@ -38,6 +51,12 @@ void menu_navigation_decrement(menu_handle_t *menu) driver.menu_ctx->navigation_decrement(menu); } +/** + * menu_navigation_increment: + * @menu : menu handle + * + * Increment the navigation pointer. + **/ void menu_navigation_increment(menu_handle_t *menu) { menu->selection_ptr++; @@ -46,14 +65,28 @@ void menu_navigation_increment(menu_handle_t *menu) driver.menu_ctx->navigation_increment(menu); } -void menu_navigation_set(menu_handle_t *menu, size_t i, bool scroll) +/** + * menu_navigation_set: + * @menu : menu handle + * @idx : index to set navigation pointer to. + * @scroll : should we scroll when needed? + * + * Sets navigation pointer to index @idx. + **/ +void menu_navigation_set(menu_handle_t *menu, size_t idx, bool scroll) { - menu->selection_ptr = i; + menu->selection_ptr = idx; if (driver.menu_ctx && driver.menu_ctx->navigation_set) driver.menu_ctx->navigation_set(menu, scroll); } +/** + * menu_navigation_set_last: + * @menu : menu handle + * + * Sets navigation pointer to last index. + **/ void menu_navigation_set_last(menu_handle_t *menu) { menu->selection_ptr = menu_list_get_size(driver.menu->menu_list) - 1; diff --git a/menu/menu_navigation.h b/menu/menu_navigation.h index fa8e97c2bb..d5f947c4cf 100644 --- a/menu/menu_navigation.h +++ b/menu/menu_navigation.h @@ -23,14 +23,47 @@ extern "C" { #endif +/** + * menu_navigation_clear: + * @menu : menu handle + * @pending_push : pending push ? + * + * Clears the navigation pointer. + **/ void menu_navigation_clear(menu_handle_t *menu, bool pending_push); +/** + * menu_navigation_decrement: + * @menu : menu handle + * + * Decrement the navigation pointer. + **/ void menu_navigation_decrement(menu_handle_t *menu); +/** + * menu_navigation_increment: + * @menu : menu handle + * + * Increment the navigation pointer. + **/ void menu_navigation_increment(menu_handle_t *menu); +/** + * menu_navigation_set: + * @menu : menu handle + * @idx : index to set navigation pointer to. + * @scroll : should we scroll when needed? + * + * Sets navigation pointer to index @idx. + **/ void menu_navigation_set(menu_handle_t *menu, size_t i, bool scroll); +/** + * menu_navigation_set_last: + * @menu : menu handle + * + * Sets navigation pointer to last index. + **/ void menu_navigation_set_last(menu_handle_t *menu); void menu_navigation_descend_alphabet(menu_handle_t *menu, size_t *ptr_out);