2016-02-09 16:12:39 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2017-01-22 12:40:32 +00:00
|
|
|
* Copyright (C) 2011-2017 - Higor Euripedes
|
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2016-02-09 16:12:39 +00:00
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef TASKS_HANDLER_INTERNAL_H
|
|
|
|
#define TASKS_HANDLER_INTERNAL_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2016-06-03 00:43:30 +00:00
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
#include <boolean.h>
|
2016-06-03 00:43:30 +00:00
|
|
|
#include <retro_common_api.h>
|
2016-12-29 22:14:48 +00:00
|
|
|
#include <retro_miscellaneous.h>
|
2016-02-09 16:12:39 +00:00
|
|
|
|
2016-02-09 17:13:47 +00:00
|
|
|
#include <queues/task_queue.h>
|
2016-02-09 16:12:39 +00:00
|
|
|
|
2017-02-21 17:55:11 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../config.h"
|
|
|
|
#endif
|
|
|
|
|
2019-12-23 17:34:44 +00:00
|
|
|
#if defined(HAVE_NETWORKING)
|
|
|
|
#include "../core_updater_list.h"
|
|
|
|
#endif
|
|
|
|
|
2019-05-16 13:32:25 +00:00
|
|
|
#include "../playlist.h"
|
|
|
|
|
2020-06-04 11:19:24 +00:00
|
|
|
/* Required for task_push_core_backup() */
|
|
|
|
#include "../core_backup.h"
|
|
|
|
|
2016-06-03 00:43:30 +00:00
|
|
|
RETRO_BEGIN_DECLS
|
2016-06-02 23:14:53 +00:00
|
|
|
|
2019-08-22 21:31:33 +00:00
|
|
|
typedef struct nbio_buf
|
|
|
|
{
|
|
|
|
void *buf;
|
|
|
|
unsigned bufsize;
|
|
|
|
char *path;
|
|
|
|
} nbio_buf_t;
|
|
|
|
|
2020-01-19 05:40:07 +00:00
|
|
|
typedef struct autoconfig_params autoconfig_params_t;
|
|
|
|
|
|
|
|
struct autoconfig_params
|
|
|
|
{
|
|
|
|
int32_t vid;
|
|
|
|
int32_t pid;
|
|
|
|
unsigned idx;
|
|
|
|
uint32_t max_users;
|
|
|
|
char *name;
|
|
|
|
char *autoconfig_directory;
|
2020-02-14 11:12:59 +00:00
|
|
|
bool show_hidden_files;
|
2020-01-19 05:40:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-05-10 17:43:15 +00:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-09-16 22:22:55 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2017-09-29 20:16:17 +00:00
|
|
|
char *data;
|
|
|
|
size_t len;
|
2016-09-16 22:22:55 +00:00
|
|
|
} http_transfer_data_t;
|
|
|
|
|
2016-05-27 16:14:47 +00:00
|
|
|
void *task_push_http_transfer(const char *url, bool mute, const char *type,
|
2017-03-02 22:36:25 +00:00
|
|
|
retro_task_callback_t cb, void *userdata);
|
2019-09-30 03:09:08 +00:00
|
|
|
|
|
|
|
void *task_push_http_transfer_with_user_agent(const char *url, bool mute, const char *type,
|
|
|
|
const char* user_agent, retro_task_callback_t cb, void *userdata);
|
2017-03-02 22:36:25 +00:00
|
|
|
|
|
|
|
void *task_push_http_post_transfer(const char *url, const char *post_data, bool mute, const char *type,
|
2016-02-09 16:47:04 +00:00
|
|
|
retro_task_callback_t cb, void *userdata);
|
2016-05-05 04:11:28 +00:00
|
|
|
|
2020-02-15 03:12:49 +00:00
|
|
|
void *task_push_http_post_transfer_with_user_agent(const char* url, const char* post_data, bool mute,
|
|
|
|
const char* type, const char* user_agent, retro_task_callback_t cb, void* user_data);
|
|
|
|
|
2016-05-06 04:31:25 +00:00
|
|
|
task_retriever_info_t *http_task_get_transfer_list(void);
|
2016-11-29 23:18:27 +00:00
|
|
|
|
2020-06-17 11:56:44 +00:00
|
|
|
bool task_push_bluetooth_scan(retro_task_callback_t cb);
|
|
|
|
|
2017-05-15 00:44:24 +00:00
|
|
|
bool task_push_wifi_scan(retro_task_callback_t cb);
|
2016-11-29 23:18:27 +00:00
|
|
|
|
2017-05-15 00:08:59 +00:00
|
|
|
bool task_push_netplay_lan_scan(retro_task_callback_t cb);
|
2016-12-02 23:56:29 +00:00
|
|
|
|
2017-01-22 23:57:50 +00:00
|
|
|
bool task_push_netplay_crc_scan(uint32_t crc, char* name,
|
2019-01-13 17:10:53 +00:00
|
|
|
const char *hostname, const char *corename, const char* subsystem);
|
2017-01-22 02:17:50 +00:00
|
|
|
|
2017-05-15 00:08:59 +00:00
|
|
|
bool task_push_netplay_lan_scan_rooms(retro_task_callback_t cb);
|
|
|
|
|
2017-02-21 04:27:50 +00:00
|
|
|
bool task_push_netplay_nat_traversal(void *nat_traversal_state, uint16_t port);
|
2017-02-21 00:08:31 +00:00
|
|
|
|
2019-12-23 17:34:44 +00:00
|
|
|
/* Core updater tasks */
|
2020-06-16 10:11:09 +00:00
|
|
|
|
2019-12-23 17:34:44 +00:00
|
|
|
void *task_push_get_core_updater_list(
|
|
|
|
core_updater_list_t* core_list, bool mute, bool refresh_menu);
|
2020-06-16 10:11:09 +00:00
|
|
|
/* Note: If crc is set to 0, crc of local core file
|
|
|
|
* will be calculated automatically */
|
2019-12-23 17:34:44 +00:00
|
|
|
void *task_push_core_updater_download(
|
2020-06-16 10:11:09 +00:00
|
|
|
core_updater_list_t* core_list,
|
|
|
|
const char *filename, uint32_t crc, bool mute,
|
|
|
|
bool auto_backup, size_t auto_backup_history_size,
|
|
|
|
const char *path_dir_libretro,
|
|
|
|
const char *path_dir_core_assets);
|
|
|
|
void task_push_update_installed_cores(
|
|
|
|
bool auto_backup, size_t auto_backup_history_size,
|
|
|
|
const char *path_dir_libretro,
|
|
|
|
const char *path_dir_core_assets);
|
2020-06-04 11:19:24 +00:00
|
|
|
|
2019-05-24 11:02:02 +00:00
|
|
|
bool task_push_pl_entry_thumbnail_download(
|
|
|
|
const char *system,
|
|
|
|
playlist_t *playlist,
|
|
|
|
unsigned idx,
|
|
|
|
bool overwrite,
|
|
|
|
bool mute);
|
2020-02-16 19:03:57 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_MENU
|
|
|
|
bool task_push_pl_thumbnail_download(
|
2020-06-26 14:39:03 +00:00
|
|
|
const char *system,
|
|
|
|
const playlist_config_t *playlist_config,
|
2020-02-16 19:03:57 +00:00
|
|
|
const char *dir_thumbnails);
|
2019-05-15 09:02:55 +00:00
|
|
|
#endif
|
2019-05-14 15:24:24 +00:00
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|
|
|
|
|
2020-06-04 21:41:13 +00:00
|
|
|
/* Core backup/restore tasks */
|
|
|
|
|
2020-06-16 10:11:09 +00:00
|
|
|
/* Note 1: If crc is set to 0, crc of core_path file will
|
|
|
|
* be calculated automatically
|
|
|
|
* Note 2: If core_display_name is set to NULL, display
|
|
|
|
* name will be determined automatically
|
|
|
|
* > core_display_name *must* be set to a non-empty
|
|
|
|
* string if task_push_core_backup() is *not* called
|
|
|
|
* on the main thread */
|
|
|
|
void *task_push_core_backup(
|
|
|
|
const char *core_path, const char *core_display_name,
|
2020-06-04 21:41:13 +00:00
|
|
|
uint32_t crc, enum core_backup_mode backup_mode,
|
2020-06-16 10:11:09 +00:00
|
|
|
size_t auto_backup_history_size,
|
2020-06-04 21:41:13 +00:00
|
|
|
const char *dir_core_assets, bool mute);
|
|
|
|
/* Note: If 'core_loaded' is true, menu stack should be
|
|
|
|
* flushed if task_push_core_restore() returns true */
|
|
|
|
bool task_push_core_restore(const char *backup_path,
|
|
|
|
const char *dir_libretro,
|
|
|
|
bool *core_loaded);
|
|
|
|
|
2020-06-26 14:39:03 +00:00
|
|
|
bool task_push_pl_manager_reset_cores(const playlist_config_t *playlist_config);
|
|
|
|
bool task_push_pl_manager_clean_playlist(const playlist_config_t *playlist_config);
|
2019-07-02 08:47:02 +00:00
|
|
|
|
2016-12-29 21:53:10 +00:00
|
|
|
bool task_push_image_load(const char *fullpath,
|
2019-06-05 16:04:23 +00:00
|
|
|
bool supports_rgba, unsigned upscale_threshold,
|
2016-12-29 21:53:10 +00:00
|
|
|
retro_task_callback_t cb, void *userdata);
|
2016-02-09 16:12:39 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_LIBRETRODB
|
2017-01-18 00:23:09 +00:00
|
|
|
bool task_push_dbscan(
|
|
|
|
const char *playlist_directory,
|
|
|
|
const char *content_database,
|
|
|
|
const char *fullpath,
|
2018-04-10 02:13:45 +00:00
|
|
|
bool directory, bool show_hidden_files,
|
|
|
|
retro_task_callback_t cb);
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|
|
|
|
|
2020-06-26 14:39:03 +00:00
|
|
|
bool task_push_manual_content_scan(
|
|
|
|
const playlist_config_t *playlist_config,
|
|
|
|
const char *playlist_directory);
|
2019-11-29 17:13:35 +00:00
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
#ifdef HAVE_OVERLAY
|
2016-05-27 16:14:47 +00:00
|
|
|
bool task_push_overlay_load_default(
|
2019-05-22 03:13:01 +00:00
|
|
|
retro_task_callback_t cb,
|
|
|
|
const char *overlay_path,
|
|
|
|
bool overlay_hide_in_menu,
|
|
|
|
bool input_overlay_enable,
|
|
|
|
float input_overlay_opacity,
|
|
|
|
float input_overlay_scale,
|
2020-06-11 12:08:13 +00:00
|
|
|
float input_overlay_center_x,
|
|
|
|
float input_overlay_center_y,
|
2019-05-22 03:13:01 +00:00
|
|
|
void *user_data);
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|
2017-12-12 07:55:31 +00:00
|
|
|
|
2020-01-20 03:31:32 +00:00
|
|
|
bool patch_content(
|
|
|
|
bool is_ips_pref,
|
|
|
|
bool is_bps_pref,
|
|
|
|
bool is_ups_pref,
|
|
|
|
const char *name_ips,
|
|
|
|
const char *name_bps,
|
|
|
|
const char *name_ups,
|
|
|
|
uint8_t **buf,
|
|
|
|
void *data);
|
|
|
|
|
2016-05-27 16:14:47 +00:00
|
|
|
bool task_check_decompress(const char *source_file);
|
2016-05-04 23:42:56 +00:00
|
|
|
|
2019-12-23 17:34:44 +00:00
|
|
|
void *task_push_decompress(
|
2016-02-09 16:12:39 +00:00
|
|
|
const char *source_file,
|
|
|
|
const char *target_dir,
|
|
|
|
const char *target_file,
|
|
|
|
const char *subdir,
|
|
|
|
const char *valid_ext,
|
2016-02-09 16:47:04 +00:00
|
|
|
retro_task_callback_t cb,
|
2018-11-22 14:45:52 +00:00
|
|
|
void *user_data,
|
2019-12-23 17:34:44 +00:00
|
|
|
void *frontend_userdata,
|
|
|
|
bool mute);
|
2016-02-09 16:12:39 +00:00
|
|
|
|
2016-05-27 16:14:47 +00:00
|
|
|
void task_file_load_handler(retro_task_t *task);
|
2017-05-17 23:19:47 +00:00
|
|
|
|
2019-05-22 03:54:35 +00:00
|
|
|
bool take_screenshot(
|
|
|
|
const char *screenshot_dir,
|
|
|
|
const char *path, bool silence,
|
2019-01-20 01:57:12 +00:00
|
|
|
bool has_valid_framebuffer, bool fullpath, bool use_thread);
|
2016-05-17 12:31:33 +00:00
|
|
|
|
2020-02-01 02:32:24 +00:00
|
|
|
bool event_load_save_files(bool is_sram_load_disabled);
|
2016-09-19 02:05:44 +00:00
|
|
|
|
2020-02-01 02:27:58 +00:00
|
|
|
bool event_save_files(bool sram_used);
|
2016-09-19 02:09:27 +00:00
|
|
|
|
2017-05-07 15:52:48 +00:00
|
|
|
void path_init_savefile_rtc(const char *savefile_path);
|
2016-09-19 02:18:40 +00:00
|
|
|
|
|
|
|
void *savefile_ptr_get(void);
|
|
|
|
|
|
|
|
void path_init_savefile_new(void);
|
|
|
|
|
2017-04-25 13:49:27 +00:00
|
|
|
bool input_is_autoconfigured(unsigned i);
|
|
|
|
|
2017-04-25 14:57:44 +00:00
|
|
|
unsigned input_autoconfigure_get_device_name_index(unsigned i);
|
|
|
|
|
2017-04-25 14:33:30 +00:00
|
|
|
void input_autoconfigure_reset(void);
|
|
|
|
|
2020-01-19 05:40:07 +00:00
|
|
|
void input_autoconfigure_override_handler(void *data);
|
|
|
|
|
2019-07-16 13:28:22 +00:00
|
|
|
void input_autoconfigure_connect(
|
2016-12-31 06:43:34 +00:00
|
|
|
const char *name,
|
|
|
|
const char *display_name,
|
|
|
|
const char *driver,
|
|
|
|
unsigned idx,
|
|
|
|
unsigned vid,
|
|
|
|
unsigned pid);
|
2016-12-01 19:38:20 +00:00
|
|
|
|
2016-12-01 21:36:38 +00:00
|
|
|
bool input_autoconfigure_disconnect(unsigned i, const char *ident);
|
2016-12-01 19:38:20 +00:00
|
|
|
|
2017-05-06 04:01:15 +00:00
|
|
|
bool input_autoconfigure_get_swap_override(void);
|
|
|
|
|
2017-12-05 22:03:56 +00:00
|
|
|
void input_autoconfigure_joypad_reindex_devices(void);
|
|
|
|
|
2018-09-08 00:11:18 +00:00
|
|
|
void set_save_state_in_background(bool state);
|
|
|
|
|
2019-07-08 19:32:12 +00:00
|
|
|
#ifdef HAVE_CDROM
|
|
|
|
void task_push_cdrom_dump(const char *drive);
|
|
|
|
#endif
|
|
|
|
|
2016-12-01 21:57:43 +00:00
|
|
|
extern const char* const input_builtin_autoconfs[];
|
|
|
|
|
2016-06-03 00:43:30 +00:00
|
|
|
RETRO_END_DECLS
|
2016-06-02 23:14:53 +00:00
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|