diff --git a/docs/README-migration.md b/docs/README-migration.md index 85fab337e..08b62fb1f 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1800,32 +1800,32 @@ The information previously available in SDL_GetWindowWMInfo() is now available a becomes: ```c #if defined(SDL_PLATFORM_WIN32) - HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (hwnd) { ... } #elif defined(SDL_PLATFORM_MACOS) - NSWindow *nswindow = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); + NSWindow *nswindow = (__bridge NSWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); if (nswindow) { ... } #elif defined(SDL_PLATFORM_LINUX) if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { - Display *xdisplay = (Display *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); + Display *xdisplay = (Display *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); Window xwindow = (Window)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); if (xdisplay && xwindow) { ... } } else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { - struct wl_display *display = (struct wl_display *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL); - struct wl_surface *surface = (struct wl_surface *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); + struct wl_display *display = (struct wl_display *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL); + struct wl_surface *surface = (struct wl_surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); if (display && surface) { ... } } #elif defined(SDL_PLATFORM_IOS) SDL_PropertiesID props = SDL_GetWindowProperties(window); - UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL); + UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL); if (uiwindow) { GLuint framebuffer = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER, 0); GLuint colorbuffer = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_RENDERBUFFER_NUMBER, 0); diff --git a/docs/README-wayland.md b/docs/README-wayland.md index 7f831fe6e..aa0f2ccf0 100644 --- a/docs/README-wayland.md +++ b/docs/README-wayland.md @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) } /* Set SDL to use the existing wl_display object from Qt and initialize. */ - SDL_SetProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display); + SDL_SetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display); SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS); /* Create a basic, frameless QWindow */ @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) * Qt objects should not be flagged as DPI-aware or protocol violations will result. */ props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, surface); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, surface); SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, SDL_TRUE); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, 640); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, 480); diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index 772e811a6..a8356ce5e 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -953,9 +953,6 @@ extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_CreateAudioStream(const SDL_Aud * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream); diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index 197981274..02d294158 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -367,9 +367,6 @@ extern SDL_DECLSPEC SDL_CameraDeviceID SDLCALL SDL_GetCameraInstanceID(SDL_Camer * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera *camera); diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 9ab90092f..36282ad5f 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -725,9 +725,6 @@ extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int playe * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGamepadProperties(SDL_Gamepad *gamepad); diff --git a/include/SDL3/SDL_iostream.h b/include/SDL3/SDL_iostream.h index 4da921445..c87d20313 100644 --- a/include/SDL3/SDL_iostream.h +++ b/include/SDL3/SDL_iostream.h @@ -395,9 +395,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_CloseIO(SDL_IOStream *context); * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetIOProperties(SDL_IOStream *context); diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index c4e713c7c..31c4fc58b 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -654,9 +654,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick * * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joystick *joystick); diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index 529b4decc..d277b5374 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -32,7 +32,7 @@ * Properties can be added to and retrieved from a property set through the * following functions: * - * - SDL_SetProperty and SDL_GetProperty operate on `void*` pointer types. + * - SDL_SetPointerProperty and SDL_GetPointerProperty operate on `void*` pointer types. * - SDL_SetStringProperty and SDL_GetStringProperty operate on string types. * - SDL_SetNumberProperty and SDL_GetNumberProperty operate on signed 64-bit * integer types. @@ -86,9 +86,6 @@ typedef enum SDL_PropertyType * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void); @@ -113,7 +110,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void); * * Copy all the properties from one set of properties to another, with the * exception of properties requiring cleanup (set using - * SDL_SetPropertyWithCleanup()), which will not be copied. Any property that + * SDL_SetPointerPropertyWithCleanup()), which will not be copied. Any property that * already exists on `dst` will be overwritten. * * \param src the properties to copy. @@ -173,7 +170,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props); * This callback is set per-property. Different properties in the same set can * have different cleanup callbacks. * - * This callback will be called _during_ SDL_SetPropertyWithCleanup if the + * This callback will be called _during_ SDL_SetPointerPropertyWithCleanup if the * function fails for any reason. * * \param userdata an app-defined pointer passed to the callback. @@ -184,7 +181,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props); * * \since This datatype is available since SDL 3.0.0. * - * \sa SDL_SetPropertyWithCleanup + * \sa SDL_SetPointerPropertyWithCleanup */ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value); @@ -213,11 +210,11 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetProperty - * \sa SDL_SetProperty + * \sa SDL_GetPointerProperty + * \sa SDL_SetPointerProperty * \sa SDL_CleanupPropertyCallback */ -extern SDL_DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata); +extern SDL_DECLSPEC int SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata); /** * Set a property on a set of properties. @@ -232,15 +229,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID prop * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetProperty + * \sa SDL_GetPointerProperty * \sa SDL_HasProperty * \sa SDL_SetBooleanProperty * \sa SDL_SetFloatProperty * \sa SDL_SetNumberProperty - * \sa SDL_SetPropertyWithCleanup + * \sa SDL_SetPointerPropertyWithCleanup * \sa SDL_SetStringProperty */ -extern SDL_DECLSPEC int SDLCALL SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value); +extern SDL_DECLSPEC int SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value); /** * Set a string property on a set of properties. @@ -360,7 +357,7 @@ extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesI * * \threadsafety It is safe to call this function from any thread, although * the data returned is not protected and could potentially be - * freed if you call SDL_SetProperty() or SDL_ClearProperty() on + * freed if you call SDL_SetPointerProperty() or SDL_ClearProperty() on * these properties from another thread. If you need to avoid * this, use SDL_LockProperties() and SDL_UnlockProperties(). * @@ -372,9 +369,9 @@ extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesI * \sa SDL_GetPropertyType * \sa SDL_GetStringProperty * \sa SDL_HasProperty - * \sa SDL_SetProperty + * \sa SDL_SetPointerProperty */ -extern SDL_DECLSPEC void *SDLCALL SDL_GetProperty(SDL_PropertiesID props, const char *name, void *default_value); +extern SDL_DECLSPEC void *SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value); /** * Get a string property on a set of properties. diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 2ff52dc1d..38367548d 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -413,9 +413,6 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetRendererName(SDL_Renderer *render * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Renderer *renderer); @@ -758,9 +755,6 @@ extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureWithProperties(SDL_Ren * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetTextureProperties(SDL_Texture *texture); diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index 13dcd424b..d5124beee 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -217,9 +217,6 @@ extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_GetSensorFromInstanceID(SDL_SensorID * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor *sensor); diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 8078a0c88..fd5096ac9 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -211,9 +211,6 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface); * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface); diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index db54c9f99..07c608e89 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -429,9 +429,6 @@ extern SDL_DECLSPEC SDL_DisplayID SDLCALL SDL_GetPrimaryDisplay(void); * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_DisplayID displayID); @@ -1225,9 +1222,6 @@ extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window); * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_GetNumberProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window *window); diff --git a/src/SDL_properties.c b/src/SDL_properties.c index 0b584213e..1ac03e72e 100644 --- a/src/SDL_properties.c +++ b/src/SDL_properties.c @@ -336,7 +336,7 @@ static int SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name, SDL_ return result; } -int SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata) +int SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata) { SDL_Property *property; @@ -362,7 +362,7 @@ int SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *v return SDL_PrivateSetProperty(props, name, property); } -int SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value) +int SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value) { SDL_Property *property; @@ -386,7 +386,7 @@ static void SDLCALL CleanupFreeableProperty(void *userdata, void *value) int SDL_SetFreeableProperty(SDL_PropertiesID props, const char *name, void *value) { - return SDL_SetPropertyWithCleanup(props, name, value, CleanupFreeableProperty, NULL); + return SDL_SetPointerPropertyWithCleanup(props, name, value, CleanupFreeableProperty, NULL); } static void SDLCALL CleanupSurface(void *userdata, void *value) @@ -398,7 +398,7 @@ static void SDLCALL CleanupSurface(void *userdata, void *value) int SDL_SetSurfaceProperty(SDL_PropertiesID props, const char *name, SDL_Surface *surface) { - return SDL_SetPropertyWithCleanup(props, name, surface, CleanupSurface, NULL); + return SDL_SetPointerPropertyWithCleanup(props, name, surface, CleanupSurface, NULL); } int SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value) @@ -492,7 +492,7 @@ SDL_PropertyType SDL_GetPropertyType(SDL_PropertiesID props, const char *name) return type; } -void *SDL_GetProperty(SDL_PropertiesID props, const char *name, void *default_value) +void *SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value) { SDL_Properties *properties = NULL; void *value = default_value; @@ -775,7 +775,7 @@ static void SDLCALL SDL_DumpPropertiesCallback(void *userdata, SDL_PropertiesID { switch (SDL_GetPropertyType(props, name)) { case SDL_PROPERTY_TYPE_POINTER: - SDL_Log("%s: %p\n", name, SDL_GetProperty(props, name, NULL)); + SDL_Log("%s: %p\n", name, SDL_GetPointerProperty(props, name, NULL)); break; case SDL_PROPERTY_TYPE_STRING: SDL_Log("%s: \"%s\"\n", name, SDL_GetStringProperty(props, name, "")); diff --git a/src/camera/mediafoundation/SDL_camera_mediafoundation.c b/src/camera/mediafoundation/SDL_camera_mediafoundation.c index 7776d1e3b..c8cbbf34f 100644 --- a/src/camera/mediafoundation/SDL_camera_mediafoundation.c +++ b/src/camera/mediafoundation/SDL_camera_mediafoundation.c @@ -468,7 +468,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f } else { frame->pixels = pixels; frame->pitch = (int) pitch; - if (SDL_SetPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer2, NULL) == -1) { + if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer2, NULL) == -1) { retval = -1; } } @@ -480,7 +480,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f } else { frame->pixels = pixels; frame->pitch = (int) pitch; - if (SDL_SetPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer, NULL) == -1) { + if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer, NULL) == -1) { retval = -1; } } @@ -497,7 +497,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f } frame->pixels = pixels; frame->pitch = (int) pitch; - if (SDL_SetPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMFMediaBuffer, NULL) == -1) { + if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMFMediaBuffer, NULL) == -1) { retval = -1; } } diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index 8efa30556..a4f6560da 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -422,7 +422,7 @@ void SDL_Fcitx_UpdateTextInputArea(SDL_Window *window) #ifdef SDL_VIDEO_DRIVER_X11 { SDL_PropertiesID props = SDL_GetWindowProperties(window); - Display *x_disp = (Display *)SDL_GetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); + Display *x_disp = (Display *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); int x_screen = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, 0); Window x_win = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); Window unused; diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index dfaab70a6..7fe5baa65 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -703,7 +703,7 @@ void SDL_IBus_UpdateTextInputArea(SDL_Window *window) #ifdef SDL_VIDEO_DRIVER_X11 { SDL_PropertiesID props = SDL_GetWindowProperties(window); - Display *x_disp = (Display *)SDL_GetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); + Display *x_disp = (Display *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); int x_screen = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, 0); Window x_win = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); Window unused; diff --git a/src/dialog/cocoa/SDL_cocoadialog.m b/src/dialog/cocoa/SDL_cocoadialog.m index 3d58aa226..eeddfe75c 100644 --- a/src/dialog/cocoa/SDL_cocoadialog.m +++ b/src/dialog/cocoa/SDL_cocoadialog.m @@ -130,7 +130,7 @@ void show_file_dialog(cocoa_FileDialogType type, SDL_DialogFileCallback callback NSWindow *w = NULL; if (window) { - w = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); + w = (__bridge NSWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); } if (w) { diff --git a/src/dialog/windows/SDL_windowsdialog.c b/src/dialog/windows/SDL_windowsdialog.c index 45bc6418c..5fad1d110 100644 --- a/src/dialog/windows/SDL_windowsdialog.c +++ b/src/dialog/windows/SDL_windowsdialog.c @@ -101,7 +101,7 @@ void windows_ShowFileDialog(void *ptr) HWND window = NULL; if (parent) { - window = (HWND) SDL_GetProperty(SDL_GetWindowProperties(parent), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + window = (HWND) SDL_GetPointerProperty(SDL_GetWindowProperties(parent), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); } wchar_t *filebuffer; /* lpstrFile */ @@ -391,7 +391,7 @@ void windows_ShowFolderDialog(void* ptr) HWND parent = NULL; if (window) { - parent = (HWND) SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + parent = (HWND) SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); } wchar_t buffer[MAX_PATH]; diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index c5c332a9b..656b4b1fa 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -368,12 +368,12 @@ SDL3_0.0.0 { SDL_GetPixelFormatForMasks; SDL_GetPixelFormatName; SDL_GetPlatform; + SDL_GetPointerProperty; SDL_GetPowerInfo; SDL_GetPrefPath; SDL_GetPreferredLocales; SDL_GetPrimaryDisplay; SDL_GetPrimarySelectionText; - SDL_GetProperty; SDL_GetPropertyType; SDL_GetRGB; SDL_GetRGBA; @@ -730,9 +730,9 @@ SDL3_0.0.0 { SDL_SetModState; SDL_SetNumberProperty; SDL_SetPaletteColors; + SDL_SetPointerProperty; + SDL_SetPointerPropertyWithCleanup; SDL_SetPrimarySelectionText; - SDL_SetProperty; - SDL_SetPropertyWithCleanup; SDL_SetRelativeMouseMode; SDL_SetRenderClipRect; SDL_SetRenderColorScale; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 1dc3e3c94..2cdd9d248 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -393,12 +393,12 @@ #define SDL_GetPixelFormatForMasks SDL_GetPixelFormatForMasks_REAL #define SDL_GetPixelFormatName SDL_GetPixelFormatName_REAL #define SDL_GetPlatform SDL_GetPlatform_REAL +#define SDL_GetPointerProperty SDL_GetPointerProperty_REAL #define SDL_GetPowerInfo SDL_GetPowerInfo_REAL #define SDL_GetPrefPath SDL_GetPrefPath_REAL #define SDL_GetPreferredLocales SDL_GetPreferredLocales_REAL #define SDL_GetPrimaryDisplay SDL_GetPrimaryDisplay_REAL #define SDL_GetPrimarySelectionText SDL_GetPrimarySelectionText_REAL -#define SDL_GetProperty SDL_GetProperty_REAL #define SDL_GetPropertyType SDL_GetPropertyType_REAL #define SDL_GetRGB SDL_GetRGB_REAL #define SDL_GetRGBA SDL_GetRGBA_REAL @@ -755,9 +755,9 @@ #define SDL_SetModState SDL_SetModState_REAL #define SDL_SetNumberProperty SDL_SetNumberProperty_REAL #define SDL_SetPaletteColors SDL_SetPaletteColors_REAL +#define SDL_SetPointerProperty SDL_SetPointerProperty_REAL +#define SDL_SetPointerPropertyWithCleanup SDL_SetPointerPropertyWithCleanup_REAL #define SDL_SetPrimarySelectionText SDL_SetPrimarySelectionText_REAL -#define SDL_SetProperty SDL_SetProperty_REAL -#define SDL_SetPropertyWithCleanup SDL_SetPropertyWithCleanup_REAL #define SDL_SetRelativeMouseMode SDL_SetRelativeMouseMode_REAL #define SDL_SetRenderClipRect SDL_SetRenderClipRect_REAL #define SDL_SetRenderColorScale SDL_SetRenderColorScale_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 1d7e09254..66894a988 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -413,12 +413,12 @@ SDL_DYNAPI_PROC(const SDL_PixelFormatDetails*,SDL_GetPixelFormatDetails,(SDL_Pix SDL_DYNAPI_PROC(SDL_PixelFormat,SDL_GetPixelFormatForMasks,(int a, Uint32 b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(const char*,SDL_GetPixelFormatName,(SDL_PixelFormat a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetPlatform,(void),(),return) +SDL_DYNAPI_PROC(void*,SDL_GetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetPowerInfo,(int *a, int *b),(a,b),return) SDL_DYNAPI_PROC(char*,SDL_GetPrefPath,(const char *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Locale*,SDL_GetPreferredLocales,(void),(),return) SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetPrimaryDisplay,(void),(),return) SDL_DYNAPI_PROC(char*,SDL_GetPrimarySelectionText,(void),(),return) -SDL_DYNAPI_PROC(void*,SDL_GetProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_PropertyType,SDL_GetPropertyType,(SDL_PropertiesID a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f),(a,b,c,d,e,f),) SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),) @@ -765,9 +765,9 @@ SDL_DYNAPI_PROC(int,SDL_SetMemoryFunctions,(SDL_malloc_func a, SDL_calloc_func b SDL_DYNAPI_PROC(void,SDL_SetModState,(SDL_Keymod a),(a),) SDL_DYNAPI_PROC(int,SDL_SetNumberProperty,(SDL_PropertiesID a, const char *b, Sint64 c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetPaletteColors,(SDL_Palette *a, const SDL_Color *b, int c, int d),(a,b,c,d),return) +SDL_DYNAPI_PROC(int,SDL_SetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(int,SDL_SetPointerPropertyWithCleanup,(SDL_PropertiesID a, const char *b, void *c, SDL_CleanupPropertyCallback d, void *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_SetPrimarySelectionText,(const char *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_SetProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(int,SDL_SetPropertyWithCleanup,(SDL_PropertiesID a, const char *b, void *c, SDL_CleanupPropertyCallback d, void *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_SetRelativeMouseMode,(SDL_bool a),(a),return) SDL_DYNAPI_PROC(int,SDL_SetRenderClipRect,(SDL_Renderer *a, const SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetRenderColorScale,(SDL_Renderer *a, float b),(a,b),return) diff --git a/src/file/SDL_iostream.c b/src/file/SDL_iostream.c index 7e052856b..ec36dcf9e 100644 --- a/src/file/SDL_iostream.c +++ b/src/file/SDL_iostream.c @@ -431,7 +431,7 @@ static SDL_IOStream *SDL_IOFromFP(FILE *fp, SDL_bool autoclose) } else { const SDL_PropertiesID props = SDL_GetIOProperties(iostr); if (props) { - SDL_SetProperty(props, SDL_PROP_IOSTREAM_STDIO_FILE_POINTER, fp); + SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_STDIO_FILE_POINTER, fp); } } @@ -615,7 +615,7 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode) } else { const SDL_PropertiesID props = SDL_GetIOProperties(iostr); if (props) { - SDL_SetProperty(props, SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER, iodata); + SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER, iodata); } } @@ -644,7 +644,7 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode) } else { const SDL_PropertiesID props = SDL_GetIOProperties(iostr); if (props) { - SDL_SetProperty(props, SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER, iodata->h); + SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER, iodata->h); } } @@ -793,7 +793,7 @@ static int dynamic_mem_realloc(IOStreamDynamicMemData *iodata, size_t size) iodata->data.here = base + here_offset; iodata->data.stop = base + stop_offset; iodata->end = base + length; - return SDL_SetProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, base); + return SDL_SetPointerProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, base); } static size_t SDLCALL dynamic_mem_write(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status) @@ -813,7 +813,7 @@ static size_t SDLCALL dynamic_mem_write(void *userdata, const void *ptr, size_t static int SDLCALL dynamic_mem_close(void *userdata) { const IOStreamDynamicMemData *iodata = (IOStreamDynamicMemData *) userdata; - void *mem = SDL_GetProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); + void *mem = SDL_GetPointerProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); if (mem) { SDL_free(mem); } diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 6f21fe0f7..8d050bdb1 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -151,7 +151,7 @@ int SDL_AddSupportedTextureFormat(SDL_Renderer *renderer, SDL_PixelFormat format texture_formats[renderer->num_texture_formats++] = format; texture_formats[renderer->num_texture_formats] = SDL_PIXELFORMAT_UNKNOWN; renderer->texture_formats = texture_formats; - SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, texture_formats); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, texture_formats); return 0; } @@ -942,8 +942,8 @@ static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Wind SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props) { #ifndef SDL_RENDER_DISABLED - SDL_Window *window = (SDL_Window *)SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, NULL); - SDL_Surface *surface = (SDL_Surface *)SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, NULL); + SDL_Window *window = (SDL_Window *)SDL_GetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, NULL); + SDL_Surface *surface = (SDL_Surface *)SDL_GetPointerProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, NULL); const char *name = SDL_GetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, NULL); const int n = SDL_GetNumRenderDrivers(); const char *hint; @@ -1083,16 +1083,16 @@ SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props) new_props = SDL_GetRendererProperties(renderer); SDL_SetStringProperty(new_props, SDL_PROP_RENDERER_NAME_STRING, renderer->name); if (window) { - SDL_SetProperty(new_props, SDL_PROP_RENDERER_WINDOW_POINTER, window); + SDL_SetPointerProperty(new_props, SDL_PROP_RENDERER_WINDOW_POINTER, window); } if (surface) { - SDL_SetProperty(new_props, SDL_PROP_RENDERER_SURFACE_POINTER, surface); + SDL_SetPointerProperty(new_props, SDL_PROP_RENDERER_SURFACE_POINTER, surface); } SDL_SetNumberProperty(new_props, SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER, renderer->output_colorspace); UpdateHDRProperties(renderer); if (window) { - SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, renderer); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, renderer); } SDL_SetRenderViewport(renderer, NULL); @@ -1145,7 +1145,7 @@ SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, const char *name) { SDL_Renderer *renderer; SDL_PropertiesID props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); SDL_SetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, name); renderer = SDL_CreateRendererWithProperties(props); SDL_DestroyProperties(props); @@ -1163,7 +1163,7 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface) } SDL_PropertiesID props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface); renderer = SDL_CreateRendererWithProperties(props); SDL_DestroyProperties(props); return renderer; @@ -1175,7 +1175,7 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface) SDL_Renderer *SDL_GetRenderer(SDL_Window *window) { - return (SDL_Renderer *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, NULL); + return (SDL_Renderer *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, NULL); } SDL_Window *SDL_GetRenderWindow(SDL_Renderer *renderer) @@ -1401,7 +1401,7 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert return NULL; } - SDL_SetProperty(SDL_GetTextureProperties(texture->native), SDL_PROP_TEXTURE_PARENT_POINTER, texture); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture->native), SDL_PROP_TEXTURE_PARENT_POINTER, texture); /* Swap textures to have texture before texture->native in the list */ texture->native->next = texture->next; @@ -2416,7 +2416,7 @@ SDL_Texture *SDL_GetRenderTarget(SDL_Renderer *renderer) if (renderer->target == renderer->logical_target) { return NULL; } else { - return (SDL_Texture *)SDL_GetProperty(SDL_GetTextureProperties(renderer->target), SDL_PROP_TEXTURE_PARENT_POINTER, renderer->target); + return (SDL_Texture *)SDL_GetPointerProperty(SDL_GetTextureProperties(renderer->target), SDL_PROP_TEXTURE_PARENT_POINTER, renderer->target); } } @@ -4401,7 +4401,7 @@ SDL_Surface *SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) static void SDL_RenderApplyWindowShape(SDL_Renderer *renderer) { - SDL_Surface *shape = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL); + SDL_Surface *shape = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL); if (shape != renderer->shape_surface) { if (renderer->shape_texture) { SDL_DestroyTexture(renderer->shape_texture); diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index 33fb54e65..af16dbefa 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -1604,7 +1604,7 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie SDL_DisplayID displayID; const SDL_DisplayMode *fullscreen_mode = NULL; - hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (!hwnd) { return SDL_SetError("Couldn't get window handle"); } @@ -1752,7 +1752,7 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie } #endif - SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D9_DEVICE_POINTER, data->device); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D9_DEVICE_POINTER, data->device); return 0; } diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 3056d07e0..cca1925d3 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -800,7 +800,7 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) ID3D11DeviceContext_VSSetShader(data->d3dContext, data->vertexShader, NULL, 0); ID3D11DeviceContext_VSSetConstantBuffers(data->d3dContext, 0, 1, &data->vertexShaderConstants); - SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, data->d3dDevice); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, data->d3dDevice); done: SAFE_RELEASE(d3dDevice); @@ -975,7 +975,7 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) #endif } else { #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) - HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (!hwnd) { SDL_SetError("Couldn't get window handle"); result = E_FAIL; @@ -1031,7 +1031,7 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) } } - SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTER, data->swapChain); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTER, data->swapChain); done: SAFE_RELEASE(swapChain3); @@ -1251,7 +1251,7 @@ static SDL_bool D3D11_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode bl static int GetTextureProperty(SDL_PropertiesID props, const char *name, ID3D11Texture2D **texture) { - IUnknown *unknown = SDL_GetProperty(props, name, NULL); + IUnknown *unknown = SDL_GetPointerProperty(props, name, NULL); if (unknown) { HRESULT result = IUnknown_QueryInterface(unknown, &SDL_IID_ID3D11Texture2D, (void **)texture); if (FAILED(result)) { @@ -1334,7 +1334,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result); } } - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, textureData->mainTexture); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, textureData->mainTexture); #if SDL_HAVE_YUV if (texture->format == SDL_PIXELFORMAT_YV12 || texture->format == SDL_PIXELFORMAT_IYUV) { @@ -1355,7 +1355,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result); } } - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_U_POINTER, textureData->mainTextureU); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_U_POINTER, textureData->mainTextureU); if (GetTextureProperty(create_props, "d3d11.texture_v", &textureData->mainTextureV) < 0) { return -1; @@ -1369,7 +1369,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result); } } - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_V_POINTER, textureData->mainTextureV); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_V_POINTER, textureData->mainTextureV); textureData->YCbCr_matrix = SDL_GetYCbCRtoRGBConversionMatrix(texture->colorspace, texture->w, texture->h, 8); if (!textureData->YCbCr_matrix) { @@ -2783,7 +2783,7 @@ static int D3D11_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_ { D3D11_RenderData *data; - HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (!hwnd) { return SDL_SetError("Couldn't get window handle"); } diff --git a/src/render/direct3d11/SDL_render_winrt.cpp b/src/render/direct3d11/SDL_render_winrt.cpp index a2bfb5ce3..36de74eef 100644 --- a/src/render/direct3d11/SDL_render_winrt.cpp +++ b/src/render/direct3d11/SDL_render_winrt.cpp @@ -44,7 +44,7 @@ using namespace Windows::Graphics::Display; extern "C" void * D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer *renderer) { - IInspectable *window = (IInspectable *)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, NULL); + IInspectable *window = (IInspectable *)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, NULL); ABI::Windows::UI::Core::ICoreWindow *coreWindow = NULL; if (!window || FAILED(window->QueryInterface(&coreWindow))) { return NULL; diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index 45c91d87a..8e3fddd64 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -446,8 +446,8 @@ static void D3D12_ReleaseAll(SDL_Renderer *renderer) SDL_Texture *texture = NULL; SDL_PropertiesID props = SDL_GetRendererProperties(renderer); - SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, NULL); - SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, NULL); /* Release all textures */ for (texture = renderer->textures; texture; texture = texture->next) { @@ -1192,8 +1192,8 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer) data->srvPoolHead = &data->srvPoolNodes[0]; SDL_PropertiesID props = SDL_GetRendererProperties(renderer); - SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, data->d3dDevice); - SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, data->commandQueue); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, data->d3dDevice); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, data->commandQueue); done: SAFE_RELEASE(d3dDevice); @@ -1310,7 +1310,7 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h) swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT | /* To support SetMaximumFrameLatency */ DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; /* To support presenting with allow tearing on */ - HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (!hwnd) { SDL_SetError("Couldn't get window handle"); result = E_FAIL; @@ -1376,7 +1376,7 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h) result = DXGI_ERROR_UNSUPPORTED; } - SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTER, data->swapChain); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTER, data->swapChain); done: SAFE_RELEASE(swapChain); @@ -1600,7 +1600,7 @@ static void D3D12_FreeSRVIndex(SDL_Renderer *renderer, SIZE_T index) static int GetTextureProperty(SDL_PropertiesID props, const char *name, ID3D12Resource **texture) { - IUnknown *unknown = (IUnknown*)SDL_GetProperty(props, name, NULL); + IUnknown *unknown = (IUnknown*)SDL_GetPointerProperty(props, name, NULL); if (unknown) { HRESULT result = D3D_CALL(unknown, QueryInterface, D3D_GUID(SDL_IID_ID3D12Resource), (void **)texture); if (FAILED(result)) { @@ -1685,7 +1685,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL } } textureData->mainResourceState = D3D12_RESOURCE_STATE_COPY_DEST; - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_POINTER, textureData->mainTexture); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_POINTER, textureData->mainTexture); #if SDL_HAVE_YUV if (texture->format == SDL_PIXELFORMAT_YV12 || texture->format == SDL_PIXELFORMAT_IYUV) { @@ -1711,7 +1711,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL } } textureData->mainResourceStateU = D3D12_RESOURCE_STATE_COPY_DEST; - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_U_POINTER, textureData->mainTextureU); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_U_POINTER, textureData->mainTextureU); if (GetTextureProperty(create_props, "d3d12.texture_v", &textureData->mainTextureV) < 0) { return -1; @@ -1730,7 +1730,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL } } textureData->mainResourceStateV = D3D12_RESOURCE_STATE_COPY_DEST; - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_V_POINTER, textureData->mainTextureV); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_V_POINTER, textureData->mainTextureV); textureData->YCbCr_matrix = SDL_GetYCbCRtoRGBConversionMatrix(texture->colorspace, texture->w, texture->h, 8); if (!textureData->YCbCr_matrix) { @@ -3232,7 +3232,7 @@ int D3D12_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propert { D3D12_RenderData *data; - HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (!hwnd) { return SDL_SetError("Couldn't get window handle"); } diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index 29580af88..e16f39118 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -632,7 +632,7 @@ static int METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL CVPixelBufferRef pixelbuffer = nil; IOSurfaceRef surface = nil; - pixelbuffer = SDL_GetProperty(create_props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, nil); + pixelbuffer = SDL_GetPointerProperty(create_props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, nil); if (pixelbuffer) { surface = CVPixelBufferGetIOSurface(pixelbuffer); if (!surface) { @@ -1861,7 +1861,7 @@ static int METAL_SetVSync(SDL_Renderer *renderer, const int vsync) static SDL_MetalView GetWindowView(SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_COCOA - NSWindow *nswindow = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); + NSWindow *nswindow = (__bridge NSWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); NSInteger tag = (NSInteger)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER, 0); if (nswindow && tag) { NSView *view = nswindow.contentView; @@ -1875,7 +1875,7 @@ static SDL_MetalView GetWindowView(SDL_Window *window) #endif #ifdef SDL_VIDEO_DRIVER_UIKIT - UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL); + UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL); NSInteger tag = (NSInteger)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER, 0); if (uiwindow && tag) { UIView *view = uiwindow.rootViewController.view; diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index 688a0d1d1..025cdc084 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -1713,7 +1713,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert rendererData->supportsKHRGetPhysicalDeviceProperties2 = VULKAN_InstanceExtensionFound(rendererData, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); /* Create VkInstance */ - rendererData->instance = (VkInstance)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, NULL); + rendererData->instance = (VkInstance)SDL_GetPointerProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, NULL); if (rendererData->instance) { rendererData->instance_external = SDL_TRUE; } else { @@ -1769,7 +1769,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert } /* Choose Vulkan physical device */ - rendererData->physicalDevice = (VkPhysicalDevice)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, NULL); + rendererData->physicalDevice = (VkPhysicalDevice)SDL_GetPointerProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, NULL); if (rendererData->physicalDevice) { vkGetPhysicalDeviceMemoryProperties(rendererData->physicalDevice, &rendererData->physicalDeviceMemoryProperties); vkGetPhysicalDeviceFeatures(rendererData->physicalDevice, &rendererData->physicalDeviceFeatures); @@ -1793,7 +1793,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert } /* Create Vulkan device */ - rendererData->device = (VkDevice)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, NULL); + rendererData->device = (VkDevice)SDL_GetPointerProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, NULL); if (rendererData->device) { rendererData->device_external = SDL_TRUE; } else { @@ -1936,10 +1936,10 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert } SDL_PropertiesID props = SDL_GetRendererProperties(renderer); - SDL_SetProperty(props, SDL_PROP_RENDERER_VULKAN_INSTANCE_POINTER, rendererData->instance); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_VULKAN_INSTANCE_POINTER, rendererData->instance); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_VULKAN_SURFACE_NUMBER, (Sint64)rendererData->surface); - SDL_SetProperty(props, SDL_PROP_RENDERER_VULKAN_PHYSICAL_DEVICE_POINTER, rendererData->physicalDevice); - SDL_SetProperty(props, SDL_PROP_RENDERER_VULKAN_DEVICE_POINTER, rendererData->device); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_VULKAN_PHYSICAL_DEVICE_POINTER, rendererData->physicalDevice); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_VULKAN_DEVICE_POINTER, rendererData->device); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER, rendererData->graphicsQueueFamilyIndex); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER, rendererData->presentQueueFamilyIndex); diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 916f64bda..159cb49a0 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1045,7 +1045,7 @@ static void SDLTest_PrintRenderer(SDL_Renderer *renderer) SDL_Log(" Renderer %s:\n", name); SDL_Log(" VSync: %d\n", (int)SDL_GetNumberProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_VSYNC_NUMBER, 0)); - texture_formats = (const SDL_PixelFormat *)SDL_GetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); + texture_formats = (const SDL_PixelFormat *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); if (texture_formats) { (void)SDL_snprintf(text, sizeof(text), " Texture formats: "); for (i = 0; texture_formats[i]; ++i) { diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index c9be0dc91..fdcfe8f62 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -361,10 +361,10 @@ SDL_Thread *SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props, } #endif - SDL_ThreadFunction fn = (SDL_ThreadFunction) SDL_GetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, NULL); + SDL_ThreadFunction fn = (SDL_ThreadFunction) SDL_GetPointerProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, NULL); const char *name = SDL_GetStringProperty(props, SDL_PROP_THREAD_CREATE_NAME_STRING, NULL); const size_t stacksize = (size_t) SDL_GetNumberProperty(props, SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER, 0); - void *userdata = SDL_GetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, NULL); + void *userdata = SDL_GetPointerProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, NULL); if (!fn) { SDL_SetError("Thread entry function is NULL"); @@ -411,9 +411,9 @@ SDL_Thread *SDL_CreateThreadRuntime(SDL_ThreadFunction fn, SDL_FunctionPointer pfnEndThread) { const SDL_PropertiesID props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn); + SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn); SDL_SetStringProperty(props, SDL_PROP_THREAD_CREATE_NAME_STRING, name); - SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata); + SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata); SDL_Thread *thread = SDL_CreateThreadWithPropertiesRuntime(props, pfnBeginThread, pfnEndThread); SDL_DestroyProperties(props); return thread; @@ -423,9 +423,9 @@ SDL_Thread *SDL_CreateThreadRuntime(SDL_ThreadFunction fn, SDL_Thread *SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, size_t stacksize, void *userdata) { const SDL_PropertiesID props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn); + SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn); SDL_SetStringProperty(props, SDL_PROP_THREAD_CREATE_NAME_STRING, name); - SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata); + SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata); SDL_SetNumberProperty(props, SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER, (Sint64) stacksize); SDL_Thread *thread = SDL_CreateThreadWithProperties(props); SDL_DestroyProperties(props); diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index be4e42f38..6618020a3 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -287,7 +287,7 @@ static void SDLCALL SDL_CleanupWindowTextureData(void *userdata, void *value) static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_WindowTextureData *data = (SDL_WindowTextureData *)SDL_GetProperty(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); + SDL_WindowTextureData *data = (SDL_WindowTextureData *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); const SDL_bool transparent = (window->flags & SDL_WINDOW_TRANSPARENT) ? SDL_TRUE : SDL_FALSE; int i; int w, h; @@ -347,7 +347,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S SDL_DestroyRenderer(renderer); return -1; } - if (SDL_SetPropertyWithCleanup(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, data, SDL_CleanupWindowTextureData, NULL) < 0) { + if (SDL_SetPointerPropertyWithCleanup(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, data, SDL_CleanupWindowTextureData, NULL) < 0) { SDL_DestroyRenderer(renderer); return -1; } @@ -355,7 +355,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S data->renderer = renderer; } - texture_formats = (const SDL_PixelFormat *)SDL_GetProperty(SDL_GetRendererProperties(data->renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); + texture_formats = (const SDL_PixelFormat *)SDL_GetPointerProperty(SDL_GetRendererProperties(data->renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); if (!texture_formats) { return -1; } @@ -416,7 +416,7 @@ int SDL_SetWindowTextureVSync(SDL_VideoDevice *_this, SDL_Window *window, int vs { SDL_WindowTextureData *data; - data = (SDL_WindowTextureData *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); + data = (SDL_WindowTextureData *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); if (!data) { return -1; } @@ -430,7 +430,7 @@ static int SDL_GetWindowTextureVSync(SDL_VideoDevice *_this, SDL_Window *window, { SDL_WindowTextureData *data; - data = (SDL_WindowTextureData *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); + data = (SDL_WindowTextureData *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); if (!data) { return -1; } @@ -449,7 +449,7 @@ static int SDL_UpdateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, c SDL_GetWindowSizeInPixels(window, &w, &h); - data = (SDL_WindowTextureData *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); + data = (SDL_WindowTextureData *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); if (!data || !data->texture) { return SDL_SetError("No window texture data"); } @@ -2155,7 +2155,7 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props) int y = (int)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, SDL_WINDOWPOS_UNDEFINED); int w = (int)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, 0); int h = (int)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, 0); - SDL_Window *parent = (SDL_Window *)SDL_GetProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, NULL); + SDL_Window *parent = (SDL_Window *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, NULL); SDL_WindowFlags flags = SDL_GetWindowFlagProperties(props); SDL_WindowFlags type_flags, graphics_flags; SDL_bool undefined_x = SDL_FALSE; @@ -2400,7 +2400,7 @@ SDL_Window *SDL_CreatePopupWindow(SDL_Window *parent, int offset_x, int offset_y return NULL; } - SDL_SetProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, parent); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, parent); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X_NUMBER, offset_x); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, offset_y); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, w); @@ -3758,7 +3758,7 @@ void SDL_OnWindowResized(SDL_Window *window) SDL_CheckWindowPixelSizeChanged(window); if ((window->flags & SDL_WINDOW_TRANSPARENT) && _this->UpdateWindowShape) { - SDL_Surface *surface = (SDL_Surface *)SDL_GetProperty(window->props, SDL_PROP_WINDOW_SHAPE_POINTER, NULL); + SDL_Surface *surface = (SDL_Surface *)SDL_GetPointerProperty(window->props, SDL_PROP_WINDOW_SHAPE_POINTER, NULL); if (surface) { _this->UpdateWindowShape(_this, window, surface); } diff --git a/src/video/android/SDL_androidwindow.c b/src/video/android/SDL_androidwindow.c index 3186f50c7..ea7a78633 100644 --- a/src/video/android/SDL_androidwindow.c +++ b/src/video/android/SDL_androidwindow.c @@ -72,7 +72,7 @@ int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert retval = SDL_SetError("Could not fetch native window"); goto endfunction; } - SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER, data->native_window); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER, data->native_window); /* Do not create EGLSurface for Vulkan window since it will then make the window incompatible with vkCreateAndroidSurfaceKHR */ @@ -87,7 +87,7 @@ int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert goto endfunction; } } - SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER, data->egl_surface); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER, data->egl_surface); #endif window->driverdata = data; diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index f3a17b476..c0f4facb2 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -846,7 +846,7 @@ static NSCursor *Cocoa_GetDesiredCursor(void) - (void)updateIgnoreMouseState:(NSEvent *)theEvent { SDL_Window *window = _data.window; - SDL_Surface *shape = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL); + SDL_Surface *shape = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL); BOOL ignoresMouseEvents = NO; if (shape) { @@ -2054,7 +2054,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, NSWindow } SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_SetProperty(props, SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, (__bridge void *)data.nswindow); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, (__bridge void *)data.nswindow); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER, SDL_METALVIEW_TAG); /* All done! */ @@ -2067,7 +2067,7 @@ int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie { @autoreleasepool { SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata; - const void *data = SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL); + const void *data = SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL); NSWindow *nswindow = nil; NSView *nsview = nil; @@ -2080,8 +2080,8 @@ int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie SDL_assert(false); } } else { - nswindow = (__bridge NSWindow *)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER, NULL); - nsview = (__bridge NSView *)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER, NULL); + nswindow = (__bridge NSWindow *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER, NULL); + nsview = (__bridge NSView *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER, NULL); } if (nswindow && !nsview) { nsview = [nswindow contentView]; diff --git a/src/video/dummy/SDL_nullframebuffer.c b/src/video/dummy/SDL_nullframebuffer.c index 862c36c7e..f1311cfbe 100644 --- a/src/video/dummy/SDL_nullframebuffer.c +++ b/src/video/dummy/SDL_nullframebuffer.c @@ -55,7 +55,7 @@ int SDL_DUMMY_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window static int frame_number; SDL_Surface *surface; - surface = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), DUMMY_SURFACE, NULL); + surface = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), DUMMY_SURFACE, NULL); if (!surface) { return SDL_SetError("Couldn't find dummy surface for window"); } diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index cbf68e4bd..5d231595c 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -1578,7 +1578,7 @@ int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti SDL_PropertiesID props = SDL_GetWindowProperties(window); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER, viddata->devindex); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER, viddata->drm_fd); - SDL_SetProperty(props, SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER, viddata->gbm_dev); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER, viddata->gbm_dev); if (!is_vulkan && !vulkan_mode) { /* NON-Vulkan block. */ diff --git a/src/video/n3ds/SDL_n3dsframebuffer.c b/src/video/n3ds/SDL_n3dsframebuffer.c index 37b3a79b4..1180e20d6 100644 --- a/src/video/n3ds/SDL_n3dsframebuffer.c +++ b/src/video/n3ds/SDL_n3dsframebuffer.c @@ -73,7 +73,7 @@ int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, void *framebuffer; u32 bufsize; - surface = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), N3DS_SURFACE, NULL); + surface = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), N3DS_SURFACE, NULL); if (!surface) { return SDL_SetError("%s: Unable to get the window surface.", __func__); } diff --git a/src/video/offscreen/SDL_offscreenframebuffer.c b/src/video/offscreen/SDL_offscreenframebuffer.c index 89d7e83d7..82bb536d8 100644 --- a/src/video/offscreen/SDL_offscreenframebuffer.c +++ b/src/video/offscreen/SDL_offscreenframebuffer.c @@ -56,7 +56,7 @@ int SDL_OFFSCREEN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *wi static int frame_number; SDL_Surface *surface; - surface = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), OFFSCREEN_SURFACE, NULL); + surface = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), OFFSCREEN_SURFACE, NULL); if (!surface) { return SDL_SetError("Couldn't find offscreen surface for window"); } diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index 395c01322..a93f7a29f 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -146,7 +146,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, UIWindow [view setSDLWindow:window]; SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_SetProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, (__bridge void *)data.uiwindow); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, (__bridge void *)data.uiwindow); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER, SDL_METALVIEW_TAG); return 0; diff --git a/src/video/vivante/SDL_vivantevideo.c b/src/video/vivante/SDL_vivantevideo.c index c808cf878..ed27b2727 100644 --- a/src/video/vivante/SDL_vivantevideo.c +++ b/src/video/vivante/SDL_vivantevideo.c @@ -256,7 +256,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert window->driverdata = data; SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_SetProperty(props, SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER, displaydata->native_display); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER, displaydata->native_display); #ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK data->native_window = vdkCreateWindow(displaydata->native_display, window->x, window->y, window->w, window->h); @@ -266,7 +266,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert if (!data->native_window) { return SDL_SetError("VIVANTE: Can't create native window"); } - SDL_SetProperty(props, SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER, data->native_window); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER, data->native_window); #ifdef SDL_VIDEO_OPENGL_EGL if (window->flags & SDL_WINDOW_OPENGL) { @@ -277,7 +277,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert } else { data->egl_surface = EGL_NO_SURFACE; } - SDL_SetProperty(props, SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER, data->egl_surface); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER, data->egl_surface); #endif /* Window has been successfully created */ diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index dc7232b09..0745c0916 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -377,7 +377,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void) SDL_VideoDevice *device; SDL_VideoData *data; struct SDL_WaylandInput *input; - struct wl_display *display = SDL_GetProperty(SDL_GetGlobalProperties(), + struct wl_display *display = SDL_GetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, NULL); SDL_bool display_is_external = !!display; @@ -441,7 +441,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void) } if (!display_is_external) { - SDL_SetProperty(SDL_GetGlobalProperties(), + SDL_SetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display); } diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 417664759..5d5aa9700 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -1709,8 +1709,8 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) zxdg_exported_v2_add_listener(data->exported, &exported_v2_listener, data); } - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, libdecor_frame_get_xdg_surface(data->shell_surface.libdecor.frame)); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, libdecor_frame_get_xdg_toplevel(data->shell_surface.libdecor.frame)); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, libdecor_frame_get_xdg_surface(data->shell_surface.libdecor.frame)); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, libdecor_frame_get_xdg_toplevel(data->shell_surface.libdecor.frame)); } } else #endif @@ -1718,7 +1718,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) data->shell_surface.xdg.surface = xdg_wm_base_get_xdg_surface(c->shell.xdg, data->surface); xdg_surface_set_user_data(data->shell_surface.xdg.surface, data); xdg_surface_add_listener(data->shell_surface.xdg.surface, &shell_surface_listener_xdg, data); - SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, data->shell_surface.xdg.surface); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, data->shell_surface.xdg.surface); if (data->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) { SDL_Window *parent = window->parent; @@ -1777,8 +1777,8 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) } } - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, data->shell_surface.xdg.roleobj.popup.popup); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, data->shell_surface.xdg.roleobj.popup.positioner); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, data->shell_surface.xdg.roleobj.popup.popup); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, data->shell_surface.xdg.roleobj.popup.positioner); } else { data->shell_surface.xdg.roleobj.toplevel = xdg_surface_get_toplevel(data->shell_surface.xdg.surface); xdg_toplevel_set_app_id(data->shell_surface.xdg.roleobj.toplevel, data->app_id); @@ -1789,7 +1789,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) zxdg_exported_v2_add_listener(data->exported, &exported_v2_listener, data); } - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, data->shell_surface.xdg.roleobj.toplevel); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, data->shell_surface.xdg.roleobj.toplevel); } } @@ -1929,8 +1929,8 @@ static void Wayland_ReleasePopup(SDL_VideoDevice *_this, SDL_Window *popup) popupdata->shell_surface.xdg.roleobj.popup.positioner = NULL; SDL_PropertiesID props = SDL_GetWindowProperties(popup); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, NULL); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, NULL); } void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) @@ -1983,8 +1983,8 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) libdecor_frame_unref(wind->shell_surface.libdecor.frame); wind->shell_surface.libdecor.frame = NULL; - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL); } } else #endif @@ -1993,12 +1993,12 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) } else if (wind->shell_surface.xdg.roleobj.toplevel) { xdg_toplevel_destroy(wind->shell_surface.xdg.roleobj.toplevel); wind->shell_surface.xdg.roleobj.toplevel = NULL; - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL); } if (wind->shell_surface.xdg.surface) { xdg_surface_destroy(wind->shell_surface.xdg.surface); wind->shell_surface.xdg.surface = NULL; - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL); } wind->show_hide_sync_required = SDL_TRUE; @@ -2315,8 +2315,8 @@ int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert { SDL_WindowData *data; SDL_VideoData *c = _this->driverdata; - struct wl_surface *external_surface = (struct wl_surface *)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, - (struct wl_surface *)SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL)); + struct wl_surface *external_surface = (struct wl_surface *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, + (struct wl_surface *)SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL)); const SDL_bool custom_surface_role = (external_surface != NULL) || SDL_GetBooleanProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN, SDL_FALSE); const SDL_bool create_egl_window = !!(window->flags & SDL_WINDOW_OPENGL) || SDL_GetBooleanProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN, SDL_FALSE); @@ -2485,9 +2485,9 @@ int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert } SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, data->waylandData->display); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, data->surface); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER, data->egl_window); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, data->waylandData->display); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, data->surface); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER, data->egl_window); data->hit_test_result = SDL_HITTEST_NORMAL; diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 80901b70c..4b9bcb7ee 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -572,9 +572,9 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, HWND hwnd #endif /*!defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)*/ SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_SetProperty(props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, data->hwnd); - SDL_SetProperty(props, SDL_PROP_WINDOW_WIN32_HDC_POINTER, data->hdc); - SDL_SetProperty(props, SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER, data->hinstance); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, data->hwnd); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WIN32_HDC_POINTER, data->hdc); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER, data->hinstance); /* All done! */ return 0; @@ -673,7 +673,7 @@ static void WIN_SetKeyboardFocus(SDL_Window *window) int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) { - HWND hwnd = (HWND)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER, SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL)); + HWND hwnd = (HWND)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER, SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL)); HWND parent = NULL; if (hwnd) { window->flags |= SDL_WINDOW_EXTERNAL; @@ -755,7 +755,7 @@ int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI } } - HWND share_hwnd = (HWND)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER, NULL); + HWND share_hwnd = (HWND)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER, NULL); if (share_hwnd) { HDC hdc = GetDC(share_hwnd); int pixel_format = GetPixelFormat(hdc); diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index 671977873..48805d3c7 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -610,7 +610,7 @@ int WINRT_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie data->appView = ApplicationView::GetForCurrentView(); #endif } - SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, reinterpret_cast(data->coreWindow.Get())); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, reinterpret_cast(data->coreWindow.Get())); /* Make note of the requested window flags, before they start getting changed. */ const Uint32 requestedFlags = window->flags; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 9aa47aa55..ef12311ea 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -412,7 +412,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, Window w) SDL_PropertiesID props = SDL_GetWindowProperties(window); int screen = (displaydata ? displaydata->screen : 0); - SDL_SetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, data->videodata->display); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, data->videodata->display); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, screen); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, data->xwindow); @@ -454,7 +454,7 @@ static void SetWindowBordered(Display *display, int screen, Window window, SDL_b int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) { Window w = (Window)SDL_GetNumberProperty(create_props, SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER, - (Window)SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL)); + (Window)SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL)); if (w) { window->flags |= SDL_WINDOW_EXTERNAL; diff --git a/test/testautomation_iostream.c b/test/testautomation_iostream.c index 05595236e..3caa7e2be 100644 --- a/test/testautomation_iostream.c +++ b/test/testautomation_iostream.c @@ -343,14 +343,14 @@ static int iostrm_testDynamicMem(void *arg) testGenericIOStreamValidations(rw, SDL_TRUE); /* Get the dynamic memory and verify it */ - mem = (char *)SDL_GetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); - SDLTest_AssertPass("Call to SDL_GetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL) succeeded"); + mem = (char *)SDL_GetPointerProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); + SDLTest_AssertPass("Call to SDL_GetPointerProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL) succeeded"); SDLTest_AssertCheck(mem != NULL, "Verify memory value is not NULL"); mem[SDL_GetIOSize(rw)] = '\0'; SDLTest_AssertCheck(SDL_strcmp(mem, IOStreamHelloWorldTestString) == 0, "Verify memory value is correct"); /* Take the memory and free it ourselves */ - SDL_SetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); SDL_free(mem); /* Close */ diff --git a/test/testautomation_properties.c b/test/testautomation_properties.c index 8373cb36e..1d1ea4f59 100644 --- a/test/testautomation_properties.c +++ b/test/testautomation_properties.c @@ -43,12 +43,12 @@ static int properties_testBasic(void *arg) for (i = 0; i < 10; ++i) { SDL_snprintf(key, SDL_arraysize(key), "%c", 'a' + i); SDL_snprintf(expected_value, SDL_arraysize(expected_value), "%c", 'a' + i); - result = SDL_SetProperty(props, key, expected_value); - SDLTest_AssertPass("Call to SDL_SetProperty()"); + result = SDL_SetPointerProperty(props, key, expected_value); + SDLTest_AssertPass("Call to SDL_SetPointerProperty()"); SDLTest_AssertCheck(result == 0, "Verify property value was set, got: %d", result); - value = SDL_GetProperty(props, key, NULL); - SDLTest_AssertPass("Call to SDL_GetProperty()"); + value = SDL_GetPointerProperty(props, key, NULL); + SDLTest_AssertPass("Call to SDL_GetPointerProperty()"); SDLTest_AssertCheck(value && SDL_strcmp((const char *)value, expected_value) == 0, "Verify property value was set, got %s, expected %s", value ? (const char *)value : "NULL", expected_value); } @@ -60,12 +60,12 @@ static int properties_testBasic(void *arg) for (i = 0; i < 10; ++i) { SDL_snprintf(key, SDL_arraysize(key), "%c", 'a' + i); - result = SDL_SetProperty(props, key, NULL); - SDLTest_AssertPass("Call to SDL_SetProperty(NULL)"); + result = SDL_SetPointerProperty(props, key, NULL); + SDLTest_AssertPass("Call to SDL_SetPointerProperty(NULL)"); SDLTest_AssertCheck(result == 0, "Verify property value was set, got: %d", result); - value = SDL_GetProperty(props, key, NULL); - SDLTest_AssertPass("Call to SDL_GetProperty()"); + value = SDL_GetPointerProperty(props, key, NULL); + SDLTest_AssertPass("Call to SDL_GetPointerProperty()"); SDLTest_AssertCheck(value == NULL, "Verify property value was set, got %s, expected NULL", (const char *)value); } @@ -76,7 +76,7 @@ static int properties_testBasic(void *arg) "Verify property count, expected 0, got: %d", count); /* Check default values */ - value = SDL_GetProperty(props, "foo", (void *)0xabcd); + value = SDL_GetPointerProperty(props, "foo", (void *)0xabcd); SDLTest_AssertCheck(value == (void *)0xabcd, "Verify property, expected 0xabcd, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", "abcd"); @@ -93,12 +93,12 @@ static int properties_testBasic(void *arg) "Verify boolean property, expected SDL_TRUE, got: %s", value_bool ? "SDL_TRUE" : "SDL_FALSE"); /* Check data value */ - SDLTest_AssertPass("Call to SDL_SetProperty(\"foo\", 0x01)"); - SDL_SetProperty(props, "foo", (void *)0x01); + SDLTest_AssertPass("Call to SDL_SetPointerProperty(\"foo\", 0x01)"); + SDL_SetPointerProperty(props, "foo", (void *)0x01); type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_POINTER, "Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_POINTER, type); - value = SDL_GetProperty(props, "foo", NULL); + value = SDL_GetPointerProperty(props, "foo", NULL); SDLTest_AssertCheck(value == (void *)0x01, "Verify property, expected 0x01, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", NULL); @@ -120,7 +120,7 @@ static int properties_testBasic(void *arg) type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_STRING, "Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_STRING, type); - value = SDL_GetProperty(props, "foo", NULL); + value = SDL_GetPointerProperty(props, "foo", NULL); SDLTest_AssertCheck(value == NULL, "Verify property, expected NULL, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", NULL); @@ -142,7 +142,7 @@ static int properties_testBasic(void *arg) type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_NUMBER, "Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_NUMBER, type); - value = SDL_GetProperty(props, "foo", NULL); + value = SDL_GetPointerProperty(props, "foo", NULL); SDLTest_AssertCheck(value == NULL, "Verify property, expected NULL, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", NULL); @@ -164,7 +164,7 @@ static int properties_testBasic(void *arg) type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_FLOAT, "Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_FLOAT, type); - value = SDL_GetProperty(props, "foo", NULL); + value = SDL_GetPointerProperty(props, "foo", NULL); SDLTest_AssertCheck(value == NULL, "Verify property, expected NULL, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", NULL); @@ -186,7 +186,7 @@ static int properties_testBasic(void *arg) type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_BOOLEAN, "Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_BOOLEAN, type); - value = SDL_GetProperty(props, "foo", NULL); + value = SDL_GetPointerProperty(props, "foo", NULL); SDLTest_AssertCheck(value == NULL, "Verify property, expected NULL, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", NULL); @@ -230,8 +230,8 @@ static int properties_testCopy(void *arg) a = SDL_CreateProperties(); SDL_SetNumberProperty(a, "num", 1); SDL_SetStringProperty(a, "string", "foo"); - SDL_SetProperty(a, "data", &a); - SDL_SetPropertyWithCleanup(a, "cleanup", &a, copy_cleanup, &a); + SDL_SetPointerProperty(a, "data", &a); + SDL_SetPointerPropertyWithCleanup(a, "cleanup", &a, copy_cleanup, &a); b = SDL_CreateProperties(); SDL_SetNumberProperty(b, "num", 2); @@ -261,11 +261,11 @@ static int properties_testCopy(void *arg) SDLTest_AssertCheck(string && SDL_strcmp(string, "foo") == 0, "Checking string property, got \"%s\", expected \"foo\"", string); - data = SDL_GetProperty(b, "data", NULL); + data = SDL_GetPointerProperty(b, "data", NULL); SDLTest_AssertCheck(data == &a, "Checking data property, got %p, expected %p", data, &a); - data = SDL_GetProperty(b, "cleanup", NULL); + data = SDL_GetPointerProperty(b, "cleanup", NULL); SDLTest_AssertCheck(data == NULL, "Checking cleanup property, got %p, expected NULL", data); @@ -290,9 +290,9 @@ static int properties_testCleanup(void *arg) props = SDL_CreateProperties(); - SDLTest_AssertPass("Call to SDL_SetProperty(cleanup)"); + SDLTest_AssertPass("Call to SDL_SetPointerProperty(cleanup)"); count = 0; - SDL_SetPropertyWithCleanup(props, "a", "0", cleanup, &count); + SDL_SetPointerPropertyWithCleanup(props, "a", "0", cleanup, &count); SDL_ClearProperty(props, "a"); SDLTest_AssertCheck(count == 1, "Verify cleanup for deleting property, got %d, expected 1", count); @@ -302,7 +302,7 @@ static int properties_testCleanup(void *arg) for (i = 0; i < 10; ++i) { SDL_snprintf(key, SDL_arraysize(key), "%c", 'a' + i); SDL_snprintf(expected_value, SDL_arraysize(expected_value), "%c", 'a' + i); - SDL_SetPropertyWithCleanup(props, key, expected_value, cleanup, &count); + SDL_SetPointerPropertyWithCleanup(props, key, expected_value, cleanup, &count); } SDL_DestroyProperties(props); SDLTest_AssertCheck(count == 10, @@ -325,11 +325,11 @@ static int properties_thread(void *arg) while (!data->done) { SDL_LockProperties(data->props); - SDL_SetProperty(data->props, "a", "thread_loop"); + SDL_SetPointerProperty(data->props, "a", "thread_loop"); SDL_UnlockProperties(data->props); } SDL_LockProperties(data->props); - SDL_SetProperty(data->props, "a", "thread_done"); + SDL_SetPointerProperty(data->props, "a", "thread_done"); SDL_UnlockProperties(data->props); return 0; } @@ -343,7 +343,7 @@ static int properties_testLocking(void *arg) data.done = SDL_FALSE; data.props = SDL_CreateProperties(); SDLTest_AssertPass("Setting property to 'init'"); - SDL_SetProperty(data.props, "a", "init"); + SDL_SetPointerProperty(data.props, "a", "init"); thread = SDL_CreateThread(properties_thread, "properties_thread", &data); if (thread) { SDLTest_AssertPass("Waiting for property to change to 'thread_loop'"); @@ -351,7 +351,7 @@ static int properties_testLocking(void *arg) { SDL_Delay(10); SDL_LockProperties(data.props); - value = SDL_GetProperty(data.props, "a", NULL); + value = SDL_GetPointerProperty(data.props, "a", NULL); SDL_UnlockProperties(data.props); if (!value || SDL_strcmp((const char *)value, "thread_loop") == 0) { @@ -363,9 +363,9 @@ static int properties_testLocking(void *arg) SDLTest_AssertPass("Setting property to 'main'"); SDL_LockProperties(data.props); - SDL_SetProperty(data.props, "a", "main"); + SDL_SetPointerProperty(data.props, "a", "main"); SDL_Delay(100); - value = SDL_GetProperty(data.props, "a", NULL); + value = SDL_GetPointerProperty(data.props, "a", NULL); SDLTest_AssertCheck(value && SDL_strcmp((const char *)value, "main") == 0, "After 100ms sleep, property is %s, expected 'main'", value ? (const char *)value : "NULL"); SDL_UnlockProperties(data.props); @@ -373,7 +373,7 @@ static int properties_testLocking(void *arg) data.done = SDL_TRUE; SDL_WaitThread(thread, NULL); - value = SDL_GetProperty(data.props, "a", NULL); + value = SDL_GetPointerProperty(data.props, "a", NULL); SDLTest_AssertCheck(value && SDL_strcmp((const char *)value, "thread_done") == 0, "After thread complete, property is %s, expected 'thread_done'", value ? (const char *)value : "NULL"); } diff --git a/test/testautomation_video.c b/test/testautomation_video.c index 577e3d7d1..b8b995a3c 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -1528,20 +1528,20 @@ static int video_getSetWindowData(void *arg) } /* Get non-existent data */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Set data */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s)", name, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); /* Get data (twice) */ for (iteration = 1; iteration <= 2; iteration++) { - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [iteration %d]", name, iteration); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); @@ -1549,103 +1549,103 @@ static int video_getSetWindowData(void *arg) /* Set data again twice */ for (iteration = 1; iteration <= 2; iteration++) { - SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [iteration %d]", name, userdata, iteration); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); } /* Get data again */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again]", name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Set data with new data */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata2); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata2); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata]", name, userdata2); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); /* Set data with new data again */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata2); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata2); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata again]", name, userdata2); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); /* Get new data */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Set data with NULL to clear */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, NULL); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); /* Set data with NULL to clear again */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, NULL); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); /* Get non-existent data */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Get non-existent data new name */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name2, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name2, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name2); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName2, name2) == 0, "Validate that name2 was not changed, expected: %s, got: %s", referenceName2, name2); /* Set data (again) */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [again, after clear]", name, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); /* Get data (again) */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again, after clear]", name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Set data with NULL name, valid userdata */ - SDL_SetProperty(SDL_GetWindowProperties(window), NULL, userdata); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), NULL, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL)"); checkInvalidParameterError(); /* Set data with empty name, valid userdata */ - SDL_SetProperty(SDL_GetWindowProperties(window), "", userdata); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), "", userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(name='')"); checkInvalidParameterError(); /* Set data with NULL name, NULL userdata */ - SDL_SetProperty(SDL_GetWindowProperties(window), NULL, NULL); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), NULL, NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL,userdata=NULL)"); checkInvalidParameterError(); /* Set data with empty name, NULL userdata */ - SDL_SetProperty(SDL_GetWindowProperties(window), "", NULL); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), "", NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(name='',userdata=NULL)"); checkInvalidParameterError(); /* Get data with NULL name */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), NULL, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), NULL, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(name=NULL)"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); /* Get data with empty name */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), "", NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), "", NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(name='')"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); diff --git a/test/testcolorspace.c b/test/testcolorspace.c index 6afa0d748..159049f56 100644 --- a/test/testcolorspace.c +++ b/test/testcolorspace.c @@ -78,7 +78,7 @@ static void CreateRenderer(void) SDL_PropertiesID props; props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); SDL_SetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, SDL_GetRenderDriver(renderer_index)); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER, colorspace); renderer = SDL_CreateRendererWithProperties(props); diff --git a/test/testffmpeg.c b/test/testffmpeg.c index 0adbb23e3..71a402a24 100644 --- a/test/testffmpeg.c +++ b/test/testffmpeg.c @@ -151,7 +151,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char props = SDL_CreateProperties(); SDL_SetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, driver); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); if (useVulkan) { SetupVulkanRenderProperties(vulkan_context, props); } @@ -217,7 +217,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char #endif /* HAVE_EGL */ #ifdef SDL_PLATFORM_WIN32 - d3d11_device = (ID3D11Device *)SDL_GetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, NULL); + d3d11_device = (ID3D11Device *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, NULL); if (d3d11_device) { ID3D11Device_AddRef(d3d11_device); ID3D11Device_GetImmediateContext(d3d11_device, &d3d11_context); @@ -611,13 +611,13 @@ static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture) case SDL_PIXELFORMAT_UNKNOWN: { SDL_PropertiesID props = SDL_GetTextureProperties(*texture); - struct SwsContextContainer *sws_container = (struct SwsContextContainer *)SDL_GetProperty(props, SWS_CONTEXT_CONTAINER_PROPERTY, NULL); + struct SwsContextContainer *sws_container = (struct SwsContextContainer *)SDL_GetPointerProperty(props, SWS_CONTEXT_CONTAINER_PROPERTY, NULL); if (!sws_container) { sws_container = (struct SwsContextContainer *)SDL_calloc(1, sizeof(*sws_container)); if (!sws_container) { return SDL_FALSE; } - SDL_SetPropertyWithCleanup(props, SWS_CONTEXT_CONTAINER_PROPERTY, sws_container, FreeSwsContextContainer, NULL); + SDL_SetPointerPropertyWithCleanup(props, SWS_CONTEXT_CONTAINER_PROPERTY, sws_container, FreeSwsContextContainer, NULL); } sws_container->context = sws_getCachedContext(sws_container->context, frame->width, frame->height, frame->format, frame->width, frame->height, AV_PIX_FMT_BGRA, SWS_POINT, NULL, NULL, NULL); if (sws_container->context) { @@ -993,7 +993,7 @@ static SDL_bool GetTextureForD3D11Frame(AVFrame *frame, SDL_Texture **texture) } } - ID3D11Resource *dx11_resource = SDL_GetProperty(SDL_GetTextureProperties(*texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, NULL); + ID3D11Resource *dx11_resource = SDL_GetPointerProperty(SDL_GetTextureProperties(*texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, NULL); if (!dx11_resource) { SDL_SetError("Couldn't get texture ID3D11Resource interface"); return SDL_FALSE; @@ -1019,7 +1019,7 @@ static SDL_bool GetTextureForVideoToolboxFrame(AVFrame *frame, SDL_Texture **tex } props = CreateVideoTextureProperties(frame, SDL_PIXELFORMAT_UNKNOWN, SDL_TEXTUREACCESS_STATIC); - SDL_SetProperty(props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, pPixelBuffer); + SDL_SetPointerProperty(props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, pPixelBuffer); *texture = SDL_CreateTextureWithProperties(renderer, props); SDL_DestroyProperties(props); if (!*texture) { diff --git a/test/testffmpeg_vulkan.c b/test/testffmpeg_vulkan.c index 36d69dd61..3085733ce 100644 --- a/test/testffmpeg_vulkan.c +++ b/test/testffmpeg_vulkan.c @@ -671,10 +671,10 @@ VulkanVideoContext *CreateVulkanVideoContext(SDL_Window *window) void SetupVulkanRenderProperties(VulkanVideoContext *context, SDL_PropertiesID props) { - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, context->instance); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, context->instance); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER, (Sint64)context->surface); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, context->physicalDevice); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, context->device); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, context->physicalDevice); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, context->device); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER, context->presentQueueFamilyIndex); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER, context->graphicsQueueFamilyIndex); } diff --git a/test/testmanymouse.c b/test/testmanymouse.c index 8c7180f71..6f9e418ab 100644 --- a/test/testmanymouse.c +++ b/test/testmanymouse.c @@ -479,8 +479,8 @@ static void loop(void) for (i = 0; i < state->num_windows; ++i) { SDL_Window *window = state->windows[i]; SDL_Renderer *renderer = state->renderers[i]; - SDL_Texture *arrow_cursor = (SDL_Texture *)SDL_GetProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, NULL); - SDL_Texture *cross_cursor = (SDL_Texture *)SDL_GetProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, NULL); + SDL_Texture *arrow_cursor = (SDL_Texture *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, NULL); + SDL_Texture *cross_cursor = (SDL_Texture *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, NULL); SDL_SetRenderDrawColor(renderer, 128, 128, 128, 255); SDL_RenderClear(renderer); @@ -538,8 +538,8 @@ int main(int argc, char *argv[]) SDL_Texture *cursor_arrow = CreateTexture(arrow, renderer); SDL_Texture *cursor_cross = CreateTexture(cross, renderer); - SDL_SetProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, cursor_arrow); - SDL_SetProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, cursor_cross); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, cursor_arrow); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, cursor_cross); } /* We only get mouse motion for distinct devices when relative mode is enabled */ diff --git a/test/testnative.c b/test/testnative.c index 6a0db0757..aee65b3ee 100644 --- a/test/testnative.c +++ b/test/testnative.c @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) quit(3); } props = SDL_CreateProperties(); - SDL_SetProperty(props, "sdl2-compat.external_window", native_window); + SDL_SetPointerProperty(props, "sdl2-compat.external_window", native_window); SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, SDL_TRUE); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, WINDOW_W); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, WINDOW_H); diff --git a/test/testnativewayland.c b/test/testnativewayland.c index f4a9b465c..6f5c00ccd 100644 --- a/test/testnativewayland.c +++ b/test/testnativewayland.c @@ -116,7 +116,7 @@ static void *CreateWindowWayland(int w, int h) /* Export the display object from SDL and use it to create a registry object, * which will enumerate the wl_compositor and xdg_wm_base protocols. */ - state.wl_display = SDL_GetProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, NULL); + state.wl_display = SDL_GetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, NULL); if (!state.wl_display) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid 'wl_display' object!"); diff --git a/test/testwaylandcustom.c b/test/testwaylandcustom.c index 753c2c88d..6e6bd37c7 100644 --- a/test/testwaylandcustom.c +++ b/test/testwaylandcustom.c @@ -227,7 +227,7 @@ int main(int argc, char **argv) } /* Get the display object and use it to create a registry object, which will enumerate the xdg_wm_base protocol. */ - state.wl_display = SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL); + state.wl_display = SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL); state.wl_registry = wl_display_get_registry(state.wl_display); wl_registry_add_listener(state.wl_registry, &wl_registry_listener, NULL); @@ -240,7 +240,7 @@ int main(int argc, char **argv) } /* Get the wl_surface object from the SDL_Window, and create a toplevel window with it. */ - state.wl_surface = SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); + state.wl_surface = SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); /* Create the xdg_surface from the wl_surface. */ state.xdg_surface = xdg_wm_base_get_xdg_surface(state.xdg_wm_base, state.wl_surface);