2008-07-03 10:10:29 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GUI_VIRTUAL_KEYBOARD_H
|
|
|
|
#define GUI_VIRTUAL_KEYBOARD_H
|
|
|
|
|
|
|
|
class OSystem;
|
|
|
|
|
2008-07-03 22:38:19 +00:00
|
|
|
#include "common/hashmap.h"
|
|
|
|
#include "common/hash-str.h"
|
2008-07-03 10:10:29 +00:00
|
|
|
#include "common/imagemap.h"
|
|
|
|
#include "common/singleton.h"
|
|
|
|
#include "common/str.h"
|
|
|
|
#include "graphics/surface.h"
|
|
|
|
|
|
|
|
namespace GUI {
|
|
|
|
|
2008-07-03 22:38:19 +00:00
|
|
|
class VirtualKeyboardParser;
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-03 10:10:29 +00:00
|
|
|
class VirtualKeyboard : public Common::Singleton<VirtualKeyboard> {
|
2008-07-03 22:38:19 +00:00
|
|
|
private:
|
|
|
|
/** Type of key event */
|
|
|
|
enum EventType {
|
|
|
|
kEventKey,
|
|
|
|
kEventSwitchMode,
|
|
|
|
|
|
|
|
kEventMax
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Event {
|
|
|
|
Common::String name;
|
|
|
|
EventType type;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef Common::HashMap<Common::String, Event, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> EventMap;
|
|
|
|
|
|
|
|
struct Mode {
|
|
|
|
Common::String name;
|
|
|
|
Common::String resolution;
|
|
|
|
Common::String bitmapName;
|
|
|
|
Graphics::Surface *image;
|
|
|
|
Common::ImageMap imageMap;
|
|
|
|
EventMap events;
|
|
|
|
};
|
2008-07-03 10:10:29 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
VirtualKeyboard();
|
|
|
|
virtual ~VirtualKeyboard();
|
|
|
|
|
2008-07-03 22:38:19 +00:00
|
|
|
bool loadKeyboardPack(Common::String packName);
|
2008-07-03 10:10:29 +00:00
|
|
|
void show();
|
|
|
|
|
|
|
|
private:
|
|
|
|
OSystem *_system;
|
2008-07-03 22:38:19 +00:00
|
|
|
|
|
|
|
friend class VirtualKeyboardParser;
|
|
|
|
VirtualKeyboardParser *_parser;
|
2008-07-03 10:10:29 +00:00
|
|
|
|
|
|
|
void runLoop();
|
|
|
|
void draw();
|
|
|
|
|
2008-07-03 22:38:19 +00:00
|
|
|
Common::HashMap<Common::String, Mode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _modes;
|
2008-07-03 10:10:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // End of namespace GUI
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|