mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-17 15:59:57 +00:00
Create event_command callback
This commit is contained in:
parent
62960177fe
commit
a1e2228477
@ -90,11 +90,22 @@ static void *ui_companion_cocoatouch_init(void)
|
|||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ui_companion_cocoatouch_event_command(void *data, unsigned cmd)
|
||||||
|
{
|
||||||
|
ui_companion_cocoatouch_t *handle = (ui_companion_cocoatouch_t*)data;
|
||||||
|
|
||||||
|
if (!handle)
|
||||||
|
return;
|
||||||
|
|
||||||
|
event_command(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
const ui_companion_driver_t ui_companion_cocoatouch = {
|
const ui_companion_driver_t ui_companion_cocoatouch = {
|
||||||
ui_companion_cocoatouch_init,
|
ui_companion_cocoatouch_init,
|
||||||
ui_companion_cocoatouch_deinit,
|
ui_companion_cocoatouch_deinit,
|
||||||
ui_companion_cocoatouch_iterate,
|
ui_companion_cocoatouch_iterate,
|
||||||
ui_companion_cocoatouch_toggle,
|
ui_companion_cocoatouch_toggle,
|
||||||
|
ui_companion_cocoatouch_event_command,
|
||||||
ui_companion_cocoatouch_notify_content_loaded,
|
ui_companion_cocoatouch_notify_content_loaded,
|
||||||
"cocoatouch",
|
"cocoatouch",
|
||||||
};
|
};
|
||||||
|
@ -63,11 +63,18 @@ static void ui_companion_null_toggle(void *data)
|
|||||||
(void)data;
|
(void)data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ui_companion_null_event_command(void *data, unsigned cmd)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
(void)cmd;
|
||||||
|
}
|
||||||
|
|
||||||
const ui_companion_driver_t ui_companion_null = {
|
const ui_companion_driver_t ui_companion_null = {
|
||||||
ui_companion_null_init,
|
ui_companion_null_init,
|
||||||
ui_companion_null_deinit,
|
ui_companion_null_deinit,
|
||||||
ui_companion_null_iterate,
|
ui_companion_null_iterate,
|
||||||
ui_companion_null_toggle,
|
ui_companion_null_toggle,
|
||||||
|
ui_companion_null_event_command,
|
||||||
ui_companion_null_notify_content_loaded,
|
ui_companion_null_notify_content_loaded,
|
||||||
"null",
|
"null",
|
||||||
};
|
};
|
||||||
|
@ -102,11 +102,24 @@ static void ui_companion_qt_toggle(void *data)
|
|||||||
ui_companion_qt_init();
|
ui_companion_qt_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ui_companion_qt_event_command(void *data, unsigned cmd)
|
||||||
|
{
|
||||||
|
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
|
||||||
|
|
||||||
|
if (!handle)
|
||||||
|
return;
|
||||||
|
|
||||||
|
slock_lock(handle->lock);
|
||||||
|
event_command(cmd);
|
||||||
|
slock_unlock(handle->lock);
|
||||||
|
}
|
||||||
|
|
||||||
const ui_companion_driver_t ui_companion_qt = {
|
const ui_companion_driver_t ui_companion_qt = {
|
||||||
ui_companion_qt_init,
|
ui_companion_qt_init,
|
||||||
ui_companion_qt_deinit,
|
ui_companion_qt_deinit,
|
||||||
ui_companion_qt_iterate,
|
ui_companion_qt_iterate,
|
||||||
ui_companion_qt_toggle,
|
ui_companion_qt_toggle,
|
||||||
|
ui_companion_qt_event_command,
|
||||||
ui_companion_qt_notify_content_loaded,
|
ui_companion_qt_notify_content_loaded,
|
||||||
"qt",
|
"qt",
|
||||||
};
|
};
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "../command_event.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -34,6 +36,7 @@ typedef struct ui_companion_driver
|
|||||||
void (*deinit)(void *data);
|
void (*deinit)(void *data);
|
||||||
int (*iterate)(void *data, unsigned action);
|
int (*iterate)(void *data, unsigned action);
|
||||||
void (*toggle)(void *data);
|
void (*toggle)(void *data);
|
||||||
|
void (*event_command)(void *data, unsigned action);
|
||||||
void (*notify_content_loaded)(void *data);
|
void (*notify_content_loaded)(void *data);
|
||||||
|
|
||||||
const char *ident;
|
const char *ident;
|
||||||
|
Loading…
Reference in New Issue
Block a user