5 years agoWIP: Merge common code in LayoutUpdater whem making WordCandidate active/inactive
Michael Hasselmann [Wed, 28 Mar 2012 23:10:48 +0000 (01:10 +0200)]
WIP: Merge common code in LayoutUpdater whem making WordCandidate active/inactive

5 years agoWIP: add doc to hitlogic
Michael Hasselmann [Wed, 28 Mar 2012 22:50:59 +0000 (00:50 +0200)]
WIP: add doc to hitlogic

5 years agoSimplify signal connection setup in maliit-keyboard
Michael Hasselmann [Mon, 26 Mar 2012 00:14:18 +0000 (02:14 +0200)]
Simplify signal connection setup in maliit-keyboard

RevBy: TrustMe
MaliitKeyboard::Setup::connectAll can be used to create all required
connections for a fully functional virtual keyboard. It connects instances of
Glass, LayoutUpdater, Renderer, AbstractTextEditor and Logic::WordEngine.

The functions to connect two specific instances to each other are still
available, for example to be used in tests.

5 years agoIntegrate word engine with plugin and viewer
Michael Hasselmann [Tue, 27 Mar 2012 15:11:01 +0000 (17:11 +0200)]
Integrate word engine with plugin and viewer

RevBy: TrustMe

5 years agoMove word prediction and error correction into dedicated class
Michael Hasselmann [Fri, 23 Mar 2012 22:57:14 +0000 (23:57 +0100)]
Move word prediction and error correction into dedicated class

RevBy: TrustMe
MaliitKeyboard::WordEngine provides error correction based on preedit (default
engine: hunspell) and word predication based on surrounding text and preedit
(default engine: presage). WordEngine is a consumer of the shared Model::Text
master copy, but does not modify it.

5 years agoNew: Add wrapper for Hunspell
Michael Hasselmann [Mon, 26 Mar 2012 02:30:42 +0000 (04:30 +0200)]
New: Add wrapper for Hunspell

RevBy: TrustMe
WARNING: Strange license ahead, CC 2.5 SA. We probably can't use it like that?
Can be enabled like so:

$ qmake CONFIG+=enable-hunspell

5 years agoNew: Experimental word prediction
Michael Hasselmann [Mon, 26 Mar 2012 02:26:25 +0000 (04:26 +0200)]
New: Experimental word prediction

RevBy: TrustMe
If presage [P] is installed on the system, maliit-keyboard-plugin can be built
with word prediction support like so:

$ qmake CONFIG+=enable-presage

A project include file makes sure that optional libraries are added after
possible static libraries (required for proper symbol discovery by linker),
config-bottom.pri. It is to be included towards the end of other .pro files.


5 years agoFixes: Non-regular keys are valid even with empty label
Michael Hasselmann [Wed, 21 Mar 2012 16:53:39 +0000 (17:53 +0100)]
Fixes: Non-regular keys are valid even with empty label

RevBy: TrustMe
Only for keys with the default action (Key::ActionCommit), validity depends on
whether the key's label is empty. Backspace, space, return, symview etc. are no
longer bound to that check. Makes such keys press-able again.

5 years agoNew: Preedit functionality
Michael Hasselmann [Tue, 20 Mar 2012 15:10:36 +0000 (16:10 +0100)]
New: Preedit functionality

RevBy: TrustMe
For word candidates to work, we need preedit functionality. Otherwise,
candidates will always be appended to current text editor's content. However,
we want them to replace current string that is edited (= preedit).

The plugin's Editor and the viewer's DashboardEditor now share the same
functionality, via Maliit::AbstractTextEditor.

5 years agoNew: MaliitKeyboard::AbstractTextEditor
Michael Hasselmann [Tue, 20 Mar 2012 15:08:25 +0000 (16:08 +0100)]
New: MaliitKeyboard::AbstractTextEditor

RevBy: TrustMe
Unifies text handling between maliit-keyboard-viewer und
maliit-keyboard-plugin. Remember that we want to keep the viewer free of any FW
dependency, which is why this extra base class was required. The plugin
reimplements AbstractTextEditor in Editor and only has to forward the
sendCommit/sendKeyEvent calls to MAbstractInputMethodHost.

5 years agoNew: Add Text model
Michael Hasselmann [Sun, 25 Mar 2012 02:07:15 +0000 (04:07 +0200)]
New: Add Text model

RevBy: TrustMe
MaliitKeyboard::Model::Text represents the text state of the editor.  To avoid
needless copying and to keep synchronization between consumers of this model
simple, the master copy is shared as SharedText between AbstractTextEditor,
LayoutUpdater and WordEngine.
    The model itself is a passive component; users of this model are
responsible for notifying other users whenever they update the shared master

5 years agoNew: Add hit test for WordCandidate and let Renderer respond to related changes
Michael Hasselmann [Thu, 15 Mar 2012 02:11:08 +0000 (03:11 +0100)]
New: Add hit test for WordCandidate and let Renderer respond to related changes

