ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

cursor.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef STARK_UI_CURSOR_H
00024 #define STARK_UI_CURSOR_H
00025 
00026 #include "common/rect.h"
00027 #include "common/scummsys.h"
00028 
00029 namespace Stark {
00030 
00031 class VisualImageXMG;
00032 class VisualText;
00033 
00034 namespace Gfx {
00035 class Driver;
00036 }
00037 
00041 class Cursor {
00042 public:
00043     explicit Cursor(Gfx::Driver *gfx);
00044     ~Cursor();
00045 
00047     void render();
00048 
00050     void setMousePosition(const Common::Point &pos);
00051 
00053     void setFading(bool fading);
00054 
00056     void onScreenChanged();
00057 
00058     Common::Point getMousePosition(bool unscaled = false) const;
00059 
00061     Common::Rect getHotRectangle() const;
00062 
00063     enum CursorType {
00064         kImage = -1,
00065         kDefault = 0,
00066         kActive = 3,
00067         kPassive = 9,
00068         kEye = 10,
00069         kHand = 11,
00070         kMouth = 12
00071     };
00072 
00073     void setCursorType(CursorType type);
00074     void setCursorImage(VisualImageXMG *image);
00075     void setMouseHint(const Common::String &hint);
00076 private:
00077     void updateFadeLevel();
00078     void updateHintDelay();
00079 
00080     Gfx::Driver *_gfx;
00081 
00082     Common::String _currentHint;
00083     int32 _hintDisplayDelay;
00084 
00085     Common::Point _mousePos;
00086     VisualImageXMG *_cursorImage;
00087     VisualText *_mouseText;
00088     CursorType _currentCursorType;
00089 
00090     bool _fading;
00091     float _fadeLevel;
00092     bool _fadeLevelIncreasing;
00093     static const float _fadeValueMax;
00094 };
00095 
00096 } // End of namespace Stark
00097 
00098 #endif // STARK_UI_CURSOR_H


Generated on Sat Dec 14 2019 05:00:40 for ResidualVM by doxygen 1.7.1
curved edge   curved edge