From 6c7e13e1b0a29b24482ab99cf79cc842a10b2e41 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Fri, 26 Aug 2022 17:18:55 +0900 Subject: [PATCH] Add API: GetPreeditCursorRectangle This is for GLFW3: glfwGetPreeditCursorRectangle --- src/platforms/rcore_android.c | 6 ++++++ src/platforms/rcore_desktop_glfw.c | 6 ++++++ src/platforms/rcore_desktop_sdl.c | 6 ++++++ src/platforms/rcore_drm.c | 6 ++++++ src/platforms/rcore_template.c | 6 ++++++ src/platforms/rcore_web.c | 6 ++++++ src/raylib.h | 1 + 7 files changed, 37 insertions(+) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 1a7572388..4b1b68a4a 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -613,6 +613,12 @@ void SetPreeditCursorRectangle(int x, int y, int w, int h) TRACELOG(LOG_WARNING, "SetPreeditCursorRectangle() not implemented on target platform"); } +// Get the preedit cursor area +void GetPreeditCursorRectangle(int *x, int *y, int *w, int *h) +{ + TRACELOG(LOG_WARNING, "GetPreeditCursorRectangle() not implemented on target platform"); +} + // Set internal gamepad mappings int SetGamepadMappings(const char *mappings) { diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 91f5b7655..9579d854b 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1049,6 +1049,12 @@ void SetPreeditCursorRectangle(int x, int y, int w, int h) glfwSetPreeditCursorRectangle(platform.handle, x, y, w, h); } +// Get the preedit cursor area +void GetPreeditCursorRectangle(int *x, int *y, int *w, int *h) +{ + glfwGetPreeditCursorRectangle(platform.handle, x, y, w, h); +} + // Set internal gamepad mappings int SetGamepadMappings(const char *mappings) { diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index c950890e7..63bc29004 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -934,6 +934,12 @@ void SetPreeditCursorRectangle(int x, int y, int w, int h) TRACELOG(LOG_WARNING, "SetPreeditCursorRectangle() not implemented on target platform"); } +// Get the preedit cursor area +void GetPreeditCursorRectangle(int *x, int *y, int *w, int *h) +{ + TRACELOG(LOG_WARNING, "GetPreeditCursorRectangle() not implemented on target platform"); +} + // Set internal gamepad mappings int SetGamepadMappings(const char *mappings) { diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index f9dac3399..883b31d41 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -609,6 +609,12 @@ void SetPreeditCursorRectangle(int x, int y, int w, int h) TRACELOG(LOG_WARNING, "SetPreeditCursorRectangle() not implemented on target platform"); } +// Get the preedit cursor area +void GetPreeditCursorRectangle(int *x, int *y, int *w, int *h) +{ + TRACELOG(LOG_WARNING, "GetPreeditCursorRectangle() not implemented on target platform"); +} + // Set internal gamepad mappings int SetGamepadMappings(const char *mappings) { diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index eb9d8cdba..25e7db5a5 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -371,6 +371,12 @@ void SetPreeditCursorRectangle(int x, int y, int w, int h) TRACELOG(LOG_WARNING, "SetPreeditCursorRectangle() not implemented on target platform"); } +// Get the preedit cursor area +void GetPreeditCursorRectangle(int *x, int *y, int *w, int *h) +{ + TRACELOG(LOG_WARNING, "GetPreeditCursorRectangle() not implemented on target platform"); +} + // Set internal gamepad mappings int SetGamepadMappings(const char *mappings) { diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index a79de1029..8510b8261 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -855,6 +855,12 @@ void SetPreeditCursorRectangle(int x, int y, int w, int h) glfwSetPreeditCursorRectangle(platform.handle, x, y, w, h); } +// Get the preedit cursor area +void GetPreeditCursorRectangle(int *x, int *y, int *w, int *h) +{ + glfwGetPreeditCursorRectangle(platform.handle, x, y, w, h); +} + // Set internal gamepad mappings int SetGamepadMappings(const char *mappings) { diff --git a/src/raylib.h b/src/raylib.h index 316512b01..48f3cf6d7 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1172,6 +1172,7 @@ RLAPI int GetCharPressed(void); // Get char presse RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) RLAPI void SetPreeditCallback(PreeditCallback callback); // Set a callback for preedit RLAPI void SetPreeditCursorRectangle(int x, int y, int w, int h); // Set the preedit cursor area that is used to decide the position of the candidate window +RLAPI void GetPreeditCursorRectangle(int *x, int *y, int *w, int *h); // Get the preedit cursor area // Input-related functions: gamepads RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available