diff --git a/Makefile.common b/Makefile.common index d020fe59ce..f85d226679 100644 --- a/Makefile.common +++ b/Makefile.common @@ -556,7 +556,6 @@ ifeq ($(HAVE_MENU_COMMON), 1) menu/menu_input.o \ menu/menu_event.o \ menu/menu_entries.o \ - menu/menu_navigation.o \ menu/menu_setting.o \ menu/menu_shader.o \ menu/widgets/menu_filebrowser.o \ diff --git a/griffin/griffin.c b/griffin/griffin.c index 140b36478f..94438ce0cc 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -980,7 +980,6 @@ MENU #include "../menu/cbs/menu_cbs_down.c" #include "../menu/cbs/menu_cbs_contentlist_switch.c" #include "../menu/menu_shader.c" -#include "../menu/menu_navigation.c" #include "../menu/menu_display.c" #include "../menu/menu_displaylist.c" #include "../menu/menu_animation.c" diff --git a/menu/cbs/menu_cbs_cancel.c b/menu/cbs/menu_cbs_cancel.c index aa0faab289..e7fe3fff1c 100644 --- a/menu/cbs/menu_cbs_cancel.c +++ b/menu/cbs/menu_cbs_cancel.c @@ -17,7 +17,6 @@ #include #include "../menu_driver.h" -#include "../menu_navigation.h" #include "../menu_cbs.h" #include "../../msg_hash.h" diff --git a/menu/cbs/menu_cbs_down.c b/menu/cbs/menu_cbs_down.c index 62fefa3497..a2dff2a9de 100644 --- a/menu/cbs/menu_cbs_down.c +++ b/menu/cbs/menu_cbs_down.c @@ -14,7 +14,6 @@ */ #include "../menu_driver.h" -#include "../menu_navigation.h" #include "../menu_cbs.h" #ifndef BIND_ACTION_DOWN diff --git a/menu/cbs/menu_cbs_info.c b/menu/cbs/menu_cbs_info.c index f4d2e708a8..f3c6507910 100644 --- a/menu/cbs/menu_cbs_info.c +++ b/menu/cbs/menu_cbs_info.c @@ -16,7 +16,6 @@ #include #include "../menu_driver.h" -#include "../menu_navigation.h" #include "../menu_cbs.h" #include "../widgets/menu_dialog.h" diff --git a/menu/cbs/menu_cbs_left.c b/menu/cbs/menu_cbs_left.c index 5cb83f4abb..5b14c56cf3 100644 --- a/menu/cbs/menu_cbs_left.c +++ b/menu/cbs/menu_cbs_left.c @@ -28,7 +28,6 @@ #include "../menu_input.h" #include "../menu_setting.h" #include "../menu_shader.h" -#include "../menu_navigation.h" #include "../widgets/menu_list.h" diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 1b360f1ce1..da04e15e5f 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -31,7 +31,6 @@ #include "../menu_display.h" #include "../menu_setting.h" #include "../menu_shader.h" -#include "../menu_navigation.h" #include "../widgets/menu_dialog.h" #include "../widgets/menu_filebrowser.h" #include "../widgets/menu_input_dialog.h" diff --git a/menu/cbs/menu_cbs_right.c b/menu/cbs/menu_cbs_right.c index ef2e59b106..2f9150e022 100644 --- a/menu/cbs/menu_cbs_right.c +++ b/menu/cbs/menu_cbs_right.c @@ -28,7 +28,6 @@ #include "../menu_input.h" #include "../menu_setting.h" #include "../menu_shader.h" -#include "../menu_navigation.h" #include "../widgets/menu_list.h" diff --git a/menu/cbs/menu_cbs_up.c b/menu/cbs/menu_cbs_up.c index 23a74e7c14..775c2751e2 100644 --- a/menu/cbs/menu_cbs_up.c +++ b/menu/cbs/menu_cbs_up.c @@ -15,7 +15,6 @@ #include "../menu_driver.h" #include "../menu_cbs.h" -#include "../menu_navigation.h" #ifndef BIND_ACTION_UP #define BIND_ACTION_UP(cbs, name) \ diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index adc764ab74..c6756cce46 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -43,7 +43,6 @@ #include "../menu_driver.h" #include "../menu_animation.h" -#include "../menu_navigation.h" #include "../menu_display.h" #include "../menu_event.h" diff --git a/menu/drivers/menu_generic.c b/menu/drivers/menu_generic.c index 08ff50fb2e..ec37d8cbd4 100644 --- a/menu/drivers/menu_generic.c +++ b/menu/drivers/menu_generic.c @@ -23,7 +23,6 @@ #include "../menu_driver.h" #include "../menu_display.h" -#include "../menu_navigation.h" #include "../widgets/menu_dialog.h" #include "../widgets/menu_input_bind_dialog.h" diff --git a/menu/drivers/nuklear.c b/menu/drivers/nuklear.c index 60e40cf6fa..a23b1c4373 100644 --- a/menu/drivers/nuklear.c +++ b/menu/drivers/nuklear.c @@ -37,7 +37,6 @@ #include "../menu_driver.h" #include "../menu_animation.h" -#include "../menu_navigation.h" #include "../menu_display.h" #include "../../core.h" diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 1676392cf2..3d9fdbfaa2 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -41,7 +41,6 @@ #include "../menu_driver.h" #include "../menu_animation.h" #include "../menu_display.h" -#include "../menu_navigation.h" #include "../widgets/menu_input_dialog.h" diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 3ba4face42..208b51dfb3 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -44,7 +44,6 @@ #include "../menu_driver.h" #include "../menu_animation.h" #include "../menu_display.h" -#include "../menu_navigation.h" #include "../widgets/menu_entry.h" #include "../widgets/menu_list.h" diff --git a/menu/drivers/xui.cpp b/menu/drivers/xui.cpp index 47a12f4c0f..3cdf8bc466 100644 --- a/menu/drivers/xui.cpp +++ b/menu/drivers/xui.cpp @@ -35,7 +35,6 @@ #include "../widgets/menu_entry.h" #include "../menu_entries.h" #include "../menu_input.h" -#include "../menu_navigation.h" #include "../menu_setting.h" #include "../menu_display.h" #include "../widgets/menu_input_dialog.h" diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index 945a7855f5..5542dc31fb 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -43,7 +43,6 @@ #include "../menu_animation.h" #include "../widgets/menu_entry.h" #include "../menu_display.h" -#include "../menu_navigation.h" #include "../../retroarch.h" #include "../../gfx/font_driver.h" diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 3fc25732df..1fb79b9d3a 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -52,7 +52,6 @@ #include "menu_content.h" #include "menu_driver.h" -#include "menu_navigation.h" #include "menu_shader.h" #include "widgets/menu_dialog.h" #include "widgets/menu_list.h" diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 783cf6a639..279262ab2c 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -30,7 +30,6 @@ #include "menu_cbs.h" #include "menu_display.h" #include "menu_event.h" -#include "menu_navigation.h" #include "widgets/menu_dialog.h" #include "widgets/menu_list.h" #include "menu_shader.h" @@ -84,6 +83,7 @@ static playlist_t *menu_driver_playlist = NULL; static menu_handle_t *menu_driver_data = NULL; static const menu_ctx_driver_t *menu_driver_ctx = NULL; static void *menu_userdata = NULL; +static size_t menu_driver_selection_ptr = 0; bool menu_driver_is_binding_state(void) { @@ -993,3 +993,212 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data) return true; } + +size_t menu_navigation_get_selection(void) +{ + return menu_driver_selection_ptr; +} + +void menu_navigation_set_selection(size_t val) +{ + menu_driver_selection_ptr = val; +} + +#define SCROLL_INDEX_SIZE (2 * (26 + 2) + 1) + +bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data) +{ + unsigned i; + /* Quick jumping indices with L/R. + * Rebuilt when parsing directory. */ + static size_t scroll_index_list[SCROLL_INDEX_SIZE]; + static unsigned scroll_index_size = 0; + static unsigned scroll_acceleration = 0; + + switch (state) + { + case MENU_NAVIGATION_CTL_DEINIT: + { + scroll_acceleration = 0; + menu_driver_selection_ptr = 0; + scroll_index_size = 0; + + for (i = 0; i < SCROLL_INDEX_SIZE; i++) + scroll_index_list[i] = 0; + } + break; + case MENU_NAVIGATION_CTL_CLEAR: + { + menu_navigation_set_selection(0); + menu_driver_navigation_set(true); + menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_CLEAR, data); + } + break; + case MENU_NAVIGATION_CTL_INCREMENT: + { + settings_t *settings = config_get_ptr(); + unsigned *scroll_speed = (unsigned*)data; + size_t menu_list_size = menu_entries_get_size(); + bool wraparound_enable = settings->bools.menu_navigation_wraparound_enable; + + if (!scroll_speed) + return false; + + if (menu_driver_selection_ptr >= menu_list_size - 1 + && !wraparound_enable) + return false; + + if ((menu_driver_selection_ptr + (*scroll_speed)) < menu_list_size) + { + size_t idx = menu_driver_selection_ptr + (*scroll_speed); + + menu_navigation_set_selection(idx); + menu_driver_navigation_set(true); + menu_navigation_ctl(MENU_NAVIGATION_CTL_INCREMENT, NULL); + } + else + { + if (wraparound_enable) + { + bool pending_push = false; + menu_navigation_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push); + } + else + { + if (menu_list_size > 0) + { + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_LAST, NULL); + menu_navigation_ctl(MENU_NAVIGATION_CTL_INCREMENT, NULL); + } + } + } + + menu_driver_increment_navigation(); + } + break; + case MENU_NAVIGATION_CTL_DECREMENT: + { + size_t idx = 0; + settings_t *settings = config_get_ptr(); + unsigned *scroll_speed = (unsigned*)data; + size_t menu_list_size = menu_entries_get_size(); + bool wraparound_enable = settings->bools.menu_navigation_wraparound_enable; + + if (!scroll_speed) + return false; + + if (menu_driver_selection_ptr == 0 && !wraparound_enable) + return false; + + if (menu_driver_selection_ptr >= *scroll_speed) + idx = menu_driver_selection_ptr - *scroll_speed; + else + { + idx = menu_list_size - 1; + if (!wraparound_enable) + idx = 0; + } + + menu_navigation_set_selection(idx); + menu_driver_navigation_set(true); + menu_navigation_ctl(MENU_NAVIGATION_CTL_DECREMENT, NULL); + + menu_driver_decrement_navigation(); + + } + break; + case MENU_NAVIGATION_CTL_SET_LAST: + { + size_t menu_list_size = menu_entries_get_size(); + size_t new_selection = menu_list_size - 1; + menu_navigation_set_selection(new_selection); + menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_SET_LAST, NULL); + } + break; + case MENU_NAVIGATION_CTL_ASCEND_ALPHABET: + { + size_t ptr; + size_t i = 0; + size_t *ptr_out = (size_t*)&menu_driver_selection_ptr; + size_t menu_list_size = menu_entries_get_size(); + + if (!scroll_index_size || !ptr_out) + return false; + + ptr = *ptr_out; + + if (ptr == scroll_index_list[scroll_index_size - 1]) + { + *ptr_out = menu_list_size - 1; + menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_ASCEND_ALPHABET, ptr_out); + return true; + } + + while (i < scroll_index_size - 1 + && scroll_index_list[i + 1] <= ptr) + i++; + *ptr_out = scroll_index_list[i + 1]; + + if (*ptr_out >= menu_list_size) + *ptr_out = menu_list_size - 1; + + menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_ASCEND_ALPHABET, ptr_out); + } + break; + case MENU_NAVIGATION_CTL_DESCEND_ALPHABET: + { + size_t ptr; + size_t i = 0; + size_t *ptr_out = (size_t*)&menu_driver_selection_ptr; + + if (!scroll_index_size || !ptr_out) + return false; + + ptr = *ptr_out; + + if (ptr == 0) + return false; + + i = scroll_index_size - 1; + + while (i && scroll_index_list[i - 1] >= ptr) + i--; + *ptr_out = scroll_index_list[i - 1]; + + menu_driver_ctl( + RARCH_MENU_CTL_NAVIGATION_DESCEND_ALPHABET, ptr_out); + } + break; + case MENU_NAVIGATION_CTL_CLEAR_SCROLL_INDICES: + scroll_index_size = 0; + break; + case MENU_NAVIGATION_CTL_ADD_SCROLL_INDEX: + { + size_t *sel = (size_t*)data; + if (!sel) + return false; + scroll_index_list[scroll_index_size++] = *sel; + } + break; + case MENU_NAVIGATION_CTL_GET_SCROLL_ACCEL: + { + size_t *sel = (size_t*)data; + if (!sel) + return false; + *sel = scroll_acceleration; + } + break; + case MENU_NAVIGATION_CTL_SET_SCROLL_ACCEL: + { + size_t *sel = (size_t*)data; + if (!sel) + return false; + scroll_acceleration = (unsigned)(*sel); + } + break; + case MENU_NAVIGATION_CTL_NONE: + break; + } + + return true; +} diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 0b60c17ddf..b99d0a2c2a 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -202,6 +202,22 @@ enum menu_settings_type MENU_SETTINGS_LAST }; +enum menu_navigation_ctl_state +{ + MENU_NAVIGATION_CTL_NONE = 0, + MENU_NAVIGATION_CTL_CLEAR, + MENU_NAVIGATION_CTL_DEINIT, + MENU_NAVIGATION_CTL_INCREMENT, + MENU_NAVIGATION_CTL_DECREMENT, + MENU_NAVIGATION_CTL_SET_LAST, + MENU_NAVIGATION_CTL_DESCEND_ALPHABET, + MENU_NAVIGATION_CTL_ASCEND_ALPHABET, + MENU_NAVIGATION_CTL_CLEAR_SCROLL_INDICES, + MENU_NAVIGATION_CTL_ADD_SCROLL_INDEX, + MENU_NAVIGATION_CTL_SET_SCROLL_ACCEL, + MENU_NAVIGATION_CTL_GET_SCROLL_ACCEL +}; + typedef struct { char deferred_path[PATH_MAX_LENGTH]; @@ -409,6 +425,12 @@ bool menu_driver_push_list(menu_ctx_displaylist_t *disp_list); bool menu_driver_init(bool video_is_threaded); +size_t menu_navigation_get_selection(void); + +void menu_navigation_set_selection(size_t val); + +bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data); + extern menu_ctx_driver_t menu_ctx_xui; extern menu_ctx_driver_t menu_ctx_rgui; extern menu_ctx_driver_t menu_ctx_mui; diff --git a/menu/menu_entries.c b/menu/menu_entries.c index cd44a11816..6eefb6c736 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -22,7 +22,6 @@ #include "menu_driver.h" #include "menu_cbs.h" -#include "menu_navigation.h" #include "widgets/menu_list.h" diff --git a/menu/menu_event.c b/menu/menu_event.c index 27c94c384e..9a3accd5f5 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -32,7 +32,6 @@ #include "menu_driver.h" #include "menu_animation.h" #include "menu_display.h" -#include "menu_navigation.h" #include "../configuration.h" #include "../retroarch.h" diff --git a/menu/menu_input.c b/menu/menu_input.c index a2e16e67c1..ca6e2faedf 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -30,7 +30,6 @@ #include "menu_driver.h" #include "menu_input.h" #include "menu_animation.h" -#include "menu_navigation.h" #include "menu_event.h" #include "../configuration.h" diff --git a/menu/menu_navigation.c b/menu/menu_navigation.c deleted file mode 100644 index de049a60fb..0000000000 --- a/menu/menu_navigation.c +++ /dev/null @@ -1,236 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2017 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#include -#include -#include -#include -#include - -#include - -#include "../configuration.h" -#include "menu_driver.h" -#include "menu_navigation.h" - -static size_t selection_ptr = 0; - -size_t menu_navigation_get_selection(void) -{ - return selection_ptr; -} - -void menu_navigation_set_selection(size_t val) -{ - selection_ptr = val; -} - -#define SCROLL_INDEX_SIZE (2 * (26 + 2) + 1) - -bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data) -{ - unsigned i; - /* Quick jumping indices with L/R. - * Rebuilt when parsing directory. */ - static size_t scroll_index_list[SCROLL_INDEX_SIZE]; - static unsigned scroll_index_size = 0; - static unsigned scroll_acceleration = 0; - - switch (state) - { - case MENU_NAVIGATION_CTL_DEINIT: - { - scroll_acceleration = 0; - selection_ptr = 0; - scroll_index_size = 0; - - for (i = 0; i < SCROLL_INDEX_SIZE; i++) - scroll_index_list[i] = 0; - } - break; - case MENU_NAVIGATION_CTL_CLEAR: - { - menu_navigation_set_selection(0); - menu_driver_navigation_set(true); - menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_CLEAR, data); - } - break; - case MENU_NAVIGATION_CTL_INCREMENT: - { - settings_t *settings = config_get_ptr(); - unsigned *scroll_speed = (unsigned*)data; - size_t menu_list_size = menu_entries_get_size(); - bool wraparound_enable = settings->bools.menu_navigation_wraparound_enable; - - if (!scroll_speed) - return false; - - if (selection_ptr >= menu_list_size - 1 - && !wraparound_enable) - return false; - - if ((selection_ptr + (*scroll_speed)) < menu_list_size) - { - size_t idx = selection_ptr + (*scroll_speed); - - menu_navigation_set_selection(idx); - menu_driver_navigation_set(true); - menu_navigation_ctl(MENU_NAVIGATION_CTL_INCREMENT, NULL); - } - else - { - if (wraparound_enable) - { - bool pending_push = false; - menu_navigation_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push); - } - else - { - if (menu_list_size > 0) - { - menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_LAST, NULL); - menu_navigation_ctl(MENU_NAVIGATION_CTL_INCREMENT, NULL); - } - } - } - - menu_driver_increment_navigation(); - } - break; - case MENU_NAVIGATION_CTL_DECREMENT: - { - size_t idx = 0; - settings_t *settings = config_get_ptr(); - unsigned *scroll_speed = (unsigned*)data; - size_t menu_list_size = menu_entries_get_size(); - bool wraparound_enable = settings->bools.menu_navigation_wraparound_enable; - - if (!scroll_speed) - return false; - - if (selection_ptr == 0 && !wraparound_enable) - return false; - - if (selection_ptr >= *scroll_speed) - idx = selection_ptr - *scroll_speed; - else - { - idx = menu_list_size - 1; - if (!wraparound_enable) - idx = 0; - } - - menu_navigation_set_selection(idx); - menu_driver_navigation_set(true); - menu_navigation_ctl(MENU_NAVIGATION_CTL_DECREMENT, NULL); - - menu_driver_decrement_navigation(); - - } - break; - case MENU_NAVIGATION_CTL_SET_LAST: - { - size_t menu_list_size = menu_entries_get_size(); - size_t new_selection = menu_list_size - 1; - menu_navigation_set_selection(new_selection); - menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_SET_LAST, NULL); - } - break; - case MENU_NAVIGATION_CTL_ASCEND_ALPHABET: - { - size_t i = 0, ptr; - size_t *ptr_out = (size_t*)&selection_ptr; - size_t menu_list_size = menu_entries_get_size(); - - if (!scroll_index_size || !ptr_out) - return false; - - ptr = *ptr_out; - - if (ptr == scroll_index_list[scroll_index_size - 1]) - { - *ptr_out = menu_list_size - 1; - menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_ASCEND_ALPHABET, ptr_out); - return true; - } - - while (i < scroll_index_size - 1 - && scroll_index_list[i + 1] <= ptr) - i++; - *ptr_out = scroll_index_list[i + 1]; - - if (*ptr_out >= menu_list_size) - *ptr_out = menu_list_size - 1; - - menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_ASCEND_ALPHABET, ptr_out); - } - break; - case MENU_NAVIGATION_CTL_DESCEND_ALPHABET: - { - size_t i = 0, ptr; - size_t *ptr_out = (size_t*)&selection_ptr; - - if (!scroll_index_size || !ptr_out) - return false; - - ptr = *ptr_out; - - if (ptr == 0) - return false; - - i = scroll_index_size - 1; - - while (i && scroll_index_list[i - 1] >= ptr) - i--; - *ptr_out = scroll_index_list[i - 1]; - - menu_driver_ctl( - RARCH_MENU_CTL_NAVIGATION_DESCEND_ALPHABET, ptr_out); - } - break; - case MENU_NAVIGATION_CTL_CLEAR_SCROLL_INDICES: - scroll_index_size = 0; - break; - case MENU_NAVIGATION_CTL_ADD_SCROLL_INDEX: - { - size_t *sel = (size_t*)data; - if (!sel) - return false; - scroll_index_list[scroll_index_size++] = *sel; - } - break; - case MENU_NAVIGATION_CTL_GET_SCROLL_ACCEL: - { - size_t *sel = (size_t*)data; - if (!sel) - return false; - *sel = scroll_acceleration; - } - break; - case MENU_NAVIGATION_CTL_SET_SCROLL_ACCEL: - { - size_t *sel = (size_t*)data; - if (!sel) - return false; - scroll_acceleration = (unsigned)(*sel); - } - break; - case MENU_NAVIGATION_CTL_NONE: - break; - } - - return true; -} diff --git a/menu/menu_navigation.h b/menu/menu_navigation.h deleted file mode 100644 index 7db5e36916..0000000000 --- a/menu/menu_navigation.h +++ /dev/null @@ -1,51 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2017 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#ifndef _MENU_NAVIGATION_H -#define _MENU_NAVIGATION_H - -#include - -#include -#include - -RETRO_BEGIN_DECLS - -enum menu_navigation_ctl_state -{ - MENU_NAVIGATION_CTL_NONE = 0, - MENU_NAVIGATION_CTL_CLEAR, - MENU_NAVIGATION_CTL_DEINIT, - MENU_NAVIGATION_CTL_INCREMENT, - MENU_NAVIGATION_CTL_DECREMENT, - MENU_NAVIGATION_CTL_SET_LAST, - MENU_NAVIGATION_CTL_DESCEND_ALPHABET, - MENU_NAVIGATION_CTL_ASCEND_ALPHABET, - MENU_NAVIGATION_CTL_CLEAR_SCROLL_INDICES, - MENU_NAVIGATION_CTL_ADD_SCROLL_INDEX, - MENU_NAVIGATION_CTL_SET_SCROLL_ACCEL, - MENU_NAVIGATION_CTL_GET_SCROLL_ACCEL -}; - -size_t menu_navigation_get_selection(void); - -void menu_navigation_set_selection(size_t val); - -bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data); - -RETRO_END_DECLS - -#endif diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 95717a19fa..00618b947e 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -56,7 +56,6 @@ #include "menu_animation.h" #include "menu_display.h" #include "menu_input.h" -#include "menu_navigation.h" #include "../core.h" #include "../configuration.h" diff --git a/menu/widgets/menu_entry.c b/menu/widgets/menu_entry.c index 12d1923135..8895e3bd26 100644 --- a/menu/widgets/menu_entry.c +++ b/menu/widgets/menu_entry.c @@ -21,7 +21,6 @@ #include "menu_input_dialog.h" #include "../menu_driver.h" -#include "../menu_navigation.h" /* This file provides an abstraction of the currently displayed * menu. diff --git a/menu/widgets/menu_input_bind_dialog.c b/menu/widgets/menu_input_bind_dialog.c index 79bf82248c..8e12e4d10d 100644 --- a/menu/widgets/menu_input_bind_dialog.c +++ b/menu/widgets/menu_input_bind_dialog.c @@ -21,7 +21,6 @@ #include "menu_input_bind_dialog.h" #include "../menu_driver.h" -#include "../menu_navigation.h" #include "../../input/input_config.h" diff --git a/menu/widgets/menu_input_dialog.c b/menu/widgets/menu_input_dialog.c index 3cce3a4cfd..dd9fe1ea5e 100644 --- a/menu/widgets/menu_input_dialog.c +++ b/menu/widgets/menu_input_dialog.c @@ -19,7 +19,6 @@ #include "menu_input_dialog.h" #include "../menu_driver.h" -#include "../menu_navigation.h" #include "../../input/input_driver.h" static const char **menu_input_dialog_keyboard_buffer = {NULL}; diff --git a/menu/widgets/menu_list.c b/menu/widgets/menu_list.c index b6cfab843a..f135686458 100644 --- a/menu/widgets/menu_list.c +++ b/menu/widgets/menu_list.c @@ -20,7 +20,6 @@ #include "menu_list.h" #include "../menu_driver.h" -#include "../menu_navigation.h" struct menu_list { diff --git a/ui/drivers/cocoa/cocoatouch_menu.m b/ui/drivers/cocoa/cocoatouch_menu.m index e10f996297..40ea236f79 100644 --- a/ui/drivers/cocoa/cocoatouch_menu.m +++ b/ui/drivers/cocoa/cocoatouch_menu.m @@ -34,7 +34,7 @@ #ifdef HAVE_MENU #include "../../../menu/widgets/menu_entry.h" -#include "../../../menu/menu_navigation.h" +#include "../../../menu/menu_driver.h" #include "../../../menu/drivers/menu_generic.h" #endif