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

virtual-keyboard-parser.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
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 COMMON_VIRTUAL_KEYBOARD_PARSER_H
00024 #define COMMON_VIRTUAL_KEYBOARD_PARSER_H
00025 
00026 #include "common/scummsys.h"
00027 
00028 #ifdef ENABLE_VKEYBD
00029 
00030 #include "common/xmlparser.h"
00031 #include "backends/vkeybd/virtual-keyboard.h"
00032 
00173 namespace Common {
00174 
00179 class VirtualKeyboardParser : public XMLParser {
00180 
00181 public:
00182 
00186     enum ParseMode {
00190         kParseFull,
00191 
00196         kParseCheckResolutions
00197     };
00198 
00199     VirtualKeyboardParser(VirtualKeyboard *kbd);
00200     void setParseMode(ParseMode m) {
00201         _parseMode = m;
00202     }
00203 
00204 protected:
00205     CUSTOM_XML_PARSER(VirtualKeyboardParser) {
00206         XML_KEY(keyboard)
00207             XML_PROP(initial_mode, true)
00208             XML_PROP(v_align, false)
00209             XML_PROP(h_align, false)
00210             XML_KEY(mode)
00211                 XML_PROP(name, true)
00212                 XML_PROP(resolutions, true)
00213                 XML_KEY(layout)
00214                     XML_PROP(resolution, true)
00215                     XML_PROP(bitmap, true)
00216                     XML_PROP(transparent_color, false)
00217                     XML_PROP(display_font_color, false)
00218                     XML_KEY(map)
00219                         XML_KEY(area)
00220                             XML_PROP(shape, true)
00221                             XML_PROP(coords, true)
00222                             XML_PROP(target, true)
00223                         KEY_END()
00224                     KEY_END()
00225                 KEY_END()
00226                 XML_KEY(event)
00227                     XML_PROP(name, true)
00228                     XML_PROP(type, true)
00229                     XML_PROP(code, false)
00230                     XML_PROP(ascii, false)
00231                     XML_PROP(modifiers, false)
00232                     XML_PROP(mode, false)
00233                 KEY_END()
00234             KEY_END()
00235         KEY_END()
00236     } PARSER_END()
00237 
00238 protected:
00239     VirtualKeyboard *_keyboard;
00240 
00242     ParseMode _parseMode;
00243     VirtualKeyboard::Mode *_mode;
00244     String _initialModeName;
00245     bool _kbdParsed;
00246     bool _layoutParsed;
00247 
00249     virtual void cleanup();
00250 
00252     bool parserCallback_keyboard(ParserNode *node);
00253     bool parserCallback_mode(ParserNode *node);
00254     bool parserCallback_event(ParserNode *node);
00255     bool parserCallback_layout(ParserNode *node);
00256     bool parserCallback_map(ParserNode *node);
00257     bool parserCallback_area(ParserNode *node);
00258     virtual bool closedKeyCallback(ParserNode *node);
00259 
00261     byte parseFlags(const String &flags);
00262     bool parseRect(Rect &rect, const String &coords);
00263     bool parsePolygon(Polygon &poly, const String &coords);
00264     bool parseRectAsPolygon(Polygon &poly, const String &coords);
00265 };
00266 
00267 } // End of namespace GUI
00268 
00269 #endif // #ifdef ENABLE_VKEYBD
00270 
00271 #endif // #ifndef COMMON_VIRTUAL_KEYBOARD_PARSER_H


Generated on Sat Mar 16 2019 05:02:01 for ResidualVM by doxygen 1.7.1
curved edge   curved edge