RevBy: TrustMe
WordCandidate can now be pressed and inserted into text editor, too.

5 years agoNew: hit test for Key
Michael Hasselmann [Thu, 15 Mar 2012 00:15:09 +0000 (01:15 +0100)]
New: hit test for Key

RevBy: TrustMe
MaliitKeyboard::Logic::keyHit(.) can be used to test whether a Key has been
hit. Decided to move it outside of Glass and refactor a bit, to make code look
nicer. Can now also be used in tests and *does not* require QWidget dependency.

5 years agoChanges: Bump version to 0.91.0 0.91.0
Michael Hasselmann [Sat, 31 Mar 2012 17:24:58 +0000 (19:24 +0200)]
Changes: Bump version to 0.91.0

5 years agoFix Windows-specific library prefixes and suffixes
Jon Nordby [Mon, 19 Mar 2012 15:24:10 +0000 (16:24 +0100)]
Fix Windows-specific library prefixes and suffixes

RevBy: Krzesimir Nowak, Jan Arne Petersen
Based on the behavior seen on qmake 4.8 on Windows 8.

5 years agoUse maliitStaticLib portability function also in tests
Jon Nordby [Mon, 19 Mar 2012 15:15:38 +0000 (16:15 +0100)]
Use maliitStaticLib portability function also in tests

RevBy: Krzesimir Nowak, Jan Arne Petersen

5 years agoAllow to skip building of tests using CONFIG+=notests
Jon Nordby [Mon, 19 Mar 2012 15:15:04 +0000 (16:15 +0100)]
Allow to skip building of tests using CONFIG+=notests
ooks good.

RevBy: Krzesimir Nowak, Jan Arne Petersen
Matches the option we have in maliit-framework

5 years agoDelete KeyFont class
Michael Hasselmann [Wed, 28 Mar 2012 13:46:57 +0000 (15:46 +0200)]
Delete KeyFont class

RevBy: Jon Nordby, Jan Arne Petersen, Krzesimir Nowak
Renamed to MaliitKeyboard::Font, because it is reused in WordCandidate.

5 years agoCompose Key, KeyArea from Area, Label and change Layout policy
Michael Hasselmann [Wed, 28 Mar 2012 13:43:42 +0000 (15:43 +0200)]
Compose Key, KeyArea from Area, Label and change Layout policy

RevBy: Jon Nordby, Jan Arne Petersen, Krzesimir Nowak
Reuse Area and Label for Key and KeyArea.  New Layout policy allows to set
alignment on Layout element (left, top, right, bottom). All models who
previously reported a rectangle (that was used as geometry information) now
report a size, and optionally, an origin. Keys for example are located in a
KeyArea and thus, have an origin. The Layout itself knows the relationship
between WordRibbon, center panel and extended panel. This allows us to contain
even more layout details with it.

5 years agoNew: WordRibbonItem to render WordRibbon
Michael Hasselmann [Wed, 28 Mar 2012 13:38:34 +0000 (15:38 +0200)]
New: WordRibbonItem to render WordRibbon

RevBy: Jon Nordby, Jan Arne Petersen, Krzesimir Nowak
Similar as to KeyArea and KeyAreaItem, WordRibbon gets its own dedicated
rendering class, WordRibbonItem.

5 years agoNew: WordCandidate and WordRibbon models
Michael Hasselmann [Tue, 13 Mar 2012 15:28:25 +0000 (16:28 +0100)]
New: WordCandidate and WordRibbon models

