Add msg_queue_push to UI companion driver interface

This commit is contained in:
twinaphex 2015-09-22 22:20:03 +02:00
parent 0730af5919
commit f87154773d
7 changed files with 14 additions and 1 deletions

View File

@ -290,5 +290,13 @@ void menu_display_timedate(char *s, size_t len, unsigned time_mode)
void menu_display_msg_queue_push(const char *msg, unsigned prio, unsigned duration,
bool flush)
{
rarch_main_msg_queue_push(msg, prio, duration, flush);
if (ui_companion_is_on_foreground())
{
const ui_companion_driver_t *ui = ui_companion_get_ptr();
if (ui->msg_queue_push)
ui->msg_queue_push(msg, prio, duration, flush);
}
}

View File

@ -555,11 +555,11 @@ int menu_iterate_render(void)
if (menu->state.do_messagebox && menu->state.msg[0] != '\0')
{
const ui_companion_driver_t *ui = ui_companion_get_ptr();
if (driver->render_messagebox)
driver->render_messagebox(menu->state.msg);
if (ui_companion_is_on_foreground())
{
const ui_companion_driver_t *ui = ui_companion_get_ptr();
if (ui->render_messagebox)
ui->render_messagebox(menu->state.msg);
}

View File

@ -498,5 +498,6 @@ const ui_companion_driver_t ui_companion_cocoa = {
ui_companion_cocoa_notify_list_pushed,
NULL,
NULL,
NULL,
"cocoa",
};

View File

@ -576,6 +576,7 @@ const ui_companion_driver_t ui_companion_cocoatouch = {
ui_companion_cocoatouch_notify_content_loaded,
ui_companion_cocoatouch_notify_list_pushed,
ui_companion_cocoatouch_notify_refresh,
NULL,
ui_companion_cocoatouch_render_messagebox,
"cocoatouch",
};

View File

@ -87,5 +87,6 @@ const ui_companion_driver_t ui_companion_null = {
ui_companion_null_notify_list_pushed,
NULL,
NULL,
NULL,
"null",
};

View File

@ -130,5 +130,6 @@ const ui_companion_driver_t ui_companion_qt = {
ui_companion_qt_notify_list_pushed,
NULL,
NULL,
NULL,
"qt",
};

View File

@ -42,6 +42,7 @@ typedef struct ui_companion_driver
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);
const char *ident;
} ui_companion_driver_t;