SDL: Added constant definitions for SDL properties

From 1a13dae2197cb4d63a21b2abe15fdd881d5f9a9a Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 7 Jan 2024 16:59:41 -0800
Subject: [PATCH] Added constant definitions for SDL properties

Fixes https://github.com/libsdl-org/SDL/issues/8622
---
 docs/README-migration.md                   |  22 +--
 include/SDL3/SDL_render.h                  | 168 +++++++----------
 include/SDL3/SDL_video.h                   | 208 +++++++++------------
 src/core/linux/SDL_fcitx.c                 |   6 +-
 src/core/linux/SDL_ibus.c                  |   6 +-
 src/render/SDL_render.c                    |  34 ++--
 src/render/direct3d/SDL_render_d3d.c       |   6 +-
 src/render/direct3d11/SDL_render_d3d11.c   |  12 +-
 src/render/direct3d11/SDL_render_winrt.cpp |   2 +-
 src/render/direct3d12/SDL_render_d3d12.c   |  18 +-
 src/render/metal/SDL_render_metal.m        |  10 +-
 src/render/opengl/SDL_render_gl.c          |  22 +--
 src/render/opengles2/SDL_render_gles2.c    |  20 +-
 src/render/ps2/SDL_render_ps2.c            |   2 +-
 src/render/psp/SDL_render_psp.c            |   2 +-
 src/render/software/SDL_render_sw.c        |   2 +-
 src/render/vitagxm/SDL_render_vita_gxm.c   |   2 +-
 src/test/SDL_test_common.c                 |  10 +-
 src/video/SDL_video.c                      |  62 +++---
 src/video/android/SDL_androidwindow.c      |   4 +-
 src/video/cocoa/SDL_cocoawindow.m          |   8 +-
 src/video/kmsdrm/SDL_kmsdrmvideo.c         |   6 +-
 src/video/uikit/SDL_uikitwindow.m          |   4 +-
 src/video/vivante/SDL_vivantevideo.c       |   6 +-
 src/video/wayland/SDL_waylandwindow.c      |  32 ++--
 src/video/windows/SDL_windowswindow.c      |  10 +-
 src/video/winrt/SDL_winrtvideo.cpp         |   2 +-
 src/video/x11/SDL_x11window.c              |   8 +-
 test/testautomation_video.c                |  14 +-
 test/testffmpeg.c                          |   4 +-
 30 files changed, 322 insertions(+), 390 deletions(-)

diff --git a/docs/README-migration.md b/docs/README-migration.md
index c8b0b9274b8b..20c7216841e1 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -1303,25 +1303,25 @@ The information previously available in SDL_GetWindowWMInfo() is now available a
 becomes:
 ```c
 #if defined(__WIN32__)
-    HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), "SDL.window.win32.hwnd", NULL);
+    HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROPERTY_WINDOW_WIN32_HWND_POINTER, NULL);
     if (hwnd) {
         ...
     }
 #elif defined(__MACOS__)
-    NSWindow *nswindow = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), "SDL.window.cocoa.window", NULL);
+    NSWindow *nswindow = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROPERTY_WINDOW_COCOA_WINDOW_POINTER, NULL);
     if (nswindow) {
         ...
     }
 #elif defined(__LINUX__)
     if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) {
-        Display *xdisplay = (Display *)SDL_GetProperty(SDL_GetWindowProperties(window), "SDL.window.x11.display", NULL);
-        Window xwindow = (Window)SDL_GetNumberProperty(SDL_GetWindowProperties(window), "SDL.window.x11.window", 0);
+        Display *xdisplay = (Display *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROPERTY_WINDOW_X11_DISPLAY_POINTER, NULL);
+        Window xwindow = (Window)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROPERTY_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.window.wayland.display", NULL);
-        struct wl_surface *surface = (struct wl_surface *)SDL_GetProperty(SDL_GetWindowProperties(window), "SDL.window.wayland.surface", NULL);
+        struct wl_display *display = (struct wl_display *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROPERTY_WINDOW_WAYLAND_DISPLAY_POINTER, NULL);
+        struct wl_surface *surface = (struct wl_surface *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROPERTY_WINDOW_WAYLAND_SURFACE_POINTER, NULL);
         if (display && surface) {
             ...
         }
@@ -1404,11 +1404,11 @@ Rather than iterating over displays using display index, there is a new function
 SDL_CreateWindow() has been simplified and no longer takes a window position. You can use SDL_CreateWindowWithProperties() if you need to set the window position when creating it, e.g.
 ```c
     SDL_PropertiesID props = SDL_CreateProperties();
