/* 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.
*
*/
#ifndef COMMON_VIRTUAL_KEYBOARD_PARSER_H
#define COMMON_VIRTUAL_KEYBOARD_PARSER_H
#include "common/scummsys.h"
#ifdef ENABLE_VKEYBD
#include "common/xmlparser.h"
#include "backends/vkeybd/virtual-keyboard.h"
/**
***************************************
** Virtual Keyboard Pack File Format **
***************************************
The new virtual keyboard for ScummVM is implemented in the same way as a HTML
ImageMap. It uses a single bitmap of the entire keyboard layout and then a
image map description allows certain areas of the bitmap to be given special
actions. Most of these actions will be a virtual key press event, but there
will also be special keys that will change the keyboard layout or close the
keyboard. The HTML image map description is contained in a larger XML file that
can describe all the different modes of the keyboard, and also different
keyboard layouts for different screen resolutions.
********************************************
** Example keyboard pack description file **
********************************************
...
...
...
*************************
** Description of tags **
*************************
This is the required, root element of the file format.
required attributes:
- initial_mode: name of the mode the keyboard will show initially
optional attributes:
- v_align/h_align: where on the screen should the keyboard appear initially
(defaults to bottom/center).
child tags:
- mode
-------------------------------------------------------------------------------
This tag encapsulates a single mode of the keyboard. Within are a number of
layouts, which provide the specific implementation at different resolutions.
required attributes:
- name: the name of the mode
- resolutions: list of the different layout resolutions
child tags:
- layout
- event
-------------------------------------------------------------------------------
These tags describe a particular event that will be triggered by a mouse click
on a particular area. The target attribute of each image map area should be the
same as an event's name.
required attributes:
- name: name of the event
- type: key | modifier | switch_mode | submit | cancel | clear | delete |
move_left | move_right - see VirtualKeyboard::EventType for explanation
for key events
- code / ascii: describe a key press in ScummVM KeyState format
for key and modifier events
- modifiers: modifier keystate as comma-separated list of shift, ctrl and/or
alt.
for switch_mode events
- mode: name of the mode that should be switched to
-------------------------------------------------------------------------------
These tags encapsulate an implementation of a mode at a particular resolution.
required attributes:
- resolution: the screen resolution that this layout is designed for
- bitmap: filename of the 24-bit bitmap that will be used for this layout
optional attributes:
- transparent_color: color in r,g,b format that will be used for keycolor
transparency (defaults to (255,0,255).
- display_font_color: color in r,g,b format that will be used for the text of
the keyboard display (defaults to (0,0,0).
child nodes:
- map: this describes the image map using the same format as html image maps
-------------------------------------------------------------------------------