1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
use crate::{c_char, c_int, stdinc::*, video::*};
#[allow(unused)]
use crate::*;
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
pub struct SDL_MessageBoxFlags(pub u32);
impl_bit_ops_for_tuple_newtype!(SDL_MessageBoxFlags);
pub const SDL_MESSAGEBOX_ERROR: SDL_MessageBoxFlags =
SDL_MessageBoxFlags(0x00000010);
pub const SDL_MESSAGEBOX_WARNING: SDL_MessageBoxFlags =
SDL_MessageBoxFlags(0x00000020);
pub const SDL_MESSAGEBOX_INFORMATION: SDL_MessageBoxFlags =
SDL_MessageBoxFlags(0x00000040);
pub const SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT: SDL_MessageBoxFlags =
SDL_MessageBoxFlags(0x00000080);
pub const SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT: SDL_MessageBoxFlags =
SDL_MessageBoxFlags(0x00000100);
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
pub struct SDL_MessageBoxButtonFlags(pub u32);
impl_bit_ops_for_tuple_newtype!(SDL_MessageBoxButtonFlags);
pub const SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT: SDL_MessageBoxButtonFlags =
SDL_MessageBoxButtonFlags(0x00000001);
pub const SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT: SDL_MessageBoxButtonFlags =
SDL_MessageBoxButtonFlags(0x00000002);
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(C)]
#[allow(missing_docs)]
pub struct SDL_MessageBoxButtonData {
pub flags: SDL_MessageBoxButtonFlags,
pub buttonid: c_int,
pub text: *const c_char,
}
impl Default for SDL_MessageBoxButtonData {
#[inline]
#[must_use]
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(C)]
#[allow(missing_docs)]
pub struct SDL_MessageBoxColor {
pub r: Uint8,
pub g: Uint8,
pub b: Uint8,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
pub struct SDL_MessageBoxColorType(pub u32);
#[allow(missing_docs)]
pub const SDL_MESSAGEBOX_COLOR_BACKGROUND: SDL_MessageBoxColorType =
SDL_MessageBoxColorType(0);
#[allow(missing_docs)]
pub const SDL_MESSAGEBOX_COLOR_TEXT: SDL_MessageBoxColorType =
SDL_MessageBoxColorType(1);
#[allow(missing_docs)]
pub const SDL_MESSAGEBOX_COLOR_BUTTON_BORDER: SDL_MessageBoxColorType =
SDL_MessageBoxColorType(2);
#[allow(missing_docs)]
pub const SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND: SDL_MessageBoxColorType =
SDL_MessageBoxColorType(3);
#[allow(missing_docs)]
pub const SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED: SDL_MessageBoxColorType =
SDL_MessageBoxColorType(4);
#[allow(missing_docs)]
pub const SDL_MESSAGEBOX_COLOR_MAX: usize = 5;
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(C)]
#[allow(missing_docs)]
pub struct SDL_MessageBoxColorScheme {
pub colors: [SDL_MessageBoxColor; SDL_MESSAGEBOX_COLOR_MAX],
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(C)]
#[allow(missing_docs)]
pub struct SDL_MessageBoxData {
pub flags: SDL_MessageBoxFlags,
pub window: *mut SDL_Window,
pub title: *const c_char,
pub message: *const c_char,
pub numbuttons: c_int,
pub buttons: *const SDL_MessageBoxButtonData,
pub colorScheme: *const SDL_MessageBoxColorScheme,
}
impl Default for SDL_MessageBoxData {
#[inline]
#[must_use]
fn default() -> Self {
unsafe { core::mem::zeroed() }
}
}
extern "C" {
pub fn SDL_ShowMessageBox(
messageboxdata: *const SDL_MessageBoxData, buttonid: *mut c_int,
) -> c_int;
pub fn SDL_ShowSimpleMessageBox(
flags: SDL_MessageBoxFlags, title: *const c_char, message: *const c_char,
window: *mut SDL_Window,
) -> c_int;
}