Changed SDL_GetAbsoluteMouseState() to SDL_GetGlobalMouseState(). This matches naming conventions in the main repository, between SDL_GetRelativeMouseState() and SDL_WarpMouseGlobal().
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
diff --git a/include/SDL_mouse.h b/include/SDL_mouse.h
index fdb68f0..855e97b 100644
--- a/include/SDL_mouse.h
+++ b/include/SDL_mouse.h
@@ -100,7 +100,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
*
* \sa SDL_GetMouseState
*/
-extern DECLSPEC Uint32 SDLCALL SDL_GetAbsoluteMouseState(int *x, int *y);
+extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y);
/**
* \brief Retrieve the relative state of the mouse.
diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h
index aa99639..668cf8d 100644
--- a/src/dynapi/SDL_dynapi_overrides.h
+++ b/src/dynapi/SDL_dynapi_overrides.h
@@ -581,4 +581,4 @@
#define SDL_WinRTRunApp SDL_WinRTRunApp_REAL
#define SDL_CaptureMouse SDL_CaptureMouse_REAL
#define SDL_SetWindowHitTest SDL_SetWindowHitTest_REAL
-#define SDL_GetAbsoluteMouseState SDL_GetAbsoluteMouseState_REAL
+#define SDL_GetGlobalMouseState SDL_GetGlobalMouseState_REAL
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index 1df1222..eb820bf 100644
--- a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -614,4 +614,4 @@ SDL_DYNAPI_PROC(int,SDL_WinRTRunApp,(int a, char **b, void *c),(a,b,c),return)
#endif
SDL_DYNAPI_PROC(int,SDL_CaptureMouse,(SDL_bool a),(a),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowHitTest,(SDL_Window *a, SDL_HitTest b, void *c),(a,b,c),return)
-SDL_DYNAPI_PROC(Uint32,SDL_GetAbsoluteMouseState,(int *a, int *b),(a,b),return)
+SDL_DYNAPI_PROC(Uint32,SDL_GetGlobalMouseState,(int *a, int *b),(a,b),return)
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index 970cc78..4ebfcca 100644
--- a/src/events/SDL_mouse.c
+++ b/src/events/SDL_mouse.c
@@ -470,7 +470,7 @@ SDL_GetRelativeMouseState(int *x, int *y)
}
Uint32
-SDL_GetAbsoluteMouseState(int *x, int *y)
+SDL_GetGlobalMouseState(int *x, int *y)
{
SDL_Mouse *mouse = SDL_GetMouse();
int tmpx, tmpy;
@@ -485,12 +485,12 @@ SDL_GetAbsoluteMouseState(int *x, int *y)
*x = *y = 0;
- if (!mouse->GetAbsoluteMouseState) {
+ if (!mouse->GetGlobalMouseState) {
SDL_assert(0 && "This should really be implemented for every target.");
return 0;
}
- return mouse->GetAbsoluteMouseState(x, y);
+ return mouse->GetGlobalMouseState(x, y);
}
void
diff --git a/src/events/SDL_mouse_c.h b/src/events/SDL_mouse_c.h
index 70b3ec0..61553d4 100644
--- a/src/events/SDL_mouse_c.h
+++ b/src/events/SDL_mouse_c.h
@@ -67,7 +67,7 @@ typedef struct
int (*CaptureMouse) (SDL_Window * window);
/* Get absolute mouse coordinates. (x) and (y) are never NULL and set to zero before call. */
- Uint32 (*GetAbsoluteMouseState) (int *x, int *y);
+ Uint32 (*GetGlobalMouseState) (int *x, int *y);
/* Data common to all mice */
SDL_MouseID mouseID;
diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c
index fa6c1fe..d05c609 100644
--- a/src/test/SDL_test_common.c
+++ b/src/test/SDL_test_common.c
@@ -1492,7 +1492,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done)
if (withControl) {
/* Ctrl-A reports absolute mouse position. */
int x, y;
- const Uint32 mask = SDL_GetAbsoluteMouseState(&x, &y);
+ const Uint32 mask = SDL_GetGlobalMouseState(&x, &y);
SDL_Log("ABSOLUTE MOUSE: (%d, %d)%s%s%s%s%s\n", x, y,
(mask & SDL_BUTTON_LMASK) ? " [LBUTTON]" : "",
(mask & SDL_BUTTON_MMASK) ? " [MBUTTON]" : "",
diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m
index c14f226..dbd26ae 100644
--- a/src/video/cocoa/SDL_cocoamouse.m
+++ b/src/video/cocoa/SDL_cocoamouse.m
@@ -283,7 +283,7 @@ Cocoa_CaptureMouse(SDL_Window *window)
}
static Uint32
-Cocoa_GetAbsoluteMouseState(int *x, int *y)
+Cocoa_GetGlobalMouseState(int *x, int *y)
{
const NSUInteger cocoaButtons = [NSEvent pressedMouseButtons];
const NSPoint cocoaLocation = [NSEvent mouseLocation];
@@ -321,7 +321,7 @@ Cocoa_InitMouse(_THIS)
mouse->WarpMouse = Cocoa_WarpMouse;
mouse->SetRelativeMouseMode = Cocoa_SetRelativeMouseMode;
mouse->CaptureMouse = Cocoa_CaptureMouse;
- mouse->GetAbsoluteMouseState = Cocoa_GetAbsoluteMouseState;
+ mouse->GetGlobalMouseState = Cocoa_GetGlobalMouseState;
SDL_SetDefaultCursor(Cocoa_CreateDefaultCursor());
diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c
index 8bb4106..1e5b8bd 100644
--- a/src/video/windows/SDL_windowsmouse.c
+++ b/src/video/windows/SDL_windowsmouse.c
@@ -261,7 +261,7 @@ WIN_CaptureMouse(SDL_Window *window)
}
static Uint32
-WIN_GetAbsoluteMouseState(int *x, int *y)
+WIN_GetGlobalMouseState(int *x, int *y)
{
Uint32 retval = 0;
POINT pt = { 0, 0 };
@@ -290,7 +290,7 @@ WIN_InitMouse(_THIS)
mouse->WarpMouse = WIN_WarpMouse;
mouse->SetRelativeMouseMode = WIN_SetRelativeMouseMode;
mouse->CaptureMouse = WIN_CaptureMouse;
- mouse->GetAbsoluteMouseState = WIN_GetAbsoluteMouseState;
+ mouse->GetGlobalMouseState = WIN_GetGlobalMouseState;
SDL_SetDefaultCursor(WIN_CreateDefaultCursor());
diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c
index 7386da5..16894d6 100644
--- a/src/video/x11/SDL_x11mouse.c
+++ b/src/video/x11/SDL_x11mouse.c
@@ -354,7 +354,7 @@ X11_CaptureMouse(SDL_Window *window)
}
static Uint32
-X11_GetAbsoluteMouseState(int *x, int *y)
+X11_GetGlobalMouseState(int *x, int *y)
{
Display *display = GetDisplay();
const int num_screens = SDL_GetNumVideoDisplays();
@@ -398,7 +398,7 @@ X11_InitMouse(_THIS)
mouse->WarpMouse = X11_WarpMouse;
mouse->SetRelativeMouseMode = X11_SetRelativeMouseMode;
mouse->CaptureMouse = X11_CaptureMouse;
- mouse->GetAbsoluteMouseState = X11_GetAbsoluteMouseState;
+ mouse->GetGlobalMouseState = X11_GetGlobalMouseState;
SDL_SetDefaultCursor(X11_CreateDefaultCursor());
}