From 61e1c13ae67f0655271d7003756a76a3323dd09a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 4 Jun 2016 04:24:54 +0200 Subject: [PATCH] Create stub window interface --- Makefile.common | 5 +-- griffin/griffin.c | 2 ++ ui/drivers/null/ui_null_window.c | 32 +++++++++++++++++ ui/drivers/ui_cocoa.m | 3 +- ui/drivers/ui_cocoatouch.m | 3 +- ui/drivers/ui_null.c | 3 +- ui/drivers/ui_qt.c | 3 +- ui/drivers/ui_win32.c | 5 +-- ui/drivers/win32/ui_win32_window.c | 57 ++++++++++++++++++++++++++++++ ui/ui_companion_driver.h | 12 ++++++- 10 files changed, 116 insertions(+), 9 deletions(-) create mode 100644 ui/drivers/null/ui_null_window.c create mode 100644 ui/drivers/win32/ui_win32_window.c diff --git a/Makefile.common b/Makefile.common index 4ab0342c66..2a05918bb8 100644 --- a/Makefile.common +++ b/Makefile.common @@ -108,6 +108,7 @@ OBJ += frontend/frontend.o \ frontend/drivers/platform_null.o \ ui/ui_companion_driver.o \ ui/drivers/ui_null.o \ + ui/drivers/null/ui_null_window.o \ core_impl.o \ retroarch.o \ input/input_keyboard.o \ @@ -629,8 +630,8 @@ endif # Companion UI ifneq ($(findstring Win32,$(OS)),) -OBJ += ui/drivers/ui_win32.o - +OBJ += ui/drivers/ui_win32.o \ + ui/drivers/win32/ui_win32_window.o endif # Video diff --git a/griffin/griffin.c b/griffin/griffin.c index 43b9320303..2c0727da27 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -723,6 +723,7 @@ UI #include "../ui/ui_companion_driver.c" #include "../ui/drivers/ui_null.c" +#include "../ui/drivers/null/ui_null_window.c" #ifdef HAVE_QT #include "../ui/drivers/ui_qt.c" @@ -730,6 +731,7 @@ UI #if defined(_WIN32) && !defined(_XBOX) #include "../ui/drivers/ui_win32.c" +#include "../ui/drivers/win32/ui_win32_window.c" #endif /*============================================================ diff --git a/ui/drivers/null/ui_null_window.c b/ui/drivers/null/ui_null_window.c new file mode 100644 index 0000000000..46a8596cbb --- /dev/null +++ b/ui/drivers/null/ui_null_window.c @@ -0,0 +1,32 @@ +/* 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 void ui_window_null_set_visible(void *data, + bool set_visible) +{ +} + +const ui_window_t ui_window_null = { + ui_window_null_set_visible, + "null", +}; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index bbe16cd5e6..adef74dfef 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -1,6 +1,6 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2013-2014 - Jason Fetters - * Copyright (C) 2011-2015 - Daniel De Matteis + * 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- @@ -595,5 +595,6 @@ const ui_companion_driver_t ui_companion_cocoa = { NULL, NULL, NULL, + &ui_window_null, "cocoa", }; diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index 663d63764e..497e2820e4 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -1,5 +1,5 @@ /* RetroArch - A frontend for libretro. - * Copyright (C) 2011-2015 - Daniel De Matteis + * 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- @@ -687,5 +687,6 @@ 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_window_null, "cocoatouch", }; diff --git a/ui/drivers/ui_null.c b/ui/drivers/ui_null.c index f0d6d2ad44..1c81c80280 100644 --- a/ui/drivers/ui_null.c +++ b/ui/drivers/ui_null.c @@ -1,5 +1,5 @@ /* RetroArch - A frontend for libretro. - * Copyright (C) 2011-2015 - Daniel De Matteis + * 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- @@ -88,5 +88,6 @@ const ui_companion_driver_t ui_companion_null = { NULL, NULL, NULL, + &ui_window_null, "null", }; diff --git a/ui/drivers/ui_qt.c b/ui/drivers/ui_qt.c index b740e95a58..e50dca24ad 100644 --- a/ui/drivers/ui_qt.c +++ b/ui/drivers/ui_qt.c @@ -1,5 +1,5 @@ /* RetroArch - A frontend for libretro. - * Copyright (C) 2011-2015 - Daniel De Matteis + * 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- @@ -132,5 +132,6 @@ const ui_companion_driver_t ui_companion_qt = { NULL, NULL, NULL, + &ui_window_null, "qt", }; diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index f910c021a9..e4fca7bd4f 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -1,6 +1,6 @@ /* RetroArch - A frontend for libretro. - * Copyright (C) 2015 - Ali Bouhlel - * Copyright (C) 2011-2015 - Daniel De Matteis + * Copyright (C) 2015-2016 - Ali Bouhlel + * 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- @@ -725,5 +725,6 @@ const ui_companion_driver_t ui_companion_win32 = { NULL, NULL, NULL, + &ui_window_win32, "win32", }; diff --git a/ui/drivers/win32/ui_win32_window.c b/ui/drivers/win32/ui_win32_window.c new file mode 100644 index 0000000000..a8e73c3c33 --- /dev/null +++ b/ui/drivers/win32/ui_win32_window.c @@ -0,0 +1,57 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2015-2016 - Ali Bouhlel + * 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 + +#ifdef _MSC_VER +#pragma comment( lib, "comctl32" ) +#endif + +#define IDI_ICON 1 + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 //_WIN32_WINNT_WIN2K +#endif + +#ifndef _WIN32_IE +#define _WIN32_IE 0x0300 +#endif + +#include +#include +#include + +#include +#include + +#include "../../ui_companion_driver.h" +#include "../../../driver.h" +#include "../../../runloop.h" +#include "../../../tasks/tasks_internal.h" + +static void ui_window_win32_set_visible(void *data, + bool set_visible) +{ +} + +const ui_window_t ui_window_win32 = { + ui_window_win32_set_visible, + "win32", +}; diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index be0ab7c834..a471a01690 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -31,6 +31,12 @@ RETRO_BEGIN_DECLS +typedef struct ui_window +{ + void (*set_visible)(void *data, bool visible); + const char *ident; +} ui_window_t; + typedef struct ui_companion_driver { void *(*init)(void); @@ -43,9 +49,13 @@ 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 char *ident; + const ui_window_t *window; + const char *ident; } ui_companion_driver_t; +extern const ui_window_t ui_window_null; +extern const ui_window_t ui_window_win32; + extern const ui_companion_driver_t ui_companion_null; extern const ui_companion_driver_t ui_companion_cocoa; extern const ui_companion_driver_t ui_companion_cocoatouch;