slouken@0
|
1 |
/*
|
slouken@5535
|
2 |
Simple DirectMedia Layer
|
slouken@6885
|
3 |
Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
|
slouken@0
|
4 |
|
slouken@5535
|
5 |
This software is provided 'as-is', without any express or implied
|
slouken@5535
|
6 |
warranty. In no event will the authors be held liable for any damages
|
slouken@5535
|
7 |
arising from the use of this software.
|
slouken@0
|
8 |
|
slouken@5535
|
9 |
Permission is granted to anyone to use this software for any purpose,
|
slouken@5535
|
10 |
including commercial applications, and to alter it and redistribute it
|
slouken@5535
|
11 |
freely, subject to the following restrictions:
|
slouken@0
|
12 |
|
slouken@5535
|
13 |
1. The origin of this software must not be misrepresented; you must not
|
slouken@5535
|
14 |
claim that you wrote the original software. If you use this software
|
slouken@5535
|
15 |
in a product, an acknowledgment in the product documentation would be
|
slouken@5535
|
16 |
appreciated but is not required.
|
slouken@5535
|
17 |
2. Altered source versions must be plainly marked as such, and must not be
|
slouken@5535
|
18 |
misrepresented as being the original software.
|
slouken@5535
|
19 |
3. This notice may not be removed or altered from any source distribution.
|
slouken@0
|
20 |
*/
|
slouken@0
|
21 |
|
slouken@1895
|
22 |
/**
|
slouken@3407
|
23 |
* \file SDL_quit.h
|
slouken@3407
|
24 |
*
|
slouken@3407
|
25 |
* Include file for SDL quit event handling.
|
slouken@1895
|
26 |
*/
|
slouken@0
|
27 |
|
slouken@0
|
28 |
#ifndef _SDL_quit_h
|
slouken@0
|
29 |
#define _SDL_quit_h
|
slouken@0
|
30 |
|
slouken@1356
|
31 |
#include "SDL_stdinc.h"
|
slouken@1358
|
32 |
#include "SDL_error.h"
|
slouken@1356
|
33 |
|
slouken@3407
|
34 |
/**
|
slouken@3407
|
35 |
* \file SDL_quit.h
|
slouken@3407
|
36 |
*
|
slouken@3407
|
37 |
* An ::SDL_QUIT event is generated when the user tries to close the application
|
slouken@3407
|
38 |
* window. If it is ignored or filtered out, the window will remain open.
|
slouken@3407
|
39 |
* If it is not ignored or filtered, it is queued normally and the window
|
slouken@3407
|
40 |
* is allowed to close. When the window is closed, screen updates will
|
slouken@3407
|
41 |
* complete, but have no effect.
|
slouken@3407
|
42 |
*
|
slouken@3407
|
43 |
* SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
|
slouken@3407
|
44 |
* and SIGTERM (system termination request), if handlers do not already
|
slouken@3407
|
45 |
* exist, that generate ::SDL_QUIT events as well. There is no way
|
slouken@3407
|
46 |
* to determine the cause of an ::SDL_QUIT event, but setting a signal
|
slouken@3407
|
47 |
* handler in your application will override the default generation of
|
slouken@3407
|
48 |
* quit events for that signal.
|
slouken@3407
|
49 |
*
|
slouken@3407
|
50 |
* \sa SDL_Quit()
|
slouken@3407
|
51 |
*/
|
slouken@0
|
52 |
|
slouken@0
|
53 |
/* There are no functions directly affecting the quit event */
|
slouken@3407
|
54 |
|
slouken@0
|
55 |
#define SDL_QuitRequested() \
|
slouken@5553
|
56 |
(SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
|
slouken@0
|
57 |
|
slouken@0
|
58 |
#endif /* _SDL_quit_h */
|