diff --git a/src/cocoa_init.m b/src/cocoa_init.m index f9726f84..9570d4c2 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -683,6 +683,7 @@ GLFWbool _glfwConnectCocoa(int platformID, _GLFWplatform* platform) _glfwSetWindowMousePassthroughCocoa, _glfwGetThemeCocoa, _glfwSetThemeCocoa, + // Events _glfwPollEventsCocoa, _glfwWaitEventsCocoa, _glfwWaitEventsTimeoutCocoa, diff --git a/src/internal.h b/src/internal.h index 6dbe5d01..5d3ec9a6 100644 --- a/src/internal.h +++ b/src/internal.h @@ -672,11 +672,11 @@ struct _GLFWmutex struct _GLFWplatform { int platformID; - // init + // Init GLFWbool (*init)(void); void (*terminate)(void); GLFWtheme* (*getSystemDefaultTheme)(void); - // input + // Input void (*getCursorPos)(_GLFWwindow*,double*,double*); void (*setCursorPos)(_GLFWwindow*,double,double); void (*setCursorMode)(_GLFWwindow*,int); @@ -695,7 +695,7 @@ struct _GLFWplatform GLFWbool (*pollJoystick)(_GLFWjoystick*,int); const char* (*getMappingName)(void); void (*updateGamepadGUID)(char*); - // monitor + // Monitor void (*freeMonitor)(_GLFWmonitor*); void (*getMonitorPos)(_GLFWmonitor*,int*,int*); void (*getMonitorContentScale)(_GLFWmonitor*,float*,float*); @@ -704,7 +704,7 @@ struct _GLFWplatform void (*getVideoMode)(_GLFWmonitor*,GLFWvidmode*); GLFWbool (*getGammaRamp)(_GLFWmonitor*,GLFWgammaramp*); void (*setGammaRamp)(_GLFWmonitor*,const GLFWgammaramp*); - // window + // Window GLFWbool (*createWindow)(_GLFWwindow*,const _GLFWwndconfig*,const _GLFWctxconfig*,const _GLFWfbconfig*); void (*destroyWindow)(_GLFWwindow*); void (*setWindowTitle)(_GLFWwindow*,const char*); @@ -740,6 +740,7 @@ struct _GLFWplatform void (*setWindowMousePassthrough)(_GLFWwindow*,GLFWbool); GLFWtheme* (*getTheme)(_GLFWwindow*); void (*setTheme)(_GLFWwindow*,GLFWtheme*); + // Events void (*pollEvents)(void); void (*waitEvents)(void); void (*waitEventsTimeout)(double); @@ -748,7 +749,7 @@ struct _GLFWplatform EGLenum (*getEGLPlatform)(EGLint**); EGLNativeDisplayType (*getEGLNativeDisplay)(void); EGLNativeWindowType (*getEGLNativeWindow)(_GLFWwindow*); - // vulkan + // Vulkan void (*getRequiredInstanceExtensions)(char**); GLFWbool (*getPhysicalDevicePresentationSupport)(VkInstance,VkPhysicalDevice,uint32_t); VkResult (*createWindowSurface)(VkInstance,_GLFWwindow*,const VkAllocationCallbacks*,VkSurfaceKHR*); diff --git a/src/win32_init.c b/src/win32_init.c index 64393e77..629ef33f 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -606,8 +606,11 @@ GLFWbool _glfwConnectWin32(int platformID, _GLFWplatform* platform) const _GLFWplatform win32 = { GLFW_PLATFORM_WIN32, + // Init _glfwInitWin32, _glfwTerminateWin32, + _glfwGetSystemDefaultThemeWin32 + // Input _glfwGetCursorPosWin32, _glfwSetCursorPosWin32, _glfwSetCursorModeWin32, @@ -626,6 +629,7 @@ GLFWbool _glfwConnectWin32(int platformID, _GLFWplatform* platform) _glfwPollJoystickWin32, _glfwGetMappingNameWin32, _glfwUpdateGamepadGUIDWin32, + // Monitor _glfwFreeMonitorWin32, _glfwGetMonitorPosWin32, _glfwGetMonitorContentScaleWin32, @@ -634,6 +638,7 @@ GLFWbool _glfwConnectWin32(int platformID, _GLFWplatform* platform) _glfwGetVideoModeWin32, _glfwGetGammaRampWin32, _glfwSetGammaRampWin32, + // Window _glfwCreateWindowWin32, _glfwDestroyWindowWin32, _glfwSetWindowTitleWin32, @@ -667,13 +672,18 @@ GLFWbool _glfwConnectWin32(int platformID, _GLFWplatform* platform) _glfwSetWindowFloatingWin32, _glfwSetWindowOpacityWin32, _glfwSetWindowMousePassthroughWin32, + _glfwGetThemeWin32, + _glfwSetThemeWin32, + // Events _glfwPollEventsWin32, _glfwWaitEventsWin32, _glfwWaitEventsTimeoutWin32, _glfwPostEmptyEventWin32, + // EGL _glfwGetEGLPlatformWin32, _glfwGetEGLNativeDisplayWin32, _glfwGetEGLNativeWindowWin32, + // Vulkan _glfwGetRequiredInstanceExtensionsWin32, _glfwGetPhysicalDevicePresentationSupportWin32, _glfwCreateWindowSurfaceWin32, @@ -727,5 +737,11 @@ void _glfwTerminateWin32(void) freeLibraries(); } +GLFWtheme* _glfwGetSystemDefaultThemeWin32(void) +{ + _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED, NULL); + return NULL; // TODO: implement +} + #endif // _GLFW_WIN32 diff --git a/src/win32_platform.h b/src/win32_platform.h index 82b34bb9..ca46cb16 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -622,3 +622,6 @@ GLFWbool _glfwCreateContextWGL(_GLFWwindow* window, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); +GLFWtheme* _glfwGetSystemDefaultThemeWin32(void); +void _glfwSetThemeWin32(_GLFWwindow* window, GLFWtheme* theme); +GLFWtheme* _glfwGetThemeWin32(_GLFWwindow* window); diff --git a/src/win32_window.c b/src/win32_window.c index 676640bf..53a11a14 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -2373,6 +2373,17 @@ const char* _glfwGetClipboardStringWin32(void) return _glfw.win32.clipboardString; } +void _glfwSetThemeWin32(_GLFWwindow* window, GLFWtheme* theme) +{ + _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED, NULL); +} + +GLFWtheme* _glfwGetThemeWin32(_GLFWwindow* window) +{ + _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED, NULL); + return NULL; // TODO: implement +} + EGLenum _glfwGetEGLPlatformWin32(EGLint** attribs) { if (_glfw.egl.ANGLE_platform_angle) diff --git a/src/wl_init.c b/src/wl_init.c index 7a9157a4..49e785cc 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -379,8 +379,11 @@ GLFWbool _glfwConnectWayland(int platformID, _GLFWplatform* platform) const _GLFWplatform wayland = { GLFW_PLATFORM_WAYLAND, + // Init _glfwInitWayland, _glfwTerminateWayland, + _glfwGetSystemDefaultThemeWayland + // Input _glfwGetCursorPosWayland, _glfwSetCursorPosWayland, _glfwSetCursorModeWayland, @@ -407,6 +410,7 @@ GLFWbool _glfwConnectWayland(int platformID, _GLFWplatform* platform) _glfwGetMappingNameNull, _glfwUpdateGamepadGUIDNull, #endif + // Monitor _glfwFreeMonitorWayland, _glfwGetMonitorPosWayland, _glfwGetMonitorContentScaleWayland, @@ -415,6 +419,7 @@ GLFWbool _glfwConnectWayland(int platformID, _GLFWplatform* platform) _glfwGetVideoModeWayland, _glfwGetGammaRampWayland, _glfwSetGammaRampWayland, + // Window _glfwCreateWindowWayland, _glfwDestroyWindowWayland, _glfwSetWindowTitleWayland, @@ -448,13 +453,18 @@ GLFWbool _glfwConnectWayland(int platformID, _GLFWplatform* platform) _glfwSetWindowFloatingWayland, _glfwSetWindowOpacityWayland, _glfwSetWindowMousePassthroughWayland, + _glfwGetThemeWayland, + _glfwSetThemeWayland, + // Events _glfwPollEventsWayland, _glfwWaitEventsWayland, _glfwWaitEventsTimeoutWayland, _glfwPostEmptyEventWayland, + // EGL _glfwGetEGLPlatformWayland, _glfwGetEGLNativeDisplayWayland, _glfwGetEGLNativeWindowWayland, + // Vulkan _glfwGetRequiredInstanceExtensionsWayland, _glfwGetPhysicalDevicePresentationSupportWayland, _glfwCreateWindowSurfaceWayland, @@ -793,5 +803,11 @@ void _glfwTerminateWayland(void) _glfw_free(_glfw.wl.clipboardString); } +GLFWtheme* _glfwGetSystemDefaultThemeWayland(void) +{ + _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED, NULL); + return NULL; // TODO: implement +} + #endif // _GLFW_WAYLAND diff --git a/src/wl_platform.h b/src/wl_platform.h index 238e1ed4..af357cac 100644 --- a/src/wl_platform.h +++ b/src/wl_platform.h @@ -519,3 +519,6 @@ void _glfwUpdateContentScaleWayland(_GLFWwindow* window); void _glfwAddSeatListenerWayland(struct wl_seat* seat); void _glfwAddDataDeviceListenerWayland(struct wl_data_device* device); +GLFWtheme* _glfwGetSystemDefaultThemeWayland(void); +void _glfwSetThemeWayland(_GLFWwindow* window, GLFWtheme* theme); +GLFWtheme* _glfwGetThemeWayland(_GLFWwindow* window); diff --git a/src/wl_window.c b/src/wl_window.c index a227c16f..48a60b52 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -2775,6 +2775,17 @@ const char* _glfwGetClipboardStringWayland(void) return _glfw.wl.clipboardString; } +void _glfwSetThemeWayland(_GLFWwindow* window, GLFWtheme* theme) +{ + _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED, NULL); +} + +GLFWtheme* _glfwGetThemeWayland(_GLFWwindow* window) +{ + _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED, NULL); + return NULL; // TODO: implement +} + EGLenum _glfwGetEGLPlatformWayland(EGLint** attribs) { if (_glfw.egl.EXT_platform_base && _glfw.egl.EXT_platform_wayland) diff --git a/src/x11_init.c b/src/x11_init.c index a0100f2f..2806eadb 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -1169,8 +1169,11 @@ GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform) const _GLFWplatform x11 = { GLFW_PLATFORM_X11, + // Init _glfwInitX11, _glfwTerminateX11, + _glfwGetSystemDefaultThemeX11 + // Input _glfwGetCursorPosX11, _glfwSetCursorPosX11, _glfwSetCursorModeX11, @@ -1197,6 +1200,7 @@ GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform) _glfwGetMappingNameNull, _glfwUpdateGamepadGUIDNull, #endif + // Monitor _glfwFreeMonitorX11, _glfwGetMonitorPosX11, _glfwGetMonitorContentScaleX11, @@ -1205,6 +1209,7 @@ GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform) _glfwGetVideoModeX11, _glfwGetGammaRampX11, _glfwSetGammaRampX11, + // Window _glfwCreateWindowX11, _glfwDestroyWindowX11, _glfwSetWindowTitleX11, @@ -1238,13 +1243,18 @@ GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform) _glfwSetWindowFloatingX11, _glfwSetWindowOpacityX11, _glfwSetWindowMousePassthroughX11, + _glfwGetThemeX11, + _glfwSetThemeX11, + // Events _glfwPollEventsX11, _glfwWaitEventsX11, _glfwWaitEventsTimeoutX11, _glfwPostEmptyEventX11, + // EGL _glfwGetEGLPlatformX11, _glfwGetEGLNativeDisplayX11, _glfwGetEGLNativeWindowX11, + // Vulkan _glfwGetRequiredInstanceExtensionsX11, _glfwGetPhysicalDevicePresentationSupportX11, _glfwCreateWindowSurfaceX11, @@ -1654,5 +1664,11 @@ void _glfwTerminateX11(void) } } +GLFWtheme* _glfwGetSystemDefaultThemeX11(void) +{ + _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED, NULL); + return NULL; // TODO: implement +} + #endif // _GLFW_X11 diff --git a/src/x11_platform.h b/src/x11_platform.h index cdea3957..e0214699 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -1002,3 +1002,6 @@ GLFWbool _glfwChooseVisualGLX(const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig, Visual** visual, int* depth); +GLFWtheme* _glfwGetSystemDefaultThemeX11(void); +void _glfwSetThemeX11(_GLFWwindow* window, GLFWtheme* theme); +GLFWtheme* _glfwGetThemeX11(_GLFWwindow* window); diff --git a/src/x11_window.c b/src/x11_window.c index 7da9b965..f3adc490 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -3082,6 +3082,17 @@ const char* _glfwGetClipboardStringX11(void) return getSelectionString(_glfw.x11.CLIPBOARD); } +void _glfwSetThemeX11(_GLFWwindow* window, GLFWtheme* theme) +{ + _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED, NULL); +} + +GLFWtheme* _glfwGetThemeX11(_GLFWwindow* window) +{ + _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED, NULL); + return NULL; // TODO: implement +} + EGLenum _glfwGetEGLPlatformX11(EGLint** attribs) { if (_glfw.egl.ANGLE_platform_angle)