Skip to content

Commit

Permalink
Add API: ResetPreedit
Browse files Browse the repository at this point in the history
This is for GLFW3: glfwResetPreeditText
  • Loading branch information
daipom authored and ashie committed Feb 29, 2024
1 parent 180cbef commit cdc88c1
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/platforms/rcore_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,12 @@ void SetImeStatus(bool on)
TRACELOG(LOG_WARNING, "SetImeStatus() not implemented on target platform");
}

// Reset preedit text
void ResetPreedit(void)
{
TRACELOG(LOG_WARNING, "ResetPreedit() not implemented on target platform");
}

// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{
Expand Down
6 changes: 6 additions & 0 deletions src/platforms/rcore_desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,12 @@ void SetImeStatus(bool on)
else glfwSetInputMode(platform.handle, GLFW_IME, GLFW_FALSE);
}

// Reset preedit text
void ResetPreedit(void)
{
glfwResetPreeditText(platform.handle);
}

// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{
Expand Down
6 changes: 6 additions & 0 deletions src/platforms/rcore_desktop_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,12 @@ void SetImeStatus(bool on)
TRACELOG(LOG_WARNING, "SetImeStatus() not implemented on target platform");
}

// Reset preedit text
void ResetPreedit(void)
{
TRACELOG(LOG_WARNING, "ResetPreedit() not implemented on target platform");
}

// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{
Expand Down
6 changes: 6 additions & 0 deletions src/platforms/rcore_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,12 @@ void SetImeStatus(bool on)
TRACELOG(LOG_WARNING, "SetImeStatus() not implemented on target platform");
}

// Reset preedit text
void ResetPreedit(void)
{
TRACELOG(LOG_WARNING, "ResetPreedit() not implemented on target platform");
}

// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{
Expand Down
6 changes: 6 additions & 0 deletions src/platforms/rcore_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,12 @@ void SetImeStatus(bool on)
TRACELOG(LOG_WARNING, "SetImeStatus() not implemented on target platform");
}

// Reset preedit text
void ResetPreedit(void)
{
TRACELOG(LOG_WARNING, "ResetPreedit() not implemented on target platform");
}

// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{
Expand Down
6 changes: 6 additions & 0 deletions src/platforms/rcore_web.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,12 @@ void SetImeStatus(bool on)
else glfwSetInputMode(platform.handle, GLFW_IME, GLFW_FALSE);
}

// Reset preedit text
void ResetPreedit(void)
{
glfwResetPreeditText(platform.handle);
}

// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{
Expand Down
1 change: 1 addition & 0 deletions src/raylib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ RLAPI void SetPreeditCursorRectangle(int x, int y, int w, int h); // Set the pre
RLAPI void GetPreeditCursorRectangle(int *x, int *y, int *w, int *h); // Get the preedit cursor area
RLAPI bool IsImeOn(void); // Check if IME is ON
RLAPI void SetImeStatus(bool on); // Set IME status
RLAPI void ResetPreedit(void); // Reset preedit text

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

0 comments on commit cdc88c1

Please sign in to comment.