-    SDL_SetStringProperty(props, "title", title);
-    SDL_SetNumberProperty(props, "x", x);
-    SDL_SetNumberProperty(props, "y", y);
-    SDL_SetNumberProperty(props, "width", width);
-    SDL_SetNumberProperty(props, "height", height);
+    SDL_SetStringProperty(props, SDL_PROPERTY_WINDOW_CREATE_TITLE_STRING, title);
+    SDL_SetNumberProperty(props, SDL_PROPERTY_WINDOW_CREATE_X_NUMBER, x);
+    SDL_SetNumberProperty(props, SDL_PROPERTY_WINDOW_CREATE_Y_NUMBER, y);
+    SDL_SetNumberProperty(props, SDL_PROPERTY_WINDOW_CREATE_WIDTH_NUMBER, width);
+    SDL_SetNumberProperty(props, SDL_PROPERTY_WINDOW_CREATE_HEIGHT_NUMBER, height);
     SDL_SetNumberProperty(props, "flags", flags);
     pWindow = SDL_CreateWindowWithProperties(props);
     SDL_DestroyProperties(props);
diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h
index 392335096828..07bd03123724 100644
--- a/include/SDL3/SDL_render.h
+++ b/include/SDL3/SDL_render.h
@@ -239,15 +239,12 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window, co
  * Create a 2D rendering context for a window, with the specified properties.
  *
  * These are the supported properties:
