use super::stdinc::*;
use super::error::*;
use super::video::*;
pub type SDL_MessageBoxFlags = Uint32;
pub const SDL_MESSAGEBOX_ERROR: SDL_MessageBoxFlags = (0x00000010 as SDL_MessageBoxFlags);
pub const SDL_MESSAGEBOX_WARNING: SDL_MessageBoxFlags = (0x00000020 as SDL_MessageBoxFlags);
pub const SDL_MESSAGEBOX_INFORMATION: SDL_MessageBoxFlags = (0x00000040 as SDL_MessageBoxFlags);
pub const SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT: SDL_MessageBoxFlags =
(0x00000080 as SDL_MessageBoxFlags);
pub const SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT: SDL_MessageBoxFlags =
(0x00000100 as SDL_MessageBoxFlags);
pub type SDL_MessageBoxButtonFlags = Uint32;
pub const SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT: SDL_MessageBoxButtonFlags =
(0x00000001 as SDL_MessageBoxButtonFlags);
pub const SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT: SDL_MessageBoxButtonFlags =
(0x00000002 as SDL_MessageBoxButtonFlags);
#[repr(C)]
#[derive(Clone, Copy)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
pub struct SDL_MessageBoxButtonData {
pub flags: SDL_MessageBoxButtonFlags,
pub buttonID: ::core::ffi::c_int,
pub text: *const ::core::ffi::c_char,
}
impl ::core::default::Default for SDL_MessageBoxButtonData {
#[inline(always)]
fn default() -> Self {
unsafe { ::core::mem::MaybeUninit::<Self>::zeroed().assume_init() }
}
}
#[repr(C)]
#[derive(Clone, Copy, Default, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
pub struct SDL_MessageBoxColor {
pub r: Uint8,
pub g: Uint8,
pub b: Uint8,
}
#[repr(transparent)]
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct SDL_MessageBoxColorType(pub ::core::ffi::c_int);
impl From<SDL_MessageBoxColorType> for ::core::ffi::c_int {
#[inline(always)]
fn from(value: SDL_MessageBoxColorType) -> Self {
value.0
}
}
#[cfg(feature = "debug-impls")]
impl ::core::fmt::Debug for SDL_MessageBoxColorType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
#[allow(unreachable_patterns)]
f.write_str(match *self {
Self::BACKGROUND => "SDL_MESSAGEBOX_COLOR_BACKGROUND",
Self::TEXT => "SDL_MESSAGEBOX_COLOR_TEXT",
Self::BUTTON_BORDER => "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER",
Self::BUTTON_BACKGROUND => "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND",
Self::BUTTON_SELECTED => "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED",
Self::COUNT => "SDL_MESSAGEBOX_COLOR_COUNT",
_ => return write!(f, "SDL_MessageBoxColorType({})", self.0),
})
}
}
impl SDL_MessageBoxColorType {
pub const BACKGROUND: Self = Self(0);
pub const TEXT: Self = Self(1);
pub const BUTTON_BORDER: Self = Self(2);
pub const BUTTON_BACKGROUND: Self = Self(3);
pub const BUTTON_SELECTED: Self = Self(4);
pub const COUNT: Self = Self(5);
}
pub const SDL_MESSAGEBOX_COLOR_BACKGROUND: SDL_MessageBoxColorType =
SDL_MessageBoxColorType::BACKGROUND;
pub const SDL_MESSAGEBOX_COLOR_TEXT: SDL_MessageBoxColorType = SDL_MessageBoxColorType::TEXT;
pub const SDL_MESSAGEBOX_COLOR_BUTTON_BORDER: SDL_MessageBoxColorType =
SDL_MessageBoxColorType::BUTTON_BORDER;
pub const SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND: SDL_MessageBoxColorType =
SDL_MessageBoxColorType::BUTTON_BACKGROUND;
pub const SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED: SDL_MessageBoxColorType =
SDL_MessageBoxColorType::BUTTON_SELECTED;
pub const SDL_MESSAGEBOX_COLOR_COUNT: SDL_MessageBoxColorType = SDL_MessageBoxColorType::COUNT;
#[repr(C)]
#[derive(Clone, Copy, Default, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
pub struct SDL_MessageBoxColorScheme {
pub colors: [SDL_MessageBoxColor; SDL_MESSAGEBOX_COLOR_COUNT.0 as ::core::primitive::usize],
}
#[repr(C)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
pub struct SDL_MessageBoxData {
pub flags: SDL_MessageBoxFlags,
pub window: *mut SDL_Window,
pub title: *const ::core::ffi::c_char,
pub message: *const ::core::ffi::c_char,
pub numbuttons: ::core::ffi::c_int,
pub buttons: *const SDL_MessageBoxButtonData,
pub colorScheme: *const SDL_MessageBoxColorScheme,
}
impl ::core::default::Default for SDL_MessageBoxData {
#[inline(always)]
fn default() -> Self {
unsafe { ::core::mem::MaybeUninit::<Self>::zeroed().assume_init() }
}
}
extern "C" {
pub fn SDL_ShowMessageBox(
messageboxdata: *const SDL_MessageBoxData,
buttonid: *mut ::core::ffi::c_int,
) -> ::core::primitive::bool;
}
extern "C" {
pub fn SDL_ShowSimpleMessageBox(
flags: SDL_MessageBoxFlags,
title: *const ::core::ffi::c_char,
message: *const ::core::ffi::c_char,
window: *mut SDL_Window,
) -> ::core::primitive::bool;
}
#[cfg(doc)]
use crate::everything::*;