From 46c9663ed7a1653312a9bf509ce091a73b28827d Mon Sep 17 00:00:00 2001 From: BrandonSchaefer Date: Thu, 6 Nov 2014 00:21:12 -0800 Subject: [PATCH] I should add the actual mir_* source files :). --- src/mir_init.c | 20 +++++++++ src/mir_monitor.c | 42 ++++++++++++++++++ src/mir_platform.h | 42 ++++++++++++++++++ src/mir_window.c | 107 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 211 insertions(+) create mode 100644 src/mir_init.c create mode 100644 src/mir_monitor.c create mode 100644 src/mir_platform.h create mode 100644 src/mir_window.c diff --git a/src/mir_init.c b/src/mir_init.c new file mode 100644 index 00000000..7702b8fe --- /dev/null +++ b/src/mir_init.c @@ -0,0 +1,20 @@ +#include "internal.h" + +////////////////////////////////////////////////////////////////////////// +////// GLFW internal API ////// +////////////////////////////////////////////////////////////////////////// + +int _glfwPlatformInit(void) +{ + return 0; +} + +void _glfwPlatformTerminate(void) +{ +} + +const char* _glfwPlatformGetVersionString(void) +{ + return "MIR // FIXME (<0_0>)"; +} + diff --git a/src/mir_monitor.c b/src/mir_monitor.c new file mode 100644 index 00000000..e744b496 --- /dev/null +++ b/src/mir_monitor.c @@ -0,0 +1,42 @@ +#include "internal.h" + +#include + +////////////////////////////////////////////////////////////////////////// +////// GLFW platform API ////// +////////////////////////////////////////////////////////////////////////// + +_GLFWmonitor** _glfwPlatformGetMonitors(int* count) +{ + return NULL; +} + +GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second) +{ + return 0; +} + +void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) +{ +} + +GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) +{ + return NULL; +} + +void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) +{ +} + +void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) +{ + // TODO + fprintf(stderr, "_glfwPlatformGetGammaRamp not implemented yet\n"); +} + +void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) +{ + // TODO + fprintf(stderr, "_glfwPlatformSetGammaRamp not implemented yet\n"); +} diff --git a/src/mir_platform.h b/src/mir_platform.h new file mode 100644 index 00000000..c00c8c65 --- /dev/null +++ b/src/mir_platform.h @@ -0,0 +1,42 @@ +#ifndef _mir_platform_h_ +#define _mir_platform_h_ + +#include + +#include "posix_tls.h" +#include "posix_time.h" +#include "linux_joystick.h" + +#if defined(_GLFW_EGL) + #include "egl_context.h" +#else + #error "The Mir backend depends on EGL platform support" +#endif + +#define _GLFW_EGL_NATIVE_WINDOW NULL +#define _GLFW_EGL_NATIVE_DISPLAY NULL + +#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowMir mir; +#define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorMir mir; +#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryMir mir; +#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorMir mir; + +typedef struct _GLFWwindowMir +{ +} _GLFWwindowMir; + +typedef struct _GLFWmonitorMir +{ +} _GLFWmonitorMir; + +typedef struct _GLFWlibraryMir +{ + MirConnection* connection; + +} _GLFWlibraryMir; + +typedef struct _GLFWcursorMir +{ +} _GLFWcursorMir; + +#endif // _mir_platform_h_ diff --git a/src/mir_window.c b/src/mir_window.c new file mode 100644 index 00000000..eb7bd4c6 --- /dev/null +++ b/src/mir_window.c @@ -0,0 +1,107 @@ +#include "internal.h" + +////////////////////////////////////////////////////////////////////////// +////// GLFW platform API ////// +////////////////////////////////////////////////////////////////////////// + +int _glfwPlatformCreateWindow(_GLFWwindow* window, + const _GLFWwndconfig* wndconfig, + const _GLFWctxconfig* ctxconfig, + const _GLFWfbconfig* fbconfig) +{ + return 0; +} + +void _glfwPlatformDestroyWindow(_GLFWwindow* window) +{ +} + +void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) +{ +} + +void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos) +{ +} + +void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) +{ +} + +void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height) +{ +} + +void _glfwPlatformIconifyWindow(_GLFWwindow* window) +{ +} + +void _glfwPlatformRestoreWindow(_GLFWwindow* window) +{ +} + +void _glfwPlatformHideWindow(_GLFWwindow* window) +{ +} + +void _glfwPlatformPollEvents(void) +{ +} + +void _glfwPlatformWaitEvents(void) +{ +} + +void _glfwPlatformPostEmptyEvent(void) +{ +} + +void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height) +{ +} + +void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, int* left, int* top, int* right, int* bottom) +{ +} + +void _glfwPlatformShowWindow(_GLFWwindow* window) +{ +} + +void _glfwPlatformUnhideWindow(_GLFWwindow* window) +{ +} + +void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) +{ +} + +int _glfwPlatformCreateCursor(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot) +{ + return 0; +} + +void _glfwPlatformDestroyCursor(_GLFWcursor* cursor) +{ +} + +void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor) +{ +} + +void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos) +{ +} + +void _glfwPlatformApplyCursorMode(_GLFWwindow* window) +{ +} + +void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) +{ +} + +const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) +{ + return NULL; +}