Skip to content

Commit b63d0eb

Browse files
daipomashie
authored andcommitted
Add API: SetPreeditCursorRectangle
This is for GLFW3: glfwSetPreeditCursorRectangle
1 parent 71bb40a commit b63d0eb

File tree

7 files changed

+43
-0
lines changed

7 files changed

+43
-0
lines changed

src/platforms/rcore_android.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,13 @@ void OpenURL(const char *url)
606606
// Module Functions Definition: Inputs
607607
//----------------------------------------------------------------------------------
608608

609+
// Set the preedit cursor area.
610+
// This is used to decide the position of the candidate window.
611+
void SetPreeditCursorRectangle(int x, int y, int w, int h)
612+
{
613+
TRACELOG(LOG_WARNING, "SetPreeditCursorRectangle() not implemented on target platform");
614+
}
615+
609616
// Set internal gamepad mappings
610617
int SetGamepadMappings(const char *mappings)
611618
{

src/platforms/rcore_desktop_glfw.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,13 @@ void OpenURL(const char *url)
10421042
// Module Functions Definition: Inputs
10431043
//----------------------------------------------------------------------------------
10441044

1045+
// Set the preedit cursor area.
1046+
// This is used to decide the position of the candidate window.
1047+
void SetPreeditCursorRectangle(int x, int y, int w, int h)
1048+
{
1049+
glfwSetPreeditCursorRectangle(platform.handle, x, y, w, h);
1050+
}
1051+
10451052
// Set internal gamepad mappings
10461053
int SetGamepadMappings(const char *mappings)
10471054
{

src/platforms/rcore_desktop_sdl.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,13 @@ void OpenURL(const char *url)
927927
// Module Functions Definition: Inputs
928928
//----------------------------------------------------------------------------------
929929

930+
// Set the preedit cursor area.
931+
// This is used to decide the position of the candidate window.
932+
void SetPreeditCursorRectangle(int x, int y, int w, int h)
933+
{
934+
TRACELOG(LOG_WARNING, "SetPreeditCursorRectangle() not implemented on target platform");
935+
}
936+
930937
// Set internal gamepad mappings
931938
int SetGamepadMappings(const char *mappings)
932939
{

src/platforms/rcore_drm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,13 @@ void OpenURL(const char *url)
602602
// Module Functions Definition: Inputs
603603
//----------------------------------------------------------------------------------
604604

605+
// Set the preedit cursor area.
606+
// This is used to decide the position of the candidate window.
607+
void SetPreeditCursorRectangle(int x, int y, int w, int h)
608+
{
609+
TRACELOG(LOG_WARNING, "SetPreeditCursorRectangle() not implemented on target platform");
610+
}
611+
605612
// Set internal gamepad mappings
606613
int SetGamepadMappings(const char *mappings)
607614
{

src/platforms/rcore_template.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,13 @@ void OpenURL(const char *url)
364364
// Module Functions Definition: Inputs
365365
//----------------------------------------------------------------------------------
366366

367+
// Set the preedit cursor area.
368+
// This is used to decide the position of the candidate window.
369+
void SetPreeditCursorRectangle(int x, int y, int w, int h)
370+
{
371+
TRACELOG(LOG_WARNING, "SetPreeditCursorRectangle() not implemented on target platform");
372+
}
373+
367374
// Set internal gamepad mappings
368375
int SetGamepadMappings(const char *mappings)
369376
{

src/platforms/rcore_web.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,13 @@ void OpenURL(const char *url)
848848
// Module Functions Definition: Inputs
849849
//----------------------------------------------------------------------------------
850850

851+
// Set the preedit cursor area.
852+
// This is used to decide the position of the candidate window.
853+
void SetPreeditCursorRectangle(int x, int y, int w, int h)
854+
{
855+
glfwSetPreeditCursorRectangle(platform.handle, x, y, w, h);
856+
}
857+
851858
// Set internal gamepad mappings
852859
int SetGamepadMappings(const char *mappings)
853860
{

src/raylib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,7 @@ RLAPI int GetKeyPressed(void); // Get key pressed
11711171
RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
11721172
RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
11731173
RLAPI void SetPreeditCallback(PreeditCallback callback); // Set a callback for preedit
1174+
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
11741175

11751176
// Input-related functions: gamepads
11761177
RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available

0 commit comments

Comments
 (0)