From f46d8a50fc992ade641b59b5763c9a3b86065677 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 19 Nov 2015 07:23:41 +0100 Subject: [PATCH] Add ui_win32.c --- Makefile.common | 7 +++ ui/drivers/ui_win32.c | 92 ++++++++++++++++++++++++++++++++++++++++ ui/ui_companion_driver.c | 3 ++ ui/ui_companion_driver.h | 1 + 4 files changed, 103 insertions(+) create mode 100644 ui/drivers/ui_win32.c diff --git a/Makefile.common b/Makefile.common index 73ee61918e..ee008e39ea 100644 --- a/Makefile.common +++ b/Makefile.common @@ -559,6 +559,12 @@ ifeq ($(HAVE_PARPORT), 1) OBJ += input/drivers_joypad/parport_joypad.o endif +# Companion UI + +ifneq ($(findstring Win32,$(OS)),) +OBJ += ui/drivers/ui_win32.o +endif + # Video OBJ += gfx/video_context_driver.o \ @@ -573,6 +579,7 @@ else OBJ += gfx/video_texture_c.o endif + ifeq ($(HAVE_GL_CONTEXT), 1) DEFINES += -DHAVE_OPENGL -DHAVE_GLSL OBJ += gfx/drivers/gl.o \ diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c new file mode 100644 index 0000000000..6fe878690e --- /dev/null +++ b/ui/drivers/ui_win32.c @@ -0,0 +1,92 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2015 - 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 +#include "../ui_companion_driver.h" + +typedef struct ui_companion_win32 +{ + void *empty; +} ui_companion_win32_t; + +static void ui_companion_win32_deinit(void *data) +{ + ui_companion_win32_t *handle = (ui_companion_win32_t*)data; + + if (handle) + free(handle); +} + +static void *ui_companion_win32_init(void) +{ + ui_companion_win32_t *handle = (ui_companion_win32_t*)calloc(1, sizeof(*handle)); + + if (!handle) + return NULL; + + return handle; +} + +static int ui_companion_win32_iterate(void *data, unsigned action) +{ + (void)data; + (void)action; + + return 0; +} + +static void ui_companion_win32_notify_content_loaded(void *data) +{ + (void)data; +} + +static void ui_companion_win32_toggle(void *data) +{ + (void)data; +} + +static void ui_companion_win32_event_command(void *data, enum event_command cmd) +{ + (void)data; + (void)cmd; +} + +static void ui_companion_win32_notify_list_pushed(void *data, + file_list_t *list, file_list_t *menu_list) +{ + (void)data; + (void)list; + (void)menu_list; +} + +const ui_companion_driver_t ui_companion_win32 = { + ui_companion_win32_init, + ui_companion_win32_deinit, + ui_companion_win32_iterate, + ui_companion_win32_toggle, + ui_companion_win32_event_command, + ui_companion_win32_notify_content_loaded, + ui_companion_win32_notify_list_pushed, + NULL, + NULL, + NULL, + "win32", +}; diff --git a/ui/ui_companion_driver.c b/ui/ui_companion_driver.c index dac529b8a4..f9de77f610 100644 --- a/ui/ui_companion_driver.c +++ b/ui/ui_companion_driver.c @@ -26,6 +26,9 @@ static bool main_ui_companion_is_on_foreground; static const ui_companion_driver_t *ui_companion_drivers[] = { +#ifdef _WIN32 + &ui_companion_win32, +#endif #ifdef HAVE_COCOA &ui_companion_cocoa, #endif diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 1714c55bda..466c5ed5bf 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -51,6 +51,7 @@ 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; extern const ui_companion_driver_t ui_companion_qt; +extern const ui_companion_driver_t ui_companion_win32; /** * ui_companion_find_driver: