RetroArch/ui/ui_companion_driver.h

126 lines
3.7 KiB
C
Raw Normal View History

/* 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
*
* 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>
#include <lists/file_list.h>
#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
2016-06-07 14:31:35 +00:00
typedef struct ui_application
{
void (*process_events)(void *data);
const char *ident;
} ui_application_t;
2016-06-04 02:24:54 +00:00
typedef struct ui_window
{
void (*destroy)(void *data);
void (*set_focused)(void *data);
2016-06-04 02:24:54 +00:00
void (*set_visible)(void *data, bool visible);
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;
typedef struct ui_companion_driver
{
void *(*init)(void);
void (*deinit)(void *data);
int (*iterate)(void *data, unsigned action);
void (*toggle)(void *data);
void (*event_command)(void *data, enum event_command action);
void (*notify_content_loaded)(void *data);
void (*notify_list_loaded)(void *data, file_list_t *list, file_list_t *menu_list);
void (*notify_refresh)(void *data);
void (*msg_queue_push)(const char *msg, unsigned priority, unsigned duration, bool flush);
void (*render_messagebox)(const char *msg);
2016-06-04 02:24:54 +00:00
const ui_window_t *window;
2016-06-07 14:31:35 +00:00
const ui_application_t *application;
2016-06-04 02:24:54 +00:00
const char *ident;
} 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;
2016-06-07 14:31:35 +00:00
extern const ui_application_t ui_application_null;
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;
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;
/**
* 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);
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);
void ui_companion_event_command(enum event_command action);
2015-04-20 16:34:55 +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);
void ui_companion_driver_free(void);
const ui_window_t *ui_companion_driver_get_window_ptr(void);
2016-06-03 03:54:21 +00:00
RETRO_END_DECLS
#endif