My Project
SDL_messagebox.h
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
22 #ifndef SDL_messagebox_h_
23 #define SDL_messagebox_h_
24 
25 #include "SDL_stdinc.h"
26 #include "SDL_video.h" /* For SDL_Window */
27 
28 #include "begin_code.h"
29 /* Set up for C function definitions, even when using C++ */
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
37 typedef enum
38 {
39  SDL_MESSAGEBOX_ERROR = 0x00000010,
40  SDL_MESSAGEBOX_WARNING = 0x00000020,
41  SDL_MESSAGEBOX_INFORMATION = 0x00000040
42 } SDL_MessageBoxFlags;
43 
47 typedef enum
48 {
49  SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001,
50  SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002
51 } SDL_MessageBoxButtonFlags;
52 
56 typedef struct
57 {
58  Uint32 flags;
59  int buttonid;
60  const char * text;
62 
66 typedef struct
67 {
68  Uint8 r, g, b;
70 
71 typedef enum
72 {
73  SDL_MESSAGEBOX_COLOR_BACKGROUND,
74  SDL_MESSAGEBOX_COLOR_TEXT,
75  SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
76  SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
77  SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
78  SDL_MESSAGEBOX_COLOR_MAX
79 } SDL_MessageBoxColorType;
80 
84 typedef struct
85 {
86  SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX];
88 
92 typedef struct
93 {
94  Uint32 flags;
96  const char *title;
97  const char *message;
99  int numbuttons;
100  const SDL_MessageBoxButtonData *buttons;
101 
104 
119 extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
120 
133 extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window);
134 
135 
136 /* Ends C function definitions when using C++ */
137 #ifdef __cplusplus
138 }
139 #endif
140 #include "close_code.h"
141 
142 #endif /* SDL_messagebox_h_ */
143 
144 /* vi: set ts=4 sw=4 expandtab: */
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:90
const char * message
Definition: SDL_messagebox.h:97
MessageBox structure containing title, text, window, etc.
Definition: SDL_messagebox.h:92
Individual button data.
Definition: SDL_messagebox.h:56
Uint32 flags
Definition: SDL_messagebox.h:58
Uint32 flags
Definition: SDL_messagebox.h:94
const SDL_MessageBoxColorScheme * colorScheme
Definition: SDL_messagebox.h:102
A set of colors to use for message box dialogs.
Definition: SDL_messagebox.h:84
SDL_Window * window
Definition: SDL_messagebox.h:95
const char * text
Definition: SDL_messagebox.h:60
const char * title
Definition: SDL_messagebox.h:96
int buttonid
Definition: SDL_messagebox.h:59
RGB value used in a message box color scheme.
Definition: SDL_messagebox.h:66