From 81ff49f4b5e07144a52c2734a58803c7e78bb6e7 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 9 May 2023 12:55:11 +0200 Subject: [PATCH] Remove _THIS in src/video and in src/events (also VideoDevice) --- src/events/SDL_events.c | 2 +- src/video/SDL_egl.c | 42 ++--- src/video/SDL_egl_c.h | 42 ++--- src/video/SDL_sysvideo.h | 167 +++++++++--------- src/video/SDL_video.c | 4 +- src/video/android/SDL_androidclipboard.c | 6 +- src/video/android/SDL_androidclipboard.h | 6 +- src/video/android/SDL_androidevents.c | 4 +- src/video/android/SDL_androidevents.h | 4 +- src/video/android/SDL_androidgl.c | 8 +- src/video/android/SDL_androidgl.h | 8 +- src/video/android/SDL_androidkeyboard.c | 10 +- src/video/android/SDL_androidkeyboard.h | 10 +- src/video/android/SDL_androidvideo.c | 10 +- src/video/android/SDL_androidvulkan.c | 8 +- src/video/android/SDL_androidvulkan.h | 8 +- src/video/android/SDL_androidwindow.c | 14 +- src/video/android/SDL_androidwindow.h | 14 +- src/video/cocoa/SDL_cocoaclipboard.h | 6 +- src/video/cocoa/SDL_cocoaclipboard.m | 6 +- src/video/cocoa/SDL_cocoaevents.h | 8 +- src/video/cocoa/SDL_cocoaevents.m | 10 +- src/video/cocoa/SDL_cocoakeyboard.h | 14 +- src/video/cocoa/SDL_cocoakeyboard.m | 16 +- src/video/cocoa/SDL_cocoametalview.h | 6 +- src/video/cocoa/SDL_cocoametalview.m | 6 +- src/video/cocoa/SDL_cocoamodes.h | 12 +- src/video/cocoa/SDL_cocoamodes.m | 14 +- src/video/cocoa/SDL_cocoamouse.h | 6 +- src/video/cocoa/SDL_cocoamouse.m | 8 +- src/video/cocoa/SDL_cocoaopengl.h | 18 +- src/video/cocoa/SDL_cocoaopengl.m | 18 +- src/video/cocoa/SDL_cocoaopengles.h | 14 +- src/video/cocoa/SDL_cocoaopengles.m | 14 +- src/video/cocoa/SDL_cocoavideo.m | 8 +- src/video/cocoa/SDL_cocoavulkan.h | 8 +- src/video/cocoa/SDL_cocoavulkan.m | 10 +- src/video/cocoa/SDL_cocoawindow.h | 54 +++--- src/video/cocoa/SDL_cocoawindow.m | 56 +++--- src/video/dummy/SDL_nullevents.c | 2 +- src/video/dummy/SDL_nullevents_c.h | 2 +- src/video/dummy/SDL_nullframebuffer.c | 6 +- src/video/dummy/SDL_nullframebuffer_c.h | 6 +- src/video/dummy/SDL_nullvideo.c | 16 +- .../emscripten/SDL_emscriptenframebuffer.c | 6 +- .../emscripten/SDL_emscriptenframebuffer.h | 6 +- src/video/emscripten/SDL_emscriptenopengles.c | 18 +- src/video/emscripten/SDL_emscriptenopengles.h | 18 +- src/video/emscripten/SDL_emscriptenvideo.c | 44 ++--- src/video/haiku/SDL_bclipboard.cc | 6 +- src/video/haiku/SDL_bclipboard.h | 6 +- src/video/haiku/SDL_bevents.cc | 2 +- src/video/haiku/SDL_bevents.h | 2 +- src/video/haiku/SDL_bframebuffer.cc | 6 +- src/video/haiku/SDL_bframebuffer.h | 6 +- src/video/haiku/SDL_bmodes.cc | 10 +- src/video/haiku/SDL_bmodes.h | 10 +- src/video/haiku/SDL_bopengl.cc | 20 +-- src/video/haiku/SDL_bopengl.h | 20 +-- src/video/haiku/SDL_bvideo.cc | 6 +- src/video/haiku/SDL_bvideo.h | 6 +- src/video/haiku/SDL_bwindow.cc | 38 ++-- src/video/haiku/SDL_bwindow.h | 36 ++-- src/video/kmsdrm/SDL_kmsdrmevents.c | 2 +- src/video/kmsdrm/SDL_kmsdrmevents.h | 6 +- src/video/kmsdrm/SDL_kmsdrmmouse.c | 6 +- src/video/kmsdrm/SDL_kmsdrmmouse.h | 6 +- src/video/kmsdrm/SDL_kmsdrmopengles.c | 10 +- src/video/kmsdrm/SDL_kmsdrmopengles.h | 12 +- src/video/kmsdrm/SDL_kmsdrmvideo.c | 54 +++--- src/video/kmsdrm/SDL_kmsdrmvideo.h | 62 +++---- src/video/kmsdrm/SDL_kmsdrmvulkan.c | 8 +- src/video/kmsdrm/SDL_kmsdrmvulkan.h | 8 +- src/video/n3ds/SDL_n3dsevents.c | 2 +- src/video/n3ds/SDL_n3dsevents_c.h | 2 +- src/video/n3ds/SDL_n3dsframebuffer.c | 6 +- src/video/n3ds/SDL_n3dsframebuffer_c.h | 6 +- src/video/n3ds/SDL_n3dsswkb.c | 6 +- src/video/n3ds/SDL_n3dsswkb.h | 6 +- src/video/n3ds/SDL_n3dsvideo.c | 20 +-- src/video/ngage/SDL_ngageevents.cpp | 12 +- src/video/ngage/SDL_ngageevents_c.h | 2 +- src/video/ngage/SDL_ngageframebuffer.cpp | 22 +-- src/video/ngage/SDL_ngageframebuffer_c.h | 6 +- src/video/ngage/SDL_ngagevideo.cpp | 8 +- src/video/ngage/SDL_ngagevideo.h | 2 +- src/video/ngage/SDL_ngagewindow.cpp | 12 +- src/video/ngage/SDL_ngagewindow.h | 4 +- src/video/offscreen/SDL_offscreenevents.c | 2 +- src/video/offscreen/SDL_offscreenevents_c.h | 2 +- .../offscreen/SDL_offscreenframebuffer.c | 6 +- .../offscreen/SDL_offscreenframebuffer_c.h | 6 +- src/video/offscreen/SDL_offscreenopengles.c | 8 +- src/video/offscreen/SDL_offscreenopengles.h | 8 +- src/video/offscreen/SDL_offscreenvideo.c | 12 +- src/video/offscreen/SDL_offscreenwindow.c | 4 +- src/video/offscreen/SDL_offscreenwindow.h | 4 +- src/video/ps2/SDL_ps2video.c | 10 +- src/video/psp/SDL_pspevents.c | 8 +- src/video/psp/SDL_pspevents_c.h | 4 +- src/video/psp/SDL_pspgl.c | 18 +- src/video/psp/SDL_pspgl_c.h | 18 +- src/video/psp/SDL_pspvideo.c | 40 ++--- src/video/psp/SDL_pspvideo.h | 58 +++--- src/video/qnx/SDL_qnx.h | 16 +- src/video/qnx/SDL_qnxgl.c | 30 ++-- src/video/qnx/SDL_qnxvideo.c | 38 ++-- src/video/raspberry/SDL_rpievents.c | 2 +- src/video/raspberry/SDL_rpievents_c.h | 6 +- src/video/raspberry/SDL_rpimouse.c | 4 +- src/video/raspberry/SDL_rpimouse.h | 4 +- src/video/raspberry/SDL_rpiopengles.c | 6 +- src/video/raspberry/SDL_rpiopengles.h | 10 +- src/video/raspberry/SDL_rpivideo.c | 28 +-- src/video/raspberry/SDL_rpivideo.h | 50 +++--- src/video/riscos/SDL_riscosevents.c | 10 +- src/video/riscos/SDL_riscosevents_c.h | 6 +- src/video/riscos/SDL_riscosframebuffer.c | 6 +- src/video/riscos/SDL_riscosframebuffer_c.h | 6 +- src/video/riscos/SDL_riscosmodes.c | 6 +- src/video/riscos/SDL_riscosmodes.h | 6 +- src/video/riscos/SDL_riscosmouse.c | 4 +- src/video/riscos/SDL_riscosmouse.h | 2 +- src/video/riscos/SDL_riscosvideo.c | 8 +- src/video/riscos/SDL_riscoswindow.c | 6 +- src/video/riscos/SDL_riscoswindow.h | 6 +- src/video/uikit/SDL_uikitclipboard.h | 10 +- src/video/uikit/SDL_uikitclipboard.m | 10 +- src/video/uikit/SDL_uikitevents.h | 2 +- src/video/uikit/SDL_uikitevents.m | 2 +- src/video/uikit/SDL_uikitmetalview.h | 6 +- src/video/uikit/SDL_uikitmetalview.m | 6 +- src/video/uikit/SDL_uikitmodes.h | 10 +- src/video/uikit/SDL_uikitmodes.m | 10 +- src/video/uikit/SDL_uikitopengles.h | 12 +- src/video/uikit/SDL_uikitopengles.m | 12 +- src/video/uikit/SDL_uikitvideo.h | 2 +- src/video/uikit/SDL_uikitvideo.m | 10 +- src/video/uikit/SDL_uikitviewcontroller.h | 10 +- src/video/uikit/SDL_uikitviewcontroller.m | 10 +- src/video/uikit/SDL_uikitvulkan.h | 8 +- src/video/uikit/SDL_uikitvulkan.m | 8 +- src/video/uikit/SDL_uikitwindow.h | 24 +-- src/video/uikit/SDL_uikitwindow.m | 28 +-- src/video/vita/SDL_vitaframebuffer.c | 6 +- src/video/vita/SDL_vitaframebuffer.h | 6 +- src/video/vita/SDL_vitagl_pvr.c | 6 +- src/video/vita/SDL_vitagl_pvr_c.h | 6 +- src/video/vita/SDL_vitagles.c | 18 +- src/video/vita/SDL_vitagles_c.h | 18 +- src/video/vita/SDL_vitagles_pvr.c | 8 +- src/video/vita/SDL_vitagles_pvr_c.h | 8 +- src/video/vita/SDL_vitavideo.c | 40 ++--- src/video/vita/SDL_vitavideo.h | 68 +++---- src/video/vivante/SDL_vivanteopengles.c | 2 +- src/video/vivante/SDL_vivanteopengles.h | 8 +- src/video/vivante/SDL_vivanteplatform.c | 8 +- src/video/vivante/SDL_vivanteplatform.h | 8 +- src/video/vivante/SDL_vivantevideo.c | 24 +-- src/video/vivante/SDL_vivantevideo.h | 26 +-- src/video/vivante/SDL_vivantevulkan.c | 8 +- src/video/vivante/SDL_vivantevulkan.h | 8 +- src/video/wayland/SDL_waylandclipboard.c | 12 +- src/video/wayland/SDL_waylandclipboard.h | 12 +- src/video/wayland/SDL_waylanddatamanager.h | 4 +- src/video/wayland/SDL_waylandevents.c | 10 +- src/video/wayland/SDL_waylandevents_c.h | 6 +- src/video/wayland/SDL_waylandkeyboard.c | 12 +- src/video/wayland/SDL_waylandkeyboard.h | 12 +- src/video/wayland/SDL_waylandopengles.c | 16 +- src/video/wayland/SDL_waylandopengles.h | 16 +- src/video/wayland/SDL_waylandvideo.c | 16 +- src/video/wayland/SDL_waylandvideo.h | 2 +- src/video/wayland/SDL_waylandvulkan.c | 8 +- src/video/wayland/SDL_waylandvulkan.h | 8 +- src/video/wayland/SDL_waylandwindow.c | 50 +++--- src/video/wayland/SDL_waylandwindow.h | 48 ++--- src/video/windows/SDL_windowsclipboard.c | 8 +- src/video/windows/SDL_windowsclipboard.h | 6 +- src/video/windows/SDL_windowsevents.c | 6 +- src/video/windows/SDL_windowsevents.h | 6 +- src/video/windows/SDL_windowsframebuffer.c | 6 +- src/video/windows/SDL_windowsframebuffer.h | 6 +- src/video/windows/SDL_windowskeyboard.c | 18 +- src/video/windows/SDL_windowskeyboard.h | 14 +- src/video/windows/SDL_windowsmodes.c | 24 +-- src/video/windows/SDL_windowsmodes.h | 14 +- src/video/windows/SDL_windowsmouse.c | 4 +- src/video/windows/SDL_windowsmouse.h | 4 +- src/video/windows/SDL_windowsopengl.c | 34 ++-- src/video/windows/SDL_windowsopengl.h | 26 +-- src/video/windows/SDL_windowsopengles.c | 10 +- src/video/windows/SDL_windowsopengles.h | 14 +- src/video/windows/SDL_windowsvideo.c | 26 +-- src/video/windows/SDL_windowsvideo.h | 2 +- src/video/windows/SDL_windowsvulkan.c | 8 +- src/video/windows/SDL_windowsvulkan.h | 8 +- src/video/windows/SDL_windowswindow.c | 58 +++--- src/video/windows/SDL_windowswindow.h | 54 +++--- src/video/winrt/SDL_winrtevents.cpp | 2 +- src/video/winrt/SDL_winrtevents_c.h | 14 +- src/video/winrt/SDL_winrtgamebar.cpp | 4 +- src/video/winrt/SDL_winrtgamebar_cpp.h | 4 +- src/video/winrt/SDL_winrtkeyboard.cpp | 10 +- src/video/winrt/SDL_winrtmouse.cpp | 4 +- src/video/winrt/SDL_winrtmouse_c.h | 4 +- src/video/winrt/SDL_winrtopengles.cpp | 4 +- src/video/winrt/SDL_winrtopengles.h | 10 +- src/video/winrt/SDL_winrtpointerinput.cpp | 2 +- src/video/winrt/SDL_winrtvideo.cpp | 48 ++--- src/video/x11/SDL_x11clipboard.c | 18 +- src/video/x11/SDL_x11clipboard.h | 12 +- src/video/x11/SDL_x11events.c | 30 ++-- src/video/x11/SDL_x11events.h | 10 +- src/video/x11/SDL_x11framebuffer.c | 6 +- src/video/x11/SDL_x11framebuffer.h | 6 +- src/video/x11/SDL_x11keyboard.c | 28 +-- src/video/x11/SDL_x11keyboard.h | 22 +-- src/video/x11/SDL_x11modes.c | 22 +-- src/video/x11/SDL_x11modes.h | 14 +- src/video/x11/SDL_x11mouse.c | 4 +- src/video/x11/SDL_x11mouse.h | 4 +- src/video/x11/SDL_x11opengl.c | 28 +-- src/video/x11/SDL_x11opengl.h | 22 +-- src/video/x11/SDL_x11opengles.c | 8 +- src/video/x11/SDL_x11opengles.h | 12 +- src/video/x11/SDL_x11touch.c | 6 +- src/video/x11/SDL_x11touch.h | 6 +- src/video/x11/SDL_x11video.c | 10 +- src/video/x11/SDL_x11vulkan.c | 8 +- src/video/x11/SDL_x11vulkan.h | 8 +- src/video/x11/SDL_x11window.c | 74 ++++---- src/video/x11/SDL_x11window.h | 62 +++---- src/video/x11/SDL_x11xfixes.c | 8 +- src/video/x11/SDL_x11xfixes.h | 8 +- src/video/x11/SDL_x11xinput2.c | 10 +- src/video/x11/SDL_x11xinput2.h | 10 +- 237 files changed, 1670 insertions(+), 1671 deletions(-) diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index a46b9999cb..5266e1d598 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -900,7 +900,7 @@ static SDL_bool SDL_events_need_periodic_poll(void) return need_periodic_poll; } -static int SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event *event, Uint64 start, Sint64 timeoutNS) +static int SDL_WaitEventTimeout_Device(SDL_VideoDevice *_this, SDL_Window *wakeup_window, SDL_Event *event, Uint64 start, Sint64 timeoutNS) { Sint64 loop_timeoutNS = timeoutNS; SDL_bool need_periodic_poll = SDL_events_need_periodic_poll(); diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 93ef45aa7f..c59e518c89 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -176,7 +176,7 @@ int SDL_EGL_SetErrorEx(const char *message, const char *eglFunctionName, EGLint /* EGL implementation of SDL OpenGL ES support */ -SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext) +SDL_bool SDL_EGL_HasExtension(SDL_VideoDevice *_this, SDL_EGL_ExtensionType type, const char *ext) { size_t ext_len; const char *ext_override; @@ -248,7 +248,7 @@ SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext return SDL_FALSE; } -SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(_THIS, const char *proc) +SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(SDL_VideoDevice *_this, const char *proc) { SDL_FunctionPointer retval = NULL; if (_this->egl_data != NULL) { @@ -275,7 +275,7 @@ SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(_THIS, const char *proc) return retval; } -void SDL_EGL_UnloadLibrary(_THIS) +void SDL_EGL_UnloadLibrary(SDL_VideoDevice *_this) { if (_this->egl_data) { if (_this->egl_data->egl_display) { @@ -297,7 +297,7 @@ void SDL_EGL_UnloadLibrary(_THIS) } } -static int SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) +static int SDL_EGL_LoadLibraryInternal(SDL_VideoDevice *_this, const char *egl_path) { void *egl_dll_handle = NULL, *opengl_dll_handle = NULL; const char *path = NULL; @@ -468,7 +468,7 @@ static int SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) return 0; } -int SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) +int SDL_EGL_LoadLibraryOnly(SDL_VideoDevice *_this, const char *egl_path) { if (_this->egl_data) { return SDL_SetError("EGL context already created"); @@ -487,7 +487,7 @@ int SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) return 0; } -static void SDL_EGL_GetVersion(_THIS) +static void SDL_EGL_GetVersion(SDL_VideoDevice *_this) { if (_this->egl_data->eglQueryString) { const char *egl_version = _this->egl_data->eglQueryString(_this->egl_data->egl_display, EGL_VERSION); @@ -503,7 +503,7 @@ static void SDL_EGL_GetVersion(_THIS) } } -int SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_display, EGLenum platform) +int SDL_EGL_LoadLibrary(SDL_VideoDevice *_this, const char *egl_path, NativeDisplayType native_display, EGLenum platform) { int library_load_retcode = SDL_EGL_LoadLibraryOnly(_this, egl_path); if (library_load_retcode != 0) { @@ -583,7 +583,7 @@ int SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_di valid available GPU for EGL to use. */ -int SDL_EGL_InitializeOffscreen(_THIS, int device) +int SDL_EGL_InitializeOffscreen(SDL_VideoDevice *_this, int device) { void *egl_devices[SDL_EGL_MAX_DEVICES]; EGLint num_egl_devices = 0; @@ -661,7 +661,7 @@ int SDL_EGL_InitializeOffscreen(_THIS, int device) return 0; } -void SDL_EGL_SetRequiredVisualId(_THIS, int visual_id) +void SDL_EGL_SetRequiredVisualId(SDL_VideoDevice *_this, int visual_id) { _this->egl_data->egl_required_visual_id = visual_id; } @@ -715,7 +715,7 @@ static Attribute all_attributes[] = { ATTRIBUTE(EGL_CONFORMANT), }; -static void dumpconfig(_THIS, EGLConfig config) +static void dumpconfig(SDL_VideoDevice *_this, EGLConfig config) { int attr; for (attr = 0; attr < sizeof(all_attributes) / sizeof(Attribute); attr++) { @@ -727,7 +727,7 @@ static void dumpconfig(_THIS, EGLConfig config) #endif /* DUMP_EGL_CONFIG */ -static int SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) +static int SDL_EGL_PrivateChooseConfig(SDL_VideoDevice *_this, SDL_bool set_config_caveat_none) { /* 64 seems nice. */ EGLint attribs[64]; @@ -925,7 +925,7 @@ static int SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) return 0; } -int SDL_EGL_ChooseConfig(_THIS) +int SDL_EGL_ChooseConfig(SDL_VideoDevice *_this) { int ret; @@ -950,7 +950,7 @@ int SDL_EGL_ChooseConfig(_THIS) } SDL_GLContext -SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) +SDL_EGL_CreateContext(SDL_VideoDevice *_this, EGLSurface egl_surface) { /* max 16 key+value pairs plus terminator. */ EGLint attribs[33]; @@ -1123,7 +1123,7 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) return (SDL_GLContext)egl_context; } -int SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) +int SDL_EGL_MakeCurrent(SDL_VideoDevice *_this, EGLSurface egl_surface, SDL_GLContext context) { EGLContext egl_context = (EGLContext)context; @@ -1160,7 +1160,7 @@ int SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) return 0; } -int SDL_EGL_SetSwapInterval(_THIS, int interval) +int SDL_EGL_SetSwapInterval(SDL_VideoDevice *_this, int interval) { EGLBoolean status; @@ -1184,7 +1184,7 @@ int SDL_EGL_SetSwapInterval(_THIS, int interval) return SDL_EGL_SetError("Unable to set the EGL swap interval", "eglSwapInterval"); } -int SDL_EGL_GetSwapInterval(_THIS, int *interval) +int SDL_EGL_GetSwapInterval(SDL_VideoDevice *_this, int *interval) { if (!_this->egl_data) { return SDL_SetError("EGL not initialized"); @@ -1194,7 +1194,7 @@ int SDL_EGL_GetSwapInterval(_THIS, int *interval) return 0; } -int SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface) +int SDL_EGL_SwapBuffers(SDL_VideoDevice *_this, EGLSurface egl_surface) { if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, egl_surface)) { return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers"); @@ -1202,7 +1202,7 @@ int SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface) return 0; } -int SDL_EGL_DeleteContext(_THIS, SDL_GLContext context) +int SDL_EGL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { EGLContext egl_context = (EGLContext)context; @@ -1218,7 +1218,7 @@ int SDL_EGL_DeleteContext(_THIS, SDL_GLContext context) } EGLSurface * -SDL_EGL_CreateSurface(_THIS, SDL_Window *window, NativeWindowType nw) +SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, NativeWindowType nw) { #ifdef SDL_VIDEO_DRIVER_ANDROID EGLint format_wanted; @@ -1311,7 +1311,7 @@ SDL_EGL_CreateSurface(_THIS, SDL_Window *window, NativeWindowType nw) } EGLSurface -SDL_EGL_CreateOffscreenSurface(_THIS, int width, int height) +SDL_EGL_CreateOffscreenSurface(SDL_VideoDevice *_this, int width, int height) { EGLint attributes[] = { EGL_WIDTH, 0, @@ -1331,7 +1331,7 @@ SDL_EGL_CreateOffscreenSurface(_THIS, int width, int height) attributes); } -void SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface) +void SDL_EGL_DestroySurface(SDL_VideoDevice *_this, EGLSurface egl_surface) { if (!_this->egl_data) { return; diff --git a/src/video/SDL_egl_c.h b/src/video/SDL_egl_c.h index d2a4aa74a8..1916e12eaa 100644 --- a/src/video/SDL_egl_c.h +++ b/src/video/SDL_egl_c.h @@ -114,32 +114,32 @@ typedef enum SDL_EGL_ExtensionType SDL_EGL_CLIENT_EXTENSION } SDL_EGL_ExtensionType; -extern SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext); +extern SDL_bool SDL_EGL_HasExtension(SDL_VideoDevice *_this, SDL_EGL_ExtensionType type, const char *ext); -extern int SDL_EGL_GetAttribute(_THIS, SDL_GLattr attrib, int *value); +extern int SDL_EGL_GetAttribute(SDL_VideoDevice *_this, SDL_GLattr attrib, int *value); /* SDL_EGL_LoadLibrary can get a display for a specific platform (EGL_PLATFORM_*) * or, if 0 is passed, let the implementation decide. */ -extern int SDL_EGL_LoadLibraryOnly(_THIS, const char *path); -extern int SDL_EGL_LoadLibrary(_THIS, const char *path, NativeDisplayType native_display, EGLenum platform); -extern SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(_THIS, const char *proc); -extern void SDL_EGL_UnloadLibrary(_THIS); -extern void SDL_EGL_SetRequiredVisualId(_THIS, int visual_id); -extern int SDL_EGL_ChooseConfig(_THIS); -extern int SDL_EGL_SetSwapInterval(_THIS, int interval); -extern int SDL_EGL_GetSwapInterval(_THIS, int *interval); -extern int SDL_EGL_DeleteContext(_THIS, SDL_GLContext context); -extern EGLSurface *SDL_EGL_CreateSurface(_THIS, SDL_Window *window, NativeWindowType nw); -extern void SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface); +extern int SDL_EGL_LoadLibraryOnly(SDL_VideoDevice *_this, const char *path); +extern int SDL_EGL_LoadLibrary(SDL_VideoDevice *_this, const char *path, NativeDisplayType native_display, EGLenum platform); +extern SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(SDL_VideoDevice *_this, const char *proc); +extern void SDL_EGL_UnloadLibrary(SDL_VideoDevice *_this); +extern void SDL_EGL_SetRequiredVisualId(SDL_VideoDevice *_this, int visual_id); +extern int SDL_EGL_ChooseConfig(SDL_VideoDevice *_this); +extern int SDL_EGL_SetSwapInterval(SDL_VideoDevice *_this, int interval); +extern int SDL_EGL_GetSwapInterval(SDL_VideoDevice *_this, int *interval); +extern int SDL_EGL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); +extern EGLSurface *SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, NativeWindowType nw); +extern void SDL_EGL_DestroySurface(SDL_VideoDevice *_this, EGLSurface egl_surface); -extern EGLSurface SDL_EGL_CreateOffscreenSurface(_THIS, int width, int height); +extern EGLSurface SDL_EGL_CreateOffscreenSurface(SDL_VideoDevice *_this, int width, int height); /* Assumes that LoadLibraryOnly() has succeeded */ -extern int SDL_EGL_InitializeOffscreen(_THIS, int device); +extern int SDL_EGL_InitializeOffscreen(SDL_VideoDevice *_this, int device); /* These need to be wrapped to get the surface for the window by the platform GLES implementation */ -extern SDL_GLContext SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface); -extern int SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context); -extern int SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface); +extern SDL_GLContext SDL_EGL_CreateContext(SDL_VideoDevice *_this, EGLSurface egl_surface); +extern int SDL_EGL_MakeCurrent(SDL_VideoDevice *_this, EGLSurface egl_surface, SDL_GLContext context); +extern int SDL_EGL_SwapBuffers(SDL_VideoDevice *_this, EGLSurface egl_surface); /* SDL Error-reporting */ extern int SDL_EGL_SetErrorEx(const char *message, const char *eglFunctionName, EGLint eglErrorCode); @@ -148,19 +148,19 @@ extern int SDL_EGL_SetErrorEx(const char *message, const char *eglFunctionName, /* A few of useful macros */ #define SDL_EGL_SwapWindow_impl(BACKEND) \ - int BACKEND##_GLES_SwapWindow(_THIS, SDL_Window *window) \ + int BACKEND##_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) \ { \ return SDL_EGL_SwapBuffers(_this, window->driverdata->egl_surface); \ } #define SDL_EGL_MakeCurrent_impl(BACKEND) \ - int BACKEND##_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) \ + int BACKEND##_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) \ { \ return SDL_EGL_MakeCurrent(_this, window ? window->driverdata->egl_surface : EGL_NO_SURFACE, context); \ } #define SDL_EGL_CreateContext_impl(BACKEND) \ - SDL_GLContext BACKEND##_GLES_CreateContext(_THIS, SDL_Window *window) \ + SDL_GLContext BACKEND##_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) \ { \ return SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); \ } diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 567dc7a170..2e87dab574 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -155,9 +155,6 @@ struct SDL_VideoDisplay /* Forward declaration */ struct SDL_SysWMinfo; -/* Define the SDL video driver structure */ -#define _THIS SDL_VideoDevice *_this - /* Video device flags */ typedef enum { @@ -179,18 +176,18 @@ struct SDL_VideoDevice * Initialize the native video subsystem, filling in the list of * displays for this driver, returning 0 or -1 if there's an error. */ - int (*VideoInit)(_THIS); + int (*VideoInit)(SDL_VideoDevice *_this); /* * Reverse the effects VideoInit() -- called if VideoInit() fails or * if the application is shutting down the video subsystem. */ - void (*VideoQuit)(_THIS); + void (*VideoQuit)(SDL_VideoDevice *_this); /* * Reinitialize the touch devices -- called if an unknown touch ID occurs. */ - void (*ResetTouch)(_THIS); + void (*ResetTouch)(SDL_VideoDevice *_this); /* * * */ /* @@ -200,22 +197,22 @@ struct SDL_VideoDevice /* * Refresh the display list */ - void (*RefreshDisplays)(_THIS); + void (*RefreshDisplays)(SDL_VideoDevice *_this); /* * Get the bounds of a display */ - int (*GetDisplayBounds)(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); + int (*GetDisplayBounds)(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); /* * Get the usable bounds of a display (bounds minus menubar or whatever) */ - int (*GetDisplayUsableBounds)(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); + int (*GetDisplayUsableBounds)(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); /* * Get a list of the available display modes for a display. */ - int (*GetDisplayModes)(_THIS, SDL_VideoDisplay *display); + int (*GetDisplayModes)(SDL_VideoDevice *_this, SDL_VideoDisplay *display); /* * Setting the display mode is independent of creating windows, so @@ -223,46 +220,46 @@ struct SDL_VideoDevice * their data updated accordingly, including the display surfaces * associated with them. */ - int (*SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); + int (*SetDisplayMode)(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); /* * * */ /* * Window functions */ - int (*CreateSDLWindow)(_THIS, SDL_Window *window); - int (*CreateSDLWindowFrom)(_THIS, SDL_Window *window, const void *data); - void (*SetWindowTitle)(_THIS, SDL_Window *window); - int (*SetWindowIcon)(_THIS, SDL_Window *window, SDL_Surface *icon); - int (*SetWindowPosition)(_THIS, SDL_Window *window); - void (*SetWindowSize)(_THIS, SDL_Window *window); - void (*SetWindowMinimumSize)(_THIS, SDL_Window *window); - void (*SetWindowMaximumSize)(_THIS, SDL_Window *window); - int (*GetWindowBordersSize)(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right); - void (*GetWindowSizeInPixels)(_THIS, SDL_Window *window, int *w, int *h); - int (*SetWindowOpacity)(_THIS, SDL_Window *window, float opacity); - int (*SetWindowModalFor)(_THIS, SDL_Window *modal_window, SDL_Window *parent_window); - int (*SetWindowInputFocus)(_THIS, SDL_Window *window); - void (*ShowWindow)(_THIS, SDL_Window *window); - void (*HideWindow)(_THIS, SDL_Window *window); - void (*RaiseWindow)(_THIS, SDL_Window *window); - void (*MaximizeWindow)(_THIS, SDL_Window *window); - void (*MinimizeWindow)(_THIS, SDL_Window *window); - void (*RestoreWindow)(_THIS, SDL_Window *window); - void (*SetWindowBordered)(_THIS, SDL_Window *window, SDL_bool bordered); - void (*SetWindowResizable)(_THIS, SDL_Window *window, SDL_bool resizable); - void (*SetWindowAlwaysOnTop)(_THIS, SDL_Window *window, SDL_bool on_top); - void (*SetWindowFullscreen)(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); - void *(*GetWindowICCProfile)(_THIS, SDL_Window *window, size_t *size); - SDL_DisplayID (*GetDisplayForWindow)(_THIS, SDL_Window *window); - void (*SetWindowMouseRect)(_THIS, SDL_Window *window); - void (*SetWindowMouseGrab)(_THIS, SDL_Window *window, SDL_bool grabbed); - void (*SetWindowKeyboardGrab)(_THIS, SDL_Window *window, SDL_bool grabbed); - void (*DestroyWindow)(_THIS, SDL_Window *window); - int (*CreateWindowFramebuffer)(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); - int (*UpdateWindowFramebuffer)(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); - void (*DestroyWindowFramebuffer)(_THIS, SDL_Window *window); - void (*OnWindowEnter)(_THIS, SDL_Window *window); - int (*FlashWindow)(_THIS, SDL_Window *window, SDL_FlashOperation operation); + int (*CreateSDLWindow)(SDL_VideoDevice *_this, SDL_Window *window); + int (*CreateSDLWindowFrom)(SDL_VideoDevice *_this, SDL_Window *window, const void *data); + void (*SetWindowTitle)(SDL_VideoDevice *_this, SDL_Window *window); + int (*SetWindowIcon)(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon); + int (*SetWindowPosition)(SDL_VideoDevice *_this, SDL_Window *window); + void (*SetWindowSize)(SDL_VideoDevice *_this, SDL_Window *window); + void (*SetWindowMinimumSize)(SDL_VideoDevice *_this, SDL_Window *window); + void (*SetWindowMaximumSize)(SDL_VideoDevice *_this, SDL_Window *window); + int (*GetWindowBordersSize)(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right); + void (*GetWindowSizeInPixels)(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h); + int (*SetWindowOpacity)(SDL_VideoDevice *_this, SDL_Window *window, float opacity); + int (*SetWindowModalFor)(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window); + int (*SetWindowInputFocus)(SDL_VideoDevice *_this, SDL_Window *window); + void (*ShowWindow)(SDL_VideoDevice *_this, SDL_Window *window); + void (*HideWindow)(SDL_VideoDevice *_this, SDL_Window *window); + void (*RaiseWindow)(SDL_VideoDevice *_this, SDL_Window *window); + void (*MaximizeWindow)(SDL_VideoDevice *_this, SDL_Window *window); + void (*MinimizeWindow)(SDL_VideoDevice *_this, SDL_Window *window); + void (*RestoreWindow)(SDL_VideoDevice *_this, SDL_Window *window); + void (*SetWindowBordered)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered); + void (*SetWindowResizable)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable); + void (*SetWindowAlwaysOnTop)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top); + void (*SetWindowFullscreen)(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); + void *(*GetWindowICCProfile)(SDL_VideoDevice *_this, SDL_Window *window, size_t *size); + SDL_DisplayID (*GetDisplayForWindow)(SDL_VideoDevice *_this, SDL_Window *window); + void (*SetWindowMouseRect)(SDL_VideoDevice *_this, SDL_Window *window); + void (*SetWindowMouseGrab)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); + void (*SetWindowKeyboardGrab)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); + void (*DestroyWindow)(SDL_VideoDevice *_this, SDL_Window *window); + int (*CreateWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); + int (*UpdateWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); + void (*DestroyWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window); + void (*OnWindowEnter)(SDL_VideoDevice *_this, SDL_Window *window); + int (*FlashWindow)(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation); /* * * */ /* @@ -271,75 +268,75 @@ struct SDL_VideoDevice SDL_ShapeDriver shape_driver; /* Get some platform dependent window information */ - int (*GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); + int (*GetWindowWMInfo)(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info); /* * * */ /* * OpenGL support */ - int (*GL_LoadLibrary)(_THIS, const char *path); - SDL_FunctionPointer (*GL_GetProcAddress)(_THIS, const char *proc); - void (*GL_UnloadLibrary)(_THIS); - SDL_GLContext (*GL_CreateContext)(_THIS, SDL_Window *window); - int (*GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context); - SDL_EGLSurface (*GL_GetEGLSurface)(_THIS, SDL_Window *window); - int (*GL_SetSwapInterval)(_THIS, int interval); - int (*GL_GetSwapInterval)(_THIS, int *interval); - int (*GL_SwapWindow)(_THIS, SDL_Window *window); - int (*GL_DeleteContext)(_THIS, SDL_GLContext context); - void (*GL_DefaultProfileConfig)(_THIS, int *mask, int *major, int *minor); + int (*GL_LoadLibrary)(SDL_VideoDevice *_this, const char *path); + SDL_FunctionPointer (*GL_GetProcAddress)(SDL_VideoDevice *_this, const char *proc); + void (*GL_UnloadLibrary)(SDL_VideoDevice *_this); + SDL_GLContext (*GL_CreateContext)(SDL_VideoDevice *_this, SDL_Window *window); + int (*GL_MakeCurrent)(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); + SDL_EGLSurface (*GL_GetEGLSurface)(SDL_VideoDevice *_this, SDL_Window *window); + int (*GL_SetSwapInterval)(SDL_VideoDevice *_this, int interval); + int (*GL_GetSwapInterval)(SDL_VideoDevice *_this, int *interval); + int (*GL_SwapWindow)(SDL_VideoDevice *_this, SDL_Window *window); + int (*GL_DeleteContext)(SDL_VideoDevice *_this, SDL_GLContext context); + void (*GL_DefaultProfileConfig)(SDL_VideoDevice *_this, int *mask, int *major, int *minor); /* * * */ /* * Vulkan support */ - int (*Vulkan_LoadLibrary)(_THIS, const char *path); - void (*Vulkan_UnloadLibrary)(_THIS); - SDL_bool (*Vulkan_GetInstanceExtensions)(_THIS, unsigned *count, const char **names); - SDL_bool (*Vulkan_CreateSurface)(_THIS, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); + int (*Vulkan_LoadLibrary)(SDL_VideoDevice *_this, const char *path); + void (*Vulkan_UnloadLibrary)(SDL_VideoDevice *_this); + SDL_bool (*Vulkan_GetInstanceExtensions)(SDL_VideoDevice *_this, unsigned *count, const char **names); + SDL_bool (*Vulkan_CreateSurface)(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); /* * * */ /* * Metal support */ - SDL_MetalView (*Metal_CreateView)(_THIS, SDL_Window *window); - void (*Metal_DestroyView)(_THIS, SDL_MetalView view); - void *(*Metal_GetLayer)(_THIS, SDL_MetalView view); + SDL_MetalView (*Metal_CreateView)(SDL_VideoDevice *_this, SDL_Window *window); + void (*Metal_DestroyView)(SDL_VideoDevice *_this, SDL_MetalView view); + void *(*Metal_GetLayer)(SDL_VideoDevice *_this, SDL_MetalView view); /* * * */ /* * Event manager functions */ - int (*WaitEventTimeout)(_THIS, Sint64 timeoutNS); - void (*SendWakeupEvent)(_THIS, SDL_Window *window); - void (*PumpEvents)(_THIS); + int (*WaitEventTimeout)(SDL_VideoDevice *_this, Sint64 timeoutNS); + void (*SendWakeupEvent)(SDL_VideoDevice *_this, SDL_Window *window); + void (*PumpEvents)(SDL_VideoDevice *_this); /* Suspend the screensaver */ - int (*SuspendScreenSaver)(_THIS); + int (*SuspendScreenSaver)(SDL_VideoDevice *_this); /* Text input */ - void (*StartTextInput)(_THIS); - void (*StopTextInput)(_THIS); - int (*SetTextInputRect)(_THIS, const SDL_Rect *rect); - void (*ClearComposition)(_THIS); - SDL_bool (*IsTextInputShown)(_THIS); + void (*StartTextInput)(SDL_VideoDevice *_this); + void (*StopTextInput)(SDL_VideoDevice *_this); + int (*SetTextInputRect)(SDL_VideoDevice *_this, const SDL_Rect *rect); + void (*ClearComposition)(SDL_VideoDevice *_this); + SDL_bool (*IsTextInputShown)(SDL_VideoDevice *_this); /* Screen keyboard */ - SDL_bool (*HasScreenKeyboardSupport)(_THIS); - void (*ShowScreenKeyboard)(_THIS, SDL_Window *window); - void (*HideScreenKeyboard)(_THIS, SDL_Window *window); - SDL_bool (*IsScreenKeyboardShown)(_THIS, SDL_Window *window); + SDL_bool (*HasScreenKeyboardSupport)(SDL_VideoDevice *_this); + void (*ShowScreenKeyboard)(SDL_VideoDevice *_this, SDL_Window *window); + void (*HideScreenKeyboard)(SDL_VideoDevice *_this, SDL_Window *window); + SDL_bool (*IsScreenKeyboardShown)(SDL_VideoDevice *_this, SDL_Window *window); /* Clipboard */ - int (*SetClipboardText)(_THIS, const char *text); - char *(*GetClipboardText)(_THIS); - SDL_bool (*HasClipboardText)(_THIS); - int (*SetPrimarySelectionText)(_THIS, const char *text); - char *(*GetPrimarySelectionText)(_THIS); - SDL_bool (*HasPrimarySelectionText)(_THIS); + int (*SetClipboardText)(SDL_VideoDevice *_this, const char *text); + char *(*GetClipboardText)(SDL_VideoDevice *_this); + SDL_bool (*HasClipboardText)(SDL_VideoDevice *_this); + int (*SetPrimarySelectionText)(SDL_VideoDevice *_this, const char *text); + char *(*GetPrimarySelectionText)(SDL_VideoDevice *_this); + SDL_bool (*HasPrimarySelectionText)(SDL_VideoDevice *_this); /* MessageBox */ - int (*ShowMessageBox)(_THIS, const SDL_MessageBoxData *messageboxdata, int *buttonid); + int (*ShowMessageBox)(SDL_VideoDevice *_this, const SDL_MessageBoxData *messageboxdata, int *buttonid); /* Hit-testing */ int (*SetWindowHitTest)(SDL_Window *window, SDL_bool enabled); @@ -449,7 +446,7 @@ struct SDL_VideoDevice /* * * */ /* The function used to dispose of this structure */ - void (*free)(_THIS); + void (*free)(SDL_VideoDevice *_this); }; typedef struct VideoBootStrap diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 58508b879d..4ea06adba9 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -161,7 +161,7 @@ extern SDL_bool Cocoa_SetWindowFullscreenSpace(SDL_Window *window, SDL_bool stat #endif /* Convenience functions for reading driver flags */ -static SDL_bool ModeSwitchingEmulated(_THIS) +static SDL_bool ModeSwitchingEmulated(SDL_VideoDevice *_this) { if (_this->quirk_flags & VIDEO_DEVICE_QUIRK_MODE_SWITCHING_EMULATED) { return SDL_TRUE; @@ -169,7 +169,7 @@ static SDL_bool ModeSwitchingEmulated(_THIS) return SDL_FALSE; } -static SDL_bool DisableUnsetFullscreenOnMinimize(_THIS) +static SDL_bool DisableUnsetFullscreenOnMinimize(SDL_VideoDevice *_this) { if (_this->quirk_flags & VIDEO_DEVICE_QUIRK_DISABLE_UNSET_FULLSCREEN_ON_MINIMIZE) { return SDL_TRUE; diff --git a/src/video/android/SDL_androidclipboard.c b/src/video/android/SDL_androidclipboard.c index 6b7b25b56a..92792eb357 100644 --- a/src/video/android/SDL_androidclipboard.c +++ b/src/video/android/SDL_androidclipboard.c @@ -26,18 +26,18 @@ #include "SDL_androidclipboard.h" #include "../../core/android/SDL_android.h" -int Android_SetClipboardText(_THIS, const char *text) +int Android_SetClipboardText(SDL_VideoDevice *_this, const char *text) { return Android_JNI_SetClipboardText(text); } char * -Android_GetClipboardText(_THIS) +Android_GetClipboardText(SDL_VideoDevice *_this) { return Android_JNI_GetClipboardText(); } -SDL_bool Android_HasClipboardText(_THIS) +SDL_bool Android_HasClipboardText(SDL_VideoDevice *_this) { return Android_JNI_HasClipboardText(); } diff --git a/src/video/android/SDL_androidclipboard.h b/src/video/android/SDL_androidclipboard.h index dd57bdf45a..d161ef01bb 100644 --- a/src/video/android/SDL_androidclipboard.h +++ b/src/video/android/SDL_androidclipboard.h @@ -23,8 +23,8 @@ #ifndef SDL_androidclipboard_h_ #define SDL_androidclipboard_h_ -extern int Android_SetClipboardText(_THIS, const char *text); -extern char *Android_GetClipboardText(_THIS); -extern SDL_bool Android_HasClipboardText(_THIS); +extern int Android_SetClipboardText(SDL_VideoDevice *_this, const char *text); +extern char *Android_GetClipboardText(SDL_VideoDevice *_this); +extern SDL_bool Android_HasClipboardText(SDL_VideoDevice *_this); #endif /* SDL_androidclipboard_h_ */ diff --git a/src/video/android/SDL_androidevents.c b/src/video/android/SDL_androidevents.c index a924a23c48..077e4fb4fb 100644 --- a/src/video/android/SDL_androidevents.c +++ b/src/video/android/SDL_androidevents.c @@ -118,7 +118,7 @@ static void android_egl_context_backup(SDL_Window *window) * No polling necessary */ -void Android_PumpEvents_Blocking(_THIS) +void Android_PumpEvents_Blocking(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; @@ -193,7 +193,7 @@ void Android_PumpEvents_Blocking(_THIS) } } -void Android_PumpEvents_NonBlocking(_THIS) +void Android_PumpEvents_NonBlocking(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; static int backup_context = 0; diff --git a/src/video/android/SDL_androidevents.h b/src/video/android/SDL_androidevents.h index 8d5728520e..fc6753a10d 100644 --- a/src/video/android/SDL_androidevents.h +++ b/src/video/android/SDL_androidevents.h @@ -22,5 +22,5 @@ #include "SDL_androidvideo.h" -extern void Android_PumpEvents_Blocking(_THIS); -extern void Android_PumpEvents_NonBlocking(_THIS); +extern void Android_PumpEvents_Blocking(SDL_VideoDevice *_this); +extern void Android_PumpEvents_NonBlocking(SDL_VideoDevice *_this); diff --git a/src/video/android/SDL_androidgl.c b/src/video/android/SDL_androidgl.c index 70bbcff299..b08fc3cf01 100644 --- a/src/video/android/SDL_androidgl.c +++ b/src/video/android/SDL_androidgl.c @@ -35,7 +35,7 @@ #include -int Android_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int Android_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { if (window && context) { return SDL_EGL_MakeCurrent(_this, window->driverdata->egl_surface, context); @@ -45,7 +45,7 @@ int Android_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) } SDL_GLContext -Android_GLES_CreateContext(_THIS, SDL_Window *window) +Android_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_GLContext ret; @@ -58,7 +58,7 @@ Android_GLES_CreateContext(_THIS, SDL_Window *window) return ret; } -int Android_GLES_SwapWindow(_THIS, SDL_Window *window) +int Android_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { int retval; @@ -78,7 +78,7 @@ int Android_GLES_SwapWindow(_THIS, SDL_Window *window) return retval; } -int Android_GLES_LoadLibrary(_THIS, const char *path) +int Android_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)0, 0); } diff --git a/src/video/android/SDL_androidgl.h b/src/video/android/SDL_androidgl.h index b416ccbf24..059d3dcf45 100644 --- a/src/video/android/SDL_androidgl.h +++ b/src/video/android/SDL_androidgl.h @@ -23,9 +23,9 @@ #ifndef SDL_androidgl_h_ #define SDL_androidgl_h_ -SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window *window); -int Android_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -int Android_GLES_SwapWindow(_THIS, SDL_Window *window); -int Android_GLES_LoadLibrary(_THIS, const char *path); +SDL_GLContext Android_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +int Android_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +int Android_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +int Android_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); #endif /* SDL_androidgl_h_ */ diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c index fb17e1c6ea..f59f2d7402 100644 --- a/src/video/android/SDL_androidkeyboard.c +++ b/src/video/android/SDL_androidkeyboard.c @@ -337,29 +337,29 @@ int Android_OnKeyUp(int keycode) } SDL_bool -Android_HasScreenKeyboardSupport(_THIS) +Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { return SDL_TRUE; } SDL_bool -Android_IsScreenKeyboardShown(_THIS, SDL_Window *window) +Android_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { return Android_JNI_IsScreenKeyboardShown(); } -void Android_StartTextInput(_THIS) +void Android_StartTextInput(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; Android_JNI_ShowTextInput(&videodata->textRect); } -void Android_StopTextInput(_THIS) +void Android_StopTextInput(SDL_VideoDevice *_this) { Android_JNI_HideTextInput(); } -int Android_SetTextInputRect(_THIS, const SDL_Rect *rect) +int Android_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) { SDL_VideoData *videodata = _this->driverdata; videodata->textRect = *rect; diff --git a/src/video/android/SDL_androidkeyboard.h b/src/video/android/SDL_androidkeyboard.h index a515ff62a7..ed3c6fe3ff 100644 --- a/src/video/android/SDL_androidkeyboard.h +++ b/src/video/android/SDL_androidkeyboard.h @@ -25,9 +25,9 @@ extern int Android_OnKeyDown(int keycode); extern int Android_OnKeyUp(int keycode); -extern SDL_bool Android_HasScreenKeyboardSupport(_THIS); -extern SDL_bool Android_IsScreenKeyboardShown(_THIS, SDL_Window *window); +extern SDL_bool Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this); +extern SDL_bool Android_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); -extern void Android_StartTextInput(_THIS); -extern void Android_StopTextInput(_THIS); -extern int Android_SetTextInputRect(_THIS, const SDL_Rect *rect); +extern void Android_StartTextInput(SDL_VideoDevice *_this); +extern void Android_StopTextInput(SDL_VideoDevice *_this); +extern int Android_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); diff --git a/src/video/android/SDL_androidvideo.c b/src/video/android/SDL_androidvideo.c index 766278ae44..09ba1b8e4e 100644 --- a/src/video/android/SDL_androidvideo.c +++ b/src/video/android/SDL_androidvideo.c @@ -42,8 +42,8 @@ #define ANDROID_VID_DRIVER_NAME "Android" /* Initialization/Query functions */ -static int Android_VideoInit(_THIS); -static void Android_VideoQuit(_THIS); +static int Android_VideoInit(SDL_VideoDevice *_this); +static void Android_VideoQuit(SDL_VideoDevice *_this); #include "../SDL_egl_c.h" #define Android_GLES_GetProcAddress SDL_EGL_GetProcAddressInternal @@ -67,7 +67,7 @@ SDL_Semaphore *Android_ResumeSem = NULL; SDL_Mutex *Android_ActivityMutex = NULL; static SDL_SystemTheme Android_SystemTheme; -static int Android_SuspendScreenSaver(_THIS) +static int Android_SuspendScreenSaver(SDL_VideoDevice *_this) { return Android_JNI_SuspendScreenSaver(_this->suspend_screensaver); } @@ -166,7 +166,7 @@ VideoBootStrap Android_bootstrap = { Android_CreateDevice }; -int Android_VideoInit(_THIS) +int Android_VideoInit(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; SDL_DisplayID displayID; @@ -200,7 +200,7 @@ int Android_VideoInit(_THIS) return 0; } -void Android_VideoQuit(_THIS) +void Android_VideoQuit(SDL_VideoDevice *_this) { Android_QuitMouse(); Android_QuitTouch(); diff --git a/src/video/android/SDL_androidvulkan.c b/src/video/android/SDL_androidvulkan.c index ad072eaed8..685b7c4edd 100644 --- a/src/video/android/SDL_androidvulkan.c +++ b/src/video/android/SDL_androidvulkan.c @@ -35,7 +35,7 @@ #include -int Android_Vulkan_LoadLibrary(_THIS, const char *path) +int Android_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path) { VkExtensionProperties *extensions = NULL; Uint32 i, extensionCount = 0; @@ -101,7 +101,7 @@ fail: return -1; } -void Android_Vulkan_UnloadLibrary(_THIS) +void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) { if (_this->vulkan_config.loader_handle) { SDL_UnloadObject(_this->vulkan_config.loader_handle); @@ -109,7 +109,7 @@ void Android_Vulkan_UnloadLibrary(_THIS) } } -SDL_bool Android_Vulkan_GetInstanceExtensions(_THIS, +SDL_bool Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names) { @@ -125,7 +125,7 @@ SDL_bool Android_Vulkan_GetInstanceExtensions(_THIS, extensionsForAndroid); } -SDL_bool Android_Vulkan_CreateSurface(_THIS, +SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface) diff --git a/src/video/android/SDL_androidvulkan.h b/src/video/android/SDL_androidvulkan.h index a2aedc78bd..1b059c43d6 100644 --- a/src/video/android/SDL_androidvulkan.h +++ b/src/video/android/SDL_androidvulkan.h @@ -34,12 +34,12 @@ #if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_ANDROID) -int Android_Vulkan_LoadLibrary(_THIS, const char *path); -void Android_Vulkan_UnloadLibrary(_THIS); -SDL_bool Android_Vulkan_GetInstanceExtensions(_THIS, +int Android_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); +void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); +SDL_bool Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names); -SDL_bool Android_Vulkan_CreateSurface(_THIS, +SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); diff --git a/src/video/android/SDL_androidwindow.c b/src/video/android/SDL_androidwindow.c index 7fc32a001f..52a7c4332b 100644 --- a/src/video/android/SDL_androidwindow.c +++ b/src/video/android/SDL_androidwindow.c @@ -36,7 +36,7 @@ /* Currently only one window */ SDL_Window *Android_Window = NULL; -int Android_CreateWindow(_THIS, SDL_Window *window) +int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data; int retval = 0; @@ -100,12 +100,12 @@ endfunction: return retval; } -void Android_SetWindowTitle(_THIS, SDL_Window *window) +void Android_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { Android_JNI_SetActivityTitle(window->title); } -void Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) +void Android_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { SDL_LockMutex(Android_ActivityMutex); @@ -156,18 +156,18 @@ endfunction: SDL_UnlockMutex(Android_ActivityMutex); } -void Android_MinimizeWindow(_THIS, SDL_Window *window) +void Android_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { Android_JNI_MinizeWindow(); } -void Android_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) +void Android_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable) { /* Set orientation */ Android_JNI_SetOrientation(window->w, window->h, window->flags & SDL_WINDOW_RESIZABLE, SDL_GetHint(SDL_HINT_ORIENTATIONS)); } -void Android_DestroyWindow(_THIS, SDL_Window *window) +void Android_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_LockMutex(Android_ActivityMutex); @@ -194,7 +194,7 @@ void Android_DestroyWindow(_THIS, SDL_Window *window) SDL_UnlockMutex(Android_ActivityMutex); } -int Android_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) +int Android_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info) { SDL_WindowData *data = window->driverdata; diff --git a/src/video/android/SDL_androidwindow.h b/src/video/android/SDL_androidwindow.h index 6b95df333c..439156119d 100644 --- a/src/video/android/SDL_androidwindow.h +++ b/src/video/android/SDL_androidwindow.h @@ -26,14 +26,14 @@ #include "../../core/android/SDL_android.h" #include "../SDL_egl_c.h" -extern int Android_CreateWindow(_THIS, SDL_Window *window); -extern void Android_SetWindowTitle(_THIS, SDL_Window *window); -extern void Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); -extern void Android_MinimizeWindow(_THIS, SDL_Window *window); -extern void Android_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable); +extern int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Android_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +extern void Android_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); +extern void Android_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Android_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable); -extern void Android_DestroyWindow(_THIS, SDL_Window *window); -extern int Android_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); +extern void Android_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int Android_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info); extern SDL_Window *Android_Window; struct SDL_WindowData diff --git a/src/video/cocoa/SDL_cocoaclipboard.h b/src/video/cocoa/SDL_cocoaclipboard.h index cd6c71ce5f..72756a4db9 100644 --- a/src/video/cocoa/SDL_cocoaclipboard.h +++ b/src/video/cocoa/SDL_cocoaclipboard.h @@ -26,9 +26,9 @@ /* Forward declaration */ @class SDL_CocoaVideoData; -extern int Cocoa_SetClipboardText(_THIS, const char *text); -extern char *Cocoa_GetClipboardText(_THIS); -extern SDL_bool Cocoa_HasClipboardText(_THIS); +extern int Cocoa_SetClipboardText(SDL_VideoDevice *_this, const char *text); +extern char *Cocoa_GetClipboardText(SDL_VideoDevice *_this); +extern SDL_bool Cocoa_HasClipboardText(SDL_VideoDevice *_this); extern void Cocoa_CheckClipboardUpdate(SDL_CocoaVideoData *data); #endif /* SDL_cocoaclipboard_h_ */ diff --git a/src/video/cocoa/SDL_cocoaclipboard.m b/src/video/cocoa/SDL_cocoaclipboard.m index 2dec20d271..ad424707cd 100644 --- a/src/video/cocoa/SDL_cocoaclipboard.m +++ b/src/video/cocoa/SDL_cocoaclipboard.m @@ -25,7 +25,7 @@ #include "SDL_cocoavideo.h" #include "../../events/SDL_clipboardevents_c.h" -int Cocoa_SetClipboardText(_THIS, const char *text) +int Cocoa_SetClipboardText(SDL_VideoDevice *_this, const char *text) { @autoreleasepool { SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; @@ -45,7 +45,7 @@ int Cocoa_SetClipboardText(_THIS, const char *text) } char * -Cocoa_GetClipboardText(_THIS) +Cocoa_GetClipboardText(SDL_VideoDevice *_this) { @autoreleasepool { NSPasteboard *pasteboard; @@ -75,7 +75,7 @@ Cocoa_GetClipboardText(_THIS) } SDL_bool -Cocoa_HasClipboardText(_THIS) +Cocoa_HasClipboardText(SDL_VideoDevice *_this) { SDL_bool result = SDL_FALSE; char *text = Cocoa_GetClipboardText(_this); diff --git a/src/video/cocoa/SDL_cocoaevents.h b/src/video/cocoa/SDL_cocoaevents.h index 606747f271..c5846d708c 100644 --- a/src/video/cocoa/SDL_cocoaevents.h +++ b/src/video/cocoa/SDL_cocoaevents.h @@ -25,9 +25,9 @@ extern void Cocoa_RegisterApp(void); extern Uint64 Cocoa_GetEventTimestamp(NSTimeInterval nsTimestamp); -extern void Cocoa_PumpEvents(_THIS); -extern int Cocoa_WaitEventTimeout(_THIS, Sint64 timeoutNS); -extern void Cocoa_SendWakeupEvent(_THIS, SDL_Window *window); -extern int Cocoa_SuspendScreenSaver(_THIS); +extern void Cocoa_PumpEvents(SDL_VideoDevice *_this); +extern int Cocoa_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS); +extern void Cocoa_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_SuspendScreenSaver(SDL_VideoDevice *_this); #endif /* SDL_cocoaevents_h_ */ diff --git a/src/video/cocoa/SDL_cocoaevents.m b/src/video/cocoa/SDL_cocoaevents.m index d43b518c1f..5e0c3e49c0 100644 --- a/src/video/cocoa/SDL_cocoaevents.m +++ b/src/video/cocoa/SDL_cocoaevents.m @@ -524,7 +524,7 @@ Uint64 Cocoa_GetEventTimestamp(NSTimeInterval nsTimestamp) return timestamp; } -int Cocoa_PumpEventsUntilDate(_THIS, NSDate *expiration, bool accumulate) +int Cocoa_PumpEventsUntilDate(SDL_VideoDevice *_this, NSDate *expiration, bool accumulate) { for (;;) { NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:expiration inMode:NSDefaultRunLoopMode dequeue:YES]; @@ -545,7 +545,7 @@ int Cocoa_PumpEventsUntilDate(_THIS, NSDate *expiration, bool accumulate) return 1; } -int Cocoa_WaitEventTimeout(_THIS, Sint64 timeoutNS) +int Cocoa_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) { @autoreleasepool { if (timeoutNS > 0) { @@ -561,14 +561,14 @@ int Cocoa_WaitEventTimeout(_THIS, Sint64 timeoutNS) } } -void Cocoa_PumpEvents(_THIS) +void Cocoa_PumpEvents(SDL_VideoDevice *_this) { @autoreleasepool { Cocoa_PumpEventsUntilDate(_this, [NSDate distantPast], true); } } -void Cocoa_SendWakeupEvent(_THIS, SDL_Window *window) +void Cocoa_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { NSEvent *event = [NSEvent otherEventWithType:NSEventTypeApplicationDefined @@ -585,7 +585,7 @@ void Cocoa_SendWakeupEvent(_THIS, SDL_Window *window) } } -int Cocoa_SuspendScreenSaver(_THIS) +int Cocoa_SuspendScreenSaver(SDL_VideoDevice *_this) { @autoreleasepool { SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; diff --git a/src/video/cocoa/SDL_cocoakeyboard.h b/src/video/cocoa/SDL_cocoakeyboard.h index eea716a8ba..d522a9c633 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.h +++ b/src/video/cocoa/SDL_cocoakeyboard.h @@ -23,14 +23,14 @@ #ifndef SDL_cocoakeyboard_h_ #define SDL_cocoakeyboard_h_ -extern void Cocoa_InitKeyboard(_THIS); -extern void Cocoa_HandleKeyEvent(_THIS, NSEvent *event); -extern void Cocoa_QuitKeyboard(_THIS); +extern void Cocoa_InitKeyboard(SDL_VideoDevice *_this); +extern void Cocoa_HandleKeyEvent(SDL_VideoDevice *_this, NSEvent *event); +extern void Cocoa_QuitKeyboard(SDL_VideoDevice *_this); -extern void Cocoa_StartTextInput(_THIS); -extern void Cocoa_StopTextInput(_THIS); -extern int Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect); +extern void Cocoa_StartTextInput(SDL_VideoDevice *_this); +extern void Cocoa_StopTextInput(SDL_VideoDevice *_this); +extern int Cocoa_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); -extern void Cocoa_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed); +extern void Cocoa_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); #endif /* SDL_cocoakeyboard_h_ */ diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 799a29ac5e..9334c7ab2d 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -198,7 +198,7 @@ static bool IsModifierKeyPressed(unsigned int flags, return target_pressed; } -static void HandleModifiers(_THIS, SDL_Scancode code, unsigned int modifierFlags) +static void HandleModifiers(SDL_VideoDevice *_this, SDL_Scancode code, unsigned int modifierFlags) { bool pressed = false; @@ -312,7 +312,7 @@ cleanup: CFRelease(key_layout); } -void Cocoa_InitKeyboard(_THIS) +void Cocoa_InitKeyboard(SDL_VideoDevice *_this) { SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; @@ -330,7 +330,7 @@ void Cocoa_InitKeyboard(_THIS) SDL_ToggleModState(SDL_KMOD_CAPS, (data.modifierFlags & NSEventModifierFlagCapsLock) ? SDL_TRUE : SDL_FALSE); } -void Cocoa_StartTextInput(_THIS) +void Cocoa_StartTextInput(SDL_VideoDevice *_this) { @autoreleasepool { NSView *parentView; @@ -362,7 +362,7 @@ void Cocoa_StartTextInput(_THIS) } } -void Cocoa_StopTextInput(_THIS) +void Cocoa_StopTextInput(SDL_VideoDevice *_this) { @autoreleasepool { SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; @@ -374,14 +374,14 @@ void Cocoa_StopTextInput(_THIS) } } -int Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect) +int Cocoa_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) { SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; [data.fieldEdit setInputRect:rect]; return 0; } -void Cocoa_HandleKeyEvent(_THIS, NSEvent *event) +void Cocoa_HandleKeyEvent(SDL_VideoDevice *_this, NSEvent *event) { unsigned short scancode; SDL_Scancode code; @@ -443,7 +443,7 @@ void Cocoa_HandleKeyEvent(_THIS, NSEvent *event) } } -void Cocoa_QuitKeyboard(_THIS) +void Cocoa_QuitKeyboard(SDL_VideoDevice *_this) { } @@ -457,7 +457,7 @@ typedef enum extern CGSConnection _CGSDefaultConnection(void); extern CGError CGSSetGlobalHotKeyOperatingMode(CGSConnection connection, CGSGlobalHotKeyOperatingMode mode); -void Cocoa_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void Cocoa_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { #ifdef SDL_MAC_NO_SANDBOX CGSSetGlobalHotKeyOperatingMode(_CGSDefaultConnection(), grabbed ? CGSGlobalHotKeyDisable : CGSGlobalHotKeyEnable); diff --git a/src/video/cocoa/SDL_cocoametalview.h b/src/video/cocoa/SDL_cocoametalview.h index 1c930a06ed..aff42f8484 100644 --- a/src/video/cocoa/SDL_cocoametalview.h +++ b/src/video/cocoa/SDL_cocoametalview.h @@ -57,9 +57,9 @@ @end -SDL_MetalView Cocoa_Metal_CreateView(_THIS, SDL_Window *window); -void Cocoa_Metal_DestroyView(_THIS, SDL_MetalView view); -void *Cocoa_Metal_GetLayer(_THIS, SDL_MetalView view); +SDL_MetalView Cocoa_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window); +void Cocoa_Metal_DestroyView(SDL_VideoDevice *_this, SDL_MetalView view); +void *Cocoa_Metal_GetLayer(SDL_VideoDevice *_this, SDL_MetalView view); #endif /* SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL) */ diff --git a/src/video/cocoa/SDL_cocoametalview.m b/src/video/cocoa/SDL_cocoametalview.m index 0236b5d9ef..7d60f771ad 100644 --- a/src/video/cocoa/SDL_cocoametalview.m +++ b/src/video/cocoa/SDL_cocoametalview.m @@ -133,7 +133,7 @@ static int SDLCALL SDL_MetalViewEventWatch(void *userdata, SDL_Event *event) @end SDL_MetalView -Cocoa_Metal_CreateView(_THIS, SDL_Window *window) +Cocoa_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -164,7 +164,7 @@ Cocoa_Metal_CreateView(_THIS, SDL_Window *window) } } -void Cocoa_Metal_DestroyView(_THIS, SDL_MetalView view) +void Cocoa_Metal_DestroyView(SDL_VideoDevice *_this, SDL_MetalView view) { @autoreleasepool { SDL_cocoametalview *metalview = CFBridgingRelease(view); @@ -173,7 +173,7 @@ void Cocoa_Metal_DestroyView(_THIS, SDL_MetalView view) } void * -Cocoa_Metal_GetLayer(_THIS, SDL_MetalView view) +Cocoa_Metal_GetLayer(SDL_VideoDevice *_this, SDL_MetalView view) { @autoreleasepool { SDL_cocoametalview *cocoaview = (__bridge SDL_cocoametalview *)view; diff --git a/src/video/cocoa/SDL_cocoamodes.h b/src/video/cocoa/SDL_cocoamodes.h index 564ac9c71b..b3f44c0c6e 100644 --- a/src/video/cocoa/SDL_cocoamodes.h +++ b/src/video/cocoa/SDL_cocoamodes.h @@ -33,11 +33,11 @@ struct SDL_DisplayModeData CFMutableArrayRef modes; }; -extern void Cocoa_InitModes(_THIS); -extern int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); -extern int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); -extern int Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -extern int Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -extern void Cocoa_QuitModes(_THIS); +extern void Cocoa_InitModes(SDL_VideoDevice *_this); +extern int Cocoa_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); +extern int Cocoa_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); +extern int Cocoa_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +extern int Cocoa_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +extern void Cocoa_QuitModes(SDL_VideoDevice *_this); #endif /* SDL_cocoamodes_h_ */ diff --git a/src/video/cocoa/SDL_cocoamodes.m b/src/video/cocoa/SDL_cocoamodes.m index 6257a2cd22..48d49b6225 100644 --- a/src/video/cocoa/SDL_cocoamodes.m +++ b/src/video/cocoa/SDL_cocoamodes.m @@ -139,7 +139,7 @@ static Uint32 GetDisplayModePixelFormat(CGDisplayModeRef vidmode) return pixelformat; } -static SDL_bool GetDisplayMode(_THIS, CGDisplayModeRef vidmode, SDL_bool vidmodeCurrent, CFArrayRef modelist, CVDisplayLinkRef link, SDL_DisplayMode *mode) +static SDL_bool GetDisplayMode(SDL_VideoDevice *_this, CGDisplayModeRef vidmode, SDL_bool vidmodeCurrent, CFArrayRef modelist, CVDisplayLinkRef link, SDL_DisplayMode *mode) { SDL_DisplayModeData *data; bool usableForGUI = CGDisplayModeIsUsableForDesktopGUI(vidmode); @@ -277,7 +277,7 @@ static const char *Cocoa_GetDisplayName(CGDirectDisplayID displayID) return displayName; } -void Cocoa_InitModes(_THIS) +void Cocoa_InitModes(SDL_VideoDevice *_this) { @autoreleasepool { CGDisplayErr result; @@ -361,7 +361,7 @@ void Cocoa_InitModes(_THIS) } } -int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) +int Cocoa_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; CGRect cgrect; @@ -374,7 +374,7 @@ int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) return 0; } -int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) +int Cocoa_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; const CGDirectDisplayID cgdisplay = displaydata->display; @@ -406,7 +406,7 @@ int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rec return 0; } -int Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display) +int Cocoa_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { SDL_DisplayData *data = (SDL_DisplayData *)display->driverdata; CVDisplayLinkRef link = NULL; @@ -483,7 +483,7 @@ static CGError SetDisplayModeForDisplay(CGDirectDisplayID display, SDL_DisplayMo return result; } -int Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +int Cocoa_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata; @@ -548,7 +548,7 @@ ERR_NO_CAPTURE: return -1; } -void Cocoa_QuitModes(_THIS) +void Cocoa_QuitModes(SDL_VideoDevice *_this) { int i, j; diff --git a/src/video/cocoa/SDL_cocoamouse.h b/src/video/cocoa/SDL_cocoamouse.h index 50ae116599..4e89b7527c 100644 --- a/src/video/cocoa/SDL_cocoamouse.h +++ b/src/video/cocoa/SDL_cocoamouse.h @@ -25,11 +25,11 @@ #include "SDL_cocoavideo.h" -extern int Cocoa_InitMouse(_THIS); -extern void Cocoa_HandleMouseEvent(_THIS, NSEvent *event); +extern int Cocoa_InitMouse(SDL_VideoDevice *_this); +extern void Cocoa_HandleMouseEvent(SDL_VideoDevice *_this, NSEvent *event); extern void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event); extern void Cocoa_HandleMouseWarp(CGFloat x, CGFloat y); -extern void Cocoa_QuitMouse(_THIS); +extern void Cocoa_QuitMouse(SDL_VideoDevice *_this); typedef struct { diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m index ee173e06ff..03be6cbeed 100644 --- a/src/video/cocoa/SDL_cocoamouse.m +++ b/src/video/cocoa/SDL_cocoamouse.m @@ -362,7 +362,7 @@ static Uint32 Cocoa_GetGlobalMouseState(float *x, float *y) return retval; } -int Cocoa_InitMouse(_THIS) +int Cocoa_InitMouse(SDL_VideoDevice *_this) { NSPoint location; SDL_Mouse *mouse = SDL_GetMouse(); @@ -390,7 +390,7 @@ int Cocoa_InitMouse(_THIS) return 0; } -static void Cocoa_HandleTitleButtonEvent(_THIS, NSEvent *event) +static void Cocoa_HandleTitleButtonEvent(SDL_VideoDevice *_this, NSEvent *event) { SDL_Window *window; NSWindow *nswindow = [event window]; @@ -423,7 +423,7 @@ static void Cocoa_HandleTitleButtonEvent(_THIS, NSEvent *event) } } -void Cocoa_HandleMouseEvent(_THIS, NSEvent *event) +void Cocoa_HandleMouseEvent(SDL_VideoDevice *_this, NSEvent *event) { SDL_Mouse *mouse; SDL_MouseData *driverdata; @@ -552,7 +552,7 @@ void Cocoa_HandleMouseWarp(CGFloat x, CGFloat y) DLog("(%g, %g)", x, y); } -void Cocoa_QuitMouse(_THIS) +void Cocoa_QuitMouse(SDL_VideoDevice *_this) { SDL_Mouse *mouse = SDL_GetMouse(); if (mouse) { diff --git a/src/video/cocoa/SDL_cocoaopengl.h b/src/video/cocoa/SDL_cocoaopengl.h index cb5382073c..1ec05d8f5a 100644 --- a/src/video/cocoa/SDL_cocoaopengl.h +++ b/src/video/cocoa/SDL_cocoaopengl.h @@ -69,16 +69,16 @@ struct SDL_GLDriverData @end /* OpenGL functions */ -extern int Cocoa_GL_LoadLibrary(_THIS, const char *path); -extern SDL_FunctionPointer Cocoa_GL_GetProcAddress(_THIS, const char *proc); -extern void Cocoa_GL_UnloadLibrary(_THIS); -extern SDL_GLContext Cocoa_GL_CreateContext(_THIS, SDL_Window *window); -extern int Cocoa_GL_MakeCurrent(_THIS, SDL_Window *window, +extern int Cocoa_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_FunctionPointer Cocoa_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +extern void Cocoa_GL_UnloadLibrary(SDL_VideoDevice *_this); +extern SDL_GLContext Cocoa_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); -extern int Cocoa_GL_SetSwapInterval(_THIS, int interval); -extern int Cocoa_GL_GetSwapInterval(_THIS, int *interval); -extern int Cocoa_GL_SwapWindow(_THIS, SDL_Window *window); -extern int Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context); +extern int Cocoa_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval); +extern int Cocoa_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval); +extern int Cocoa_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); #ifdef __clang__ #pragma clang diagnostic pop diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index a61e8f2ac5..ec0250c340 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -225,7 +225,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt @end -int Cocoa_GL_LoadLibrary(_THIS, const char *path) +int Cocoa_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path) { /* Load the OpenGL library */ if (path == NULL) { @@ -243,18 +243,18 @@ int Cocoa_GL_LoadLibrary(_THIS, const char *path) return 0; } -SDL_FunctionPointer Cocoa_GL_GetProcAddress(_THIS, const char *proc) +SDL_FunctionPointer Cocoa_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc) { return SDL_LoadFunction(_this->gl_config.dll_handle, proc); } -void Cocoa_GL_UnloadLibrary(_THIS) +void Cocoa_GL_UnloadLibrary(SDL_VideoDevice *_this) { SDL_UnloadObject(_this->gl_config.dll_handle); _this->gl_config.dll_handle = NULL; } -SDL_GLContext Cocoa_GL_CreateContext(_THIS, SDL_Window *window) +SDL_GLContext Cocoa_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); @@ -435,7 +435,7 @@ SDL_GLContext Cocoa_GL_CreateContext(_THIS, SDL_Window *window) } } -int Cocoa_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int Cocoa_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { @autoreleasepool { if (context) { @@ -453,7 +453,7 @@ int Cocoa_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) } } -int Cocoa_GL_SetSwapInterval(_THIS, int interval) +int Cocoa_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval) { @autoreleasepool { SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)SDL_GL_GetCurrentContext(); @@ -473,7 +473,7 @@ int Cocoa_GL_SetSwapInterval(_THIS, int interval) } } -int Cocoa_GL_GetSwapInterval(_THIS, int *interval) +int Cocoa_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval) { @autoreleasepool { SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)SDL_GL_GetCurrentContext(); @@ -486,7 +486,7 @@ int Cocoa_GL_GetSwapInterval(_THIS, int *interval) } } -int Cocoa_GL_SwapWindow(_THIS, SDL_Window *window) +int Cocoa_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)SDL_GL_GetCurrentContext(); @@ -523,7 +523,7 @@ int Cocoa_GL_SwapWindow(_THIS, SDL_Window *window) } } -int Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context) +int Cocoa_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { @autoreleasepool { SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)context; diff --git a/src/video/cocoa/SDL_cocoaopengles.h b/src/video/cocoa/SDL_cocoaopengles.h index 3b81c07fa1..cbdaadd6f6 100644 --- a/src/video/cocoa/SDL_cocoaopengles.h +++ b/src/video/cocoa/SDL_cocoaopengles.h @@ -35,13 +35,13 @@ #define Cocoa_GLES_GetSwapInterval SDL_EGL_GetSwapInterval #define Cocoa_GLES_SetSwapInterval SDL_EGL_SetSwapInterval -extern int Cocoa_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext Cocoa_GLES_CreateContext(_THIS, SDL_Window *window); -extern int Cocoa_GLES_SwapWindow(_THIS, SDL_Window *window); -extern int Cocoa_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -extern int Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context); -extern int Cocoa_GLES_SetupWindow(_THIS, SDL_Window *window); -extern SDL_EGLSurface Cocoa_GLES_GetEGLSurface(_THIS, SDL_Window *window); +extern int Cocoa_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_GLContext Cocoa_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +extern int Cocoa_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); +extern int Cocoa_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern SDL_EGLSurface Cocoa_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/cocoa/SDL_cocoaopengles.m b/src/video/cocoa/SDL_cocoaopengles.m index 4ef42c5741..9fe2d360c2 100644 --- a/src/video/cocoa/SDL_cocoaopengles.m +++ b/src/video/cocoa/SDL_cocoaopengles.m @@ -28,7 +28,7 @@ /* EGL implementation of SDL OpenGL support */ -int Cocoa_GLES_LoadLibrary(_THIS, const char *path) +int Cocoa_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { /* If the profile requested is not GL ES, switch over to WIN_GL functions */ if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) { @@ -58,7 +58,7 @@ int Cocoa_GLES_LoadLibrary(_THIS, const char *path) } SDL_GLContext -Cocoa_GLES_CreateContext(_THIS, SDL_Window *window) +Cocoa_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_GLContext context; @@ -92,7 +92,7 @@ Cocoa_GLES_CreateContext(_THIS, SDL_Window *window) } } -int Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context) +int Cocoa_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { @autoreleasepool { SDL_EGL_DeleteContext(_this, context); @@ -100,21 +100,21 @@ int Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context) return 0; } -int Cocoa_GLES_SwapWindow(_THIS, SDL_Window *window) +int Cocoa_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { return SDL_EGL_SwapBuffers(_this, ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface); } } -int Cocoa_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int Cocoa_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { @autoreleasepool { return SDL_EGL_MakeCurrent(_this, window ? ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface : EGL_NO_SURFACE, context); } } -int Cocoa_GLES_SetupWindow(_THIS, SDL_Window *window) +int Cocoa_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { NSView *v; @@ -148,7 +148,7 @@ int Cocoa_GLES_SetupWindow(_THIS, SDL_Window *window) } SDL_EGLSurface -Cocoa_GLES_GetEGLSurface(_THIS, SDL_Window *window) +Cocoa_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { return ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface; diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m index 491cbe0953..d8e939f937 100644 --- a/src/video/cocoa/SDL_cocoavideo.m +++ b/src/video/cocoa/SDL_cocoavideo.m @@ -37,8 +37,8 @@ @end /* Initialization/Query functions */ -static int Cocoa_VideoInit(_THIS); -static void Cocoa_VideoQuit(_THIS); +static int Cocoa_VideoInit(SDL_VideoDevice *_this); +static void Cocoa_VideoQuit(SDL_VideoDevice *_this); /* Cocoa driver bootstrap functions */ @@ -188,7 +188,7 @@ VideoBootStrap COCOA_bootstrap = { Cocoa_CreateDevice }; -int Cocoa_VideoInit(_THIS) +int Cocoa_VideoInit(SDL_VideoDevice *_this) { @autoreleasepool { SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; @@ -211,7 +211,7 @@ int Cocoa_VideoInit(_THIS) } } -void Cocoa_VideoQuit(_THIS) +void Cocoa_VideoQuit(SDL_VideoDevice *_this) { @autoreleasepool { SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; diff --git a/src/video/cocoa/SDL_cocoavulkan.h b/src/video/cocoa/SDL_cocoavulkan.h index d49de0f438..3a49b2adfc 100644 --- a/src/video/cocoa/SDL_cocoavulkan.h +++ b/src/video/cocoa/SDL_cocoavulkan.h @@ -34,12 +34,12 @@ #if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_COCOA) -int Cocoa_Vulkan_LoadLibrary(_THIS, const char *path); -void Cocoa_Vulkan_UnloadLibrary(_THIS); -SDL_bool Cocoa_Vulkan_GetInstanceExtensions(_THIS, +int Cocoa_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); +void Cocoa_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); +SDL_bool Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names); -SDL_bool Cocoa_Vulkan_CreateSurface(_THIS, +SDL_bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); diff --git a/src/video/cocoa/SDL_cocoavulkan.m b/src/video/cocoa/SDL_cocoavulkan.m index 0e971211e9..027ba2ac24 100644 --- a/src/video/cocoa/SDL_cocoavulkan.m +++ b/src/video/cocoa/SDL_cocoavulkan.m @@ -48,7 +48,7 @@ const char *defaultPaths[] = { /* Since libSDL is most likely a .dylib, need RTLD_DEFAULT not RTLD_SELF. */ #define DEFAULT_HANDLE RTLD_DEFAULT -int Cocoa_Vulkan_LoadLibrary(_THIS, const char *path) +int Cocoa_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path) { VkExtensionProperties *extensions = NULL; Uint32 extensionCount = 0; @@ -153,7 +153,7 @@ fail: return -1; } -void Cocoa_Vulkan_UnloadLibrary(_THIS) +void Cocoa_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) { if (_this->vulkan_config.loader_handle) { if (_this->vulkan_config.loader_handle != DEFAULT_HANDLE) { @@ -163,7 +163,7 @@ void Cocoa_Vulkan_UnloadLibrary(_THIS) } } -SDL_bool Cocoa_Vulkan_GetInstanceExtensions(_THIS, +SDL_bool Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names) { @@ -179,7 +179,7 @@ SDL_bool Cocoa_Vulkan_GetInstanceExtensions(_THIS, extensionsForCocoa); } -static SDL_bool Cocoa_Vulkan_CreateSurfaceViaMetalView(_THIS, +static SDL_bool Cocoa_Vulkan_CreateSurfaceViaMetalView(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface, @@ -232,7 +232,7 @@ static SDL_bool Cocoa_Vulkan_CreateSurfaceViaMetalView(_THIS, return SDL_TRUE; } -SDL_bool Cocoa_Vulkan_CreateSurface(_THIS, +SDL_bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface) diff --git a/src/video/cocoa/SDL_cocoawindow.h b/src/video/cocoa/SDL_cocoawindow.h index fa2e4aa2ba..ceb27db92a 100644 --- a/src/video/cocoa/SDL_cocoawindow.h +++ b/src/video/cocoa/SDL_cocoawindow.h @@ -139,35 +139,35 @@ typedef enum #endif @end -extern int Cocoa_CreateWindow(_THIS, SDL_Window *window); -extern int Cocoa_CreateWindowFrom(_THIS, SDL_Window *window, +extern int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data); -extern void Cocoa_SetWindowTitle(_THIS, SDL_Window *window); -extern int Cocoa_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon); -extern int Cocoa_SetWindowPosition(_THIS, SDL_Window *window); -extern void Cocoa_SetWindowSize(_THIS, SDL_Window *window); -extern void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window *window); -extern void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window *window); -extern void Cocoa_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h); -extern int Cocoa_SetWindowOpacity(_THIS, SDL_Window *window, float opacity); -extern void Cocoa_ShowWindow(_THIS, SDL_Window *window); -extern void Cocoa_HideWindow(_THIS, SDL_Window *window); -extern void Cocoa_RaiseWindow(_THIS, SDL_Window *window); -extern void Cocoa_MaximizeWindow(_THIS, SDL_Window *window); -extern void Cocoa_MinimizeWindow(_THIS, SDL_Window *window); -extern void Cocoa_RestoreWindow(_THIS, SDL_Window *window); -extern void Cocoa_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered); -extern void Cocoa_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable); -extern void Cocoa_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top); -extern void Cocoa_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); -extern void *Cocoa_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size); -extern SDL_DisplayID Cocoa_GetDisplayForWindow(_THIS, SDL_Window *window); -extern void Cocoa_SetWindowMouseRect(_THIS, SDL_Window *window); -extern void Cocoa_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -extern void Cocoa_DestroyWindow(_THIS, SDL_Window *window); -extern int Cocoa_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); +extern void Cocoa_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon); +extern int Cocoa_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h); +extern int Cocoa_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity); +extern void Cocoa_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered); +extern void Cocoa_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable); +extern void Cocoa_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top); +extern void Cocoa_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); +extern void *Cocoa_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size); +extern SDL_DisplayID Cocoa_GetDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window); +extern void Cocoa_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); +extern void Cocoa_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info); extern int Cocoa_SetWindowHitTest(SDL_Window *window, SDL_bool enabled); extern void Cocoa_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept); -extern int Cocoa_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation); +extern int Cocoa_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation); #endif /* SDL_cocoawindow_h_ */ diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index c414a5d2c0..e57837ee02 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -1655,7 +1655,7 @@ static int Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL_ @end -static int SetupWindowData(_THIS, SDL_Window *window, NSWindow *nswindow, NSView *nsview, SDL_bool created) +static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, NSWindow *nswindow, NSView *nsview, SDL_bool created) { @autoreleasepool { SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata; @@ -1772,7 +1772,7 @@ static int SetupWindowData(_THIS, SDL_Window *window, NSWindow *nswindow, NSView } } -int Cocoa_CreateWindow(_THIS, SDL_Window *window) +int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata; @@ -1919,7 +1919,7 @@ int Cocoa_CreateWindow(_THIS, SDL_Window *window) } } -int Cocoa_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) +int Cocoa_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data) { @autoreleasepool { NSView *nsview = nil; @@ -1960,7 +1960,7 @@ int Cocoa_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) } } -void Cocoa_SetWindowTitle(_THIS, SDL_Window *window) +void Cocoa_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { const char *title = window->title ? window->title : ""; @@ -1970,7 +1970,7 @@ void Cocoa_SetWindowTitle(_THIS, SDL_Window *window) } } -int Cocoa_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) +int Cocoa_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon) { @autoreleasepool { NSImage *nsimage = Cocoa_CreateImage(icon); @@ -1985,7 +1985,7 @@ int Cocoa_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) } } -int Cocoa_SetWindowPosition(_THIS, SDL_Window *window) +int Cocoa_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2029,7 +2029,7 @@ int Cocoa_SetWindowPosition(_THIS, SDL_Window *window) return 0; } -void Cocoa_SetWindowSize(_THIS, SDL_Window *window) +void Cocoa_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2058,7 +2058,7 @@ void Cocoa_SetWindowSize(_THIS, SDL_Window *window) } } -void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window *window) +void Cocoa_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2071,7 +2071,7 @@ void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window *window) } } -void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window *window) +void Cocoa_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2084,7 +2084,7 @@ void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window *window) } } -void Cocoa_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) +void Cocoa_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h) { @autoreleasepool { SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2101,7 +2101,7 @@ void Cocoa_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) } } -void Cocoa_ShowWindow(_THIS, SDL_Window *window) +void Cocoa_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *windowData = ((__bridge SDL_CocoaWindowData *)window->driverdata); @@ -2115,7 +2115,7 @@ void Cocoa_ShowWindow(_THIS, SDL_Window *window) } } -void Cocoa_HideWindow(_THIS, SDL_Window *window) +void Cocoa_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; @@ -2138,7 +2138,7 @@ void Cocoa_HideWindow(_THIS, SDL_Window *window) } } -void Cocoa_RaiseWindow(_THIS, SDL_Window *window) +void Cocoa_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *windowData = ((__bridge SDL_CocoaWindowData *)window->driverdata); @@ -2156,7 +2156,7 @@ void Cocoa_RaiseWindow(_THIS, SDL_Window *window) } } -void Cocoa_MaximizeWindow(_THIS, SDL_Window *window) +void Cocoa_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2168,7 +2168,7 @@ void Cocoa_MaximizeWindow(_THIS, SDL_Window *window) } } -void Cocoa_MinimizeWindow(_THIS, SDL_Window *window) +void Cocoa_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2181,7 +2181,7 @@ void Cocoa_MinimizeWindow(_THIS, SDL_Window *window) } } -void Cocoa_RestoreWindow(_THIS, SDL_Window *window) +void Cocoa_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; @@ -2194,7 +2194,7 @@ void Cocoa_RestoreWindow(_THIS, SDL_Window *window) } } -void Cocoa_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) +void Cocoa_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered) { @autoreleasepool { if (SetWindowStyle(window, GetWindowStyle(window))) { @@ -2205,7 +2205,7 @@ void Cocoa_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) } } -void Cocoa_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) +void Cocoa_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable) { @autoreleasepool { /* Don't set this if we're in a space! @@ -2230,7 +2230,7 @@ void Cocoa_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) } } -void Cocoa_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top) +void Cocoa_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top) { @autoreleasepool { NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; @@ -2242,7 +2242,7 @@ void Cocoa_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top) } } -void Cocoa_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) +void Cocoa_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { @autoreleasepool { SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2332,7 +2332,7 @@ void Cocoa_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *disp } void * -Cocoa_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size) +Cocoa_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size) { @autoreleasepool { SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2369,7 +2369,7 @@ Cocoa_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size) } } -SDL_DisplayID Cocoa_GetDisplayForWindow(_THIS, SDL_Window *window) +SDL_DisplayID Cocoa_GetDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { NSScreen *screen; @@ -2405,12 +2405,12 @@ SDL_DisplayID Cocoa_GetDisplayForWindow(_THIS, SDL_Window *window) } } -void Cocoa_SetWindowMouseRect(_THIS, SDL_Window *window) +void Cocoa_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window) { Cocoa_UpdateClipCursor(window); } -void Cocoa_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void Cocoa_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { @autoreleasepool { SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2431,7 +2431,7 @@ void Cocoa_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) } } -void Cocoa_DestroyWindow(_THIS, SDL_Window *window) +void Cocoa_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *data = (SDL_CocoaWindowData *)CFBridgingRelease(window->driverdata); @@ -2474,7 +2474,7 @@ void Cocoa_DestroyWindow(_THIS, SDL_Window *window) } } -int Cocoa_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) +int Cocoa_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info) { @autoreleasepool { NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; @@ -2562,7 +2562,7 @@ void Cocoa_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept) } } -int Cocoa_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) +int Cocoa_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation) { @autoreleasepool { /* Note that this is app-wide and not window-specific! */ @@ -2590,7 +2590,7 @@ int Cocoa_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) } } -int Cocoa_SetWindowOpacity(_THIS, SDL_Window *window, float opacity) +int Cocoa_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity) { @autoreleasepool { SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; diff --git a/src/video/dummy/SDL_nullevents.c b/src/video/dummy/SDL_nullevents.c index 6abf10709b..51e2a8f1f4 100644 --- a/src/video/dummy/SDL_nullevents.c +++ b/src/video/dummy/SDL_nullevents.c @@ -30,7 +30,7 @@ #include "SDL_nullvideo.h" #include "SDL_nullevents_c.h" -void DUMMY_PumpEvents(_THIS) +void DUMMY_PumpEvents(SDL_VideoDevice *_this) { /* do nothing. */ } diff --git a/src/video/dummy/SDL_nullevents_c.h b/src/video/dummy/SDL_nullevents_c.h index c7913e1250..5cae376b6e 100644 --- a/src/video/dummy/SDL_nullevents_c.h +++ b/src/video/dummy/SDL_nullevents_c.h @@ -26,6 +26,6 @@ #include "SDL_nullvideo.h" -extern void DUMMY_PumpEvents(_THIS); +extern void DUMMY_PumpEvents(SDL_VideoDevice *_this); #endif /* SDL_nullevents_c_h_ */ diff --git a/src/video/dummy/SDL_nullframebuffer.c b/src/video/dummy/SDL_nullframebuffer.c index ca99b53ed4..e0f9e6c134 100644 --- a/src/video/dummy/SDL_nullframebuffer.c +++ b/src/video/dummy/SDL_nullframebuffer.c @@ -27,7 +27,7 @@ #define DUMMY_SURFACE "_SDL_DummySurface" -int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) +int SDL_DUMMY_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_Surface *surface; const Uint32 surface_format = SDL_PIXELFORMAT_RGB888; @@ -51,7 +51,7 @@ int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, return 0; } -int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) +int SDL_DUMMY_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { static int frame_number; SDL_Surface *surface; @@ -71,7 +71,7 @@ int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect return 0; } -void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +void SDL_DUMMY_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { SDL_Surface *surface; diff --git a/src/video/dummy/SDL_nullframebuffer_c.h b/src/video/dummy/SDL_nullframebuffer_c.h index 50f5a10437..41ecfaaf5b 100644 --- a/src/video/dummy/SDL_nullframebuffer_c.h +++ b/src/video/dummy/SDL_nullframebuffer_c.h @@ -24,8 +24,8 @@ #include "SDL_internal.h" -extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); -extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); -extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window *window); +extern int SDL_DUMMY_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int SDL_DUMMY_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void SDL_DUMMY_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_nullframebuffer_c_h_ */ diff --git a/src/video/dummy/SDL_nullvideo.c b/src/video/dummy/SDL_nullvideo.c index 3f4365e85c..cb53095fb8 100644 --- a/src/video/dummy/SDL_nullvideo.c +++ b/src/video/dummy/SDL_nullvideo.c @@ -49,13 +49,13 @@ #define DUMMYVID_DRIVER_EVDEV_NAME "evdev" /* Initialization/Query functions */ -static int DUMMY_VideoInit(_THIS); -static int DUMMY_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -static void DUMMY_VideoQuit(_THIS); +static int DUMMY_VideoInit(SDL_VideoDevice *_this); +static int DUMMY_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +static void DUMMY_VideoQuit(SDL_VideoDevice *_this); #ifdef SDL_INPUT_LINUXEV static int evdev = 0; -static void DUMMY_EVDEV_Poll(_THIS); +static void DUMMY_EVDEV_Poll(SDL_VideoDevice *_this); #endif /* DUMMY driver bootstrap functions */ @@ -130,14 +130,14 @@ VideoBootStrap DUMMY_evdev_bootstrap = { void SDL_EVDEV_Init(void); void SDL_EVDEV_Poll(void); void SDL_EVDEV_Quit(void); -static void DUMMY_EVDEV_Poll(_THIS) +static void DUMMY_EVDEV_Poll(SDL_VideoDevice *_this) { (void)_this; SDL_EVDEV_Poll(); } #endif -int DUMMY_VideoInit(_THIS) +int DUMMY_VideoInit(SDL_VideoDevice *_this) { SDL_DisplayMode mode; @@ -158,12 +158,12 @@ int DUMMY_VideoInit(_THIS) return 0; } -static int DUMMY_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +static int DUMMY_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -void DUMMY_VideoQuit(_THIS) +void DUMMY_VideoQuit(SDL_VideoDevice *_this) { #ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Quit(); diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.c b/src/video/emscripten/SDL_emscriptenframebuffer.c index beb8c6496e..4dd883ae52 100644 --- a/src/video/emscripten/SDL_emscriptenframebuffer.c +++ b/src/video/emscripten/SDL_emscriptenframebuffer.c @@ -27,7 +27,7 @@ #include -int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) +int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_Surface *surface; const Uint32 surface_format = SDL_PIXELFORMAT_BGR888; @@ -54,7 +54,7 @@ int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format return 0; } -int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) +int Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { SDL_Surface *surface; @@ -150,7 +150,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect return 0; } -void Emscripten_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +void Emscripten_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.h b/src/video/emscripten/SDL_emscriptenframebuffer.h index 3dc289b174..0192e35075 100644 --- a/src/video/emscripten/SDL_emscriptenframebuffer.h +++ b/src/video/emscripten/SDL_emscriptenframebuffer.h @@ -23,8 +23,8 @@ #ifndef SDL_emscriptenframebuffer_h_ #define SDL_emscriptenframebuffer_h_ -extern int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); -extern int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); -extern void Emscripten_DestroyWindowFramebuffer(_THIS, SDL_Window *window); +extern int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void Emscripten_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_emscriptenframebuffer_h_ */ diff --git a/src/video/emscripten/SDL_emscriptenopengles.c b/src/video/emscripten/SDL_emscriptenopengles.c index c97dd22c3c..6a40c24c95 100644 --- a/src/video/emscripten/SDL_emscriptenopengles.c +++ b/src/video/emscripten/SDL_emscriptenopengles.c @@ -29,21 +29,21 @@ #include "SDL_emscriptenvideo.h" #include "SDL_emscriptenopengles.h" -int Emscripten_GLES_LoadLibrary(_THIS, const char *path) +int Emscripten_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { return 0; } -void Emscripten_GLES_UnloadLibrary(_THIS) +void Emscripten_GLES_UnloadLibrary(SDL_VideoDevice *_this) { } -SDL_FunctionPointer Emscripten_GLES_GetProcAddress(_THIS, const char *proc) +SDL_FunctionPointer Emscripten_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc) { return emscripten_webgl_get_proc_address(proc); } -int Emscripten_GLES_SetSwapInterval(_THIS, int interval) +int Emscripten_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval) { if (interval < 0) { return SDL_SetError("Late swap tearing currently unsupported"); @@ -56,7 +56,7 @@ int Emscripten_GLES_SetSwapInterval(_THIS, int interval) return 0; } -int Emscripten_GLES_GetSwapInterval(_THIS, int *interval) +int Emscripten_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval) { int mode, value; @@ -71,7 +71,7 @@ int Emscripten_GLES_GetSwapInterval(_THIS, int *interval) } } -SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window *window) +SDL_GLContext Emscripten_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *window_data; @@ -112,7 +112,7 @@ SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window *window) return (SDL_GLContext)context; } -int Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context) +int Emscripten_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { SDL_Window *window; @@ -129,7 +129,7 @@ int Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context) return 0; } -int Emscripten_GLES_SwapWindow(_THIS, SDL_Window *window) +int Emscripten_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) { /* give back control to browser for screen refresh */ @@ -138,7 +138,7 @@ int Emscripten_GLES_SwapWindow(_THIS, SDL_Window *window) return 0; } -int Emscripten_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int Emscripten_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { /* it isn't possible to reuse contexts across canvases */ if (window && context) { diff --git a/src/video/emscripten/SDL_emscriptenopengles.h b/src/video/emscripten/SDL_emscriptenopengles.h index 5f264b61af..ecd879296d 100644 --- a/src/video/emscripten/SDL_emscriptenopengles.h +++ b/src/video/emscripten/SDL_emscriptenopengles.h @@ -28,15 +28,15 @@ #include "../SDL_sysvideo.h" /* OpenGLES functions */ -extern int Emscripten_GLES_LoadLibrary(_THIS, const char *path); -extern void Emscripten_GLES_UnloadLibrary(_THIS); -extern SDL_FunctionPointer Emscripten_GLES_GetProcAddress(_THIS, const char *proc); -extern int Emscripten_GLES_SetSwapInterval(_THIS, int interval); -extern int Emscripten_GLES_GetSwapInterval(_THIS, int *interval); -extern SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window *window); -extern int Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context); -extern int Emscripten_GLES_SwapWindow(_THIS, SDL_Window *window); -extern int Emscripten_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); +extern int Emscripten_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern void Emscripten_GLES_UnloadLibrary(SDL_VideoDevice *_this); +extern SDL_FunctionPointer Emscripten_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +extern int Emscripten_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval); +extern int Emscripten_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval); +extern SDL_GLContext Emscripten_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int Emscripten_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); +extern int Emscripten_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int Emscripten_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); #endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */ diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c index 734a264218..0c18adbd8f 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.c +++ b/src/video/emscripten/SDL_emscriptenvideo.c @@ -35,18 +35,18 @@ #define EMSCRIPTENVID_DRIVER_NAME "emscripten" /* Initialization/Query functions */ -static int Emscripten_VideoInit(_THIS); -static int Emscripten_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -static void Emscripten_VideoQuit(_THIS); -static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); +static int Emscripten_VideoInit(SDL_VideoDevice *_this); +static int Emscripten_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +static void Emscripten_VideoQuit(SDL_VideoDevice *_this); +static int Emscripten_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); -static int Emscripten_CreateWindow(_THIS, SDL_Window *window); -static void Emscripten_SetWindowSize(_THIS, SDL_Window *window); -static void Emscripten_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h); -static void Emscripten_DestroyWindow(_THIS, SDL_Window *window); -static void Emscripten_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); -static void Emscripten_PumpEvents(_THIS); -static void Emscripten_SetWindowTitle(_THIS, SDL_Window *window); +static int Emscripten_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +static void Emscripten_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +static void Emscripten_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h); +static void Emscripten_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); +static void Emscripten_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); +static void Emscripten_PumpEvents(SDL_VideoDevice *_this); +static void Emscripten_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); /* Emscripten driver bootstrap functions */ @@ -120,7 +120,7 @@ VideoBootStrap Emscripten_bootstrap = { Emscripten_CreateDevice }; -int Emscripten_VideoInit(_THIS) +int Emscripten_VideoInit(SDL_VideoDevice *_this) { SDL_DisplayMode mode; @@ -140,18 +140,18 @@ int Emscripten_VideoInit(_THIS) return 0; } -static int Emscripten_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +static int Emscripten_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { /* can't do this */ return 0; } -static void Emscripten_VideoQuit(_THIS) +static void Emscripten_VideoQuit(SDL_VideoDevice *_this) { Emscripten_FiniMouse(); } -static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) +static int Emscripten_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { if (rect) { rect->x = 0; @@ -166,12 +166,12 @@ static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, S return 0; } -static void Emscripten_PumpEvents(_THIS) +static void Emscripten_PumpEvents(SDL_VideoDevice *_this) { /* do nothing. */ } -static int Emscripten_CreateWindow(_THIS, SDL_Window *window) +static int Emscripten_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wdata; double scaled_w, scaled_h; @@ -238,7 +238,7 @@ static int Emscripten_CreateWindow(_THIS, SDL_Window *window) return 0; } -static void Emscripten_SetWindowSize(_THIS, SDL_Window *window) +static void Emscripten_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data; @@ -257,7 +257,7 @@ static void Emscripten_SetWindowSize(_THIS, SDL_Window *window) } } -static void Emscripten_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) +static void Emscripten_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h) { SDL_WindowData *data; if (window->driverdata) { @@ -267,7 +267,7 @@ static void Emscripten_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, } } -static void Emscripten_DestroyWindow(_THIS, SDL_Window *window) +static void Emscripten_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data; @@ -285,7 +285,7 @@ static void Emscripten_DestroyWindow(_THIS, SDL_Window *window) } } -static void Emscripten_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) +static void Emscripten_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { SDL_WindowData *data; if (window->driverdata) { @@ -324,7 +324,7 @@ static void Emscripten_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoD } } -static void Emscripten_SetWindowTitle(_THIS, SDL_Window *window) +static void Emscripten_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { emscripten_set_window_title(window->title); } diff --git a/src/video/haiku/SDL_bclipboard.cc b/src/video/haiku/SDL_bclipboard.cc index 7aaa3ef38c..04625ad8e5 100644 --- a/src/video/haiku/SDL_bclipboard.cc +++ b/src/video/haiku/SDL_bclipboard.cc @@ -34,7 +34,7 @@ extern "C" { #endif -int HAIKU_SetClipboardText(_THIS, const char *text) { +int HAIKU_SetClipboardText(SDL_VideoDevice *_this, const char *text) { BMessage *clip = NULL; if (be_clipboard->Lock()) { be_clipboard->Clear(); @@ -50,7 +50,7 @@ int HAIKU_SetClipboardText(_THIS, const char *text) { return 0; } -char *HAIKU_GetClipboardText(_THIS) { +char *HAIKU_GetClipboardText(SDL_VideoDevice *_this) { BMessage *clip = NULL; const char *text = NULL; ssize_t length; @@ -75,7 +75,7 @@ char *HAIKU_GetClipboardText(_THIS) { return result; } -SDL_bool HAIKU_HasClipboardText(_THIS) { +SDL_bool HAIKU_HasClipboardText(SDL_VideoDevice *_this) { SDL_bool result = SDL_FALSE; char *text = HAIKU_GetClipboardText(_this); if (text) { diff --git a/src/video/haiku/SDL_bclipboard.h b/src/video/haiku/SDL_bclipboard.h index 82ed586aaa..62a6791bc3 100644 --- a/src/video/haiku/SDL_bclipboard.h +++ b/src/video/haiku/SDL_bclipboard.h @@ -24,8 +24,8 @@ #ifndef SDL_BCLIPBOARD_H #define SDL_BCLIPBOARD_H -extern int HAIKU_SetClipboardText(_THIS, const char *text); -extern char *HAIKU_GetClipboardText(_THIS); -extern SDL_bool HAIKU_HasClipboardText(_THIS); +extern int HAIKU_SetClipboardText(SDL_VideoDevice *_this, const char *text); +extern char *HAIKU_GetClipboardText(SDL_VideoDevice *_this); +extern SDL_bool HAIKU_HasClipboardText(SDL_VideoDevice *_this); #endif diff --git a/src/video/haiku/SDL_bevents.cc b/src/video/haiku/SDL_bevents.cc index 9c78b12d84..6075eb854a 100644 --- a/src/video/haiku/SDL_bevents.cc +++ b/src/video/haiku/SDL_bevents.cc @@ -28,7 +28,7 @@ extern "C" { #endif -void HAIKU_PumpEvents(_THIS) { +void HAIKU_PumpEvents(SDL_VideoDevice *_this) { /* Since the event thread is its own thread, this isn't really necessary */ } diff --git a/src/video/haiku/SDL_bevents.h b/src/video/haiku/SDL_bevents.h index a7bf257bc3..d8db1b54cb 100644 --- a/src/video/haiku/SDL_bevents.h +++ b/src/video/haiku/SDL_bevents.h @@ -28,7 +28,7 @@ extern "C" { #endif -extern void HAIKU_PumpEvents(_THIS); +extern void HAIKU_PumpEvents(SDL_VideoDevice *_this); #ifdef __cplusplus } diff --git a/src/video/haiku/SDL_bframebuffer.cc b/src/video/haiku/SDL_bframebuffer.cc index 0540736412..0151c72c53 100644 --- a/src/video/haiku/SDL_bframebuffer.cc +++ b/src/video/haiku/SDL_bframebuffer.cc @@ -43,7 +43,7 @@ static SDL_INLINE SDL_BLooper *_GetBeLooper() { return SDL_Looper; } -int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window, +int HAIKU_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) { SDL_BWin *bwin = _ToBeWin(window); @@ -92,7 +92,7 @@ int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window, -int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window * window, +int HAIKU_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, const SDL_Rect * rects, int numrects) { if (window == NULL) { return 0; @@ -105,7 +105,7 @@ int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window * window, return 0; } -void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window * window) { +void HAIKU_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window) { SDL_BWin *bwin = _ToBeWin(window); bwin->LockBuffer(); diff --git a/src/video/haiku/SDL_bframebuffer.h b/src/video/haiku/SDL_bframebuffer.h index c4bd4ceedc..a1ab7ee152 100644 --- a/src/video/haiku/SDL_bframebuffer.h +++ b/src/video/haiku/SDL_bframebuffer.h @@ -30,12 +30,12 @@ extern "C" { #include "../SDL_sysvideo.h" -extern int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window *window, +extern int HAIKU_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); -extern int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window *window, +extern int HAIKU_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); -extern void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window *window); +extern void HAIKU_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); extern int32 HAIKU_DrawThread(void *data); #ifdef __cplusplus diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc index 1e2daeb9c8..1ace720f9a 100644 --- a/src/video/haiku/SDL_bmodes.cc +++ b/src/video/haiku/SDL_bmodes.cc @@ -201,7 +201,7 @@ static void _AddDisplay(BScreen *screen) { * Functions called by SDL */ -int HAIKU_InitModes(_THIS) { +int HAIKU_InitModes(SDL_VideoDevice *_this) { BScreen screen; /* TODO: When Haiku supports multiple display screens, call @@ -210,13 +210,13 @@ int HAIKU_InitModes(_THIS) { return 0; } -int HAIKU_QuitModes(_THIS) { +int HAIKU_QuitModes(SDL_VideoDevice *_this) { /* FIXME: Nothing really needs to be done here at the moment? */ return 0; } -int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) { +int HAIKU_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { BScreen bscreen; BRect rc = bscreen.Frame(); rect->x = (int)rc.left; @@ -226,7 +226,7 @@ int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) { return 0; } -int HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { +int HAIKU_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { /* Get the current screen */ BScreen bscreen; @@ -252,7 +252,7 @@ int HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { } -int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { +int HAIKU_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { /* Get the current screen */ BScreen bscreen; if (!bscreen.IsValid()) { diff --git a/src/video/haiku/SDL_bmodes.h b/src/video/haiku/SDL_bmodes.h index d61867c05e..0a9ca796e2 100644 --- a/src/video/haiku/SDL_bmodes.h +++ b/src/video/haiku/SDL_bmodes.h @@ -30,12 +30,12 @@ extern "C" { extern int32 HAIKU_ColorSpaceToSDLPxFormat(uint32 colorspace); -extern int HAIKU_InitModes(_THIS); -extern int HAIKU_QuitModes(_THIS); -extern int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, +extern int HAIKU_InitModes(SDL_VideoDevice *_this); +extern int HAIKU_QuitModes(SDL_VideoDevice *_this); +extern int HAIKU_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); -extern int HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -extern int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, +extern int HAIKU_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +extern int HAIKU_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); #ifdef __cplusplus diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc index d5074fe12d..52f2ed9c42 100644 --- a/src/video/haiku/SDL_bopengl.cc +++ b/src/video/haiku/SDL_bopengl.cc @@ -44,7 +44,7 @@ static SDL_INLINE SDL_BLooper *_GetBeLooper() { } /* Passing a NULL path means load pointers from the application */ -int HAIKU_GL_LoadLibrary(_THIS, const char *path) +int HAIKU_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path) { /* FIXME: Is this working correctly? */ image_info info; @@ -63,7 +63,7 @@ int HAIKU_GL_LoadLibrary(_THIS, const char *path) return 0; } -SDL_FunctionPointer HAIKU_GL_GetProcAddress(_THIS, const char *proc) +SDL_FunctionPointer HAIKU_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc) { if (_this->gl_config.dll_handle != NULL) { void *location = NULL; @@ -84,12 +84,12 @@ SDL_FunctionPointer HAIKU_GL_GetProcAddress(_THIS, const char *proc) } -int HAIKU_GL_SwapWindow(_THIS, SDL_Window * window) { +int HAIKU_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window * window) { _ToBeWin(window)->SwapBuffers(); return 0; } -int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { +int HAIKU_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window * window, SDL_GLContext context) { BGLView* glView = (BGLView*)context; // printf("HAIKU_GL_MakeCurrent(%llx), win = %llx, thread = %d\n", (uint64)context, (uint64)window, find_thread(NULL)); if (glView != NULL) { @@ -102,7 +102,7 @@ int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { } -SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window * window) { +SDL_GLContext HAIKU_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window * window) { /* FIXME: Not sure what flags should be included here; may want to have most of them */ SDL_BWin *bwin = _ToBeWin(window); @@ -142,7 +142,7 @@ SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window * window) { return (SDL_GLContext)(bwin->GetGLView()); } -int HAIKU_GL_DeleteContext(_THIS, SDL_GLContext context) { +int HAIKU_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { // printf("HAIKU_GL_DeleteContext(%llx), thread = %d\n", (uint64)context, find_thread(NULL)); BGLView* glView = (BGLView*)context; SDL_BWin *bwin = (SDL_BWin*)glView->Window(); @@ -155,17 +155,17 @@ int HAIKU_GL_DeleteContext(_THIS, SDL_GLContext context) { } -int HAIKU_GL_SetSwapInterval(_THIS, int interval) { +int HAIKU_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval) { /* TODO: Implement this, if necessary? */ return SDL_Unsupported(); } -int HAIKU_GL_GetSwapInterval(_THIS, int *interval) { +int HAIKU_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval) { return SDL_Unsupported(); } -void HAIKU_GL_UnloadLibrary(_THIS) { +void HAIKU_GL_UnloadLibrary(SDL_VideoDevice *_this) { /* TODO: Implement this, if necessary? */ } @@ -173,7 +173,7 @@ void HAIKU_GL_UnloadLibrary(_THIS) { /* FIXME: This function is meant to clear the OpenGL context when the video mode changes (see SDL_bmodes.cc), but it doesn't seem to help, and is not currently in use. */ -void HAIKU_GL_RebootContexts(_THIS) { +void HAIKU_GL_RebootContexts(SDL_VideoDevice *_this) { SDL_Window *window = _this->windows; while (window) { SDL_BWin *bwin = _ToBeWin(window); diff --git a/src/video/haiku/SDL_bopengl.h b/src/video/haiku/SDL_bopengl.h index 585080636f..aea625cc63 100644 --- a/src/video/haiku/SDL_bopengl.h +++ b/src/video/haiku/SDL_bopengl.h @@ -30,18 +30,18 @@ extern "C" { #include "../SDL_sysvideo.h" -extern int HAIKU_GL_LoadLibrary(_THIS, const char *path); /* FIXME */ -extern SDL_FunctionPointer HAIKU_GL_GetProcAddress(_THIS, const char *proc); /* FIXME */ -extern void HAIKU_GL_UnloadLibrary(_THIS); /* TODO */ -extern int HAIKU_GL_MakeCurrent(_THIS, SDL_Window *window, +extern int HAIKU_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); /* FIXME */ +extern SDL_FunctionPointer HAIKU_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); /* FIXME */ +extern void HAIKU_GL_UnloadLibrary(SDL_VideoDevice *_this); /* TODO */ +extern int HAIKU_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); -extern int HAIKU_GL_SetSwapInterval(_THIS, int interval); /* TODO */ -extern int HAIKU_GL_GetSwapInterval(_THIS, int *interval); /* TODO */ -extern int HAIKU_GL_SwapWindow(_THIS, SDL_Window *window); -extern SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window *window); -extern int HAIKU_GL_DeleteContext(_THIS, SDL_GLContext context); +extern int HAIKU_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval); /* TODO */ +extern int HAIKU_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval); /* TODO */ +extern int HAIKU_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern SDL_GLContext HAIKU_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int HAIKU_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); -extern void HAIKU_GL_RebootContexts(_THIS); +extern void HAIKU_GL_RebootContexts(SDL_VideoDevice *_this); #ifdef __cplusplus } diff --git a/src/video/haiku/SDL_bvideo.cc b/src/video/haiku/SDL_bvideo.cc index 3f8306ff5a..14e3ef2fd6 100644 --- a/src/video/haiku/SDL_bvideo.cc +++ b/src/video/haiku/SDL_bvideo.cc @@ -243,7 +243,7 @@ static int HAIKU_SetRelativeMouseMode(SDL_bool enabled) return 0; } -static void HAIKU_MouseInit(_THIS) +static void HAIKU_MouseInit(SDL_VideoDevice *_this) { SDL_Mouse *mouse = SDL_GetMouse(); if (mouse == NULL) { @@ -258,7 +258,7 @@ static void HAIKU_MouseInit(_THIS) SDL_SetDefaultCursor(HAIKU_CreateDefaultCursor()); } -int HAIKU_VideoInit(_THIS) +int HAIKU_VideoInit(SDL_VideoDevice *_this) { /* Initialize the Be Application for appserver interaction */ if (SDL_InitBeApp() < 0) { @@ -283,7 +283,7 @@ int HAIKU_VideoInit(_THIS) return 0; } -void HAIKU_VideoQuit(_THIS) +void HAIKU_VideoQuit(SDL_VideoDevice *_this) { HAIKU_QuitModes(_this); diff --git a/src/video/haiku/SDL_bvideo.h b/src/video/haiku/SDL_bvideo.h index 747e4cc3b6..480aa2d2e3 100644 --- a/src/video/haiku/SDL_bvideo.h +++ b/src/video/haiku/SDL_bvideo.h @@ -29,9 +29,9 @@ extern "C" { #include "../../core/haiku/SDL_BeApp.h" #include "../SDL_sysvideo.h" -extern void HAIKU_VideoQuit(_THIS); -extern int HAIKU_VideoInit(_THIS); -extern void HAIKU_DeleteDevice(_THIS); +extern void HAIKU_VideoQuit(SDL_VideoDevice *_this); +extern int HAIKU_VideoInit(SDL_VideoDevice *_this); +extern void HAIKU_DeleteDevice(SDL_VideoDevice *_this); #ifdef __cplusplus } diff --git a/src/video/haiku/SDL_bwindow.cc b/src/video/haiku/SDL_bwindow.cc index 03b31713b8..2d309e6aa0 100644 --- a/src/video/haiku/SDL_bwindow.cc +++ b/src/video/haiku/SDL_bwindow.cc @@ -41,7 +41,7 @@ static SDL_INLINE SDL_BLooper *_GetBeLooper() { return SDL_Looper; } -static int _InitWindow(_THIS, SDL_Window *window) { +static int _InitWindow(SDL_VideoDevice *_this, SDL_Window *window) { uint32 flags = 0; window_look look = B_TITLED_WINDOW_LOOK; @@ -78,7 +78,7 @@ static int _InitWindow(_THIS, SDL_Window *window) { return 0; } -int HAIKU_CreateWindow(_THIS, SDL_Window *window) { +int HAIKU_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { if (_InitWindow(_this, window) < 0) { return -1; } @@ -88,7 +88,7 @@ int HAIKU_CreateWindow(_THIS, SDL_Window *window) { return 0; } -int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) { +int HAIKU_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window * window, const void *data) { SDL_BWin *otherBWin = (SDL_BWin*)data; if (!otherBWin->LockLooper()) { @@ -121,69 +121,69 @@ int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) { return 0; } -void HAIKU_SetWindowTitle(_THIS, SDL_Window * window) { +void HAIKU_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window * window) { BMessage msg(BWIN_SET_TITLE); msg.AddString("window-title", window->title); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_SetWindowPosition(_THIS, SDL_Window * window) { +void HAIKU_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window * window) { BMessage msg(BWIN_MOVE_WINDOW); msg.AddInt32("window-x", window->x); msg.AddInt32("window-y", window->y); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_SetWindowSize(_THIS, SDL_Window * window) { +void HAIKU_SetWindowSize(SDL_VideoDevice *_this, SDL_Window * window) { BMessage msg(BWIN_RESIZE_WINDOW); msg.AddInt32("window-w", window->w - 1); msg.AddInt32("window-h", window->h - 1); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) { +void HAIKU_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window * window, SDL_bool bordered) { BMessage msg(BWIN_SET_BORDERED); msg.AddBool("window-border", bordered != SDL_FALSE); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) { +void HAIKU_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window * window, SDL_bool resizable) { BMessage msg(BWIN_SET_RESIZABLE); msg.AddBool("window-resizable", resizable != SDL_FALSE); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_ShowWindow(_THIS, SDL_Window * window) { +void HAIKU_ShowWindow(SDL_VideoDevice *_this, SDL_Window * window) { BMessage msg(BWIN_SHOW_WINDOW); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_HideWindow(_THIS, SDL_Window * window) { +void HAIKU_HideWindow(SDL_VideoDevice *_this, SDL_Window * window) { BMessage msg(BWIN_HIDE_WINDOW); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_RaiseWindow(_THIS, SDL_Window * window) { +void HAIKU_RaiseWindow(SDL_VideoDevice *_this, SDL_Window * window) { BMessage msg(BWIN_SHOW_WINDOW); /* Activate this window and move to front */ _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_MaximizeWindow(_THIS, SDL_Window * window) { +void HAIKU_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window * window) { BMessage msg(BWIN_MAXIMIZE_WINDOW); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_MinimizeWindow(_THIS, SDL_Window * window) { +void HAIKU_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window * window) { BMessage msg(BWIN_MINIMIZE_WINDOW); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_RestoreWindow(_THIS, SDL_Window * window) { +void HAIKU_RestoreWindow(SDL_VideoDevice *_this, SDL_Window * window) { BMessage msg(BWIN_RESTORE_WINDOW); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_SetWindowFullscreen(_THIS, SDL_Window * window, +void HAIKU_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) { /* Haiku tracks all video display information */ BMessage msg(BWIN_FULLSCREEN); @@ -193,25 +193,25 @@ void HAIKU_SetWindowFullscreen(_THIS, SDL_Window * window, } -void HAIKU_SetWindowMinimumSize(_THIS, SDL_Window * window) { +void HAIKU_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window * window) { BMessage msg(BWIN_MINIMUM_SIZE_WINDOW); msg.AddInt32("window-w", window->w -1); msg.AddInt32("window-h", window->h -1); _ToBeWin(window)->PostMessage(&msg); } -void HAIKU_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) { +void HAIKU_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window * window, SDL_bool grabbed) { /* TODO: Implement this! */ } -void HAIKU_DestroyWindow(_THIS, SDL_Window * window) { +void HAIKU_DestroyWindow(SDL_VideoDevice *_this, SDL_Window * window) { _ToBeWin(window)->LockLooper(); /* This MUST be locked */ _GetBeLooper()->ClearID(_ToBeWin(window)); _ToBeWin(window)->Quit(); window->driverdata = NULL; } -int HAIKU_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info) +int HAIKU_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info) { info->subsystem = SDL_SYSWM_HAIKU; return 0; diff --git a/src/video/haiku/SDL_bwindow.h b/src/video/haiku/SDL_bwindow.h index 31eb960490..0597acbced 100644 --- a/src/video/haiku/SDL_bwindow.h +++ b/src/video/haiku/SDL_bwindow.h @@ -24,23 +24,23 @@ #include "../SDL_sysvideo.h" -extern int HAIKU_CreateWindow(_THIS, SDL_Window *window); -extern int HAIKU_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); -extern void HAIKU_SetWindowTitle(_THIS, SDL_Window *window); -extern int HAIKU_SetWindowPosition(_THIS, SDL_Window *window); -extern void HAIKU_SetWindowSize(_THIS, SDL_Window *window); -extern void HAIKU_SetWindowMinimumSize(_THIS, SDL_Window *window); -extern void HAIKU_ShowWindow(_THIS, SDL_Window *window); -extern void HAIKU_HideWindow(_THIS, SDL_Window *window); -extern void HAIKU_RaiseWindow(_THIS, SDL_Window *window); -extern void HAIKU_MaximizeWindow(_THIS, SDL_Window *window); -extern void HAIKU_MinimizeWindow(_THIS, SDL_Window *window); -extern void HAIKU_RestoreWindow(_THIS, SDL_Window *window); -extern void HAIKU_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered); -extern void HAIKU_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable); -extern void HAIKU_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); -extern void HAIKU_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -extern void HAIKU_DestroyWindow(_THIS, SDL_Window *window); -extern int HAIKU_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); +extern int HAIKU_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int HAIKU_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data); +extern void HAIKU_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +extern int HAIKU_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); +extern void HAIKU_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +extern void HAIKU_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window); +extern void HAIKU_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void HAIKU_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void HAIKU_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void HAIKU_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void HAIKU_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void HAIKU_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void HAIKU_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered); +extern void HAIKU_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable); +extern void HAIKU_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); +extern void HAIKU_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); +extern void HAIKU_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int HAIKU_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info); #endif diff --git a/src/video/kmsdrm/SDL_kmsdrmevents.c b/src/video/kmsdrm/SDL_kmsdrmevents.c index 49c3368ba3..7479e074da 100644 --- a/src/video/kmsdrm/SDL_kmsdrmevents.c +++ b/src/video/kmsdrm/SDL_kmsdrmevents.c @@ -32,7 +32,7 @@ #include "../../core/openbsd/SDL_wscons.h" #endif -void KMSDRM_PumpEvents(_THIS) +void KMSDRM_PumpEvents(SDL_VideoDevice *_this) { #ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Poll(); diff --git a/src/video/kmsdrm/SDL_kmsdrmevents.h b/src/video/kmsdrm/SDL_kmsdrmevents.h index a010bf80b6..e63136717b 100644 --- a/src/video/kmsdrm/SDL_kmsdrmevents.h +++ b/src/video/kmsdrm/SDL_kmsdrmevents.h @@ -24,8 +24,8 @@ #ifndef SDL_kmsdrmevents_h_ #define SDL_kmsdrmevents_h_ -extern void KMSDRM_PumpEvents(_THIS); -extern void KMSDRM_EventInit(_THIS); -extern void KMSDRM_EventQuit(_THIS); +extern void KMSDRM_PumpEvents(SDL_VideoDevice *_this); +extern void KMSDRM_EventInit(SDL_VideoDevice *_this); +extern void KMSDRM_EventQuit(SDL_VideoDevice *_this); #endif /* SDL_kmsdrmevents_h_ */ diff --git a/src/video/kmsdrm/SDL_kmsdrmmouse.c b/src/video/kmsdrm/SDL_kmsdrmmouse.c index 1f397d928d..4ed8b7c2a4 100644 --- a/src/video/kmsdrm/SDL_kmsdrmmouse.c +++ b/src/video/kmsdrm/SDL_kmsdrmmouse.c @@ -61,7 +61,7 @@ static SDL_Cursor *KMSDRM_CreateDefaultCursor(void) /* Given a display's driverdata, destroy the cursor BO for it. To be called from KMSDRM_DestroyWindow(), as that's where we destroy the driverdata for the window's display. */ -void KMSDRM_DestroyCursorBO(_THIS, SDL_VideoDisplay *display) +void KMSDRM_DestroyCursorBO(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { SDL_DisplayData *dispdata = display->driverdata; @@ -383,7 +383,7 @@ static int KMSDRM_WarpMouse(SDL_Window *window, float x, float y) return KMSDRM_WarpMouseGlobal(x, y); } -void KMSDRM_InitMouse(_THIS, SDL_VideoDisplay *display) +void KMSDRM_InitMouse(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_DisplayData *dispdata = display->driverdata; @@ -403,7 +403,7 @@ void KMSDRM_InitMouse(_THIS, SDL_VideoDisplay *display) } } -void KMSDRM_QuitMouse(_THIS) +void KMSDRM_QuitMouse(SDL_VideoDevice *_this) { /* TODO: ? */ } diff --git a/src/video/kmsdrm/SDL_kmsdrmmouse.h b/src/video/kmsdrm/SDL_kmsdrmmouse.h index 6389044c7d..754dc19e3d 100644 --- a/src/video/kmsdrm/SDL_kmsdrmmouse.h +++ b/src/video/kmsdrm/SDL_kmsdrmmouse.h @@ -43,11 +43,11 @@ typedef struct KMSDRM_CursorData } KMSDRM_CursorData; -extern void KMSDRM_InitMouse(_THIS, SDL_VideoDisplay *display); -extern void KMSDRM_QuitMouse(_THIS); +extern void KMSDRM_InitMouse(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +extern void KMSDRM_QuitMouse(SDL_VideoDevice *_this); extern int KMSDRM_CreateCursorBO(SDL_VideoDisplay *display); -extern void KMSDRM_DestroyCursorBO(_THIS, SDL_VideoDisplay *display); +extern void KMSDRM_DestroyCursorBO(SDL_VideoDevice *_this, SDL_VideoDisplay *display); extern void KMSDRM_InitCursor(void); #endif /* SDL_KMSDRM_mouse_h_ */ diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c index 01cd93cfee..2de35e0e86 100644 --- a/src/video/kmsdrm/SDL_kmsdrmopengles.c +++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c @@ -34,7 +34,7 @@ /* EGL implementation of SDL OpenGL support */ -void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor) +void KMSDRM_GLES_DefaultProfileConfig(SDL_VideoDevice *_this, int *mask, int *major, int *minor) { /* if SDL was _also_ built with the Raspberry Pi driver (so we're definitely a Pi device) or with the ROCKCHIP video driver @@ -46,7 +46,7 @@ void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor) #endif } -int KMSDRM_GLES_LoadLibrary(_THIS, const char *path) +int KMSDRM_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { /* Just pretend you do this here, but don't do it until KMSDRM_CreateWindow(), where we do the same library load we would normally do here. @@ -60,7 +60,7 @@ int KMSDRM_GLES_LoadLibrary(_THIS, const char *path) return 0; } -void KMSDRM_GLES_UnloadLibrary(_THIS) +void KMSDRM_GLES_UnloadLibrary(SDL_VideoDevice *_this) { /* As with KMSDRM_GLES_LoadLibrary(), we define our own "dummy" unloading function so we manually unload the library whenever we want. */ @@ -68,7 +68,7 @@ void KMSDRM_GLES_UnloadLibrary(_THIS) SDL_EGL_CreateContext_impl(KMSDRM) - int KMSDRM_GLES_SetSwapInterval(_THIS, int interval) + int KMSDRM_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval) { if (!_this->egl_data) { @@ -84,7 +84,7 @@ SDL_EGL_CreateContext_impl(KMSDRM) return 0; } -int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window) +int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *windata = window->driverdata; SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window); diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.h b/src/video/kmsdrm/SDL_kmsdrmopengles.h index fd1ce896d9..08f3561fa5 100644 --- a/src/video/kmsdrm/SDL_kmsdrmopengles.h +++ b/src/video/kmsdrm/SDL_kmsdrmopengles.h @@ -34,12 +34,12 @@ #define KMSDRM_GLES_DeleteContext SDL_EGL_DeleteContext #define KMSDRM_GLES_GetSwapInterval SDL_EGL_GetSwapInterval -extern void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor); -extern int KMSDRM_GLES_SetSwapInterval(_THIS, int interval); -extern int KMSDRM_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext KMSDRM_GLES_CreateContext(_THIS, SDL_Window *window); -extern int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window); -extern int KMSDRM_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); +extern void KMSDRM_GLES_DefaultProfileConfig(SDL_VideoDevice *_this, int *mask, int *major, int *minor); +extern int KMSDRM_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval); +extern int KMSDRM_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_GLContext KMSDRM_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int KMSDRM_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); #endif /* SDL_VIDEO_DRIVER_KMSDRM */ diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index a8e326cc9c..32dc23acf7 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -350,7 +350,7 @@ static void KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data) } KMSDRM_FBInfo * -KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo) +KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo) { SDL_VideoData *viddata = _this->driverdata; unsigned w, h; @@ -402,7 +402,7 @@ static void KMSDRM_FlipHandler(int fd, unsigned int frame, unsigned int sec, uns } SDL_bool -KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata) +KMSDRM_WaitPageflip(SDL_VideoDevice *_this, SDL_WindowData *windata) { SDL_VideoData *viddata = _this->driverdata; @@ -514,7 +514,7 @@ static drmModeModeInfo *KMSDRM_GetClosestDisplayMode(SDL_VideoDisplay *display, /*****************************************************************************/ /* Deinitializes the driverdata of the SDL Displays in the SDL display list. */ -static void KMSDRM_DeinitDisplays(_THIS) +static void KMSDRM_DeinitDisplays(SDL_VideoDevice *_this) { SDL_DisplayID *displays; SDL_DisplayData *dispdata; @@ -680,7 +680,7 @@ static SDL_bool KMSDRM_CrtcGetVrr(uint32_t drm_fd, uint32_t crtc_id) /* Gets a DRM connector, builds an SDL_Display with it, and adds it to the list of SDL Displays in _this->displays[] */ -static void KMSDRM_AddDisplay(_THIS, drmModeConnector *connector, drmModeRes *resources) +static void KMSDRM_AddDisplay(SDL_VideoDevice *_this, drmModeConnector *connector, drmModeRes *resources) { SDL_VideoData *viddata = _this->driverdata; SDL_DisplayData *dispdata = NULL; @@ -903,7 +903,7 @@ cleanup: closed when we get to the end of this function. This is to be called early, in VideoInit(), because it gets us the videomode information, which SDL needs immediately after VideoInit(). */ -static int KMSDRM_InitDisplays(_THIS) +static int KMSDRM_InitDisplays(SDL_VideoDevice *_this) { SDL_VideoData *viddata = _this->driverdata; @@ -999,7 +999,7 @@ cleanup: These things are incompatible with Vulkan, which accesses the same resources internally so they must be free when trying to build a Vulkan surface. */ -static int KMSDRM_GBMInit(_THIS, SDL_DisplayData *dispdata) +static int KMSDRM_GBMInit(SDL_VideoDevice *_this, SDL_DisplayData *dispdata) { SDL_VideoData *viddata = _this->driverdata; int ret = 0; @@ -1022,7 +1022,7 @@ static int KMSDRM_GBMInit(_THIS, SDL_DisplayData *dispdata) } /* Deinit the Vulkan-incompatible KMSDRM stuff. */ -static void KMSDRM_GBMDeinit(_THIS, SDL_DisplayData *dispdata) +static void KMSDRM_GBMDeinit(SDL_VideoDevice *_this, SDL_DisplayData *dispdata) { SDL_VideoData *viddata = _this->driverdata; @@ -1042,7 +1042,7 @@ static void KMSDRM_GBMDeinit(_THIS, SDL_DisplayData *dispdata) viddata->gbm_init = SDL_FALSE; } -static void KMSDRM_DestroySurfaces(_THIS, SDL_Window *window) +static void KMSDRM_DestroySurfaces(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *viddata = _this->driverdata; SDL_WindowData *windata = window->driverdata; @@ -1144,7 +1144,7 @@ static void KMSDRM_DirtySurfaces(SDL_Window *window) /* This determines the size of the fb, which comes from the GBM surface that we create here. */ -int KMSDRM_CreateSurfaces(_THIS, SDL_Window *window) +int KMSDRM_CreateSurfaces(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *viddata = _this->driverdata; SDL_WindowData *windata = window->driverdata; @@ -1228,7 +1228,7 @@ cleanup: return ret; } -int KMSDRM_VideoInit(_THIS) +int KMSDRM_VideoInit(SDL_VideoDevice *_this) { int ret = 0; @@ -1259,7 +1259,7 @@ int KMSDRM_VideoInit(_THIS) /* The driverdata pointers, like dispdata, viddata, windata, etc... are freed by SDL internals, so not our job. */ -void KMSDRM_VideoQuit(_THIS) +void KMSDRM_VideoQuit(SDL_VideoDevice *_this) { SDL_VideoData *viddata = _this->driverdata; @@ -1280,7 +1280,7 @@ void KMSDRM_VideoQuit(_THIS) } /* Read modes from the connector modes, and store them in display->display_modes. */ -int KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay *display) +int KMSDRM_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { SDL_DisplayData *dispdata = display->driverdata; drmModeConnector *conn = dispdata->connector; @@ -1308,7 +1308,7 @@ int KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay *display) return 0; } -int KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +int KMSDRM_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { /* Set the dispdata->mode to the new mode and leave actual modesetting pending to be done on SwapWindow() via drmModeSetCrtc() */ @@ -1339,7 +1339,7 @@ int KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mod return 0; } -void KMSDRM_DestroyWindow(_THIS, SDL_Window *window) +void KMSDRM_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *windata = window->driverdata; SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window); @@ -1417,7 +1417,7 @@ void KMSDRM_DestroyWindow(_THIS, SDL_Window *window) /* reflect it: if it's fullscreen, KMSDRM_SetWindwoFullscreen() will */ /* be called by SDL later, and we can manage it there. */ /**********************************************************************/ -int KMSDRM_CreateWindow(_THIS, SDL_Window *window) +int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *windata = NULL; SDL_VideoData *viddata = _this->driverdata; @@ -1551,26 +1551,26 @@ int KMSDRM_CreateWindow(_THIS, SDL_Window *window) return ret; } -int KMSDRM_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) +int KMSDRM_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data) { return -1; } -void KMSDRM_SetWindowTitle(_THIS, SDL_Window *window) +void KMSDRM_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { } -int KMSDRM_SetWindowPosition(_THIS, SDL_Window *window) +int KMSDRM_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { return SDL_Unsupported(); } -void KMSDRM_SetWindowSize(_THIS, SDL_Window *window) +void KMSDRM_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *viddata = _this->driverdata; if (!viddata->vulkan_mode) { KMSDRM_DirtySurfaces(window); } } -void KMSDRM_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) +void KMSDRM_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { SDL_VideoData *viddata = _this->driverdata; @@ -1578,29 +1578,29 @@ void KMSDRM_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *dis KMSDRM_DirtySurfaces(window); } } -void KMSDRM_ShowWindow(_THIS, SDL_Window *window) +void KMSDRM_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void KMSDRM_HideWindow(_THIS, SDL_Window *window) +void KMSDRM_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void KMSDRM_RaiseWindow(_THIS, SDL_Window *window) +void KMSDRM_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void KMSDRM_MaximizeWindow(_THIS, SDL_Window *window) +void KMSDRM_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void KMSDRM_MinimizeWindow(_THIS, SDL_Window *window) +void KMSDRM_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void KMSDRM_RestoreWindow(_THIS, SDL_Window *window) +void KMSDRM_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { } /*****************************************************************************/ /* SDL Window Manager function */ /*****************************************************************************/ -int KMSDRM_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info) +int KMSDRM_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info) { SDL_VideoData *viddata = _this->driverdata; diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.h b/src/video/kmsdrm/SDL_kmsdrmvideo.h index ddeb418075..24e03fb9b0 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.h +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.h @@ -107,46 +107,46 @@ typedef struct KMSDRM_FBInfo } KMSDRM_FBInfo; /* Helper functions */ -int KMSDRM_CreateSurfaces(_THIS, SDL_Window *window); -KMSDRM_FBInfo *KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo); -KMSDRM_FBInfo *KMSDRM_FBFromBO2(_THIS, struct gbm_bo *bo, int w, int h); -SDL_bool KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata); +int KMSDRM_CreateSurfaces(SDL_VideoDevice *_this, SDL_Window *window); +KMSDRM_FBInfo *KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo); +KMSDRM_FBInfo *KMSDRM_FBFromBO2(SDL_VideoDevice *_this, struct gbm_bo *bo, int w, int h); +SDL_bool KMSDRM_WaitPageflip(SDL_VideoDevice *_this, SDL_WindowData *windata); /****************************************************************************/ /* SDL_VideoDevice functions declaration */ /****************************************************************************/ /* Display and window functions */ -int KMSDRM_VideoInit(_THIS); -void KMSDRM_VideoQuit(_THIS); -int KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -int KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -int KMSDRM_CreateWindow(_THIS, SDL_Window *window); -int KMSDRM_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); -void KMSDRM_SetWindowTitle(_THIS, SDL_Window *window); -int KMSDRM_SetWindowPosition(_THIS, SDL_Window *window); -void KMSDRM_SetWindowSize(_THIS, SDL_Window *window); -void KMSDRM_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen); -void KMSDRM_ShowWindow(_THIS, SDL_Window *window); -void KMSDRM_HideWindow(_THIS, SDL_Window *window); -void KMSDRM_RaiseWindow(_THIS, SDL_Window *window); -void KMSDRM_MaximizeWindow(_THIS, SDL_Window *window); -void KMSDRM_MinimizeWindow(_THIS, SDL_Window *window); -void KMSDRM_RestoreWindow(_THIS, SDL_Window *window); -void KMSDRM_DestroyWindow(_THIS, SDL_Window *window); +int KMSDRM_VideoInit(SDL_VideoDevice *_this); +void KMSDRM_VideoQuit(SDL_VideoDevice *_this); +int KMSDRM_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +int KMSDRM_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +int KMSDRM_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data); +void KMSDRM_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +int KMSDRM_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); +void KMSDRM_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +void KMSDRM_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen); +void KMSDRM_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +void KMSDRM_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +void KMSDRM_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); +void KMSDRM_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +void KMSDRM_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +void KMSDRM_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); +void KMSDRM_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); /* Window manager function */ -int KMSDRM_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); +int KMSDRM_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info); /* OpenGL/OpenGL ES functions */ -int KMSDRM_GLES_LoadLibrary(_THIS, const char *path); -SDL_FunctionPointer KMSDRM_GLES_GetProcAddress(_THIS, const char *proc); -void KMSDRM_GLES_UnloadLibrary(_THIS); -SDL_GLContext KMSDRM_GLES_CreateContext(_THIS, SDL_Window *window); -int KMSDRM_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -int KMSDRM_GLES_SetSwapInterval(_THIS, int interval); -int KMSDRM_GLES_GetSwapInterval(_THIS); -int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window); -int KMSDRM_GLES_DeleteContext(_THIS, SDL_GLContext context); +int KMSDRM_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +SDL_FunctionPointer KMSDRM_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +void KMSDRM_GLES_UnloadLibrary(SDL_VideoDevice *_this); +SDL_GLContext KMSDRM_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +int KMSDRM_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +int KMSDRM_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval); +int KMSDRM_GLES_GetSwapInterval(SDL_VideoDevice *_this); +int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +int KMSDRM_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); #endif /* SDL_kmsdrmvideo_h */ diff --git a/src/video/kmsdrm/SDL_kmsdrmvulkan.c b/src/video/kmsdrm/SDL_kmsdrmvulkan.c index 96deef8018..dac3ab329f 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvulkan.c +++ b/src/video/kmsdrm/SDL_kmsdrmvulkan.c @@ -42,7 +42,7 @@ #define DEFAULT_VULKAN "libvulkan.so.1" #endif -int KMSDRM_Vulkan_LoadLibrary(_THIS, const char *path) +int KMSDRM_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path) { VkExtensionProperties *extensions = NULL; Uint32 i, extensionCount = 0; @@ -122,7 +122,7 @@ fail: return -1; } -void KMSDRM_Vulkan_UnloadLibrary(_THIS) +void KMSDRM_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) { if (_this->vulkan_config.loader_handle) { SDL_UnloadObject(_this->vulkan_config.loader_handle); @@ -140,7 +140,7 @@ void KMSDRM_Vulkan_UnloadLibrary(_THIS) /* members of the VkInstanceCreateInfo struct passed to */ /* vkCreateInstance(). */ /*********************************************************************/ -SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(_THIS, +SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names) { @@ -164,7 +164,7 @@ SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(_THIS, /* KMSDRM_Vulkan_GetInstanceExtensions(), like we do with */ /* VK_KHR_DISPLAY_EXTENSION_NAME, which is what we need for x-less VK. */ /***********************************************************************/ -SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, +SDL_bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface) diff --git a/src/video/kmsdrm/SDL_kmsdrmvulkan.h b/src/video/kmsdrm/SDL_kmsdrmvulkan.h index da9c91fc5b..68efc02d03 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvulkan.h +++ b/src/video/kmsdrm/SDL_kmsdrmvulkan.h @@ -34,12 +34,12 @@ #if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_KMSDRM) -int KMSDRM_Vulkan_LoadLibrary(_THIS, const char *path); -void KMSDRM_Vulkan_UnloadLibrary(_THIS); -SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(_THIS, +int KMSDRM_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); +void KMSDRM_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); +SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names); -SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, +SDL_bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); diff --git a/src/video/n3ds/SDL_n3dsevents.c b/src/video/n3ds/SDL_n3dsevents.c index be605c240e..64cbe60380 100644 --- a/src/video/n3ds/SDL_n3dsevents.c +++ b/src/video/n3ds/SDL_n3dsevents.c @@ -28,7 +28,7 @@ #include "SDL_n3dsevents_c.h" #include "SDL_n3dstouch.h" -void N3DS_PumpEvents(_THIS) +void N3DS_PumpEvents(SDL_VideoDevice *_this) { hidScanInput(); N3DS_PollTouch(); diff --git a/src/video/n3ds/SDL_n3dsevents_c.h b/src/video/n3ds/SDL_n3dsevents_c.h index b894e9268b..25052cb043 100644 --- a/src/video/n3ds/SDL_n3dsevents_c.h +++ b/src/video/n3ds/SDL_n3dsevents_c.h @@ -24,6 +24,6 @@ #include "SDL_internal.h" -extern void N3DS_PumpEvents(_THIS); +extern void N3DS_PumpEvents(SDL_VideoDevice *_this); #endif /* SDL_n3dsevents_c_h_ */ diff --git a/src/video/n3ds/SDL_n3dsframebuffer.c b/src/video/n3ds/SDL_n3dsframebuffer.c index 6b281c7071..4339bb82e4 100644 --- a/src/video/n3ds/SDL_n3dsframebuffer.c +++ b/src/video/n3ds/SDL_n3dsframebuffer.c @@ -40,7 +40,7 @@ SDL_FORCE_INLINE int GetDestOffset(int x, int y, int dest_width); SDL_FORCE_INLINE int GetSourceOffset(int x, int y, int source_width); SDL_FORCE_INLINE void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen); -int SDL_N3DS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) +int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_Surface *framebuffer; @@ -73,7 +73,7 @@ CreateNewWindowFramebuffer(SDL_Window *window) return SDL_CreateSurface(w, h, FRAMEBUFFER_FORMAT); } -int SDL_N3DS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) +int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { SDL_WindowData *drv_data = window->driverdata; SDL_Surface *surface; @@ -131,7 +131,7 @@ FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen) gfxScreenSwapBuffers(screen, false); } -void SDL_N3DS_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +void SDL_N3DS_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { SDL_Surface *surface; surface = (SDL_Surface *)SDL_SetWindowData(window, N3DS_SURFACE, NULL); diff --git a/src/video/n3ds/SDL_n3dsframebuffer_c.h b/src/video/n3ds/SDL_n3dsframebuffer_c.h index 40a71153d3..09caedaefd 100644 --- a/src/video/n3ds/SDL_n3dsframebuffer_c.h +++ b/src/video/n3ds/SDL_n3dsframebuffer_c.h @@ -24,8 +24,8 @@ #include "SDL_internal.h" -int SDL_N3DS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); -int SDL_N3DS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); -void SDL_N3DS_DestroyWindowFramebuffer(_THIS, SDL_Window *window); +int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); +void SDL_N3DS_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_n3dsframebuffer_c_h_ */ diff --git a/src/video/n3ds/SDL_n3dsswkb.c b/src/video/n3ds/SDL_n3dsswkb.c index 29e92fb088..de27d9ac29 100644 --- a/src/video/n3ds/SDL_n3dsswkb.c +++ b/src/video/n3ds/SDL_n3dsswkb.c @@ -46,12 +46,12 @@ void N3DS_SwkbQuit() } SDL_bool -N3DS_HasScreenKeyboardSupport(_THIS) +N3DS_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { return SDL_TRUE; } -void N3DS_StartTextInput(_THIS) +void N3DS_StartTextInput(SDL_VideoDevice *_this) { char buffer[BUFFER_SIZE]; SwkbdButton button_pressed; @@ -61,7 +61,7 @@ void N3DS_StartTextInput(_THIS) } } -void N3DS_StopTextInput(_THIS) +void N3DS_StopTextInput(SDL_VideoDevice *_this) { return; } diff --git a/src/video/n3ds/SDL_n3dsswkb.h b/src/video/n3ds/SDL_n3dsswkb.h index eaedd547f8..fa942ef9b4 100644 --- a/src/video/n3ds/SDL_n3dsswkb.h +++ b/src/video/n3ds/SDL_n3dsswkb.h @@ -28,9 +28,9 @@ void N3DS_SwkbInit(); void N3DS_SwkbPoll(); void N3DS_SwkbQuit(); -SDL_bool N3DS_HasScreenKeyboardSupport(_THIS); +SDL_bool N3DS_HasScreenKeyboardSupport(SDL_VideoDevice *_this); -void N3DS_StartTextInput(_THIS); -void N3DS_StopTextInput(_THIS); +void N3DS_StartTextInput(SDL_VideoDevice *_this); +void N3DS_StopTextInput(SDL_VideoDevice *_this); #endif /* SDL_n3dskeyboard_h_ */ diff --git a/src/video/n3ds/SDL_n3dsvideo.c b/src/video/n3ds/SDL_n3dsvideo.c index 4a05db6686..31535f4637 100644 --- a/src/video/n3ds/SDL_n3dsvideo.c +++ b/src/video/n3ds/SDL_n3dsvideo.c @@ -33,11 +33,11 @@ SDL_FORCE_INLINE int AddN3DSDisplay(gfxScreen_t screen); -static int N3DS_VideoInit(_THIS); -static void N3DS_VideoQuit(_THIS); -static int N3DS_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); -static int N3DS_CreateWindow(_THIS, SDL_Window *window); -static void N3DS_DestroyWindow(_THIS, SDL_Window *window); +static int N3DS_VideoInit(SDL_VideoDevice *_this); +static void N3DS_VideoQuit(SDL_VideoDevice *_this); +static int N3DS_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); +static int N3DS_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +static void N3DS_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); struct SDL_DisplayData { @@ -86,7 +86,7 @@ static SDL_VideoDevice *N3DS_CreateDevice(void) VideoBootStrap N3DS_bootstrap = { N3DSVID_DRIVER_NAME, "N3DS Video Driver", N3DS_CreateDevice }; -static int N3DS_VideoInit(_THIS) +static int N3DS_VideoInit(SDL_VideoDevice *_this) { gfxInit(GSP_RGBA8_OES, GSP_RGBA8_OES, false); hidInit(); @@ -127,7 +127,7 @@ static int AddN3DSDisplay(gfxScreen_t screen) return 0; } -static void N3DS_VideoQuit(_THIS) +static void N3DS_VideoQuit(SDL_VideoDevice *_this) { N3DS_SwkbQuit(); N3DS_QuitTouch(); @@ -136,7 +136,7 @@ static void N3DS_VideoQuit(_THIS) gfxExit(); } -static int N3DS_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) +static int N3DS_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { SDL_DisplayData *driver_data = display->driverdata; @@ -151,7 +151,7 @@ static int N3DS_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rec return 0; } -static int N3DS_CreateWindow(_THIS, SDL_Window *window) +static int N3DS_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_DisplayData *display_data; SDL_WindowData *window_data = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); @@ -165,7 +165,7 @@ static int N3DS_CreateWindow(_THIS, SDL_Window *window) return 0; } -static void N3DS_DestroyWindow(_THIS, SDL_Window *window) +static void N3DS_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { if (window == NULL) { return; diff --git a/src/video/ngage/SDL_ngageevents.cpp b/src/video/ngage/SDL_ngageevents.cpp index 8891469aed..836fa74bc3 100644 --- a/src/video/ngage/SDL_ngageevents.cpp +++ b/src/video/ngage/SDL_ngageevents.cpp @@ -40,9 +40,9 @@ extern "C" { #include "SDL_ngagevideo.h" #include "SDL_ngageevents_c.h" -int HandleWsEvent(_THIS, const TWsEvent &aWsEvent); +int HandleWsEvent(SDL_VideoDevice *_this, const TWsEvent &aWsEvent); -void NGAGE_PumpEvents(_THIS) +void NGAGE_PumpEvents(SDL_VideoDevice *_this) { SDL_VideoData *phdata = _this->driverdata; @@ -63,12 +63,12 @@ void NGAGE_PumpEvents(_THIS) #include #include -extern void DisableKeyBlocking(_THIS); -extern void RedrawWindowL(_THIS); +extern void DisableKeyBlocking(SDL_VideoDevice *_this); +extern void RedrawWindowL(SDL_VideoDevice *_this); TBool isCursorVisible = EFalse; -static SDL_Scancode ConvertScancode(_THIS, int key) +static SDL_Scancode ConvertScancode(SDL_VideoDevice *_this, int key) { SDL_Keycode keycode; @@ -147,7 +147,7 @@ static SDL_Scancode ConvertScancode(_THIS, int key) return SDL_GetScancodeFromKey(keycode); } -int HandleWsEvent(_THIS, const TWsEvent &aWsEvent) +int HandleWsEvent(SDL_VideoDevice *_this, const TWsEvent &aWsEvent) { SDL_VideoData *phdata = _this->driverdata; int posted = 0; diff --git a/src/video/ngage/SDL_ngageevents_c.h b/src/video/ngage/SDL_ngageevents_c.h index 4e8e9e4ca0..b67c93cb36 100644 --- a/src/video/ngage/SDL_ngageevents_c.h +++ b/src/video/ngage/SDL_ngageevents_c.h @@ -23,4 +23,4 @@ #include "SDL_ngagevideo.h" -extern void NGAGE_PumpEvents(_THIS); +extern void NGAGE_PumpEvents(SDL_VideoDevice *_this); diff --git a/src/video/ngage/SDL_ngageframebuffer.cpp b/src/video/ngage/SDL_ngageframebuffer.cpp index a4a6c0dc72..a4072f7fcc 100644 --- a/src/video/ngage/SDL_ngageframebuffer.cpp +++ b/src/video/ngage/SDL_ngageframebuffer.cpp @@ -39,12 +39,12 @@ static TUint32 NGAGE_HWPalette_256_to_Screen[256]; int GetBpp(TDisplayMode displaymode); -void DirectUpdate(_THIS, int numrects, SDL_Rect *rects); -void DrawBackground(_THIS); -void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16 *screenBuffer); -void RedrawWindowL(_THIS); +void DirectUpdate(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects); +void DrawBackground(SDL_VideoDevice *_this); +void DirectDraw(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects, TUint16 *screenBuffer); +void RedrawWindowL(SDL_VideoDevice *_this); -int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) +int SDL_NGAGE_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_VideoData *phdata = _this->driverdata; SDL_Surface *surface; @@ -143,7 +143,7 @@ int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, return 0; } -int SDL_NGAGE_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) +int SDL_NGAGE_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { static int frame_number; SDL_Surface *surface; @@ -166,7 +166,7 @@ int SDL_NGAGE_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect return 0; } -void SDL_NGAGE_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +void SDL_NGAGE_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { SDL_Surface *surface; @@ -197,7 +197,7 @@ int GetBpp(TDisplayMode displaymode) return TDisplayModeUtils::NumDisplayModeBitsPerPixel(displaymode); } -void DrawBackground(_THIS) +void DrawBackground(SDL_VideoDevice *_this) { SDL_VideoData *phdata = _this->driverdata; /* Draw background */ @@ -206,7 +206,7 @@ void DrawBackground(_THIS) Mem::FillZ(screenBuffer, phdata->NGAGE_BytesPerScreen); } -void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16 *screenBuffer) +void DirectDraw(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects, TUint16 *screenBuffer) { SDL_VideoData *phdata = _this->driverdata; SDL_Surface *screen = (SDL_Surface *)SDL_GetWindowData(_this->windows, NGAGE_SURFACE); @@ -331,7 +331,7 @@ void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16 *screenBuffer) } } -void DirectUpdate(_THIS, int numrects, SDL_Rect *rects) +void DirectUpdate(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects) { SDL_VideoData *phdata = _this->driverdata; @@ -366,7 +366,7 @@ void DirectUpdate(_THIS, int numrects, SDL_Rect *rects) } } -void RedrawWindowL(_THIS) +void RedrawWindowL(SDL_VideoDevice *_this) { SDL_VideoData *phdata = _this->driverdata; SDL_Surface *screen = (SDL_Surface *)SDL_GetWindowData(_this->windows, NGAGE_SURFACE); diff --git a/src/video/ngage/SDL_ngageframebuffer_c.h b/src/video/ngage/SDL_ngageframebuffer_c.h index 2d3ebaee29..861c01402b 100644 --- a/src/video/ngage/SDL_ngageframebuffer_c.h +++ b/src/video/ngage/SDL_ngageframebuffer_c.h @@ -21,9 +21,9 @@ #include "SDL_internal.h" -extern int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); -extern int SDL_NGAGE_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); -extern void SDL_NGAGE_DestroyWindowFramebuffer(_THIS, SDL_Window *window); +extern int SDL_NGAGE_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int SDL_NGAGE_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void SDL_NGAGE_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); /****************************************************************************/ /* Runtime */ diff --git a/src/video/ngage/SDL_ngagevideo.cpp b/src/video/ngage/SDL_ngagevideo.cpp index cf896dd0a6..737bf80bbf 100644 --- a/src/video/ngage/SDL_ngagevideo.cpp +++ b/src/video/ngage/SDL_ngagevideo.cpp @@ -47,8 +47,8 @@ extern "C" { #define NGAGEVID_DRIVER_NAME "ngage" /* Initialization/Query functions */ -static int NGAGE_VideoInit(_THIS); -static void NGAGE_VideoQuit(_THIS); +static int NGAGE_VideoInit(SDL_VideoDevice *_this); +static void NGAGE_VideoQuit(SDL_VideoDevice *_this); /* NGAGE driver bootstrap functions */ @@ -141,7 +141,7 @@ VideoBootStrap NGAGE_bootstrap = { NGAGE_CreateDevice }; -int NGAGE_VideoInit(_THIS) +int NGAGE_VideoInit(SDL_VideoDevice *_this) { SDL_DisplayMode mode; @@ -158,7 +158,7 @@ int NGAGE_VideoInit(_THIS) return 0; } -void NGAGE_VideoQuit(_THIS) +void NGAGE_VideoQuit(SDL_VideoDevice *_this) { } diff --git a/src/video/ngage/SDL_ngagevideo.h b/src/video/ngage/SDL_ngagevideo.h index c1a9661433..0d51b24a9a 100644 --- a/src/video/ngage/SDL_ngagevideo.h +++ b/src/video/ngage/SDL_ngagevideo.h @@ -32,7 +32,7 @@ #include #include "bitdraw.h" // CFbsDrawDevice -#define _THIS SDL_VideoDevice *_this +#define SDL_VideoDevice *_this SDL_VideoDevice *_this struct SDL_VideoData { diff --git a/src/video/ngage/SDL_ngagewindow.cpp b/src/video/ngage/SDL_ngagewindow.cpp index 00a3cb13ff..5772e3e25b 100644 --- a/src/video/ngage/SDL_ngagewindow.cpp +++ b/src/video/ngage/SDL_ngagewindow.cpp @@ -29,10 +29,10 @@ const TUint32 WindowClientHandle = 9210; -void DisableKeyBlocking(_THIS); -void ConstructWindowL(_THIS); +void DisableKeyBlocking(SDL_VideoDevice *_this); +void ConstructWindowL(SDL_VideoDevice *_this); -int NGAGE_CreateWindow(_THIS, SDL_Window *window) +int NGAGE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { NGAGE_Window *ngage_window = (NGAGE_Window *)SDL_calloc(1, sizeof(NGAGE_Window)); @@ -57,7 +57,7 @@ int NGAGE_CreateWindow(_THIS, SDL_Window *window) return 0; } -void NGAGE_DestroyWindow(_THIS, SDL_Window *window) +void NGAGE_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { NGAGE_Window *ngage_window = (NGAGE_Window *)window->driverdata; @@ -72,7 +72,7 @@ void NGAGE_DestroyWindow(_THIS, SDL_Window *window) /* Internal */ /*****************************************************************************/ -void DisableKeyBlocking(_THIS) +void DisableKeyBlocking(SDL_VideoDevice *_this) { SDL_VideoData *phdata = _this->driverdata; TRawEvent event; @@ -81,7 +81,7 @@ void DisableKeyBlocking(_THIS) phdata->NGAGE_WsSession.SimulateRawEvent(event); } -void ConstructWindowL(_THIS) +void ConstructWindowL(SDL_VideoDevice *_this) { SDL_VideoData *phdata = _this->driverdata; TInt error; diff --git a/src/video/ngage/SDL_ngagewindow.h b/src/video/ngage/SDL_ngagewindow.h index 40ed19a74d..1418ab7c3a 100644 --- a/src/video/ngage/SDL_ngagewindow.h +++ b/src/video/ngage/SDL_ngagewindow.h @@ -35,9 +35,9 @@ typedef struct } NGAGE_Window; extern int -NGAGE_CreateWindow(_THIS, SDL_Window *window); +NGAGE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); extern void -NGAGE_DestroyWindow(_THIS, SDL_Window *window); +NGAGE_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_ngagewindow */ diff --git a/src/video/offscreen/SDL_offscreenevents.c b/src/video/offscreen/SDL_offscreenevents.c index 8a59c23852..28b4453d8c 100644 --- a/src/video/offscreen/SDL_offscreenevents.c +++ b/src/video/offscreen/SDL_offscreenevents.c @@ -30,7 +30,7 @@ #include "SDL_offscreenvideo.h" #include "SDL_offscreenevents_c.h" -void OFFSCREEN_PumpEvents(_THIS) +void OFFSCREEN_PumpEvents(SDL_VideoDevice *_this) { /* do nothing. */ } diff --git a/src/video/offscreen/SDL_offscreenevents_c.h b/src/video/offscreen/SDL_offscreenevents_c.h index cccedcbe00..80c8011aa4 100644 --- a/src/video/offscreen/SDL_offscreenevents_c.h +++ b/src/video/offscreen/SDL_offscreenevents_c.h @@ -20,4 +20,4 @@ */ #include "SDL_internal.h" -extern void OFFSCREEN_PumpEvents(_THIS); +extern void OFFSCREEN_PumpEvents(SDL_VideoDevice *_this); diff --git a/src/video/offscreen/SDL_offscreenframebuffer.c b/src/video/offscreen/SDL_offscreenframebuffer.c index 25a710a29e..4f8c6f7227 100644 --- a/src/video/offscreen/SDL_offscreenframebuffer.c +++ b/src/video/offscreen/SDL_offscreenframebuffer.c @@ -27,7 +27,7 @@ #define OFFSCREEN_SURFACE "_SDL_DummySurface" -int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) +int SDL_OFFSCREEN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_Surface *surface; const Uint32 surface_format = SDL_PIXELFORMAT_RGB888; @@ -52,7 +52,7 @@ int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *for return 0; } -int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) +int SDL_OFFSCREEN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { static int frame_number; SDL_Surface *surface; @@ -72,7 +72,7 @@ int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_R return 0; } -void SDL_OFFSCREEN_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +void SDL_OFFSCREEN_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { SDL_Surface *surface; diff --git a/src/video/offscreen/SDL_offscreenframebuffer_c.h b/src/video/offscreen/SDL_offscreenframebuffer_c.h index 7c40a5c002..7d50989ad1 100644 --- a/src/video/offscreen/SDL_offscreenframebuffer_c.h +++ b/src/video/offscreen/SDL_offscreenframebuffer_c.h @@ -20,6 +20,6 @@ */ #include "SDL_internal.h" -extern int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); -extern int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); -extern void SDL_OFFSCREEN_DestroyWindowFramebuffer(_THIS, SDL_Window *window); +extern int SDL_OFFSCREEN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int SDL_OFFSCREEN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void SDL_OFFSCREEN_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/offscreen/SDL_offscreenopengles.c b/src/video/offscreen/SDL_offscreenopengles.c index 2134472435..b21a8bf27f 100644 --- a/src/video/offscreen/SDL_offscreenopengles.c +++ b/src/video/offscreen/SDL_offscreenopengles.c @@ -28,7 +28,7 @@ /* EGL implementation of SDL OpenGL support */ -int OFFSCREEN_GLES_LoadLibrary(_THIS, const char *path) +int OFFSCREEN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { int ret = SDL_EGL_LoadLibraryOnly(_this, path); if (ret != 0) { @@ -55,7 +55,7 @@ int OFFSCREEN_GLES_LoadLibrary(_THIS, const char *path) } SDL_GLContext -OFFSCREEN_GLES_CreateContext(_THIS, SDL_Window *window) +OFFSCREEN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *offscreen_window = window->driverdata; @@ -65,7 +65,7 @@ OFFSCREEN_GLES_CreateContext(_THIS, SDL_Window *window) return context; } -int OFFSCREEN_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int OFFSCREEN_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { if (window) { EGLSurface egl_surface = window->driverdata->egl_surface; @@ -75,7 +75,7 @@ int OFFSCREEN_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) } } -int OFFSCREEN_GLES_SwapWindow(_THIS, SDL_Window *window) +int OFFSCREEN_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *offscreen_wind = window->driverdata; diff --git a/src/video/offscreen/SDL_offscreenopengles.h b/src/video/offscreen/SDL_offscreenopengles.h index 7c65488092..f3bd5c3c75 100644 --- a/src/video/offscreen/SDL_offscreenopengles.h +++ b/src/video/offscreen/SDL_offscreenopengles.h @@ -34,10 +34,10 @@ #define OFFSCREEN_GLES_SetSwapInterval SDL_EGL_SetSwapInterval #define OFFSCREEN_GLES_DeleteContext SDL_EGL_DeleteContext -extern int OFFSCREEN_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext OFFSCREEN_GLES_CreateContext(_THIS, SDL_Window *window); -extern int OFFSCREEN_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -extern int OFFSCREEN_GLES_SwapWindow(_THIS, SDL_Window *window); +extern int OFFSCREEN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_GLContext OFFSCREEN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int OFFSCREEN_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +extern int OFFSCREEN_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_VIDEO_DRIVER_OFFSCREEN && SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/offscreen/SDL_offscreenvideo.c b/src/video/offscreen/SDL_offscreenvideo.c index 2f77bea059..dc93c305ef 100644 --- a/src/video/offscreen/SDL_offscreenvideo.c +++ b/src/video/offscreen/SDL_offscreenvideo.c @@ -39,9 +39,9 @@ #define OFFSCREENVID_DRIVER_NAME "offscreen" /* Initialization/Query functions */ -static int OFFSCREEN_VideoInit(_THIS); -static int OFFSCREEN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -static void OFFSCREEN_VideoQuit(_THIS); +static int OFFSCREEN_VideoInit(SDL_VideoDevice *_this); +static int OFFSCREEN_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +static void OFFSCREEN_VideoQuit(SDL_VideoDevice *_this); /* OFFSCREEN driver bootstrap functions */ @@ -96,7 +96,7 @@ VideoBootStrap OFFSCREEN_bootstrap = { OFFSCREEN_CreateDevice }; -int OFFSCREEN_VideoInit(_THIS) +int OFFSCREEN_VideoInit(SDL_VideoDevice *_this) { SDL_DisplayMode mode; @@ -113,12 +113,12 @@ int OFFSCREEN_VideoInit(_THIS) return 0; } -static int OFFSCREEN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +static int OFFSCREEN_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -void OFFSCREEN_VideoQuit(_THIS) +void OFFSCREEN_VideoQuit(SDL_VideoDevice *_this) { } diff --git a/src/video/offscreen/SDL_offscreenwindow.c b/src/video/offscreen/SDL_offscreenwindow.c index 6031b2c5e0..d105e8347e 100644 --- a/src/video/offscreen/SDL_offscreenwindow.c +++ b/src/video/offscreen/SDL_offscreenwindow.c @@ -27,7 +27,7 @@ #include "SDL_offscreenwindow.h" -int OFFSCREEN_CreateWindow(_THIS, SDL_Window *window) +int OFFSCREEN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *offscreen_window = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); @@ -68,7 +68,7 @@ int OFFSCREEN_CreateWindow(_THIS, SDL_Window *window) return 0; } -void OFFSCREEN_DestroyWindow(_THIS, SDL_Window *window) +void OFFSCREEN_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *offscreen_window = window->driverdata; diff --git a/src/video/offscreen/SDL_offscreenwindow.h b/src/video/offscreen/SDL_offscreenwindow.h index c892c05b53..4f502560ff 100644 --- a/src/video/offscreen/SDL_offscreenwindow.h +++ b/src/video/offscreen/SDL_offscreenwindow.h @@ -33,7 +33,7 @@ struct SDL_WindowData #endif }; -extern int OFFSCREEN_CreateWindow(_THIS, SDL_Window *window); -extern void OFFSCREEN_DestroyWindow(_THIS, SDL_Window *window); +extern int OFFSCREEN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void OFFSCREEN_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_offscreenwindow_h */ diff --git a/src/video/ps2/SDL_ps2video.c b/src/video/ps2/SDL_ps2video.c index 6d828b3a42..42a5aab21e 100644 --- a/src/video/ps2/SDL_ps2video.c +++ b/src/video/ps2/SDL_ps2video.c @@ -45,7 +45,7 @@ /* PS2 driver bootstrap functions */ -static int PS2_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +static int PS2_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } @@ -55,7 +55,7 @@ static void PS2_DeleteDevice(SDL_VideoDevice *device) SDL_free(device); } -static int PS2_CreateWindow(_THIS, SDL_Window *window) +static int PS2_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_SetKeyboardFocus(window); @@ -63,7 +63,7 @@ static int PS2_CreateWindow(_THIS, SDL_Window *window) return 0; } -static int PS2_VideoInit(_THIS) +static int PS2_VideoInit(SDL_VideoDevice *_this) { SDL_DisplayMode mode; @@ -80,11 +80,11 @@ static int PS2_VideoInit(_THIS) return 1; } -static void PS2_VideoQuit(_THIS) +static void PS2_VideoQuit(SDL_VideoDevice *_this) { } -static void PS2_PumpEvents(_THIS) +static void PS2_PumpEvents(SDL_VideoDevice *_this) { /* do nothing. */ } diff --git a/src/video/psp/SDL_pspevents.c b/src/video/psp/SDL_pspevents.c index 3248062250..451d621d63 100644 --- a/src/video/psp/SDL_pspevents.c +++ b/src/video/psp/SDL_pspevents.c @@ -73,7 +73,7 @@ int EventUpdate(void *data) return 0; } -void PSP_PumpEvents(_THIS) +void PSP_PumpEvents(SDL_VideoDevice *_this) { int i; enum PspHprmKeys keys; @@ -124,7 +124,7 @@ void PSP_PumpEvents(_THIS) return; } -void PSP_InitOSKeymap(_THIS) +void PSP_InitOSKeymap(SDL_VideoDevice *_this) { #ifdef PSPIRKEYB int i; @@ -235,7 +235,7 @@ void PSP_InitOSKeymap(_THIS) #endif } -int PSP_EventInit(_THIS) +int PSP_EventInit(SDL_VideoDevice *_this) { #ifdef PSPIRKEYB int outputmode = PSP_IRKBD_OUTPUT_MODE_SCANCODE; @@ -258,7 +258,7 @@ int PSP_EventInit(_THIS) return 0; } -void PSP_EventQuit(_THIS) +void PSP_EventQuit(SDL_VideoDevice *_this) { running = 0; SDL_WaitThread(thread, NULL); diff --git a/src/video/psp/SDL_pspevents_c.h b/src/video/psp/SDL_pspevents_c.h index 9183def4ca..dd299a6f27 100644 --- a/src/video/psp/SDL_pspevents_c.h +++ b/src/video/psp/SDL_pspevents_c.h @@ -21,7 +21,7 @@ #include "SDL_pspvideo.h" -extern void PSP_InitOSKeymap(_THIS); -extern void PSP_PumpEvents(_THIS); +extern void PSP_InitOSKeymap(SDL_VideoDevice *_this); +extern void PSP_PumpEvents(SDL_VideoDevice *_this); /* end of SDL_pspevents_c.h ... */ diff --git a/src/video/psp/SDL_pspgl.c b/src/video/psp/SDL_pspgl.c index 2b2d40c207..5800648004 100644 --- a/src/video/psp/SDL_pspgl.c +++ b/src/video/psp/SDL_pspgl.c @@ -43,7 +43,7 @@ } \ } while (0) -int PSP_GL_LoadLibrary(_THIS, const char *path) +int PSP_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path) { return 0; } @@ -54,12 +54,12 @@ int PSP_GL_LoadLibrary(_THIS, const char *path) GLSTUB(glOrtho,(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) */ -SDL_FunctionPointer PSP_GL_GetProcAddress(_THIS, const char *proc) +SDL_FunctionPointer PSP_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc) { return eglGetProcAddress(proc); } -void PSP_GL_UnloadLibrary(_THIS) +void PSP_GL_UnloadLibrary(SDL_VideoDevice *_this) { eglTerminate(_this->gl_data->display); } @@ -67,7 +67,7 @@ void PSP_GL_UnloadLibrary(_THIS) static EGLint width = 480; static EGLint height = 272; -SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window *window) +SDL_GLContext PSP_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wdata = window->driverdata; @@ -129,7 +129,7 @@ SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window *window) return context; } -int PSP_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int PSP_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { if (!eglMakeCurrent(_this->gl_data->display, _this->gl_data->surface, _this->gl_data->surface, _this->gl_data->context)) { @@ -138,7 +138,7 @@ int PSP_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) return 0; } -int PSP_GL_SetSwapInterval(_THIS, int interval) +int PSP_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval) { EGLBoolean status; status = eglSwapInterval(_this->gl_data->display, interval); @@ -151,13 +151,13 @@ int PSP_GL_SetSwapInterval(_THIS, int interval) return SDL_SetError("Unable to set the EGL swap interval"); } -int PSP_GL_GetSwapInterval(_THIS, int *interval) +int PSP_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval) { *interval = _this->gl_data->swapinterval; return 0; } -int PSP_GL_SwapWindow(_THIS, SDL_Window *window) +int PSP_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { if (!eglSwapBuffers(_this->gl_data->display, _this->gl_data->surface)) { return SDL_SetError("eglSwapBuffers() failed"); @@ -165,7 +165,7 @@ int PSP_GL_SwapWindow(_THIS, SDL_Window *window) return 0; } -int PSP_GL_DeleteContext(_THIS, SDL_GLContext context) +int PSP_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { SDL_VideoData *phdata = _this->driverdata; EGLBoolean status; diff --git a/src/video/psp/SDL_pspgl_c.h b/src/video/psp/SDL_pspgl_c.h index d02a50f9f7..eea46f25e5 100644 --- a/src/video/psp/SDL_pspgl_c.h +++ b/src/video/psp/SDL_pspgl_c.h @@ -35,16 +35,16 @@ typedef struct SDL_GLDriverData uint32_t swapinterval; } SDL_GLDriverData; -extern SDL_FunctionPointer PSP_GL_GetProcAddress(_THIS, const char *proc); -extern int PSP_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -extern void PSP_GL_SwapBuffers(_THIS); +extern SDL_FunctionPointer PSP_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +extern int PSP_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +extern void PSP_GL_SwapBuffers(SDL_VideoDevice *_this); -extern int PSP_GL_SwapWindow(_THIS, SDL_Window *window); -extern SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window *window); +extern int PSP_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern SDL_GLContext PSP_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); -extern int PSP_GL_LoadLibrary(_THIS, const char *path); -extern void PSP_GL_UnloadLibrary(_THIS); -extern int PSP_GL_SetSwapInterval(_THIS, int interval); -extern int PSP_GL_GetSwapInterval(_THIS, int *interval); +extern int PSP_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern void PSP_GL_UnloadLibrary(SDL_VideoDevice *_this); +extern int PSP_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval); +extern int PSP_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval); #endif /* SDL_pspgl_c_h_ */ diff --git a/src/video/psp/SDL_pspvideo.c b/src/video/psp/SDL_pspvideo.c index d09a9c64f8..e3eb29fc5e 100644 --- a/src/video/psp/SDL_pspvideo.c +++ b/src/video/psp/SDL_pspvideo.c @@ -130,7 +130,7 @@ VideoBootStrap PSP_bootstrap = { /*****************************************************************************/ /* SDL Video and Display initialization/handling functions */ /*****************************************************************************/ -int PSP_VideoInit(_THIS) +int PSP_VideoInit(SDL_VideoDevice *_this) { SDL_DisplayMode mode; @@ -148,11 +148,11 @@ int PSP_VideoInit(_THIS) return 0; } -void PSP_VideoQuit(_THIS) +void PSP_VideoQuit(SDL_VideoDevice *_this) { } -int PSP_GetDisplayModes(_THIS, SDL_VideoDisplay *display) +int PSP_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { SDL_DisplayMode mode; @@ -171,7 +171,7 @@ int PSP_GetDisplayModes(_THIS, SDL_VideoDisplay *display) return 0; } -int PSP_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +int PSP_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } @@ -188,7 +188,7 @@ int PSP_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) } \ } while (0) -int PSP_CreateWindow(_THIS, SDL_Window *window) +int PSP_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wdata; @@ -207,55 +207,55 @@ int PSP_CreateWindow(_THIS, SDL_Window *window) return 0; } -int PSP_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) +int PSP_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data) { return SDL_Unsupported(); } -void PSP_SetWindowTitle(_THIS, SDL_Window *window) +void PSP_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { } -int PSP_SetWindowPosition(_THIS, SDL_Window *window) +int PSP_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { return SDL_Unsupported(); } -void PSP_SetWindowSize(_THIS, SDL_Window *window) +void PSP_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { } -void PSP_ShowWindow(_THIS, SDL_Window *window) +void PSP_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void PSP_HideWindow(_THIS, SDL_Window *window) +void PSP_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void PSP_RaiseWindow(_THIS, SDL_Window *window) +void PSP_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void PSP_MaximizeWindow(_THIS, SDL_Window *window) +void PSP_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void PSP_MinimizeWindow(_THIS, SDL_Window *window) +void PSP_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void PSP_RestoreWindow(_THIS, SDL_Window *window) +void PSP_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void PSP_DestroyWindow(_THIS, SDL_Window *window) +void PSP_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { } /* TO Write Me */ -SDL_bool PSP_HasScreenKeyboardSupport(_THIS) +SDL_bool PSP_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { return SDL_FALSE; } -void PSP_ShowScreenKeyboard(_THIS, SDL_Window *window) +void PSP_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { } -void PSP_HideScreenKeyboard(_THIS, SDL_Window *window) +void PSP_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { } -SDL_bool PSP_IsScreenKeyboardShown(_THIS, SDL_Window *window) +SDL_bool PSP_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { return SDL_FALSE; } diff --git a/src/video/psp/SDL_pspvideo.h b/src/video/psp/SDL_pspvideo.h index 0097069ad6..429ad98d63 100644 --- a/src/video/psp/SDL_pspvideo.h +++ b/src/video/psp/SDL_pspvideo.h @@ -45,38 +45,38 @@ struct SDL_WindowData /****************************************************************************/ /* Display and window functions */ -int PSP_VideoInit(_THIS); -void PSP_VideoQuit(_THIS); -int PSP_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -int PSP_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -int PSP_CreateWindow(_THIS, SDL_Window *window); -int PSP_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); -void PSP_SetWindowTitle(_THIS, SDL_Window *window); -int PSP_SetWindowPosition(_THIS, SDL_Window *window); -void PSP_SetWindowSize(_THIS, SDL_Window *window); -void PSP_ShowWindow(_THIS, SDL_Window *window); -void PSP_HideWindow(_THIS, SDL_Window *window); -void PSP_RaiseWindow(_THIS, SDL_Window *window); -void PSP_MaximizeWindow(_THIS, SDL_Window *window); -void PSP_MinimizeWindow(_THIS, SDL_Window *window); -void PSP_RestoreWindow(_THIS, SDL_Window *window); -void PSP_DestroyWindow(_THIS, SDL_Window *window); +int PSP_VideoInit(SDL_VideoDevice *_this); +void PSP_VideoQuit(SDL_VideoDevice *_this); +int PSP_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +int PSP_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +int PSP_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +int PSP_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data); +void PSP_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +int PSP_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); +void PSP_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +void PSP_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +void PSP_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +void PSP_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); +void PSP_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +void PSP_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +void PSP_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); +void PSP_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); /* OpenGL/OpenGL ES functions */ -int PSP_GL_LoadLibrary(_THIS, const char *path); -SDL_FunctionPointer PSP_GL_GetProcAddress(_THIS, const char *proc); -void PSP_GL_UnloadLibrary(_THIS); -SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window *window); -int PSP_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -int PSP_GL_SetSwapInterval(_THIS, int interval); -int PSP_GL_GetSwapInterval(_THIS, int *interval); -int PSP_GL_SwapWindow(_THIS, SDL_Window *window); -int PSP_GL_DeleteContext(_THIS, SDL_GLContext context); +int PSP_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); +SDL_FunctionPointer PSP_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +void PSP_GL_UnloadLibrary(SDL_VideoDevice *_this); +SDL_GLContext PSP_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +int PSP_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +int PSP_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval); +int PSP_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval); +int PSP_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +int PSP_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); /* PSP on screen keyboard */ -SDL_bool PSP_HasScreenKeyboardSupport(_THIS); -void PSP_ShowScreenKeyboard(_THIS, SDL_Window *window); -void PSP_HideScreenKeyboard(_THIS, SDL_Window *window); -SDL_bool PSP_IsScreenKeyboardShown(_THIS, SDL_Window *window); +SDL_bool PSP_HasScreenKeyboardSupport(SDL_VideoDevice *_this); +void PSP_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); +void PSP_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); +SDL_bool PSP_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_pspvideo_h_ */ diff --git a/src/video/qnx/SDL_qnx.h b/src/video/qnx/SDL_qnx.h index 3a3fddb75e..368f84000f 100644 --- a/src/video/qnx/SDL_qnx.h +++ b/src/video/qnx/SDL_qnx.h @@ -36,13 +36,13 @@ typedef struct extern void handleKeyboardEvent(screen_event_t event); extern int glGetConfig(EGLConfig *pconf, int *pformat); -extern int glLoadLibrary(_THIS, const char *name); -extern SDL_FunctionPointer glGetProcAddress(_THIS, const char *proc); -extern SDL_GLContext glCreateContext(_THIS, SDL_Window *window); -extern int glSetSwapInterval(_THIS, int interval); -extern int glSwapWindow(_THIS, SDL_Window *window); -extern int glMakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); -extern void glDeleteContext(_THIS, SDL_GLContext context); -extern void glUnloadLibrary(_THIS); +extern int glLoadLibrary(SDL_VideoDevice *_this, const char *name); +extern SDL_FunctionPointer glGetProcAddress(SDL_VideoDevice *_this, const char *proc); +extern SDL_GLContext glCreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int glSetSwapInterval(SDL_VideoDevice *_this, int interval); +extern int glSwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int glMakeCurrent(SDL_VideoDevice *_this, SDL_Window * window, SDL_GLContext context); +extern void glDeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); +extern void glUnloadLibrary(SDL_VideoDevice *_this); #endif diff --git a/src/video/qnx/SDL_qnxgl.c b/src/video/qnx/SDL_qnxgl.c index b7003af3f1..93507fbeec 100644 --- a/src/video/qnx/SDL_qnxgl.c +++ b/src/video/qnx/SDL_qnxgl.c @@ -128,12 +128,12 @@ glGetConfig(EGLConfig *pconf, int *pformat) /** * Initializes the EGL library. - * @param _THIS + * @param SDL_VideoDevice *_this * @param name unused * @return 0 if successful, -1 on error */ int -glLoadLibrary(_THIS, const char *name) +glLoadLibrary(SDL_VideoDevice *_this, const char *name) { EGLNativeDisplayType disp_id = EGL_DEFAULT_DISPLAY; @@ -155,7 +155,7 @@ glLoadLibrary(_THIS, const char *name) * @return Function address */ SDL_FunctionPointer -glGetProcAddress(_THIS, const char *proc) +glGetProcAddress(SDL_VideoDevice *_this, const char *proc) { return eglGetProcAddress(proc); } @@ -163,12 +163,12 @@ glGetProcAddress(_THIS, const char *proc) /** * Associates the given window with the necessary EGL structures for drawing and * displaying content. - * @param _THIS + * @param SDL_VideoDevice *_this * @param window The SDL window to create the context for * @return A pointer to the created context, if successful, NULL on error */ SDL_GLContext -glCreateContext(_THIS, SDL_Window *window) +glCreateContext(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; EGLContext context; @@ -211,12 +211,12 @@ glCreateContext(_THIS, SDL_Window *window) /** * Sets a new value for the number of frames to display before swapping buffers. - * @param _THIS + * @param SDL_VideoDevice *_this * @param interval New interval value * @return 0 if successful, -1 on error */ int -glSetSwapInterval(_THIS, int interval) +glSetSwapInterval(SDL_VideoDevice *_this, int interval) { if (eglSwapInterval(egl_disp, interval) != EGL_TRUE) { return -1; @@ -227,12 +227,12 @@ glSetSwapInterval(_THIS, int interval) /** * Swaps the EGL buffers associated with the given window - * @param _THIS + * @param SDL_VideoDevice *_this * @param window Window to swap buffers for * @return 0 if successful, -1 on error */ int -glSwapWindow(_THIS, SDL_Window *window) +glSwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { /* !!! FIXME: should we migrate this all over to use SDL_egl.c? */ window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -241,13 +241,13 @@ glSwapWindow(_THIS, SDL_Window *window) /** * Makes the given context the current one for drawing operations. - * @param _THIS + * @param SDL_VideoDevice *_this * @param window SDL window associated with the context (maybe NULL) * @param context The context to activate * @return 0 if successful, -1 on error */ int -glMakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +glMakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { window_impl_t *impl; EGLSurface surface = NULL; @@ -266,21 +266,21 @@ glMakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) /** * Destroys a context. - * @param _THIS + * @param SDL_VideoDevice *_this * @param context The context to destroy */ void -glDeleteContext(_THIS, SDL_GLContext context) +glDeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { eglDestroyContext(egl_disp, context); } /** * Terminates access to the EGL library. - * @param _THIS + * @param SDL_VideoDevice *_this */ void -glUnloadLibrary(_THIS) +glUnloadLibrary(SDL_VideoDevice *_this) { eglTerminate(egl_disp); } diff --git a/src/video/qnx/SDL_qnxvideo.c b/src/video/qnx/SDL_qnxvideo.c index 791bd3828a..b17aec4101 100644 --- a/src/video/qnx/SDL_qnxvideo.c +++ b/src/video/qnx/SDL_qnxvideo.c @@ -29,11 +29,11 @@ static screen_event_t event; * Initializes the QNX video plugin. * Creates the Screen context and event handles used for all window operations * by the plugin. - * @param _THIS + * @param SDL_VideoDevice *_this * @return 0 if successful, -1 on error */ static int -videoInit(_THIS) +videoInit(SDL_VideoDevice *_this) { SDL_VideoDisplay display; @@ -56,19 +56,19 @@ videoInit(_THIS) } static void -videoQuit(_THIS) +videoQuit(SDL_VideoDevice *_this) { } /** * Creates a new native Screen window and associates it with the given SDL * window. - * @param _THIS + * @param SDL_VideoDevice *_this * @param window SDL window to initialize * @return 0 if successful, -1 on error */ static int -createWindow(_THIS, SDL_Window *window) +createWindow(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl; int size[2]; @@ -143,7 +143,7 @@ fail: /** * Gets a pointer to the Screen buffer associated with the given window. Note * that the buffer is actually created in createWindow(). - * @param _THIS + * @param SDL_VideoDevice *_this * @param window SDL window to get the buffer for * @param[out] pixles Holds a pointer to the window's buffer * @param[out] format Holds the pixel format for the buffer @@ -151,7 +151,7 @@ fail: * @return 0 if successful, -1 on error */ static int -createWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, +createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) { window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -180,14 +180,14 @@ createWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, /** * Informs the window manager that the window needs to be updated. - * @param _THIS + * @param SDL_VideoDevice *_this * @param window The window to update * @param rects An array of reectangular areas to update * @param numrects Rect array length * @return 0 if successful, -1 on error */ static int -updateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, +updateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -205,10 +205,10 @@ updateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, /** * Runs the main event loop. - * @param _THIS + * @param SDL_VideoDevice *_this */ static void -pumpEvents(_THIS) +pumpEvents(SDL_VideoDevice *_this) { int type; @@ -239,11 +239,11 @@ pumpEvents(_THIS) /** * Updates the size of the native window using the geometry of the SDL window. - * @param _THIS + * @param SDL_VideoDevice *_this * @param window SDL window to update */ static void -setWindowSize(_THIS, SDL_Window *window) +setWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; int size[2]; @@ -258,11 +258,11 @@ setWindowSize(_THIS, SDL_Window *window) /** * Makes the native window associated with the given SDL window visible. - * @param _THIS + * @param SDL_VideoDevice *_this * @param window SDL window to update */ static void -showWindow(_THIS, SDL_Window *window) +showWindow(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; const int visible = 1; @@ -273,11 +273,11 @@ showWindow(_THIS, SDL_Window *window) /** * Makes the native window associated with the given SDL window invisible. - * @param _THIS + * @param SDL_VideoDevice *_this * @param window SDL window to update */ static void -hideWindow(_THIS, SDL_Window *window) +hideWindow(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; const int visible = 0; @@ -288,11 +288,11 @@ hideWindow(_THIS, SDL_Window *window) /** * Destroys the native window associated with the given SDL window. - * @param _THIS + * @param SDL_VideoDevice *_this * @param window SDL window that is being destroyed */ static void -destroyWindow(_THIS, SDL_Window *window) +destroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; diff --git a/src/video/raspberry/SDL_rpievents.c b/src/video/raspberry/SDL_rpievents.c index 5b1638e95d..a6b9b2dff7 100644 --- a/src/video/raspberry/SDL_rpievents.c +++ b/src/video/raspberry/SDL_rpievents.c @@ -33,7 +33,7 @@ #include "../../core/linux/SDL_evdev.h" #endif -void RPI_PumpEvents(_THIS) +void RPI_PumpEvents(SDL_VideoDevice *_this) { #ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Poll(); diff --git a/src/video/raspberry/SDL_rpievents_c.h b/src/video/raspberry/SDL_rpievents_c.h index a4c349676f..f56bee883c 100644 --- a/src/video/raspberry/SDL_rpievents_c.h +++ b/src/video/raspberry/SDL_rpievents_c.h @@ -24,8 +24,8 @@ #include "SDL_rpivideo.h" -void RPI_PumpEvents(_THIS); -void RPI_EventInit(_THIS); -void RPI_EventQuit(_THIS); +void RPI_PumpEvents(SDL_VideoDevice *_this); +void RPI_EventInit(SDL_VideoDevice *_this); +void RPI_EventQuit(SDL_VideoDevice *_this); #endif /* SDL_rpievents_c_h_ */ diff --git a/src/video/raspberry/SDL_rpimouse.c b/src/video/raspberry/SDL_rpimouse.c index 6380d8f3f5..4ef0387e00 100644 --- a/src/video/raspberry/SDL_rpimouse.c +++ b/src/video/raspberry/SDL_rpimouse.c @@ -288,7 +288,7 @@ static int RPI_WarpMouse(SDL_Window *window, float x, float y) return RPI_WarpMouseGlobal(x, y); } -void RPI_InitMouse(_THIS) +void RPI_InitMouse(SDL_VideoDevice *_this) { /* FIXME: Using UDEV it should be possible to scan all mice * but there's no point in doing so as there's no multimice support...yet! @@ -305,7 +305,7 @@ void RPI_InitMouse(_THIS) SDL_SetDefaultCursor(RPI_CreateDefaultCursor()); } -void RPI_QuitMouse(_THIS) +void RPI_QuitMouse(SDL_VideoDevice *_this) { } diff --git a/src/video/raspberry/SDL_rpimouse.h b/src/video/raspberry/SDL_rpimouse.h index e66f085d24..dc31b1709c 100644 --- a/src/video/raspberry/SDL_rpimouse.h +++ b/src/video/raspberry/SDL_rpimouse.h @@ -35,7 +35,7 @@ struct _RPI_CursorData #define SDL_RPI_CURSORDATA(curs) RPI_CursorData *curdata = (RPI_CursorData *)((curs) ? (curs)->driverdata : NULL) -extern void RPI_InitMouse(_THIS); -extern void RPI_QuitMouse(_THIS); +extern void RPI_InitMouse(SDL_VideoDevice *_this); +extern void RPI_QuitMouse(SDL_VideoDevice *_this); #endif /* SDL_RPI_mouse_h_ */ diff --git a/src/video/raspberry/SDL_rpiopengles.c b/src/video/raspberry/SDL_rpiopengles.c index 7ccc6aebce..0bb530e63f 100644 --- a/src/video/raspberry/SDL_rpiopengles.c +++ b/src/video/raspberry/SDL_rpiopengles.c @@ -27,19 +27,19 @@ /* EGL implementation of SDL OpenGL support */ -void RPI_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor) +void RPI_GLES_DefaultProfileConfig(SDL_VideoDevice *_this, int *mask, int *major, int *minor) { *mask = SDL_GL_CONTEXT_PROFILE_ES; *major = 2; *minor = 0; } -int RPI_GLES_LoadLibrary(_THIS, const char *path) +int RPI_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { return SDL_EGL_LoadLibrary(_this, path, EGL_DEFAULT_DISPLAY, 0); } -int RPI_GLES_SwapWindow(_THIS, SDL_Window *window) +int RPI_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wdata = window->driverdata; diff --git a/src/video/raspberry/SDL_rpiopengles.h b/src/video/raspberry/SDL_rpiopengles.h index 108eff5932..209d80e125 100644 --- a/src/video/raspberry/SDL_rpiopengles.h +++ b/src/video/raspberry/SDL_rpiopengles.h @@ -36,11 +36,11 @@ #define RPI_GLES_GetSwapInterval SDL_EGL_GetSwapInterval #define RPI_GLES_DeleteContext SDL_EGL_DeleteContext -extern int RPI_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window *window); -extern int RPI_GLES_SwapWindow(_THIS, SDL_Window *window); -extern int RPI_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -extern void RPI_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor); +extern int RPI_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_GLContext RPI_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int RPI_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int RPI_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +extern void RPI_GLES_DefaultProfileConfig(SDL_VideoDevice *_this, int *mask, int *major, int *minor); #endif /* SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/raspberry/SDL_rpivideo.c b/src/video/raspberry/SDL_rpivideo.c index c8cfe3d496..2c95fa4679 100644 --- a/src/video/raspberry/SDL_rpivideo.c +++ b/src/video/raspberry/SDL_rpivideo.c @@ -184,7 +184,7 @@ static void AddDispManXDisplay(const int display_id) SDL_AddVideoDisplay(&display, SDL_FALSE); } -int RPI_VideoInit(_THIS) +int RPI_VideoInit(SDL_VideoDevice *_this) { /* Initialize BCM Host */ bcm_host_init(); @@ -203,7 +203,7 @@ int RPI_VideoInit(_THIS) return 1; } -void RPI_VideoQuit(_THIS) +void RPI_VideoQuit(SDL_VideoDevice *_this) { #ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Quit(); @@ -219,7 +219,7 @@ static void RPI_vsync_callback(DISPMANX_UPDATE_HANDLE_T u, void *data) SDL_UnlockMutex(wdata->vsync_cond_mutex); } -int RPI_CreateWindow(_THIS, SDL_Window *window) +int RPI_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wdata; SDL_VideoDisplay *display; @@ -313,7 +313,7 @@ int RPI_CreateWindow(_THIS, SDL_Window *window) return 0; } -void RPI_DestroyWindow(_THIS, SDL_Window *window) +void RPI_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); @@ -341,37 +341,37 @@ void RPI_DestroyWindow(_THIS, SDL_Window *window) } } -int RPI_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) +int RPI_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data) { return -1; } -void RPI_SetWindowTitle(_THIS, SDL_Window *window) +void RPI_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { } -int RPI_SetWindowPosition(_THIS, SDL_Window *window) +int RPI_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { return SDL_Unsupported(); } -void RPI_SetWindowSize(_THIS, SDL_Window *window) +void RPI_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { } -void RPI_ShowWindow(_THIS, SDL_Window *window) +void RPI_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void RPI_HideWindow(_THIS, SDL_Window *window) +void RPI_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void RPI_RaiseWindow(_THIS, SDL_Window *window) +void RPI_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void RPI_MaximizeWindow(_THIS, SDL_Window *window) +void RPI_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void RPI_MinimizeWindow(_THIS, SDL_Window *window) +void RPI_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void RPI_RestoreWindow(_THIS, SDL_Window *window) +void RPI_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { } diff --git a/src/video/raspberry/SDL_rpivideo.h b/src/video/raspberry/SDL_rpivideo.h index 05c5ef1fac..b620d5d130 100644 --- a/src/video/raspberry/SDL_rpivideo.h +++ b/src/video/raspberry/SDL_rpivideo.h @@ -59,32 +59,32 @@ struct SDL_WindowData /****************************************************************************/ /* Display and window functions */ -int RPI_VideoInit(_THIS); -void RPI_VideoQuit(_THIS); -int RPI_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -int RPI_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -int RPI_CreateWindow(_THIS, SDL_Window *window); -int RPI_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); -void RPI_SetWindowTitle(_THIS, SDL_Window *window); -int RPI_SetWindowPosition(_THIS, SDL_Window *window); -void RPI_SetWindowSize(_THIS, SDL_Window *window); -void RPI_ShowWindow(_THIS, SDL_Window *window); -void RPI_HideWindow(_THIS, SDL_Window *window); -void RPI_RaiseWindow(_THIS, SDL_Window *window); -void RPI_MaximizeWindow(_THIS, SDL_Window *window); -void RPI_MinimizeWindow(_THIS, SDL_Window *window); -void RPI_RestoreWindow(_THIS, SDL_Window *window); -void RPI_DestroyWindow(_THIS, SDL_Window *window); +int RPI_VideoInit(SDL_VideoDevice *_this); +void RPI_VideoQuit(SDL_VideoDevice *_this); +int RPI_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +int RPI_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +int RPI_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +int RPI_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data); +void RPI_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +int RPI_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); +void RPI_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +void RPI_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +void RPI_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +void RPI_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); +void RPI_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +void RPI_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +void RPI_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); +void RPI_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); /* OpenGL/OpenGL ES functions */ -int RPI_GLES_LoadLibrary(_THIS, const char *path); -SDL_FunctionPointer RPI_GLES_GetProcAddress(_THIS, const char *proc); -void RPI_GLES_UnloadLibrary(_THIS); -SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window *window); -int RPI_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -int RPI_GLES_SetSwapInterval(_THIS, int interval); -int RPI_GLES_GetSwapInterval(_THIS); -int RPI_GLES_SwapWindow(_THIS, SDL_Window *window); -int RPI_GLES_DeleteContext(_THIS, SDL_GLContext context); +int RPI_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +SDL_FunctionPointer RPI_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +void RPI_GLES_UnloadLibrary(SDL_VideoDevice *_this); +SDL_GLContext RPI_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +int RPI_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +int RPI_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval); +int RPI_GLES_GetSwapInterval(SDL_VideoDevice *_this); +int RPI_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +int RPI_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); #endif /* SDL_rpivideo_h */ diff --git a/src/video/riscos/SDL_riscosevents.c b/src/video/riscos/SDL_riscosevents.c index 182f447cd4..18d8fde1c1 100644 --- a/src/video/riscos/SDL_riscosevents.c +++ b/src/video/riscos/SDL_riscosevents.c @@ -48,7 +48,7 @@ static SDL_Scancode SDL_RISCOS_translate_keycode(int keycode) return scancode; } -void RISCOS_PollKeyboard(_THIS) +void RISCOS_PollKeyboard(SDL_VideoDevice *_this) { SDL_VideoData *driverdata = _this->driverdata; Uint8 key = 2; @@ -108,7 +108,7 @@ static const Uint8 mouse_button_map[] = { SDL_BUTTON_X2 + 3 }; -void RISCOS_PollMouse(_THIS) +void RISCOS_PollMouse(SDL_VideoDevice *_this) { SDL_VideoData *driverdata = _this->driverdata; SDL_Mouse *mouse = SDL_GetMouse(); @@ -137,7 +137,7 @@ void RISCOS_PollMouse(_THIS) } } -int RISCOS_InitEvents(_THIS) +int RISCOS_InitEvents(SDL_VideoDevice *_this) { SDL_VideoData *driverdata = _this->driverdata; _kernel_swi_regs regs; @@ -161,13 +161,13 @@ int RISCOS_InitEvents(_THIS) return 0; } -void RISCOS_PumpEvents(_THIS) +void RISCOS_PumpEvents(SDL_VideoDevice *_this) { RISCOS_PollMouse(_this); RISCOS_PollKeyboard(_this); } -void RISCOS_QuitEvents(_THIS) +void RISCOS_QuitEvents(SDL_VideoDevice *_this) { /* Re-enable escape. */ _kernel_osbyte(229, 0, 0); diff --git a/src/video/riscos/SDL_riscosevents_c.h b/src/video/riscos/SDL_riscosevents_c.h index 92c2c45d68..2bc272ba05 100644 --- a/src/video/riscos/SDL_riscosevents_c.h +++ b/src/video/riscos/SDL_riscosevents_c.h @@ -26,8 +26,8 @@ #include "SDL_riscosvideo.h" -extern int RISCOS_InitEvents(_THIS); -extern void RISCOS_PumpEvents(_THIS); -extern void RISCOS_QuitEvents(_THIS); +extern int RISCOS_InitEvents(SDL_VideoDevice *_this); +extern void RISCOS_PumpEvents(SDL_VideoDevice *_this); +extern void RISCOS_QuitEvents(SDL_VideoDevice *_this); #endif /* SDL_riscosevents_c_h_ */ diff --git a/src/video/riscos/SDL_riscosframebuffer.c b/src/video/riscos/SDL_riscosframebuffer.c index b7b1049d2d..5ea122f4d2 100644 --- a/src/video/riscos/SDL_riscosframebuffer.c +++ b/src/video/riscos/SDL_riscosframebuffer.c @@ -30,7 +30,7 @@ #include #include -int RISCOS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) +int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_WindowData *driverdata = window->driverdata; const char *sprite_name = "display"; @@ -91,7 +91,7 @@ int RISCOS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, vo return 0; } -int RISCOS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) +int RISCOS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { SDL_WindowData *driverdata = window->driverdata; _kernel_swi_regs regs; @@ -113,7 +113,7 @@ int RISCOS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *re return 0; } -void RISCOS_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +void RISCOS_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *driverdata = window->driverdata; diff --git a/src/video/riscos/SDL_riscosframebuffer_c.h b/src/video/riscos/SDL_riscosframebuffer_c.h index 6b0cda625f..926b76a619 100644 --- a/src/video/riscos/SDL_riscosframebuffer_c.h +++ b/src/video/riscos/SDL_riscosframebuffer_c.h @@ -24,8 +24,8 @@ #include "SDL_internal.h" -extern int RISCOS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); -extern int RISCOS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); -extern void RISCOS_DestroyWindowFramebuffer(_THIS, SDL_Window *window); +extern int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int RISCOS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void RISCOS_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_riscosframebuffer_c_h_ */ diff --git a/src/video/riscos/SDL_riscosmodes.c b/src/video/riscos/SDL_riscosmodes.c index 6b4a9d64c3..0f99729d14 100644 --- a/src/video/riscos/SDL_riscosmodes.c +++ b/src/video/riscos/SDL_riscosmodes.c @@ -199,7 +199,7 @@ static void *copy_memory(const void *src, size_t size, size_t alloc) return dst; } -int RISCOS_InitModes(_THIS) +int RISCOS_InitModes(SDL_VideoDevice *_this) { SDL_DisplayMode mode; int *current_mode; @@ -230,7 +230,7 @@ int RISCOS_InitModes(_THIS) return 0; } -int RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay *display) +int RISCOS_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { SDL_DisplayMode mode; _kernel_swi_regs regs; @@ -283,7 +283,7 @@ int RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay *display) return 0; } -int RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +int RISCOS_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { const char disable_cursor[] = { 23, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; _kernel_swi_regs regs; diff --git a/src/video/riscos/SDL_riscosmodes.h b/src/video/riscos/SDL_riscosmodes.h index de8dc74c6a..e360097451 100644 --- a/src/video/riscos/SDL_riscosmodes.h +++ b/src/video/riscos/SDL_riscosmodes.h @@ -23,9 +23,9 @@ #ifndef SDL_riscosmodes_h_ #define SDL_riscosmodes_h_ -extern int RISCOS_InitModes(_THIS); -extern int RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -extern int RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay *display, +extern int RISCOS_InitModes(SDL_VideoDevice *_this); +extern int RISCOS_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +extern int RISCOS_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); #endif /* SDL_riscosmodes_h_ */ diff --git a/src/video/riscos/SDL_riscosmouse.c b/src/video/riscos/SDL_riscosmouse.c index 16324318bf..40b7cf2bb0 100644 --- a/src/video/riscos/SDL_riscosmouse.c +++ b/src/video/riscos/SDL_riscosmouse.c @@ -22,6 +22,8 @@ #ifdef SDL_VIDEO_DRIVER_RISCOS +#include "SDL_riscosvideo.h" +#include "SDL_riscosmouse.h" #include "../../events/SDL_mouse_c.h" #include @@ -59,7 +61,7 @@ static int RISCOS_ShowCursor(SDL_Cursor *cursor) return 0; } -int RISCOS_InitMouse(_THIS) +int RISCOS_InitMouse(SDL_VideoDevice *_this) { SDL_Mouse *mouse = SDL_GetMouse(); diff --git a/src/video/riscos/SDL_riscosmouse.h b/src/video/riscos/SDL_riscosmouse.h index 68f914865f..02c1e3ed36 100644 --- a/src/video/riscos/SDL_riscosmouse.h +++ b/src/video/riscos/SDL_riscosmouse.h @@ -23,6 +23,6 @@ #ifndef SDL_riscosmouse_h_ #define SDL_riscosmouse_h_ -extern int RISCOS_InitMouse(_THIS); +extern int RISCOS_InitMouse(SDL_VideoDevice *_this); #endif /* SDL_riscosmouse_h_ */ diff --git a/src/video/riscos/SDL_riscosvideo.c b/src/video/riscos/SDL_riscosvideo.c index 7dfae8a04b..dd57ce839e 100644 --- a/src/video/riscos/SDL_riscosvideo.c +++ b/src/video/riscos/SDL_riscosvideo.c @@ -36,8 +36,8 @@ #define RISCOSVID_DRIVER_NAME "riscos" /* Initialization/Query functions */ -static int RISCOS_VideoInit(_THIS); -static void RISCOS_VideoQuit(_THIS); +static int RISCOS_VideoInit(SDL_VideoDevice *_this); +static void RISCOS_VideoQuit(SDL_VideoDevice *_this); /* RISC OS driver bootstrap functions */ @@ -95,7 +95,7 @@ VideoBootStrap RISCOS_bootstrap = { RISCOS_CreateDevice }; -static int RISCOS_VideoInit(_THIS) +static int RISCOS_VideoInit(SDL_VideoDevice *_this) { if (RISCOS_InitEvents(_this) < 0) { return -1; @@ -113,7 +113,7 @@ static int RISCOS_VideoInit(_THIS) return 0; } -static void RISCOS_VideoQuit(_THIS) +static void RISCOS_VideoQuit(SDL_VideoDevice *_this) { RISCOS_QuitEvents(_this); } diff --git a/src/video/riscos/SDL_riscoswindow.c b/src/video/riscos/SDL_riscoswindow.c index 743f7aba5e..80a0e94f7f 100644 --- a/src/video/riscos/SDL_riscoswindow.c +++ b/src/video/riscos/SDL_riscoswindow.c @@ -30,7 +30,7 @@ #include "SDL_riscosvideo.h" #include "SDL_riscoswindow.h" -int RISCOS_CreateWindow(_THIS, SDL_Window *window) +int RISCOS_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *driverdata; @@ -49,7 +49,7 @@ int RISCOS_CreateWindow(_THIS, SDL_Window *window) return 0; } -void RISCOS_DestroyWindow(_THIS, SDL_Window *window) +void RISCOS_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *driverdata = window->driverdata; @@ -61,7 +61,7 @@ void RISCOS_DestroyWindow(_THIS, SDL_Window *window) window->driverdata = NULL; } -int RISCOS_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info) +int RISCOS_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info) { info->subsystem = SDL_SYSWM_RISCOS; return 0; diff --git a/src/video/riscos/SDL_riscoswindow.h b/src/video/riscos/SDL_riscoswindow.h index 039ac28333..e05466481a 100644 --- a/src/video/riscos/SDL_riscoswindow.h +++ b/src/video/riscos/SDL_riscoswindow.h @@ -32,8 +32,8 @@ struct SDL_WindowData sprite_header *fb_sprite; }; -extern int RISCOS_CreateWindow(_THIS, SDL_Window *window); -extern void RISCOS_DestroyWindow(_THIS, SDL_Window *window); -extern int RISCOS_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); +extern int RISCOS_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void RISCOS_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int RISCOS_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info); #endif /* SDL_riscoswindow_h_ */ diff --git a/src/video/uikit/SDL_uikitclipboard.h b/src/video/uikit/SDL_uikitclipboard.h index 0068e3074a..cb86efdd51 100644 --- a/src/video/uikit/SDL_uikitclipboard.h +++ b/src/video/uikit/SDL_uikitclipboard.h @@ -23,11 +23,11 @@ #include "../SDL_sysvideo.h" -extern int UIKit_SetClipboardText(_THIS, const char *text); -extern char *UIKit_GetClipboardText(_THIS); -extern SDL_bool UIKit_HasClipboardText(_THIS); +extern int UIKit_SetClipboardText(SDL_VideoDevice *_this, const char *text); +extern char *UIKit_GetClipboardText(SDL_VideoDevice *_this); +extern SDL_bool UIKit_HasClipboardText(SDL_VideoDevice *_this); -extern void UIKit_InitClipboard(_THIS); -extern void UIKit_QuitClipboard(_THIS); +extern void UIKit_InitClipboard(SDL_VideoDevice *_this); +extern void UIKit_QuitClipboard(SDL_VideoDevice *_this); #endif /* SDL_uikitclipboard_h_ */ diff --git a/src/video/uikit/SDL_uikitclipboard.m b/src/video/uikit/SDL_uikitclipboard.m index 79c7c229c2..df8433a998 100644 --- a/src/video/uikit/SDL_uikitclipboard.m +++ b/src/video/uikit/SDL_uikitclipboard.m @@ -27,7 +27,7 @@ #import -int UIKit_SetClipboardText(_THIS, const char *text) +int UIKit_SetClipboardText(SDL_VideoDevice *_this, const char *text) { #if TARGET_OS_TV return SDL_SetError("The clipboard is not available on tvOS"); @@ -40,7 +40,7 @@ int UIKit_SetClipboardText(_THIS, const char *text) } char * -UIKit_GetClipboardText(_THIS) +UIKit_GetClipboardText(SDL_VideoDevice *_this) { #if TARGET_OS_TV return SDL_strdup(""); // Unsupported. @@ -59,7 +59,7 @@ UIKit_GetClipboardText(_THIS) } SDL_bool -UIKit_HasClipboardText(_THIS) +UIKit_HasClipboardText(SDL_VideoDevice *_this) { @autoreleasepool { #if !TARGET_OS_TV @@ -71,7 +71,7 @@ UIKit_HasClipboardText(_THIS) } } -void UIKit_InitClipboard(_THIS) +void UIKit_InitClipboard(SDL_VideoDevice *_this) { #if !TARGET_OS_TV @autoreleasepool { @@ -90,7 +90,7 @@ void UIKit_InitClipboard(_THIS) #endif } -void UIKit_QuitClipboard(_THIS) +void UIKit_QuitClipboard(SDL_VideoDevice *_this) { @autoreleasepool { SDL_UIKitVideoData *data = (__bridge SDL_UIKitVideoData *)_this->driverdata; diff --git a/src/video/uikit/SDL_uikitevents.h b/src/video/uikit/SDL_uikitevents.h index 366b16d7d8..82bccad621 100644 --- a/src/video/uikit/SDL_uikitevents.h +++ b/src/video/uikit/SDL_uikitevents.h @@ -26,7 +26,7 @@ #include "../SDL_sysvideo.h" extern Uint64 UIKit_GetEventTimestamp(NSTimeInterval nsTimestamp); -extern void UIKit_PumpEvents(_THIS); +extern void UIKit_PumpEvents(SDL_VideoDevice *_this); extern void SDL_InitGCKeyboard(void); extern SDL_bool SDL_HasGCKeyboard(void); diff --git a/src/video/uikit/SDL_uikitevents.m b/src/video/uikit/SDL_uikitevents.m index d0fc0cd570..1c6fe13daf 100644 --- a/src/video/uikit/SDL_uikitevents.m +++ b/src/video/uikit/SDL_uikitevents.m @@ -138,7 +138,7 @@ void SDL_iPhoneSetEventPump(SDL_bool enabled) [lifecycleObserver eventPumpChanged]; } -void UIKit_PumpEvents(_THIS) +void UIKit_PumpEvents(SDL_VideoDevice *_this) { if (!UIKit_EventPumpEnabled) { return; diff --git a/src/video/uikit/SDL_uikitmetalview.h b/src/video/uikit/SDL_uikitmetalview.h index 23a477730c..b6c7a4ce44 100644 --- a/src/video/uikit/SDL_uikitmetalview.h +++ b/src/video/uikit/SDL_uikitmetalview.h @@ -45,9 +45,9 @@ @end -SDL_MetalView UIKit_Metal_CreateView(_THIS, SDL_Window *window); -void UIKit_Metal_DestroyView(_THIS, SDL_MetalView view); -void *UIKit_Metal_GetLayer(_THIS, SDL_MetalView view); +SDL_MetalView UIKit_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window); +void UIKit_Metal_DestroyView(SDL_VideoDevice *_this, SDL_MetalView view); +void *UIKit_Metal_GetLayer(SDL_VideoDevice *_this, SDL_MetalView view); #endif /* SDL_VIDEO_DRIVER_UIKIT && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL) */ diff --git a/src/video/uikit/SDL_uikitmetalview.m b/src/video/uikit/SDL_uikitmetalview.m index 16f6a44c4e..cd279d61d8 100644 --- a/src/video/uikit/SDL_uikitmetalview.m +++ b/src/video/uikit/SDL_uikitmetalview.m @@ -75,7 +75,7 @@ @end SDL_MetalView -UIKit_Metal_CreateView(_THIS, SDL_Window *window) +UIKit_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; @@ -104,7 +104,7 @@ UIKit_Metal_CreateView(_THIS, SDL_Window *window) } } -void UIKit_Metal_DestroyView(_THIS, SDL_MetalView view) +void UIKit_Metal_DestroyView(SDL_VideoDevice *_this, SDL_MetalView view) { @autoreleasepool { SDL_uikitmetalview *metalview = CFBridgingRelease(view); @@ -116,7 +116,7 @@ void UIKit_Metal_DestroyView(_THIS, SDL_MetalView view) } void * -UIKit_Metal_GetLayer(_THIS, SDL_MetalView view) +UIKit_Metal_GetLayer(SDL_VideoDevice *_this, SDL_MetalView view) { @autoreleasepool { SDL_uikitview *uiview = (__bridge SDL_uikitview *)view; diff --git a/src/video/uikit/SDL_uikitmodes.h b/src/video/uikit/SDL_uikitmodes.h index e5dc0706cf..a744febb27 100644 --- a/src/video/uikit/SDL_uikitmodes.h +++ b/src/video/uikit/SDL_uikitmodes.h @@ -41,12 +41,12 @@ extern SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen); -extern int UIKit_InitModes(_THIS); +extern int UIKit_InitModes(SDL_VideoDevice *_this); extern int UIKit_AddDisplay(UIScreen *uiscreen, SDL_bool send_event); extern void UIKit_DelDisplay(UIScreen *uiscreen); -extern int UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -extern int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -extern void UIKit_QuitModes(_THIS); -extern int UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); +extern int UIKit_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +extern int UIKit_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +extern void UIKit_QuitModes(SDL_VideoDevice *_this); +extern int UIKit_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); #endif /* SDL_uikitmodes_h_ */ diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index 6cd2428ddd..9ddea9bb84 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -271,7 +271,7 @@ UIKit_IsDisplayLandscape(UIScreen *uiscreen) } } -int UIKit_InitModes(_THIS) +int UIKit_InitModes(SDL_VideoDevice *_this) { @autoreleasepool { for (UIScreen *uiscreen in [UIScreen screens]) { @@ -289,7 +289,7 @@ int UIKit_InitModes(_THIS) return 0; } -int UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay *display) +int UIKit_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { @autoreleasepool { SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->driverdata; @@ -323,7 +323,7 @@ int UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay *display) return 0; } -int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +int UIKit_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { @autoreleasepool { SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->driverdata; @@ -352,7 +352,7 @@ int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode return 0; } -int UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) +int UIKit_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { @autoreleasepool { SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->driverdata; @@ -373,7 +373,7 @@ int UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rec return 0; } -void UIKit_QuitModes(_THIS) +void UIKit_QuitModes(SDL_VideoDevice *_this) { [SDL_DisplayWatch stop]; diff --git a/src/video/uikit/SDL_uikitopengles.h b/src/video/uikit/SDL_uikitopengles.h index b2dc1d6faf..3e280df732 100644 --- a/src/video/uikit/SDL_uikitopengles.h +++ b/src/video/uikit/SDL_uikitopengles.h @@ -25,13 +25,13 @@ #include "../SDL_sysvideo.h" -extern int UIKit_GL_MakeCurrent(_THIS, SDL_Window *window, +extern int UIKit_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); -extern int UIKit_GL_SwapWindow(_THIS, SDL_Window *window); -extern SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window *window); -extern int UIKit_GL_DeleteContext(_THIS, SDL_GLContext context); -extern SDL_FunctionPointer UIKit_GL_GetProcAddress(_THIS, const char *proc); -extern int UIKit_GL_LoadLibrary(_THIS, const char *path); +extern int UIKit_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern SDL_GLContext UIKit_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int UIKit_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); +extern SDL_FunctionPointer UIKit_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +extern int UIKit_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); extern void UIKit_GL_RestoreCurrentContext(void); diff --git a/src/video/uikit/SDL_uikitopengles.m b/src/video/uikit/SDL_uikitopengles.m index 674bc56227..79738fe4b2 100644 --- a/src/video/uikit/SDL_uikitopengles.m +++ b/src/video/uikit/SDL_uikitopengles.m @@ -51,7 +51,7 @@ @end -SDL_FunctionPointer UIKit_GL_GetProcAddress(_THIS, const char *proc) +SDL_FunctionPointer UIKit_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc) { /* Look through all SO's for the proc symbol. Here's why: * -Looking for the path to the OpenGL Library seems not to work in the iOS Simulator. @@ -62,7 +62,7 @@ SDL_FunctionPointer UIKit_GL_GetProcAddress(_THIS, const char *proc) /* note that SDL_GL_DeleteContext makes it current without passing the window */ -int UIKit_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int UIKit_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { @autoreleasepool { SDLEAGLContext *eaglcontext = (__bridge SDLEAGLContext *)context; @@ -79,7 +79,7 @@ int UIKit_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) return 0; } -int UIKit_GL_LoadLibrary(_THIS, const char *path) +int UIKit_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path) { /* We shouldn't pass a path to this function, since we've already loaded the * library. */ @@ -89,7 +89,7 @@ int UIKit_GL_LoadLibrary(_THIS, const char *path) return 0; } -int UIKit_GL_SwapWindow(_THIS, SDL_Window *window) +int UIKit_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDLEAGLContext *context = (__bridge SDLEAGLContext *)SDL_GL_GetCurrentContext(); @@ -108,7 +108,7 @@ int UIKit_GL_SwapWindow(_THIS, SDL_Window *window) return 0; } -SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window *window) +SDL_GLContext UIKit_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDLEAGLContext *context = nil; @@ -185,7 +185,7 @@ SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window *window) } } -int UIKit_GL_DeleteContext(_THIS, SDL_GLContext context) +int UIKit_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { @autoreleasepool { /* The context was retained in SDL_GL_CreateContext, so we release it diff --git a/src/video/uikit/SDL_uikitvideo.h b/src/video/uikit/SDL_uikitvideo.h index c3892a077e..60ee2a9f2a 100644 --- a/src/video/uikit/SDL_uikitvideo.h +++ b/src/video/uikit/SDL_uikitvideo.h @@ -37,7 +37,7 @@ CGRect UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen); #endif /* __OBJC__ */ -int UIKit_SuspendScreenSaver(_THIS); +int UIKit_SuspendScreenSaver(SDL_VideoDevice *_this); void UIKit_ForceUpdateHomeIndicator(void); diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index d709b56dc6..13e12e5da0 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -44,8 +44,8 @@ @end /* Initialization/Query functions */ -static int UIKit_VideoInit(_THIS); -static void UIKit_VideoQuit(_THIS); +static int UIKit_VideoInit(SDL_VideoDevice *_this); +static void UIKit_VideoQuit(SDL_VideoDevice *_this); /* DUMMY driver bootstrap functions */ @@ -143,7 +143,7 @@ VideoBootStrap UIKIT_bootstrap = { UIKit_CreateDevice }; -int UIKit_VideoInit(_THIS) +int UIKit_VideoInit(SDL_VideoDevice *_this) { _this->gl_config.driver_loaded = 1; @@ -157,7 +157,7 @@ int UIKit_VideoInit(_THIS) return 0; } -void UIKit_VideoQuit(_THIS) +void UIKit_VideoQuit(SDL_VideoDevice *_this) { SDL_QuitGCKeyboard(); SDL_QuitGCMouse(); @@ -165,7 +165,7 @@ void UIKit_VideoQuit(_THIS) UIKit_QuitModes(_this); } -int UIKit_SuspendScreenSaver(_THIS) +int UIKit_SuspendScreenSaver(SDL_VideoDevice *_this) { @autoreleasepool { UIApplication *app = [UIApplication sharedApplication]; diff --git a/src/video/uikit/SDL_uikitviewcontroller.h b/src/video/uikit/SDL_uikitviewcontroller.h index 46b0193e44..ddb634e1d0 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.h +++ b/src/video/uikit/SDL_uikitviewcontroller.h @@ -87,9 +87,9 @@ @end #ifdef SDL_IPHONE_KEYBOARD -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); -int UIKit_SetTextInputRect(_THIS, const SDL_Rect *rect); +SDL_bool UIKit_HasScreenKeyboardSupport(SDL_VideoDevice *_this); +void UIKit_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); +void UIKit_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); +SDL_bool UIKit_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); +int UIKit_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); #endif diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index 658a6847ec..be0928e5f9 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -524,12 +524,12 @@ static SDL_uikitviewcontroller *GetWindowViewController(SDL_Window *window) } SDL_bool -UIKit_HasScreenKeyboardSupport(_THIS) +UIKit_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { return SDL_TRUE; } -void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window) +void UIKit_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_uikitviewcontroller *vc = GetWindowViewController(window); @@ -537,7 +537,7 @@ void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window) } } -void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window) +void UIKit_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_uikitviewcontroller *vc = GetWindowViewController(window); @@ -546,7 +546,7 @@ void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window) } SDL_bool -UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window) +UIKit_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_uikitviewcontroller *vc = GetWindowViewController(window); @@ -557,7 +557,7 @@ UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window) } } -int UIKit_SetTextInputRect(_THIS, const SDL_Rect *rect) +int UIKit_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) { @autoreleasepool { SDL_uikitviewcontroller *vc = GetWindowViewController(SDL_GetFocusWindow()); diff --git a/src/video/uikit/SDL_uikitvulkan.h b/src/video/uikit/SDL_uikitvulkan.h index 6ea06c2725..0e13675672 100644 --- a/src/video/uikit/SDL_uikitvulkan.h +++ b/src/video/uikit/SDL_uikitvulkan.h @@ -34,12 +34,12 @@ #if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_UIKIT) -int UIKit_Vulkan_LoadLibrary(_THIS, const char *path); -void UIKit_Vulkan_UnloadLibrary(_THIS); -SDL_bool UIKit_Vulkan_GetInstanceExtensions(_THIS, +int UIKit_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); +void UIKit_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); +SDL_bool UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names); -SDL_bool UIKit_Vulkan_CreateSurface(_THIS, +SDL_bool UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); diff --git a/src/video/uikit/SDL_uikitvulkan.m b/src/video/uikit/SDL_uikitvulkan.m index c1da9dc2c1..5bdc743807 100644 --- a/src/video/uikit/SDL_uikitvulkan.m +++ b/src/video/uikit/SDL_uikitvulkan.m @@ -46,7 +46,7 @@ const char *defaultPaths[] = { * proofing. */ #define DEFAULT_HANDLE RTLD_DEFAULT -int UIKit_Vulkan_LoadLibrary(_THIS, const char *path) +int UIKit_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path) { VkExtensionProperties *extensions = NULL; Uint32 extensionCount = 0; @@ -159,7 +159,7 @@ fail: return -1; } -void UIKit_Vulkan_UnloadLibrary(_THIS) +void UIKit_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) { if (_this->vulkan_config.loader_handle) { if (_this->vulkan_config.loader_handle != DEFAULT_HANDLE) { @@ -169,7 +169,7 @@ void UIKit_Vulkan_UnloadLibrary(_THIS) } } -SDL_bool UIKit_Vulkan_GetInstanceExtensions(_THIS, +SDL_bool UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names) { @@ -186,7 +186,7 @@ SDL_bool UIKit_Vulkan_GetInstanceExtensions(_THIS, extensionsForUIKit); } -SDL_bool UIKit_Vulkan_CreateSurface(_THIS, +SDL_bool UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface) diff --git a/src/video/uikit/SDL_uikitwindow.h b/src/video/uikit/SDL_uikitwindow.h index f78b36e43b..ba89566293 100644 --- a/src/video/uikit/SDL_uikitwindow.h +++ b/src/video/uikit/SDL_uikitwindow.h @@ -26,18 +26,18 @@ #import "SDL_uikitview.h" #import "SDL_uikitviewcontroller.h" -extern int UIKit_CreateWindow(_THIS, SDL_Window *window); -extern void UIKit_SetWindowTitle(_THIS, SDL_Window *window); -extern void UIKit_ShowWindow(_THIS, SDL_Window *window); -extern void UIKit_HideWindow(_THIS, SDL_Window *window); -extern void UIKit_RaiseWindow(_THIS, SDL_Window *window); -extern void UIKit_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered); -extern void UIKit_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); -extern void UIKit_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -extern void UIKit_UpdatePointerLock(_THIS, SDL_Window *window); -extern void UIKit_DestroyWindow(_THIS, SDL_Window *window); -extern void UIKit_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h); -extern int UIKit_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); +extern int UIKit_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void UIKit_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +extern void UIKit_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void UIKit_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void UIKit_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void UIKit_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered); +extern void UIKit_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); +extern void UIKit_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); +extern void UIKit_UpdatePointerLock(SDL_VideoDevice *_this, SDL_Window *window); +extern void UIKit_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void UIKit_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h); +extern int UIKit_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info); extern NSUInteger UIKit_GetSupportedOrientations(SDL_Window *window); diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index f01178b630..12916536df 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -79,7 +79,7 @@ @end -static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created) +static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, UIWindow *uiwindow, SDL_bool created) { SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); SDL_UIKitDisplayData *displaydata = (__bridge SDL_UIKitDisplayData *)display->driverdata; @@ -149,7 +149,7 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo return 0; } -int UIKit_CreateWindow(_THIS, SDL_Window *window) +int UIKit_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); @@ -207,7 +207,7 @@ int UIKit_CreateWindow(_THIS, SDL_Window *window) return 1; } -void UIKit_SetWindowTitle(_THIS, SDL_Window *window) +void UIKit_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; @@ -215,7 +215,7 @@ void UIKit_SetWindowTitle(_THIS, SDL_Window *window) } } -void UIKit_ShowWindow(_THIS, SDL_Window *window) +void UIKit_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; @@ -231,7 +231,7 @@ void UIKit_ShowWindow(_THIS, SDL_Window *window) } } -void UIKit_HideWindow(_THIS, SDL_Window *window) +void UIKit_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; @@ -239,7 +239,7 @@ void UIKit_HideWindow(_THIS, SDL_Window *window) } } -void UIKit_RaiseWindow(_THIS, SDL_Window *window) +void UIKit_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { /* We don't currently offer a concept of "raising" the SDL window, since * we only allow one per display, in the iOS fashion. @@ -248,7 +248,7 @@ void UIKit_RaiseWindow(_THIS, SDL_Window *window) _this->GL_MakeCurrent(_this, _this->current_glwin, _this->current_glctx); } -static void UIKit_UpdateWindowBorder(_THIS, SDL_Window *window) +static void UIKit_UpdateWindowBorder(SDL_VideoDevice *_this, SDL_Window *window) { SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; SDL_uikitviewcontroller *viewcontroller = data.viewcontroller; @@ -277,26 +277,26 @@ static void UIKit_UpdateWindowBorder(_THIS, SDL_Window *window) [viewcontroller.view layoutIfNeeded]; } -void UIKit_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) +void UIKit_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered) { @autoreleasepool { UIKit_UpdateWindowBorder(_this, window); } } -void UIKit_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) +void UIKit_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { @autoreleasepool { UIKit_UpdateWindowBorder(_this, window); } } -void UIKit_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void UIKit_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { /* There really isn't a concept of window grab or cursor confinement on iOS */ } -void UIKit_UpdatePointerLock(_THIS, SDL_Window *window) +void UIKit_UpdatePointerLock(SDL_VideoDevice *_this, SDL_Window *window) { #if !TARGET_OS_TV #if defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0 @@ -311,7 +311,7 @@ void UIKit_UpdatePointerLock(_THIS, SDL_Window *window) #endif /* !TARGET_OS_TV */ } -void UIKit_DestroyWindow(_THIS, SDL_Window *window) +void UIKit_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { if (window->driverdata != NULL) { @@ -341,7 +341,7 @@ void UIKit_DestroyWindow(_THIS, SDL_Window *window) } } -void UIKit_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) +void UIKit_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h) { @autoreleasepool { SDL_UIKitWindowData *windata = (__bridge SDL_UIKitWindowData *)window->driverdata; @@ -360,7 +360,7 @@ void UIKit_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) } } -int UIKit_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) +int UIKit_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info) { @autoreleasepool { SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; diff --git a/src/video/vita/SDL_vitaframebuffer.c b/src/video/vita/SDL_vitaframebuffer.c index 8d4e246f0e..ef505d75e2 100644 --- a/src/video/vita/SDL_vitaframebuffer.c +++ b/src/video/vita/SDL_vitaframebuffer.c @@ -63,7 +63,7 @@ void vita_gpu_free(SceUID uid) sceKernelFreeMemBlock(uid); } -int VITA_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) +int VITA_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_WindowData *data = window->driverdata; SceDisplayFrameBuf framebuf; @@ -93,13 +93,13 @@ int VITA_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void return 0; } -int VITA_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) +int VITA_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { // do nothing return 0; } -void VITA_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +void VITA_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; diff --git a/src/video/vita/SDL_vitaframebuffer.h b/src/video/vita/SDL_vitaframebuffer.h index 26058f61c0..eda9b59900 100644 --- a/src/video/vita/SDL_vitaframebuffer.h +++ b/src/video/vita/SDL_vitaframebuffer.h @@ -20,6 +20,6 @@ */ #include "SDL_internal.h" -extern int VITA_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); -extern int VITA_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); -extern void VITA_DestroyWindowFramebuffer(_THIS, SDL_Window *window); +extern int VITA_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int VITA_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void VITA_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/vita/SDL_vitagl_pvr.c b/src/video/vita/SDL_vitagl_pvr.c index 8ceefd850b..482d5a69ec 100644 --- a/src/video/vita/SDL_vitagl_pvr.c +++ b/src/video/vita/SDL_vitagl_pvr.c @@ -43,7 +43,7 @@ static void getFBSize(int *width, int *height) *height = FB_HEIGHT; } -int VITA_GL_LoadLibrary(_THIS, const char *path) +int VITA_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path) { PVRSRV_PSP2_APPHINT hint; char *override = SDL_getenv("VITA_MODULE_PATH"); @@ -81,7 +81,7 @@ int VITA_GL_LoadLibrary(_THIS, const char *path) } SDL_GLContext -VITA_GL_CreateContext(_THIS, SDL_Window *window) +VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { char gl_version[3]; SDL_GLContext context = NULL; @@ -116,7 +116,7 @@ VITA_GL_CreateContext(_THIS, SDL_Window *window) } SDL_FunctionPointer -VITA_GL_GetProcAddress(_THIS, const char *proc) +VITA_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc) { return gl4es_GetProcAddress(proc); } diff --git a/src/video/vita/SDL_vitagl_pvr_c.h b/src/video/vita/SDL_vitagl_pvr_c.h index 98715078af..99aceadad0 100644 --- a/src/video/vita/SDL_vitagl_pvr_c.h +++ b/src/video/vita/SDL_vitagl_pvr_c.h @@ -24,8 +24,8 @@ #include "SDL_vitavideo.h" -extern SDL_GLContext VITA_GL_CreateContext(_THIS, SDL_Window *window); -extern int VITA_GL_LoadLibrary(_THIS, const char *path); -extern SDL_FunctionPointer VITA_GL_GetProcAddress(_THIS, const char *proc); +extern SDL_GLContext VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int VITA_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_FunctionPointer VITA_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); #endif /* SDL_vitagl_pvr_c_h_ */ diff --git a/src/video/vita/SDL_vitagles.c b/src/video/vita/SDL_vitagles.c index d25103baab..f058c37497 100644 --- a/src/video/vita/SDL_vitagles.c +++ b/src/video/vita/SDL_vitagles.c @@ -58,18 +58,18 @@ void VITA_GLES_KeyboardCallback(ScePigletPreSwapData *data) sceCommonDialogUpdate(&commonDialogParam); } -int VITA_GLES_LoadLibrary(_THIS, const char *path) +int VITA_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { pibInit(PIB_SHACCCG | PIB_GET_PROC_ADDR_CORE); return 0; } -SDL_FunctionPointer VITA_GLES_GetProcAddress(_THIS, const char *proc) +SDL_FunctionPointer VITA_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc) { return eglGetProcAddress(proc); } -void VITA_GLES_UnloadLibrary(_THIS) +void VITA_GLES_UnloadLibrary(SDL_VideoDevice *_this) { eglTerminate(_this->gl_data->display); } @@ -77,7 +77,7 @@ void VITA_GLES_UnloadLibrary(_THIS) static EGLint width = 960; static EGLint height = 544; -SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window) +SDL_GLContext VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wdata = window->driverdata; @@ -155,7 +155,7 @@ SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window) return context; } -int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int VITA_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { if (!eglMakeCurrent(_this->gl_data->display, _this->gl_data->surface, _this->gl_data->surface, _this->gl_data->context)) { @@ -164,7 +164,7 @@ int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) return 0; } -int VITA_GLES_SetSwapInterval(_THIS, int interval) +int VITA_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval) { EGLBoolean status; status = eglSwapInterval(_this->gl_data->display, interval); @@ -177,13 +177,13 @@ int VITA_GLES_SetSwapInterval(_THIS, int interval) return SDL_SetError("Unable to set the EGL swap interval"); } -int VITA_GLES_GetSwapInterval(_THIS, int *interval) +int VITA_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval) { *interval = _this->gl_data->swapinterval; return 0; } -int VITA_GLES_SwapWindow(_THIS, SDL_Window *window) +int VITA_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { if (!eglSwapBuffers(_this->gl_data->display, _this->gl_data->surface)) { return SDL_SetError("eglSwapBuffers() failed"); @@ -191,7 +191,7 @@ int VITA_GLES_SwapWindow(_THIS, SDL_Window *window) return 0; } -int VITA_GLES_DeleteContext(_THIS, SDL_GLContext context) +int VITA_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { SDL_VideoData *phdata = _this->driverdata; EGLBoolean status; diff --git a/src/video/vita/SDL_vitagles_c.h b/src/video/vita/SDL_vitagles_c.h index bb98699cef..36885982fc 100644 --- a/src/video/vita/SDL_vitagles_c.h +++ b/src/video/vita/SDL_vitagles_c.h @@ -38,16 +38,16 @@ typedef struct SDL_GLDriverData uint32_t swapinterval; } SDL_GLDriverData; -extern SDL_FunctionPointer VITA_GLES_GetProcAddress(_THIS, const char *proc); -extern int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -extern void VITA_GLES_SwapBuffers(_THIS); +extern SDL_FunctionPointer VITA_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +extern int VITA_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +extern void VITA_GLES_SwapBuffers(SDL_VideoDevice *_this); -extern int VITA_GLES_SwapWindow(_THIS, SDL_Window *window); -extern SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window); +extern int VITA_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern SDL_GLContext VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); -extern int VITA_GLES_LoadLibrary(_THIS, const char *path); -extern void VITA_GLES_UnloadLibrary(_THIS); -extern int VITA_GLES_SetSwapInterval(_THIS, int interval); -extern int VITA_GLES_GetSwapInterval(_THIS, int *interval); +extern int VITA_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern void VITA_GLES_UnloadLibrary(SDL_VideoDevice *_this); +extern int VITA_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval); +extern int VITA_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval); #endif /* SDL_vitagles_c_h_ */ diff --git a/src/video/vita/SDL_vitagles_pvr.c b/src/video/vita/SDL_vitagles_pvr.c index 009335f9ce..80321d694a 100644 --- a/src/video/vita/SDL_vitagles_pvr.c +++ b/src/video/vita/SDL_vitagles_pvr.c @@ -32,7 +32,7 @@ #define MAX_PATH 256 // vita limits are somehow wrong -int VITA_GLES_LoadLibrary(_THIS, const char *path) +int VITA_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { PVRSRV_PSP2_APPHINT hint; char *override = SDL_getenv("VITA_MODULE_PATH"); @@ -68,12 +68,12 @@ int VITA_GLES_LoadLibrary(_THIS, const char *path) } SDL_GLContext -VITA_GLES_CreateContext(_THIS, SDL_Window *window) +VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { return SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); } -int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int VITA_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { if (window && context) { return SDL_EGL_MakeCurrent(_this, window->driverdata->egl_surface, context); @@ -82,7 +82,7 @@ int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) } } -int VITA_GLES_SwapWindow(_THIS, SDL_Window *window) +int VITA_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *videodata = _this->driverdata; if (videodata->ime_active) { diff --git a/src/video/vita/SDL_vitagles_pvr_c.h b/src/video/vita/SDL_vitagles_pvr_c.h index 1f0642554c..afe60f3b4a 100644 --- a/src/video/vita/SDL_vitagles_pvr_c.h +++ b/src/video/vita/SDL_vitagles_pvr_c.h @@ -24,9 +24,9 @@ #include "SDL_vitavideo.h" -extern int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -extern int VITA_GLES_SwapWindow(_THIS, SDL_Window *window); -extern SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window); -extern int VITA_GLES_LoadLibrary(_THIS, const char *path); +extern int VITA_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +extern int VITA_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern SDL_GLContext VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int VITA_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); #endif /* SDL_vitagles_pvr_c_h_ */ diff --git a/src/video/vita/SDL_vitavideo.c b/src/video/vita/SDL_vitavideo.c index 2aa5ed127d..739511c18e 100644 --- a/src/video/vita/SDL_vitavideo.c +++ b/src/video/vita/SDL_vitavideo.c @@ -170,7 +170,7 @@ VideoBootStrap VITA_bootstrap = { /*****************************************************************************/ /* SDL Video and Display initialization/handling functions */ /*****************************************************************************/ -int VITA_VideoInit(_THIS) +int VITA_VideoInit(SDL_VideoDevice *_this) { SDL_DisplayMode mode; #ifdef SDL_VIDEO_VITA_PVR @@ -216,12 +216,12 @@ int VITA_VideoInit(_THIS) return 1; } -void VITA_VideoQuit(_THIS) +void VITA_VideoQuit(SDL_VideoDevice *_this) { VITA_QuitTouch(); } -int VITA_CreateWindow(_THIS, SDL_Window *window) +int VITA_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wdata; #ifdef SDL_VIDEO_VITA_PVR @@ -295,44 +295,44 @@ int VITA_CreateWindow(_THIS, SDL_Window *window) return 0; } -int VITA_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) +int VITA_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data) { return -1; } -void VITA_SetWindowTitle(_THIS, SDL_Window *window) +void VITA_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { } -int VITA_SetWindowPosition(_THIS, SDL_Window *window) +int VITA_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { return SDL_Unsupported(); } -void VITA_SetWindowSize(_THIS, SDL_Window *window) +void VITA_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { } -void VITA_ShowWindow(_THIS, SDL_Window *window) +void VITA_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void VITA_HideWindow(_THIS, SDL_Window *window) +void VITA_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void VITA_RaiseWindow(_THIS, SDL_Window *window) +void VITA_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void VITA_MaximizeWindow(_THIS, SDL_Window *window) +void VITA_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void VITA_MinimizeWindow(_THIS, SDL_Window *window) +void VITA_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void VITA_RestoreWindow(_THIS, SDL_Window *window) +void VITA_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { } -void VITA_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void VITA_SetWindowGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { } -void VITA_DestroyWindow(_THIS, SDL_Window *window) +void VITA_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data; @@ -346,7 +346,7 @@ void VITA_DestroyWindow(_THIS, SDL_Window *window) Vita_Window = NULL; } -SDL_bool VITA_HasScreenKeyboardSupport(_THIS) +SDL_bool VITA_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { return SDL_TRUE; } @@ -420,7 +420,7 @@ void VITA_ImeEventHandler(void *arg, const SceImeEventData *e) } #endif -void VITA_ShowScreenKeyboard(_THIS, SDL_Window *window) +void VITA_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *videodata = _this->driverdata; SceInt32 res; @@ -481,7 +481,7 @@ void VITA_ShowScreenKeyboard(_THIS, SDL_Window *window) videodata->ime_active = SDL_TRUE; } -void VITA_HideScreenKeyboard(_THIS, SDL_Window *window) +void VITA_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { #ifndef SDL_VIDEO_VITA_PVR SDL_VideoData *videodata = _this->driverdata; @@ -502,7 +502,7 @@ void VITA_HideScreenKeyboard(_THIS, SDL_Window *window) #endif } -SDL_bool VITA_IsScreenKeyboardShown(_THIS, SDL_Window *window) +SDL_bool VITA_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_VITA_PVR SDL_VideoData *videodata = _this->driverdata; @@ -513,7 +513,7 @@ SDL_bool VITA_IsScreenKeyboardShown(_THIS, SDL_Window *window) #endif } -void VITA_PumpEvents(_THIS) +void VITA_PumpEvents(SDL_VideoDevice *_this) { #ifndef SDL_VIDEO_VITA_PVR SDL_VideoData *videodata = _this->driverdata; diff --git a/src/video/vita/SDL_vitavideo.h b/src/video/vita/SDL_vitavideo.h index c436058415..aa4be1ba9e 100644 --- a/src/video/vita/SDL_vitavideo.h +++ b/src/video/vita/SDL_vitavideo.h @@ -58,50 +58,50 @@ extern SDL_Window *Vita_Window; /****************************************************************************/ /* Display and window functions */ -int VITA_VideoInit(_THIS); -void VITA_VideoQuit(_THIS); -int VITA_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -int VITA_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -int VITA_CreateWindow(_THIS, SDL_Window *window); -int VITA_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); -void VITA_SetWindowTitle(_THIS, SDL_Window *window); -int VITA_SetWindowPosition(_THIS, SDL_Window *window); -void VITA_SetWindowSize(_THIS, SDL_Window *window); -void VITA_ShowWindow(_THIS, SDL_Window *window); -void VITA_HideWindow(_THIS, SDL_Window *window); -void VITA_RaiseWindow(_THIS, SDL_Window *window); -void VITA_MaximizeWindow(_THIS, SDL_Window *window); -void VITA_MinimizeWindow(_THIS, SDL_Window *window); -void VITA_RestoreWindow(_THIS, SDL_Window *window); -void VITA_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -void VITA_DestroyWindow(_THIS, SDL_Window *window); +int VITA_VideoInit(SDL_VideoDevice *_this); +void VITA_VideoQuit(SDL_VideoDevice *_this); +int VITA_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +int VITA_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +int VITA_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +int VITA_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data); +void VITA_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +int VITA_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); +void VITA_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +void VITA_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +void VITA_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +void VITA_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); +void VITA_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +void VITA_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +void VITA_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); +void VITA_SetWindowGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); +void VITA_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); #ifdef SDL_VIDEO_DRIVER_VITA #ifdef SDL_VIDEO_VITA_PVR_OGL /* OpenGL functions */ -int VITA_GL_LoadLibrary(_THIS, const char *path); -SDL_GLContext VITA_GL_CreateContext(_THIS, SDL_Window *window); -SDL_FunctionPointer VITA_GL_GetProcAddress(_THIS, const char *proc); +int VITA_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); +SDL_GLContext VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +SDL_FunctionPointer VITA_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); #endif /* OpenGLES functions */ -int VITA_GLES_LoadLibrary(_THIS, const char *path); -SDL_FunctionPointer VITA_GLES_GetProcAddress(_THIS, const char *proc); -void VITA_GLES_UnloadLibrary(_THIS); -SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window); -int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -int VITA_GLES_SetSwapInterval(_THIS, int interval); -int VITA_GLES_GetSwapInterval(_THIS, int *interval); -int VITA_GLES_SwapWindow(_THIS, SDL_Window *window); -int VITA_GLES_DeleteContext(_THIS, SDL_GLContext context); +int VITA_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +SDL_FunctionPointer VITA_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +void VITA_GLES_UnloadLibrary(SDL_VideoDevice *_this); +SDL_GLContext VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +int VITA_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +int VITA_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval); +int VITA_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval); +int VITA_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +int VITA_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); #endif /* VITA on screen keyboard */ -SDL_bool VITA_HasScreenKeyboardSupport(_THIS); -void VITA_ShowScreenKeyboard(_THIS, SDL_Window *window); -void VITA_HideScreenKeyboard(_THIS, SDL_Window *window); -SDL_bool VITA_IsScreenKeyboardShown(_THIS, SDL_Window *window); +SDL_bool VITA_HasScreenKeyboardSupport(SDL_VideoDevice *_this); +void VITA_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); +void VITA_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); +SDL_bool VITA_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); -void VITA_PumpEvents(_THIS); +void VITA_PumpEvents(SDL_VideoDevice *_this); #endif /* SDL_pspvideo_h */ diff --git a/src/video/vivante/SDL_vivanteopengles.c b/src/video/vivante/SDL_vivanteopengles.c index 519403cf0d..fcca0cd8f9 100644 --- a/src/video/vivante/SDL_vivanteopengles.c +++ b/src/video/vivante/SDL_vivanteopengles.c @@ -27,7 +27,7 @@ /* EGL implementation of SDL OpenGL support */ -int VIVANTE_GLES_LoadLibrary(_THIS, const char *path) +int VIVANTE_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { SDL_DisplayData *displaydata = SDL_GetDisplayDriverData(SDL_GetPrimaryDisplay()); diff --git a/src/video/vivante/SDL_vivanteopengles.h b/src/video/vivante/SDL_vivanteopengles.h index 8c3f470e04..ab75465a1d 100644 --- a/src/video/vivante/SDL_vivanteopengles.h +++ b/src/video/vivante/SDL_vivanteopengles.h @@ -36,10 +36,10 @@ #define VIVANTE_GLES_GetSwapInterval SDL_EGL_GetSwapInterval #define VIVANTE_GLES_DeleteContext SDL_EGL_DeleteContext -extern int VIVANTE_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext VIVANTE_GLES_CreateContext(_THIS, SDL_Window *window); -extern int VIVANTE_GLES_SwapWindow(_THIS, SDL_Window *window); -extern int VIVANTE_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); +extern int VIVANTE_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_GLContext VIVANTE_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int VIVANTE_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int VIVANTE_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); #endif /* SDL_VIDEO_DRIVER_VIVANTE && SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/vivante/SDL_vivanteplatform.c b/src/video/vivante/SDL_vivanteplatform.c index b671167664..7d966724ad 100644 --- a/src/video/vivante/SDL_vivanteplatform.c +++ b/src/video/vivante/SDL_vivanteplatform.c @@ -26,21 +26,21 @@ #ifdef VIVANTE_PLATFORM_GENERIC -int VIVANTE_SetupPlatform(_THIS) +int VIVANTE_SetupPlatform(SDL_VideoDevice *_this) { return 0; } -char *VIVANTE_GetDisplayName(_THIS) +char *VIVANTE_GetDisplayName(SDL_VideoDevice *_this) { return NULL; } -void VIVANTE_UpdateDisplayScale(_THIS) +void VIVANTE_UpdateDisplayScale(SDL_VideoDevice *_this) { } -void VIVANTE_CleanupPlatform(_THIS) +void VIVANTE_CleanupPlatform(SDL_VideoDevice *_this) { } diff --git a/src/video/vivante/SDL_vivanteplatform.h b/src/video/vivante/SDL_vivanteplatform.h index 2ffa415b60..a3cf24aa08 100644 --- a/src/video/vivante/SDL_vivanteplatform.h +++ b/src/video/vivante/SDL_vivanteplatform.h @@ -35,10 +35,10 @@ #define VIVANTE_PLATFORM_GENERIC #endif -extern int VIVANTE_SetupPlatform(_THIS); -extern char *VIVANTE_GetDisplayName(_THIS); -extern void VIVANTE_UpdateDisplayScale(_THIS); -extern void VIVANTE_CleanupPlatform(_THIS); +extern int VIVANTE_SetupPlatform(SDL_VideoDevice *_this); +extern char *VIVANTE_GetDisplayName(SDL_VideoDevice *_this); +extern void VIVANTE_UpdateDisplayScale(SDL_VideoDevice *_this); +extern void VIVANTE_CleanupPlatform(SDL_VideoDevice *_this); #endif /* SDL_VIDEO_DRIVER_VIVANTE */ diff --git a/src/video/vivante/SDL_vivantevideo.c b/src/video/vivante/SDL_vivantevideo.c index 7b0e8fb847..bd39038e14 100644 --- a/src/video/vivante/SDL_vivantevideo.c +++ b/src/video/vivante/SDL_vivantevideo.c @@ -117,7 +117,7 @@ VideoBootStrap VIVANTE_bootstrap = { /* SDL Video and Display initialization/handling functions */ /*****************************************************************************/ -static int VIVANTE_AddVideoDisplays(_THIS) +static int VIVANTE_AddVideoDisplays(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; SDL_VideoDisplay display; @@ -164,7 +164,7 @@ static int VIVANTE_AddVideoDisplays(_THIS) return 0; } -int VIVANTE_VideoInit(_THIS) +int VIVANTE_VideoInit(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; @@ -216,7 +216,7 @@ int VIVANTE_VideoInit(_THIS) return 0; } -void VIVANTE_VideoQuit(_THIS) +void VIVANTE_VideoQuit(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; @@ -239,7 +239,7 @@ void VIVANTE_VideoQuit(_THIS) #endif } -int VIVANTE_CreateWindow(_THIS, SDL_Window *window) +int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *videodata = _this->driverdata; SDL_DisplayData *displaydata; @@ -280,7 +280,7 @@ int VIVANTE_CreateWindow(_THIS, SDL_Window *window) return 0; } -void VIVANTE_DestroyWindow(_THIS, SDL_Window *window) +void VIVANTE_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *videodata = _this->driverdata; SDL_WindowData *data; @@ -306,7 +306,7 @@ void VIVANTE_DestroyWindow(_THIS, SDL_Window *window) window->driverdata = NULL; } -void VIVANTE_SetWindowTitle(_THIS, SDL_Window *window) +void VIVANTE_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK SDL_WindowData *data = window->driverdata; @@ -314,18 +314,18 @@ void VIVANTE_SetWindowTitle(_THIS, SDL_Window *window) #endif } -int VIVANTE_SetWindowPosition(_THIS, SDL_Window *window) +int VIVANTE_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { /* FIXME */ return SDL_Unsupported(); } -void VIVANTE_SetWindowSize(_THIS, SDL_Window *window) +void VIVANTE_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { /* FIXME */ } -void VIVANTE_ShowWindow(_THIS, SDL_Window *window) +void VIVANTE_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK SDL_WindowData *data = window->driverdata; @@ -335,7 +335,7 @@ void VIVANTE_ShowWindow(_THIS, SDL_Window *window) SDL_SetKeyboardFocus(window); } -void VIVANTE_HideWindow(_THIS, SDL_Window *window) +void VIVANTE_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK SDL_WindowData *data = window->driverdata; @@ -346,7 +346,7 @@ void VIVANTE_HideWindow(_THIS, SDL_Window *window) /*****************************************************************************/ /* SDL Window Manager function */ /*****************************************************************************/ -int VIVANTE_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info) +int VIVANTE_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info) { SDL_WindowData *data = window->driverdata; SDL_DisplayData *displaydata = SDL_GetDisplayDriverData(0); @@ -360,7 +360,7 @@ int VIVANTE_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *inf /*****************************************************************************/ /* SDL event functions */ /*****************************************************************************/ -void VIVANTE_PumpEvents(_THIS) +void VIVANTE_PumpEvents(SDL_VideoDevice *_this) { #ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Poll(); diff --git a/src/video/vivante/SDL_vivantevideo.h b/src/video/vivante/SDL_vivantevideo.h index df9c758097..290851fc8b 100644 --- a/src/video/vivante/SDL_vivantevideo.h +++ b/src/video/vivante/SDL_vivantevideo.h @@ -68,22 +68,22 @@ struct SDL_WindowData /****************************************************************************/ /* Display and window functions */ -int VIVANTE_VideoInit(_THIS); -void VIVANTE_VideoQuit(_THIS); -int VIVANTE_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -int VIVANTE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -int VIVANTE_CreateWindow(_THIS, SDL_Window *window); -void VIVANTE_SetWindowTitle(_THIS, SDL_Window *window); -int VIVANTE_SetWindowPosition(_THIS, SDL_Window *window); -void VIVANTE_SetWindowSize(_THIS, SDL_Window *window); -void VIVANTE_ShowWindow(_THIS, SDL_Window *window); -void VIVANTE_HideWindow(_THIS, SDL_Window *window); -void VIVANTE_DestroyWindow(_THIS, SDL_Window *window); +int VIVANTE_VideoInit(SDL_VideoDevice *_this); +void VIVANTE_VideoQuit(SDL_VideoDevice *_this); +int VIVANTE_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +int VIVANTE_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +void VIVANTE_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +int VIVANTE_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); +void VIVANTE_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +void VIVANTE_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +void VIVANTE_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +void VIVANTE_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); /* Window manager function */ -int VIVANTE_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); +int VIVANTE_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info); /* Event functions */ -void VIVANTE_PumpEvents(_THIS); +void VIVANTE_PumpEvents(SDL_VideoDevice *_this); #endif /* SDL_vivantevideo_h_ */ diff --git a/src/video/vivante/SDL_vivantevulkan.c b/src/video/vivante/SDL_vivantevulkan.c index d9267ae1bd..a84d893da5 100644 --- a/src/video/vivante/SDL_vivantevulkan.c +++ b/src/video/vivante/SDL_vivantevulkan.c @@ -33,7 +33,7 @@ #include "SDL_vivantevulkan.h" #include -int VIVANTE_Vulkan_LoadLibrary(_THIS, const char *path) +int VIVANTE_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path) { VkExtensionProperties *extensions = NULL; Uint32 i, extensionCount = 0; @@ -108,7 +108,7 @@ fail: return -1; } -void VIVANTE_Vulkan_UnloadLibrary(_THIS) +void VIVANTE_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) { if (_this->vulkan_config.loader_handle) { SDL_UnloadObject(_this->vulkan_config.loader_handle); @@ -116,7 +116,7 @@ void VIVANTE_Vulkan_UnloadLibrary(_THIS) } } -SDL_bool VIVANTE_Vulkan_GetInstanceExtensions(_THIS, +SDL_bool VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names) { @@ -132,7 +132,7 @@ SDL_bool VIVANTE_Vulkan_GetInstanceExtensions(_THIS, extensionsForVivante); } -SDL_bool VIVANTE_Vulkan_CreateSurface(_THIS, +SDL_bool VIVANTE_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface) diff --git a/src/video/vivante/SDL_vivantevulkan.h b/src/video/vivante/SDL_vivantevulkan.h index 0d73090fdf..dc77bbf357 100644 --- a/src/video/vivante/SDL_vivantevulkan.h +++ b/src/video/vivante/SDL_vivantevulkan.h @@ -33,12 +33,12 @@ #if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_VIVANTE) -int VIVANTE_Vulkan_LoadLibrary(_THIS, const char *path); -void VIVANTE_Vulkan_UnloadLibrary(_THIS); -SDL_bool VIVANTE_Vulkan_GetInstanceExtensions(_THIS, +int VIVANTE_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); +void VIVANTE_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); +SDL_bool VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names); -SDL_bool VIVANTE_Vulkan_CreateSurface(_THIS, +SDL_bool VIVANTE_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); diff --git a/src/video/wayland/SDL_waylandclipboard.c b/src/video/wayland/SDL_waylandclipboard.c index f24290feb9..dd9572f01d 100644 --- a/src/video/wayland/SDL_waylandclipboard.c +++ b/src/video/wayland/SDL_waylandclipboard.c @@ -26,7 +26,7 @@ #include "SDL_waylandevents_c.h" #include "SDL_waylandclipboard.h" -int Wayland_SetClipboardText(_THIS, const char *text) +int Wayland_SetClipboardText(SDL_VideoDevice *_this, const char *text) { SDL_VideoData *video_data = NULL; SDL_WaylandDataDevice *data_device = NULL; @@ -57,7 +57,7 @@ int Wayland_SetClipboardText(_THIS, const char *text) return status; } -int Wayland_SetPrimarySelectionText(_THIS, const char *text) +int Wayland_SetPrimarySelectionText(SDL_VideoDevice *_this, const char *text) { SDL_VideoData *video_data = NULL; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; @@ -89,7 +89,7 @@ int Wayland_SetPrimarySelectionText(_THIS, const char *text) return status; } -char *Wayland_GetClipboardText(_THIS) +char *Wayland_GetClipboardText(SDL_VideoDevice *_this) { SDL_VideoData *video_data = NULL; SDL_WaylandDataDevice *data_device = NULL; @@ -123,7 +123,7 @@ char *Wayland_GetClipboardText(_THIS) return text; } -char *Wayland_GetPrimarySelectionText(_THIS) +char *Wayland_GetPrimarySelectionText(SDL_VideoDevice *_this) { SDL_VideoData *video_data = NULL; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; @@ -157,7 +157,7 @@ char *Wayland_GetPrimarySelectionText(_THIS) return text; } -SDL_bool Wayland_HasClipboardText(_THIS) +SDL_bool Wayland_HasClipboardText(SDL_VideoDevice *_this) { SDL_VideoData *video_data = NULL; SDL_WaylandDataDevice *data_device = NULL; @@ -177,7 +177,7 @@ SDL_bool Wayland_HasClipboardText(_THIS) return result; } -SDL_bool Wayland_HasPrimarySelectionText(_THIS) +SDL_bool Wayland_HasPrimarySelectionText(SDL_VideoDevice *_this) { SDL_VideoData *video_data = NULL; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; diff --git a/src/video/wayland/SDL_waylandclipboard.h b/src/video/wayland/SDL_waylandclipboard.h index b7b33631ef..ba79aeedfc 100644 --- a/src/video/wayland/SDL_waylandclipboard.h +++ b/src/video/wayland/SDL_waylandclipboard.h @@ -23,11 +23,11 @@ #ifndef SDL_waylandclipboard_h_ #define SDL_waylandclipboard_h_ -extern int Wayland_SetClipboardText(_THIS, const char *text); -extern char *Wayland_GetClipboardText(_THIS); -extern SDL_bool Wayland_HasClipboardText(_THIS); -extern int Wayland_SetPrimarySelectionText(_THIS, const char *text); -extern char *Wayland_GetPrimarySelectionText(_THIS); -extern SDL_bool Wayland_HasPrimarySelectionText(_THIS); +extern int Wayland_SetClipboardText(SDL_VideoDevice *_this, const char *text); +extern char *Wayland_GetClipboardText(SDL_VideoDevice *_this); +extern SDL_bool Wayland_HasClipboardText(SDL_VideoDevice *_this); +extern int Wayland_SetPrimarySelectionText(SDL_VideoDevice *_this, const char *text); +extern char *Wayland_GetPrimarySelectionText(SDL_VideoDevice *_this); +extern SDL_bool Wayland_HasPrimarySelectionText(SDL_VideoDevice *_this); #endif /* SDL_waylandclipboard_h_ */ diff --git a/src/video/wayland/SDL_waylanddatamanager.h b/src/video/wayland/SDL_waylanddatamanager.h index a81f67e438..eaee423b96 100644 --- a/src/video/wayland/SDL_waylanddatamanager.h +++ b/src/video/wayland/SDL_waylanddatamanager.h @@ -95,8 +95,8 @@ typedef struct extern const char *Wayland_convert_mime_type(const char *mime_type); /* Wayland Data Source / Primary Selection Source - (Sending) */ -extern SDL_WaylandDataSource *Wayland_data_source_create(_THIS); -extern SDL_WaylandPrimarySelectionSource *Wayland_primary_selection_source_create(_THIS); +extern SDL_WaylandDataSource *Wayland_data_source_create(SDL_VideoDevice *_this); +extern SDL_WaylandPrimarySelectionSource *Wayland_primary_selection_source_create(SDL_VideoDevice *_this); extern ssize_t Wayland_data_source_send(SDL_WaylandDataSource *source, const char *mime_type, int fd); extern ssize_t Wayland_primary_selection_source_send(SDL_WaylandPrimarySelectionSource *source, diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 3803a97c10..c9ed171e50 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -349,7 +349,7 @@ static SDL_bool keyboard_repeat_key_is_set(SDL_WaylandKeyboardRepeat *repeat_inf return repeat_info->is_initialized && repeat_info->is_key_down && key == repeat_info->key; } -void Wayland_SendWakeupEvent(_THIS, SDL_Window *window) +void Wayland_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *d = _this->driverdata; @@ -376,7 +376,7 @@ static int dispatch_queued_events(SDL_VideoData *viddata) return ret >= 0 ? 1 : ret; } -int Wayland_WaitEventTimeout(_THIS, Sint64 timeoutNS) +int Wayland_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) { SDL_VideoData *d = _this->driverdata; struct SDL_WaylandInput *input = d->input; @@ -451,7 +451,7 @@ int Wayland_WaitEventTimeout(_THIS, Sint64 timeoutNS) } } -void Wayland_PumpEvents(_THIS) +void Wayland_PumpEvents(SDL_VideoDevice *_this) { SDL_VideoData *d = _this->driverdata; struct SDL_WaylandInput *input = d->input; @@ -1715,7 +1715,7 @@ static const struct zwp_primary_selection_source_v1_listener primary_selection_s primary_selection_source_cancelled, }; -SDL_WaylandDataSource *Wayland_data_source_create(_THIS) +SDL_WaylandDataSource *Wayland_data_source_create(SDL_VideoDevice *_this) { SDL_WaylandDataSource *data_source = NULL; SDL_VideoData *driver_data = NULL; @@ -1750,7 +1750,7 @@ SDL_WaylandDataSource *Wayland_data_source_create(_THIS) return data_source; } -SDL_WaylandPrimarySelectionSource *Wayland_primary_selection_source_create(_THIS) +SDL_WaylandPrimarySelectionSource *Wayland_primary_selection_source_create(SDL_VideoDevice *_this) { SDL_WaylandPrimarySelectionSource *primary_selection_source = NULL; SDL_VideoData *driver_data = NULL; diff --git a/src/video/wayland/SDL_waylandevents_c.h b/src/video/wayland/SDL_waylandevents_c.h index 70b57889ca..4c36ab8bff 100644 --- a/src/video/wayland/SDL_waylandevents_c.h +++ b/src/video/wayland/SDL_waylandevents_c.h @@ -173,9 +173,9 @@ struct SDL_WaylandInput extern Uint64 Wayland_GetTouchTimestamp(struct SDL_WaylandInput *input, Uint32 wl_timestamp_ms); -extern void Wayland_PumpEvents(_THIS); -extern void Wayland_SendWakeupEvent(_THIS, SDL_Window *window); -extern int Wayland_WaitEventTimeout(_THIS, Sint64 timeoutNS); +extern void Wayland_PumpEvents(SDL_VideoDevice *_this); +extern void Wayland_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window); +extern int Wayland_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS); extern void Wayland_add_data_device_manager(SDL_VideoData *d, uint32_t id, uint32_t version); extern void Wayland_add_primary_selection_device_manager(SDL_VideoData *d, uint32_t id, uint32_t version); diff --git a/src/video/wayland/SDL_waylandkeyboard.c b/src/video/wayland/SDL_waylandkeyboard.c index 04aa1c824b..3aa52f38f5 100644 --- a/src/video/wayland/SDL_waylandkeyboard.c +++ b/src/video/wayland/SDL_waylandkeyboard.c @@ -28,7 +28,7 @@ #include "../../events/SDL_keyboard_c.h" #include "text-input-unstable-v3-client-protocol.h" -int Wayland_InitKeyboard(_THIS) +int Wayland_InitKeyboard(SDL_VideoDevice *_this) { #ifdef SDL_USE_IME SDL_VideoData *driverdata = _this->driverdata; @@ -41,7 +41,7 @@ int Wayland_InitKeyboard(_THIS) return 0; } -void Wayland_QuitKeyboard(_THIS) +void Wayland_QuitKeyboard(SDL_VideoDevice *_this) { #ifdef SDL_USE_IME SDL_VideoData *driverdata = _this->driverdata; @@ -51,7 +51,7 @@ void Wayland_QuitKeyboard(_THIS) #endif } -void Wayland_StartTextInput(_THIS) +void Wayland_StartTextInput(SDL_VideoDevice *_this) { SDL_VideoData *driverdata = _this->driverdata; @@ -92,7 +92,7 @@ void Wayland_StartTextInput(_THIS) } } -void Wayland_StopTextInput(_THIS) +void Wayland_StopTextInput(SDL_VideoDevice *_this) { SDL_VideoData *driverdata = _this->driverdata; @@ -112,7 +112,7 @@ void Wayland_StopTextInput(_THIS) #endif } -int Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect) +int Wayland_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) { SDL_VideoData *driverdata = _this->driverdata; if (driverdata->text_input_manager) { @@ -138,7 +138,7 @@ int Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect) return 0; } -SDL_bool Wayland_HasScreenKeyboardSupport(_THIS) +SDL_bool Wayland_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { /* In reality we just want to return true when the screen keyboard is the * _only_ way to get text input. So, in addition to checking for the text diff --git a/src/video/wayland/SDL_waylandkeyboard.h b/src/video/wayland/SDL_waylandkeyboard.h index 0ff6802445..e8c3ded8ab 100644 --- a/src/video/wayland/SDL_waylandkeyboard.h +++ b/src/video/wayland/SDL_waylandkeyboard.h @@ -31,11 +31,11 @@ typedef struct SDL_WaylandTextInput SDL_bool is_enabled; } SDL_WaylandTextInput; -extern int Wayland_InitKeyboard(_THIS); -extern void Wayland_QuitKeyboard(_THIS); -extern void Wayland_StartTextInput(_THIS); -extern void Wayland_StopTextInput(_THIS); -extern int Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect); -extern SDL_bool Wayland_HasScreenKeyboardSupport(_THIS); +extern int Wayland_InitKeyboard(SDL_VideoDevice *_this); +extern void Wayland_QuitKeyboard(SDL_VideoDevice *_this); +extern void Wayland_StartTextInput(SDL_VideoDevice *_this); +extern void Wayland_StopTextInput(SDL_VideoDevice *_this); +extern int Wayland_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); +extern SDL_bool Wayland_HasScreenKeyboardSupport(SDL_VideoDevice *_this); #endif /* SDL_waylandkeyboard_h_ */ diff --git a/src/video/wayland/SDL_waylandopengles.c b/src/video/wayland/SDL_waylandopengles.c index 4496690704..f67d952585 100644 --- a/src/video/wayland/SDL_waylandopengles.c +++ b/src/video/wayland/SDL_waylandopengles.c @@ -34,7 +34,7 @@ /* EGL implementation of SDL OpenGL ES support */ -int Wayland_GLES_LoadLibrary(_THIS, const char *path) +int Wayland_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { int ret; SDL_VideoData *data = _this->driverdata; @@ -47,7 +47,7 @@ int Wayland_GLES_LoadLibrary(_THIS, const char *path) return ret; } -SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window *window) +SDL_GLContext Wayland_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_GLContext context; context = SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); @@ -70,7 +70,7 @@ SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window *window) libretro, Wayland, probably others...it feels like we're eventually going to have to give in with a future SDL API revision, since we can bend the other APIs to this style, but this style is much harder to bend the other way. :/ */ -int Wayland_GLES_SetSwapInterval(_THIS, int interval) +int Wayland_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval) { if (!_this->egl_data) { return SDL_SetError("EGL not initialized"); @@ -92,7 +92,7 @@ int Wayland_GLES_SetSwapInterval(_THIS, int interval) return 0; } -int Wayland_GLES_GetSwapInterval(_THIS, int *interval) +int Wayland_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval) { if (!_this->egl_data) { return SDL_SetError("EGL not initialized"); @@ -102,7 +102,7 @@ int Wayland_GLES_GetSwapInterval(_THIS, int *interval) return 0; } -int Wayland_GLES_SwapWindow(_THIS, SDL_Window *window) +int Wayland_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; const int swap_interval = _this->egl_data->egl_swapinterval; @@ -171,7 +171,7 @@ int Wayland_GLES_SwapWindow(_THIS, SDL_Window *window) return 0; } -int Wayland_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int Wayland_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { int ret; @@ -188,14 +188,14 @@ int Wayland_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) return ret; } -int Wayland_GLES_DeleteContext(_THIS, SDL_GLContext context) +int Wayland_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { SDL_EGL_DeleteContext(_this, context); WAYLAND_wl_display_flush(_this->driverdata->display); return 0; } -EGLSurface Wayland_GLES_GetEGLSurface(_THIS, SDL_Window *window) +EGLSurface Wayland_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *windowdata = window->driverdata; diff --git a/src/video/wayland/SDL_waylandopengles.h b/src/video/wayland/SDL_waylandopengles.h index 39472b06c1..98968863c9 100644 --- a/src/video/wayland/SDL_waylandopengles.h +++ b/src/video/wayland/SDL_waylandopengles.h @@ -36,13 +36,13 @@ typedef struct SDL_PrivateGLESData #define Wayland_GLES_GetProcAddress SDL_EGL_GetProcAddressInternal #define Wayland_GLES_UnloadLibrary SDL_EGL_UnloadLibrary -extern int Wayland_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window *window); -extern int Wayland_GLES_SetSwapInterval(_THIS, int interval); -extern int Wayland_GLES_GetSwapInterval(_THIS, int *interval); -extern int Wayland_GLES_SwapWindow(_THIS, SDL_Window *window); -extern int Wayland_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -extern int Wayland_GLES_DeleteContext(_THIS, SDL_GLContext context); -extern SDL_EGLSurface Wayland_GLES_GetEGLSurface(_THIS, SDL_Window *window); +extern int Wayland_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_GLContext Wayland_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int Wayland_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval); +extern int Wayland_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval); +extern int Wayland_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int Wayland_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +extern int Wayland_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); +extern SDL_EGLSurface Wayland_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_waylandopengles_h_ */ diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 12846b1b94..65d674003c 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -77,10 +77,10 @@ static void display_handle_done(void *data, struct wl_output *output); /* Initialization/Query functions */ -static int Wayland_VideoInit(_THIS); +static int Wayland_VideoInit(SDL_VideoDevice *_this); -static int Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); -static void Wayland_VideoQuit(_THIS); +static int Wayland_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); +static void Wayland_VideoQuit(SDL_VideoDevice *_this); /* Find out what class name we should use * Based on src/video/x11/SDL_x11video.c */ @@ -918,7 +918,7 @@ SDL_bool Wayland_LoadLibdecor(SDL_VideoData *data, SDL_bool ignore_xdg) return SDL_FALSE; } -int Wayland_VideoInit(_THIS) +int Wayland_VideoInit(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; @@ -957,7 +957,7 @@ int Wayland_VideoInit(_THIS) return 0; } -static int Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) +static int Wayland_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { SDL_DisplayData *driverdata = display->driverdata; rect->x = driverdata->x; @@ -978,7 +978,7 @@ static int Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect * return 0; } -static void Wayland_VideoCleanup(_THIS) +static void Wayland_VideoCleanup(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; int i; @@ -1095,7 +1095,7 @@ static void Wayland_VideoCleanup(_THIS) } } -SDL_bool Wayland_VideoReconnect(_THIS) +SDL_bool Wayland_VideoReconnect(SDL_VideoDevice *_this) { #if 0 /* TODO RECONNECT: Uncomment all when https://invent.kde.org/plasma/kwin/-/wikis/Restarting is completed */ SDL_VideoData *data = _this->driverdata; @@ -1142,7 +1142,7 @@ SDL_bool Wayland_VideoReconnect(_THIS) #endif /* 0 */ } -void Wayland_VideoQuit(_THIS) +void Wayland_VideoQuit(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; diff --git a/src/video/wayland/SDL_waylandvideo.h b/src/video/wayland/SDL_waylandvideo.h index b6b94bc9cd..eb4636550d 100644 --- a/src/video/wayland/SDL_waylandvideo.h +++ b/src/video/wayland/SDL_waylandvideo.h @@ -123,6 +123,6 @@ extern SDL_bool SDL_WAYLAND_own_output(struct wl_output *output); extern SDL_bool Wayland_LoadLibdecor(SDL_VideoData *data, SDL_bool ignore_xdg); -extern SDL_bool Wayland_VideoReconnect(_THIS); +extern SDL_bool Wayland_VideoReconnect(SDL_VideoDevice *_this); #endif /* SDL_waylandvideo_h_ */ diff --git a/src/video/wayland/SDL_waylandvulkan.c b/src/video/wayland/SDL_waylandvulkan.c index e01dd09bb8..c886695cf4 100644 --- a/src/video/wayland/SDL_waylandvulkan.c +++ b/src/video/wayland/SDL_waylandvulkan.c @@ -41,7 +41,7 @@ #define DEFAULT_VULKAN "libvulkan.so.1" #endif -int Wayland_Vulkan_LoadLibrary(_THIS, const char *path) +int Wayland_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path) { VkExtensionProperties *extensions = NULL; Uint32 i, extensionCount = 0; @@ -107,7 +107,7 @@ fail: return -1; } -void Wayland_Vulkan_UnloadLibrary(_THIS) +void Wayland_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) { if (_this->vulkan_config.loader_handle) { SDL_UnloadObject(_this->vulkan_config.loader_handle); @@ -115,7 +115,7 @@ void Wayland_Vulkan_UnloadLibrary(_THIS) } } -SDL_bool Wayland_Vulkan_GetInstanceExtensions(_THIS, +SDL_bool Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names) { @@ -131,7 +131,7 @@ SDL_bool Wayland_Vulkan_GetInstanceExtensions(_THIS, extensionsForWayland); } -SDL_bool Wayland_Vulkan_CreateSurface(_THIS, +SDL_bool Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface) diff --git a/src/video/wayland/SDL_waylandvulkan.h b/src/video/wayland/SDL_waylandvulkan.h index 146b39d3ee..618f936c00 100644 --- a/src/video/wayland/SDL_waylandvulkan.h +++ b/src/video/wayland/SDL_waylandvulkan.h @@ -34,12 +34,12 @@ #if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_WAYLAND) -int Wayland_Vulkan_LoadLibrary(_THIS, const char *path); -void Wayland_Vulkan_UnloadLibrary(_THIS); -SDL_bool Wayland_Vulkan_GetInstanceExtensions(_THIS, +int Wayland_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); +void Wayland_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); +SDL_bool Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names); -SDL_bool Wayland_Vulkan_CreateSurface(_THIS, +SDL_bool Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index b188da1305..a9bfc47be3 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -1201,7 +1201,7 @@ static void SetKeyboardFocus(SDL_Window *window) SDL_SetKeyboardFocus(window); } -int Wayland_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) +int Wayland_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info) { SDL_VideoData *viddata = _this->driverdata; SDL_WindowData *data = window->driverdata; @@ -1237,7 +1237,7 @@ int Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) return 0; /* just succeed, the real work is done elsewhere. */ } -int Wayland_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window) +int Wayland_SetWindowModalFor(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window) { SDL_VideoData *viddata = _this->driverdata; SDL_WindowData *modal_data = modal_window->driverdata; @@ -1276,7 +1276,7 @@ int Wayland_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *paren return 0; } -void Wayland_ShowWindow(_THIS, SDL_Window *window) +void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *c = _this->driverdata; SDL_WindowData *data = window->driverdata; @@ -1490,7 +1490,7 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window) WAYLAND_wl_display_roundtrip(c->display); } -static void Wayland_ReleasePopup(_THIS, SDL_Window *popup) +static void Wayland_ReleasePopup(SDL_VideoDevice *_this, SDL_Window *popup) { SDL_WindowData *popupdata; @@ -1527,7 +1527,7 @@ static void Wayland_ReleasePopup(_THIS, SDL_Window *popup) popupdata->shell_surface.xdg.roleobj.popup.positioner = NULL; } -void Wayland_HideWindow(_THIS, SDL_Window *window) +void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *data = _this->driverdata; SDL_WindowData *wind = window->driverdata; @@ -1643,7 +1643,7 @@ static void Wayland_activate_window(SDL_VideoData *data, SDL_WindowData *wind, } } -void Wayland_RaiseWindow(_THIS, SDL_Window *window) +void Wayland_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; struct SDL_WaylandInput * input = _this->driverdata->input; @@ -1667,7 +1667,7 @@ void Wayland_RaiseWindow(_THIS, SDL_Window *window) seat); } -int Wayland_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) +int Wayland_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation) { Wayland_activate_window(_this->driverdata, window->driverdata, @@ -1761,7 +1761,7 @@ static void QtExtendedSurface_Unsubscribe(struct qt_extended_surface *surface, c } #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ -void Wayland_SetWindowFullscreen(_THIS, SDL_Window *window, +void Wayland_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { SDL_WindowData *wind = window->driverdata; @@ -1806,7 +1806,7 @@ void Wayland_SetWindowFullscreen(_THIS, SDL_Window *window, wind->in_fullscreen_transition = SDL_FALSE; } -void Wayland_RestoreWindow(_THIS, SDL_Window *window) +void Wayland_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *viddata = _this->driverdata; SDL_WindowData *wind = window->driverdata; @@ -1839,7 +1839,7 @@ void Wayland_RestoreWindow(_THIS, SDL_Window *window) WAYLAND_wl_display_roundtrip(viddata->display); } -void Wayland_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) +void Wayland_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered) { SDL_WindowData *wind = window->driverdata; const SDL_VideoData *viddata = (const SDL_VideoData *)_this->driverdata; @@ -1861,7 +1861,7 @@ void Wayland_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) } } -void Wayland_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) +void Wayland_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable) { #ifdef HAVE_LIBDECOR_H const SDL_WindowData *wind = window->driverdata; @@ -1887,7 +1887,7 @@ void Wayland_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) CommitLibdecorFrame(window); } -void Wayland_MaximizeWindow(_THIS, SDL_Window *window) +void Wayland_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *viddata = _this->driverdata; SDL_WindowData *wind = window->driverdata; @@ -1927,7 +1927,7 @@ void Wayland_MaximizeWindow(_THIS, SDL_Window *window) } } -void Wayland_MinimizeWindow(_THIS, SDL_Window *window) +void Wayland_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *viddata = _this->driverdata; SDL_WindowData *wind = window->driverdata; @@ -1956,7 +1956,7 @@ void Wayland_MinimizeWindow(_THIS, SDL_Window *window) } } -void Wayland_SetWindowMouseRect(_THIS, SDL_Window *window) +void Wayland_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *data = _this->driverdata; @@ -1975,7 +1975,7 @@ void Wayland_SetWindowMouseRect(_THIS, SDL_Window *window) } } -void Wayland_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void Wayland_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { SDL_VideoData *data = _this->driverdata; @@ -1986,7 +1986,7 @@ void Wayland_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) } } -void Wayland_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void Wayland_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { SDL_VideoData *data = _this->driverdata; @@ -1997,7 +1997,7 @@ void Wayland_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) } } -int Wayland_CreateWindow(_THIS, SDL_Window *window) +int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data; SDL_VideoData *c; @@ -2144,19 +2144,19 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) return 0; } -void Wayland_SetWindowMinimumSize(_THIS, SDL_Window *window) +void Wayland_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window) { /* Will be committed when Wayland_SetWindowSize() is called by the video core. */ SetMinMaxDimensions(window); } -void Wayland_SetWindowMaximumSize(_THIS, SDL_Window *window) +void Wayland_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window) { /* Will be committed when Wayland_SetWindowSize() is called by the video core. */ SetMinMaxDimensions(window); } -int Wayland_SetWindowPosition(_THIS, SDL_Window *window) +int Wayland_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; @@ -2173,7 +2173,7 @@ int Wayland_SetWindowPosition(_THIS, SDL_Window *window) return SDL_SetError("wayland cannot position non-popup windows"); } -void Wayland_SetWindowSize(_THIS, SDL_Window *window) +void Wayland_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; @@ -2199,7 +2199,7 @@ void Wayland_SetWindowSize(_THIS, SDL_Window *window) CommitLibdecorFrame(window); } -void Wayland_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) +void Wayland_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h) { SDL_WindowData *data; if (window->driverdata) { @@ -2209,7 +2209,7 @@ void Wayland_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) } } -void Wayland_SetWindowTitle(_THIS, SDL_Window *window) +void Wayland_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; SDL_VideoData *viddata = _this->driverdata; @@ -2237,7 +2237,7 @@ void Wayland_SetWindowTitle(_THIS, SDL_Window *window) WAYLAND_wl_display_flush(viddata->display); } -int Wayland_SuspendScreenSaver(_THIS) +int Wayland_SuspendScreenSaver(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; @@ -2276,7 +2276,7 @@ int Wayland_SuspendScreenSaver(_THIS) return 0; } -void Wayland_DestroyWindow(_THIS, SDL_Window *window) +void Wayland_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *data = _this->driverdata; SDL_WindowData *wind = window->driverdata; diff --git a/src/video/wayland/SDL_waylandwindow.h b/src/video/wayland/SDL_waylandwindow.h index 570fb2d19e..7861cb5fa6 100644 --- a/src/video/wayland/SDL_waylandwindow.h +++ b/src/video/wayland/SDL_waylandwindow.h @@ -126,33 +126,33 @@ struct SDL_WindowData SDL_bool fullscreen_was_positioned; }; -extern void Wayland_ShowWindow(_THIS, SDL_Window *window); -extern void Wayland_HideWindow(_THIS, SDL_Window *window); -extern void Wayland_RaiseWindow(_THIS, SDL_Window *window); -extern void Wayland_SetWindowFullscreen(_THIS, SDL_Window *window, +extern void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen); -extern void Wayland_MaximizeWindow(_THIS, SDL_Window *window); -extern void Wayland_MinimizeWindow(_THIS, SDL_Window *window); -extern void Wayland_SetWindowMouseRect(_THIS, SDL_Window *window); -extern void Wayland_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -extern void Wayland_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -extern void Wayland_RestoreWindow(_THIS, SDL_Window *window); -extern void Wayland_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered); -extern void Wayland_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable); -extern int Wayland_CreateWindow(_THIS, SDL_Window *window); -extern int Wayland_SetWindowPosition(_THIS, SDL_Window *window); -extern void Wayland_SetWindowSize(_THIS, SDL_Window *window); -extern void Wayland_SetWindowMinimumSize(_THIS, SDL_Window *window); -extern void Wayland_SetWindowMaximumSize(_THIS, SDL_Window *window); -extern void Wayland_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h); -extern int Wayland_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window); -extern void Wayland_SetWindowTitle(_THIS, SDL_Window *window); -extern void Wayland_DestroyWindow(_THIS, SDL_Window *window); -extern int Wayland_SuspendScreenSaver(_THIS); +extern void Wayland_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); +extern void Wayland_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); +extern void Wayland_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered); +extern void Wayland_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable); +extern int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int Wayland_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h); +extern int Wayland_SetWindowModalFor(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window); +extern void Wayland_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +extern void Wayland_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int Wayland_SuspendScreenSaver(SDL_VideoDevice *_this); -extern int Wayland_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info); +extern int Wayland_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info); extern int Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled); -extern int Wayland_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation); +extern int Wayland_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation); #endif /* SDL_waylandwindow_h_ */ diff --git a/src/video/windows/SDL_windowsclipboard.c b/src/video/windows/SDL_windowsclipboard.c index d0d787b522..f6869b79e4 100644 --- a/src/video/windows/SDL_windowsclipboard.c +++ b/src/video/windows/SDL_windowsclipboard.c @@ -33,7 +33,7 @@ #endif /* Get any application owned window handle for clipboard association */ -static HWND GetWindowHandle(_THIS) +static HWND GetWindowHandle(SDL_VideoDevice *_this) { SDL_Window *window; @@ -44,7 +44,7 @@ static HWND GetWindowHandle(_THIS) return NULL; } -int WIN_SetClipboardText(_THIS, const char *text) +int WIN_SetClipboardText(SDL_VideoDevice *_this, const char *text) { SDL_VideoData *data = _this->driverdata; int result = 0; @@ -101,7 +101,7 @@ int WIN_SetClipboardText(_THIS, const char *text) } char * -WIN_GetClipboardText(_THIS) +WIN_GetClipboardText(SDL_VideoDevice *_this) { char *text; @@ -128,7 +128,7 @@ WIN_GetClipboardText(_THIS) } SDL_bool -WIN_HasClipboardText(_THIS) +WIN_HasClipboardText(SDL_VideoDevice *_this) { SDL_bool result = SDL_FALSE; char *text = WIN_GetClipboardText(_this); diff --git a/src/video/windows/SDL_windowsclipboard.h b/src/video/windows/SDL_windowsclipboard.h index abe5747be7..fd1cc52290 100644 --- a/src/video/windows/SDL_windowsclipboard.h +++ b/src/video/windows/SDL_windowsclipboard.h @@ -26,9 +26,9 @@ /* Forward declaration */ struct SDL_VideoData; -extern int WIN_SetClipboardText(_THIS, const char *text); -extern char *WIN_GetClipboardText(_THIS); -extern SDL_bool WIN_HasClipboardText(_THIS); +extern int WIN_SetClipboardText(SDL_VideoDevice *_this, const char *text); +extern char *WIN_GetClipboardText(SDL_VideoDevice *_this); +extern SDL_bool WIN_HasClipboardText(SDL_VideoDevice *_this); extern void WIN_CheckClipboardUpdate(struct SDL_VideoData *data); #endif /* SDL_windowsclipboard_h_ */ diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index a46e400015..1bbdbe9e86 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -1838,7 +1838,7 @@ void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata) g_WindowsMessageHookData = userdata; } -int WIN_WaitEventTimeout(_THIS, Sint64 timeoutNS) +int WIN_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) { MSG msg; if (g_WindowsEnableMessageLoop) { @@ -1873,13 +1873,13 @@ int WIN_WaitEventTimeout(_THIS, Sint64 timeoutNS) } } -void WIN_SendWakeupEvent(_THIS, SDL_Window *window) +void WIN_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; PostMessage(data->hwnd, data->videodata->_SDL_WAKEUP, 0, 0); } -void WIN_PumpEvents(_THIS) +void WIN_PumpEvents(SDL_VideoDevice *_this) { MSG msg; DWORD end_ticks = GetTickCount() + 1; diff --git a/src/video/windows/SDL_windowsevents.h b/src/video/windows/SDL_windowsevents.h index 135e61b2ce..12475a3ee8 100644 --- a/src/video/windows/SDL_windowsevents.h +++ b/src/video/windows/SDL_windowsevents.h @@ -30,8 +30,8 @@ extern HINSTANCE SDL_Instance; extern LRESULT CALLBACK WIN_KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam); extern LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); -extern void WIN_PumpEvents(_THIS); -extern void WIN_SendWakeupEvent(_THIS, SDL_Window *window); -extern int WIN_WaitEventTimeout(_THIS, Sint64 timeoutNS); +extern void WIN_PumpEvents(SDL_VideoDevice *_this); +extern void WIN_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS); #endif /* SDL_windowsevents_h_ */ diff --git a/src/video/windows/SDL_windowsframebuffer.c b/src/video/windows/SDL_windowsframebuffer.c index fe4d360593..212f6bde01 100644 --- a/src/video/windows/SDL_windowsframebuffer.c +++ b/src/video/windows/SDL_windowsframebuffer.c @@ -24,7 +24,7 @@ #include "SDL_windowsvideo.h" -int WIN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) +int WIN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_WindowData *data = window->driverdata; SDL_bool isstack; @@ -98,7 +98,7 @@ int WIN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void return 0; } -int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) +int WIN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { SDL_WindowData *data = window->driverdata; int i; @@ -110,7 +110,7 @@ int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects return 0; } -void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +void WIN_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; diff --git a/src/video/windows/SDL_windowsframebuffer.h b/src/video/windows/SDL_windowsframebuffer.h index a150d1999d..e9ed44100b 100644 --- a/src/video/windows/SDL_windowsframebuffer.h +++ b/src/video/windows/SDL_windowsframebuffer.h @@ -20,6 +20,6 @@ */ #include "SDL_internal.h" -extern int WIN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); -extern int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); -extern void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window *window); +extern int WIN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int WIN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void WIN_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 65b1e07426..18547f3130 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -49,7 +49,7 @@ static SDL_bool IME_IsTextInputShown(SDL_VideoData *videodata); #endif /* Alphabetic scancodes for PC keyboards */ -void WIN_InitKeyboard(_THIS) +void WIN_InitKeyboard(SDL_VideoDevice *_this) { #ifndef SDL_DISABLE_WINDOWS_IME SDL_VideoData *data = _this->driverdata; @@ -153,7 +153,7 @@ void WIN_UpdateKeymap(SDL_bool send_event) SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES, send_event); } -void WIN_QuitKeyboard(_THIS) +void WIN_QuitKeyboard(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; @@ -196,7 +196,7 @@ void WIN_ResetDeadKeys() } } -void WIN_StartTextInput(_THIS) +void WIN_StartTextInput(SDL_VideoDevice *_this) { #ifndef SDL_DISABLE_WINDOWS_IME SDL_Window *window; @@ -216,7 +216,7 @@ void WIN_StartTextInput(_THIS) #endif /* !SDL_DISABLE_WINDOWS_IME */ } -void WIN_StopTextInput(_THIS) +void WIN_StopTextInput(SDL_VideoDevice *_this) { #ifndef SDL_DISABLE_WINDOWS_IME SDL_Window *window; @@ -235,7 +235,7 @@ void WIN_StopTextInput(_THIS) #endif /* !SDL_DISABLE_WINDOWS_IME */ } -int WIN_SetTextInputRect(_THIS, const SDL_Rect *rect) +int WIN_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) { SDL_VideoData *videodata = _this->driverdata; HIMC himc = 0; @@ -275,11 +275,11 @@ int WIN_SetTextInputRect(_THIS, const SDL_Rect *rect) #ifdef SDL_DISABLE_WINDOWS_IME -void WIN_ClearComposition(_THIS) +void WIN_ClearComposition(SDL_VideoDevice *_this) { } -SDL_bool WIN_IsTextInputShown(_THIS) +SDL_bool WIN_IsTextInputShown(SDL_VideoDevice *_this) { return SDL_FALSE; } @@ -1721,13 +1721,13 @@ void IME_Present(SDL_VideoData *videodata) /* FIXME: Need to show the IME bitmap */ } -SDL_bool WIN_IsTextInputShown(_THIS) +SDL_bool WIN_IsTextInputShown(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; return IME_IsTextInputShown(videodata); } -void WIN_ClearComposition(_THIS) +void WIN_ClearComposition(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; IME_ClearComposition(videodata); diff --git a/src/video/windows/SDL_windowskeyboard.h b/src/video/windows/SDL_windowskeyboard.h index 3a5f70f9b0..777bc40e33 100644 --- a/src/video/windows/SDL_windowskeyboard.h +++ b/src/video/windows/SDL_windowskeyboard.h @@ -23,17 +23,17 @@ #ifndef SDL_windowskeyboard_h_ #define SDL_windowskeyboard_h_ -extern void WIN_InitKeyboard(_THIS); +extern void WIN_InitKeyboard(SDL_VideoDevice *_this); extern void WIN_UpdateKeymap(SDL_bool send_event); -extern void WIN_QuitKeyboard(_THIS); +extern void WIN_QuitKeyboard(SDL_VideoDevice *_this); extern void WIN_ResetDeadKeys(void); -extern void WIN_StartTextInput(_THIS); -extern void WIN_StopTextInput(_THIS); -extern int WIN_SetTextInputRect(_THIS, const SDL_Rect *rect); -extern void WIN_ClearComposition(_THIS); -extern SDL_bool WIN_IsTextInputShown(_THIS); +extern void WIN_StartTextInput(SDL_VideoDevice *_this); +extern void WIN_StopTextInput(SDL_VideoDevice *_this); +extern int WIN_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); +extern void WIN_ClearComposition(SDL_VideoDevice *_this); +extern SDL_bool WIN_IsTextInputShown(SDL_VideoDevice *_this); extern SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, struct SDL_VideoData *videodata); diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index ec2dbc0b14..38fe6d1853 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -33,7 +33,7 @@ /* #define DEBUG_MODES */ /* #define HIGHDPI_DEBUG_VERBOSE */ -static void WIN_UpdateDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode *mode) +static void WIN_UpdateDisplayMode(SDL_VideoDevice *_this, LPCWSTR deviceName, DWORD index, SDL_DisplayMode *mode) { SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata; HDC hdc; @@ -156,7 +156,7 @@ static float WIN_GetRefreshRate(DEVMODE *mode) } } -static SDL_bool WIN_GetDisplayMode(_THIS, HMONITOR hMonitor, LPCWSTR deviceName, DWORD index, SDL_DisplayMode *mode, SDL_DisplayOrientation *orientation) +static SDL_bool WIN_GetDisplayMode(SDL_VideoDevice *_this, HMONITOR hMonitor, LPCWSTR deviceName, DWORD index, SDL_DisplayMode *mode, SDL_DisplayOrientation *orientation) { const SDL_VideoData *videodata = (const SDL_VideoData *)_this->driverdata; SDL_DisplayModeData *data; @@ -300,7 +300,7 @@ WIN_GetDisplayNameVista_failed: return NULL; } -static void WIN_AddDisplay(_THIS, HMONITOR hMonitor, const MONITORINFOEXW *info, int *display_index, SDL_bool send_event) +static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONITORINFOEXW *info, int *display_index, SDL_bool send_event) { int i, index = *display_index; SDL_DisplayID displayID; @@ -422,7 +422,7 @@ static BOOL CALLBACK WIN_AddDisplaysCallback(HMONITOR hMonitor, return TRUE; } -static void WIN_AddDisplays(_THIS, SDL_bool send_event) +static void WIN_AddDisplays(SDL_VideoDevice *_this, SDL_bool send_event) { WIN_AddDisplaysData callback_data; callback_data.video_device = _this; @@ -436,7 +436,7 @@ static void WIN_AddDisplays(_THIS, SDL_bool send_event) EnumDisplayMonitors(NULL, NULL, WIN_AddDisplaysCallback, (LPARAM)&callback_data); } -int WIN_InitModes(_THIS) +int WIN_InitModes(SDL_VideoDevice *_this) { WIN_AddDisplays(_this, SDL_FALSE); @@ -480,7 +480,7 @@ static void WIN_MonitorInfoToSDL(const SDL_VideoData *videodata, HMONITOR monito info->rcWork.bottom = info->rcMonitor.top + MulDiv(info->rcWork.bottom - info->rcMonitor.top, 96, ydpi); } -int WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) +int WIN_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { const SDL_DisplayData *data = display->driverdata; const SDL_VideoData *videodata = display->device->driverdata; @@ -532,7 +532,7 @@ static int WIN_GetDisplayDPI(SDL_DisplayID displayID, int *dpi) return 0; } -int WIN_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) +int WIN_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { const SDL_DisplayData *data = display->driverdata; const SDL_VideoData *videodata = display->device->driverdata; @@ -693,7 +693,7 @@ void WIN_ScreenPointToSDLFloat(LONG x, LONG y, float *xOut, float *yOut) #endif } -int WIN_GetDisplayModes(_THIS, SDL_VideoDisplay *display) +int WIN_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { SDL_DisplayData *data = display->driverdata; DWORD i; @@ -720,7 +720,7 @@ int WIN_GetDisplayModes(_THIS, SDL_VideoDisplay *display) } #ifdef DEBUG_MODES -static void WIN_LogMonitor(_THIS, HMONITOR mon) +static void WIN_LogMonitor(SDL_VideoDevice *_this, HMONITOR mon) { const SDL_VideoData *vid_data = (const SDL_VideoData *)_this->driverdata; MONITORINFOEX minfo; @@ -749,7 +749,7 @@ static void WIN_LogMonitor(_THIS, HMONITOR mon) } #endif -int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +int WIN_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { SDL_DisplayData *displaydata = display->driverdata; SDL_DisplayModeData *data = mode->driverdata; @@ -810,7 +810,7 @@ int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) return 0; } -void WIN_RefreshDisplays(_THIS) +void WIN_RefreshDisplays(SDL_VideoDevice *_this) { int i; @@ -836,7 +836,7 @@ void WIN_RefreshDisplays(_THIS) } } -void WIN_QuitModes(_THIS) +void WIN_QuitModes(SDL_VideoDevice *_this) { /* All fullscreen windows should have restored modes by now */ } diff --git a/src/video/windows/SDL_windowsmodes.h b/src/video/windows/SDL_windowsmodes.h index d586271436..b24ce487c6 100644 --- a/src/video/windows/SDL_windowsmodes.h +++ b/src/video/windows/SDL_windowsmodes.h @@ -36,16 +36,16 @@ struct SDL_DisplayModeData DEVMODE DeviceMode; }; -extern int WIN_InitModes(_THIS); -extern int WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); -extern int WIN_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); +extern int WIN_InitModes(SDL_VideoDevice *_this); +extern int WIN_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); +extern int WIN_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); extern void WIN_ScreenPointFromSDL(int *x, int *y, int *dpiOut); extern void WIN_ScreenPointFromSDLFloat(float x, float y, LONG *xOut, LONG *yOut, int *dpiOut); extern void WIN_ScreenPointToSDL(int *x, int *y); extern void WIN_ScreenPointToSDLFloat(LONG x, LONG y, float *xOut, float *yOut); -extern int WIN_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -extern int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -extern void WIN_RefreshDisplays(_THIS); -extern void WIN_QuitModes(_THIS); +extern int WIN_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +extern int WIN_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +extern void WIN_RefreshDisplays(SDL_VideoDevice *_this); +extern void WIN_QuitModes(SDL_VideoDevice *_this); #endif /* SDL_windowsmodes_h_ */ diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index a3fe632313..e37a59e7a6 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/src/video/windows/SDL_windowsmouse.c @@ -349,7 +349,7 @@ static Uint32 WIN_GetGlobalMouseState(float *x, float *y) return retval; } -void WIN_InitMouse(_THIS) +void WIN_InitMouse(SDL_VideoDevice *_this) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -370,7 +370,7 @@ void WIN_InitMouse(_THIS) WIN_UpdateMouseSystemScale(); } -void WIN_QuitMouse(_THIS) +void WIN_QuitMouse(SDL_VideoDevice *_this) { if (rawInputEnableCount) { /* force RAWINPUT off here. */ rawInputEnableCount = 1; diff --git a/src/video/windows/SDL_windowsmouse.h b/src/video/windows/SDL_windowsmouse.h index 5fe1d2eefd..3c3788238d 100644 --- a/src/video/windows/SDL_windowsmouse.h +++ b/src/video/windows/SDL_windowsmouse.h @@ -26,8 +26,8 @@ extern DWORD SDL_last_warp_time; extern HCURSOR SDL_cursor; -extern void WIN_InitMouse(_THIS); -extern void WIN_QuitMouse(_THIS); +extern void WIN_InitMouse(SDL_VideoDevice *_this); +extern void WIN_QuitMouse(SDL_VideoDevice *_this); extern void WIN_SetCursorPos(int x, int y); extern void WIN_UpdateMouseSystemScale(); diff --git a/src/video/windows/SDL_windowsopengl.c b/src/video/windows/SDL_windowsopengl.c index 88e92fffa3..970643a104 100644 --- a/src/video/windows/SDL_windowsopengl.c +++ b/src/video/windows/SDL_windowsopengl.c @@ -105,7 +105,7 @@ typedef HGLRC(APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC hDC, #define SetPixelFormat _this->gl_data->wglSetPixelFormat #endif -int WIN_GL_LoadLibrary(_THIS, const char *path) +int WIN_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path) { void *handle; @@ -212,7 +212,7 @@ int WIN_GL_LoadLibrary(_THIS, const char *path) return 0; } -SDL_FunctionPointer WIN_GL_GetProcAddress(_THIS, const char *proc) +SDL_FunctionPointer WIN_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc) { void *func; @@ -225,7 +225,7 @@ SDL_FunctionPointer WIN_GL_GetProcAddress(_THIS, const char *proc) return func; } -void WIN_GL_UnloadLibrary(_THIS) +void WIN_GL_UnloadLibrary(SDL_VideoDevice *_this) { SDL_UnloadObject(_this->gl_config.dll_handle); _this->gl_config.dll_handle = NULL; @@ -235,7 +235,7 @@ void WIN_GL_UnloadLibrary(_THIS) _this->gl_data = NULL; } -static void WIN_GL_SetupPixelFormat(_THIS, PIXELFORMATDESCRIPTOR *pfd) +static void WIN_GL_SetupPixelFormat(SDL_VideoDevice *_this, PIXELFORMATDESCRIPTOR *pfd) { SDL_zerop(pfd); pfd->nSize = sizeof(*pfd); @@ -272,7 +272,7 @@ static void WIN_GL_SetupPixelFormat(_THIS, PIXELFORMATDESCRIPTOR *pfd) /* Choose the closest pixel format that meets or exceeds the target. FIXME: Should we weight any particular attribute over any other? */ -static int WIN_GL_ChoosePixelFormat(_THIS, HDC hdc, PIXELFORMATDESCRIPTOR *target) +static int WIN_GL_ChoosePixelFormat(SDL_VideoDevice *_this, HDC hdc, PIXELFORMATDESCRIPTOR *target) { PIXELFORMATDESCRIPTOR pfd; int count, index, best = 0; @@ -408,7 +408,7 @@ static SDL_bool HasExtension(const char *extension, const char *extensions) return SDL_FALSE; } -void WIN_GL_InitExtensions(_THIS) +void WIN_GL_InitExtensions(SDL_VideoDevice *_this) { /* *INDENT-OFF* */ /* clang-format off */ const char *(WINAPI * wglGetExtensionsStringARB)(HDC) = 0; @@ -517,7 +517,7 @@ void WIN_GL_InitExtensions(_THIS) WIN_PumpEvents(_this); } -static int WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) +static int WIN_GL_ChoosePixelFormatARB(SDL_VideoDevice *_this, int *iAttribs, float *fAttribs) { HWND hwnd; HDC hdc; @@ -558,7 +558,7 @@ static int WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) } /* actual work of WIN_GL_SetupWindow() happens here. */ -static int WIN_GL_SetupWindowInternal(_THIS, SDL_Window *window) +static int WIN_GL_SetupWindowInternal(SDL_VideoDevice *_this, SDL_Window *window) { HDC hdc = window->driverdata->hdc; PIXELFORMATDESCRIPTOR pfd; @@ -677,7 +677,7 @@ static int WIN_GL_SetupWindowInternal(_THIS, SDL_Window *window) return 0; } -int WIN_GL_SetupWindow(_THIS, SDL_Window *window) +int WIN_GL_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window) { /* The current context is lost in here; save it and reset it. */ SDL_Window *current_win = SDL_GL_GetCurrentWindow(); @@ -687,7 +687,7 @@ int WIN_GL_SetupWindow(_THIS, SDL_Window *window) return retval; } -SDL_bool WIN_GL_UseEGL(_THIS) +SDL_bool WIN_GL_UseEGL(SDL_VideoDevice *_this) { SDL_assert(_this->gl_data != NULL); SDL_assert(_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES); @@ -695,7 +695,7 @@ SDL_bool WIN_GL_UseEGL(_THIS) return SDL_GetHintBoolean(SDL_HINT_OPENGL_ES_DRIVER, SDL_FALSE) || _this->gl_config.major_version == 1 || _this->gl_config.major_version > _this->gl_data->es_profile_max_supported_version.major || (_this->gl_config.major_version == _this->gl_data->es_profile_max_supported_version.major && _this->gl_config.minor_version > _this->gl_data->es_profile_max_supported_version.minor); /* No WGL extension for OpenGL ES 1.x profiles. */ } -SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window *window) +SDL_GLContext WIN_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { HDC hdc = window->driverdata->hdc; HGLRC context, share_context; @@ -820,7 +820,7 @@ SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window *window) return context; } -int WIN_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int WIN_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { HDC hdc; @@ -850,7 +850,7 @@ int WIN_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) return 0; } -int WIN_GL_SetSwapInterval(_THIS, int interval) +int WIN_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval) { if ((interval < 0) && (!_this->gl_data->HAS_WGL_EXT_swap_control_tear)) { return SDL_SetError("Negative swap interval unsupported in this GL"); @@ -864,7 +864,7 @@ int WIN_GL_SetSwapInterval(_THIS, int interval) return 0; } -int WIN_GL_GetSwapInterval(_THIS, int *interval) +int WIN_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval) { if (_this->gl_data->wglGetSwapIntervalEXT) { *interval = _this->gl_data->wglGetSwapIntervalEXT(); @@ -874,7 +874,7 @@ int WIN_GL_GetSwapInterval(_THIS, int *interval) } } -int WIN_GL_SwapWindow(_THIS, SDL_Window *window) +int WIN_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { HDC hdc = window->driverdata->hdc; @@ -884,7 +884,7 @@ int WIN_GL_SwapWindow(_THIS, SDL_Window *window) return 0; } -int WIN_GL_DeleteContext(_THIS, SDL_GLContext context) +int WIN_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { if (!_this->gl_data) { return 0; @@ -893,7 +893,7 @@ int WIN_GL_DeleteContext(_THIS, SDL_GLContext context) return 0; } -SDL_bool WIN_GL_SetPixelFormatFrom(_THIS, SDL_Window *fromWindow, SDL_Window *toWindow) +SDL_bool WIN_GL_SetPixelFormatFrom(SDL_VideoDevice *_this, SDL_Window *fromWindow, SDL_Window *toWindow) { HDC hfromdc = fromWindow->driverdata->hdc; HDC htodc = toWindow->driverdata->hdc; diff --git a/src/video/windows/SDL_windowsopengl.h b/src/video/windows/SDL_windowsopengl.h index 75dfe7da16..dc1d140de3 100644 --- a/src/video/windows/SDL_windowsopengl.h +++ b/src/video/windows/SDL_windowsopengl.h @@ -102,20 +102,20 @@ struct SDL_GLDriverData }; /* OpenGL functions */ -extern int WIN_GL_LoadLibrary(_THIS, const char *path); -extern SDL_FunctionPointer WIN_GL_GetProcAddress(_THIS, const char *proc); -extern void WIN_GL_UnloadLibrary(_THIS); -extern SDL_bool WIN_GL_UseEGL(_THIS); -extern int WIN_GL_SetupWindow(_THIS, SDL_Window *window); -extern SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window *window); -extern int WIN_GL_MakeCurrent(_THIS, SDL_Window *window, +extern int WIN_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_FunctionPointer WIN_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +extern void WIN_GL_UnloadLibrary(SDL_VideoDevice *_this); +extern SDL_bool WIN_GL_UseEGL(SDL_VideoDevice *_this); +extern int WIN_GL_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern SDL_GLContext WIN_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); -extern int WIN_GL_SetSwapInterval(_THIS, int interval); -extern int WIN_GL_GetSwapInterval(_THIS, int *interval); -extern int WIN_GL_SwapWindow(_THIS, SDL_Window *window); -extern int WIN_GL_DeleteContext(_THIS, SDL_GLContext context); -extern void WIN_GL_InitExtensions(_THIS); -extern SDL_bool WIN_GL_SetPixelFormatFrom(_THIS, SDL_Window *fromWindow, SDL_Window *toWindow); +extern int WIN_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval); +extern int WIN_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval); +extern int WIN_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); +extern void WIN_GL_InitExtensions(SDL_VideoDevice *_this); +extern SDL_bool WIN_GL_SetPixelFormatFrom(SDL_VideoDevice *_this, SDL_Window *fromWindow, SDL_Window *toWindow); #ifndef WGL_ARB_pixel_format #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 diff --git a/src/video/windows/SDL_windowsopengles.c b/src/video/windows/SDL_windowsopengles.c index c4f9d921fc..5b4d50095b 100644 --- a/src/video/windows/SDL_windowsopengles.c +++ b/src/video/windows/SDL_windowsopengles.c @@ -29,7 +29,7 @@ /* EGL implementation of SDL OpenGL support */ -int WIN_GLES_LoadLibrary(_THIS, const char *path) +int WIN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { /* If the profile requested is not GL ES, switch over to WIN_GL functions */ @@ -61,7 +61,7 @@ int WIN_GLES_LoadLibrary(_THIS, const char *path) } SDL_GLContext -WIN_GLES_CreateContext(_THIS, SDL_Window *window) +WIN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_GLContext context; SDL_WindowData *data = window->driverdata; @@ -94,7 +94,7 @@ WIN_GLES_CreateContext(_THIS, SDL_Window *window) return context; } -int WIN_GLES_DeleteContext(_THIS, SDL_GLContext context) +int WIN_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { SDL_EGL_DeleteContext(_this, context); return 0; @@ -105,7 +105,7 @@ SDL_EGL_SwapWindow_impl(WIN) SDL_EGL_MakeCurrent_impl(WIN) /* *INDENT-ON* */ /* clang-format on */ -int WIN_GLES_SetupWindow(_THIS, SDL_Window *window) +int WIN_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window) { /* The current context is lost in here; save it and reset it. */ SDL_WindowData *windowdata = window->driverdata; @@ -135,7 +135,7 @@ int WIN_GLES_SetupWindow(_THIS, SDL_Window *window) } EGLSurface -WIN_GLES_GetEGLSurface(_THIS, SDL_Window *window) +WIN_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *windowdata = window->driverdata; diff --git a/src/video/windows/SDL_windowsopengles.h b/src/video/windows/SDL_windowsopengles.h index 963f2a1c8e..4cd8af41dd 100644 --- a/src/video/windows/SDL_windowsopengles.h +++ b/src/video/windows/SDL_windowsopengles.h @@ -35,13 +35,13 @@ #define WIN_GLES_GetSwapInterval SDL_EGL_GetSwapInterval #define WIN_GLES_SetSwapInterval SDL_EGL_SetSwapInterval -extern int WIN_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext WIN_GLES_CreateContext(_THIS, SDL_Window *window); -extern int WIN_GLES_SwapWindow(_THIS, SDL_Window *window); -extern int WIN_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -extern int WIN_GLES_DeleteContext(_THIS, SDL_GLContext context); -extern int WIN_GLES_SetupWindow(_THIS, SDL_Window *window); -extern SDL_EGLSurface WIN_GLES_GetEGLSurface(_THIS, SDL_Window *window); +extern int WIN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_GLContext WIN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +extern int WIN_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); +extern int WIN_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern SDL_EGLSurface WIN_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index e2788f8fce..1a565cd56f 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -34,8 +34,8 @@ /* #define HIGHDPI_DEBUG */ /* Initialization/Query functions */ -static int WIN_VideoInit(_THIS); -static void WIN_VideoQuit(_THIS); +static int WIN_VideoInit(SDL_VideoDevice *_this); +static void WIN_VideoQuit(SDL_VideoDevice *_this); /* Hints */ SDL_bool g_WindowsEnableMessageLoop = SDL_TRUE; @@ -58,7 +58,7 @@ static void SDLCALL UpdateWindowFrameUsableWhileCursorHidden(void *userdata, con } #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) -static int WIN_SuspendScreenSaver(_THIS) +static int WIN_SuspendScreenSaver(SDL_VideoDevice *_this) { if (_this->suspend_screensaver) { SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED); @@ -269,7 +269,7 @@ VideoBootStrap WINDOWS_bootstrap = { "windows", "SDL Windows video driver", WIN_CreateDevice }; -static BOOL WIN_DeclareDPIAwareUnaware(_THIS) +static BOOL WIN_DeclareDPIAwareUnaware(SDL_VideoDevice *_this) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) SDL_VideoData *data = _this->driverdata; @@ -284,7 +284,7 @@ static BOOL WIN_DeclareDPIAwareUnaware(_THIS) return FALSE; } -static BOOL WIN_DeclareDPIAwareSystem(_THIS) +static BOOL WIN_DeclareDPIAwareSystem(SDL_VideoDevice *_this) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) SDL_VideoData *data = _this->driverdata; @@ -303,7 +303,7 @@ static BOOL WIN_DeclareDPIAwareSystem(_THIS) return FALSE; } -static BOOL WIN_DeclareDPIAwarePerMonitor(_THIS) +static BOOL WIN_DeclareDPIAwarePerMonitor(SDL_VideoDevice *_this) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) SDL_VideoData *data = _this->driverdata; @@ -323,7 +323,7 @@ static BOOL WIN_DeclareDPIAwarePerMonitor(_THIS) #endif } -static BOOL WIN_DeclareDPIAwarePerMonitorV2(_THIS) +static BOOL WIN_DeclareDPIAwarePerMonitorV2(SDL_VideoDevice *_this) { #if defined(__XBOXONE__) || defined(__XBOXSERIES__) return FALSE; @@ -362,7 +362,7 @@ static BOOL WIN_DeclareDPIAwarePerMonitorV2(_THIS) } #ifdef HIGHDPI_DEBUG -static const char *WIN_GetDPIAwareness(_THIS) +static const char *WIN_GetDPIAwareness(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; @@ -386,7 +386,7 @@ static const char *WIN_GetDPIAwareness(_THIS) } #endif -static void WIN_InitDPIAwareness(_THIS) +static void WIN_InitDPIAwareness(SDL_VideoDevice *_this) { const char *hint = SDL_GetHint("SDL_WINDOWS_DPI_AWARENESS"); @@ -401,7 +401,7 @@ static void WIN_InitDPIAwareness(_THIS) } } -static void WIN_InitDPIScaling(_THIS) +static void WIN_InitDPIScaling(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; @@ -412,7 +412,7 @@ static void WIN_InitDPIScaling(_THIS) } } -int WIN_VideoInit(_THIS) +int WIN_VideoInit(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; @@ -455,7 +455,7 @@ int WIN_VideoInit(_THIS) return 0; } -void WIN_VideoQuit(_THIS) +void WIN_VideoQuit(SDL_VideoDevice *_this) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) WIN_QuitModes(_this); @@ -699,7 +699,7 @@ SDL_SystemTheme WIN_GetSystemTheme(void) return theme; } -SDL_bool WIN_IsPerMonitorV2DPIAware(_THIS) +SDL_bool WIN_IsPerMonitorV2DPIAware(SDL_VideoDevice *_this) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) SDL_VideoData *data = _this->driverdata; diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index b7cdc7cb8c..c1a37bd13c 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -467,6 +467,6 @@ typedef struct IDirect3D9 IDirect3D9; extern SDL_bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface); extern SDL_SystemTheme WIN_GetSystemTheme(void); -extern SDL_bool WIN_IsPerMonitorV2DPIAware(_THIS); +extern SDL_bool WIN_IsPerMonitorV2DPIAware(SDL_VideoDevice *_this); #endif /* SDL_windowsvideo_h_ */ diff --git a/src/video/windows/SDL_windowsvulkan.c b/src/video/windows/SDL_windowsvulkan.c index 0cac196e26..060e2ac01d 100644 --- a/src/video/windows/SDL_windowsvulkan.c +++ b/src/video/windows/SDL_windowsvulkan.c @@ -35,7 +35,7 @@ #include -int WIN_Vulkan_LoadLibrary(_THIS, const char *path) +int WIN_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path) { VkExtensionProperties *extensions = NULL; Uint32 extensionCount = 0; @@ -102,7 +102,7 @@ fail: return -1; } -void WIN_Vulkan_UnloadLibrary(_THIS) +void WIN_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) { if (_this->vulkan_config.loader_handle) { SDL_UnloadObject(_this->vulkan_config.loader_handle); @@ -110,7 +110,7 @@ void WIN_Vulkan_UnloadLibrary(_THIS) } } -SDL_bool WIN_Vulkan_GetInstanceExtensions(_THIS, +SDL_bool WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names) { @@ -126,7 +126,7 @@ SDL_bool WIN_Vulkan_GetInstanceExtensions(_THIS, extensionsForWin32); } -SDL_bool WIN_Vulkan_CreateSurface(_THIS, +SDL_bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface) diff --git a/src/video/windows/SDL_windowsvulkan.h b/src/video/windows/SDL_windowsvulkan.h index d786a679e7..707e9d4892 100644 --- a/src/video/windows/SDL_windowsvulkan.h +++ b/src/video/windows/SDL_windowsvulkan.h @@ -34,12 +34,12 @@ #if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_WINDOWS) -int WIN_Vulkan_LoadLibrary(_THIS, const char *path); -void WIN_Vulkan_UnloadLibrary(_THIS); -SDL_bool WIN_Vulkan_GetInstanceExtensions(_THIS, +int WIN_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); +void WIN_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); +SDL_bool WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names); -SDL_bool WIN_Vulkan_CreateSurface(_THIS, +SDL_bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 60e24076d7..a8a7f5c7f6 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -321,7 +321,7 @@ static int WIN_GetScalingDPIForHWND(const SDL_VideoData *videodata, HWND hwnd) #endif } -static int SetupWindowData(_THIS, SDL_Window *window, HWND hwnd, HWND parent, SDL_bool created) +static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, HWND hwnd, HWND parent, SDL_bool created) { SDL_VideoData *videodata = _this->driverdata; SDL_WindowData *data; @@ -497,7 +497,7 @@ static int SetupWindowData(_THIS, SDL_Window *window, HWND hwnd, HWND parent, SD return 0; } -static void CleanupWindowData(_THIS, SDL_Window *window) +static void CleanupWindowData(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; @@ -588,7 +588,7 @@ static void WIN_SetKeyboardFocus(SDL_Window *window) SDL_SetKeyboardFocus(window); } -int WIN_CreateWindow(_THIS, SDL_Window *window) +int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { HWND hwnd, parent = NULL; DWORD style = STYLE_BASIC; @@ -670,7 +670,7 @@ int WIN_CreateWindow(_THIS, SDL_Window *window) return 0; } -int WIN_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) +int WIN_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data) { #if defined(__XBOXONE__) || defined(__XBOXSERIES__) return -1; @@ -729,7 +729,7 @@ int WIN_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ } -void WIN_SetWindowTitle(_THIS, SDL_Window *window) +void WIN_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) HWND hwnd = window->driverdata->hwnd; @@ -739,7 +739,7 @@ void WIN_SetWindowTitle(_THIS, SDL_Window *window) #endif } -int WIN_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) +int WIN_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) HWND hwnd = window->driverdata->hwnd; @@ -804,7 +804,7 @@ int WIN_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) #endif } -int WIN_SetWindowPosition(_THIS, SDL_Window *window) +int WIN_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { /* HighDPI support: removed SWP_NOSIZE. If the move results in a DPI change, we need to allow * the window to resize (e.g. AdjustWindowRectExForDpi frame sizes are different). @@ -813,12 +813,12 @@ int WIN_SetWindowPosition(_THIS, SDL_Window *window) return WIN_SetWindowPositionInternal(window, window->driverdata->copybits_flag | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE); } -void WIN_SetWindowSize(_THIS, SDL_Window *window) +void WIN_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { WIN_SetWindowPositionInternal(window, window->driverdata->copybits_flag | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE); } -int WIN_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right) +int WIN_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right) { #if defined(__XBOXONE__) || defined(__XBOXSERIES__) HWND hwnd = window->driverdata->hwnd; @@ -885,7 +885,7 @@ int WIN_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ } -void WIN_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) +void WIN_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h) { const SDL_WindowData *data = window->driverdata; HWND hwnd = data->hwnd; @@ -900,7 +900,7 @@ void WIN_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) } } -void WIN_ShowWindow(_THIS, SDL_Window *window) +void WIN_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { DWORD style; HWND hwnd; @@ -926,7 +926,7 @@ void WIN_ShowWindow(_THIS, SDL_Window *window) } } -void WIN_HideWindow(_THIS, SDL_Window *window) +void WIN_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { HWND hwnd = window->driverdata->hwnd; ShowWindow(hwnd, SW_HIDE); @@ -946,7 +946,7 @@ void WIN_HideWindow(_THIS, SDL_Window *window) } } -void WIN_RaiseWindow(_THIS, SDL_Window *window) +void WIN_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) /* If desired, raise the window more forcefully. @@ -984,7 +984,7 @@ void WIN_RaiseWindow(_THIS, SDL_Window *window) #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ } -void WIN_MaximizeWindow(_THIS, SDL_Window *window) +void WIN_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; HWND hwnd = data->hwnd; @@ -993,13 +993,13 @@ void WIN_MaximizeWindow(_THIS, SDL_Window *window) data->expected_resize = SDL_FALSE; } -void WIN_MinimizeWindow(_THIS, SDL_Window *window) +void WIN_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { HWND hwnd = window->driverdata->hwnd; ShowWindow(hwnd, SW_MINIMIZE); } -void WIN_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) +void WIN_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered) { SDL_WindowData *data = window->driverdata; HWND hwnd = data->hwnd; @@ -1015,7 +1015,7 @@ void WIN_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) data->in_border_change = SDL_FALSE; } -void WIN_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) +void WIN_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable) { SDL_WindowData *data = window->driverdata; HWND hwnd = data->hwnd; @@ -1028,12 +1028,12 @@ void WIN_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) SetWindowLong(hwnd, GWL_STYLE, style); } -void WIN_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top) +void WIN_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top) { WIN_SetWindowPositionInternal(window, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } -void WIN_RestoreWindow(_THIS, SDL_Window *window) +void WIN_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; HWND hwnd = data->hwnd; @@ -1045,7 +1045,7 @@ void WIN_RestoreWindow(_THIS, SDL_Window *window) /** * Reconfigures the window to fill the given display, if fullscreen is true, otherwise restores the window. */ -void WIN_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) +void WIN_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) SDL_DisplayData *displaydata = display->driverdata; @@ -1158,7 +1158,7 @@ void WIN_UpdateWindowICCProfile(SDL_Window *window, SDL_bool send_event) } } -void *WIN_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size) +void *WIN_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size) { SDL_WindowData *data = window->driverdata; char *filename_utf8; @@ -1221,17 +1221,17 @@ void WIN_UngrabKeyboard(SDL_Window *window) } } -void WIN_SetWindowMouseRect(_THIS, SDL_Window *window) +void WIN_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window) { WIN_UpdateClipCursor(window); } -void WIN_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void WIN_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { WIN_UpdateClipCursor(window); } -void WIN_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void WIN_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { if (grabbed) { WIN_GrabKeyboard(window); @@ -1241,7 +1241,7 @@ void WIN_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) } #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ -void WIN_DestroyWindow(_THIS, SDL_Window *window) +void WIN_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { if (window->shaper) { SDL_ShapeData *shapedata = (SDL_ShapeData *)window->shaper->driverdata; @@ -1258,7 +1258,7 @@ void WIN_DestroyWindow(_THIS, SDL_Window *window) CleanupWindowData(_this, window); } -int WIN_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) +int WIN_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info) { const SDL_WindowData *data = (const SDL_WindowData *)window->driverdata; @@ -1337,7 +1337,7 @@ void SDL_HelperWindowDestroy(void) } #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) -void WIN_OnWindowEnter(_THIS, SDL_Window *window) +void WIN_OnWindowEnter(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; @@ -1451,7 +1451,7 @@ int WIN_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) } #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ -int WIN_SetWindowOpacity(_THIS, SDL_Window *window, float opacity) +int WIN_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity) { #if defined(__XBOXONE__) || defined(__XBOXSERIES__) return -1; @@ -1558,7 +1558,7 @@ void WIN_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept) DragAcceptFiles(data->hwnd, accept ? TRUE : FALSE); } -int WIN_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) +int WIN_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation) { FLASHWINFO desc; diff --git a/src/video/windows/SDL_windowswindow.h b/src/video/windows/SDL_windowswindow.h index aaa7f62ed5..95ed83ca64 100644 --- a/src/video/windows/SDL_windowswindow.h +++ b/src/video/windows/SDL_windowswindow.h @@ -80,33 +80,33 @@ struct SDL_WindowData UINT copybits_flag; }; -extern int WIN_CreateWindow(_THIS, SDL_Window *window); -extern int WIN_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); -extern void WIN_SetWindowTitle(_THIS, SDL_Window *window); -extern int WIN_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon); -extern int WIN_SetWindowPosition(_THIS, SDL_Window *window); -extern void WIN_SetWindowSize(_THIS, SDL_Window *window); -extern int WIN_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right); -extern void WIN_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *width, int *height); -extern int WIN_SetWindowOpacity(_THIS, SDL_Window *window, float opacity); -extern void WIN_ShowWindow(_THIS, SDL_Window *window); -extern void WIN_HideWindow(_THIS, SDL_Window *window); -extern void WIN_RaiseWindow(_THIS, SDL_Window *window); -extern void WIN_MaximizeWindow(_THIS, SDL_Window *window); -extern void WIN_MinimizeWindow(_THIS, SDL_Window *window); -extern void WIN_RestoreWindow(_THIS, SDL_Window *window); -extern void WIN_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered); -extern void WIN_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable); -extern void WIN_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top); -extern void WIN_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); +extern int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data); +extern void WIN_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon); +extern int WIN_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); +extern void WIN_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right); +extern void WIN_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *width, int *height); +extern int WIN_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity); +extern void WIN_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void WIN_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void WIN_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void WIN_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void WIN_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void WIN_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void WIN_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered); +extern void WIN_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable); +extern void WIN_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top); +extern void WIN_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); extern void WIN_UpdateWindowICCProfile(SDL_Window *window, SDL_bool send_event); -extern void *WIN_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size); -extern void WIN_SetWindowMouseRect(_THIS, SDL_Window *window); -extern void WIN_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -extern void WIN_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -extern void WIN_DestroyWindow(_THIS, SDL_Window *window); -extern int WIN_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); -extern void WIN_OnWindowEnter(_THIS, SDL_Window *window); +extern void *WIN_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size); +extern void WIN_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window); +extern void WIN_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); +extern void WIN_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); +extern void WIN_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info); +extern void WIN_OnWindowEnter(SDL_VideoDevice *_this, SDL_Window *window); extern void WIN_UpdateClipCursor(SDL_Window *window); extern int WIN_SetWindowHitTest(SDL_Window *window, SDL_bool enabled); extern void WIN_ClientPointToSDL(const SDL_Window *window, int *x, int *y); @@ -114,7 +114,7 @@ extern void WIN_ClientPointToSDLFloat(const SDL_Window *window, LONG x, LONG y, extern void WIN_ClientPointFromSDL(const SDL_Window *window, int *x, int *y); extern void WIN_ClientPointFromSDLFloat(const SDL_Window *window, float x, float y, LONG *xOut, LONG *yOut); extern void WIN_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept); -extern int WIN_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation); +extern int WIN_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation); extern void WIN_UpdateDarkModeForHWND(HWND hwnd); extern int WIN_SetWindowPositionInternal(SDL_Window *window, UINT flags); diff --git a/src/video/winrt/SDL_winrtevents.cpp b/src/video/winrt/SDL_winrtevents.cpp index 161389209e..2b7e3ff8dc 100644 --- a/src/video/winrt/SDL_winrtevents.cpp +++ b/src/video/winrt/SDL_winrtevents.cpp @@ -48,7 +48,7 @@ static void WINRT_YieldXAMLThread(); /* Global event management */ -void WINRT_PumpEvents(_THIS) +void WINRT_PumpEvents(SDL_VideoDevice *_this) { if (SDL_WinRTGlobalApp) { SDL_WinRTGlobalApp->PumpEvents(); diff --git a/src/video/winrt/SDL_winrtevents_c.h b/src/video/winrt/SDL_winrtevents_c.h index 2db495aa51..f5871caf34 100644 --- a/src/video/winrt/SDL_winrtevents_c.h +++ b/src/video/winrt/SDL_winrtevents_c.h @@ -32,8 +32,8 @@ extern "C" { extern "C" { #endif -extern void WINRT_InitTouch(_THIS); -extern void WINRT_PumpEvents(_THIS); +extern void WINRT_InitTouch(SDL_VideoDevice *_this); +extern void WINRT_PumpEvents(SDL_VideoDevice *_this); #ifdef __cplusplus } @@ -68,11 +68,11 @@ extern void WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^ args); extern void WINRT_ProcessCharacterReceivedEvent(Windows::UI::Core::CharacterReceivedEventArgs ^ args); #if NTDDI_VERSION >= NTDDI_WIN10 -extern void WINTRT_InitialiseInputPaneEvents(_THIS); -extern SDL_bool WINRT_HasScreenKeyboardSupport(_THIS); -extern void WINRT_ShowScreenKeyboard(_THIS, SDL_Window *window); -extern void WINRT_HideScreenKeyboard(_THIS, SDL_Window *window); -extern SDL_bool WINRT_IsScreenKeyboardShown(_THIS, SDL_Window *window); +extern void WINTRT_InitialiseInputPaneEvents(SDL_VideoDevice *_this); +extern SDL_bool WINRT_HasScreenKeyboardSupport(SDL_VideoDevice *_this); +extern void WINRT_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); +extern void WINRT_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); +extern SDL_bool WINRT_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); #endif // NTDDI_VERSION >= ... /* XAML Thread Management */ diff --git a/src/video/winrt/SDL_winrtgamebar.cpp b/src/video/winrt/SDL_winrtgamebar.cpp index 09340b55c1..f9ffa2c5fc 100644 --- a/src/video/winrt/SDL_winrtgamebar.cpp +++ b/src/video/winrt/SDL_winrtgamebar.cpp @@ -142,7 +142,7 @@ static void WINRT_HandleGameBarIsInputRedirected_NonMainThread(Platform::Object } } -void WINRT_InitGameBar(_THIS) +void WINRT_InitGameBar(SDL_VideoDevice *_this) { SDL_VideoData *driverdata = _this->driverdata; IGameBarStatics_ *gameBar = WINRT_GetGameBar(); @@ -162,7 +162,7 @@ void WINRT_InitGameBar(_THIS) } } -void WINRT_QuitGameBar(_THIS) +void WINRT_QuitGameBar(SDL_VideoDevice *_this) { SDL_VideoData *driverdata; IGameBarStatics_ *gameBar; diff --git a/src/video/winrt/SDL_winrtgamebar_cpp.h b/src/video/winrt/SDL_winrtgamebar_cpp.h index fe73116c2f..6cadd11ca1 100644 --- a/src/video/winrt/SDL_winrtgamebar_cpp.h +++ b/src/video/winrt/SDL_winrtgamebar_cpp.h @@ -26,8 +26,8 @@ #ifdef __cplusplus /* These are exported as C++ functions, rather than C, to fix a compilation bug with MSVC 2013, for Windows 8.x builds. */ -extern void WINRT_InitGameBar(_THIS); -extern void WINRT_QuitGameBar(_THIS); +extern void WINRT_InitGameBar(SDL_VideoDevice *_this); +extern void WINRT_QuitGameBar(SDL_VideoDevice *_this); #endif #endif /* SDL_winrtgamebar_h_ */ diff --git a/src/video/winrt/SDL_winrtkeyboard.cpp b/src/video/winrt/SDL_winrtkeyboard.cpp index 2a574c321d..bf82e8f987 100644 --- a/src/video/winrt/SDL_winrtkeyboard.cpp +++ b/src/video/winrt/SDL_winrtkeyboard.cpp @@ -410,7 +410,7 @@ void WINTRT_OnInputPaneHiding(Windows::UI::ViewManagement::InputPane ^ sender, W WINRT_InputPaneVisible = false; } -void WINTRT_InitialiseInputPaneEvents(_THIS) +void WINTRT_InitialiseInputPaneEvents(SDL_VideoDevice *_this) { using namespace Windows::UI::ViewManagement; InputPane ^ inputPane = InputPane::GetForCurrentView(); @@ -422,12 +422,12 @@ void WINTRT_InitialiseInputPaneEvents(_THIS) } } -SDL_bool WINRT_HasScreenKeyboardSupport(_THIS) +SDL_bool WINRT_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { return SDL_TRUE; } -void WINRT_ShowScreenKeyboard(_THIS, SDL_Window *window) +void WINRT_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { using namespace Windows::UI::ViewManagement; InputPane ^ inputPane = InputPane::GetForCurrentView(); @@ -436,7 +436,7 @@ void WINRT_ShowScreenKeyboard(_THIS, SDL_Window *window) } } -void WINRT_HideScreenKeyboard(_THIS, SDL_Window *window) +void WINRT_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { using namespace Windows::UI::ViewManagement; InputPane ^ inputPane = InputPane::GetForCurrentView(); @@ -445,7 +445,7 @@ void WINRT_HideScreenKeyboard(_THIS, SDL_Window *window) } } -SDL_bool WINRT_IsScreenKeyboardShown(_THIS, SDL_Window *window) +SDL_bool WINRT_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { using namespace Windows::UI::ViewManagement; InputPane ^ inputPane = InputPane::GetForCurrentView(); diff --git a/src/video/winrt/SDL_winrtmouse.cpp b/src/video/winrt/SDL_winrtmouse.cpp index 13550f948c..826a75bc80 100644 --- a/src/video/winrt/SDL_winrtmouse.cpp +++ b/src/video/winrt/SDL_winrtmouse.cpp @@ -204,7 +204,7 @@ static int WINRT_SetRelativeMouseMode(SDL_bool enabled) return 0; } -void WINRT_InitMouse(_THIS) +void WINRT_InitMouse(SDL_VideoDevice *_this) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -226,7 +226,7 @@ void WINRT_InitMouse(_THIS) #endif } -void WINRT_QuitMouse(_THIS) +void WINRT_QuitMouse(SDL_VideoDevice *_this) { } diff --git a/src/video/winrt/SDL_winrtmouse_c.h b/src/video/winrt/SDL_winrtmouse_c.h index 3735c519e4..1a5438415b 100644 --- a/src/video/winrt/SDL_winrtmouse_c.h +++ b/src/video/winrt/SDL_winrtmouse_c.h @@ -27,8 +27,8 @@ extern "C" { #endif -extern void WINRT_InitMouse(_THIS); -extern void WINRT_QuitMouse(_THIS); +extern void WINRT_InitMouse(SDL_VideoDevice *_this); +extern void WINRT_QuitMouse(SDL_VideoDevice *_this); extern SDL_bool WINRT_UsingRelativeMouseMode; #ifdef __cplusplus diff --git a/src/video/winrt/SDL_winrtopengles.cpp b/src/video/winrt/SDL_winrtopengles.cpp index f61bf0b883..52a1ef5b9b 100644 --- a/src/video/winrt/SDL_winrtopengles.cpp +++ b/src/video/winrt/SDL_winrtopengles.cpp @@ -52,7 +52,7 @@ static const int ANGLE_D3D_FEATURE_LEVEL_ANY = 0; */ extern "C" int -WINRT_GLES_LoadLibrary(_THIS, const char *path) +WINRT_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { SDL_VideoData *video_data = _this->driverdata; @@ -184,7 +184,7 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path) } extern "C" void -WINRT_GLES_UnloadLibrary(_THIS) +WINRT_GLES_UnloadLibrary(SDL_VideoDevice *_this) { SDL_VideoData *video_data = _this->driverdata; diff --git a/src/video/winrt/SDL_winrtopengles.h b/src/video/winrt/SDL_winrtopengles.h index 457c718104..eaebadf553 100644 --- a/src/video/winrt/SDL_winrtopengles.h +++ b/src/video/winrt/SDL_winrtopengles.h @@ -35,11 +35,11 @@ #define WINRT_GLES_GetSwapInterval SDL_EGL_GetSwapInterval #define WINRT_GLES_DeleteContext SDL_EGL_DeleteContext -extern int WINRT_GLES_LoadLibrary(_THIS, const char *path); -extern void WINRT_GLES_UnloadLibrary(_THIS); -extern SDL_GLContext WINRT_GLES_CreateContext(_THIS, SDL_Window *window); -extern int WINRT_GLES_SwapWindow(_THIS, SDL_Window *window); -extern int WINRT_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); +extern int WINRT_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern void WINRT_GLES_UnloadLibrary(SDL_VideoDevice *_this); +extern SDL_GLContext WINRT_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int WINRT_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int WINRT_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); #ifdef __cplusplus diff --git a/src/video/winrt/SDL_winrtpointerinput.cpp b/src/video/winrt/SDL_winrtpointerinput.cpp index 71bcc9e9b9..e30952f9e7 100644 --- a/src/video/winrt/SDL_winrtpointerinput.cpp +++ b/src/video/winrt/SDL_winrtpointerinput.cpp @@ -37,7 +37,7 @@ extern "C" { /* File-specific globals: */ static SDL_TouchID WINRT_TouchID = 1; -void WINRT_InitTouch(_THIS) +void WINRT_InitTouch(SDL_VideoDevice *_this) { SDL_AddTouch(WINRT_TouchID, SDL_TOUCH_DEVICE_DIRECT, ""); } diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index 6fae7c573e..9d11a2a091 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -70,21 +70,21 @@ extern "C" { #include /* Initialization/Query functions */ -static int WINRT_VideoInit(_THIS); -static int WINRT_InitModes(_THIS); -static int WINRT_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -static void WINRT_VideoQuit(_THIS); +static int WINRT_VideoInit(SDL_VideoDevice *_this); +static int WINRT_InitModes(SDL_VideoDevice *_this); +static int WINRT_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +static void WINRT_VideoQuit(SDL_VideoDevice *_this); /* Window functions */ -static int WINRT_CreateWindow(_THIS, SDL_Window *window); -static void WINRT_SetWindowSize(_THIS, SDL_Window *window); -static void WINRT_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); -static void WINRT_DestroyWindow(_THIS, SDL_Window *window); -static int WINRT_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info); +static int WINRT_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +static void WINRT_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +static void WINRT_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); +static void WINRT_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); +static int WINRT_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info); /* Misc functions */ -static ABI::Windows::System::Display::IDisplayRequest *WINRT_CreateDisplayRequest(_THIS); -extern int WINRT_SuspendScreenSaver(_THIS); +static ABI::Windows::System::Display::IDisplayRequest *WINRT_CreateDisplayRequest(SDL_VideoDevice *_this); +extern int WINRT_SuspendScreenSaver(SDL_VideoDevice *_this); /* SDL-internal globals: */ SDL_Window *WINRT_GlobalSDLWindow = NULL; @@ -227,7 +227,7 @@ static void SDLCALL WINRT_SetDisplayOrientationsPreference(void *userdata, const WINRT_DISPLAY_PROPERTY(AutoRotationPreferences) = (DisplayOrientations)orientationFlags; } -int WINRT_VideoInit(_THIS) +int WINRT_VideoInit(SDL_VideoDevice *_this) { SDL_VideoData *driverdata = _this->driverdata; if (WINRT_InitModes(_this) < 0) { @@ -259,7 +259,7 @@ static void WINRT_DXGIModeToSDLDisplayMode(const DXGI_MODE_DESC *dxgiMode, SDL_D sdlMode->format = D3D11_DXGIFormatToSDLPixelFormat(dxgiMode->Format); } -static int WINRT_AddDisplaysForOutput(_THIS, IDXGIAdapter1 *dxgiAdapter1, int outputIndex) +static int WINRT_AddDisplaysForOutput(SDL_VideoDevice *_this, IDXGIAdapter1 *dxgiAdapter1, int outputIndex) { HRESULT hr; IDXGIOutput *dxgiOutput = NULL; @@ -360,7 +360,7 @@ done: return functionResult; } -static int WINRT_AddDisplaysForAdapter(_THIS, IDXGIFactory2 *dxgiFactory2, int adapterIndex) +static int WINRT_AddDisplaysForAdapter(SDL_VideoDevice *_this, IDXGIFactory2 *dxgiFactory2, int adapterIndex) { HRESULT hr; IDXGIAdapter1 *dxgiAdapter1; @@ -444,7 +444,7 @@ static int WINRT_AddDisplaysForAdapter(_THIS, IDXGIFactory2 *dxgiFactory2, int a return 0; } -int WINRT_InitModes(_THIS) +int WINRT_InitModes(SDL_VideoDevice *_this) { /* HACK: Initialize a single display, for whatever screen the app's CoreApplicationView is on. @@ -469,12 +469,12 @@ int WINRT_InitModes(_THIS) return 0; } -static int WINRT_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) +static int WINRT_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -void WINRT_VideoQuit(_THIS) +void WINRT_VideoQuit(SDL_VideoDevice *_this) { SDL_VideoData *driverdata = _this->driverdata; if (driverdata && driverdata->displayRequest) { @@ -590,7 +590,7 @@ static bool WINRT_IsCoreWindowActive(CoreWindow ^ coreWindow) return true; } -int WINRT_CreateWindow(_THIS, SDL_Window *window) +int WINRT_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { // Make sure that only one window gets created, at least until multimonitor // support is added. @@ -740,7 +740,7 @@ int WINRT_CreateWindow(_THIS, SDL_Window *window) return 0; } -void WINRT_SetWindowSize(_THIS, SDL_Window *window) +void WINRT_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { #if NTDDI_VERSION >= NTDDI_WIN10 SDL_WindowData *data = window->driverdata; @@ -749,7 +749,7 @@ void WINRT_SetWindowSize(_THIS, SDL_Window *window) #endif } -void WINRT_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) +void WINRT_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { #if NTDDI_VERSION >= NTDDI_WIN10 SDL_WindowData *data = window->driverdata; @@ -768,7 +768,7 @@ void WINRT_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *disp #endif } -void WINRT_DestroyWindow(_THIS, SDL_Window *window) +void WINRT_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; @@ -784,7 +784,7 @@ void WINRT_DestroyWindow(_THIS, SDL_Window *window) } } -int WINRT_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) +int WINRT_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info) { SDL_WindowData *data = window->driverdata; @@ -793,7 +793,7 @@ int WINRT_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) return 0; } -static ABI::Windows::System::Display::IDisplayRequest *WINRT_CreateDisplayRequest(_THIS) +static ABI::Windows::System::Display::IDisplayRequest *WINRT_CreateDisplayRequest(SDL_VideoDevice *_this) { /* Setup a WinRT DisplayRequest object, usable for enabling/disabling screensaver requests */ const wchar_t *wClassName = L"Windows.System.Display.DisplayRequest"; @@ -837,7 +837,7 @@ done: return pDisplayRequest; } -int WINRT_SuspendScreenSaver(_THIS) +int WINRT_SuspendScreenSaver(SDL_VideoDevice *_this) { SDL_VideoData *driverdata = _this->driverdata; if (driverdata && driverdata->displayRequest) { diff --git a/src/video/x11/SDL_x11clipboard.c b/src/video/x11/SDL_x11clipboard.c index de7b6e79f7..89549fe2a1 100644 --- a/src/video/x11/SDL_x11clipboard.c +++ b/src/video/x11/SDL_x11clipboard.c @@ -28,7 +28,7 @@ #include "SDL_x11clipboard.h" /* Get any application owned window handle for clipboard association */ -static Window GetWindow(_THIS) +static Window GetWindow(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; @@ -113,7 +113,7 @@ Atom X11_GetSDLCutBufferClipboardInternalFormat(Display *display, enum ESDLX11Cl } } -static int SetSelectionText(_THIS, const char *text, Atom selection_type) +static int SetSelectionText(SDL_VideoDevice *_this, const char *text, Atom selection_type) { Display *display = _this->driverdata->display; Window window; @@ -137,7 +137,7 @@ static int SetSelectionText(_THIS, const char *text, Atom selection_type) return 0; } -static char *GetSelectionText(_THIS, Atom selection_type) +static char *GetSelectionText(SDL_VideoDevice *_this, Atom selection_type) { SDL_VideoData *videodata = _this->driverdata; Display *display = videodata->display; @@ -214,7 +214,7 @@ static char *GetSelectionText(_THIS, Atom selection_type) return text; } -int X11_SetClipboardText(_THIS, const char *text) +int X11_SetClipboardText(SDL_VideoDevice *_this, const char *text) { SDL_VideoData *videodata = _this->driverdata; Atom XA_CLIPBOARD = X11_XInternAtom(videodata->display, "CLIPBOARD", 0); @@ -224,13 +224,13 @@ int X11_SetClipboardText(_THIS, const char *text) return SetSelectionText(_this, text, XA_CLIPBOARD); } -int X11_SetPrimarySelectionText(_THIS, const char *text) +int X11_SetPrimarySelectionText(SDL_VideoDevice *_this, const char *text) { return SetSelectionText(_this, text, XA_PRIMARY); } char * -X11_GetClipboardText(_THIS) +X11_GetClipboardText(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; Atom XA_CLIPBOARD = X11_XInternAtom(videodata->display, "CLIPBOARD", 0); @@ -242,13 +242,13 @@ X11_GetClipboardText(_THIS) } char * -X11_GetPrimarySelectionText(_THIS) +X11_GetPrimarySelectionText(SDL_VideoDevice *_this) { return GetSelectionText(_this, XA_PRIMARY); } SDL_bool -X11_HasClipboardText(_THIS) +X11_HasClipboardText(SDL_VideoDevice *_this) { SDL_bool result = SDL_FALSE; char *text = X11_GetClipboardText(_this); @@ -260,7 +260,7 @@ X11_HasClipboardText(_THIS) } SDL_bool -X11_HasPrimarySelectionText(_THIS) +X11_HasPrimarySelectionText(SDL_VideoDevice *_this) { SDL_bool result = SDL_FALSE; char *text = X11_GetPrimarySelectionText(_this); diff --git a/src/video/x11/SDL_x11clipboard.h b/src/video/x11/SDL_x11clipboard.h index 48a6df4c24..24116ae649 100644 --- a/src/video/x11/SDL_x11clipboard.h +++ b/src/video/x11/SDL_x11clipboard.h @@ -34,12 +34,12 @@ enum ESDLX11ClipboardMimeType SDL_X11_CLIPBOARD_MIME_TYPE_MAX }; -extern int X11_SetClipboardText(_THIS, const char *text); -extern char *X11_GetClipboardText(_THIS); -extern SDL_bool X11_HasClipboardText(_THIS); -extern int X11_SetPrimarySelectionText(_THIS, const char *text); -extern char *X11_GetPrimarySelectionText(_THIS); -extern SDL_bool X11_HasPrimarySelectionText(_THIS); +extern int X11_SetClipboardText(SDL_VideoDevice *_this, const char *text); +extern char *X11_GetClipboardText(SDL_VideoDevice *_this); +extern SDL_bool X11_HasClipboardText(SDL_VideoDevice *_this); +extern int X11_SetPrimarySelectionText(SDL_VideoDevice *_this, const char *text); +extern char *X11_GetPrimarySelectionText(SDL_VideoDevice *_this); +extern SDL_bool X11_HasPrimarySelectionText(SDL_VideoDevice *_this); extern Atom X11_GetSDLCutBufferClipboardType(Display *display, enum ESDLX11ClipboardMimeType mime_type, Atom selection_type); extern Atom X11_GetSDLCutBufferClipboardExternalFormat(Display *display, enum ESDLX11ClipboardMimeType mime_type); extern Atom X11_GetSDLCutBufferClipboardInternalFormat(Display *display, enum ESDLX11ClipboardMimeType mime_type); diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 3a24b478f1..fb93446f84 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -348,7 +348,7 @@ static void X11_HandleGenericEvent(SDL_VideoData *videodata, XEvent *xev) } #endif /* SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */ -static unsigned X11_GetNumLockModifierMask(_THIS) +static unsigned X11_GetNumLockModifierMask(SDL_VideoDevice *_this) { SDL_VideoData *viddata = _this->driverdata; Display *display = viddata->display; @@ -373,7 +373,7 @@ static unsigned X11_GetNumLockModifierMask(_THIS) return num_mask; } -static unsigned X11_GetScrollLockModifierMask(_THIS) +static unsigned X11_GetScrollLockModifierMask(SDL_VideoDevice *_this) { SDL_VideoData *viddata = _this->driverdata; Display *display = viddata->display; @@ -398,7 +398,7 @@ static unsigned X11_GetScrollLockModifierMask(_THIS) return num_mask; } -void X11_ReconcileKeyboardState(_THIS) +void X11_ReconcileKeyboardState(SDL_VideoDevice *_this) { SDL_VideoData *viddata = _this->driverdata; Display *display = viddata->display; @@ -447,7 +447,7 @@ void X11_ReconcileKeyboardState(_THIS) } } -static void X11_DispatchFocusIn(_THIS, SDL_WindowData *data) +static void X11_DispatchFocusIn(SDL_VideoDevice *_this, SDL_WindowData *data) { #ifdef DEBUG_XEVENTS printf("window %p: Dispatching FocusIn\n", data); @@ -467,7 +467,7 @@ static void X11_DispatchFocusIn(_THIS, SDL_WindowData *data) } } -static void X11_DispatchFocusOut(_THIS, SDL_WindowData *data) +static void X11_DispatchFocusOut(SDL_VideoDevice *_this, SDL_WindowData *data) { #ifdef DEBUG_XEVENTS printf("window %p: Dispatching FocusOut\n", data); @@ -505,7 +505,7 @@ static void X11_DispatchUnmapNotify(SDL_WindowData *data) SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_MINIMIZED, 0, 0); } -static void InitiateWindowMove(_THIS, const SDL_WindowData *data, const SDL_Point *point) +static void InitiateWindowMove(SDL_VideoDevice *_this, const SDL_WindowData *data, const SDL_Point *point) { SDL_VideoData *viddata = _this->driverdata; SDL_Window *window = data->window; @@ -530,7 +530,7 @@ static void InitiateWindowMove(_THIS, const SDL_WindowData *data, const SDL_Poin X11_XSync(display, 0); } -static void InitiateWindowResize(_THIS, const SDL_WindowData *data, const SDL_Point *point, int direction) +static void InitiateWindowResize(SDL_VideoDevice *_this, const SDL_WindowData *data, const SDL_Point *point, int direction) { SDL_VideoData *viddata = _this->driverdata; SDL_Window *window = data->window; @@ -559,7 +559,7 @@ static void InitiateWindowResize(_THIS, const SDL_WindowData *data, const SDL_Po X11_XSync(display, 0); } -static SDL_bool ProcessHitTest(_THIS, const SDL_WindowData *data, const XEvent *xev) +static SDL_bool ProcessHitTest(SDL_VideoDevice *_this, const SDL_WindowData *data, const XEvent *xev) { SDL_Window *window = data->window; @@ -612,7 +612,7 @@ static void X11_UpdateUserTime(SDL_WindowData *data, const unsigned long latest) } } -static void X11_HandleClipboardEvent(_THIS, const XEvent *xevent) +static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xevent) { int i; SDL_VideoData *videodata = _this->driverdata; @@ -778,7 +778,7 @@ void X11_GetBorderValues(SDL_WindowData *data) } } -static void X11_DispatchEvent(_THIS, XEvent *xevent) +static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) { SDL_VideoData *videodata = _this->driverdata; Display *display; @@ -1600,7 +1600,7 @@ static void X11_DispatchEvent(_THIS, XEvent *xevent) } } -static void X11_HandleFocusChanges(_THIS) +static void X11_HandleFocusChanges(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; int i; @@ -1637,7 +1637,7 @@ static SDL_bool X11_PollEvent(Display *display, XEvent *event) return SDL_TRUE; } -void X11_SendWakeupEvent(_THIS, SDL_Window *window) +void X11_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *data = _this->driverdata; Display *req_display = data->request_display; @@ -1657,7 +1657,7 @@ void X11_SendWakeupEvent(_THIS, SDL_Window *window) X11_XFlush(req_display); } -int X11_WaitEventTimeout(_THIS, Sint64 timeoutNS) +int X11_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) { SDL_VideoData *videodata = _this->driverdata; Display *display; @@ -1711,7 +1711,7 @@ int X11_WaitEventTimeout(_THIS, Sint64 timeoutNS) return 1; } -void X11_PumpEvents(_THIS) +void X11_PumpEvents(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; XEvent xevent; @@ -1767,7 +1767,7 @@ void X11_PumpEvents(_THIS) } } -int X11_SuspendScreenSaver(_THIS) +int X11_SuspendScreenSaver(SDL_VideoDevice *_this) { #ifdef SDL_VIDEO_DRIVER_X11_XSCRNSAVER SDL_VideoData *data = _this->driverdata; diff --git a/src/video/x11/SDL_x11events.h b/src/video/x11/SDL_x11events.h index 55b204b32c..58cdb8dabb 100644 --- a/src/video/x11/SDL_x11events.h +++ b/src/video/x11/SDL_x11events.h @@ -23,11 +23,11 @@ #ifndef SDL_x11events_h_ #define SDL_x11events_h_ -extern void X11_PumpEvents(_THIS); -extern int X11_WaitEventTimeout(_THIS, Sint64 timeoutNS); -extern void X11_SendWakeupEvent(_THIS, SDL_Window *window); -extern int X11_SuspendScreenSaver(_THIS); -extern void X11_ReconcileKeyboardState(_THIS); +extern void X11_PumpEvents(SDL_VideoDevice *_this); +extern int X11_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS); +extern void X11_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_SuspendScreenSaver(SDL_VideoDevice *_this); +extern void X11_ReconcileKeyboardState(SDL_VideoDevice *_this); extern void X11_GetBorderValues(SDL_WindowData *data); #endif /* SDL_x11events_h_ */ diff --git a/src/video/x11/SDL_x11framebuffer.c b/src/video/x11/SDL_x11framebuffer.c index 209c666d63..21bf7d2fcd 100644 --- a/src/video/x11/SDL_x11framebuffer.c +++ b/src/video/x11/SDL_x11framebuffer.c @@ -48,7 +48,7 @@ static SDL_bool have_mitshm(Display *dpy) #endif /* !NO_SHARED_MEMORY */ -int X11_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, +int X11_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_WindowData *data = window->driverdata; @@ -143,7 +143,7 @@ int X11_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, return 0; } -int X11_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, +int X11_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { SDL_WindowData *data = window->driverdata; @@ -222,7 +222,7 @@ int X11_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects return 0; } -void X11_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +void X11_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; Display *display; diff --git a/src/video/x11/SDL_x11framebuffer.h b/src/video/x11/SDL_x11framebuffer.h index 10ec01af86..8362346285 100644 --- a/src/video/x11/SDL_x11framebuffer.h +++ b/src/video/x11/SDL_x11framebuffer.h @@ -24,11 +24,11 @@ #include "SDL_internal.h" -extern int X11_CreateWindowFramebuffer(_THIS, SDL_Window *window, +extern int X11_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); -extern int X11_UpdateWindowFramebuffer(_THIS, SDL_Window *window, +extern int X11_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); -extern void X11_DestroyWindowFramebuffer(_THIS, SDL_Window *window); +extern void X11_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_x11framebuffer_h_ */ diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 668b653547..d557db869d 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -70,7 +70,7 @@ static SDL_bool X11_ScancodeIsRemappable(SDL_Scancode scancode) } /* This function only correctly maps letters and numbers for keyboards in US QWERTY layout */ -static SDL_Scancode X11_KeyCodeToSDLScancode(_THIS, KeyCode keycode) +static SDL_Scancode X11_KeyCodeToSDLScancode(SDL_VideoDevice *_this, KeyCode keycode) { const KeySym keysym = X11_KeyCodeToSym(_this, keycode, 0); @@ -81,7 +81,7 @@ static SDL_Scancode X11_KeyCodeToSDLScancode(_THIS, KeyCode keycode) return SDL_GetScancodeFromKeySym(keysym, keycode); } -static Uint32 X11_KeyCodeToUcs4(_THIS, KeyCode keycode, unsigned char group) +static Uint32 X11_KeyCodeToUcs4(SDL_VideoDevice *_this, KeyCode keycode, unsigned char group) { KeySym keysym = X11_KeyCodeToSym(_this, keycode, group); @@ -93,7 +93,7 @@ static Uint32 X11_KeyCodeToUcs4(_THIS, KeyCode keycode, unsigned char group) } KeySym -X11_KeyCodeToSym(_THIS, KeyCode keycode, unsigned char group) +X11_KeyCodeToSym(SDL_VideoDevice *_this, KeyCode keycode, unsigned char group) { SDL_VideoData *data = _this->driverdata; KeySym keysym; @@ -129,7 +129,7 @@ X11_KeyCodeToSym(_THIS, KeyCode keycode, unsigned char group) return keysym; } -int X11_InitKeyboard(_THIS) +int X11_InitKeyboard(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; int i = 0; @@ -335,7 +335,7 @@ int X11_InitKeyboard(_THIS) return 0; } -void X11_UpdateKeymap(_THIS, SDL_bool send_event) +void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) { SDL_VideoData *data = _this->driverdata; int i; @@ -397,7 +397,7 @@ void X11_UpdateKeymap(_THIS, SDL_bool send_event) SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES, send_event); } -void X11_QuitKeyboard(_THIS) +void X11_QuitKeyboard(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; @@ -413,7 +413,7 @@ void X11_QuitKeyboard(_THIS) #endif } -static void X11_ResetXIM(_THIS) +static void X11_ResetXIM(SDL_VideoDevice *_this) { #ifdef X_HAVE_UTF8_STRING SDL_VideoData *videodata = _this->driverdata; @@ -434,12 +434,12 @@ static void X11_ResetXIM(_THIS) #endif } -void X11_StartTextInput(_THIS) +void X11_StartTextInput(SDL_VideoDevice *_this) { X11_ResetXIM(_this); } -void X11_StopTextInput(_THIS) +void X11_StopTextInput(SDL_VideoDevice *_this) { X11_ResetXIM(_this); #ifdef SDL_USE_IME @@ -447,7 +447,7 @@ void X11_StopTextInput(_THIS) #endif } -int X11_SetTextInputRect(_THIS, const SDL_Rect *rect) +int X11_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) { #ifdef SDL_USE_IME SDL_IME_UpdateTextRect(rect); @@ -456,13 +456,13 @@ int X11_SetTextInputRect(_THIS, const SDL_Rect *rect) } SDL_bool -X11_HasScreenKeyboardSupport(_THIS) +X11_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; return videodata->is_steam_deck; } -void X11_ShowScreenKeyboard(_THIS, SDL_Window *window) +void X11_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *videodata = _this->driverdata; @@ -479,7 +479,7 @@ void X11_ShowScreenKeyboard(_THIS, SDL_Window *window) } } -void X11_HideScreenKeyboard(_THIS, SDL_Window *window) +void X11_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *videodata = _this->driverdata; @@ -490,7 +490,7 @@ void X11_HideScreenKeyboard(_THIS, SDL_Window *window) } SDL_bool -X11_IsScreenKeyboardShown(_THIS, SDL_Window *window) +X11_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *videodata = _this->driverdata; diff --git a/src/video/x11/SDL_x11keyboard.h b/src/video/x11/SDL_x11keyboard.h index 40355ff625..45ab01dc06 100644 --- a/src/video/x11/SDL_x11keyboard.h +++ b/src/video/x11/SDL_x11keyboard.h @@ -23,16 +23,16 @@ #ifndef SDL_x11keyboard_h_ #define SDL_x11keyboard_h_ -extern int X11_InitKeyboard(_THIS); -extern void X11_UpdateKeymap(_THIS, SDL_bool send_event); -extern void X11_QuitKeyboard(_THIS); -extern void X11_StartTextInput(_THIS); -extern void X11_StopTextInput(_THIS); -extern int X11_SetTextInputRect(_THIS, const SDL_Rect *rect); -extern SDL_bool X11_HasScreenKeyboardSupport(_THIS); -extern void X11_ShowScreenKeyboard(_THIS, SDL_Window *window); -extern void X11_HideScreenKeyboard(_THIS, SDL_Window *window); -extern SDL_bool X11_IsScreenKeyboardShown(_THIS, SDL_Window *window); -extern KeySym X11_KeyCodeToSym(_THIS, KeyCode, unsigned char group); +extern int X11_InitKeyboard(SDL_VideoDevice *_this); +extern void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event); +extern void X11_QuitKeyboard(SDL_VideoDevice *_this); +extern void X11_StartTextInput(SDL_VideoDevice *_this); +extern void X11_StopTextInput(SDL_VideoDevice *_this); +extern int X11_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); +extern SDL_bool X11_HasScreenKeyboardSupport(SDL_VideoDevice *_this); +extern void X11_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); +extern SDL_bool X11_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); +extern KeySym X11_KeyCodeToSym(SDL_VideoDevice *_this, KeyCode, unsigned char group); #endif /* SDL_x11keyboard_h_ */ diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index f14222b251..0df8f64299 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -284,7 +284,7 @@ static void SetXRandRDisplayName(Display *dpy, Atom EDID, char *name, const size #endif } -static int X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput outputid, XRRScreenResources *res, SDL_bool send_event) +static int X11_AddXRandRDisplay(SDL_VideoDevice *_this, Display *dpy, int screen, RROutput outputid, XRRScreenResources *res, SDL_bool send_event) { Atom EDID = X11_XInternAtom(dpy, "EDID", False); XRROutputInfo *output_info; @@ -391,7 +391,7 @@ static int X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput output return 0; } -static void X11_HandleXRandROutputChange(_THIS, const XRROutputChangeNotifyEvent *ev) +static void X11_HandleXRandROutputChange(SDL_VideoDevice *_this, const XRROutputChangeNotifyEvent *ev) { SDL_DisplayID *displays; SDL_VideoDisplay *display = NULL; @@ -443,7 +443,7 @@ static void X11_HandleXRandROutputChange(_THIS, const XRROutputChangeNotifyEvent } } -void X11_HandleXRandREvent(_THIS, const XEvent *xevent) +void X11_HandleXRandREvent(SDL_VideoDevice *_this, const XEvent *xevent) { SDL_VideoData *videodata = _this->driverdata; SDL_assert(xevent->type == (videodata->xrandr_event_base + RRNotify)); @@ -457,7 +457,7 @@ void X11_HandleXRandREvent(_THIS, const XEvent *xevent) } } -static int X11_InitModes_XRandR(_THIS) +static int X11_InitModes_XRandR(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; Display *dpy = data->display; @@ -523,7 +523,7 @@ static int X11_InitModes_XRandR(_THIS) /* This is used if there's no better functionality--like XRandR--to use. It won't attempt to supply different display modes at all, but it can enumerate the current displays and their current sizes. */ -static int X11_InitModes_StdXlib(_THIS) +static int X11_InitModes_StdXlib(SDL_VideoDevice *_this) { /* !!! FIXME: a lot of copy/paste from X11_InitModes_XRandR in this function. */ SDL_VideoData *data = _this->driverdata; @@ -598,7 +598,7 @@ static int X11_InitModes_StdXlib(_THIS) return 0; } -int X11_InitModes(_THIS) +int X11_InitModes(SDL_VideoDevice *_this) { /* XRandR is the One True Modern Way to do this on X11. If this fails, we just won't report any display modes except the current @@ -619,7 +619,7 @@ int X11_InitModes(_THIS) return X11_InitModes_StdXlib(_this); } -int X11_GetDisplayModes(_THIS, SDL_VideoDisplay *sdl_display) +int X11_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display) { #ifdef SDL_VIDEO_DRIVER_X11_XRANDR SDL_DisplayData *data = sdl_display->driverdata; @@ -683,7 +683,7 @@ static int SDL_XRRSetScreenSizeErrHandler(Display *d, XErrorEvent *e) } #endif -int X11_SetDisplayMode(_THIS, SDL_VideoDisplay *sdl_display, SDL_DisplayMode *mode) +int X11_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SDL_DisplayMode *mode) { SDL_VideoData *viddata = _this->driverdata; SDL_DisplayData *data = sdl_display->driverdata; @@ -772,11 +772,11 @@ int X11_SetDisplayMode(_THIS, SDL_VideoDisplay *sdl_display, SDL_DisplayMode *mo return 0; } -void X11_QuitModes(_THIS) +void X11_QuitModes(SDL_VideoDevice *_this) { } -int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect) +int X11_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SDL_Rect *rect) { SDL_DisplayData *data = sdl_display->driverdata; @@ -787,7 +787,7 @@ int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect) return 0; } -int X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect) +int X11_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SDL_Rect *rect) { SDL_VideoData *data = _this->driverdata; Display *display = data->display; diff --git a/src/video/x11/SDL_x11modes.h b/src/video/x11/SDL_x11modes.h index 1606394958..9d78cb1e10 100644 --- a/src/video/x11/SDL_x11modes.h +++ b/src/video/x11/SDL_x11modes.h @@ -48,21 +48,21 @@ struct SDL_DisplayModeData #endif }; -extern int X11_InitModes(_THIS); -extern int X11_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -extern int X11_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -extern void X11_QuitModes(_THIS); +extern int X11_InitModes(SDL_VideoDevice *_this); +extern int X11_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); +extern int X11_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +extern void X11_QuitModes(SDL_VideoDevice *_this); /* Some utility functions for working with visuals */ extern int X11_GetVisualInfoFromVisual(Display *display, Visual *visual, XVisualInfo *vinfo); extern Uint32 X11_GetPixelFormatFromVisualInfo(Display *display, XVisualInfo *vinfo); -extern int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect); -extern int X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect); +extern int X11_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SDL_Rect *rect); +extern int X11_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SDL_Rect *rect); #ifdef SDL_VIDEO_DRIVER_X11_XRANDR -extern void X11_HandleXRandREvent(_THIS, const XEvent *xevent); +extern void X11_HandleXRandREvent(SDL_VideoDevice *_this, const XEvent *xevent); #endif #endif /* SDL_x11modes_h_ */ diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index 3131dc4319..51eda30f32 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -463,7 +463,7 @@ static Uint32 X11_GetGlobalMouseState(float *x, float *y) return videodata->global_mouse_buttons; } -void X11_InitMouse(_THIS) +void X11_InitMouse(SDL_VideoDevice *_this) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -480,7 +480,7 @@ void X11_InitMouse(_THIS) SDL_SetDefaultCursor(X11_CreateDefaultCursor()); } -void X11_QuitMouse(_THIS) +void X11_QuitMouse(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; SDL_XInput2DeviceInfo *i; diff --git a/src/video/x11/SDL_x11mouse.h b/src/video/x11/SDL_x11mouse.h index 313cb487ce..96e0f93195 100644 --- a/src/video/x11/SDL_x11mouse.h +++ b/src/video/x11/SDL_x11mouse.h @@ -33,7 +33,7 @@ typedef struct SDL_XInput2DeviceInfo struct SDL_XInput2DeviceInfo *next; } SDL_XInput2DeviceInfo; -extern void X11_InitMouse(_THIS); -extern void X11_QuitMouse(_THIS); +extern void X11_InitMouse(SDL_VideoDevice *_this); +extern void X11_QuitMouse(SDL_VideoDevice *_this); #endif /* SDL_x11mouse_h_ */ diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index 401e0c7799..836e879768 100644 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -159,9 +159,9 @@ typedef GLXContext (*PFNGLXCREATECONTEXTATTRIBSARBPROC)(Display *dpy, #define GL_UnloadObject SDL_UnloadObject #endif -static void X11_GL_InitExtensions(_THIS); +static void X11_GL_InitExtensions(SDL_VideoDevice *_this); -int X11_GL_LoadLibrary(_THIS, const char *path) +int X11_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path) { Display *display; void *handle; @@ -270,7 +270,7 @@ int X11_GL_LoadLibrary(_THIS, const char *path) return 0; } -SDL_FunctionPointer X11_GL_GetProcAddress(_THIS, const char *proc) +SDL_FunctionPointer X11_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc) { if (_this->gl_data->glXGetProcAddress) { return _this->gl_data->glXGetProcAddress((const GLubyte *)proc); @@ -278,7 +278,7 @@ SDL_FunctionPointer X11_GL_GetProcAddress(_THIS, const char *proc) return GL_LoadFunction(_this->gl_config.dll_handle, proc); } -void X11_GL_UnloadLibrary(_THIS) +void X11_GL_UnloadLibrary(SDL_VideoDevice *_this) { /* Don't actually unload the library, since it may have registered * X11 shutdown hooks, per the notes at: @@ -333,7 +333,7 @@ static SDL_bool HasExtension(const char *extension, const char *extensions) return SDL_FALSE; } -static void X11_GL_InitExtensions(_THIS) +static void X11_GL_InitExtensions(SDL_VideoDevice *_this) { Display *display = _this->driverdata->display; const int screen = DefaultScreen(display); @@ -484,7 +484,7 @@ static void X11_GL_InitExtensions(_THIS) * In case of failure, if that pointer is not NULL, set that pointer to None * and try again. */ -static int X11_GL_GetAttributes(_THIS, Display *display, int screen, int *attribs, int size, Bool for_FBConfig, int **_pvistypeattr, SDL_bool transparent) +static int X11_GL_GetAttributes(SDL_VideoDevice *_this, Display *display, int screen, int *attribs, int size, Bool for_FBConfig, int **_pvistypeattr, SDL_bool transparent) { int i = 0; const int MAX_ATTRIBUTES = 64; @@ -605,7 +605,7 @@ static int X11_GL_GetAttributes(_THIS, Display *display, int screen, int *attrib return i; } -XVisualInfo *X11_GL_GetVisual(_THIS, Display *display, int screen, SDL_bool transparent) +XVisualInfo *X11_GL_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, SDL_bool transparent) { /* 64 seems nice. */ int attribs[64]; @@ -693,7 +693,7 @@ static int X11_GL_ErrorHandler(Display *d, XErrorEvent *e) return (0); } -SDL_bool X11_GL_UseEGL(_THIS) +SDL_bool X11_GL_UseEGL(SDL_VideoDevice *_this) { SDL_assert(_this->gl_data != NULL); if (SDL_GetHintBoolean(SDL_HINT_VIDEO_FORCE_EGL, SDL_FALSE)) { @@ -706,7 +706,7 @@ SDL_bool X11_GL_UseEGL(_THIS) || _this->gl_config.major_version > _this->gl_data->es_profile_max_supported_version.major || (_this->gl_config.major_version == _this->gl_data->es_profile_max_supported_version.major && _this->gl_config.minor_version > _this->gl_data->es_profile_max_supported_version.minor)); } -SDL_GLContext X11_GL_CreateContext(_THIS, SDL_Window *window) +SDL_GLContext X11_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -839,7 +839,7 @@ SDL_GLContext X11_GL_CreateContext(_THIS, SDL_Window *window) return context; } -int X11_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int X11_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { Display *display = _this->driverdata->display; Window drawable = @@ -878,7 +878,7 @@ int X11_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) */ static int swapinterval = 0; -int X11_GL_SetSwapInterval(_THIS, int interval) +int X11_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval) { int status = -1; @@ -925,7 +925,7 @@ int X11_GL_SetSwapInterval(_THIS, int interval) return status; } -int X11_GL_GetSwapInterval(_THIS, int *interval) +int X11_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval) { if (_this->gl_data->glXSwapIntervalEXT) { Display *display = _this->driverdata->display; @@ -963,7 +963,7 @@ int X11_GL_GetSwapInterval(_THIS, int *interval) } } -int X11_GL_SwapWindow(_THIS, SDL_Window *window) +int X11_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -972,7 +972,7 @@ int X11_GL_SwapWindow(_THIS, SDL_Window *window) return 0; } -int X11_GL_DeleteContext(_THIS, SDL_GLContext context) +int X11_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { Display *display = _this->driverdata->display; GLXContext glx_context = (GLXContext)context; diff --git a/src/video/x11/SDL_x11opengl.h b/src/video/x11/SDL_x11opengl.h index 5c5720877f..f49f556683 100644 --- a/src/video/x11/SDL_x11opengl.h +++ b/src/video/x11/SDL_x11opengl.h @@ -68,18 +68,18 @@ struct SDL_GLDriverData }; /* OpenGL functions */ -extern int X11_GL_LoadLibrary(_THIS, const char *path); -extern SDL_FunctionPointer X11_GL_GetProcAddress(_THIS, const char *proc); -extern void X11_GL_UnloadLibrary(_THIS); -extern SDL_bool X11_GL_UseEGL(_THIS); -extern XVisualInfo *X11_GL_GetVisual(_THIS, Display *display, int screen, SDL_bool transparent); -extern SDL_GLContext X11_GL_CreateContext(_THIS, SDL_Window *window); -extern int X11_GL_MakeCurrent(_THIS, SDL_Window *window, +extern int X11_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern SDL_FunctionPointer X11_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); +extern void X11_GL_UnloadLibrary(SDL_VideoDevice *_this); +extern SDL_bool X11_GL_UseEGL(SDL_VideoDevice *_this); +extern XVisualInfo *X11_GL_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, SDL_bool transparent); +extern SDL_GLContext X11_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); -extern int X11_GL_SetSwapInterval(_THIS, int interval); -extern int X11_GL_GetSwapInterval(_THIS, int *interval); -extern int X11_GL_SwapWindow(_THIS, SDL_Window *window); -extern int X11_GL_DeleteContext(_THIS, SDL_GLContext context); +extern int X11_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval); +extern int X11_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval); +extern int X11_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context); #endif /* SDL_VIDEO_OPENGL_GLX */ diff --git a/src/video/x11/SDL_x11opengles.c b/src/video/x11/SDL_x11opengles.c index 4490ca51eb..979b8ce75a 100644 --- a/src/video/x11/SDL_x11opengles.c +++ b/src/video/x11/SDL_x11opengles.c @@ -28,7 +28,7 @@ /* EGL implementation of SDL OpenGL support */ -int X11_GLES_LoadLibrary(_THIS, const char *path) +int X11_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { SDL_VideoData *data = _this->driverdata; @@ -56,7 +56,7 @@ int X11_GLES_LoadLibrary(_THIS, const char *path) } XVisualInfo * -X11_GLES_GetVisual(_THIS, Display *display, int screen, SDL_bool transparent) +X11_GLES_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, SDL_bool transparent) { XVisualInfo *egl_visualinfo = NULL; @@ -106,7 +106,7 @@ X11_GLES_GetVisual(_THIS, Display *display, int screen, SDL_bool transparent) } SDL_GLContext -X11_GLES_CreateContext(_THIS, SDL_Window *window) +X11_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_GLContext context; SDL_WindowData *data = window->driverdata; @@ -120,7 +120,7 @@ X11_GLES_CreateContext(_THIS, SDL_Window *window) } SDL_EGLSurface -X11_GLES_GetEGLSurface(_THIS, SDL_Window *window) +X11_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; return data->egl_surface; diff --git a/src/video/x11/SDL_x11opengles.h b/src/video/x11/SDL_x11opengles.h index 41e4b7aa2a..a4237b5edb 100644 --- a/src/video/x11/SDL_x11opengles.h +++ b/src/video/x11/SDL_x11opengles.h @@ -43,12 +43,12 @@ typedef struct SDL_PrivateGLESData #define X11_GLES_GetSwapInterval SDL_EGL_GetSwapInterval #define X11_GLES_DeleteContext SDL_EGL_DeleteContext -extern int X11_GLES_LoadLibrary(_THIS, const char *path); -extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display *display, int screen, SDL_bool transparent); -extern SDL_GLContext X11_GLES_CreateContext(_THIS, SDL_Window *window); -extern int X11_GLES_SwapWindow(_THIS, SDL_Window *window); -extern int X11_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); -extern SDL_EGLSurface X11_GLES_GetEGLSurface(_THIS, SDL_Window *window); +extern int X11_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); +extern XVisualInfo *X11_GLES_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, SDL_bool transparent); +extern SDL_GLContext X11_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); +extern SDL_EGLSurface X11_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/x11/SDL_x11touch.c b/src/video/x11/SDL_x11touch.c index a1c96acd07..681e9d9c4b 100644 --- a/src/video/x11/SDL_x11touch.c +++ b/src/video/x11/SDL_x11touch.c @@ -27,17 +27,17 @@ #include "SDL_x11xinput2.h" #include "../../events/SDL_touch_c.h" -void X11_InitTouch(_THIS) +void X11_InitTouch(SDL_VideoDevice *_this) { X11_InitXinput2Multitouch(_this); } -void X11_QuitTouch(_THIS) +void X11_QuitTouch(SDL_VideoDevice *_this) { SDL_QuitTouch(); } -void X11_ResetTouch(_THIS) +void X11_ResetTouch(SDL_VideoDevice *_this) { X11_QuitTouch(_this); X11_InitTouch(_this); diff --git a/src/video/x11/SDL_x11touch.h b/src/video/x11/SDL_x11touch.h index 5ce9902e59..93f66a879d 100644 --- a/src/video/x11/SDL_x11touch.h +++ b/src/video/x11/SDL_x11touch.h @@ -23,8 +23,8 @@ #ifndef SDL_x11touch_h_ #define SDL_x11touch_h_ -extern void X11_InitTouch(_THIS); -extern void X11_QuitTouch(_THIS); -extern void X11_ResetTouch(_THIS); +extern void X11_InitTouch(SDL_VideoDevice *_this); +extern void X11_QuitTouch(SDL_VideoDevice *_this); +extern void X11_ResetTouch(SDL_VideoDevice *_this); #endif /* SDL_x11touch_h_ */ diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 3405a29bb6..7d26a685cd 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -42,8 +42,8 @@ #include "SDL_x11vulkan.h" /* Initialization/Query functions */ -static int X11_VideoInit(_THIS); -static void X11_VideoQuit(_THIS); +static int X11_VideoInit(SDL_VideoDevice *_this); +static void X11_VideoQuit(SDL_VideoDevice *_this); /* Find out what class name we should use */ static char *get_classname(void) @@ -341,7 +341,7 @@ static int X11_CheckWindowManagerErrorHandler(Display *d, XErrorEvent *e) } } -static void X11_CheckWindowManager(_THIS) +static void X11_CheckWindowManager(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; Display *display = data->display; @@ -401,7 +401,7 @@ static void X11_CheckWindowManager(_THIS) #endif } -int X11_VideoInit(_THIS) +int X11_VideoInit(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; @@ -479,7 +479,7 @@ int X11_VideoInit(_THIS) return 0; } -void X11_VideoQuit(_THIS) +void X11_VideoQuit(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; diff --git a/src/video/x11/SDL_x11vulkan.c b/src/video/x11/SDL_x11vulkan.c index 8a2a6fe565..e04c00721b 100644 --- a/src/video/x11/SDL_x11vulkan.c +++ b/src/video/x11/SDL_x11vulkan.c @@ -40,7 +40,7 @@ typedef uint32_t xcb_window_t; typedef uint32_t xcb_visualid_t; */ -int X11_Vulkan_LoadLibrary(_THIS, const char *path) +int X11_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path) { SDL_VideoData *videoData = _this->driverdata; VkExtensionProperties *extensions = NULL; @@ -128,7 +128,7 @@ fail: return -1; } -void X11_Vulkan_UnloadLibrary(_THIS) +void X11_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) { SDL_VideoData *videoData = _this->driverdata; if (_this->vulkan_config.loader_handle) { @@ -140,7 +140,7 @@ void X11_Vulkan_UnloadLibrary(_THIS) } } -SDL_bool X11_Vulkan_GetInstanceExtensions(_THIS, +SDL_bool X11_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names) { @@ -166,7 +166,7 @@ SDL_bool X11_Vulkan_GetInstanceExtensions(_THIS, } } -SDL_bool X11_Vulkan_CreateSurface(_THIS, +SDL_bool X11_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface) diff --git a/src/video/x11/SDL_x11vulkan.h b/src/video/x11/SDL_x11vulkan.h index ad5c069a4e..f9b99101ca 100644 --- a/src/video/x11/SDL_x11vulkan.h +++ b/src/video/x11/SDL_x11vulkan.h @@ -30,12 +30,12 @@ /*typedef struct xcb_connection_t xcb_connection_t;*/ typedef xcb_connection_t *(*PFN_XGetXCBConnection)(Display *dpy); -int X11_Vulkan_LoadLibrary(_THIS, const char *path); -void X11_Vulkan_UnloadLibrary(_THIS); -SDL_bool X11_Vulkan_GetInstanceExtensions(_THIS, +int X11_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); +void X11_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); +SDL_bool X11_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, unsigned *count, const char **names); -SDL_bool X11_Vulkan_CreateSurface(_THIS, +SDL_bool X11_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 1ee5f5fc90..f92cc1f9d1 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -72,7 +72,7 @@ static Bool X11_XIfEventTimeout(Display *display, XEvent *event_return, Bool (*p } */ -static SDL_bool X11_IsWindowMapped(_THIS, SDL_Window *window) +static SDL_bool X11_IsWindowMapped(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; SDL_VideoData *videodata = _this->driverdata; @@ -112,7 +112,7 @@ static SDL_bool X11_IsActionAllowed(SDL_Window *window, Atom action) } #endif /* 0 */ -void X11_SetNetWMState(_THIS, Window xwindow, Uint32 flags) +void X11_SetNetWMState(SDL_VideoDevice *_this, Window xwindow, Uint32 flags) { SDL_VideoData *videodata = _this->driverdata; Display *display = videodata->display; @@ -219,7 +219,7 @@ static void X11_SetKeyboardFocus(SDL_Window *window) } Uint32 -X11_GetNetWMState(_THIS, SDL_Window *window, Window xwindow) +X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwindow) { SDL_VideoData *videodata = _this->driverdata; Display *display = videodata->display; @@ -305,7 +305,7 @@ X11_GetNetWMState(_THIS, SDL_Window *window, Window xwindow) return flags; } -static int SetupWindowData(_THIS, SDL_Window *window, Window w, BOOL created) +static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, Window w, BOOL created) { SDL_VideoData *videodata = _this->driverdata; SDL_WindowData *data; @@ -423,7 +423,7 @@ static void SetWindowBordered(Display *display, int screen, Window window, SDL_b } } -int X11_CreateWindow(_THIS, SDL_Window *window) +int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *data = _this->driverdata; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); @@ -764,7 +764,7 @@ int X11_CreateWindow(_THIS, SDL_Window *window) return 0; } -int X11_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) +int X11_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data) { Window w = (Window)data; @@ -777,7 +777,7 @@ int X11_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) } char * -X11_GetWindowTitle(_THIS, Window xwindow) +X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow) { SDL_VideoData *data = _this->driverdata; Display *display = data->display; @@ -809,7 +809,7 @@ X11_GetWindowTitle(_THIS, Window xwindow) return title; } -void X11_SetWindowTitle(_THIS, SDL_Window *window) +void X11_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; Window xwindow = data->xwindow; @@ -828,7 +828,7 @@ static int X11_CatchAnyError(Display *d, XErrorEvent *e) return 0; } -int X11_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) +int X11_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -959,7 +959,7 @@ void X11_UpdateWindowPosition(SDL_Window *window) } } -int X11_SetWindowPosition(_THIS, SDL_Window *window) +int X11_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { if (SDL_WINDOW_IS_POPUP(window)) { X11_ConstrainPopup(window); @@ -968,7 +968,7 @@ int X11_SetWindowPosition(_THIS, SDL_Window *window) return 0; } -static void X11_SetWMNormalHints(_THIS, SDL_Window *window, XSizeHints *sizehints) +static void X11_SetWMNormalHints(SDL_VideoDevice *_this, SDL_Window *window, XSizeHints *sizehints) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -1001,7 +1001,7 @@ static void X11_SetWMNormalHints(_THIS, SDL_Window *window, XSizeHints *sizehint X11_XRaiseWindow(display, data->xwindow); } -void X11_SetWindowMinimumSize(_THIS, SDL_Window *window) +void X11_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -1024,7 +1024,7 @@ void X11_SetWindowMinimumSize(_THIS, SDL_Window *window) X11_XFlush(display); } -void X11_SetWindowMaximumSize(_THIS, SDL_Window *window) +void X11_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -1047,7 +1047,7 @@ void X11_SetWindowMaximumSize(_THIS, SDL_Window *window) X11_XFlush(display); } -void X11_SetWindowSize(_THIS, SDL_Window *window) +void X11_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -1123,7 +1123,7 @@ void X11_SetWindowSize(_THIS, SDL_Window *window) caught_x11_error = SDL_FALSE; } -int X11_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right) +int X11_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right) { SDL_WindowData *data = window->driverdata; @@ -1135,7 +1135,7 @@ int X11_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int return 0; } -int X11_SetWindowOpacity(_THIS, SDL_Window *window, float opacity) +int X11_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -1153,7 +1153,7 @@ int X11_SetWindowOpacity(_THIS, SDL_Window *window, float opacity) return 0; } -int X11_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window) +int X11_SetWindowModalFor(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window) { SDL_WindowData *data = modal_window->driverdata; SDL_WindowData *parent_data = parent_window->driverdata; @@ -1163,7 +1163,7 @@ int X11_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_wi return 0; } -int X11_SetWindowInputFocus(_THIS, SDL_Window *window) +int X11_SetWindowInputFocus(SDL_VideoDevice *_this, SDL_Window *window) { if (X11_IsWindowMapped(_this, window)) { SDL_WindowData *data = window->driverdata; @@ -1175,7 +1175,7 @@ int X11_SetWindowInputFocus(_THIS, SDL_Window *window) return -1; } -void X11_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) +void X11_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered) { const SDL_bool focused = (window->flags & SDL_WINDOW_INPUT_FOCUS) ? SDL_TRUE : SDL_FALSE; const SDL_bool visible = (!(window->flags & SDL_WINDOW_HIDDEN)) ? SDL_TRUE : SDL_FALSE; @@ -1209,7 +1209,7 @@ void X11_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) X11_XSync(display, False); } -void X11_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) +void X11_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -1241,7 +1241,7 @@ void X11_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) X11_XFlush(display); } -void X11_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top) +void X11_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top) { SDL_WindowData *data = window->driverdata; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); @@ -1270,7 +1270,7 @@ void X11_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top) X11_XFlush(display); } -void X11_ShowWindow(_THIS, SDL_Window *window) +void X11_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -1313,7 +1313,7 @@ void X11_ShowWindow(_THIS, SDL_Window *window) } -void X11_HideWindow(_THIS, SDL_Window *window) +void X11_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); @@ -1344,7 +1344,7 @@ void X11_HideWindow(_THIS, SDL_Window *window) } } -static void X11_SetWindowActive(_THIS, SDL_Window *window) +static void X11_SetWindowActive(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); @@ -1372,7 +1372,7 @@ static void X11_SetWindowActive(_THIS, SDL_Window *window) } } -void X11_RaiseWindow(_THIS, SDL_Window *window) +void X11_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -1382,7 +1382,7 @@ void X11_RaiseWindow(_THIS, SDL_Window *window) X11_XFlush(display); } -static void X11_SetWindowMaximized(_THIS, SDL_Window *window, SDL_bool maximized) +static void X11_SetWindowMaximized(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool maximized) { SDL_WindowData *data = window->driverdata; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); @@ -1427,12 +1427,12 @@ static void X11_SetWindowMaximized(_THIS, SDL_Window *window, SDL_bool maximized X11_XFlush(display); } -void X11_MaximizeWindow(_THIS, SDL_Window *window) +void X11_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { X11_SetWindowMaximized(_this, window, SDL_TRUE); } -void X11_MinimizeWindow(_THIS, SDL_Window *window) +void X11_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); @@ -1442,7 +1442,7 @@ void X11_MinimizeWindow(_THIS, SDL_Window *window) X11_XFlush(display); } -void X11_RestoreWindow(_THIS, SDL_Window *window) +void X11_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { X11_SetWindowMaximized(_this, window, SDL_FALSE); X11_ShowWindow(_this, window); @@ -1450,7 +1450,7 @@ void X11_RestoreWindow(_THIS, SDL_Window *window) } /* This asks the Window Manager to handle fullscreen for us. This is the modern way. */ -static void X11_SetWindowFullscreenViaWM(_THIS, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen) +static void X11_SetWindowFullscreenViaWM(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen) { SDL_WindowData *data = window->driverdata; SDL_DisplayData *displaydata = _display->driverdata; @@ -1619,7 +1619,7 @@ static void X11_SetWindowFullscreenViaWM(_THIS, SDL_Window *window, SDL_VideoDis X11_XFlush(display); } -void X11_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen) +void X11_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen) { X11_SetWindowFullscreenViaWM(_this, window, _display, fullscreen); } @@ -1658,7 +1658,7 @@ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop) } void * -X11_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size) +X11_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; @@ -1707,7 +1707,7 @@ X11_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size) return ret_icc_profile_data; } -void X11_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void X11_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { SDL_WindowData *data = window->driverdata; Display *display; @@ -1762,7 +1762,7 @@ void X11_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) X11_XSync(display, False); } -void X11_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void X11_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { SDL_WindowData *data = window->driverdata; Display *display; @@ -1789,7 +1789,7 @@ void X11_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) X11_XSync(display, False); } -void X11_DestroyWindow(_THIS, SDL_Window *window) +void X11_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; @@ -1841,7 +1841,7 @@ void X11_DestroyWindow(_THIS, SDL_Window *window) window->driverdata = NULL; } -int X11_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) +int X11_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info) { SDL_WindowData *data = window->driverdata; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); @@ -1878,7 +1878,7 @@ void X11_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept) } } -int X11_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) +int X11_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation) { SDL_WindowData *data = window->driverdata; Display *display = data->videodata->display; diff --git a/src/video/x11/SDL_x11window.h b/src/video/x11/SDL_x11window.h index 37f3646783..b5da61a4ce 100644 --- a/src/video/x11/SDL_x11window.h +++ b/src/video/x11/SDL_x11window.h @@ -81,40 +81,40 @@ struct SDL_WindowData #endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ }; -extern void X11_SetNetWMState(_THIS, Window xwindow, Uint32 flags); -extern Uint32 X11_GetNetWMState(_THIS, SDL_Window *window, Window xwindow); +extern void X11_SetNetWMState(SDL_VideoDevice *_this, Window xwindow, Uint32 flags); +extern Uint32 X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwindow); -extern int X11_CreateWindow(_THIS, SDL_Window *window); -extern int X11_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); -extern char *X11_GetWindowTitle(_THIS, Window xwindow); -extern void X11_SetWindowTitle(_THIS, SDL_Window *window); -extern int X11_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon); -extern int X11_SetWindowPosition(_THIS, SDL_Window *window); -extern void X11_SetWindowMinimumSize(_THIS, SDL_Window *window); -extern void X11_SetWindowMaximumSize(_THIS, SDL_Window *window); -extern int X11_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right); -extern int X11_SetWindowOpacity(_THIS, SDL_Window *window, float opacity); -extern int X11_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window); -extern int X11_SetWindowInputFocus(_THIS, SDL_Window *window); -extern void X11_SetWindowSize(_THIS, SDL_Window *window); -extern void X11_ShowWindow(_THIS, SDL_Window *window); -extern void X11_HideWindow(_THIS, SDL_Window *window); -extern void X11_RaiseWindow(_THIS, SDL_Window *window); -extern void X11_MaximizeWindow(_THIS, SDL_Window *window); -extern void X11_MinimizeWindow(_THIS, SDL_Window *window); -extern void X11_RestoreWindow(_THIS, SDL_Window *window); -extern void X11_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered); -extern void X11_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable); -extern void X11_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top); -extern void X11_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); -extern void *X11_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size); -extern void X11_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -extern void X11_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -extern void X11_DestroyWindow(_THIS, SDL_Window *window); -extern int X11_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); +extern int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data); +extern char *X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow); +extern void X11_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon); +extern int X11_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right); +extern int X11_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity); +extern int X11_SetWindowModalFor(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window); +extern int X11_SetWindowInputFocus(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered); +extern void X11_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable); +extern void X11_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top); +extern void X11_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); +extern void *X11_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size); +extern void X11_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); +extern void X11_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); +extern void X11_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info); extern int X11_SetWindowHitTest(SDL_Window *window, SDL_bool enabled); extern void X11_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept); -extern int X11_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation); +extern int X11_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation); int SDL_X11_SetWindowTitle(Display *display, Window xwindow, char *title); void X11_UpdateWindowPosition(SDL_Window *window); diff --git a/src/video/x11/SDL_x11xfixes.c b/src/video/x11/SDL_x11xfixes.c index bd9cc52005..5c69eb1402 100644 --- a/src/video/x11/SDL_x11xfixes.c +++ b/src/video/x11/SDL_x11xfixes.c @@ -42,7 +42,7 @@ static SDL_bool xfixes_version_atleast(const int version, const int wantmajor, c return version >= ((wantmajor * 1000) + wantminor); } -void X11_InitXfixes(_THIS) +void X11_InitXfixes(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; @@ -69,7 +69,7 @@ int X11_XfixesIsInitialized(void) return xfixes_initialized; } -void X11_SetWindowMouseRect(_THIS, SDL_Window *window) +void X11_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window) { if (SDL_RectEmpty(&window->mouse_rect)) { X11_ConfineCursorWithFlags(_this, window, NULL, 0); @@ -87,7 +87,7 @@ void X11_SetWindowMouseRect(_THIS, SDL_Window *window) } } -int X11_ConfineCursorWithFlags(_THIS, SDL_Window *window, const SDL_Rect *rect, int flags) +int X11_ConfineCursorWithFlags(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rect, int flags) { /* Yaakuro: For some reason Xfixes when confining inside a rect where the * edges exactly match, a rectangle the cursor 'slips' out of the barrier. @@ -176,7 +176,7 @@ int X11_ConfineCursorWithFlags(_THIS, SDL_Window *window, const SDL_Rect *rect, return 0; } -void X11_DestroyPointerBarrier(_THIS, SDL_Window *window) +void X11_DestroyPointerBarrier(SDL_VideoDevice *_this, SDL_Window *window) { int i; SDL_VideoData *data = _this->driverdata; diff --git a/src/video/x11/SDL_x11xfixes.h b/src/video/x11/SDL_x11xfixes.h index dcf26f8e30..328fc5aae2 100644 --- a/src/video/x11/SDL_x11xfixes.h +++ b/src/video/x11/SDL_x11xfixes.h @@ -28,11 +28,11 @@ #define X11_BARRIER_HANDLED_BY_EVENT 1 -extern void X11_InitXfixes(_THIS); +extern void X11_InitXfixes(SDL_VideoDevice *_this); extern int X11_XfixesIsInitialized(void); -extern void X11_SetWindowMouseRect(_THIS, SDL_Window *window); -extern int X11_ConfineCursorWithFlags(_THIS, SDL_Window *window, const SDL_Rect *rect, int flags); -extern void X11_DestroyPointerBarrier(_THIS, SDL_Window *window); +extern void X11_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_ConfineCursorWithFlags(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rect, int flags); +extern void X11_DestroyPointerBarrier(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c index 26912b31e3..522d8d05b7 100644 --- a/src/video/x11/SDL_x11xinput2.c +++ b/src/video/x11/SDL_x11xinput2.c @@ -110,7 +110,7 @@ static void xinput2_normalize_touch_coordinates(SDL_Window *window, double in_x, #endif /* SDL_VIDEO_DRIVER_X11_XINPUT2 */ -void X11_InitXinput2(_THIS) +void X11_InitXinput2(SDL_VideoDevice *_this) { #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 SDL_VideoData *data = _this->driverdata; @@ -383,7 +383,7 @@ int X11_HandleXinput2Event(SDL_VideoData *videodata, XGenericEventCookie *cookie return 0; } -void X11_InitXinput2Multitouch(_THIS) +void X11_InitXinput2Multitouch(SDL_VideoDevice *_this) { #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH SDL_VideoData *data = _this->driverdata; @@ -423,7 +423,7 @@ void X11_InitXinput2Multitouch(_THIS) #endif } -void X11_Xinput2SelectTouch(_THIS, SDL_Window *window) +void X11_Xinput2SelectTouch(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH SDL_VideoData *data = NULL; @@ -469,7 +469,7 @@ int X11_Xinput2IsMultitouchSupported(void) #endif } -void X11_Xinput2GrabTouch(_THIS, SDL_Window *window) +void X11_Xinput2GrabTouch(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH SDL_WindowData *data = window->driverdata; @@ -499,7 +499,7 @@ void X11_Xinput2GrabTouch(_THIS, SDL_Window *window) #endif } -void X11_Xinput2UngrabTouch(_THIS, SDL_Window *window) +void X11_Xinput2UngrabTouch(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH SDL_WindowData *data = window->driverdata; diff --git a/src/video/x11/SDL_x11xinput2.h b/src/video/x11/SDL_x11xinput2.h index 1199c3f885..2d4573a81a 100644 --- a/src/video/x11/SDL_x11xinput2.h +++ b/src/video/x11/SDL_x11xinput2.h @@ -30,13 +30,13 @@ struct XGenericEventCookie; typedef struct XGenericEventCookie XGenericEventCookie; #endif -extern void X11_InitXinput2(_THIS); -extern void X11_InitXinput2Multitouch(_THIS); +extern void X11_InitXinput2(SDL_VideoDevice *_this); +extern void X11_InitXinput2Multitouch(SDL_VideoDevice *_this); extern int X11_HandleXinput2Event(SDL_VideoData *videodata, XGenericEventCookie *cookie); extern int X11_Xinput2IsInitialized(void); extern int X11_Xinput2IsMultitouchSupported(void); -extern void X11_Xinput2SelectTouch(_THIS, SDL_Window *window); -extern void X11_Xinput2GrabTouch(_THIS, SDL_Window *window); -extern void X11_Xinput2UngrabTouch(_THIS, SDL_Window *window); +extern void X11_Xinput2SelectTouch(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_Xinput2GrabTouch(SDL_VideoDevice *_this, SDL_Window *window); +extern void X11_Xinput2UngrabTouch(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_x11xinput2_h_ */