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

pub inline fn setClipboardText(text: [*c]const u8) bool {
    return @bitCast(c.SDL_SetClipboardText(text));
}

pub inline fn getClipboardText() [*c]u8 {
    return c.SDL_GetClipboardText();
}

pub inline fn hasClipboardText() bool {
    return @bitCast(c.SDL_HasClipboardText());
}

pub inline fn setPrimarySelectionText(text: [*c]const u8) bool {
    return @bitCast(c.SDL_SetPrimarySelectionText(text));
}

pub inline fn getPrimarySelectionText() [*c]u8 {
    return c.SDL_GetPrimarySelectionText();
}

pub inline fn hasPrimarySelectionText() bool {
    return @bitCast(c.SDL_HasPrimarySelectionText());
}

pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback;

pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback;

pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c][*c]const u8, num_mime_types: usize) bool {
    return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types));
}

pub inline fn clearClipboardData() bool {
    return @bitCast(c.SDL_ClearClipboardData());
}

pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque {
    return c.SDL_GetClipboardData(mime_type, @ptrCast(size));
}

pub inline fn hasClipboardData(mime_type: [*c]const u8) bool {
    return @bitCast(c.SDL_HasClipboardData(mime_type));
}

pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 {
    return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types));
}
