(→Implementation details) |
(→Out-of-process) |
||
| Line 31: | Line 31: | ||
==== Implementation details ==== | ==== Implementation details ==== | ||
| - | The details here assume that QtQuick 2's QML based compositor would be implemented. | + | The details here assume that QtQuick 2's QML based compositor would be implemented. In there, everything is a QSceneGraphItem and managed by the compositor. Furthermore, we can't use QtQuick 1.0 and nor the QGraphicsView based plugins inside this world. |
| + | |||
| + | ===== First approach ===== | ||
| + | This approach is to display input method as one of the client window of the compositor. | ||
* Instantiate MIMPluginManager inside a Wayland compositor by using a normal QML plugin infrastructure. So here, the MIMPluginManager needs to be possible to be recompiled as a QDeclarativeExtensionPlugin. The MIMPluginManager then exposed to QML world as QSceneGraphItem as "InputMethod". | * Instantiate MIMPluginManager inside a Wayland compositor by using a normal QML plugin infrastructure. So here, the MIMPluginManager needs to be possible to be recompiled as a QDeclarativeExtensionPlugin. The MIMPluginManager then exposed to QML world as QSceneGraphItem as "InputMethod". | ||
| Line 52: | Line 55: | ||
* MIMPluginManager would still need to be responsible to insert the plugin's UI into the scene by just reparenting the plugin's UI into the <tt>inputMethod</tt> object there. | * MIMPluginManager would still need to be responsible to insert the plugin's UI into the scene by just reparenting the plugin's UI into the <tt>inputMethod</tt> object there. | ||
| - | This approach would be feasible for multiprocess Lighthouse applications setup. | + | ===== Second approach ===== |
| + | This approach is to display input method graphics into an item specified by the application. The application still need to include an item like this: | ||
| + | |||
| + | <pre> | ||
| + | import QtQuick 2.0 | ||
| + | import Maliit 1.0 // Import Maliit's plugin manager | ||
| + | |||
| + | ... | ||
| + | InputMethod { | ||
| + | id: inputMethod | ||
| + | anchors { | ||
| + | fill: parent | ||
| + | } | ||
| + | } | ||
| + | ... | ||
| + | |||
| + | Then, the compositor need to be aware of this special item, and blit the graphics of the input method plugin into the area and handle the input events accordingly. This may need a quite an effort in the compositor side. | ||
| + | |||
| + | </pre> | ||
| + | |||
| + | Both approaches would be feasible for multiprocess Lighthouse applications setup. Modification to MImPluginManager is quite easy and minimal, removing the X11-tied classes out from the project files. | ||
| + | |||
| + | |||
| + | ===== Input Context ===== | ||
| + | The application may be easier to use a declarative version of MInputContext instead of using the normal QInputContext interface, as they are not QWidget nor QGraphicsView which is now heavily used in MInputContext. | ||
== Hardware keyboard mapping == | == Hardware keyboard mapping == | ||
At the moment, the X11 platform is the only platform supported by the Input Method. This page describes the approaches that can be taken to support non-x11 platforms. When we are talking about non-X11 platforms the following feature may be affected:
The ideas in this page basically built on using Wayland as the display server. https://meego.gitorious.org/~krh/meego-ux/krhs-meego-ux-daemon can be used as a reference.
Contents |
For the host of the input method, basically there are two approaches that can be done, depending on the requirements of the system that we want to support, and we want to support both approach and can be easily switch between those.
This approach will bring the input method in the same process as the application. The memory consumed by input method is shared with the application. It also affects the startup time of the application.
This approach would be feasible for these use cases:
When used in-process, even though if the platform supports GLib D-Bus API, there is no point of having the connection using D-Bus API. Here the MInputContext may need to be modified to do direct call to the input method plugin.
This approach will still need the presence of compositor or be part of the compositor.
The details here assume that QtQuick 2's QML based compositor would be implemented. In there, everything is a QSceneGraphItem and managed by the compositor. Furthermore, we can't use QtQuick 1.0 and nor the QGraphicsView based plugins inside this world.
This approach is to display input method as one of the client window of the compositor.
import QtQuick 2.0
import Maliit 1.0 // Import Maliit's plugin manager
...
InputMethod {
id: inputMethod
anchors {
fill: parent
}
}
...
This approach is to display input method graphics into an item specified by the application. The application still need to include an item like this:
import QtQuick 2.0
import Maliit 1.0 // Import Maliit's plugin manager
...
InputMethod {
id: inputMethod
anchors {
fill: parent
}
}
...
Then, the compositor need to be aware of this special item, and blit the graphics of the input method plugin into the area and handle the input events accordingly. This may need a quite an effort in the compositor side.
Both approaches would be feasible for multiprocess Lighthouse applications setup. Modification to MImPluginManager is quite easy and minimal, removing the X11-tied classes out from the project files.
The application may be easier to use a declarative version of MInputContext instead of using the normal QInputContext interface, as they are not QWidget nor QGraphicsView which is now heavily used in MInputContext.
Internally Wayland is still using xkb, but having a dedicated interface to manage the hardware keyboard would make sense.