1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef CINE_MAINLOOP_H
24 #define CINE_MAINLOOP_H
25 
26 namespace Cine {
27 
28 enum CallSource {
29 	EXECUTE_PLAYER_INPUT, ///< Called from executePlayerInput function.
30 	MAIN_LOOP_WAIT_FOR_PLAYER_CLICK, ///< Called from mainLoop function's waiting for player click section.
31 	MAKE_MENU_CHOICE, ///< Called from makeMenuChoice function.
32 	MAKE_SYSTEM_MENU, ///< Called from makeSystemMenu function.
33 	MAKE_TEXT_ENTRY_MENU, ///< Called from makeTextEntryMenu function.
34 	PROCESS_INVENTORY, ///< Called from processInventory function.
35 	WAIT_PLAYER_INPUT ///< Called from waitPlayerInput function.
36 };
37 
38 enum EventTarget {
39 	UNTIL_MOUSE_BUTTON_UP_DOWN_UP, ///< Wait until first mouse buttons all up, then at least one down, finally all up.
40 	UNTIL_MOUSE_BUTTON_DOWN_UP, ///< Wait until first at least one mouse button down, finally all up.
41 	UNTIL_MOUSE_BUTTON_UP, ///< Wait until all mouse buttons up.
42 	UNTIL_MOUSE_BUTTON_UP_AND_WAIT_ENDED, ///< Wait until all mouse buttons up and wait period (getTimerDelay()) ended.
43 	UNTIL_MOUSE_BUTTON_UP_DOWN, ///< Wait until first all mouse buttons up, finally at least one down.
44 	UNTIL_MOUSE_BUTTON_DOWN, ///< Wait until at least one mouse button down.
45 	UNTIL_MOUSE_BUTTON_DOWN_OR_KEY_UP_OR_DOWN_OR_IN_RECTS, ///< Wait until at least one mouse button down, up key pressed, down key pressed or mouse position in at least one of the given rectangles.
46 	UNTIL_MOUSE_BUTTON_DOWN_OR_KEY_INPUT, ///< Wait until at least one mouse button down or a key pressed.
47 	UNTIL_WAIT_ENDED, ///< Wait until wait period (getTimerDelay()) ended.
48 	EMPTY_EVENT_QUEUE ///< Empty the event queue.
49 };
50 
51 void mainLoop(int bootScriptIdx);
52 void manageEvents(CallSource callSource, EventTarget eventTarget, bool useMaxMouseButtonState = false, Common::Array<Common::Rect> rects = Common::Array<Common::Rect>());
53 
54 } // End of namespace Cine
55 
56 #endif
57