const std = @import("std");
pub const c = @import("c.zig").c;

pub const DisplayID = u32;

pub const Window = opaque {
    pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool {
        return c.SDL_SetiOSAnimationCallback(window, interval, callback, callbackParam);
    }
};

pub const MSG = opaque {};

pub const WindowsMessageHook = c.SDL_WindowsMessageHook;

pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void {
    return c.SDL_SetWindowsMessageHook(callback, userdata);
}

pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int {
    return c.SDL_GetDirect3D9AdapterIndex(displayID);
}

pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool {
    return c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex));
}

pub const X11EventHook = c.SDL_X11EventHook;

pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void {
    return c.SDL_SetX11EventHook(callback, userdata);
}

pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool {
    return c.SDL_SetLinuxThreadPriority(threadID, priority);
}

pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool {
    return c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy);
}

pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback;

pub inline fn setiOSEventPump(enabled: bool) void {
    return c.SDL_SetiOSEventPump(enabled);
}

pub inline fn getAndroidJNIEnv() ?*anyopaque {
    return c.SDL_GetAndroidJNIEnv();
}

pub inline fn getAndroidActivity() ?*anyopaque {
    return c.SDL_GetAndroidActivity();
}

pub inline fn getAndroidSDKVersion() c_int {
    return c.SDL_GetAndroidSDKVersion();
}

pub inline fn isChromebook() bool {
    return c.SDL_IsChromebook();
}

pub inline fn isDeXMode() bool {
    return c.SDL_IsDeXMode();
}

pub inline fn sendAndroidBackButton() void {
    return c.SDL_SendAndroidBackButton();
}

pub inline fn getAndroidInternalStoragePath() [*c]const u8 {
    return c.SDL_GetAndroidInternalStoragePath();
}

pub inline fn getAndroidExternalStorageState() u32 {
    return c.SDL_GetAndroidExternalStorageState();
}

pub inline fn getAndroidExternalStoragePath() [*c]const u8 {
    return c.SDL_GetAndroidExternalStoragePath();
}

pub inline fn getAndroidCachePath() [*c]const u8 {
    return c.SDL_GetAndroidCachePath();
}

pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback;

pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool {
    return c.SDL_RequestAndroidPermission(permission, cb, userdata);
}

pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool {
    return c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset);
}

pub inline fn sendAndroidMessage(command: u32, param: c_int) bool {
    return c.SDL_SendAndroidMessage(command, param);
}

pub inline fn isTablet() bool {
    return c.SDL_IsTablet();
}

pub inline fn isTV() bool {
    return c.SDL_IsTV();
}

pub const Sandbox = enum(c_int) {
    sandboxUnknownContainer,
    sandboxFlatpak,
    sandboxSnap,
    sandboxMacos,
};

pub inline fn getSandbox() Sandbox {
    return c.SDL_GetSandbox();
}

pub inline fn onApplicationWillTerminate() void {
    return c.SDL_OnApplicationWillTerminate();
}

pub inline fn onApplicationDidReceiveMemoryWarning() void {
    return c.SDL_OnApplicationDidReceiveMemoryWarning();
}

pub inline fn onApplicationWillEnterBackground() void {
    return c.SDL_OnApplicationWillEnterBackground();
}

pub inline fn onApplicationDidEnterBackground() void {
    return c.SDL_OnApplicationDidEnterBackground();
}

pub inline fn onApplicationWillEnterForeground() void {
    return c.SDL_OnApplicationWillEnterForeground();
}

pub inline fn onApplicationDidEnterForeground() void {
    return c.SDL_OnApplicationDidEnterForeground();
}

pub inline fn onApplicationDidChangeStatusBarOrientation() void {
    return c.SDL_OnApplicationDidChangeStatusBarOrientation();
}

pub const XTaskQueueHandle = *anyopaque;

pub const XUserHandle = *anyopaque;

pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool {
    return c.SDL_GetGDKTaskQueue(outTaskQueue);
}

pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool {
    return c.SDL_GetGDKDefaultUser(outUserHandle);
}
