From 30f41c02aec763d32e62351452da9ef582bc3472 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 6 Mar 2026 13:30:59 -0800 Subject: Move contrib libraries to contrib repo --- contrib/SDL-3.2.8/src/misc/SDL_sysurl.h | 31 ---------- contrib/SDL-3.2.8/src/misc/SDL_url.c | 31 ---------- contrib/SDL-3.2.8/src/misc/android/SDL_sysurl.c | 29 --------- contrib/SDL-3.2.8/src/misc/dummy/SDL_sysurl.c | 28 --------- contrib/SDL-3.2.8/src/misc/emscripten/SDL_sysurl.c | 33 ---------- contrib/SDL-3.2.8/src/misc/haiku/SDL_sysurl.cc | 34 ----------- contrib/SDL-3.2.8/src/misc/ios/SDL_sysurl.m | 42 ------------- contrib/SDL-3.2.8/src/misc/macos/SDL_sysurl.m | 42 ------------- contrib/SDL-3.2.8/src/misc/riscos/SDL_sysurl.c | 49 --------------- contrib/SDL-3.2.8/src/misc/unix/SDL_sysurl.c | 71 ---------------------- contrib/SDL-3.2.8/src/misc/vita/SDL_sysurl.c | 41 ------------- contrib/SDL-3.2.8/src/misc/windows/SDL_sysurl.c | 62 ------------------- 12 files changed, 493 deletions(-) delete mode 100644 contrib/SDL-3.2.8/src/misc/SDL_sysurl.h delete mode 100644 contrib/SDL-3.2.8/src/misc/SDL_url.c delete mode 100644 contrib/SDL-3.2.8/src/misc/android/SDL_sysurl.c delete mode 100644 contrib/SDL-3.2.8/src/misc/dummy/SDL_sysurl.c delete mode 100644 contrib/SDL-3.2.8/src/misc/emscripten/SDL_sysurl.c delete mode 100644 contrib/SDL-3.2.8/src/misc/haiku/SDL_sysurl.cc delete mode 100644 contrib/SDL-3.2.8/src/misc/ios/SDL_sysurl.m delete mode 100644 contrib/SDL-3.2.8/src/misc/macos/SDL_sysurl.m delete mode 100644 contrib/SDL-3.2.8/src/misc/riscos/SDL_sysurl.c delete mode 100644 contrib/SDL-3.2.8/src/misc/unix/SDL_sysurl.c delete mode 100644 contrib/SDL-3.2.8/src/misc/vita/SDL_sysurl.c delete mode 100644 contrib/SDL-3.2.8/src/misc/windows/SDL_sysurl.c (limited to 'contrib/SDL-3.2.8/src/misc') diff --git a/contrib/SDL-3.2.8/src/misc/SDL_sysurl.h b/contrib/SDL-3.2.8/src/misc/SDL_sysurl.h deleted file mode 100644 index b5ee700..0000000 --- a/contrib/SDL-3.2.8/src/misc/SDL_sysurl.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern bool SDL_SYS_OpenURL(const char *url); - -#ifdef __cplusplus -} -#endif diff --git a/contrib/SDL-3.2.8/src/misc/SDL_url.c b/contrib/SDL-3.2.8/src/misc/SDL_url.c deleted file mode 100644 index b3163ab..0000000 --- a/contrib/SDL-3.2.8/src/misc/SDL_url.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "SDL_sysurl.h" - -bool SDL_OpenURL(const char *url) -{ - if (!url) { - return SDL_InvalidParamError("url"); - } - return SDL_SYS_OpenURL(url); -} diff --git a/contrib/SDL-3.2.8/src/misc/android/SDL_sysurl.c b/contrib/SDL-3.2.8/src/misc/android/SDL_sysurl.c deleted file mode 100644 index d79f1e0..0000000 --- a/contrib/SDL-3.2.8/src/misc/android/SDL_sysurl.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "../SDL_sysurl.h" -#include "../../core/android/SDL_android.h" - -bool SDL_SYS_OpenURL(const char *url) -{ - return Android_JNI_OpenURL(url); -} diff --git a/contrib/SDL-3.2.8/src/misc/dummy/SDL_sysurl.c b/contrib/SDL-3.2.8/src/misc/dummy/SDL_sysurl.c deleted file mode 100644 index 64dcfa9..0000000 --- a/contrib/SDL-3.2.8/src/misc/dummy/SDL_sysurl.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "../SDL_sysurl.h" - -bool SDL_SYS_OpenURL(const char *url) -{ - return SDL_Unsupported(); -} diff --git a/contrib/SDL-3.2.8/src/misc/emscripten/SDL_sysurl.c b/contrib/SDL-3.2.8/src/misc/emscripten/SDL_sysurl.c deleted file mode 100644 index 881de01..0000000 --- a/contrib/SDL-3.2.8/src/misc/emscripten/SDL_sysurl.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "../SDL_sysurl.h" - -#include - -EM_JS_DEPS(sdlsysurl, "$UTF8ToString"); - -bool SDL_SYS_OpenURL(const char *url) -{ - EM_ASM(window.open(UTF8ToString($0), "_blank"), url); - return true; -} diff --git a/contrib/SDL-3.2.8/src/misc/haiku/SDL_sysurl.cc b/contrib/SDL-3.2.8/src/misc/haiku/SDL_sysurl.cc deleted file mode 100644 index 1ce5955..0000000 --- a/contrib/SDL-3.2.8/src/misc/haiku/SDL_sysurl.cc +++ /dev/null @@ -1,34 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "../SDL_sysurl.h" -#include - -bool SDL_SYS_OpenURL(const char *url) -{ - BUrl burl(url); - const status_t rc = burl.OpenWithPreferredApplication(false); - if (rc != B_NO_ERROR) { - return SDL_SetError("URL open failed (err=%d)", (int)rc); - } - return true; -} diff --git a/contrib/SDL-3.2.8/src/misc/ios/SDL_sysurl.m b/contrib/SDL-3.2.8/src/misc/ios/SDL_sysurl.m deleted file mode 100644 index 1221eda..0000000 --- a/contrib/SDL-3.2.8/src/misc/ios/SDL_sysurl.m +++ /dev/null @@ -1,42 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#if defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS) - -#include "../SDL_sysurl.h" - -#import - -bool SDL_SYS_OpenURL(const char *url) -{ - @autoreleasepool { - NSString *nsstr = [NSString stringWithUTF8String:url]; - NSURL *nsurl = [NSURL URLWithString:nsstr]; - if (![[UIApplication sharedApplication] canOpenURL:nsurl]) { - return SDL_SetError("No handler registered for this type of URL"); - } - [[UIApplication sharedApplication] openURL:nsurl options:@{} completionHandler:^(BOOL success) {}]; - return true; - } -} - -#endif // SDL_PLATFORM_IOS || SDL_PLATFORM_TVOS diff --git a/contrib/SDL-3.2.8/src/misc/macos/SDL_sysurl.m b/contrib/SDL-3.2.8/src/misc/macos/SDL_sysurl.m deleted file mode 100644 index 64d9c92..0000000 --- a/contrib/SDL-3.2.8/src/misc/macos/SDL_sysurl.m +++ /dev/null @@ -1,42 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#if defined(SDL_PLATFORM_MACOS) - -#include "../SDL_sysurl.h" - -#import - -bool SDL_SYS_OpenURL(const char *url) -{ - @autoreleasepool { - CFURLRef cfurl = CFURLCreateWithBytes(NULL, (const UInt8 *)url, SDL_strlen(url), kCFStringEncodingUTF8, NULL); - OSStatus status = LSOpenCFURLRef(cfurl, NULL); - CFRelease(cfurl); - if (status != noErr) { - return SDL_SetError("LSOpenCFURLRef() failed: %d", status); - } - return true; - } -} - -#endif // SDL_PLATFORM_MACOS diff --git a/contrib/SDL-3.2.8/src/misc/riscos/SDL_sysurl.c b/contrib/SDL-3.2.8/src/misc/riscos/SDL_sysurl.c deleted file mode 100644 index f5a92b2..0000000 --- a/contrib/SDL-3.2.8/src/misc/riscos/SDL_sysurl.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "../SDL_sysurl.h" - -#include -#include - -#ifndef URI_Dispatch -#define URI_Dispatch 0x4e381 -#endif - -bool SDL_SYS_OpenURL(const char *url) -{ - _kernel_swi_regs regs; - _kernel_oserror *error; - - regs.r[0] = 0; - regs.r[1] = (int)url; - regs.r[2] = 0; - error = _kernel_swi(URI_Dispatch, ®s, ®s); - if (error) { - return SDL_SetError("Couldn't open given URL: %s", error->errmess); - } - - if (regs.r[0] & 1) { - return SDL_SetError("Couldn't open given URL."); - } - return true; -} diff --git a/contrib/SDL-3.2.8/src/misc/unix/SDL_sysurl.c b/contrib/SDL-3.2.8/src/misc/unix/SDL_sysurl.c deleted file mode 100644 index e72894b..0000000 --- a/contrib/SDL-3.2.8/src/misc/unix/SDL_sysurl.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "../SDL_sysurl.h" - -#include -#include -#include -#include -#include -#include -#ifdef USE_POSIX_SPAWN -#include -extern char **environ; -#endif - -bool SDL_SYS_OpenURL(const char *url) -{ - const char *args[] = { "xdg-open", url, NULL }; - SDL_Environment *env = NULL; - SDL_Process *process = NULL; - bool result = false; - - env = SDL_CreateEnvironment(true); - if (!env) { - goto done; - } - - // Clear LD_PRELOAD so Chrome opens correctly when this application is launched by Steam - SDL_UnsetEnvironmentVariable(env, "LD_PRELOAD"); - - SDL_PropertiesID props = SDL_CreateProperties(); - if (!props) { - goto done; - } - SDL_SetPointerProperty(props, SDL_PROP_PROCESS_CREATE_ARGS_POINTER, args); - SDL_SetPointerProperty(props, SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER, env); - SDL_SetBooleanProperty(props, SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN, true); - process = SDL_CreateProcessWithProperties(props); - SDL_DestroyProperties(props); - if (!process) { - goto done; - } - - result = true; - -done: - SDL_DestroyEnvironment(env); - SDL_DestroyProcess(process); - - return result; -} diff --git a/contrib/SDL-3.2.8/src/misc/vita/SDL_sysurl.c b/contrib/SDL-3.2.8/src/misc/vita/SDL_sysurl.c deleted file mode 100644 index fb901c3..0000000 --- a/contrib/SDL-3.2.8/src/misc/vita/SDL_sysurl.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "../SDL_sysurl.h" - -#include -#include - -bool SDL_SYS_OpenURL(const char *url) -{ - SceAppUtilInitParam init_param; - SceAppUtilBootParam boot_param; - SceAppUtilWebBrowserParam browser_param; - SDL_zero(init_param); - SDL_zero(boot_param); - sceAppUtilInit(&init_param, &boot_param); - SDL_zero(browser_param); - browser_param.str = url; - browser_param.strlen = SDL_strlen(url); - sceAppUtilLaunchWebBrowser(&browser_param); - return true; -} diff --git a/contrib/SDL-3.2.8/src/misc/windows/SDL_sysurl.c b/contrib/SDL-3.2.8/src/misc/windows/SDL_sysurl.c deleted file mode 100644 index 8e7bf0b..0000000 --- a/contrib/SDL-3.2.8/src/misc/windows/SDL_sysurl.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "../SDL_sysurl.h" -#include "../../core/windows/SDL_windows.h" - -#include - -#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) -bool SDL_SYS_OpenURL(const char *url) -{ - // Not supported - return SDL_Unsupported(); -} -#else -// https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx -bool SDL_SYS_OpenURL(const char *url) -{ - WCHAR *wurl; - HINSTANCE rc; - - // MSDN says for safety's sake, make sure COM is initialized. - const HRESULT hr = WIN_CoInitialize(); - if (FAILED(hr)) { - return WIN_SetErrorFromHRESULT("CoInitialize failed", hr); - } - - wurl = WIN_UTF8ToStringW(url); - if (!wurl) { - WIN_CoUninitialize(); - return false; - } - - // Success returns value greater than 32. Less is an error. - rc = ShellExecuteW(NULL, L"open", wurl, NULL, NULL, SW_SHOWNORMAL); - SDL_free(wurl); - WIN_CoUninitialize(); - if (rc <= ((HINSTANCE)32)) { - return WIN_SetError("Couldn't open given URL."); - } - return true; -} -#endif -- cgit v1.2.3