From 48621907a263f3565b843506fd5c8b7d3b771384 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Tue, 2 Oct 2018 14:17:07 -0400 Subject: [PATCH] SDL_system.h --- src/SDL2.cs | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/src/SDL2.cs b/src/SDL2.cs index 147236b..6a901bd 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -6337,6 +6337,104 @@ namespace SDL2 #endregion + #region SDL_system.h + + /* Windows */ + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate IntPtr SDL_WindowsMessageHook( + IntPtr userdata, + IntPtr hWnd, + uint message, + ulong wParam, + long lParam + ); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void SDL_SetWindowsMessageHook( + SDL_WindowsMessageHook callback, + IntPtr userdata + ); + + /* iOS */ + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void SDL_iPhoneAnimationCallback(IntPtr p); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_iPhoneSetAnimationCallback( + IntPtr window, /* SDL_Window* */ + int interval, + SDL_iPhoneAnimationCallback callback, + IntPtr callbackParam + ); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void SDL_iPhoneSetEventPump(SDL_bool enabled); + + /* Android */ + + public const int SDL_ANDROID_EXTERNAL_STORAGE_READ = 0x01; + public const int SDL_ANDROID_EXTERNAL_STORAGE_WRITE = 0x02; + + /* IntPtr refers to a JNIEnv* */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr SDL_AndroidGetJNIEnv(); + + /* IntPtr refers to a jobject */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr SDL_AndroidGetActivity(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_IsAndroidTV(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_IsChromebook(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_IsDeXMode(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void SDL_AndroidBackButton(); + + [DllImport(nativeLibName, EntryPoint = "SDL_AndroidGetInternalStoragePath", CallingConvention = CallingConvention.Cdecl)] + private static extern IntPtr INTERNAL_SDL_AndroidGetInternalStoragePath(); + + public static string SDL_AndroidGetInternalStoragePath() + { + return UTF8_ToManaged( + INTERNAL_SDL_AndroidGetInternalStoragePath() + ); + } + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_AndroidGetExternalStorageState(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + private static extern IntPtr INTERNAL_SDL_AndroidGetExternalStoragePath(); + + public static string SDL_AndroidGetExternalStoragePath() + { + return UTF8_ToManaged( + INTERNAL_SDL_AndroidGetExternalStoragePath() + ); + } + + /* WinRT */ + + public enum SDL_WinRT_DeviceFamily + { + SDL_WINRT_DEVICEFAMILY_UNKNOWN, + SDL_WINRT_DEVICEFAMILY_DESKTOP, + SDL_WINRT_DEVICEFAMILY_MOBILE, + SDL_WINRT_DEVICEFAMILY_XBOX + } + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_WinRT_DeviceFamily SDL_WinRTGetDeviceFamily(); + + #endregion + #region SDL_syswm.h public enum SDL_SYSWM_TYPE