From a247b1616472c863b494002d61f0fbd88ba2457a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 06:29:52 +0200 Subject: [PATCH] Add ui_null_msg_window --- Makefile.common | 1 + griffin/griffin.c | 1 + ui/drivers/null/ui_null_msg_window.c | 44 ++++++++++++++++++++++++++++ ui/drivers/ui_cocoa.m | 1 + ui/drivers/ui_cocoatouch.m | 1 + ui/drivers/ui_null.c | 1 + ui/drivers/ui_qt.c | 1 + ui/drivers/ui_win32.c | 1 + ui/ui_companion_driver.h | 4 +++ 9 files changed, 55 insertions(+) create mode 100644 ui/drivers/null/ui_null_msg_window.c diff --git a/Makefile.common b/Makefile.common index 1822a2363b..479a252d63 100644 --- a/Makefile.common +++ b/Makefile.common @@ -117,6 +117,7 @@ OBJ += frontend/frontend.o \ ui/ui_companion_driver.o \ ui/drivers/ui_null.o \ ui/drivers/null/ui_null_window.o \ + ui/drivers/null/ui_null_msg_window.o \ ui/drivers/null/ui_null_application.o \ core_impl.o \ retroarch.o \ diff --git a/griffin/griffin.c b/griffin/griffin.c index 020b6c5770..f1a7c8cf63 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -723,6 +723,7 @@ UI #include "../ui/drivers/ui_null.c" #include "../ui/drivers/null/ui_null_window.c" +#include "../ui/drivers/null/ui_null_msg_window.c" #include "../ui/drivers/null/ui_null_application.c" #ifdef HAVE_QT diff --git a/ui/drivers/null/ui_null_msg_window.c b/ui/drivers/null/ui_null_msg_window.c new file mode 100644 index 0000000000..32f5d04dac --- /dev/null +++ b/ui/drivers/null/ui_null_msg_window.c @@ -0,0 +1,44 @@ +/* RetroArch - A frontend for libretro. + * 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 . + */ + +#include +#include +#include +#include +#include + +#include "../../ui_companion_driver.h" + +static enum ui_msg_window_response ui_msg_window_null_error(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +static enum ui_msg_window_response ui_msg_window_null_information(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +static enum ui_msg_window_response ui_msg_window_null_question(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +const ui_msg_window_t ui_msg_window_null = { + ui_msg_window_null_error, + ui_msg_window_null_information, + ui_msg_window_null_question, + "null" +}; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index d18ee7466f..881790f486 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -585,6 +585,7 @@ const ui_companion_driver_t ui_companion_cocoa = { NULL, NULL, NULL, + &ui_msg_window_null, &ui_window_cocoa, &ui_application_cocoa, "cocoa", diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index 74a17b3bfc..ee088add9c 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -687,6 +687,7 @@ const ui_companion_driver_t ui_companion_cocoatouch = { ui_companion_cocoatouch_notify_refresh, ui_companion_cocoatouch_msg_queue_push, ui_companion_cocoatouch_render_messagebox, + &ui_msg_window_null, &ui_window_null, &ui_application_null, "cocoatouch", diff --git a/ui/drivers/ui_null.c b/ui/drivers/ui_null.c index 960096fcd5..6d4027e585 100644 --- a/ui/drivers/ui_null.c +++ b/ui/drivers/ui_null.c @@ -88,6 +88,7 @@ const ui_companion_driver_t ui_companion_null = { NULL, NULL, NULL, + &ui_msg_window_null, &ui_window_null, &ui_application_null, "null", diff --git a/ui/drivers/ui_qt.c b/ui/drivers/ui_qt.c index fb76f72e60..2b521f5cf5 100644 --- a/ui/drivers/ui_qt.c +++ b/ui/drivers/ui_qt.c @@ -132,6 +132,7 @@ const ui_companion_driver_t ui_companion_qt = { NULL, NULL, NULL, + &ui_msg_window_null, &ui_window_null, &ui_application_null, "qt", diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index a33dd27757..7b338e054b 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -729,6 +729,7 @@ const ui_companion_driver_t ui_companion_win32 = { NULL, NULL, NULL, + &ui_msg_window_null, &ui_window_win32, &ui_application_win32, "win32", diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 837e16048f..549cd37aec 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -59,6 +59,7 @@ typedef struct ui_msg_window enum ui_msg_window_response (*error)(ui_msg_window_state *state); enum ui_msg_window_response (*information)(ui_msg_window_state *state); enum ui_msg_window_response (*question)(ui_msg_window_state *state); + const char *ident; } ui_msg_window_t; typedef struct ui_application @@ -91,6 +92,7 @@ typedef struct ui_companion_driver 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 ui_msg_window_t *msg_window; const ui_window_t *window; const ui_application_t *application; const char *ident; @@ -100,6 +102,8 @@ extern const ui_window_t ui_window_null; extern const ui_window_t ui_window_cocoa; extern const ui_window_t ui_window_win32; +extern const ui_msg_window_t ui_msg_window_null; + extern const ui_application_t ui_application_null; extern const ui_application_t ui_application_win32; extern const ui_application_t ui_application_cocoa;