aboutsummaryrefslogtreecommitdiff
path: root/backends/vkeybd
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-24 15:17:42 +0000
committerJohannes Schickel2009-05-24 15:17:42 +0000
commitb3c6751b9b7fc1401fd5e87a034cdaec92b67b20 (patch)
treeaa00dba58fb88ea2e095b886963370c7290c692b /backends/vkeybd
parent7c1eb057146af11793c627327f3fefe309d27fbb (diff)
downloadscummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.tar.gz
scummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.tar.bz2
scummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.zip
Strip trailing whitespaces in the whole code base.
svn-id: r40867
Diffstat (limited to 'backends/vkeybd')
-rw-r--r--backends/vkeybd/image-map.h2
-rw-r--r--backends/vkeybd/virtual-keyboard-gui.cpp38
-rw-r--r--backends/vkeybd/virtual-keyboard-gui.h14
-rw-r--r--backends/vkeybd/virtual-keyboard-parser.cpp8
-rw-r--r--backends/vkeybd/virtual-keyboard-parser.h48
-rw-r--r--backends/vkeybd/virtual-keyboard.cpp6
-rw-r--r--backends/vkeybd/virtual-keyboard.h30
7 files changed, 73 insertions, 73 deletions
diff --git a/backends/vkeybd/image-map.h b/backends/vkeybd/image-map.h
index 6e31720abb..269ad265cd 100644
--- a/backends/vkeybd/image-map.h
+++ b/backends/vkeybd/image-map.h
@@ -41,7 +41,7 @@ class ImageMap {
public:
~ImageMap();
-
+
Polygon *createArea(const String& id);
void removeArea(const String& id);
void removeAllAreas();
diff --git a/backends/vkeybd/virtual-keyboard-gui.cpp b/backends/vkeybd/virtual-keyboard-gui.cpp
index a4b6d63aad..54b9b3d43d 100644
--- a/backends/vkeybd/virtual-keyboard-gui.cpp
+++ b/backends/vkeybd/virtual-keyboard-gui.cpp
@@ -62,31 +62,31 @@ static void blit(Graphics::Surface *surf_dst, Graphics::Surface *surf_src, int16
int dstAdd = surf_dst->w - blitW;
int srcAdd = surf_src->w - blitW;
- for (int i = 0; i < blitH; ++i) {
- for (int j = 0; j < blitW; ++j, ++dst, ++src) {
+ for (int i = 0; i < blitH; ++i) {
+ for (int j = 0; j < blitW; ++j, ++dst, ++src) {
OverlayColor col = *src;
if (col != transparent)
*dst = col;
}
dst += dstAdd;
- src += srcAdd;
+ src += srcAdd;
}
}
VirtualKeyboardGUI::VirtualKeyboardGUI(VirtualKeyboard *kbd)
- : _kbd(kbd), _displaying(false), _drag(false),
- _drawCaret(false), _displayEnabled(false), _firstRun(true),
+ : _kbd(kbd), _displaying(false), _drag(false),
+ _drawCaret(false), _displayEnabled(false), _firstRun(true),
_cursorAnimateTimer(0), _cursorAnimateCounter(0) {
-
+
assert(_kbd);
assert(g_system);
_system = g_system;
-
+
_lastScreenChanged = _system->getScreenChangeID();
_screenW = _system->getOverlayWidth();
_screenH = _system->getOverlayHeight();
-
+
memset(_cursor, 0xFF, sizeof(_cursor));
}
@@ -138,7 +138,7 @@ bool VirtualKeyboardGUI::fontIsSuitable(const Graphics::Font *font, const Rect&
void VirtualKeyboardGUI::checkScreenChanged() {
if (_lastScreenChanged != _system->getScreenChangeID())
- screenChanged();
+ screenChanged();
}
void VirtualKeyboardGUI::initSize(int16 w, int16 h) {
@@ -297,7 +297,7 @@ void VirtualKeyboardGUI::mainLoop() {
break;
case Common::EVENT_MOUSEMOVE:
if (_drag)
- move(event.mouse.x - _dragPoint.x,
+ move(event.mouse.x - _dragPoint.x,
event.mouse.y - _dragPoint.y);
break;
case Common::EVENT_SCREEN_CHANGED:
@@ -349,7 +349,7 @@ void VirtualKeyboardGUI::redraw() {
int16 w = _dirtyRect.width();
int16 h = _dirtyRect.height();
if (w <= 0 || h <= 0) return;
-
+
Graphics::Surface surf;
surf.create(w, h, sizeof(OverlayColor));
@@ -362,17 +362,17 @@ void VirtualKeyboardGUI::redraw() {
src += _overlayBackup.w;
}
- blit(&surf, _kbdSurface, _kbdBound.left - _dirtyRect.left,
+ blit(&surf, _kbdSurface, _kbdBound.left - _dirtyRect.left,
_kbdBound.top - _dirtyRect.top, _kbdTransparentColor);
if (_displayEnabled) {
- blit(&surf, &_dispSurface, _dispX - _dirtyRect.left,
+ blit(&surf, &_dispSurface, _dispX - _dirtyRect.left,
_dispY - _dirtyRect.top, _dispBackColor);
}
- _system->copyRectToOverlay((OverlayColor*)surf.pixels, surf.w,
+ _system->copyRectToOverlay((OverlayColor*)surf.pixels, surf.w,
_dirtyRect.left, _dirtyRect.top, surf.w, surf.h);
surf.free();
-
+
resetDirtyRect();
}
@@ -390,7 +390,7 @@ void VirtualKeyboardGUI::animateCaret() {
if (_system->getMillis() % kCaretBlinkTime < kCaretBlinkTime / 2) {
if (!_drawCaret) {
- _drawCaret = true;
+ _drawCaret = true;
_dispSurface.drawLine(_caretX, 0, _caretX, _dispSurface.h, _dispForeColor);
extendDirtyRect(Rect(_dispX + _caretX, _dispY, _dispX + _caretX + 1, _dispY + _dispSurface.h));
}
@@ -412,17 +412,17 @@ void VirtualKeyboardGUI::updateDisplay() {
uint dispTextEnd;
if (_dispI > cursorPos)
_dispI = cursorPos;
-
+
dispTextEnd = calculateEndIndex(wholeText, _dispI);
while (cursorPos > dispTextEnd)
dispTextEnd = calculateEndIndex(wholeText, ++_dispI);
-
+
String dispText = String(wholeText.c_str() + _dispI, wholeText.c_str() + dispTextEnd);
// draw to display surface
_dispSurface.fillRect(Rect(_dispSurface.w, _dispSurface.h), _dispBackColor);
_dispFont->drawString(&_dispSurface, dispText, 0, 0, _dispSurface.w, _dispForeColor);
-
+
String beforeCaret(wholeText.c_str() + _dispI, wholeText.c_str() + cursorPos);
_caretX = _dispFont->getStringWidth(beforeCaret);
if (_drawCaret) _dispSurface.drawLine(_caretX, 0, _caretX, _dispSurface.h, _dispForeColor);
diff --git a/backends/vkeybd/virtual-keyboard-gui.h b/backends/vkeybd/virtual-keyboard-gui.h
index 7c2e4a88a6..bd6f72d64a 100644
--- a/backends/vkeybd/virtual-keyboard-gui.h
+++ b/backends/vkeybd/virtual-keyboard-gui.h
@@ -62,9 +62,9 @@ public:
/**
* Interrupts the event loop and resets the overlay to its initial state.
- */
+ */
void close();
-
+
bool isDisplaying() { return _displaying; }
/**
@@ -73,7 +73,7 @@ public:
void reset();
/**
- * Activates drag mode. Takes the keyboard-relative coordinates of the
+ * Activates drag mode. Takes the keyboard-relative coordinates of the
* cursor as an argument.
*/
void startDrag(int16 x, int16 y);
@@ -82,16 +82,16 @@ public:
* Deactivates drag mode
* */
void endDrag();
-
+
/**
- * Checks for a screen change in the backend and re-inits the virtual
+ * Checks for a screen change in the backend and re-inits the virtual
* keyboard if it has.
*/
void checkScreenChanged();
-
+
/**
* Sets the GUI's internal screen size variables
- */
+ */
void initSize(int16 w, int16 h);
private:
diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp
index 73575d0d9a..3e40ffc1fa 100644
--- a/backends/vkeybd/virtual-keyboard-parser.cpp
+++ b/backends/vkeybd/virtual-keyboard-parser.cpp
@@ -38,7 +38,7 @@
namespace Common {
-VirtualKeyboardParser::VirtualKeyboardParser(VirtualKeyboard *kbd)
+VirtualKeyboardParser::VirtualKeyboardParser(VirtualKeyboard *kbd)
: XMLParser(), _keyboard(kbd) {
}
@@ -59,7 +59,7 @@ bool VirtualKeyboardParser::closedKeyCallback(ParserNode *node) {
return parserError("Initial mode of keyboard pack not defined");
} else if (node->name.equalsIgnoreCase("mode")) {
if (!_layoutParsed) {
- return parserError("'%s' layout missing from '%s' mode",
+ return parserError("'%s' layout missing from '%s' mode",
_mode->resolution.c_str(), _mode->name.c_str());
}
}
@@ -119,7 +119,7 @@ bool VirtualKeyboardParser::parserCallback_mode(ParserNode *node) {
String resolutions = node->values["resolutions"];
StringTokenizer tok (resolutions, " ,");
- // select best resolution simply by minimising the difference between the
+ // select best resolution simply by minimising the difference between the
// overlay size and the resolution dimensions.
// TODO: improve this by giving preference to a resolution that is smaller
// than the overlay res (so the keyboard can't be too big for the screen)
@@ -200,7 +200,7 @@ bool VirtualKeyboardParser::parserCallback_event(ParserNode *node) {
delete evt;
return parserError("Key modifier element must contain modifier attributes");
}
-
+
evt->type = VirtualKeyboard::kVKEventModifier;
byte *flags = (byte*) malloc(sizeof(byte));
*(flags) = parseFlags(node->values["modifiers"]);
diff --git a/backends/vkeybd/virtual-keyboard-parser.h b/backends/vkeybd/virtual-keyboard-parser.h
index 12adcd61c2..eeea1995c7 100644
--- a/backends/vkeybd/virtual-keyboard-parser.h
+++ b/backends/vkeybd/virtual-keyboard-parser.h
@@ -38,13 +38,13 @@
** 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
+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
+can describe all the different modes of the keyboard, and also different
keyboard layouts for different screen resolutions.
********************************************
@@ -92,7 +92,7 @@ keyboard layouts for different screen resolutions.
<keyboard>
-This is the required, root element of the file format.
+This is the required, root element of the file format.
required attributes:
- initial_mode: name of the mode the keyboard will show initially
@@ -108,12 +108,12 @@ child tags:
<mode>
-This tag encapsulates a single mode of the keyboard. Within are a number of
+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
+ - name: the name of the mode
+ - resolutions: list of the different layout resolutions
child tags:
- layout
@@ -129,12 +129,12 @@ same as an event's name.
required attributes:
- name: name of the event
- - type: key | modifier | switch_mode | submit | cancel | clear | delete |
+ - 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
+ - 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
@@ -148,8 +148,8 @@ 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
+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).
@@ -161,13 +161,13 @@ child nodes:
<map>
-These tags describe the image map for a particular layout. It uses the same
-format as HTML image maps. The only area shapes that are supported are
+These tags describe the image map for a particular layout. It uses the same
+format as HTML image maps. The only area shapes that are supported are
rectangles and polygons. The target attribute of each area should be the name
of an event for this mode (see <event> tag). They will usually be generated by
-an external tool such as GIMP's Image Map plugin, and so will not be written
-by hand, but for more information on HTML image map format see
- - http://www.w3schools.com/TAGS/tag_map.asp
+an external tool such as GIMP's Image Map plugin, and so will not be written
+by hand, but for more information on HTML image map format see
+ - http://www.w3schools.com/TAGS/tag_map.asp
- http://www.w3schools.com/TAGS/tag_area.asp
*/
@@ -177,21 +177,21 @@ namespace Common {
/**
* Subclass of Common::XMLParser that parses the virtual keyboard pack
* description file
- */
+ */
class VirtualKeyboardParser : public XMLParser {
public:
/**
- * Enum dictating how extensive a parse will be
+ * Enum dictating how extensive a parse will be
*/
enum ParseMode {
/**
* Full parse - when loading keyboard pack for first time
*/
- kParseFull,
- /**
- * Just check resolutions and reload layouts if needed - following a
+ kParseFull,
+ /**
+ * Just check resolutions and reload layouts if needed - following a
* change in screen size
*/
kParseCheckResolutions
diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp
index 1314ab7370..a95b79d213 100644
--- a/backends/vkeybd/virtual-keyboard.cpp
+++ b/backends/vkeybd/virtual-keyboard.cpp
@@ -97,7 +97,7 @@ bool VirtualKeyboard::loadKeyboardPack(String packName) {
// uncompressed keyboard pack
if (!_parser->loadFile(vkDir.getChild(packName + ".xml")))
return false;
-
+
} else if (vkDir.getChild(packName + ".zip").exists()) {
// compressed keyboard pack
#ifdef USE_ZLIB
@@ -239,7 +239,7 @@ void VirtualKeyboard::close(bool submit) {
_kbdGUI->close();
}
-bool VirtualKeyboard::isDisplaying() {
+bool VirtualKeyboard::isDisplaying() {
return _kbdGUI->isDisplaying();
}
@@ -359,7 +359,7 @@ void VirtualKeyboard::KeyPressQueue::clear() {
_strChanged = true;
}
-bool VirtualKeyboard::KeyPressQueue::empty() {
+bool VirtualKeyboard::KeyPressQueue::empty() {
return _keys.empty();
}
diff --git a/backends/vkeybd/virtual-keyboard.h b/backends/vkeybd/virtual-keyboard.h
index 4fdcb8b453..e3a9cd3600 100644
--- a/backends/vkeybd/virtual-keyboard.h
+++ b/backends/vkeybd/virtual-keyboard.h
@@ -54,7 +54,7 @@ class VirtualKeyboardParser;
* This includes storage of the virtual key press events when the user clicks
* a key and delivery of them when the keyboard is closed, as well as managing
* the internal state of the keyboard, such as its active mode.
- */
+ */
class VirtualKeyboard {
protected:
@@ -73,7 +73,7 @@ protected:
kVKEventSubmit,
/** Close the keyboard, without submitting keypresses */
kVKEventCancel,
- /** Clear the virtual keypress queue */
+ /** Clear the virtual keypress queue */
kVKEventClear,
/** Move the keypress queue insert position backwards */
kVKEventMoveLeft,
@@ -87,23 +87,23 @@ protected:
struct VKEvent {
String name;
VKEventType type;
- /**
+ /**
* Void pointer that will point to different types of data depending
* on the type of the event, these are:
* - KeyState struct for kVKEventKey events
* - a flags byte for kVKEventModifier events
* - c-string stating the name of the new mode for kSwitchMode events
- */
+ */
void *data;
-
+
VKEvent() : data(0) {}
~VKEvent() {
if (data)
free(data);
}
};
-
- typedef HashMap<String, VKEvent*> VKEventMap;
+
+ typedef HashMap<String, VKEvent*> VKEventMap;
/**
* Mode struct encapsulates all the data for each mode of the keyboard
@@ -122,7 +122,7 @@ protected:
Mode() : image(0) {}
~Mode() { delete image; }
};
-
+
typedef HashMap<String, Mode, IgnoreCase_Hash, IgnoreCase_EqualTo> ModeMap;
enum HorizontalAlignment {
@@ -143,7 +143,7 @@ protected:
uint strLen;
};
- /**
+ /**
* Class that stores the queue of virtual key presses, as well as
* maintaining a string that represents a preview of the queue
*/
@@ -182,11 +182,11 @@ public:
VirtualKeyboard();
virtual ~VirtualKeyboard();
-
+
/**
* Loads the keyboard pack with the given name.
- * The system first looks for an uncompressed keyboard pack by searching
- * for packName.xml in the filesystem, if this does not exist then it
+ * The system first looks for an uncompressed keyboard pack by searching
+ * for packName.xml in the filesystem, if this does not exist then it
* searches for a compressed keyboard pack by looking for packName.zip.
* @param packName name of the keyboard pack
*/
@@ -201,7 +201,7 @@ public:
/**
* Hides the keyboard, ending the event loop.
- * @param submit if true all accumulated key presses are submitted to
+ * @param submit if true all accumulated key presses are submitted to
* the event manager
*/
void close(bool submit);
@@ -218,7 +218,7 @@ public:
return _loaded;
}
-protected:
+protected:
OSystem *_system;
Archive *_fileArchive;
@@ -227,7 +227,7 @@ protected:
VirtualKeyboardGUI *_kbdGUI;
KeyPressQueue _keyQueue;
-
+
friend class VirtualKeyboardParser;
VirtualKeyboardParser *_parser;