diff --git a/Makefile.common b/Makefile.common index a958d2accf..670b99243e 100644 --- a/Makefile.common +++ b/Makefile.common @@ -357,6 +357,7 @@ ifeq ($(HAVE_MENU_COMMON), 1) menu/menu_entries_cbs.o \ menu/menu_list.o \ menu/menu_display.o \ + menu/menu_displaylist.o \ menu/menu_animation.o \ menu/drivers/null.o endif diff --git a/griffin/griffin.c b/griffin/griffin.c index cc6e7ca404..fb00fb7ce2 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -732,6 +732,7 @@ MENU #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" #include "../menu/menu_database.c" diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c new file mode 100644 index 0000000000..56e76cb6f2 --- /dev/null +++ b/menu/menu_displaylist.c @@ -0,0 +1,37 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2015 - 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 "menu.h" +#include "menu_display.h" +#include "menu_entries.h" + +int menu_displaylist_push(file_list_t *list, file_list_t *menu_list) +{ + menu_handle_t *menu = menu_driver_get_ptr(); + driver_t *driver = driver_get_ptr(); + int ret = menu_entries_deferred_push(list, menu_list); + + menu->need_refresh = false; + + if (ret == 0) + { + const ui_companion_driver_t *ui = ui_companion_get_ptr(); + + if (ui) + ui->notify_list_loaded(driver->ui_companion_data, list, menu_list); + } + + return ret; +} diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h new file mode 100644 index 0000000000..66c9d8405a --- /dev/null +++ b/menu/menu_displaylist.h @@ -0,0 +1,31 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2015 - 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_DISPLAYLIST_H +#define _MENU_DISPLAYLIST_H + +#include "menu_list.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int menu_displaylist_push(file_list_t *list, file_list_t *menu_list); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/menu/menu_entries_cbs_deferred_push.c b/menu/menu_entries_cbs_deferred_push.c index aec273981f..c6b02b695a 100644 --- a/menu/menu_entries_cbs_deferred_push.c +++ b/menu/menu_entries_cbs_deferred_push.c @@ -15,6 +15,7 @@ #include #include "menu.h" +#include "menu_displaylist.h" #include "menu_entries_cbs.h" #include "menu_setting.h" #include "menu_entries.h" @@ -2090,7 +2091,7 @@ int deferred_push_content_list(void *data, void *userdata, menu_handle_t *menu = menu_driver_get_ptr(); if (!menu) return -1; - return menu_entries_deferred_push((file_list_t*)data, menu->menu_list->selection_buf); + return menu_displaylist_push((file_list_t*)data, menu->menu_list->selection_buf); } static int deferred_push_database_manager_list(void *data, void *userdata, diff --git a/menu/menu_entries_cbs_refresh.c b/menu/menu_entries_cbs_refresh.c index 76e1de882a..9ed44aceb7 100644 --- a/menu/menu_entries_cbs_refresh.c +++ b/menu/menu_entries_cbs_refresh.c @@ -14,30 +14,13 @@ */ #include "menu.h" +#include "menu_displaylist.h" #include "menu_entries.h" #include "menu_entries_cbs.h" static int action_refresh_default(file_list_t *list, file_list_t *menu_list) { - int ret = 0; - driver_t *driver = driver_get_ptr(); - menu_handle_t *menu = menu_driver_get_ptr(); - if (!menu) - return -1; - - ret = menu_entries_deferred_push(list, menu_list); - - menu->need_refresh = false; - - if (ret == 0) - { - const ui_companion_driver_t *ui = ui_companion_get_ptr(); - - if (ui) - ui->notify_list_loaded(driver->ui_companion_data, list, menu_list); - } - - return ret; + return menu_displaylist_push(list, menu_list); } void menu_entries_cbs_init_bind_refresh(menu_file_list_cbs_t *cbs,