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 LURE_EVENTS_H 24 #define LURE_EVENTS_H 25 26 27 #include "common/events.h" 28 #include "common/str.h" 29 #include "lure/luredefs.h" 30 #include "lure/disk.h" 31 32 namespace Lure { 33 34 class Mouse { 35 private: 36 CursorType _cursorNum; 37 int16 _x, _y; 38 bool _lButton, _rButton, _mButton; 39 public: 40 Mouse(); 41 ~Mouse(); 42 static Mouse &getReference(); 43 void handleEvent(Common::Event event); 44 45 void cursorOn(); 46 void cursorOff(); 47 void setCursorNum(CursorType cursorNum); 48 void setCursorNum(CursorType cursorNum, int hotspotX, int hotspotY); getCursorNum()49 CursorType getCursorNum() { return _cursorNum; } 50 void setPosition(int x, int y); x()51 int16 x() { return _x; } y()52 int16 y() { return _y; } lButton()53 bool lButton() { return _lButton; } rButton()54 bool rButton() { return _rButton; } mButton()55 bool mButton() { return _mButton; } 56 void waitForRelease(); 57 void pushCursorNum(CursorType cursorNum); 58 void pushCursorNum(CursorType cursorNum, int hotspotX, int hotspotY); 59 void popCursor(); 60 }; 61 62 class Events { 63 private: 64 Common::Event _event; 65 public: 66 Events(); 67 static Events &getReference(); 68 69 bool pollEvent(); 70 void waitForPress(); 71 bool interruptableDelay(uint32 milliseconds); 72 event()73 Common::Event event() { return _event; } type()74 Common::EventType type() { return _event.type; } 75 }; 76 77 } // End of namespace Lure 78 79 #endif 80