RevBy: Jon Nordby, Jan Arne Petersen, Krzesimir Nowak
WordCandidate is composed out of Area (specifies background and size), Label
(specifies text and font). WordRibbon consists of WordCandidate and is
semantically (that is, in the way it'll be used by other components) a sibbling
of KeyArea.

5 years agoFix include order of static libs for tests, maliit-keyboard-viewer and maliit-keyboar...
Michael Hasselmann [Thu, 15 Mar 2012 00:43:17 +0000 (01:43 +0100)]
Fix include order of static libs for tests, maliit-keyboard-viewer and maliit-keyboard-plugin

RevBy: Jon Nordby, Jan Arne Petersen, Krzesimir Nowak
MALIIT_KEYBOARD_VIEW_LIB depends on MALIIT_KEYBOARD_LIB. Since we link against
static libs when, for example, building the maliit-keyboard-viewer, the include
order matters. For the linker to know which symbols to use from
MALIIT_KEYBOARD_LIB, it first needs to know all used symbols in
MALIIT_KEYBOARD_VIEW_LIB. Otherwise, symbols that are only provided by but not
used in MALIIT_KEYBOARD_LIB will be stripped by the linker, and the compilation
of maliit-keyboard-viewer will fail.
Same applies to tests that use both libraries and maliit-keyboard-plugin.

5 years agoImplement the "close" action in maliit-keyboard-viewer.
Mattia Barbon [Thu, 23 Feb 2012 17:10:30 +0000 (18:10 +0100)]
Implement the "close" action in maliit-keyboard-viewer.

RevBy: Jon Nordby, Michael Hasselmann

5 years agoClose vkb when the user presses a key with the "close" action.
Mattia Barbon [Thu, 23 Feb 2012 17:08:08 +0000 (18:08 +0100)]
Close vkb when the user presses a key with the "close" action.

RevBy: Jon Nordby, Michael Hasselmann

5 years agoAdd a "close" action to the keyboard layout parser.
Mattia Barbon [Thu, 23 Feb 2012 15:40:06 +0000 (16:40 +0100)]
Add a "close" action to the keyboard layout parser.

RevBy: Jon Nordby, Michael Hasselmann
Also add "close" action to keyboard layout DTD.

5 years agoFixed padding value handling for right margin.
Mattia Barbon [Wed, 21 Mar 2012 13:40:21 +0000 (14:40 +0100)]
Fixed padding value handling for right margin.

RevBy: Michael Hasselmann, Jon Nordby
Instead of relying on current x coordinate, use the fact that the
button is the first/last in the row and does not have a left/right

The change for left margin is just for code consistency, behaviour
was correct before this patch.

5 years agoChanges: Update NEWS for version 0.90.1
Maksim Kirillov [Wed, 28 Mar 2012 13:49:33 +0000 (16:49 +0300)]
Changes: Update NEWS for version 0.90.1

5 years agoChanges: use qmake features for framework
Maksim Kirillov [Thu, 15 Mar 2012 14:08:27 +0000 (16:08 +0200)]
Changes: use qmake features for framework

 * get rid of enable-legacy mode
 * set PREFIX by default to MALIIT_PREFIX rather than /usr.
   In fact, it affects only a couple of binaries, everything else is
   installed to MALIIT_PREFIX anyway.

5 years agoUse QTEST_MAIN in commit-string test
Jon Nordby [Tue, 6 Mar 2012 17:33:45 +0000 (18:33 +0100)]
Use QTEST_MAIN in commit-string test

RevBy: Jan Arne Petersen, Michael Hasselmann
This means that we obey the commandline arguments passed
in to the test.

5 years agoPass -qws to the unittests when using QWS
Jon Nordby [Tue, 6 Mar 2012 16:42:41 +0000 (17:42 +0100)]
Pass -qws to the unittests when using QWS

RevBy: Jan Arne Petersen, Michael Hasselmann
This is neccesary for tests which rely on a UI, to start
a Qt windowing system "server".

5 years agoNew: Estonian language layout file
Kristjan Räts [Fri, 9 Mar 2012 18:02:14 +0000 (19:02 +0100)]
New: Estonian language layout file

RevBy: Michael Hasselmann
The Estonian layout is derived from Finnish and German layouts.

5 years agoChanges: Bump version to 0.90.0 0.90.0
Michael Hasselmann [Thu, 1 Mar 2012 15:07:54 +0000 (16:07 +0100)]
Changes: Bump version to 0.90.0

5 years agoFix Qt5 build failure in tests due to missing QtWidget lib
Jon Nordby [Thu, 1 Mar 2012 15:31:01 +0000 (16:31 +0100)]
Fix Qt5 build failure in tests due to missing QtWidget lib

RevBy: TrustMe
QApplication is now in QtWidgets, not QtGui, so
include it explicitly for Qt5.

5 years agoNew: Add unit test for backspace auto-repeat
Viacheslav Sobolev [Tue, 28 Feb 2012 14:04:29 +0000 (16:04 +0200)]
New: Add unit test for backspace auto-repeat

RevBy: Michael Hasselmann, Jon Nordby

5 years agoLet Editor use options instead of hardcoded values
Viacheslav Sobolev [Tue, 28 Feb 2012 14:30:49 +0000 (16:30 +0200)]
Let Editor use options instead of hardcoded values

RevBy: Michael Hasselmann, Jon Nordby
Details: this change makes Editor testable and will also simplify integration
with styling.

5 years agoMove common build options for tests and maliit-keyboard-plugin into config-plugin.pri
Viacheslav Sobolev [Tue, 28 Feb 2012 14:01:43 +0000 (16:01 +0200)]
Move common build options for tests and maliit-keyboard-plugin into config-plugin.pri

RevBy: Michael Hasselmann, Jon Nordby

5 years agoMove InputMethodHostProbe into common library
Viacheslav Sobolev [Tue, 28 Feb 2012 13:12:04 +0000 (15:12 +0200)]
Move InputMethodHostProbe into common library

RevBy: Michael Hasselmann, Jon Nordby

5 years agoReorganize source code in tests directory
Viacheslav Sobolev [Tue, 28 Feb 2012 10:58:52 +0000 (12:58 +0200)]
Reorganize source code in tests directory

RevBy: Michael Hasselmann, Jon Nordby
Details: this patch moves code which is shared between different tests into new
static library, so tests should be compiled faster

5 years agoNew: auto-repeat for backspace key
Viacheslav Sobolev [Tue, 28 Feb 2012 09:05:27 +0000 (11:05 +0200)]
New: auto-repeat for backspace key

RevBy: Michael Hasselmann, Jon Nordby

5 years agoAdd rotation support to maliit-keyboard-viewer's Dashboard 44
Michael Hasselmann [Tue, 21 Feb 2012 17:37:44 +0000 (18:37 +0100)]
Add rotation support to maliit-keyboard-viewer's Dashboard

RevBy: TrustMe
Also emulate rotation of the target application, not just the keyboard layouts.
Done by putting everything inside a QGraphicsView and using
QGraphicsProxyWidget for the evil parts.

5 years agoRead toolbar from XML instead of creating it ad-hoc in maliit-keyboard-viewer
Michael Hasselmann [Tue, 21 Feb 2012 17:06:02 +0000 (18:06 +0100)]
Read toolbar from XML instead of creating it ad-hoc in maliit-keyboard-viewer

RevBy: TrustMe
Required, as usage of KeyboardLoader in LayoutUpdater is now mandatory (no way
to reset the instance from the outside).

5 years agoAdd alignment property to Layout
Michael Hasselmann [Tue, 21 Feb 2012 17:04:29 +0000 (18:04 +0100)]
Add alignment property to Layout

RevBy: TrustMe
Makes it possible to dock a layout to the edge of the screen (left, top, right,
bottom). Defaults to bottom. Left and right docking currently not supported.

5 years agoAdd orientation change feature to maliit-keyboard-viewer
Michael Hasselmann [Tue, 21 Feb 2012 13:08:41 +0000 (14:08 +0100)]
Add orientation change feature to maliit-keyboard-viewer

RevBy: TrustMe
Currently loses toolbar when changing orientation.

5 years agoRemove the ability to reset the internal KeyboardLoader of LayoutUpdater
Michael Hasselmann [Tue, 21 Feb 2012 13:05:46 +0000 (14:05 +0100)]
Remove the ability to reset the internal KeyboardLoader of LayoutUpdater

RevBy: TrustMe
This was only used by the maliit-keyboard-viewer, for a questionable feature
(toolbar) which can be done in better ways. There is also no test yet that
would require such feature, and the internal logic in general is not fit to
properly deal with a non-existing KeyboardLoader.

5 years agoAdd warning to KeyAreaConverter c'tor when either loader or style parameter is invalid
Michael Hasselmann [Tue, 21 Feb 2012 12:51:20 +0000 (13:51 +0100)]
Add warning to KeyAreaConverter c'tor when either loader or style parameter is invalid

RevBy: TrustMe
KeyAreaConverter would not complain about invalid parameter but simply crash
later. Now we at least print a critical warning before crashing. I decided to
not protect against the crashes, because it actually makes no sense: Being able
to transform the keyboards into key areas is a core feature, it simply *has* to
work. Better to make the surrounding code more robust.

5 years agoFix last row in 40-keys layouts
Michael Hasselmann [Sun, 12 Feb 2012 22:18:30 +0000 (23:18 +0100)]
Fix last row in 40-keys layouts

RevBy: TrustMe
Made it so that spacebar in last row consumes remaining space (equivalent width
of three neighboring keys).

5 years agoAdd Macedonian language keyboard layout
Damjan Georgievski [Thu, 9 Feb 2012 19:13:25 +0000 (20:13 +0100)]
Add Macedonian language keyboard layout

RevBy: Michael Hasselmann

5 years agoMove Keyboard-to-KeyArea conversion into dedicated helper class
Michael Hasselmann [Thu, 26 Jan 2012 17:10:32 +0000 (18:10 +0100)]
Move Keyboard-to-KeyArea conversion into dedicated helper class

RevBy: Krzesimir Nowak, Jon Nordby
KeyAreaConverter can transform Keyboards into KeyArea, including styling. It
provides a direct mapping to the KeyboardLoader interface (at least the methods
that return Keyboards). The createFromKeyboard code was moved from
LayoutUpdater to KeyAreaConverter, too.

5 years agoInternalize LayoutUpdater::activeStyle
Michael Hasselmann [Thu, 26 Jan 2012 14:44:31 +0000 (15:44 +0100)]
Internalize LayoutUpdater::activeStyle

RevBy: Krzesimir Nowak, Jon Nordby
Semi-public classes such as LayoutUpdater simply shouldn't leak implementation
details. That's why activeStyle was moved from LayoutUpdater's header to its

5 years agoRemove QObject inheritance from Style class
Michael Hasselmann [Thu, 26 Jan 2012 13:39:36 +0000 (14:39 +0100)]
Remove QObject inheritance from Style class

RevBy: Krzesimir Nowak, Jon Nordby
There was nothing in Style class that required the QObject inheritance. We keep
it as a PIMPL though, which means it's remains uncopyable.

5 years agoUpdate test .pro file template.
Krzesimir Nowak [Wed, 25 Jan 2012 15:12:15 +0000 (16:12 +0100)]
Update test .pro file template.

RevBy: Michael Hasselmann, Jon Nordby

5 years agoAdd dependencies on static libs.
Krzesimir Nowak [Thu, 26 Jan 2012 13:59:59 +0000 (14:59 +0100)]
Add dependencies on static libs.

RevBy: Michael Hasselmann, Jon Nordby
Forces binaries to be relinked if dependencies have changed.

5 years agoUse relative paths for static libs.
Krzesimir Nowak [Wed, 25 Jan 2012 15:08:30 +0000 (16:08 +0100)]
Use relative paths for static libs.

RevBy: Michael Hasselmann, Jon Nordby
Avoids linking to installed old dynamic lib by accident.

5 years agoAdd some common variables to maliit-keyboard's config.
Krzesimir Nowak [Tue, 24 Jan 2012 15:28:52 +0000 (16:28 +0100)]
Add some common variables to maliit-keyboard's config.

RevBy: Michael Hasselmann, Jon Nordby

5 years agoChanges: Bump version to 0.81.3 0.81.3
Michael Hasselmann [Fri, 27 Jan 2012 12:39:44 +0000 (13:39 +0100)]
Changes: Bump version to 0.81.3

5 years agoMerge commit 'refs/merge-requests/27' of git://
Luis Araujo [Fri, 27 Jan 2012 05:38:16 +0000 (01:08 -0430)]
Merge commit 'refs/merge-requests/27' of git:// into merge-requests/27

5 years agoFix qmake's warning about unescaped backslashes.
Krzesimir Nowak [Wed, 25 Jan 2012 15:31:03 +0000 (16:31 +0100)]
Fix qmake's warning about unescaped backslashes.

RevBy: Jon Nordby, Michael Hasselmann

5 years agoAdd key repetition during press-and-hold for all char keys and backspace/enter functi... 27
Luis Araujo [Fri, 6 Jan 2012 13:28:39 +0000 (08:58 -0430)]
Add key repetition during press-and-hold for all char keys and backspace/enter function keys

Issue: character and backspace/enter keys are not repeatable during press-and-hold
Fix: Use a Timer with the press-and-hold signal to allow keys repetition, changed sendPreedit by
sendCommit function to input all the characters since it eases and improves the synchronization of the keys repetition
Now character keys and backspace/enter function keys repeat during press-and-hold

5 years agoUse PluginClose from the main view: it avoids swiping the keys over the application
Luis Araujo [Fri, 6 Jan 2012 12:42:40 +0000 (08:12 -0430)]
Use PluginClose from the main view: it avoids swiping the keys over the application

Issue: Vertical flick happens inside each of the views (landscape/portrait) rectangles,
this creates the visual effect of swiping the keys over the applications. It is not using the PluginClose component so it is also duplicating code
Fix: Add the vertical flick using the PluginClose{} component from the main application rectangle
Now it avoids code duplication and the keys don't swipe over the application during vertical flicking

5 years agoEnable ABC/?123 key change for symbol<->alpha views switch
Luis Araujo [Fri, 6 Jan 2012 12:13:46 +0000 (07:43 -0430)]
Enable ABC/?123 key change for symbol<->alpha views switch

Issue: The symbol<->alpha key doesn't update when changing view
Fix: Check for symbol<->alpha view changes and update the key label accordingly
Now the key label updates during symbol<->alpha view switches

5 years agoEnable whitespace character when it is capslocked
Luis Araujo [Fri, 6 Jan 2012 12:02:58 +0000 (07:32 -0430)]
Enable whitespace character when it is capslocked

Issue: Space bar character is not available for capslocked keys
Fix: Added the captionShifted property to the space bar CharacterKey
Now space bar character is available for capslocked keys

5 years agoNew: Give extended keys dedicated styling
Michael Hasselmann [Sat, 21 Jan 2012 17:46:22 +0000 (18:46 +0100)]
New: Give extended keys dedicated styling

RevBy: Jon Nordby, Krzesimir Nowak
It's now possible to give extended keys their own graphics. But instead of
filling up the default style, I decided to use a decidcated style for extended
keys. Also keeps style related code relatively nice, since we only have to hand
in the proper style instance.

5 years agoNew: Make background borders for pixmaps stylable
Michael Hasselmann [Sat, 21 Jan 2012 14:01:02 +0000 (15:01 +0100)]
New: Make background borders for pixmaps stylable

RevBy: Jon Nordby, Krzesimir Nowak
In order to draw 9-tiled pixmaps properly, we need to define the corner sizes.
For that we use QMargins, and it is now read from style, for keys and key area.

5 years agoNew: Make key area background stylable
Michael Hasselmann [Sat, 21 Jan 2012 02:52:38 +0000 (03:52 +0100)]
New: Make key area background stylable

RevBy: Jon Nordby, Krzesimir Nowak
Added background and background_margins to KeyArea struct, so that KeyAreaItem
can use that into to draw background pixmap properly (including those with
rounded corners).

This is a partial fix for MALIIT#58 - Maliit Keyboard needs to have theme-able
fonts and keyboard background

5 years agoMove KeyRenderer's loadPixmap into separate Utils unit
Michael Hasselmann [Fri, 20 Jan 2012 22:33:43 +0000 (23:33 +0100)]
Move KeyRenderer's loadPixmap into separate Utils unit

RevBy: Jon Nordby, Krzesimir Nowak
Allows re-use of loadPixmap in KeyAreaItem.

5 years agoLet git ignore (static) libraries
Michael Hasselmann [Sat, 21 Jan 2012 02:57:03 +0000 (03:57 +0100)]
Let git ignore (static) libraries

RevBy: Jon Nordby, Krzesimir Nowak

6 years agoChanges: Also add Qt library path to LD_LIBRARY_PATH for tests
Jon Nordby [Tue, 24 Jan 2012 16:18:32 +0000 (17:18 +0100)]
Changes: Also add Qt library path to LD_LIBRARY_PATH for tests

RevBy: TrustMe
This is needed to make sure the same Qt libraries as was
build against is used for the test.

6 years agoFixes: Tests fail in legacy-mode
Jon Nordby [Mon, 23 Jan 2012 16:33:06 +0000 (17:33 +0100)]
Fixes: Tests fail in legacy-mode

RevBy: TrustMe
Previous change failed to take legacy-mode into account.

6 years agoFixes: Tests fail if framework not installed to system dirs
Jon Nordby [Fri, 20 Jan 2012 15:01:25 +0000 (16:01 +0100)]
Fixes: Tests fail if framework not installed to system dirs

RevBy: Krzesimir Nowak, Michael Hasselmann
Add the directories linked against to LD_LIBRARY_PATH for tests.

6 years agoNew: Read vertical offset and safety margin for extended keys from style
Michael Hasselmann [Fri, 20 Jan 2012 13:18:32 +0000 (14:18 +0100)]
New: Read vertical offset and safety margin for extended keys from style

RevBy: Jon Nordby, Krzesimir Nowak

6 years agoDon't trigger long-press signal for keys with no extended keys
Michael Hasselmann [Sun, 18 Dec 2011 21:08:08 +0000 (22:08 +0100)]
Don't trigger long-press signal for keys with no extended keys

RevBy: Jon Nordby, Krzesimir Nowak
Decided to add a boolean flag to Key model for easy decision making in glass.

6 years agoFor extended keyboards, allow to enter originally long-pressed key, too
Michael Hasselmann [Sun, 18 Dec 2011 20:44:35 +0000 (21:44 +0100)]
For extended keyboards, allow to enter originally long-pressed key, too

RevBy: Jon Nordby, Krzesimir Nowak
We simply prepend the long-pressed key to the extended keyboard, but only if
extended labels are non-empty.

6 years agoFixes: MALIIT#39 - Maliit Keyboard doesn't allow input of accented characters
Michael Hasselmann [Sun, 18 Dec 2011 20:26:05 +0000 (21:26 +0100)]
Fixes: MALIIT#39 - Maliit Keyboard doesn't allow input of accented characters

RevBy: Jon Nordby, Krzesimir Nowak
Naive implementation of extended keys.

6 years agoLet Glass detect when Key was long-pressed
Michael Hasselmann [Sun, 18 Dec 2011 19:42:41 +0000 (20:42 +0100)]
Let Glass detect when Key was long-pressed

RevBy: Jon Nordby, Krzesimir Nowak

6 years agoFix parsing layouts using old-style imports.
Krzesimir Nowak [Thu, 19 Jan 2012 17:51:40 +0000 (18:51 +0100)]
Fix parsing layouts using old-style imports.

RevBy: Michael Hasselmann, Jan Arne Petersen
LayoutParser expects no child tags when old-style import tag
is used. For this it used readNextStartElement() which was wrong
because it was reading a file to its end when import tag was last
opening tag in file. Replaced it with some more scrutinous check.

6 years agoTurn off optimizations when compiling for debugging.
Krzesimir Nowak [Thu, 19 Jan 2012 18:22:45 +0000 (19:22 +0100)]
Turn off optimizations when compiling for debugging.

RevBy: Michael Hasselmann, Jon Nordby, Jan Arne Petersen
Same as in maliit-framework.

6 years agoFix build under Qt 5 due to missing QtWidgets include
Jon Nordby [Fri, 20 Jan 2012 14:30:21 +0000 (15:30 +0100)]
Fix build under Qt 5 due to missing QtWidgets include

RevBy: TrustMe
Under Qt5 both QtGui and QtWidgets needs to be included
to include classes like QWidget and QTextEdit.

6 years agoIn commit-string test, use extendedPanel instead of centerPanel
Michael Hasselmann [Tue, 27 Dec 2011 19:15:03 +0000 (20:15 +0100)]
In commit-string test, use extendedPanel instead of centerPanel

RevBy: Jon Nordby, Jan Arne Petersen
Simply done to increase code coverage a tiny bit. Also, for an overlay item
such as extended key area, filling out the whole widget could actually make

6 years agoCleanup commit-string test and add orientation changes
Michael Hasselmann [Tue, 27 Dec 2011 19:02:23 +0000 (20:02 +0100)]
Cleanup commit-string test and add orientation changes

RevBy: Jon Nordby, Jan Arne Petersen
Now commit-string test also runs for portrait orientation.

6 years agoMake LayoutUpdate enum types introspectable for Qt
Michael Hasselmann [Wed, 18 Jan 2012 20:04:04 +0000 (21:04 +0100)]
Make LayoutUpdate enum types introspectable for Qt

RevBy: Jon Nordby, Jan Arne Petersen

6 years agoNew: Commit string test
Michael Hasselmann [Tue, 27 Dec 2011 15:46:39 +0000 (16:46 +0100)]
New: Commit string test

RevBy: Jon Nordby, Jan Arne Petersen
Test whether event filter on Glass manages to press/release keys in a non-empty
Layout. Test itself is done by faking mouse release events and checking the
commit string history that was processed by Editor.

6 years agoNew: test case skeleton generator
Michael Hasselmann [Tue, 27 Dec 2011 11:59:11 +0000 (12:59 +0100)]
New: test case skeleton generator

RevBy: Jon Nordby, Jan Arne Petersen
Usage: "$ tools/gen-test some-stuff tests/"
This will create a sub project "some-stuff" in tests directory, containing a
"" and a main.cpp" with a TestSomeStuff class.

After the sub directory is added to "tests/", make and make check will
compile and run the new test case. Use this skeleton to then write the actual
test case.

6 years agoNew: Allow code to be compiled with code coverage options
Michael Hasselmann [Tue, 27 Dec 2011 04:26:42 +0000 (05:26 +0100)]
New: Allow code to be compiled with code coverage options

RevBy: Jon Nordby, Jan Arne Petersen
Meant to be used in connection with running tests, but can also be used by
benchmark or manual testing, for example through maliit-keyboard-viewer.
Enabled at configure time, through "$ qmake CONFIG+=enable-coverage".

6 years agoNew: Add sanity test for language layout switching
Michael Hasselmann [Tue, 27 Dec 2011 04:03:06 +0000 (05:03 +0100)]
New: Add sanity test for language layout switching

RevBy: Jon Nordby, Jan Arne Petersen
This is the first auto test added to Maliit Keyboard, hence the infrastructure
overhead in this commit. Run "$ make check" to run the test.

The sanity test for language layout switching also gives an outlook for the
majority of our tests: High level feature tests are preferred over explicitly
testing 100% of a class' API. Most of the XML parsing for example can be tested
implicitly. Classes found in maliit-keyboard/lib/logic are usually good
candidates for high level feature tests.

The major drawback of high-level feature tests is that validation also happens
on a high level.  If errors are found, such tests will point to the failing
component, but rarely will they point directly to the failing line of code or

TestUtils::waitForSignal and TestUtils::create[Core]Application can be used to
create event-driven tests (or tests using async API). Tests need to use the
QTEST_APPLESS_MAIN macro and create their own main loop.

6 years agoAdd missing declaration of PVD in MaliitKeyboard::AbstractBackgroundBuffer
Michael Hasselmann [Tue, 27 Dec 2011 13:21:21 +0000 (14:21 +0100)]
Add missing declaration of PVD in MaliitKeyboard::AbstractBackgroundBuffer

RevBy: Jon Nordby, Jan Arne Petersen
Got lucky so far that the linker was able to cope with the missing d'tor
declaration, but when trying to reuse, this issue
showed up again.

6 years agoForward declare symbols in Dashboard of maliit-keyboard-viewer
Michael Hasselmann [Thu, 19 Jan 2012 09:43:36 +0000 (10:43 +0100)]
Forward declare symbols in Dashboard of maliit-keyboard-viewer

RevBy: Jon Nordby, Krzesimir Nowak

6 years agoNew: Allow to specify keyboard id via command line
Michael Hasselmann [Thu, 19 Jan 2012 02:25:26 +0000 (03:25 +0100)]
New: Allow to specify keyboard id via command line

RevBy: Jon Nordby, Krzesimir Nowak
maliit-keyboard-viewer can now also show other language layouts than en_gb.

  $ maliit-keyboard-viewer [--id pl]

Id's are the same as the subview id's being used by the framework, for

6 years agoMake maliit-keyboard-viewer more useful
Michael Hasselmann [Sun, 18 Dec 2011 16:15:11 +0000 (17:15 +0100)]
Make maliit-keyboard-viewer more useful

RevBy: Jon Nordby, Krzesimir Nowak
Viewer now shows entered keys, as if it was entered into application through
maliit-server. Also demonstrates how two VKB layouts can be operated at the
same time, with the top one acting as some kind of IM toolbar with left/right
arrow keys.

6 years agoShow Renderer's target widget
Michael Hasselmann [Sun, 18 Dec 2011 04:39:48 +0000 (05:39 +0100)]
Show Renderer's target widget

maliit-keyboard-viewer didn't show anything because the Renderer's target
widget was hidden by default. Maliit FW enforces visibily of the plugin's
widget hierarchy when a plugin becomes active, so this bug got shadowed.

6 years agoMove connection setup between Glass, Renderer and LayoutUpdater into MaliitKeyboard...
Michael Hasselmann [Sun, 18 Dec 2011 03:58:30 +0000 (04:58 +0100)]
Move connection setup between Glass, Renderer and LayoutUpdater into MaliitKeyboard::Setup namespace

RevBy: Jon Nordby, Krzesimir Nowak
It's a good idea to have the connection setup in one common place, so that
tests and the maliit-keyboard-viewer can reuse it.

6 years agoBuild internal libraries as static ones.
Krzesimir Nowak [Tue, 17 Jan 2012 16:57:56 +0000 (17:57 +0100)]
Build internal libraries as static ones.

RevBy: Michael Hasselmann, Jon Nordby
These libraries are not meant to be used by third party software
for now, so we don't have to install them. Also, not installing
them avoids a situation when old, already-installed libraries were
used during linking, which could end with failure (undefined
references to newly added API).

6 years agoRemoved unused functions and enum. 34
Krzesimir Nowak [Thu, 12 Jan 2012 18:05:51 +0000 (19:05 +0100)]
Removed unused functions and enum.

6 years agoReload keyboard when shift state changes.
Krzesimir Nowak [Thu, 12 Jan 2012 18:04:06 +0000 (19:04 +0100)]
Reload keyboard when shift state changes.

That looks like a more correct solution than just changing captions
of key to lowercase or uppercase when shift state changes.

6 years agoConsider shift state for keyboard and dead keyboard.
Krzesimir Nowak [Thu, 12 Jan 2012 17:58:39 +0000 (18:58 +0100)]
Consider shift state for keyboard and dead keyboard.

With shiftedDeadKeyboard() being introduced in KeyboardLoader we
can finally query shift state machine whether we should show shifted
keyboard or normal one.

6 years agoUse variables instead of raw strings.
Krzesimir Nowak [Mon, 16 Jan 2012 19:39:25 +0000 (20:39 +0100)]
Use variables instead of raw strings.

RevBy: TrustMe
Reasons noted in previous commit.

6 years agoExport state names as static variables.
Krzesimir Nowak [Thu, 12 Jan 2012 17:48:34 +0000 (18:48 +0100)]
Export state names as static variables.

RevBy: TrustMe
Useful when we want to query state machine in which state it is.
Also, it is better to use variables than raw strings because typo
will end in compilation error instead of some bogus behaviour of
a keyboard.

6 years agoAdded comments about addState taking ownership.
Krzesimir Nowak [Thu, 12 Jan 2012 17:44:03 +0000 (18:44 +0100)]
Added comments about addState taking ownership.

6 years agoMove get_imported_keyboard to anonymous namespace.
Krzesimir Nowak [Tue, 10 Jan 2012 18:19:53 +0000 (19:19 +0100)]
Move get_imported_keyboard to anonymous namespace.

It does not need to be a method of KeyboardLoaderPrivate, because
it does not modify currently_shifted field anymore.

6 years agoRemove currently_shifted member.
Krzesimir Nowak [Tue, 10 Jan 2012 18:12:23 +0000 (19:12 +0100)]
Remove currently_shifted member.

It was a hack, as KeyboardLoader should be stateless in this matter.

6 years agoAdd shiftedDeadKeyboard method.
Krzesimir Nowak [Tue, 10 Jan 2012 18:10:36 +0000 (19:10 +0100)]
Add shiftedDeadKeyboard method.

This method explicitly returns shifted dead keys. With that we can
make deadKeyboard() returning non-shifted dead keyboard. That could
be used by LayoutUpdater, because here shift-tracking is done.