-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialog.h
47 lines (33 loc) · 1.09 KB
/
dialog.h
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
/**
* \file dialog.h
* Management of a dialog box on top of the main screen.
* A dialog box will be displayed on screen, disabling all actions,
* until user has clicked a button.
* Only one dialog box can be active at the same time.
*/
#ifndef __DIALOG_H_
#define __DIALOG_H_
#include <SDL/SDL.h>
/** Type of action for a button. */
typedef enum {
NONE=0, CANCEL, OK
} action_t;
/**
* Display the dialog box.
* \param screen main program screen
* \param imageFilename filename of the image including the buttons.
* the buttons must be at the good place in the image.
* \param nb the number of button in this dialog box
*/
void dialog_display(SDL_Surface *screen, char *imageFilename, int nb);
/**
* When a mouse clic is done at position (x,y), call this function to
* know if and which button is clicked.
* If a button was clicked, the function will restore screen before
* returning.
* \param screen main program screen
* \param x x coordinate of mouse pointer
* \param y y coordinate of mouse pointer
*/
action_t is_clicked(SDL_Surface *screen, int x, int y);
#endif