diff --git a/command.c b/command.c index a55eed7c12..f3214b2622 100644 --- a/command.c +++ b/command.c @@ -89,6 +89,7 @@ #include "managers/cheat_manager.h" #include "managers/state_manager.h" #include "ui/ui_companion_driver.h" +#include "tasks/task_content.h" #include "tasks/tasks_internal.h" #include "list_special.h" diff --git a/configuration.c b/configuration.c index 3471e71807..9880f7cf44 100644 --- a/configuration.c +++ b/configuration.c @@ -50,6 +50,7 @@ #include "verbosity.h" #include "lakka.h" +#include "tasks/task_content.h" #include "tasks/tasks_internal.h" #include "../list_special.h" diff --git a/frontend/frontend.c b/frontend/frontend.c index c1e281228a..3c954f20f1 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -29,9 +29,10 @@ #endif #include "frontend.h" +#include "frontend_driver.h" #include "../configuration.h" #include "../ui/ui_companion_driver.h" -#include "../tasks/tasks_internal.h" +#include "../tasks/task_content.h" #include "../driver.h" #include "../paths.h" diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index 773cf408fb..7afdfdb845 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -44,6 +44,7 @@ #include "../../driver.h" #include "../../paths.h" #include "../../retroarch.h" +#include "../../tasks/task_content.h" #include "../../tasks/tasks_internal.h" #include "../../core_info.h" @@ -51,7 +52,6 @@ #include #include -#include "../../retroarch.h" #include "../../input/input_driver.h" #include "../../input/input_keymaps.h" #include "../video_thread_wrapper.h" diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index c8f5dbe88e..18019b2f7b 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -57,6 +57,7 @@ #include "../../defaults.h" #include "../../managers/core_option_manager.h" #include "../../managers/cheat_manager.h" +#include "../../tasks/task_content.h" #include "../../tasks/task_file_transfer.h" #include "../../tasks/tasks_internal.h" #include "../../input/input_remapping.h" diff --git a/menu/drivers/ozone/ozone.c b/menu/drivers/ozone/ozone.c index dd133b282a..bbb066f61a 100644 --- a/menu/drivers/ozone/ozone.c +++ b/menu/drivers/ozone/ozone.c @@ -48,6 +48,7 @@ #include "../../../core_info.h" #include "../../../core.h" #include "../../../verbosity.h" +#include "../../../tasks/task_powerstate.h" #include "../../../tasks/tasks_internal.h" #include "../../../dynamic.h" diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 7c6ac6b526..25e64e2bbe 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -60,6 +60,7 @@ #include "../../playlist.h" #include "../../retroarch.h" +#include "../../tasks/task_powerstate.h" #include "../../tasks/tasks_internal.h" #include "../../cheevos/badges.h" diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c index ae0767a7cf..662c741bb3 100644 --- a/network/netplay/netplay_frontend.c +++ b/network/netplay/netplay_frontend.c @@ -36,7 +36,9 @@ #include "netplay_private.h" #include "../../configuration.h" +#include "../../frontend/frontend_driver.h" #include "../../input/input_driver.h" +#include "../../tasks/task_content.h" #include "../../tasks/tasks_internal.h" #include "../../file_path_special.h" #include "../../paths.h" diff --git a/retroarch.c b/retroarch.c index b523c6d747..6c509b6ccc 100644 --- a/retroarch.c +++ b/retroarch.c @@ -112,6 +112,7 @@ #include "managers/core_option_manager.h" #include "managers/cheat_manager.h" #include "managers/state_manager.h" +#include "tasks/task_content.h" #include "tasks/tasks_internal.h" #include "performance_counters.h" diff --git a/tasks/task_content.c b/tasks/task_content.c index 3445f69383..6aed80dd5f 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -69,6 +69,7 @@ #include "../cheevos/cheevos.h" #endif +#include "task_content.h" #include "tasks_internal.h" #include "../command.h" diff --git a/tasks/task_content.h b/tasks/task_content.h new file mode 100644 index 0000000000..7055307181 --- /dev/null +++ b/tasks/task_content.h @@ -0,0 +1,117 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2017 - Higor Euripedes + * 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 TASKS_HANDLER_CONTENT_H +#define TASKS_HANDLER_CONTENT_H + +#include + +#include +#include +#include + +#include + +#ifdef HAVE_CONFIG_H +#include "../config.h" +#endif + +#include "../content.h" +#include "../core_type.h" + +RETRO_BEGIN_DECLS + +enum content_mode_load +{ + CONTENT_MODE_LOAD_NONE = 0, + CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU, + CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU, + CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU +}; + +bool task_push_load_content_with_current_core_from_companion_ui( + const char *fullpath, + content_ctx_info_t *content_info, + enum rarch_core_type type, + retro_task_callback_t cb, + void *user_data); + +bool task_push_load_content_from_cli( + const char *core_path, + const char *fullpath, + content_ctx_info_t *content_info, + enum rarch_core_type type, + retro_task_callback_t cb, + void *user_data); + +bool task_push_load_new_core( + const char *core_path, + const char *fullpath, + content_ctx_info_t *content_info, + enum rarch_core_type type, + retro_task_callback_t cb, + void *user_data); + +bool task_push_start_builtin_core(content_ctx_info_t *content_info, + enum rarch_core_type type, + retro_task_callback_t cb, + void *user_data); + +bool task_push_start_current_core(content_ctx_info_t *content_info); + +bool task_push_start_dummy_core(content_ctx_info_t *content_info); + +bool task_push_load_content_with_new_core_from_companion_ui( + const char *core_path, + const char *fullpath, + const char *label, + content_ctx_info_t *content_info, + retro_task_callback_t cb, + void *user_data); + +#ifdef HAVE_MENU +bool task_push_load_content_with_new_core_from_menu( + const char *core_path, + const char *fullpath, + content_ctx_info_t *content_info, + enum rarch_core_type type, + retro_task_callback_t cb, + void *user_data); + +bool task_push_load_content_from_playlist_from_menu( + const char *core_path, + const char *fullpath, + const char *label, + content_ctx_info_t *content_info, + retro_task_callback_t cb, + void *user_data); + +bool task_push_load_content_with_core_from_menu( + const char *fullpath, + content_ctx_info_t *content_info, + enum rarch_core_type type, + retro_task_callback_t cb, + void *user_data); +bool task_push_load_subsystem_with_core_from_menu( + const char *fullpath, + content_ctx_info_t *content_info, + enum rarch_core_type type, + retro_task_callback_t cb, + void *user_data); +#endif + +RETRO_END_DECLS + +#endif diff --git a/tasks/task_netplay_find_content.c b/tasks/task_netplay_find_content.c index 86667219b8..3236253590 100644 --- a/tasks/task_netplay_find_content.c +++ b/tasks/task_netplay_find_content.c @@ -27,6 +27,7 @@ #include #include +#include "task_content.h" #include "tasks_internal.h" #include "../file_path_special.h" #include "../verbosity.h" diff --git a/tasks/task_powerstate.h b/tasks/task_powerstate.h new file mode 100644 index 0000000000..a3f7270faf --- /dev/null +++ b/tasks/task_powerstate.h @@ -0,0 +1,37 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2017 - Higor Euripedes + * 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 TASK_POWER_STATE_H +#define TASK_POWER_STATE_H + +#include + +#include +#include +#include + +#ifdef HAVE_CONFIG_H +#include "../config.h" +#endif + +RETRO_BEGIN_DECLS + +void task_push_get_powerstate(void); + +enum frontend_powerstate get_last_powerstate(int *percent); + +RETRO_END_DECLS + +#endif diff --git a/tasks/task_save.c b/tasks/task_save.c index d79139ad88..155d31f2ab 100644 --- a/tasks/task_save.c +++ b/tasks/task_save.c @@ -44,6 +44,7 @@ #include "../network/netplay/netplay.h" #endif +#include "../content.h" #include "../core.h" #include "../file_path_special.h" #include "../configuration.h" diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 06d4c98b19..d4e02d5a1b 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -30,19 +30,8 @@ #include "../audio/audio_driver.h" -#include "../content.h" -#include "../core_type.h" - RETRO_BEGIN_DECLS -enum content_mode_load -{ - CONTENT_MODE_LOAD_NONE = 0, - CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU, - CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU, - CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU -}; - #ifdef HAVE_NETWORKING typedef struct { @@ -99,77 +88,6 @@ bool task_push_decompress( retro_task_callback_t cb, void *user_data); -bool task_push_load_content_with_current_core_from_companion_ui( - const char *fullpath, - content_ctx_info_t *content_info, - enum rarch_core_type type, - retro_task_callback_t cb, - void *user_data); - -bool task_push_load_content_from_cli( - const char *core_path, - const char *fullpath, - content_ctx_info_t *content_info, - enum rarch_core_type type, - retro_task_callback_t cb, - void *user_data); - -bool task_push_load_new_core( - const char *core_path, - const char *fullpath, - content_ctx_info_t *content_info, - enum rarch_core_type type, - retro_task_callback_t cb, - void *user_data); - -bool task_push_start_builtin_core(content_ctx_info_t *content_info, - enum rarch_core_type type, - retro_task_callback_t cb, - void *user_data); - -bool task_push_start_current_core(content_ctx_info_t *content_info); - -bool task_push_start_dummy_core(content_ctx_info_t *content_info); - -bool task_push_load_content_with_new_core_from_companion_ui( - const char *core_path, - const char *fullpath, - const char *label, - content_ctx_info_t *content_info, - retro_task_callback_t cb, - void *user_data); - -#ifdef HAVE_MENU -bool task_push_load_content_with_new_core_from_menu( - const char *core_path, - const char *fullpath, - content_ctx_info_t *content_info, - enum rarch_core_type type, - retro_task_callback_t cb, - void *user_data); - -bool task_push_load_content_from_playlist_from_menu( - const char *core_path, - const char *fullpath, - const char *label, - content_ctx_info_t *content_info, - retro_task_callback_t cb, - void *user_data); - -bool task_push_load_content_with_core_from_menu( - const char *fullpath, - content_ctx_info_t *content_info, - enum rarch_core_type type, - retro_task_callback_t cb, - void *user_data); -bool task_push_load_subsystem_with_core_from_menu( - const char *fullpath, - content_ctx_info_t *content_info, - enum rarch_core_type type, - retro_task_callback_t cb, - void *user_data); -#endif - void task_file_load_handler(retro_task_t *task); bool task_audio_mixer_load_handler(retro_task_t *task); @@ -207,10 +125,6 @@ bool input_autoconfigure_get_swap_override(void); void input_autoconfigure_joypad_reindex_devices(void); -void task_push_get_powerstate(void); - -enum frontend_powerstate get_last_powerstate(int *percent); - bool task_push_audio_mixer_load_and_play( const char *fullpath, retro_task_callback_t cb, void *user_data, bool system, diff --git a/ui/drivers/qt/ui_qt_window.cpp b/ui/drivers/qt/ui_qt_window.cpp index cdfd39b98a..8d5026901e 100644 --- a/ui/drivers/qt/ui_qt_window.cpp +++ b/ui/drivers/qt/ui_qt_window.cpp @@ -67,6 +67,7 @@ extern "C" { #include "../../../menu/menu_driver.h" #endif #include "../../../config.def.h" +#include "../../../tasks/task_content.h" #include "../../../tasks/tasks_internal.h" #include #include