make SDL_SetTextInputRect take a pointer to const The documentation doesn't state that the argument is ever modified, and no implementation does so currently. This is a non-breaking change to guarantee as much to callers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
diff --git a/include/SDL_keyboard.h b/include/SDL_keyboard.h
index b19a293..b80a7dc 100644
--- a/include/SDL_keyboard.h
+++ b/include/SDL_keyboard.h
@@ -303,7 +303,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void);
*
* \sa SDL_StartTextInput
*/
-extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
+extern DECLSPEC void SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect);
/**
* Check whether the platform has screen keyboard support.
diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c
index c7a7359..f653279 100644
--- a/src/core/linux/SDL_fcitx.c
+++ b/src/core/linux/SDL_fcitx.c
@@ -424,7 +424,7 @@ SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
}
void
-SDL_Fcitx_UpdateTextRect(SDL_Rect *rect)
+SDL_Fcitx_UpdateTextRect(const SDL_Rect *rect)
{
SDL_Window *focused_win = NULL;
SDL_SysWMinfo info;
diff --git a/src/core/linux/SDL_fcitx.h b/src/core/linux/SDL_fcitx.h
index c3cea52..567ddce 100644
--- a/src/core/linux/SDL_fcitx.h
+++ b/src/core/linux/SDL_fcitx.h
@@ -32,7 +32,7 @@ extern void SDL_Fcitx_Quit(void);
extern void SDL_Fcitx_SetFocus(SDL_bool focused);
extern void SDL_Fcitx_Reset(void);
extern SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state);
-extern void SDL_Fcitx_UpdateTextRect(SDL_Rect *rect);
+extern void SDL_Fcitx_UpdateTextRect(const SDL_Rect *rect);
extern void SDL_Fcitx_PumpEvents(void);
#endif /* SDL_fcitx_h_ */
diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c
index dc0b928..8b74f57 100644
--- a/src/core/linux/SDL_ibus.c
+++ b/src/core/linux/SDL_ibus.c
@@ -639,7 +639,7 @@ SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
}
void
-SDL_IBus_UpdateTextRect(SDL_Rect *rect)
+SDL_IBus_UpdateTextRect(const SDL_Rect *rect)
{
SDL_Window *focused_win;
SDL_SysWMinfo info;
diff --git a/src/core/linux/SDL_ibus.h b/src/core/linux/SDL_ibus.h
index 71d1f2d..d7071ec 100644
--- a/src/core/linux/SDL_ibus.h
+++ b/src/core/linux/SDL_ibus.h
@@ -45,7 +45,7 @@ extern SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 st
/* Update the position of IBus' candidate list. If rect is NULL then this will
just reposition it relative to the focused window's new position. */
-extern void SDL_IBus_UpdateTextRect(SDL_Rect *window_relative_rect);
+extern void SDL_IBus_UpdateTextRect(const SDL_Rect *window_relative_rect);
/* Checks DBus for new IBus events, and calls SDL_SendKeyboardText /
SDL_SendEditingText for each event it finds */
diff --git a/src/core/linux/SDL_ime.c b/src/core/linux/SDL_ime.c
index 9c0cb80..50b5ebf 100644
--- a/src/core/linux/SDL_ime.c
+++ b/src/core/linux/SDL_ime.c
@@ -28,7 +28,7 @@ typedef void (*_SDL_IME_Quit)(void);
typedef void (*_SDL_IME_SetFocus)(SDL_bool);
typedef void (*_SDL_IME_Reset)(void);
typedef SDL_bool (*_SDL_IME_ProcessKeyEvent)(Uint32, Uint32, Uint8 state);
-typedef void (*_SDL_IME_UpdateTextRect)(SDL_Rect *);
+typedef void (*_SDL_IME_UpdateTextRect)(const SDL_Rect *);
typedef void (*_SDL_IME_PumpEvents)(void);
static _SDL_IME_Init SDL_IME_Init_Real = NULL;
@@ -136,7 +136,7 @@ SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
}
void
-SDL_IME_UpdateTextRect(SDL_Rect *rect)
+SDL_IME_UpdateTextRect(const SDL_Rect *rect)
{
if (SDL_IME_UpdateTextRect_Real)
SDL_IME_UpdateTextRect_Real(rect);
diff --git a/src/core/linux/SDL_ime.h b/src/core/linux/SDL_ime.h
index cc5b105..23417f6 100644
--- a/src/core/linux/SDL_ime.h
+++ b/src/core/linux/SDL_ime.h
@@ -32,7 +32,7 @@ extern void SDL_IME_Quit(void);
extern void SDL_IME_SetFocus(SDL_bool focused);
extern void SDL_IME_Reset(void);
extern SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state);
-extern void SDL_IME_UpdateTextRect(SDL_Rect *rect);
+extern void SDL_IME_UpdateTextRect(const SDL_Rect *rect);
extern void SDL_IME_PumpEvents(void);
#endif /* SDL_ime_h_ */
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index 4c61f19..2d6e1e8 100644
--- a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -260,7 +260,7 @@ SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromName,(const char *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_StartTextInput,(void),(),)
SDL_DYNAPI_PROC(SDL_bool,SDL_IsTextInputActive,(void),(),return)
SDL_DYNAPI_PROC(void,SDL_StopTextInput,(void),(),)
-SDL_DYNAPI_PROC(void,SDL_SetTextInputRect,(SDL_Rect *a),(a),)
+SDL_DYNAPI_PROC(void,SDL_SetTextInputRect,(const SDL_Rect *a),(a),)
SDL_DYNAPI_PROC(SDL_bool,SDL_HasScreenKeyboardSupport,(void),(),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_IsScreenKeyboardShown,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void*,SDL_LoadObject,(const char *a),(a),return)
diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h
index b1876b2..9e2bfb9 100644
--- a/src/video/SDL_sysvideo.h
+++ b/src/video/SDL_sysvideo.h
@@ -307,7 +307,7 @@ struct SDL_VideoDevice
/* Text input */
void (*StartTextInput) (_THIS);
void (*StopTextInput) (_THIS);
- void (*SetTextInputRect) (_THIS, SDL_Rect *rect);
+ void (*SetTextInputRect) (_THIS, const SDL_Rect *rect);
void (*ClearComposition) (_THIS);
SDL_bool (*IsTextInputShown) (_THIS);
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index cda7655..1e520b2 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -4259,7 +4259,7 @@ SDL_StopTextInput(void)
}
void
-SDL_SetTextInputRect(SDL_Rect *rect)
+SDL_SetTextInputRect(const SDL_Rect *rect)
{
if (_this && _this->SetTextInputRect) {
_this->SetTextInputRect(_this, rect);
diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c
index 9bb0255..7098d2e 100644
--- a/src/video/android/SDL_androidkeyboard.c
+++ b/src/video/android/SDL_androidkeyboard.c
@@ -374,7 +374,7 @@ Android_StopTextInput(_THIS)
}
void
-Android_SetTextInputRect(_THIS, SDL_Rect *rect)
+Android_SetTextInputRect(_THIS, const SDL_Rect *rect)
{
SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
diff --git a/src/video/android/SDL_androidkeyboard.h b/src/video/android/SDL_androidkeyboard.h
index 01da8ab..381c210 100644
--- a/src/video/android/SDL_androidkeyboard.h
+++ b/src/video/android/SDL_androidkeyboard.h
@@ -31,6 +31,6 @@ extern SDL_bool Android_IsScreenKeyboardShown(_THIS, SDL_Window * window);
extern void Android_StartTextInput(_THIS);
extern void Android_StopTextInput(_THIS);
-extern void Android_SetTextInputRect(_THIS, SDL_Rect *rect);
+extern void Android_SetTextInputRect(_THIS, const SDL_Rect *rect);
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/cocoa/SDL_cocoakeyboard.h b/src/video/cocoa/SDL_cocoakeyboard.h
index 9ff2aff..e3b8460 100644
--- a/src/video/cocoa/SDL_cocoakeyboard.h
+++ b/src/video/cocoa/SDL_cocoakeyboard.h
@@ -29,7 +29,7 @@ extern void Cocoa_QuitKeyboard(_THIS);
extern void Cocoa_StartTextInput(_THIS);
extern void Cocoa_StopTextInput(_THIS);
-extern void Cocoa_SetTextInputRect(_THIS, SDL_Rect *rect);
+extern void Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect);
extern void Cocoa_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m
index 6e2250d..fd96ea3 100644
--- a/src/video/cocoa/SDL_cocoakeyboard.m
+++ b/src/video/cocoa/SDL_cocoakeyboard.m
@@ -40,12 +40,12 @@
SDL_Rect _inputRect;
}
- (void)doCommandBySelector:(SEL)myselector;
-- (void)setInputRect:(SDL_Rect *)rect;
+- (void)setInputRect:(const SDL_Rect *)rect;
@end
@implementation SDLTranslatorResponder
-- (void)setInputRect:(SDL_Rect *)rect
+- (void)setInputRect:(const SDL_Rect *)rect
{
_inputRect = *rect;
}
@@ -514,7 +514,7 @@ Cocoa_StopTextInput(_THIS)
}}
void
-Cocoa_SetTextInputRect(_THIS, SDL_Rect *rect)
+Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect)
{
SDL_VideoData *data = (__bridge SDL_VideoData *) _this->driverdata;
diff --git a/src/video/uikit/SDL_uikitviewcontroller.h b/src/video/uikit/SDL_uikitviewcontroller.h
index cff5445..2e64a52 100644
--- a/src/video/uikit/SDL_uikitviewcontroller.h
+++ b/src/video/uikit/SDL_uikitviewcontroller.h
@@ -87,5 +87,5 @@ SDL_bool UIKit_HasScreenKeyboardSupport(_THIS);
void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window);
void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window);
SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window);
-void UIKit_SetTextInputRect(_THIS, SDL_Rect *rect);
+void UIKit_SetTextInputRect(_THIS, const SDL_Rect *rect);
#endif
diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m
index 23a504c..d0dd863 100644
--- a/src/video/uikit/SDL_uikitviewcontroller.m
+++ b/src/video/uikit/SDL_uikitviewcontroller.m
@@ -547,7 +547,7 @@ UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window)
}
void
-UIKit_SetTextInputRect(_THIS, SDL_Rect *rect)
+UIKit_SetTextInputRect(_THIS, const SDL_Rect *rect)
{
if (!rect) {
SDL_InvalidParamError("rect");
diff --git a/src/video/wayland/SDL_waylandkeyboard.c b/src/video/wayland/SDL_waylandkeyboard.c
index 8f293a5..8fcf678 100644
--- a/src/video/wayland/SDL_waylandkeyboard.c
+++ b/src/video/wayland/SDL_waylandkeyboard.c
@@ -108,7 +108,7 @@ Wayland_StopTextInput(_THIS)
}
void
-Wayland_SetTextInputRect(_THIS, SDL_Rect *rect)
+Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect)
{
SDL_VideoData *driverdata = _this->driverdata;
diff --git a/src/video/wayland/SDL_waylandkeyboard.h b/src/video/wayland/SDL_waylandkeyboard.h
index 604e0f3..5909a24 100644
--- a/src/video/wayland/SDL_waylandkeyboard.h
+++ b/src/video/wayland/SDL_waylandkeyboard.h
@@ -34,7 +34,7 @@ extern int Wayland_InitKeyboard(_THIS);
extern void Wayland_QuitKeyboard(_THIS);
extern void Wayland_StartTextInput(_THIS);
extern void Wayland_StopTextInput(_THIS);
-extern void Wayland_SetTextInputRect(_THIS, SDL_Rect *rect);
+extern void Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect);
extern SDL_bool Wayland_HasScreenKeyboardSupport(_THIS);
#endif /* SDL_waylandkeyboard_h_ */
diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c
index e447a4a..ac17fdf 100644
--- a/src/video/windows/SDL_windowskeyboard.c
+++ b/src/video/windows/SDL_windowskeyboard.c
@@ -235,7 +235,7 @@ WIN_StopTextInput(_THIS)
}
void
-WIN_SetTextInputRect(_THIS, SDL_Rect *rect)
+WIN_SetTextInputRect(_THIS, const SDL_Rect *rect)
{
SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
HIMC himc = 0;
diff --git a/src/video/windows/SDL_windowskeyboard.h b/src/video/windows/SDL_windowskeyboard.h
index 97382c7..57c4ffa 100644
--- a/src/video/windows/SDL_windowskeyboard.h
+++ b/src/video/windows/SDL_windowskeyboard.h
@@ -31,7 +31,7 @@ extern void WIN_ResetDeadKeys(void);
extern void WIN_StartTextInput(_THIS);
extern void WIN_StopTextInput(_THIS);
-extern void WIN_SetTextInputRect(_THIS, SDL_Rect *rect);
+extern void WIN_SetTextInputRect(_THIS, const SDL_Rect *rect);
extern void WIN_ClearComposition(_THIS);
extern SDL_bool WIN_IsTextInputShown(_THIS);
diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c
index 9d9f3f9..6da6c7d 100644
--- a/src/video/x11/SDL_x11keyboard.c
+++ b/src/video/x11/SDL_x11keyboard.c
@@ -526,7 +526,7 @@ X11_StopTextInput(_THIS)
}
void
-X11_SetTextInputRect(_THIS, SDL_Rect *rect)
+X11_SetTextInputRect(_THIS, const SDL_Rect *rect)
{
if (!rect) {
SDL_InvalidParamError("rect");
diff --git a/src/video/x11/SDL_x11keyboard.h b/src/video/x11/SDL_x11keyboard.h
index dacaf7e..9e20ae1 100644
--- a/src/video/x11/SDL_x11keyboard.h
+++ b/src/video/x11/SDL_x11keyboard.h
@@ -28,7 +28,7 @@ extern void X11_UpdateKeymap(_THIS);
extern void X11_QuitKeyboard(_THIS);
extern void X11_StartTextInput(_THIS);
extern void X11_StopTextInput(_THIS);
-extern void X11_SetTextInputRect(_THIS, SDL_Rect *rect);
+extern void X11_SetTextInputRect(_THIS, const SDL_Rect *rect);
extern KeySym X11_KeyCodeToSym(_THIS, KeyCode, unsigned char group);
#endif /* SDL_x11keyboard_h_ */