2015-04-11 23:31:03 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2016-01-10 03:06:50 +00:00
|
|
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
2015-04-11 23:31:03 +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 __UI_COMPANION_DRIVER_H
|
|
|
|
#define __UI_COMPANION_DRIVER_H
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2016-06-03 03:54:21 +00:00
|
|
|
#include <boolean.h>
|
|
|
|
#include <retro_common_api.h>
|
2016-03-20 13:53:54 +00:00
|
|
|
#include <lists/file_list.h>
|
2015-05-11 07:56:13 +00:00
|
|
|
|
2015-04-11 23:31:03 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../config.h"
|
|
|
|
#endif
|
|
|
|
|
2016-05-09 18:30:47 +00:00
|
|
|
#include "../command.h"
|
2015-04-13 11:46:48 +00:00
|
|
|
|
2016-06-03 03:54:21 +00:00
|
|
|
RETRO_BEGIN_DECLS
|
2015-04-11 23:31:03 +00:00
|
|
|
|
2016-06-04 02:24:54 +00:00
|
|
|
typedef struct ui_window
|
|
|
|
{
|
2016-06-04 02:37:37 +00:00
|
|
|
void (*destroy)(void *data);
|
2016-06-04 02:54:12 +00:00
|
|
|
void (*set_focused)(void *data);
|
2016-06-04 02:24:54 +00:00
|
|
|
void (*set_visible)(void *data, bool visible);
|
2016-06-04 02:57:44 +00:00
|
|
|
void (*set_title)(void *data, char *buf);
|
2016-06-04 06:38:38 +00:00
|
|
|
void (*set_droppable)(void *data, bool droppable);
|
2016-06-04 15:24:46 +00:00
|
|
|
bool (*focused)(void *data);
|
2016-06-04 02:24:54 +00:00
|
|
|
const char *ident;
|
|
|
|
} ui_window_t;
|
|
|
|
|
2015-04-11 23:31:03 +00:00
|
|
|
typedef struct ui_companion_driver
|
|
|
|
{
|
2015-04-12 00:09:14 +00:00
|
|
|
void *(*init)(void);
|
2015-04-11 23:31:03 +00:00
|
|
|
void (*deinit)(void *data);
|
2015-04-12 00:12:30 +00:00
|
|
|
int (*iterate)(void *data, unsigned action);
|
2015-04-13 00:14:34 +00:00
|
|
|
void (*toggle)(void *data);
|
2015-04-20 16:36:36 +00:00
|
|
|
void (*event_command)(void *data, enum event_command action);
|
2015-04-12 00:12:30 +00:00
|
|
|
void (*notify_content_loaded)(void *data);
|
2015-05-11 07:56:13 +00:00
|
|
|
void (*notify_list_loaded)(void *data, file_list_t *list, file_list_t *menu_list);
|
2015-08-30 11:03:34 +00:00
|
|
|
void (*notify_refresh)(void *data);
|
2015-09-22 20:20:03 +00:00
|
|
|
void (*msg_queue_push)(const char *msg, unsigned priority, unsigned duration, bool flush);
|
2015-08-15 00:42:04 +00:00
|
|
|
void (*render_messagebox)(const char *msg);
|
2016-06-04 02:24:54 +00:00
|
|
|
const ui_window_t *window;
|
|
|
|
const char *ident;
|
2015-04-11 23:31:03 +00:00
|
|
|
} ui_companion_driver_t;
|
|
|
|
|
2016-06-04 02:24:54 +00:00
|
|
|
extern const ui_window_t ui_window_null;
|
2016-06-04 05:56:28 +00:00
|
|
|
extern const ui_window_t ui_window_cocoa;
|
2016-06-04 02:24:54 +00:00
|
|
|
extern const ui_window_t ui_window_win32;
|
|
|
|
|
2015-04-11 23:31:03 +00:00
|
|
|
extern const ui_companion_driver_t ui_companion_null;
|
2015-04-20 10:43:07 +00:00
|
|
|
extern const ui_companion_driver_t ui_companion_cocoa;
|
2015-04-12 01:02:48 +00:00
|
|
|
extern const ui_companion_driver_t ui_companion_cocoatouch;
|
2015-04-12 16:56:23 +00:00
|
|
|
extern const ui_companion_driver_t ui_companion_qt;
|
2015-11-19 06:23:41 +00:00
|
|
|
extern const ui_companion_driver_t ui_companion_win32;
|
2015-04-11 23:31:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ui_companion_find_driver:
|
|
|
|
* @ident : Identifier name of driver to find.
|
|
|
|
*
|
|
|
|
* Finds driver with @ident. Does not initialize.
|
|
|
|
*
|
|
|
|
* Returns: pointer to driver if successful, otherwise NULL.
|
|
|
|
**/
|
|
|
|
const ui_companion_driver_t *ui_companion_find_driver(const char *ident);
|
|
|
|
|
|
|
|
const ui_companion_driver_t *ui_companion_get_ptr(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ui_companion_init_first:
|
|
|
|
*
|
|
|
|
* Finds first suitable driver and initialize.
|
|
|
|
*
|
|
|
|
* Returns: pointer to first suitable driver, otherwise NULL.
|
|
|
|
**/
|
|
|
|
const ui_companion_driver_t *ui_companion_init_first(void);
|
|
|
|
|
2015-12-05 08:55:13 +00:00
|
|
|
void ui_companion_driver_init_first(void);
|
|
|
|
|
2015-08-05 11:56:59 +00:00
|
|
|
bool ui_companion_is_on_foreground(void);
|
|
|
|
|
|
|
|
void ui_companion_set_foreground(unsigned enable);
|
|
|
|
|
2015-04-20 16:36:36 +00:00
|
|
|
void ui_companion_event_command(enum event_command action);
|
2015-04-20 16:34:55 +00:00
|
|
|
|
2015-12-05 08:55:13 +00:00
|
|
|
void ui_companion_driver_deinit(void);
|
|
|
|
|
|
|
|
void ui_companion_driver_notify_refresh(void);
|
|
|
|
|
|
|
|
void ui_companion_driver_notify_list_loaded(file_list_t *list, file_list_t *menu_list);
|
|
|
|
|
|
|
|
void ui_companion_driver_notify_content_loaded(void);
|
|
|
|
|
2016-02-12 05:43:06 +00:00
|
|
|
void ui_companion_driver_toggle(void);
|
|
|
|
|
2015-12-05 09:01:20 +00:00
|
|
|
void ui_companion_driver_free(void);
|
|
|
|
|
2016-06-06 05:35:33 +00:00
|
|
|
const ui_window_t *ui_companion_driver_get_window_ptr(void);
|
|
|
|
|
2016-06-03 03:54:21 +00:00
|
|
|
RETRO_END_DECLS
|
2015-04-11 23:31:03 +00:00
|
|
|
|
|
|
|
#endif
|