- *
- * - "window" (pointer) - the window where rendering is displayed
- * - "surface" (pointer) - the surface where rendering is displayed, if you
- *   want a software renderer without a window
- * - "name" (string) - the name of the rendering driver to use, if a specific
- *   one is desired
- * - "present_vsync" (boolean) - true if you want present synchronized with
- *   the refresh rate
- *
+ */
+#define SDL_PROPERTY_RENDERER_CREATE_WINDOW_POINTER         "window"        /* the window where rendering is displayed */
+#define SDL_PROPERTY_RENDERER_CREATE_SURFACE_POINTER        "surface"       /* the surface where rendering is displayed, if you want a software renderer without a window */
+#define SDL_PROPERTY_RENDERER_CREATE_NAME_STRING            "name"          /* the name of the rendering driver to use, if a specific one is desired */
+#define SDL_PROPERTY_RENDERER_CREATE_PRESENT_VSYNC_BOOLEAN  "present_vsync" /* true if you want present synchronized with the refresh rate */
+/*
  * \param props the properties to use
  * \returns a valid rendering context or NULL if there was an error; call
  *          SDL_GetError() for more information.
@@ -325,14 +322,12 @@ extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_Rend
  * Get the properties associated with a renderer.
  *
  * The following read-only properties are provided by SDL:
- *
- * ```
- * "SDL.renderer.d3d9.device" (pointer) - the IDirect3DDevice9 associated with the renderer
- * "SDL.renderer.d3d11.device" (pointer) - the ID3D11Device associated with the renderer
- * "SDL.renderer.d3d12.device" (pointer) - the ID3D12Device associated with the renderer
- * "SDL.renderer.d3d12.command_queue" (pointer) - the ID3D12CommandQueue associated with the renderer
- * ```
- *
+ */
+#define SDL_PROPERTY_RENDERER_D3D9_DEVICE_POINTER           "SDL.renderer.d3d9.device"          /* the IDirect3DDevice9 associated with the renderer */
+#define SDL_PROPERTY_RENDERER_D3D11_DEVICE_POINTER          "SDL.renderer.d3d11.device"         /* the ID3D11Device associated with the renderer */
+#define SDL_PROPERTY_RENDERER_D3D12_DEVICE_POINTER          "SDL.renderer.d3d12.device"         /* the ID3D12Device associated with the renderer */
+#define SDL_PROPERTY_RENDERER_D3D12_COMMAND_QUEUE_POINTER   "SDL.renderer.d3d12.command_queue"  /* the ID3D12CommandQueue associated with the renderer */
+/*
  * \param renderer the rendering context
  * \returns a valid property ID on success or 0 on failure; call
  *          SDL_GetError() for more information.
@@ -439,54 +434,39 @@ extern DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer *
  * Create a texture for a rendering context with the specified properties.
  *
  * These are the supported properties:
- *
- * - "format" (number) - one of the enumerated values in SDL_PixelFormatEnum,
- *   defaults to the best RGBA format for the renderer
- * - "access" (number) - one of the enumerated values in SDL_TextureAccess,
- *   defaults to SDL_TEXTUREACCESS_STATIC
- * - "width" (number) - the width of the texture in pixels, required
- * - "height" (number) - the height of the texture in pixels, required
- *
+ */
+#define SDL_PROPERTY_TEXTURE_CREATE_FORMAT_NUMBER               "format"                            /* one of the enumerated values in SDL_PixelFormatEnum, defaults to the best RGBA format for the renderer */
+#define SDL_PROPERTY_TEXTURE_CREATE_ACCESS_NUMBER               "access"                            /* one of the enumerated values in SDL_TextureAccess, defaults to SDL_TEXTUREACCESS_STATIC */
+#define SDL_PROPERTY_TEXTURE_CREATE_WIDTH_NUMBER                "width"                             /* the width of the texture in pixels, required */
+#define SDL_PROPERTY_TEXTURE_CREATE_HEIGHT_NUMBER               "height"                            /* the height of the texture in pixels, required */
+/*
  * With the direct3d11 renderer:
- *
- * - "d3d11.texture" (pointer) - the ID3D11Texture2D associated with the
- *   texture, if you want to wrap an existing texture.
- * - "d3d11.texture_u" (pointer) - the ID3D11Texture2D associated with the U
- *   plane of a YUV texture, if you want to wrap an existing texture.
- * - "d3d11.texture_v" (pointer) - the ID3D11Texture2D associated with the V
- *   plane of a YUV texture, if you want to wrap an existing texture.
- *
+ */
+#define SDL_PROPERTY_TEXTURE_CREATE_D3D11_TEXTURE_POINTER       "d3d11.texture"                     /* the ID3D11Texture2D associated with the texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER     "d3d11.texture_u"                   /* the ID3D11Texture2D associated with the U plane of a YUV texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER     "d3d11.texture_v"                   /* the ID3D11Texture2D associated with the V plane of a YUV texture, if you want to wrap an existing texture. */
+/*
  * With the direct3d12 renderer:
- *
- * - "d3d12.texture" (pointer) - the ID3D12Resource associated with the
- *   texture, if you want to wrap an existing texture.
- * - "d3d12.texture_u" (pointer) - the ID3D12Resource associated with the U
- *   plane of a YUV texture, if you want to wrap an existing texture.
- * - "d3d12.texture_v" (pointer) - the ID3D12Resource associated with the V
- *   plane of a YUV texture, if you want to wrap an existing texture.
- *
+ */
+#define SDL_PROPERTY_TEXTURE_CREATE_D3D12_TEXTURE_POINTER       "d3d12.texture"                     /* the ID3D12Resource associated with the texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER     "d3d12.texture_u"                   /* the ID3D12Resource associated with the U plane of a YUV texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER     "d3d12.texture_v"                   /* the ID3D12Resource associated with the V plane of a YUV texture, if you want to wrap an existing texture. */
+/*
  * With the opengl renderer:
- *
- * - "opengl.texture" (number) - the GLuint texture associated with the
- *   texture, if you want to wrap an existing texture.
- * - "opengl.texture_uv" (number) - the GLuint texture associated with the UV
- *   plane of an NV12 texture, if you want to wrap an existing texture.
- * - "opengl.texture_u" (number) - the GLuint texture associated with the U
- *   plane of a YUV texture, if you want to wrap an existing texture.
- * - "opengl.texture_v" (number) - the GLuint texture associated with the V
- *   plane of a YUV texture, if you want to wrap an existing texture.
- *
+ */
+#define SDL_PROPERTY_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER       "opengl.texture"                    /* the GLuint texture associated with the texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER    "opengl.texture_uv"                 /* the GLuint texture associated with the UV plane of an NV12 texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER     "opengl.texture_u"                  /* the GLuint texture associated with the U plane of a YUV texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER     "opengl.texture_v"                  /* the GLuint texture associated with the V plane of a YUV texture, if you want to wrap an existing texture. */
+/*
  * With the opengles2 renderer:
- *
- * - "opengles2.texture" (number) - the GLuint texture associated with the
- *   texture, if you want to wrap an existing texture.
- * - "opengles2.texture_uv" (number) - the GLuint texture associated with the
- *   UV plane of an NV12 texture, if you want to wrap an existing texture.
- * - "opengles2.texture_u" (number) - the GLuint texture associated with the U
- *   plane of a YUV texture, if you want to wrap an existing texture.
- * - "opengles2.texture_v" (number) - the GLuint texture associated with the V
- *   plane of a YUV texture, if you want to wrap an existing texture.
- *
+ */
+#define SDL_PROPERTY_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER    "opengles2.texture"                 /* the GLuint texture associated with the texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER    "opengles2.texture"                 /* the GLuint texture associated with the texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "opengles2.texture_uv"              /* the GLuint texture associated with the UV plane of an NV12 texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER  "opengles2.texture_u"               /* the GLuint texture associated with the U plane of a YUV texture, if you want to wrap an existing texture. */
+#define SDL_PROPERTY_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER  "opengles2.texture_v"               /* the GLuint texture associated with the V plane of a YUV texture, if you want to wrap an existing texture. */
+/*
  * \param renderer the rendering context
  * \param props the properties to use
  * \returns a pointer to the created texture or NULL if no rendering context
@@ -507,51 +487,37 @@ extern DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureWithProperties(SDL_Rendere
  * Get the properties associated with a texture.
  *
  * The following read-only properties are provided by SDL:
- *
+ */
+/*
  * With the direct3d11 renderer:
- *
- * - "SDL.texture.d3d11.texture" (pointer) - the ID3D11Texture2D associated
- *   with the texture
- * - "SDL.texture.d3d11.texture_u" (pointer) - the ID3D11Texture2D associated
- *   with the U plane of a YUV texture
- * - "SDL.texture.d3d11.texture_v" (pointer) - the ID3D11Texture2D associated
- *   with the V plane of a YUV texture
- *
+ */
+#define SDL_PROPERTY_TEXTURE_D3D11_TEXTURE_POINTER              "SDL.texture.d3d11.texture"         /* the ID3D11Texture2D associated with the texture */
+#define SDL_PROPERTY_TEXTURE_D3D11_TEXTURE_U_POINTER            "SDL.texture.d3d11.texture_u"       /* the ID3D11Texture2D associated with the U plane of a YUV texture */
+#define SDL_PROPERTY_TEXTURE_D3D11_TEXTURE_V_POINTER            "SDL.texture.d3d11.texture_v"       /* the ID3D11Texture2D associated with the V plane of a YUV texture */
+/*
  * With the direct3d12 renderer:
- *
- * - "SDL.texture.d3d12.texture" (pointer) - the ID3D12Resource associated
- *   with the texture
- * - "SDL.texture.d3d12.texture_u" (pointer) - the ID3D12Resource associated
- *   with the U plane of a YUV texture
- * - "SDL.texture.d3d12.texture_v" (pointer) - the ID3D12Resource associated
- *   with the V plane of a YUV texture
- *
+ */
+#define SDL_PROPERTY_TEXTURE_D3D12_TEXTURE_POINTER              "SDL.texture.d3d12.texture"         /* the ID3D12Resource associated with the texture */
+#define SDL_PROPERTY_TEXTURE_D3D12_TEXTURE_U_POINTER            "SDL.texture.d3d12.texture_u"       /* the ID3D12Resource associated with the U plane of a YUV texture */
+#define SDL_PROPERTY_TEXTURE_D3D12_TEXTURE_V_POINTER            "SDL.texture.d3d12.texture_v"       /* the ID3D12Resource associated with the V plane of a YUV texture */
+/*
  * With the opengl renderer:
- *
- * - "SDL.texture.opengl.texture" (number) - the GLuint texture associated
- *   with the texture
- * - "SDL.texture.opengl.texture_uv" (number) - the GLuint texture associated
- *   with the UV plane of an NV12 texture
- * - "SDL.texture.opengl.texture_u" (number) - the GLuint texture associated
- *   with the U plane of a YUV texture
- * - "SDL.texture.opengl.texture_v" (number) - the GLuint texture associated
- *   with the V plane of a YUV texture
- * - "SDL.texture.opengl.tex_w" (float) - the texture coordinate width of the
- *   texture (0.0 - 1.0)
- * - "SDL.texture.opengl.tex_h" (float) - the texture coordinate height of the
- *   texture (0.0 - 1.0)
- *
+ */
+#define SDL_PROPERTY_TEXTURE_OPENGL_TEXTURE_NUMBER              "SDL.texture.opengl.texture"        /* the GLuint texture associated with the texture */
+#define SDL_PROPERTY_TEXTURE_OPENGL_TEXTURE_UV_NUMBER           "SDL.texture.opengl.texture_uv"     /* the GLuint texture associated with the UV plane of an NV12 texture */
+#define SDL_PROPERTY_TEXTURE_OPENGL_TEXTURE_U_NUMBER            "SDL.texture.opengl.texture_u"      /* the GLuint texture associated with the U plane of a YUV texture */
+#define SDL_PROPERTY_TEXTURE_OPENGL_TEXTURE_V_NUMBER            "SDL.texture.opengl.texture_v"      /* the GLuint texture associated with the V plane of a YUV texture */
+#define SDL_PROPERTY_TEXTURE_OPENGL_TEX_W_FLOAT                 "SDL.texture.opengl.tex_w"          /* the texture coordinate width of the texture (0.0 - 1.0) */
+#define SDL_PROPERTY_TEXTURE_OPENGL_TEX_H_FLOAT                 "SDL.texture.opengl.tex_h"          /* the texture coordinate height of the texture (0.0 - 1.0) */
+/*
  * With the opengles2 renderer:
- *
- * - "SDL.texture.opengles2.texture" (number) - the GLuint texture associated
- *   with the texture
- * - "SDL.texture.opengles2.texture_uv" (number) - the GLuint texture
- *   associated with the UV plane of an NV12 texture
- * - "SDL.texture.opengles2.texture_u" (number) - the GLuint texture
- *   associated with the U plane of a YUV texture
- * - "SDL.texture.opengles2.texture_v" (number) - the GLuint texture
+ */
+#define SDL_PROPERTY_TEXTURE_OPENGLES2_TEXTURE_NUMBER           "SDL.texture.opengles2.texture"     /* the GLuint texture associated with the texture */
+#define SDL_PROPERTY_TEXTURE_OPENGLES2_TEXTURE_UV_NUMBER        "SDL.texture.opengles2.texture_uv"  /* the GLuint texture associated with the UV plane of an NV12 texture */
+#define SDL_PROPERTY_TEXTURE_OPENGLES2_TEXTURE_U_NUMBER         "SDL.texture.opengles2.texture_u"   /* the GLuint texture associated with the U plane of a YUV texture */
+#define SDL_PROPERTY_TEXTURE_OPENGLES2_TEXTURE_V_NUMBER         "SDL.texture.opengles2.texture_v"   /* the GLuint texture associated with the V plane of a YUV texture */
+/*
  *   associated with the V plane of a YUV texture
- *
  * \param texture the texture to query
  * \returns a valid property ID on success or 0 on failure; call
  *          SDL_GetError() for more information.
diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h
index d20bd0ee9ad6..c83762f10bf5 100644
--- a/include/SDL3/SDL_video.h
+++ b/include/SDL3/SDL_video.h
@@ -808,63 +808,46 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_CreatePopupWindow(SDL_Window *parent, in
  * Create a window with the specified properties.
  *
  * These are the supported properties:
- *
- * - "always-on-top" (boolean) - true if the window should be always on top
- * - "borderless" (boolean) - true if the window has no window decoration
- * - "focusable" (boolean) - true if the window should accept keyboard input
- *   (defaults true)
- * - "fullscreen" (boolean) - true if the window should start in fullscreen
- *   mode at desktop resolution
- * - "height" (number) - the height of the window
- * - "hidden" (boolean) - true if the window should start hidden
- * - "high-pixel-density" (boolean) - true if the window uses a high pixel
- *   density buffer if possible
- * - "maximized" (boolean) - true if the window should start maximized
- * - "menu" (boolean) - true if the window is a popup menu
- * - "metal" (string) - true if the window will be used with Metal rendering
- * - "minimized" (boolean) - true if the window should start minimized
- * - "mouse-grabbed" (boolean) - true if the window starts with grabbed mouse
- *   focus
- * - "opengl" (boolean) - true if the window will be used with OpenGL
- *   rendering
- * - "parent" (pointer) - an SDL_Window that will be the parent of this
- *   window, required for windows with the "toolip" and "menu" properties
- * - "resizable" (boolean) - true if the window should be resizable
- * - "title" (string) - the title of the window, in UTF-8 encoding
- * - "transparent" (string) - true if the window show transparent in the areas
- *   with alpha of 0
- * - "tooltip" (boolean) - true if the window is a tooltip
- * - "utility" (boolean) - true if the window is a utility window, not showing
- *   in the task bar and window list
- * - "vulkan" (string) - true if the window will be used with Vulkan rendering
- * - "width" (number) - the width of the window
- * - "x" (number) - the x position of the window, or `SDL_WINDOWPOS_CENTERED`,
- *   defaults to `SDL_WINDOWPOS_UNDEFINED`. This is relative to the parent for
- *   windows with the "parent" property set.
- * - "y" (number) - the y position of the window, or `SDL_WINDOWPOS_CENTERED`,
- *   defaults to `SDL_WINDOWPOS_UNDEFINED`. This is relative to the parent for
- *   windows with the "parent" property set.
- *
- * On macOS:
- *
- * - "cocoa.window" (pointer) - the (__unsafe_unretained) NSWindow associated
- *   with the window, if you want to wrap an existing window.
- * - "cocoa.view" (pointer) - the (__unsafe_unretained) NSView associated with
- *   the window, defaults to [window contentView]
- *
- * On Windows:
- *
- * - "win32.hwnd" (pointer) - the HWND associated with the window, if you want
- *   to wrap an existing window.
- * - "win32.pixel_format_hwnd" (pointer) - optional, another window to share
- *   pixel format with, useful for OpenGL windows
- *
- * On X11:
- *
- * - "x11.window" (number) - the X11 Window associated with the window, if you
- *   want to wrap an existing window.
- *
- * The SDL_Window is implicitly shown if the "hidden" property is not set.
+ */
+#define SDL_PROPERTY_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN            "always-on-top"             /* true if the window should be always on top */
+#define SDL_PROPERTY_WINDOW_CREATE_BORDERLESS_BOOLEAN               "borderless"                /* true if the window has no window decoration */
+#define SDL_PROPERTY_WINDOW_CREATE_FOCUSABLE_BOOLEAN                "focusable"                 /* true if the window should accept keyboard input (defaults true) */
+#define SDL_PROPERTY_WINDOW_CREATE_FULLSCREEN_BOOLEAN               "fullscreen"                /* true if the window should start in fullscreen mode at desktop resolution */
+#define SDL_PROPERTY_WINDOW_CREATE_HEIGHT_NUMBER                    "height"                    /* the height of the window */
+#define SDL_PROPERTY_WINDOW_CREATE_HIDDEN_BOOLEAN                   "hidden"                    /* true if the window should start hidden */
+#define SDL_PROPERTY_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN       "high-pixel-density"        /* true if the window uses a high pixel density buffer if possible */
+#define SDL_PROPERTY_WINDOW_CREATE_MAXIMIZED_BOOLEAN                "maximized"                 /* true if the window should start maximized */
+#define SDL_PROPERTY_WINDOW_CREATE_MENU_BOOLEAN                     "menu"                      /* true if the window is a popup menu */
+#define SDL_PROPERTY_WINDOW_CREATE_METAL_BOOLEAN                    "metal"                     /* true if the window will be used with Metal rendering */
+#define SDL_PROPERTY_WINDOW_CREATE_MINIMIZED_BOOLEAN                "minimized"                 /* true if the window should start minimized */
+#define SDL_PROPERTY_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN            "mouse-grabbed"             /* true if the window starts with grabbed mouse focus */
+#define SDL_PROPERTY_WINDOW_CREATE_OPENGL_BOOLEAN                   "opengl"                    /* true if the window will be used with OpenGL rendering */
+#define SDL_PROPERTY_WINDOW_CREATE_PARENT_POINTER                   "parent"                    /* an SDL_Window that will be the parent of this window, required for windows with the "toolip" and "menu" properties */
+#define SDL_PROPERTY_WINDOW_CREATE_RESIZABLE_BOOLEAN                "resizable"                 /* true if the window should be resizable */
+#define SDL_PROPERTY_WINDOW_CREATE_TITLE_STRING                     "title"                     /* the title of the window, in UTF-8 encoding */
+#define SDL_PROPERTY_WINDOW_CREATE_TRANSPARENT_BOOLEAN              "transparent"               /* true if the window show transparent in the areas with alpha of 0 */
+#define SDL_PROPERTY_WINDOW_CREATE_TOOLTIP_BOOLEAN                  "tooltip"                   /* true if the window is a tooltip */
+#define SDL_PROPERTY_WINDOW_CREATE_UTILITY_BOOLEAN                  "utility"                   /* true if the window is a utility window, not showing in the task bar and window list */
+#define SDL_PROPERTY_WINDOW_CREATE_VULKAN_BOOLEAN                   "vulkan"                    /* true if the window will be used with Vulkan rendering */
+#define SDL_PROPERTY_WINDOW_CREATE_WIDTH_NUMBER                     "width"                     /* the width of the window */
+#define SDL_PROPERTY_WINDOW_CREATE_X_NUMBER                         "x"                         /* the x position of the window, or `SDL_WINDOWPOS_CENTERED`, defaults to `SDL_WINDOWPOS_UNDEFINED`. This is relative to the parent for windows with the "parent" property set. */
+#define SDL_PROPERTY_WINDOW_CREATE_Y_NUMBER                         "y"                         /* the y position of the window, or `SDL_WINDOWPOS_CENTERED`, defaults to `SDL_WINDOWPOS_UNDEFINED`. This is relative to the parent for windows with the "parent" property set. */
+/*
+ * These are additional supported properties on macOS:
+ */
+#define SDL_PROPERTY_WINDOW_CREATE_COCOA_WINDOW_POINTER             "cocoa.window"              /* the (__unsafe_unretained) NSWindow associated with the window, if you want to wrap an existing window. */
+#define SDL_PROPERTY_WINDOW_CREATE_COCOA_VIEW_POINTER               "cocoa.view"                /* the (__unsafe_unretained) NSView associated with the window, defaults to [window contentView] */
+/*
+ * These are additional supported properties on Windows:
+ */
+#define SDL_PROPERTY_WINDOW_CREATE_WIN32_HWND_POINTER               "win32.hwnd"                /* the HWND associated with the window, if you want to wrap an existing window. */
+#define SDL_PROPERTY_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER  "win32.pixel_format_hwnd"   /* optional, another window to share pixel format with, useful for OpenGL windows */
+/*
+ * These are additional supported properties with X11:
+ */
+#define SDL_PROPERTY_WINDOW_CREATE_X11_WINDOW_NUMBER                "x11.window"                /* the X11 Window associated with the window, if you want to wrap an existing window. */
+/*
+ * The window is implicitly shown if the "hidden" property is not set.
  *
  * Windows with the "tooltip" and "menu" properties are popup windows and have
  * the behaviors and guidelines outlined in `SDL_CreatePopupWindow()`.
@@ -929,83 +912,66 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window);
  * Get the properties associated with a window.
  *
  * The following read-only properties are provided by SDL:
- *
+ */
+/*
  * On Android:
- *
- * ```
- * "SDL.window.android.window" (pointer) - the ANativeWindow associated with the window
- * "SDL.window.android.surface" (pointer) - the EGLSurface associated with the window
- * ```
- *
+ */
+#define SDL_PROPERTY_WINDOW_ANDROID_WINDOW_POINTER          "SDL.window.android.window"         /* the ANativeWindow associated with the window */
+#define SDL_PROPERTY_WINDOW_ANDROID_SURFACE_POINTER         "SDL.window.android.surface"        /* the EGLSurface associated with the window */
+/*
  * On iOS:
- *
- * ```
- * "SDL.window.uikit.window" (pointer) - the (__unsafe_unretained) UIWindow associated with the window
- * "SDL.window.uikit.metal_view_tag" (number) - the NSInteger tag assocated with metal views on the window
- * ```
- *
+ */
+#define SDL_PROPERTY_WINDOW_UIKIT_WINDOW_POINTER            "SDL.window.uikit.window"           /* the (__unsafe_unretained) UIWindow associated with the window */
+#define SDL_PROPERTY_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER     "SDL.window.uikit.metal_view_tag"   /* the NSInteger tag assocated with metal views on the window */
+/*
  * On KMS/DRM:
- *
- * ```
- * "SDL.window.kmsdrm.dev_index" (number) - the device index associated with the window (e.g. the X in /dev/dri/cardX)
- * "SDL.window.kmsdrm.drm_fd" (number) - the DRM FD associated with the window
- * "SDL.window.kmsdrm.gbm_dev" (pointer) - the GBM device associated with the window
- * ```
- *
+ */
+#define SDL_PROPERTY_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER      "SDL.window.kmsdrm.dev_index"       /* the device index associated with the window (e.g. the X in /dev/dri/cardX) */
+#define SDL_PROPERTY_WINDOW_KMSDRM_DRM_FD_NUMBER            "SDL.window.kmsdrm.drm_fd"          /* the DRM FD associated with the window */
+#define SDL_PROPERTY_WINDOW_KMSDRM_GBM_DEVICE_POINTER       "SDL.window.kmsdrm.gbm_dev"         /* the GBM device associated with the window */
+/*
  * On macOS:
- *
- * ```
- * "SDL.window.cocoa.window" (pointer) - the (__unsafe_unretained) NSWindow associated with the window
- * "SDL.window.cocoa.metal_view_tag" (number) - the NSInteger tag assocated with metal views on the window
- * ```
- *
+ */
+#define SDL_PROPERTY_WINDOW_COCOA_WINDOW_POINTER            "SDL.window.cocoa.window"           /* the (__unsafe_unretained) NSWindow associated with the window */
+#define SDL_PROPERTY_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER     "SDL.window.cocoa.metal_view_tag"   /* the NSInteger tag assocated with metal views on the window */
+/*
  * On Vivante:
- *
- * ```
- * "SDL.window.vivante.display" (pointer) - the EGLNativeDisplayType associated with the window
- * "SDL.window.vivante.window" (pointer) - the EGLNativeWindowType associated with the window
- * "SDL.window.vivante.surface" (pointer) - the EGLS

(Patch may be truncated, please check the link at the top of this post.)