├── .github └── workflows │ └── main.yaml ├── .gitignore ├── CMakeLists.txt ├── INSTALL.local ├── LICENSE.LGPL ├── NEWS ├── README.md ├── cmake ├── ECMFindModuleHelpers.cmake ├── FindGIO.cmake ├── FindGLib2.cmake ├── FindQtWaylandScanner.cmake ├── FindUDev.cmake ├── FindWayland.cmake ├── FindWaylandProtocols.cmake ├── FindWaylandScanner.cmake └── FindXCB.cmake ├── common ├── .gitignore ├── maliit-framework.pc.in ├── maliit-framework.prf.in └── maliit │ ├── namespace.h │ ├── namespaceinternal.h │ ├── settingdata.cpp │ └── settingdata.h ├── connection ├── .gitignore ├── README.weston ├── connectionfactory.cpp ├── connectionfactory.h ├── dbuscustomarguments.cpp ├── dbuscustomarguments.h ├── dbusinputcontextconnection.cpp ├── dbusinputcontextconnection.h ├── dbusserverconnection.cpp ├── dbusserverconnection.h ├── inputcontextdbusaddress.cpp ├── inputcontextdbusaddress.h ├── mimserverconnection.cpp ├── mimserverconnection.h ├── minputcontextconnection.cpp ├── minputcontextconnection.h ├── org.maliit.server.service.in ├── serverdbusaddress.cpp ├── serverdbusaddress.h ├── waylandinputmethodconnection.cpp └── waylandinputmethodconnection.h ├── dbus_interfaces ├── minputmethodcontext1interface.xml └── minputmethodserver1interface.xml ├── doc ├── .gitignore ├── Doxyfile.in ├── aliases.sed ├── images │ ├── architecture-overview.png │ ├── maliit-fw-components.odg │ └── maliit-fw-components.png └── src │ ├── architecture.dox │ ├── common.dox │ ├── extensions.dox │ ├── footer.html │ ├── header.html │ ├── images │ ├── .dummy │ └── dummyimage │ ├── internals.dox │ ├── libmaliit.dox │ ├── mainpage.dox │ ├── maliitserver.dox │ ├── meego-im.css │ ├── pluginapi.dox │ ├── pluginsystem.dox │ ├── plugintutorial.dox │ └── toolbarxml.dox ├── examples ├── README ├── apps │ ├── plainqt │ │ ├── .gitignore │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ └── plainqt.cpp │ └── qml │ │ └── enterKeyCustomization.qml └── plugins │ └── cxx │ ├── helloworld │ ├── helloworldinputmethod.cpp │ ├── helloworldinputmethod.h │ ├── helloworldplugin.cpp │ ├── helloworldplugin.h │ └── helloworldplugin.json │ └── override │ ├── overrideinputmethod.cpp │ ├── overrideinputmethod.h │ ├── overrideplugin.cpp │ ├── overrideplugin.h │ └── overrideplugin.json ├── input-context ├── main.cpp ├── maliit.json ├── minputcontext.cpp └── minputcontext.h ├── maliit-glib ├── .gitignore ├── MaliitGLibConfig.cmake.in ├── maliit-docs.xml ├── maliit-glib-docs.pro ├── maliit-glib.pc.in ├── maliit-sections.txt ├── maliitattributeextension.c ├── maliitattributeextension.h ├── maliitattributeextensionprivate.h ├── maliitattributeextensionregistry.c ├── maliitattributeextensionregistry.h ├── maliitbus.c ├── maliitbus.h ├── maliitbusprivate.h ├── maliitinputmethod.c ├── maliitinputmethod.h ├── maliitmarshallers.list ├── maliitpluginsettings.c ├── maliitpluginsettings.h ├── maliitpluginsettingsprivate.h ├── maliitsettingdata.c ├── maliitsettingdata.h ├── maliitsettingsentry.c ├── maliitsettingsentry.h ├── maliitsettingsentryprivate.h ├── maliitsettingsmanager.c └── maliitsettingsmanager.h ├── passthroughserver ├── .gitignore └── main.cpp ├── src ├── .gitignore ├── MaliitPluginsConfig.cmake.in ├── abstractplatform.cpp ├── abstractplatform.h ├── logging.cpp ├── logging.h ├── maliit-defines.prf.in ├── maliit-plugins.pc.in ├── maliit-plugins.prf.in ├── maliit-server.pc.in ├── maliit │ ├── plugins │ │ ├── abstractinputmethod.cpp │ │ ├── abstractinputmethod.h │ │ ├── abstractinputmethodhost.cpp │ │ ├── abstractinputmethodhost.h │ │ ├── abstractpluginsetting.h │ │ ├── attributeextension.cpp │ │ ├── attributeextension.h │ │ ├── attributeextension_p.h │ │ ├── extensionevent.cpp │ │ ├── extensionevent.h │ │ ├── extensionevent_p.h │ │ ├── inputmethodplugin.h │ │ ├── keyoverride.cpp │ │ ├── keyoverride.h │ │ ├── keyoverride_p.h │ │ ├── keyoverridedata.cpp │ │ ├── keyoverridedata.h │ │ ├── plugindescription.cpp │ │ ├── plugindescription.h │ │ ├── subviewdescription.cpp │ │ ├── subviewdescription.h │ │ ├── updateevent.cpp │ │ ├── updateevent.h │ │ ├── updateevent_p.h │ │ ├── updatereceiver.cpp │ │ └── updatereceiver.h │ ├── standaloneinputmethod.cpp │ ├── standaloneinputmethod.h │ ├── standaloneinputmethodhost.cpp │ └── standaloneinputmethodhost.h ├── mattributeextensionid.cpp ├── mattributeextensionid.h ├── mattributeextensionmanager.cpp ├── mattributeextensionmanager.h ├── mimhwkeyboardtracker.cpp ├── mimhwkeyboardtracker.h ├── mimhwkeyboardtracker_p.h ├── mimhwkeyboardtracker_stub.cpp ├── mimonscreenplugins.cpp ├── mimonscreenplugins.h ├── mimpluginmanager.cpp ├── mimpluginmanager.h ├── mimpluginmanager_p.h ├── mimserver.cpp ├── mimserver.h ├── mimserveroptions.cpp ├── mimserveroptions.h ├── mimsettings.cpp ├── mimsettings.h ├── mimsettingsqsettings.cpp ├── mimsettingsqsettings.h ├── mimsubviewoverride.cpp ├── mimsubviewoverride.h ├── minputmethodhost.cpp ├── minputmethodhost.h ├── msharedattributeextensionmanager.cpp ├── msharedattributeextensionmanager.h ├── qt │ └── plugins │ │ └── shellintegration │ │ ├── inputpanelshell.json │ │ ├── inputpanelshellplugin.cpp │ │ ├── qwaylandinputpanelshellintegration.cpp │ │ ├── qwaylandinputpanelshellintegration.h │ │ ├── qwaylandinputpanelsurface.cpp │ │ └── qwaylandinputpanelsurface.h ├── quick │ ├── inputmethodquick.cpp │ ├── inputmethodquick.h │ ├── inputmethodquickplugin.cpp │ ├── inputmethodquickplugin.h │ ├── keyoverridequick.cpp │ ├── keyoverridequick.h │ ├── keyoverridequick_p.h │ └── maliitquick.h ├── unknownplatform.cpp ├── unknownplatform.h ├── waylandplatform.cpp ├── waylandplatform.h ├── windowdata.cpp ├── windowdata.h ├── windowgroup.cpp ├── windowgroup.h ├── xcbplatform.cpp └── xcbplatform.h └── tests ├── dummyimplugin ├── dummyimplugin.cpp ├── dummyimplugin.h ├── dummyimplugin.json ├── dummyinputmethod.cpp └── dummyinputmethod.h ├── dummyimplugin2 ├── dummyimplugin2.cpp ├── dummyimplugin2.h └── dummyimplugin2.json ├── dummyimplugin3 ├── dummyimplugin3.cpp ├── dummyimplugin3.h ├── dummyimplugin3.json ├── dummyinputmethod3.cpp └── dummyinputmethod3.h ├── dummyplugin ├── dummyplugin.cpp ├── dummyplugin.h └── dummyplugin.json ├── ft_exampleplugin ├── .gitignore ├── ft_exampleplugin.cpp └── ft_exampleplugin.h ├── ft_mimpluginmanager ├── .gitignore ├── ft_mimpluginmanager.cpp └── ft_mimpluginmanager.h ├── qmlplugin └── helloworld.qml ├── sanitychecks ├── .gitignore ├── sanitychecks.cpp └── sanitychecks.h ├── stubs ├── fakeproperty.cpp ├── fakeproperty.h └── mkeyboardstatetracker_stub.h ├── ut_maliit_glib_settings ├── .gitignore ├── mockmaliitserver.c ├── mockmaliitserver.h └── ut_maliit_glib_settings.c ├── ut_mattributeextensionmanager ├── .gitignore ├── toolbar1.xml ├── toolbar2.xml ├── ut_mattributeextensionmanager.cpp └── ut_mattributeextensionmanager.h ├── ut_mimonscreenplugins ├── .gitignore ├── ut_mimonscreenplugins.cpp └── ut_mimonscreenplugins.h ├── ut_mimpluginmanager ├── .gitignore ├── toolbar1.xml ├── toolbar2.xml ├── ut_mimpluginmanager.cpp └── ut_mimpluginmanager.h ├── ut_mimpluginmanagerconfig ├── .gitignore ├── ut_mimpluginmanagerconfig.cpp └── ut_mimpluginmanagerconfig.h ├── ut_mimserveroptions ├── .gitignore ├── ut_mimserveroptions.cpp └── ut_mimserveroptions.h ├── ut_mimsettings ├── .gitignore ├── ut_mimsettings.cpp └── ut_mimsettings.h ├── ut_minputmethodquickplugin ├── .gitignore ├── ut_minputmethodquickplugin.cpp └── ut_minputmethodquickplugin.h ├── ut_mkeyoverride ├── .gitignore ├── ut_mkeyoverride.cpp └── ut_mkeyoverride.h └── utils ├── core-utils.cpp ├── core-utils.h ├── gui-utils.cpp └── gui-utils.h /.github/workflows/main.yaml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: '*' 6 | pull_request: 7 | branches: '*' 8 | 9 | jobs: 10 | build-debian-testing: 11 | name: Debian Testing 12 | runs-on: ubuntu-latest 13 | container: debian:testing 14 | 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v2 18 | 19 | - name: Install deps 20 | run: | 21 | apt-get update 22 | apt-get dist-upgrade --purge -y 23 | apt-get -y install build-essential cmake doxygen graphviz libdbus-1-dev libglib2.0-dev libgtk-3-dev libmtdev-dev libudev-dev libwayland-dev libxcb-composite0-dev libxcb-damage0-dev libxcb-xfixes0-dev libxext-dev libxkbcommon-dev pkg-config qml-module-qtquick2 qtbase5-dev qtbase5-private-dev qtdeclarative5-dev qtwayland5-dev-tools qtwayland5-private-dev 24 | 25 | - name: Build 26 | run: | 27 | cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=/usr . 28 | make -j8 29 | 30 | - name: Test 31 | run: | 32 | make ARGS+="-j8 --output-on-failure" test 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | core 2 | *-stamp 3 | Makefile 4 | doxygen.log* 5 | .moc 6 | .obj 7 | *.a 8 | *.so 9 | *.so.* 10 | *.o 11 | moc_* 12 | gen_* 13 | *.swp 14 | *~ 15 | *.pro.user 16 | *.gcov 17 | *.gcda 18 | *.gcno 19 | *.tar.* 20 | *.md5 21 | .idea 22 | build -------------------------------------------------------------------------------- /INSTALL.local: -------------------------------------------------------------------------------- 1 | LOCAL BUILD, INSTALL AND RUN 2 | 3 | Gtk+ paths and executable names may differ between distros and 4 | architectures, check them on your own. 5 | 6 | The description below was tested on Fedora 15 (Lovelock) 64-bit. 7 | 8 | # framework build 9 | 10 | 1. export GCONF_CONFIG_SOURCE="xml:merged:$HOME/.gconf/gconf.xml.defaults" 11 | 2. cd maliit-framework 12 | 3. qmake-qt4 -r CONFIG+=local-install PREFIX="$HOME/maliit-local" LIBDIR="$HOME/maliit-local/lib64" CONFIG+=disable-gtk-cache-update 13 | 4. make -j4 14 | 15 | # framework install 16 | 17 | 5. make install 18 | 6. export LD_LIBRARY_PATH="$HOME/maliit-local/lib64" 19 | 7. GTK_PATH="$HOME/maliit-local/lib64/gtk-2.0" /usr/bin/gtk-query-immodules-2.0-64 >"$HOME/maliit-local/lib64/gtk-2.0/2.10.0/gtk.immodules" 20 | 8. GTK_PATH="$HOME/maliit-local/lib64/gtk-3.0" /usr/bin/gtk-query-immodules-3.0-64 >"$HOME/maliit-local/lib64/gtk-3.0/3.0.0/gtk.immodules" 21 | 22 | # plugins build 23 | 24 | 9. cd ../maliit-plugins 25 | 10. export QMAKEFEATURES="$HOME/maliit-local/mkspecs/features" 26 | 11. qmake-qt4 -r 27 | 12. make -j4 28 | 29 | # plugins install 30 | 31 | 13. make install 32 | 33 | # server run 34 | 35 | 14. "$HOME/maliit-local/bin/maliit-server" & 36 | 37 | # qt app run 38 | 39 | 15. export QT_PLUGIN_PATH="$HOME/maliit-local/plugins" 40 | 16. QT_IM_MODULE=Maliit "$HOME/maliit-local/bin/maliit-exampleapp-plainqt" 41 | 42 | # gtk2 app run 43 | 44 | 17. GTK_IM_MODULE_FILE="$HOME/maliit-local/lib64/gtk-2.0/2.10.0/gtk.immodules" GTK_IM_MODULE=Maliit "$HOME/maliit-local/bin/maliit-exampleapp-gtk2" 45 | 46 | # gtk3 app run 47 | 48 | 18. GTK_IM_MODULE_FILE="$HOME/maliit-local/lib64/gtk-3.0/3.0.0/gtk.immodules" GTK_IM_MODULE=Maliit "$HOME/maliit-local/bin/maliit-exampleapp-gtk3" 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Maliit 2 | ====== 3 | 4 | Maliit provides a flexible and cross-platform input method framework. It has a 5 | plugin-based client-server architecture where applications act as clients and 6 | communicate with the Maliit server via input context plugins. The communication 7 | link currently uses D-Bus. Maliit is an open source framework (LGPL 2.1) with 8 | a production-quality [keyboard plugin](https://github.com/maliit/keyboard) (LGPL 3.0). 9 | 10 | Installing 11 | ---------- 12 | 13 | Qt 5 must be installed to build the Maliit framework. At a terminal, run: 14 | 15 | ``` 16 | mkdir build 17 | cd build 18 | cmake -DCMAKE_INSTALL_PREFIX=/usr .. 19 | make 20 | make install 21 | ``` 22 | 23 | Running 24 | ------- 25 | 26 | Set Maliit as the Qt and GTK+ input context: 27 | 28 | ``` 29 | export QT_IM_MODULE=Maliit 30 | export GTK_IM_MODULE=Maliit 31 | ``` 32 | 33 | Start the server: 34 | 35 | ``` 36 | maliit-server 37 | ``` 38 | 39 | Note that a compositing window manager and a D-Bus session bus are required to 40 | use Maliit. 41 | 42 | Test with the provided example applications: 43 | 44 | ``` 45 | maliit-exampleapp-plainqt # for Qt 46 | maliit-exampleapp-gtk2 # for Gtk2 47 | maliit-exampleapp-gtk3 # for Gtk3 48 | ``` 49 | 50 | Double-tap on the input field, and an input method (usually a virtual keyboard) 51 | should be shown. Note that an input method plugin, such as the Maliit keyboard 52 | from the maliit-plugins package, must be installed for the example applications 53 | to work. 54 | 55 | 56 | NETWORK TRANSPARENCY 57 | 58 | On one computer run: 59 | ``` 60 | maliit-server -allow-anonymous -override-address tcp:host=xxx.xxx.xxx.xxx,port=yyyyy 61 | ``` 62 | 63 | Any valid dbus address is supported. Using -allow-anonymous must only be done on 64 | a trusted network. If using a method with authentication, the -allow-anonymous flag 65 | may be dropped. 66 | 67 | On another computer: 68 | ``` 69 | MALIIT_SERVER_ADDRESS=tcp:host=xxx.xxx.xxx.xxx,port=yyyyy 70 | export MALIIT_SERVER_ADDRESS 71 | maliit-exampleapp-plainqt (or maliit-exampleapp-gtk{2,3}) 72 | ``` 73 | 74 | Where xxx.xxx.xxx.xxx is IP address of computer where maliit-server is ran 75 | and yyyyy is port number < 65536. 76 | -------------------------------------------------------------------------------- /cmake/FindGIO.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | pkg_check_modules(PC_GIO gio-2.0 gio-unix-2.0 QUIET) 3 | 4 | set(GIO_INCLUDE_DIRS ${PC_GIO_INCLUDE_DIRS}) 5 | 6 | foreach(COMP ${PC_GIO_LIBRARIES}) 7 | find_library(GIO_${COMP} NAMES ${COMP} HINTS ${PC_GIO_LIBRARY_DIRS}) 8 | list(APPEND GIO_LIBRARIES ${GIO_${COMP}}) 9 | endforeach() 10 | 11 | execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable gdbus_codegen gio-2.0 12 | OUTPUT_VARIABLE GDBUS_CODEGEN_EXECUTABLE) 13 | 14 | string(REGEX REPLACE "[\r\n]" " " GDBUS_CODEGEN_EXECUTABLE "${GDBUS_CODEGEN_EXECUTABLE}") 15 | string(REGEX REPLACE " +$" "" GDBUS_CODEGEN_EXECUTABLE "${GDBUS_CODEGEN_EXECUTABLE}") 16 | 17 | # handle the QUIETLY and REQUIRED arguments and set GLIB2_FOUND to TRUE if 18 | # all listed variables are TRUE 19 | include(FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args(GIO DEFAULT_MSG GIO_LIBRARIES GIO_INCLUDE_DIRS) 21 | 22 | mark_as_advanced(GIO_INCLUDE_DIRS GIO_LIBRARIES) 23 | 24 | if(PC_GIO_FOUND AND NOT TARGET GLib2::GIO) 25 | add_library(GLib2::GIO INTERFACE IMPORTED) 26 | 27 | set_property(TARGET GLib2::GIO PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${GIO_INCLUDE_DIRS}) 28 | set_property(TARGET GLib2::GIO PROPERTY INTERFACE_LINK_LIBRARIES ${GIO_LIBRARIES}) 29 | endif() 30 | 31 | function(GDBUS_ADD_CODE _sources _interface) 32 | get_filename_component(_infile ${_interface} ABSOLUTE) 33 | get_filename_component(_basename ${_interface} NAME_WE) 34 | set(_output "${CMAKE_CURRENT_BINARY_DIR}/${_basename}") 35 | 36 | get_source_file_property(_interface_prefix ${_interface} INTERFACE_PREFIX) 37 | if(_interface_prefix) 38 | set(_params ${_params} --interface-prefix ${_interface_prefix}) 39 | endif() 40 | 41 | get_source_file_property(_output_name ${_interface} OUTPUT_NAME) 42 | if(_output_name) 43 | set(_output "${_output_name}") 44 | endif() 45 | get_filename_component(_output_directory ${_output} DIRECTORY) 46 | file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_output_directory}) 47 | 48 | get_source_file_property(_namespace ${_interface} NAMESPACE) 49 | if(_namespace) 50 | set(_params ${_params} --c-namespace ${_namespace}) 51 | endif() 52 | 53 | get_source_file_property(_annotate ${_interface} ANNOTATE) 54 | if(_annotate) 55 | set(_params ${_params} --annotate ${_annotate}) 56 | endif() 57 | 58 | add_custom_command(OUTPUT "${_output}.c" "${_output}.h" 59 | COMMAND ${GDBUS_CODEGEN_EXECUTABLE} ${_params} --generate-c-code ${_output} ${_infile} 60 | DEPENDS ${_infile} VERBATIM) 61 | 62 | set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/${_output}.c" "${CMAKE_CURRENT_BINARY_DIR}/${_output}.h" PROPERTY SKIP_AUTOMOC ON) 63 | list(APPEND ${_sources} "${CMAKE_CURRENT_BINARY_DIR}/${_output}.c" "${CMAKE_CURRENT_BINARY_DIR}/${_output}.h") 64 | set(${_sources} ${${_sources}} PARENT_SCOPE) 65 | endfunction() 66 | -------------------------------------------------------------------------------- /cmake/FindGLib2.cmake: -------------------------------------------------------------------------------- 1 | include(FeatureSummary) 2 | set_package_properties(GLib2 PROPERTIES 3 | URL "https://wiki.gnome.org/Projects/GLib" 4 | DESCRIPTION "GLib provides the core application building blocks for libraries and applications written in C") 5 | 6 | find_package(PkgConfig) 7 | pkg_check_modules(PC_GLib2 glib-2.0>=2.38 QUIET) 8 | 9 | set(GLib2_INCLUDE_DIRS ${PC_GLib2_INCLUDE_DIRS}) 10 | 11 | foreach(COMP ${PC_GLib2_LIBRARIES}) 12 | find_library(GLib2_${COMP} NAMES ${COMP} HINTS ${PC_GLib2_LIBRARY_DIRS}) 13 | list(APPEND GLib2_LIBRARIES ${GLib2_${COMP}}) 14 | endforeach() 15 | 16 | execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable glib_genmarshal glib-2.0 17 | OUTPUT_VARIABLE GLib2_GENMARHSAL_EXECUTABLE) 18 | 19 | string(REGEX REPLACE "[\r\n]" " " GLib2_GENMARHSAL_EXECUTABLE "${GLib2_GENMARHSAL_EXECUTABLE}") 20 | string(REGEX REPLACE " +$" "" GLib2_GENMARHSAL_EXECUTABLE "${GLib2_GENMARHSAL_EXECUTABLE}") 21 | 22 | # handle the QUIETLY and REQUIRED arguments and set GLib2_FOUND to TRUE if 23 | # all listed variables are TRUE 24 | include(FindPackageHandleStandardArgs) 25 | find_package_handle_standard_args(GLib2 DEFAULT_MSG GLib2_LIBRARIES GLib2_INCLUDE_DIRS) 26 | 27 | mark_as_advanced(GLib2_INCLUDE_DIRS GLib2_LIBRARIES) 28 | 29 | if(PC_GLib2_FOUND AND NOT TARGET GLib2::GLib) 30 | add_library(GLib2::GLib INTERFACE IMPORTED) 31 | 32 | set_property(TARGET GLib2::GLib PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${GLib2_INCLUDE_DIRS}) 33 | set_property(TARGET GLib2::GLib PROPERTY INTERFACE_LINK_LIBRARIES ${GLib2_LIBRARIES}) 34 | endif() 35 | 36 | function(GLib2_ADD_MARSHAL _sources _marshallist) 37 | get_filename_component(_infile ${_marshallist} ABSOLUTE) 38 | get_filename_component(_basename ${_marshallist} NAME_WE) 39 | set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h") 40 | set(_body "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.c") 41 | 42 | get_source_file_property(_prefix ${_marshallist} PREFIX) 43 | if(_prefix) 44 | set(_params ${_params} --prefix ${_prefix}) 45 | endif() 46 | 47 | add_custom_command(OUTPUT "${_header}" 48 | COMMAND ${GLib2_GENMARHSAL_EXECUTABLE} --header ${_params} ${_infile} > ${_header} 49 | DEPENDS ${_infile} VERBATIM) 50 | add_custom_command(OUTPUT "${_body}" 51 | COMMAND ${GLib2_GENMARHSAL_EXECUTABLE} --body ${_params} ${_infile} > ${_body} 52 | DEPENDS ${_infile} VERBATIM) 53 | 54 | set_property(SOURCE ${_body} ${_header} PROPERTY SKIP_AUTOMOC ON) 55 | list(APPEND ${_sources} "${_body}" "${_header}") 56 | set(${_sources} ${${_sources}} PARENT_SCOPE) 57 | endfunction() 58 | -------------------------------------------------------------------------------- /cmake/FindUDev.cmake: -------------------------------------------------------------------------------- 1 | #.rst: 2 | # FindUDev 3 | # -------- 4 | # 5 | # Try to find the UDev library. 6 | # 7 | # This will define the following variables: 8 | # 9 | # ``UDev_FOUND`` 10 | # System has UDev. 11 | # 12 | # ``UDev_INCLUDE_DIRS`` 13 | # The libudev include directory. 14 | # 15 | # ``UDev_LIBRARIES`` 16 | # The libudev libraries. 17 | # 18 | # ``UDev_VERSION`` 19 | # The libudev version. 20 | # 21 | # If ``UDev_FOUND`` is TRUE, it will also define the following imported 22 | # target: 23 | # 24 | # ``UDev::UDev`` 25 | # The UDev library 26 | # 27 | # Since 5.57.0. 28 | 29 | #============================================================================= 30 | # SPDX-FileCopyrightText: 2010 Rafael Fernández López 31 | # SPDX-FileCopyrightText: 2019 Volker Krause 32 | # 33 | # SPDX-License-Identifier: BSD-3-Clause 34 | #============================================================================= 35 | 36 | find_package(PkgConfig QUIET) 37 | pkg_check_modules(PC_UDEV QUIET libudev) 38 | 39 | find_path(UDev_INCLUDE_DIRS NAMES libudev.h HINTS ${PC_UDEV_INCLUDE_DIRS}) 40 | find_library(UDev_LIBRARIES NAMES udev HINTS ${PC_UDEV_LIBRARY_DIRS}) 41 | 42 | set(UDev_VERSION ${PC_UDEV_VERSION}) 43 | 44 | include(FindPackageHandleStandardArgs) 45 | find_package_handle_standard_args(UDev 46 | FOUND_VAR UDev_FOUND 47 | REQUIRED_VARS UDev_INCLUDE_DIRS UDev_LIBRARIES 48 | VERSION_VAR UDev_VERSION 49 | ) 50 | 51 | mark_as_advanced(UDev_INCLUDE_DIRS UDev_LIBRARIES) 52 | 53 | if(UDev_FOUND AND NOT TARGET UDev::UDev) 54 | add_library(UDev::UDev UNKNOWN IMPORTED) 55 | set_target_properties(UDev::UDev PROPERTIES 56 | IMPORTED_LOCATION "${UDev_LIBRARIES}" 57 | INTERFACE_INCLUDE_DIRECTORIES "${UDev_INCLUDE_DIRS}" 58 | INTERFACE_COMPILE_DEFINITIONS "${PC_UDEV_CFLAGS_OTHER}" 59 | ) 60 | endif() 61 | 62 | # backward compat variables, remove for KF6 63 | set(UDEV_FOUND ${UDev_FOUND}) 64 | set(UDEV_LIBS ${UDev_LIBRARIES}) 65 | set(UDEV_INCLUDE_DIR ${UDev_INCLUDE_DIRS}) 66 | mark_as_advanced(UDEV_FOUND UDEV_LIBS UDEV_INCLUDE_DIR) 67 | 68 | include(FeatureSummary) 69 | set_package_properties(UDev PROPERTIES 70 | DESCRIPTION "API for enumerating and introspecting local devices (part of systemd)" 71 | URL "https://freedesktop.org/wiki/Software/systemd/" 72 | ) 73 | -------------------------------------------------------------------------------- /cmake/FindWaylandProtocols.cmake: -------------------------------------------------------------------------------- 1 | #.rst: 2 | # FindWaylandProtocols 3 | # ------- 4 | # 5 | # Find wayland protocol description files 6 | # 7 | # Try to find wayland protocol files. The following values are defined 8 | # 9 | # :: 10 | # 11 | # WAYLANDPROTOCOLS_FOUND - True if wayland protocol files are available 12 | # WAYLANDPROTOCOLS_PATH - Path to wayland protocol files 13 | # 14 | #============================================================================= 15 | # Copyright (c) 2015 Jari Vetoniemi 16 | # 17 | # Distributed under the OSI-approved BSD License (the "License"); 18 | # 19 | # This software is distributed WITHOUT ANY WARRANTY; without even the 20 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 21 | # See the License for more information. 22 | #============================================================================= 23 | 24 | include(FeatureSummary) 25 | set_package_properties(WaylandProtocols PROPERTIES 26 | URL "https://cgit.freedesktop.org/wayland/wayland-protocols" 27 | DESCRIPTION "Wayland protocol development") 28 | 29 | unset(WAYLANDPROTOCOLS_PATH) 30 | 31 | find_package(PkgConfig) 32 | if (PKG_CONFIG_FOUND) 33 | execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols 34 | OUTPUT_VARIABLE WAYLANDPROTOCOLS_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) 35 | endif () 36 | 37 | include(FindPackageHandleStandardArgs) 38 | find_package_handle_standard_args(WaylandProtocols DEFAULT_MSG WAYLANDPROTOCOLS_PATH) 39 | mark_as_advanced(WAYLANDPROTOCOLS_PATH) -------------------------------------------------------------------------------- /cmake/FindXCB.cmake: -------------------------------------------------------------------------------- 1 | #.rst: 2 | # FindXCB 3 | # ------- 4 | # 5 | # Find XCB libraries 6 | # 7 | # Tries to find xcb libraries on unix systems. 8 | # 9 | # - Be sure to set the COMPONENTS to the components you want to link to 10 | # - The XCB_LIBRARIES variable is set ONLY to your COMPONENTS list 11 | # - To use only a specific component check the XCB_LIBRARIES_${COMPONENT} variable 12 | # 13 | # The following values are defined 14 | # 15 | # :: 16 | # 17 | # XCB_FOUND - True if xcb is available 18 | # XCB_INCLUDE_DIRS - Include directories for xcb 19 | # XCB_LIBRARIES - List of libraries for xcb 20 | # XCB_DEFINITIONS - List of definitions for xcb 21 | # 22 | #============================================================================= 23 | # Copyright (c) 2015 Jari Vetoniemi 24 | # 25 | # Distributed under the OSI-approved BSD License (the "License"); 26 | # 27 | # This software is distributed WITHOUT ANY WARRANTY; without even the 28 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 29 | # See the License for more information. 30 | #============================================================================= 31 | 32 | include(FeatureSummary) 33 | set_package_properties(XCB PROPERTIES 34 | URL "http://xcb.freedesktop.org/" 35 | DESCRIPTION "X protocol C-language Binding") 36 | 37 | find_package(PkgConfig) 38 | pkg_check_modules(PC_XCB QUIET xcb ${XCB_FIND_COMPONENTS}) 39 | 40 | find_library(XCB_LIBRARIES xcb HINTS ${PC_XCB_LIBRARY_DIRS}) 41 | find_path(XCB_INCLUDE_DIRS xcb/xcb.h PATH_SUFFIXES xcb HINTS ${PC_XCB_INCLUDE_DIRS}) 42 | 43 | foreach(COMPONENT ${XCB_FIND_COMPONENTS}) 44 | find_library(XCB_LIBRARIES_${COMPONENT} xcb-${COMPONENT} HINTS ${PC_XCB_LIBRARY_DIRS}) 45 | list(APPEND XCB_LIBRARIES ${XCB_LIBRARIES_${COMPONENT}}) 46 | mark_as_advanced(XCB_LIBRARIES_${COMPONENT}) 47 | endforeach(COMPONENT ${XCB_FIND_COMPONENTS}) 48 | 49 | set(XCB_DEFINITIONS ${PC_XCB_CFLAGS_OTHER}) 50 | 51 | include(FindPackageHandleStandardArgs) 52 | find_package_handle_standard_args(XCB DEFAULT_MSG XCB_LIBRARIES XCB_INCLUDE_DIRS) 53 | mark_as_advanced(XCB_INCLUDE_DIRS XCB_LIBRARIES XCB_DEFINITIONS) 54 | -------------------------------------------------------------------------------- /common/.gitignore: -------------------------------------------------------------------------------- 1 | *.pc 2 | *.prf 3 | -------------------------------------------------------------------------------- /common/maliit-framework.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: Maliit Framework 5 | Description: Maliit provides a flexible and cross platform input method framework. It is usable on all MeeGo user experiences, and in other GNU/Linux distributions as well. 6 | Version: @PROJECT_VERSION@ 7 | Cflags: -I${includedir}/maliit-2 8 | -------------------------------------------------------------------------------- /common/maliit-framework.prf.in: -------------------------------------------------------------------------------- 1 | DEFINES *= @MALIIT_FRAMEWORK_FEATURE@ 2 | INCLUDEPATH *= @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/maliit-2 3 | -------------------------------------------------------------------------------- /common/maliit/namespaceinternal.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef NAMESPACEINTERNAL_H 15 | #define NAMESPACEINTERNAL_H 16 | 17 | //! \internal 18 | namespace Maliit { namespace Internal { 19 | 20 | //! Name of the input method hints stored in our update map. 21 | const char* const inputMethodHints = "maliit-inputmethod-hints"; 22 | 23 | }} // namespace Internal, Maliit 24 | 25 | #endif // NAMESPACEINTERNAL_H 26 | -------------------------------------------------------------------------------- /common/maliit/settingdata.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2012 Mattia Barbon 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License version 2.1 as published by the Free Software Foundation 8 | * and appearing in the file LICENSE.LGPL included in the packaging 9 | * of this file. 10 | */ 11 | 12 | #ifndef MALIIT_SETTINGDATA_H 13 | #define MALIIT_SETTINGDATA_H 14 | 15 | #include 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | 22 | /*! 23 | * \brief Single configuration entry for Maliit input method plugin 24 | * 25 | * \sa Maliit::SettingsEntry 26 | */ 27 | struct MImPluginSettingsEntry 28 | { 29 | //! Human-readable description 30 | QString description; 31 | //! The attribute extension key attribute for this entry 32 | QString extension_key; 33 | //! Entry value type 34 | Maliit::SettingEntryType type; 35 | //! Current value for the configuration entry 36 | QVariant value; 37 | //! Attributes, including domain values and descriptions 38 | QVariantMap attributes; 39 | }; 40 | 41 | 42 | /*! 43 | * \brief Settings for a Maliit input method plugin 44 | */ 45 | struct MImPluginSettingsInfo 46 | { 47 | //! The language used for human-readable descriptions 48 | QString description_language; 49 | //! Internal plugin name; "server" for global configuration entries 50 | QString plugin_name; 51 | //! Human-readable plugin description 52 | QString plugin_description; 53 | //! Attribute extension id; multiple MImPluginSettingsInfo instances might share the same extension id 54 | int extension_id; 55 | //! List of configuration entries for this plugin 56 | QList entries; 57 | }; 58 | 59 | 60 | /*! 61 | * \brief Validate the value for a plugin setting entry 62 | */ 63 | bool validateSettingValue(Maliit::SettingEntryType type, const QVariantMap attributes, const QVariant &value); 64 | 65 | Q_DECLARE_METATYPE(MImPluginSettingsEntry) 66 | Q_DECLARE_METATYPE(MImPluginSettingsInfo) 67 | Q_DECLARE_METATYPE(QList) 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /connection/.gitignore: -------------------------------------------------------------------------------- 1 | org.maliit.server.service 2 | minputmethodserver.service 3 | minputmethodcontext1interface_adaptor.cpp 4 | minputmethodcontext1interface_adaptor.h 5 | minputmethodcontext1interface_interface.cpp 6 | minputmethodcontext1interface_interface.h 7 | minputmethodserver1interface_adaptor.cpp 8 | minputmethodserver1interface_adaptor.h 9 | minputmethodserver1interface_interface.cpp 10 | minputmethodserver1interface_interface.h 11 | -------------------------------------------------------------------------------- /connection/README.weston: -------------------------------------------------------------------------------- 1 | Things not yet implemented in Weston, but used by Maliit Keyboard: 2 | 1. IM initiated hiding notifications. 3 | 2. Action invoking. By action we mean "copy", "paste" and such. For 4 | completness we could also pass a key sequences like Ctrl+c for 5 | copying or Ctrl+v for pasting. 6 | 3. Make putting a cursor before commited text possible. For now Weston 7 | takes an unsigned int which is relative to the beginning of 8 | commited text. 9 | -------------------------------------------------------------------------------- /connection/connectionfactory.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "connectionfactory.h" 15 | 16 | #include "minputcontextconnection.h" 17 | #include "dbusinputcontextconnection.h" 18 | 19 | #ifdef HAVE_WAYLAND 20 | #include "waylandinputmethodconnection.h" 21 | #endif 22 | 23 | namespace Maliit { 24 | namespace DBus { 25 | 26 | MInputContextConnection *createInputContextConnectionWithDynamicAddress() 27 | { 28 | QSharedPointer address(new Maliit::Server::DBus::DynamicAddress); 29 | return new DBusInputContextConnection(address); 30 | } 31 | 32 | MInputContextConnection *createInputContextConnectionWithFixedAddress(const QString &fixedAddress, bool allowAnonymous) 33 | { 34 | Q_UNUSED(allowAnonymous); 35 | QSharedPointer address(new Maliit::Server::DBus::FixedAddress(fixedAddress)); 36 | return new DBusInputContextConnection(address); 37 | } 38 | 39 | } // namespace DBus 40 | 41 | #ifdef HAVE_WAYLAND 42 | MInputContextConnection *createWestonIMProtocolConnection() 43 | { 44 | return new WaylandInputMethodConnection; 45 | } 46 | #endif 47 | 48 | } // namespace Maliit 49 | -------------------------------------------------------------------------------- /connection/connectionfactory.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MALIIT_DBUS_CONNECTIONFACTORY_H 15 | #define MALIIT_DBUS_CONNECTIONFACTORY_H 16 | 17 | #include 18 | 19 | class MInputContextConnection; 20 | 21 | namespace Maliit { 22 | namespace DBus { 23 | 24 | MInputContextConnection *createInputContextConnectionWithDynamicAddress(); 25 | MInputContextConnection *createInputContextConnectionWithFixedAddress(const QString &fixedAddress, bool allowAnonymous); 26 | 27 | } // namespace DBus 28 | 29 | #ifdef HAVE_WAYLAND 30 | MInputContextConnection *createWestonIMProtocolConnection(); 31 | #endif 32 | 33 | } // namespace Maliit 34 | 35 | #endif // MALIIT_DBUS_CONNECTIONFACTORY_H 36 | -------------------------------------------------------------------------------- /connection/dbuscustomarguments.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2012 Mattia Barbon 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #ifndef DBUSCUSTOMARGUMENTS_H 14 | #define DBUSCUSTOMARGUMENTS_H 15 | 16 | class MImPluginSettingsEntry; 17 | class MImPluginSettingsInfo; 18 | 19 | #include 20 | 21 | #include 22 | 23 | QT_BEGIN_NAMESPACE 24 | class QDBusArgument; 25 | class QVariant; 26 | // MImPluginSettingsEntry marshalling 27 | QDBusArgument &operator<<(QDBusArgument &argument, const MImPluginSettingsEntry &entry); 28 | const QDBusArgument &operator>>(const QDBusArgument &argument, MImPluginSettingsEntry &entry); 29 | 30 | // MImPluginSettingsInfo marshalling 31 | QDBusArgument &operator<<(QDBusArgument &argument, const MImPluginSettingsInfo &info); 32 | const QDBusArgument &operator>>(const QDBusArgument &argument, MImPluginSettingsInfo &info); 33 | 34 | QDBusArgument &operator<<(QDBusArgument &arg, const Maliit::PreeditTextFormat &format); 35 | const QDBusArgument &operator>>(const QDBusArgument &arg, Maliit::PreeditTextFormat &format); 36 | QT_END_NAMESPACE 37 | 38 | #endif // DBUSCUSTOMARGUMENTS_H 39 | -------------------------------------------------------------------------------- /connection/inputcontextdbusaddress.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "inputcontextdbusaddress.h" 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | namespace { 22 | const char * const MaliitServerName = "org.maliit.server"; 23 | const char * const MaliitServerObjectPath = "/org/maliit/server/address"; 24 | const char * const MaliitServerInterface = "org.maliit.Server.Address"; 25 | const char * const MaliitServerAddressProperty = "address"; 26 | 27 | const char * const DBusPropertiesInterface = "org.freedesktop.DBus.Properties"; 28 | const char * const DBusPropertiesGetMethod = "Get"; 29 | } 30 | 31 | namespace Maliit { 32 | namespace InputContext { 33 | namespace DBus { 34 | 35 | Address::Address() 36 | { 37 | } 38 | 39 | Address::~Address() 40 | { 41 | } 42 | 43 | void DynamicAddress::get() 44 | { 45 | QList arguments; 46 | arguments.push_back(QVariant(QString::fromLatin1(MaliitServerInterface))); 47 | arguments.push_back(QVariant(QString::fromLatin1(MaliitServerAddressProperty))); 48 | 49 | QDBusMessage message = QDBusMessage::createMethodCall(MaliitServerName, MaliitServerObjectPath, 50 | DBusPropertiesInterface, DBusPropertiesGetMethod); 51 | message.setArguments(arguments); 52 | 53 | QDBusConnection::sessionBus().callWithCallback(message, this, 54 | SLOT(successCallback(QDBusVariant)), 55 | SLOT(errorCallback(QDBusError))); 56 | } 57 | 58 | void DynamicAddress::successCallback(const QDBusVariant &address) 59 | { 60 | Q_EMIT addressReceived(address.variant().toString()); 61 | } 62 | 63 | void DynamicAddress::errorCallback(const QDBusError &error) 64 | { 65 | Q_EMIT addressFetchError(error.message()); 66 | } 67 | 68 | FixedAddress::FixedAddress(const QString &address) 69 | : mAddress(address) 70 | { 71 | } 72 | 73 | void FixedAddress::get() 74 | { 75 | Q_EMIT this->addressReceived(mAddress); 76 | } 77 | 78 | } // namespace DBus 79 | } // namespace InputContext 80 | } // namespace Maliit 81 | -------------------------------------------------------------------------------- /connection/inputcontextdbusaddress.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MALIIT_INPUTCONTEXT_DBUS_INPUTCONTEXTDBUSADDRESS_H 15 | #define MALIIT_INPUTCONTEXT_DBUS_INPUTCONTEXTDBUSADDRESS_H 16 | 17 | #include 18 | 19 | QT_BEGIN_NAMESPACE 20 | class QDBusVariant; 21 | class QDBusError; 22 | QT_END_NAMESPACE 23 | 24 | namespace Maliit { 25 | namespace InputContext { 26 | namespace DBus { 27 | 28 | class Address : public QObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | Address(); 34 | virtual ~Address(); 35 | 36 | virtual void get() = 0; 37 | 38 | Q_SIGNALS: 39 | void addressReceived(const QString &address); 40 | void addressFetchError(const QString &errorMessage); 41 | }; 42 | 43 | 44 | class DynamicAddress : public Address 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | void get(); 50 | 51 | private Q_SLOTS: 52 | void successCallback(const QDBusVariant &address); 53 | void errorCallback(const QDBusError &error); 54 | }; 55 | 56 | class FixedAddress : public Address 57 | { 58 | Q_OBJECT 59 | 60 | public: 61 | FixedAddress(const QString &address); 62 | void get(); 63 | 64 | private: 65 | QString mAddress; 66 | }; 67 | 68 | } // namespace DBus 69 | } // namespace InputContext 70 | } // namespace Maliit 71 | 72 | #endif // MALIIT_INPUTCONTEXT_DBUS_INPUTCONTEXTDBUSADDRESS_H 73 | -------------------------------------------------------------------------------- /connection/org.maliit.server.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=org.maliit.server 3 | Exec=@CMAKE_INSTALL_PREFIX@/bin/maliit-server @MALIIT_SERVER_ARGUMENTS@ 4 | 5 | -------------------------------------------------------------------------------- /connection/serverdbusaddress.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "serverdbusaddress.h" 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | namespace { 24 | const char * const MaliitServerName = "org.maliit.server"; 25 | const char * const MaliitServerObjectPath = "/org/maliit/server/address"; 26 | } 27 | 28 | namespace Maliit { 29 | namespace Server { 30 | namespace DBus { 31 | 32 | AddressPublisher::AddressPublisher(const QString &address) 33 | : QObject() 34 | , mAddress(address) 35 | { 36 | QDBusConnection::sessionBus().registerObject(MaliitServerObjectPath, this, QDBusConnection::ExportAllProperties); 37 | if (!QDBusConnection::sessionBus().registerService(MaliitServerName)) { 38 | qWarning("maliit-server is already running"); 39 | std::exit(0); 40 | } 41 | } 42 | 43 | AddressPublisher::~AddressPublisher() 44 | { 45 | QDBusConnection::sessionBus().unregisterObject(MaliitServerObjectPath); 46 | } 47 | 48 | QString AddressPublisher::address() const 49 | { 50 | return mAddress; 51 | } 52 | 53 | Address::Address() 54 | {} 55 | 56 | Address::~Address() 57 | {} 58 | 59 | DynamicAddress::DynamicAddress() 60 | {} 61 | 62 | QDBusServer* DynamicAddress::connect() 63 | { 64 | auto runtimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); 65 | auto dbusAddress = QLatin1String("unix:path=%1/maliit-server").arg(runtimeDir); 66 | 67 | QDBusServer *server = new QDBusServer(dbusAddress); 68 | 69 | publisher.reset(new AddressPublisher(server->address())); 70 | 71 | return server; 72 | } 73 | 74 | QDBusServer* FixedAddress::connect() 75 | { 76 | QDBusServer *server = new QDBusServer(mAddress); 77 | 78 | return server; 79 | } 80 | 81 | FixedAddress::FixedAddress(const QString &address) 82 | : mAddress(address) 83 | {} 84 | 85 | } // namespace DBus 86 | } // namespace Server 87 | } // namespace Maliit 88 | -------------------------------------------------------------------------------- /connection/serverdbusaddress.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MALIIT_SERVER_DBUS_SERVERDBUSADDRESS_H 15 | #define MALIIT_SERVER_DBUS_SERVERDBUSADDRESS_H 16 | 17 | #include 18 | #include 19 | 20 | QT_BEGIN_NAMESPACE 21 | class QDBusServer; 22 | QT_END_NAMESPACE 23 | 24 | namespace Maliit { 25 | namespace Server { 26 | namespace DBus { 27 | 28 | class AddressPublisher : public QObject 29 | { 30 | Q_OBJECT 31 | Q_CLASSINFO("D-Bus Interface", "org.maliit.Server.Address") 32 | 33 | Q_PROPERTY(QString address READ address) 34 | 35 | public: 36 | explicit AddressPublisher(const QString &address); 37 | ~AddressPublisher(); 38 | QString address() const; 39 | 40 | private: 41 | const QString mAddress; 42 | }; 43 | 44 | class Address 45 | { 46 | public: 47 | explicit Address(); 48 | virtual ~Address(); 49 | 50 | virtual QDBusServer* connect() = 0; 51 | }; 52 | 53 | class DynamicAddress : public Address 54 | { 55 | 56 | public: 57 | explicit DynamicAddress(); 58 | 59 | //! reimpl 60 | virtual QDBusServer* connect(); 61 | 62 | private: 63 | QScopedPointer publisher; 64 | }; 65 | 66 | class FixedAddress : public Address 67 | { 68 | 69 | public: 70 | explicit FixedAddress(const QString &address); 71 | 72 | //! reimpl 73 | virtual QDBusServer* connect(); 74 | 75 | private: 76 | QString mAddress; 77 | }; 78 | 79 | } // namespace DBus 80 | } // namespace Server 81 | } // namespace Maliit 82 | 83 | #endif // MALIIT_SERVER_DBUS_SERVERDBUSADDRESS_H 84 | -------------------------------------------------------------------------------- /connection/waylandinputmethodconnection.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2012 Canonical Ltd 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #ifndef WAYLANDINPUTMETHODCONNECTION_H 14 | #define WAYLANDINPUTMETHODCONNECTION_H 15 | 16 | #include 17 | #include "minputcontextconnection.h" 18 | 19 | #include 20 | 21 | Q_DECLARE_LOGGING_CATEGORY(lcWaylandConnection) 22 | 23 | class WaylandInputMethodConnectionPrivate; 24 | 25 | /*! \internal 26 | * \ingroup maliitserver 27 | * \brief Input method communication implementation between the Weston 28 | * and the input method server. 29 | */ 30 | class WaylandInputMethodConnection : public MInputContextConnection 31 | { 32 | Q_OBJECT 33 | Q_DISABLE_COPY(WaylandInputMethodConnection) 34 | Q_DECLARE_PRIVATE(WaylandInputMethodConnection) 35 | 36 | public: 37 | explicit WaylandInputMethodConnection(); 38 | virtual ~WaylandInputMethodConnection(); 39 | 40 | virtual void sendPreeditString(const QString &string, 41 | const QList &preedit_formats, 42 | int replacement_start = 0, 43 | int replacement_length = 0, 44 | int cursor_pos = -1); 45 | virtual void sendCommitString(const QString &string, 46 | int replace_start = 0, 47 | int replace_length = 0, 48 | int cursor_pos = -1); 49 | virtual void sendKeyEvent(const QKeyEvent &key_event, 50 | Maliit::EventRequestType request_type); 51 | virtual void setSelection(int start, 52 | int length); 53 | virtual QString selection(bool &valid); 54 | virtual void setLanguage(const QString &language); 55 | 56 | private: 57 | const QScopedPointer d_ptr; 58 | }; 59 | //! \internal_end 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /dbus_interfaces/minputmethodcontext1interface.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /dbus_interfaces/minputmethodserver1interface.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | html/ 2 | mdoxy.cfg 3 | -------------------------------------------------------------------------------- /doc/aliases.sed: -------------------------------------------------------------------------------- 1 | s/\\reimp_end/\\endcond/g 2 | s/\\reimp/\\cond REIMPLEMENTATION/g 3 | s/\\internal_end/\\endcond/g 4 | s/\\internal/\\cond INTERNAL/g 5 | -------------------------------------------------------------------------------- /doc/images/architecture-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/doc/images/architecture-overview.png -------------------------------------------------------------------------------- /doc/images/maliit-fw-components.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/doc/images/maliit-fw-components.odg -------------------------------------------------------------------------------- /doc/images/maliit-fw-components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/doc/images/maliit-fw-components.png -------------------------------------------------------------------------------- /doc/src/common.dox: -------------------------------------------------------------------------------- 1 | /*! @defgroup common Common 2 | 3 | \brief Shared API between @ref libmaliit and @ref pluginapi. 4 | 5 | This API consists of enums and other constants that are generally useful to 6 | consumers of %Maliit APIs. 7 | 8 | */ 9 | -------------------------------------------------------------------------------- /doc/src/footer.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |
Copyright © 2011 Nokia Corporation
Maliit
7 | 8 | 9 | -------------------------------------------------------------------------------- /doc/src/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | $title 4 | 5 | 6 | 7 | 8 | 9 | 10 | 17 | 18 |
11 | Home 12 | · 13 | API Reference 14 | · 15 | Modules 16 |
19 | -------------------------------------------------------------------------------- /doc/src/images/.dummy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/doc/src/images/.dummy -------------------------------------------------------------------------------- /doc/src/images/dummyimage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/doc/src/images/dummyimage -------------------------------------------------------------------------------- /doc/src/libmaliit.dox: -------------------------------------------------------------------------------- 1 | /*! @defgroup libmaliit Libmaliit 2 | 3 | \brief Input method extension library for Qt. 4 | 5 | Libmaliit is an input method extension library for Qt — use it to add 6 | application support for screen rotation and attribute extensions. 7 | 8 | @section basiclibmaliitusage Basic usage 9 | 10 | Include the header for the class that you wish to use. For example, if you want 11 | to use @ref Maliit::InputMethod "InputMethod": 12 | @code 13 | #include 14 | @endcode 15 | 16 | Add the libmaliit pkg-config checks to your project's qmake .pro %file: 17 | @code 18 | CONFIG += link_pkgconfig 19 | PKGCONFIG += maliit 20 | @endcode 21 | 22 | Finally, run qmake and build your application in the usual way: 23 | @code 24 | qmake 25 | make 26 | @endcode 27 | 28 | */ 29 | -------------------------------------------------------------------------------- /doc/src/maliitserver.dox: -------------------------------------------------------------------------------- 1 | /*! @defgroup maliitserver Maliit server 2 | 3 | %Maliit Server is an integration framework that provides interfaces to be implemented by input method UI plugins created by developers. If you are an application developer, you likely want to read the @ref pluginapi documentation instead. Such plugins offer a custom UI to be used in inputting text to text fields in applications. They also buffer and allow on-the-fly modification of text prior to delivery to the application. The included MeeGo Keyboard is an implementation of such a plugin. 4 | 5 | @note Input method plugins interact with word engine plugins, which can provide them with, for example, modified, alternate or corrected versions of the entered input. For more information, see the libmeegoimengine library introduction. 6 | 7 | */ 8 | -------------------------------------------------------------------------------- /doc/src/pluginapi.dox: -------------------------------------------------------------------------------- 1 | /*! @defgroup pluginapi Plugin API 2 | 3 | \brief Input method plugin API. 4 | 5 | */ 6 | -------------------------------------------------------------------------------- /examples/README: -------------------------------------------------------------------------------- 1 | Note that the examples are compiled as part of the normal build, 2 | and have simple sanity tests found under tests/ 3 | All newly added examples must contain such a test. 4 | This is done to prevent bitrot. 5 | 6 | To make the examples buildable both as a part of the normal 7 | framework build, and as a stand-alone examples package, the BUILD_TYPE 8 | is used. 9 | The value "unittest" means normal framework build, and "skeleton" means 10 | stand-alone. 11 | When not in unittest mode, the build cannot refer to directories below examples/ 12 | -------------------------------------------------------------------------------- /examples/apps/plainqt/.gitignore: -------------------------------------------------------------------------------- 1 | maliit-exampleapp-plainqt 2 | plainqt 3 | -------------------------------------------------------------------------------- /examples/apps/plainqt/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | class MainWindow 16 | : public QMainWindow 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit MainWindow(); 22 | virtual ~MainWindow(); 23 | 24 | bool eventFilter(QObject *watched, 25 | QEvent *event); 26 | 27 | private: 28 | Q_SLOT void onStartServerClicked(); 29 | Q_SLOT void onRotateKeyboardClicked(); 30 | Q_SLOT void onServerStateChanged(); 31 | 32 | private: 33 | void initUI(); 34 | void insertIntoGrid(const QString &description, 35 | const Qt::InputMethodHints &hints, 36 | const QString &tooltip = QString()); 37 | 38 | QProcess *m_server_process; 39 | int m_orientation_index; 40 | int m_grid_row; 41 | QGridLayout *const m_grid; 42 | QPushButton *const m_start_server; 43 | QPushButton *const m_rotate_keyboard; 44 | }; 45 | 46 | #endif // MAINWINDOW_H 47 | -------------------------------------------------------------------------------- /examples/apps/plainqt/plainqt.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "mainwindow.h" 15 | 16 | #include 17 | 18 | int main(int argc, char** argv) 19 | { 20 | QApplication kit(argc, argv); 21 | 22 | MainWindow window; 23 | return kit.exec(); 24 | } 25 | -------------------------------------------------------------------------------- /examples/apps/qml/enterKeyCustomization.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | width: 854 5 | height: 486 6 | color: "grey" 7 | 8 | TextInput { 9 | width: parent.width 10 | height: 50 11 | font.pixelSize: 50 12 | focus: true 13 | property variant __inputMethodExtensions: { 14 | 'enterKeyText': 'Enter', 15 | 'enterKeyHighlighted': true 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/plugins/cxx/helloworld/helloworldplugin.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "helloworldplugin.h" 15 | #include "helloworldinputmethod.h" 16 | 17 | #include 18 | #include 19 | 20 | HelloWorldPlugin::HelloWorldPlugin() 21 | { 22 | /* This helloworld plugin is an on screen input method */ 23 | allowedStates << Maliit::OnScreen; 24 | } 25 | 26 | QString HelloWorldPlugin::name() const 27 | { 28 | return "HelloWorldPlugin"; 29 | } 30 | 31 | MAbstractInputMethod * 32 | HelloWorldPlugin::createInputMethod(MAbstractInputMethodHost *host) 33 | { 34 | return new HelloWorldInputMethod(host); 35 | } 36 | 37 | QSet HelloWorldPlugin::supportedStates() const 38 | { 39 | return allowedStates; 40 | } 41 | -------------------------------------------------------------------------------- /examples/plugins/cxx/helloworld/helloworldplugin.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef HELLO_WORLD_PLUGIN_H 15 | #define HELLO_WORLD_PLUGIN_H 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | // TODO: Licence. We need a license that leaves no doubt this code can be used for any purpose 23 | 24 | //! Example input method plugin that can be used as a base when developing new input method plugins 25 | class HelloWorldPlugin: public QObject, 26 | public Maliit::Plugins::InputMethodPlugin 27 | { 28 | Q_OBJECT 29 | Q_INTERFACES(Maliit::Plugins::InputMethodPlugin) 30 | Q_PLUGIN_METADATA(IID "org.maliit.examples.cxx.helloworldplugin" 31 | FILE "helloworldplugin.json") 32 | 33 | public: 34 | HelloWorldPlugin(); 35 | 36 | //! \reimp 37 | virtual QString name() const; 38 | 39 | virtual MAbstractInputMethod *createInputMethod(MAbstractInputMethodHost *host); 40 | 41 | virtual QSet supportedStates() const; 42 | //! \reimp_end 43 | 44 | private: 45 | QSet allowedStates; 46 | }; 47 | 48 | #endif // HELLO_WORLD_PLUGIN_H 49 | -------------------------------------------------------------------------------- /examples/plugins/cxx/helloworld/helloworldplugin.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/examples/plugins/cxx/helloworld/helloworldplugin.json -------------------------------------------------------------------------------- /examples/plugins/cxx/override/overrideplugin.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "overrideplugin.h" 15 | #include "overrideinputmethod.h" 16 | 17 | #include 18 | #include 19 | 20 | OverridePlugin::OverridePlugin() 21 | { 22 | /* This override plugin is an on screen input method */ 23 | allowedStates << Maliit::OnScreen; 24 | } 25 | 26 | QString OverridePlugin::name() const 27 | { 28 | return "OverridePlugin"; 29 | } 30 | 31 | MAbstractInputMethod * 32 | OverridePlugin::createInputMethod(MAbstractInputMethodHost *host) 33 | { 34 | return new OverrideInputMethod(host); 35 | } 36 | 37 | QSet OverridePlugin::supportedStates() const 38 | { 39 | return allowedStates; 40 | } 41 | -------------------------------------------------------------------------------- /examples/plugins/cxx/override/overrideplugin.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef OVERRIDE_PLUGIN_H 15 | #define OVERRIDE_PLUGIN_H 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | // TODO: Licence. We need a license that leaves no doubt this code can be used for any purpose 23 | 24 | //! Override input method plugin that can be used as a base when developing new input method plugins 25 | class OverridePlugin: public QObject, 26 | public Maliit::Plugins::InputMethodPlugin 27 | { 28 | Q_OBJECT 29 | Q_INTERFACES(Maliit::Plugins::InputMethodPlugin) 30 | Q_PLUGIN_METADATA(IID "org.maliit.examples.cxx.overrideplugin" 31 | FILE "overrideplugin.json") 32 | 33 | public: 34 | OverridePlugin(); 35 | 36 | //! \reimp 37 | virtual QString name() const; 38 | 39 | virtual MAbstractInputMethod *createInputMethod(MAbstractInputMethodHost *host); 40 | 41 | virtual QSet supportedStates() const; 42 | //! \reimp_end 43 | 44 | private: 45 | QSet allowedStates; 46 | }; 47 | 48 | #endif // OVERRIDE_PLUGIN_H 49 | -------------------------------------------------------------------------------- /examples/plugins/cxx/override/overrideplugin.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/examples/plugins/cxx/override/overrideplugin.json -------------------------------------------------------------------------------- /input-context/main.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | * 5 | * All rights reserved. 6 | * 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License version 2.1 as published by the Free Software Foundation 11 | * and appearing in the file LICENSE.LGPL included in the packaging 12 | * of this file. 13 | */ 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include "minputcontext.h" 20 | 21 | class MaliitPlatformInputContextPlugin: public QPlatformInputContextPlugin 22 | { 23 | Q_OBJECT 24 | Q_PLUGIN_METADATA(IID QPlatformInputContextFactoryInterface_iid FILE "maliit.json") 25 | 26 | public: 27 | QPlatformInputContext *create(const QString&, const QStringList&); 28 | }; 29 | 30 | QPlatformInputContext *MaliitPlatformInputContextPlugin::create(const QString &system, const QStringList ¶mList) 31 | { 32 | Q_UNUSED(paramList); 33 | 34 | if (system.compare(system, QStringLiteral("maliit"), Qt::CaseInsensitive) == 0) { 35 | return new MInputContext; 36 | } 37 | return 0; 38 | } 39 | 40 | #include "main.moc" 41 | -------------------------------------------------------------------------------- /input-context/maliit.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys": [ "maliit" ] 3 | } 4 | -------------------------------------------------------------------------------- /maliit-glib/.gitignore: -------------------------------------------------------------------------------- 1 | maliit-*.pc 2 | maliitserver.h 3 | maliitserver.c 4 | maliitcontext.h 5 | maliitcontext.c 6 | maliitmarshallers.h 7 | maliitmarshallers.c 8 | Makefile.* 9 | *.stamp 10 | maliit/ 11 | reference/ 12 | Maliit-1.0.gir 13 | Maliit-1.0.typelib 14 | -------------------------------------------------------------------------------- /maliit-glib/MaliitGLibConfig.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/MaliitGLibTargets.cmake") -------------------------------------------------------------------------------- /maliit-glib/maliit-docs.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | ]> 7 | 8 | 9 | Maliit Reference Manual 10 | 11 | for Maliit 1.0. 12 | The latest version of this documentation can be found on-line at 13 | https://maliit.github.io/documentation/. 14 | 15 | 16 | 17 | 18 | Maliit 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | Object Hierarchy 29 | 30 | 31 | 32 | API Index 33 | 34 | 35 | 36 | Index of deprecated API 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /maliit-glib/maliit-glib.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: Maliit-GLib 5 | Description: Maliit provides a flexible and cross platform input method framework. It is usable on all MeeGo user experiences, and in other GNU/Linux distributions as well. 6 | Version: @PROJECT_VERSION@ 7 | Requires: gobject-2.0 gio-2.0 8 | Cflags: -I${includedir}/maliit-2 9 | Libs: -L${libdir} -lmaliit-glib 10 | -------------------------------------------------------------------------------- /maliit-glib/maliitattributeextensionprivate.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Maliit framework 2 | * 3 | * Copyright (C) 2012 One Laptop per Child Association 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the licence, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef MALIIT_GLIB_ATTRIBUTE_EXTENSION_PRIVATE_H 23 | #define MALIIT_GLIB_ATTRIBUTE_EXTENSION_PRIVATE_H 24 | 25 | #include 26 | #include "maliitattributeextension.h" 27 | 28 | MaliitAttributeExtension * 29 | maliit_attribute_extension_new_with_id (int id); 30 | 31 | #endif /* MALIIT_GLIB_ATTRIBUTE_EXTENSION_PRIVATE_H */ 32 | -------------------------------------------------------------------------------- /maliit-glib/maliitbus.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Maliit framework 2 | * 3 | * Copyright (C) 2015 Canonical Ltd 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the licence, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef MALIIT_GLIB_BUS_H 23 | #define MALIIT_GLIB_BUS_H 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | gboolean maliit_is_running (void); 33 | 34 | void maliit_get_server (GCancellable *cancellable, 35 | GAsyncReadyCallback callback, 36 | gpointer user_data); 37 | 38 | MaliitServer * maliit_get_server_finish (GAsyncResult *res, 39 | GError **error); 40 | 41 | MaliitServer * maliit_get_server_sync (GCancellable *cancellable, 42 | GError **error); 43 | 44 | void maliit_get_context (GCancellable *cancellable, 45 | GAsyncReadyCallback callback, 46 | gpointer user_data); 47 | 48 | MaliitContext * maliit_get_context_finish (GAsyncResult *res, 49 | GError **error); 50 | 51 | MaliitContext * maliit_get_context_sync (GCancellable *cancellable, 52 | GError **error); 53 | 54 | G_END_DECLS 55 | 56 | #endif /* MALIIT_GLIB_BUS_H */ 57 | -------------------------------------------------------------------------------- /maliit-glib/maliitbusprivate.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Maliit framework 2 | * 3 | * Copyright (C) 2015 Canonical Ltd 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the licence, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef MALIIT_GLIB_BUS_PRIVATE_H 23 | #define MALIIT_GLIB_BUS_PRIVATE_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | void maliit_set_bus (GDBusConnection *bus); 30 | 31 | G_END_DECLS 32 | 33 | #endif /* MALIIT_GLIB_BUS_PRIVATE_H */ 34 | -------------------------------------------------------------------------------- /maliit-glib/maliitinputmethod.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Maliit framework 2 | * 3 | * Copyright (C) 2012 One Laptop per Child Association 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the licence, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef MALIIT_GLIB_INPUT_METHOD_H 23 | #define MALIIT_GLIB_INPUT_METHOD_H 24 | 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define MALIIT_TYPE_INPUT_METHOD (maliit_input_method_get_type()) 31 | #define MALIIT_INPUT_METHOD(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, MALIIT_TYPE_INPUT_METHOD, MaliitInputMethod)) 32 | #define MALIIT_INPUT_METHOD_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST(cls, MALIIT_TYPE_INPUT_METHOD, MaliitInputMethodClass)) 33 | #define MALIIT_IS_INPUT_METHOD(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, MALIIT_TYPE_INPUT_METHOD)) 34 | #define MALIIT_IS_INPUT_METHOD_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE(obj, MALIIT_TYPE_INPUT_METHOD)) 35 | #define MALIIT_INPUT_METHOD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MALIIT_TYPE_INPUT_METHOD, MaliitInputMethodClass)) 36 | 37 | typedef struct _MaliitInputMethod MaliitInputMethod; 38 | typedef struct _MaliitInputMethodClass MaliitInputMethodClass; 39 | typedef struct _MaliitInputMethodPrivate MaliitInputMethodPrivate; 40 | 41 | struct _MaliitInputMethod 42 | { 43 | GObject parent; 44 | 45 | /*< private >*/ 46 | MaliitInputMethodPrivate *priv; 47 | }; 48 | 49 | /** 50 | * MaliitInputMethodClass: 51 | * @parent_class: The parent class. 52 | */ 53 | struct _MaliitInputMethodClass 54 | { 55 | GObjectClass parent_class; 56 | }; 57 | 58 | GType 59 | maliit_input_method_get_type (void) G_GNUC_CONST; 60 | 61 | MaliitInputMethod * 62 | maliit_input_method_new (void); 63 | 64 | void 65 | maliit_input_method_get_area (MaliitInputMethod *input_method, 66 | int *x, int *y, 67 | int *width, int *height); 68 | 69 | void 70 | maliit_input_method_show (MaliitInputMethod *input_method); 71 | 72 | void 73 | maliit_input_method_hide (MaliitInputMethod *input_method); 74 | 75 | G_END_DECLS 76 | 77 | #endif /* MALIIT_GLIB_INPUT_METHOD_H */ 78 | -------------------------------------------------------------------------------- /maliit-glib/maliitmarshallers.list: -------------------------------------------------------------------------------- 1 | VOID:STRING,VARIANT 2 | VOID:INT,STRING 3 | VOID:INT,STRING,VARIANT 4 | VOID:INT,INT,INT,INT 5 | -------------------------------------------------------------------------------- /maliit-glib/maliitpluginsettings.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Maliit framework 2 | * 3 | * Copyright (C) 2012 Canonical Ltd 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the licence, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef MALIIT_GLIB_PLUGIN_SETTINGS_H 23 | #define MALIIT_GLIB_PLUGIN_SETTINGS_H 24 | 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define MALIIT_TYPE_PLUGIN_SETTINGS (maliit_plugin_settings_get_type()) 31 | #define MALIIT_PLUGIN_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, MALIIT_TYPE_PLUGIN_SETTINGS, MaliitPluginSettings)) 32 | #define MALIIT_PLUGIN_SETTINGS_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST(cls, MALIIT_TYPE_PLUGIN_SETTINGS, MaliitPluginSettingsClass)) 33 | #define MALIIT_IS_PLUGIN_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, MALIIT_TYPE_PLUGIN_SETTINGS)) 34 | #define MALIIT_IS_PLUGIN_SETTINGS_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE(obj, MALIIT_TYPE_PLUGIN_SETTINGS)) 35 | #define MALIIT_PLUGIN_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MALIIT_TYPE_PLUGIN_SETTINGS, MaliitPluginSettingsClass)) 36 | 37 | typedef struct _MaliitPluginSettings MaliitPluginSettings; 38 | typedef struct _MaliitPluginSettingsClass MaliitPluginSettingsClass; 39 | typedef struct _MaliitPluginSettingsPrivate MaliitPluginSettingsPrivate; 40 | 41 | struct _MaliitPluginSettings 42 | { 43 | GObject parent; 44 | 45 | /*< private >*/ 46 | MaliitPluginSettingsPrivate *priv; 47 | }; 48 | 49 | /** 50 | * MaliitPluginSettingsClass: 51 | * @parent_class: The parent class. 52 | */ 53 | struct _MaliitPluginSettingsClass 54 | { 55 | GObjectClass parent_class; 56 | }; 57 | 58 | GType 59 | maliit_plugin_settings_get_type (void) G_GNUC_CONST; 60 | 61 | const gchar * 62 | maliit_plugin_settings_get_description_language (MaliitPluginSettings *settings); 63 | 64 | const gchar * 65 | maliit_plugin_settings_get_plugin_name (MaliitPluginSettings *settings); 66 | 67 | const gchar * 68 | maliit_plugin_settings_get_plugin_description (MaliitPluginSettings *settings); 69 | 70 | GPtrArray * 71 | maliit_plugin_settings_get_configuration_entries (MaliitPluginSettings *settings); 72 | 73 | G_END_DECLS 74 | 75 | #endif /* MALIIT_GLIB_PLUGIN_SETTINGS_H */ 76 | -------------------------------------------------------------------------------- /maliit-glib/maliitpluginsettingsprivate.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Maliit framework 2 | * 3 | * Copyright (C) 2012 Canonical Ltd 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the licence, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef MALIIT_GLIB_PLUGIN_SETTINGS_PRIVATE_H 23 | #define MALIIT_GLIB_PLUGIN_SETTINGS_PRIVATE_H 24 | 25 | #include "maliitattributeextension.h" 26 | #include "maliitpluginsettings.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | MaliitPluginSettings * 31 | maliit_plugin_settings_new_from_dbus_data (GVariant *plugin_info, 32 | MaliitAttributeExtension *extension); 33 | 34 | G_END_DECLS 35 | 36 | #endif /* MALIIT_GLIB_PLUGIN_SETTINGS_PRIVATE_H */ 37 | -------------------------------------------------------------------------------- /maliit-glib/maliitsettingsentryprivate.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Maliit framework 2 | * 3 | * Copyright (C) 2012 Canonical Ltd 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the licence, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef MALIIT_GLIB_SETTINGS_ENTRY_PRIVATE_H 23 | #define MALIIT_GLIB_SETTINGS_ENTRY_PRIVATE_H 24 | 25 | #include "maliitattributeextension.h" 26 | #include "maliitsettingsentry.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | MaliitSettingsEntry * 31 | maliit_settings_entry_new_from_dbus_data (GVariant *info, 32 | MaliitAttributeExtension *extension); 33 | 34 | G_END_DECLS 35 | 36 | #endif /* MALIIT_GLIB_SETTINGS_ENTRY_PRIVATE_H */ 37 | -------------------------------------------------------------------------------- /maliit-glib/maliitsettingsmanager.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Maliit framework 2 | * 3 | * Copyright (C) 2012 Canonical Ltd 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the licence, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef MALIIT_GLIB_SETTINGS_MANAGER_H 23 | #define MALIIT_GLIB_SETTINGS_MANAGER_H 24 | 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define MALIIT_TYPE_SETTINGS_MANAGER (maliit_settings_manager_get_type()) 31 | #define MALIIT_SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, MALIIT_TYPE_SETTINGS_MANAGER, MaliitSettingsManager)) 32 | #define MALIIT_SETTINGS_MANAGER_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST(cls, MALIIT_TYPE_SETTINGS_MANAGER, MaliitSettingsManagerClass)) 33 | #define MALIIT_IS_SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, MALIIT_TYPE_SETTINGS_MANAGER)) 34 | #define MALIIT_IS_SETTINGS_MANAGER_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE(obj, MALIIT_TYPE_SETTINGS_MANAGER)) 35 | #define MALIIT_SETTINGS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MALIIT_TYPE_SETTINGS_MANAGER, MaliitSettingsManagerClass)) 36 | 37 | typedef struct _MaliitSettingsManager MaliitSettingsManager; 38 | typedef struct _MaliitSettingsManagerClass MaliitSettingsManagerClass; 39 | typedef struct _MaliitSettingsManagerPrivate MaliitSettingsManagerPrivate; 40 | 41 | struct _MaliitSettingsManager 42 | { 43 | GObject parent; 44 | 45 | /*< private >*/ 46 | MaliitSettingsManagerPrivate *priv; 47 | }; 48 | 49 | /** 50 | * MaliitSettingsManagerClass: 51 | * @parent_class: The parent class. 52 | */ 53 | struct _MaliitSettingsManagerClass 54 | { 55 | GObjectClass parent_class; 56 | }; 57 | 58 | GType 59 | maliit_settings_manager_get_type (void) G_GNUC_CONST; 60 | 61 | MaliitSettingsManager * 62 | maliit_settings_manager_new (void); 63 | 64 | void 65 | maliit_settings_manager_load_plugin_settings (MaliitSettingsManager *manager); 66 | 67 | void 68 | maliit_settings_manager_set_preferred_description_locale (const gchar *locale_name); 69 | 70 | const gchar * 71 | maliit_settings_manager_get_preferred_description_locale (void); 72 | 73 | G_END_DECLS 74 | 75 | #endif /* MALIIT_GLIB_SETTINGS_MANAGER_H */ 76 | -------------------------------------------------------------------------------- /passthroughserver/.gitignore: -------------------------------------------------------------------------------- 1 | maliit-server 2 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | maliit-*.pc 2 | maliit-*.prf 3 | -------------------------------------------------------------------------------- /src/MaliitPluginsConfig.cmake.in: -------------------------------------------------------------------------------- 1 | include(CMakeFindDependencyMacro) 2 | 3 | find_dependency(Qt5Core @Qt5Core_VERSION@) 4 | find_dependency(Qt5Gui @Qt5Gui_VERSION@) 5 | find_dependency(Qt5Quick @Qt5Quick_VERSION@) 6 | 7 | include("${CMAKE_CURRENT_LIST_DIR}/MaliitPluginsTargets.cmake") -------------------------------------------------------------------------------- /src/abstractplatform.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Openismus GmbH 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #include 14 | #include "abstractplatform.h" 15 | 16 | #include "unknownplatform.h" 17 | #ifdef HAVE_XCB 18 | #include "xcbplatform.h" 19 | #endif 20 | #ifdef HAVE_WAYLAND 21 | #include "waylandplatform.h" 22 | #endif 23 | 24 | namespace Maliit 25 | { 26 | 27 | AbstractPlatform::~AbstractPlatform() 28 | {} 29 | 30 | void AbstractPlatform::setApplicationWindow(QWindow *window, WId appWindowId) 31 | { 32 | Q_UNUSED(window) 33 | Q_UNUSED(appWindowId) 34 | } 35 | 36 | std::unique_ptr createPlatform() 37 | { 38 | #ifdef HAVE_WAYLAND 39 | if (QGuiApplication::platformName().startsWith("wayland")) { 40 | return std::unique_ptr(new Maliit::WaylandPlatform); 41 | } 42 | #endif 43 | #ifdef HAVE_XCB 44 | if (QGuiApplication::platformName() == "xcb") { 45 | return std::unique_ptr(new Maliit::XCBPlatform); 46 | } 47 | #endif 48 | return std::unique_ptr(new Maliit::UnknownPlatform); 49 | } 50 | 51 | } // namespace Maliit 52 | -------------------------------------------------------------------------------- /src/abstractplatform.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Openismus GmbH 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #ifndef MALIIT_ABSTRACT_PLATFORM_H 14 | #define MALIIT_ABSTRACT_PLATFORM_H 15 | 16 | #include 17 | 18 | #include 19 | 20 | #include 21 | 22 | QT_BEGIN_NAMESPACE 23 | class QRegion; 24 | QT_END_NAMESPACE 25 | 26 | namespace Maliit 27 | { 28 | 29 | class AbstractPlatform 30 | { 31 | public: 32 | virtual ~AbstractPlatform(); 33 | virtual void setupInputPanel(QWindow* window, 34 | Maliit::Position position) = 0; 35 | virtual void setInputRegion(QWindow* window, 36 | const QRegion& region) = 0; 37 | virtual void setApplicationWindow(QWindow *window, WId appWindowId); 38 | }; 39 | 40 | std::unique_ptr createPlatform(); 41 | 42 | } // namespace Maliit 43 | 44 | #endif // MALIIT_ABSTRACT_PLATFORM_H 45 | -------------------------------------------------------------------------------- /src/logging.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2022 Pekka Vuorela 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "logging.h" 15 | 16 | Q_LOGGING_CATEGORY(lcMaliitFw, "org.maliit.framework", QtWarningMsg) 17 | -------------------------------------------------------------------------------- /src/logging.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2022 Pekka Vuorela 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include 15 | 16 | Q_DECLARE_LOGGING_CATEGORY(lcMaliitFw) 17 | -------------------------------------------------------------------------------- /src/maliit-defines.prf.in: -------------------------------------------------------------------------------- 1 | # This fime contains macro definitions that might be needed for plugins. 2 | # It is made separated, so one can load it eagerly with load() function 3 | # without risk to affect building part. 4 | MALIIT_PREFIX=@CMAKE_INSTALL_PREFIX@ 5 | MALIIT_PLUGINS_DIR = @CMAKE_INSTALL_FULL_LIBDIR@/maliit/plugins 6 | MALIIT_PLUGINS_DATA_DIR = @CMAKE_INSTALL_FULL_DATADIR@/maliit/plugins 7 | MALIIT_INSTALL_LIBS = @CMAKE_INSTALL_FULL_LIBDIR@ 8 | -------------------------------------------------------------------------------- /src/maliit-plugins.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | datarootdir=@CMAKE_INSTALL_FULL_DATADIR@ 4 | 5 | pluginsdir=${libdir}/maliit/plugins 6 | datadir=${datarootdir} 7 | pluginsdatadir=${datadir}/maliit/plugins 8 | 9 | Name: Maliit Plugins 10 | Description: Maliit provides a flexible and cross platform input method framework. It is usable on all MeeGo user experiences, and in other GNU/Linux distributions as well. 11 | Version: @PROJECT_VERSION@ 12 | Requires: maliit-framework 13 | Cflags: -I${includedir}/maliit-2 14 | Libs: -L${libdir} -lmaliit-plugins 15 | -------------------------------------------------------------------------------- /src/maliit-plugins.prf.in: -------------------------------------------------------------------------------- 1 | LIBS *= -L@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ -lmaliit-plugins 2 | INCLUDEPATH *= @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/maliit-2 3 | CONFIG *= maliit-framework 4 | -------------------------------------------------------------------------------- /src/maliit-server.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | datarootdir=@CMAKE_INSTALL_FULL_DATADIR@ 4 | 5 | pluginsdir=${libdir}/maliit/plugins 6 | datadir=${datarootdir} 7 | pluginsdatadir=${datadir}/maliit/plugins 8 | 9 | Name: Maliit Server 10 | Description: Library for embedding the Maliit IM Server 11 | Version: @PROJECT_VERSION@ 12 | Requires: maliit-framework maliit-plugins 13 | Cflags: -I${includedir}/maliit-2 14 | Libs: -L${libdir} 15 | -------------------------------------------------------------------------------- /src/maliit/plugins/abstractinputmethodhost.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include 15 | #include 16 | 17 | class MAbstractInputMethodHostPrivate 18 | { 19 | public: 20 | MAbstractInputMethodHostPrivate(); 21 | ~MAbstractInputMethodHostPrivate(); 22 | }; 23 | 24 | 25 | MAbstractInputMethodHostPrivate::MAbstractInputMethodHostPrivate() 26 | { 27 | } 28 | 29 | MAbstractInputMethodHostPrivate::~MAbstractInputMethodHostPrivate() 30 | { 31 | } 32 | 33 | 34 | MAbstractInputMethodHost::MAbstractInputMethodHost(QObject *parent) 35 | : QObject(parent), 36 | d(new MAbstractInputMethodHostPrivate) 37 | { 38 | // nothing 39 | } 40 | 41 | MAbstractInputMethodHost::~MAbstractInputMethodHost() 42 | { 43 | delete d; 44 | } 45 | 46 | bool MAbstractInputMethodHost::hiddenText(bool &valid) 47 | { 48 | valid = false; 49 | return false; 50 | } 51 | 52 | QList 53 | MAbstractInputMethodHost::surroundingSubViewDescriptions(Maliit::HandlerState /*state*/) const 54 | { 55 | return QList(); 56 | } 57 | 58 | void MAbstractInputMethodHost::setLanguage(const QString &/*language*/) 59 | { 60 | } 61 | -------------------------------------------------------------------------------- /src/maliit/plugins/abstractpluginsetting.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Maliit framework 2 | * 3 | * Copyright (C) 2012 Mattia Barbon 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the licence, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef MALIIT_PLUGIN_SETTINGS_H 23 | #define MALIIT_PLUGIN_SETTINGS_H 24 | 25 | #include 26 | 27 | namespace Maliit { 28 | namespace Plugins { 29 | 30 | /*! \ingroup maliitserver 31 | * \brief A generic interface to access plugin configuration values 32 | */ 33 | class AbstractPluginSetting : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | //! Returns the key of this item, as given to MAbstractInputMethodHost::registerPluginSetting() 39 | virtual QString key() const = 0; 40 | 41 | //! Returns the current value of this item, as a QVariant. 42 | virtual QVariant value() const = 0; 43 | 44 | /*! Returns the current value of this item, as a QVariant. If 45 | * there is no value for this item, return \a def instead. 46 | */ 47 | virtual QVariant value(const QVariant &def) const = 0; 48 | 49 | /*! Set the value of this item to \a val. If string \a val fails 50 | for any reason, the current value is not changed and nothing happens. 51 | */ 52 | virtual void set(const QVariant &val) = 0; 53 | 54 | /*! Unset this item. This is equivalent to 55 | 56 | \code 57 | item.set(QVariant(QVariant::Invalid)); 58 | \endcode 59 | */ 60 | virtual void unset() = 0; 61 | 62 | //! Emitted when the value of this item has changed. 63 | Q_SIGNAL void valueChanged(); 64 | }; 65 | 66 | } 67 | } 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /src/maliit/plugins/attributeextension.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | MAttributeExtensionPrivate::MAttributeExtensionPrivate() 22 | : id() 23 | { 24 | } 25 | 26 | MAttributeExtension::MAttributeExtension(const MAttributeExtensionId &id, const QString &) 27 | : d_ptr(new MAttributeExtensionPrivate()) 28 | { 29 | Q_D(MAttributeExtension); 30 | d->id = id; 31 | d->keyOverrideData = QSharedPointer(new MKeyOverrideData()); 32 | } 33 | 34 | MAttributeExtension::~MAttributeExtension() 35 | { 36 | delete d_ptr; 37 | } 38 | 39 | 40 | MAttributeExtensionId MAttributeExtension::id() const 41 | { 42 | Q_D(const MAttributeExtension); 43 | return d->id; 44 | } 45 | 46 | QSharedPointer MAttributeExtension::keyOverrideData() const 47 | { 48 | Q_D(const MAttributeExtension); 49 | return d->keyOverrideData; 50 | } 51 | -------------------------------------------------------------------------------- /src/maliit/plugins/attributeextension.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | 15 | 16 | #ifndef MATTRIBUTEEXTENSION_H 17 | #define MATTRIBUTEEXTENSION_H 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | class MAttributeExtensionId; 24 | class MAttributeExtensionPrivate; 25 | class MKeyOverrideData; 26 | 27 | /*! \ingroup pluginapi 28 | * \brief Attribute extension. 29 | */ 30 | class MAttributeExtension : public QObject 31 | { 32 | Q_OBJECT 33 | Q_DISABLE_COPY(MAttributeExtension) 34 | 35 | public: 36 | /*! 37 | * \brief Constructor 38 | */ 39 | MAttributeExtension(const MAttributeExtensionId &id, const QString &fileName); 40 | 41 | /*! 42 | * \brief Destructor 43 | */ 44 | ~MAttributeExtension(); 45 | 46 | MAttributeExtensionId id() const; 47 | 48 | //! Return the pointer to key override data. 49 | QSharedPointer keyOverrideData() const; 50 | 51 | protected: 52 | Q_DECLARE_PRIVATE(MAttributeExtension) 53 | MAttributeExtensionPrivate *const d_ptr; 54 | 55 | friend class MAttributeExtensionManager; 56 | friend class Ut_MAttributeExtension; 57 | friend class Ut_MAttributeExtensionManager; 58 | }; 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /src/maliit/plugins/attributeextension_p.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | 15 | #ifndef MATTRIBUTEEXTENSION_P_H 16 | #define MATTRIBUTEEXTENSION_P_H 17 | 18 | #include 19 | #include "mattributeextensionid.h" 20 | class MKeyOverrideData; 21 | 22 | class MAttributeExtensionPrivate 23 | { 24 | public: 25 | Q_DECLARE_PUBLIC(MAttributeExtension) 26 | MAttributeExtensionPrivate(); 27 | 28 | private: 29 | MAttributeExtensionId id; 30 | QSharedPointer keyOverrideData; 31 | 32 | MAttributeExtension *q_ptr; 33 | }; 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /src/maliit/plugins/extensionevent.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include 15 | #include 16 | 17 | MImExtensionEventPrivate::~MImExtensionEventPrivate() 18 | {} 19 | 20 | MImExtensionEvent::MImExtensionEvent(Type type) 21 | : d_ptr(new MImExtensionEventPrivate) 22 | { 23 | d_ptr->type = type; 24 | } 25 | 26 | MImExtensionEvent::MImExtensionEvent(MImExtensionEventPrivate *dd, 27 | Type type) 28 | : d_ptr(dd) 29 | { 30 | d_ptr->type = type; 31 | } 32 | 33 | MImExtensionEvent::~MImExtensionEvent() 34 | { 35 | Q_D(MImExtensionEvent); 36 | delete d; 37 | } 38 | 39 | MImExtensionEvent::Type MImExtensionEvent::type() const 40 | { 41 | Q_D(const MImExtensionEvent); 42 | return d->type; 43 | } 44 | -------------------------------------------------------------------------------- /src/maliit/plugins/extensionevent.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MIMEXTENSIONEVENT_H 15 | #define MIMEXTENSIONEVENT_H 16 | 17 | #include 18 | 19 | class MImExtensionEventPrivate; 20 | 21 | /*! \ingroup pluginapi 22 | * \brief Base class for extending signaling from input method system to 23 | * plugins. 24 | * 25 | * This event can be subclassed for future additions. 26 | * 27 | * \sa MAbstractInputMethod::imExtensionEvent(MImExtensionEvent *event) 28 | */ 29 | class MImExtensionEvent 30 | { 31 | public: 32 | //! Defines valid types for input method extension event 33 | enum Type { 34 | None, 35 | Update 36 | }; 37 | 38 | explicit MImExtensionEvent(Type type); 39 | virtual ~MImExtensionEvent(); 40 | 41 | //! Returns the type of the event 42 | Type type() const; 43 | 44 | protected: 45 | MImExtensionEvent(MImExtensionEventPrivate *dd, 46 | Type type); 47 | 48 | MImExtensionEventPrivate * const d_ptr; 49 | 50 | private: 51 | Q_DISABLE_COPY(MImExtensionEvent) 52 | Q_DECLARE_PRIVATE(MImExtensionEvent) 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/maliit/plugins/extensionevent_p.h: -------------------------------------------------------------------------------- 1 | #ifndef MIMEXTENSIONEVENT_P_H 2 | #define MIMEXTENSIONEVENT_P_H 3 | 4 | /* * This file is part of Maliit framework * 5 | * 6 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 7 | * All rights reserved. 8 | * 9 | * 10 | * This library is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License version 2.1 as published by the Free Software Foundation 13 | * and appearing in the file LICENSE.LGPL included in the packaging 14 | * of this file. 15 | */ 16 | 17 | #include 18 | 19 | class MImExtensionEventPrivate 20 | { 21 | public: 22 | virtual ~MImExtensionEventPrivate(); 23 | 24 | MImExtensionEvent::Type type; 25 | }; 26 | #endif // MIMEXTENSIONEVENT_P_H 27 | -------------------------------------------------------------------------------- /src/maliit/plugins/inputmethodplugin.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MINPUTMETHODPLUGIN_H 15 | #define MINPUTMETHODPLUGIN_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | class MAbstractInputMethod; 24 | class MAbstractInputMethodHost; 25 | 26 | namespace Maliit { 27 | namespace Plugins { 28 | 29 | /*! \ingroup pluginapi 30 | * \brief An interface class for all input method plugins. 31 | * 32 | * To create a virtual keyboard / input method plugin, re-implement the virtual 33 | * functions and instantiate the input method implementation in the 34 | * createInputMethod() method. Make sure your plugin links against the m im 35 | * framework library as well. 36 | */ 37 | class InputMethodPlugin 38 | { 39 | public: 40 | /*! \brief Implement this function to return the identifier for this input method. 41 | */ 42 | virtual QString name() const = 0; 43 | 44 | /*! \brief Creates and returns the MAbstractInputMethod object for 45 | * this plugin. This function will be only called once and the allocated 46 | * resources will be owned by the input method server. 47 | */ 48 | virtual MAbstractInputMethod *createInputMethod(MAbstractInputMethodHost *host) = 0; 49 | 50 | /*! 51 | * \brief Returns set of states which could be handled by this plugin. 52 | * 53 | * WARNING: If result is empty then this plugin will not be loaded 54 | * during startup. 55 | */ 56 | virtual QSet supportedStates() const = 0; 57 | }; 58 | 59 | } 60 | } 61 | 62 | QT_BEGIN_NAMESPACE 63 | Q_DECLARE_INTERFACE(Maliit::Plugins::InputMethodPlugin, 64 | "org.maliit.plugins.InputMethodPlugin/1.1") 65 | QT_END_NAMESPACE 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/maliit/plugins/keyoverride_p.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | 15 | #ifndef MKEYOVERRIDE_P_H 16 | #define MKEYOVERRIDE_P_H 17 | 18 | #include 19 | 20 | class MWidgetData; 21 | 22 | class MKeyOverridePrivate 23 | { 24 | Q_DISABLE_COPY(MKeyOverridePrivate) 25 | 26 | public: 27 | MKeyOverridePrivate(); 28 | 29 | void assign(const MKeyOverridePrivate &other); 30 | 31 | QString keyId; 32 | QString label; 33 | QString icon; 34 | bool highlighted; 35 | bool enabled; 36 | }; 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /src/maliit/plugins/keyoverridedata.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include 15 | 16 | #include 17 | 18 | namespace 19 | { 20 | inline bool keyOverrideLessThan(const QSharedPointer &k1, const QSharedPointer &k2) 21 | { 22 | return (k1->keyId() < k2->keyId()); 23 | }; 24 | } 25 | 26 | MKeyOverrideData::MKeyOverrideData() 27 | { 28 | } 29 | 30 | MKeyOverrideData::~MKeyOverrideData() 31 | { 32 | } 33 | 34 | QList > MKeyOverrideData::keyOverrides() const 35 | { 36 | QList > results = mKeyOverrides.values(); 37 | std::sort(results.begin(), results.end(), keyOverrideLessThan); 38 | return results; 39 | } 40 | 41 | bool MKeyOverrideData::createKeyOverride(const QString &keyId) 42 | { 43 | if (!mKeyOverrides.contains(keyId)) { 44 | QSharedPointer keyOverride; 45 | keyOverride = QSharedPointer(new MKeyOverride(keyId)); 46 | mKeyOverrides.insert(keyId, keyOverride); 47 | return true; 48 | } 49 | return false; 50 | } 51 | 52 | QSharedPointer MKeyOverrideData::keyOverride(const QString &keyId) const 53 | { 54 | return mKeyOverrides.value(keyId); 55 | } 56 | -------------------------------------------------------------------------------- /src/maliit/plugins/keyoverridedata.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | 15 | 16 | #ifndef MKEYOVERRIDEDATA_H 17 | #define MKEYOVERRIDEDATA_H 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | 27 | /*! \ingroup maliitserver 28 | * \brief Corresponds to the key overrides. 29 | */ 30 | class MKeyOverrideData : public QObject 31 | { 32 | Q_OBJECT 33 | Q_DISABLE_COPY(MKeyOverrideData) 34 | 35 | public: 36 | /*! 37 | * \brief Constructor 38 | */ 39 | MKeyOverrideData(); 40 | 41 | /*! 42 | * \brief Destructor 43 | */ 44 | ~MKeyOverrideData(); 45 | 46 | /* 47 | * \brief Return all key overrides in this key override data. 48 | * The returned list is sorted by key Id. 49 | */ 50 | QList > keyOverrides() const; 51 | 52 | //! Returns true if a new key override is created. 53 | bool createKeyOverride(const QString &keyId); 54 | 55 | //! Returns pointer to the key override for given \a keyId 56 | QSharedPointer keyOverride(const QString &keyId) const; 57 | 58 | protected: 59 | 60 | typedef QMap > KeyOverrides; 61 | KeyOverrides mKeyOverrides; 62 | 63 | friend class Ut_MKeyOverrideData; 64 | }; 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /src/maliit/plugins/plugindescription.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include 15 | #include 16 | 17 | //! \internal 18 | class MImPluginDescriptionPrivate 19 | { 20 | public: 21 | //! Construct new instance. 22 | //! \param plugin Reference to loaded plugin. 23 | MImPluginDescriptionPrivate(const Maliit::Plugins::InputMethodPlugin &plugin); 24 | 25 | public: 26 | //! Plugin name. 27 | QString pluginName; 28 | 29 | //! Contains true if this plugin is enabled onscreen plugin. 30 | bool enabled; 31 | }; 32 | //! \internal_end 33 | 34 | 35 | MImPluginDescriptionPrivate::MImPluginDescriptionPrivate(const Maliit::Plugins::InputMethodPlugin &plugin) 36 | : pluginName(plugin.name()), 37 | enabled(true) 38 | { 39 | } 40 | 41 | MImPluginDescription::MImPluginDescription(const Maliit::Plugins::InputMethodPlugin &plugin) 42 | : d_ptr(new MImPluginDescriptionPrivate(plugin)) 43 | { 44 | } 45 | 46 | MImPluginDescription::MImPluginDescription(const MImPluginDescription &other) 47 | : d_ptr(new MImPluginDescriptionPrivate(*other.d_ptr)) 48 | { 49 | } 50 | 51 | MImPluginDescription::~MImPluginDescription() 52 | { 53 | delete d_ptr; 54 | } 55 | 56 | void MImPluginDescription::operator=(const MImPluginDescription &other) 57 | { 58 | *d_ptr = *other.d_ptr; 59 | } 60 | 61 | QString MImPluginDescription::name() const 62 | { 63 | Q_D(const MImPluginDescription); 64 | 65 | return d->pluginName; 66 | } 67 | 68 | bool MImPluginDescription::enabled() const 69 | { 70 | Q_D(const MImPluginDescription); 71 | 72 | return d->enabled; 73 | } 74 | 75 | void MImPluginDescription::setEnabled(bool newEnabled) 76 | { 77 | Q_D(MImPluginDescription); 78 | 79 | d->enabled = newEnabled; 80 | } 81 | 82 | -------------------------------------------------------------------------------- /src/maliit/plugins/plugindescription.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | 15 | 16 | #ifndef MIMPLUGINDESCRIPTION_H 17 | #define MIMPLUGINDESCRIPTION_H 18 | 19 | #include 20 | 21 | class MImPluginDescriptionPrivate; 22 | namespace Maliit { 23 | namespace Plugins { 24 | class InputMethodPlugin; 25 | } 26 | } 27 | 28 | /*! \ingroup maliitserver 29 | * \brief Provides information about loaded input method plugin 30 | */ 31 | class MImPluginDescription 32 | { 33 | public: 34 | //! Copy constructor. 35 | MImPluginDescription(const MImPluginDescription &other); 36 | 37 | //! Destructor. 38 | virtual ~MImPluginDescription(); 39 | 40 | //! Assignment operator 41 | void operator=(const MImPluginDescription &other); 42 | 43 | //! Return plugin name. 44 | QString name() const; 45 | 46 | //! \brief Return true if this plugin is enabled by settings. 47 | bool enabled() const; 48 | 49 | private: 50 | //! Constructor 51 | //! \param plugin Reference to loaded plugin. 52 | explicit MImPluginDescription(const Maliit::Plugins::InputMethodPlugin &plugin); 53 | 54 | //! Set enabled state to given value. 55 | void setEnabled(bool newEnabled); 56 | 57 | Q_DECLARE_PRIVATE(MImPluginDescription) 58 | 59 | MImPluginDescriptionPrivate * const d_ptr; 60 | 61 | friend class MIMPluginManagerPrivate; 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/maliit/plugins/subviewdescription.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | //! \internal 4 | class MImSubViewDescriptionPrivate 5 | { 6 | public: 7 | //! Construct new instance. 8 | MImSubViewDescriptionPrivate(const QString &pluginId, 9 | const QString &subViewId, 10 | const QString &subViewTitle); 11 | 12 | friend bool operator==(const MImSubViewDescriptionPrivate &left, 13 | const MImSubViewDescriptionPrivate &right); 14 | 15 | public: 16 | //! Plugin ID. 17 | QString pluginId; 18 | 19 | //! Subview ID 20 | QString id; 21 | 22 | //! Subview title 23 | QString title; 24 | }; 25 | //! \internal_end 26 | 27 | 28 | MImSubViewDescriptionPrivate::MImSubViewDescriptionPrivate(const QString &pluginId, 29 | const QString &subViewId, 30 | const QString &subViewTitle) 31 | : pluginId(pluginId), 32 | id(subViewId), 33 | title(subViewTitle) 34 | { 35 | } 36 | 37 | bool operator==(const MImSubViewDescriptionPrivate &left, 38 | const MImSubViewDescriptionPrivate &right) 39 | { 40 | return (left.pluginId == right.pluginId && left.id == right.id && left.title == right.title); 41 | } 42 | 43 | MImSubViewDescription::MImSubViewDescription(const QString &pluginId, 44 | const QString &subViewId, 45 | const QString &subViewTitle) 46 | : d_ptr(new MImSubViewDescriptionPrivate(pluginId, subViewId, subViewTitle)) 47 | { 48 | } 49 | 50 | MImSubViewDescription::MImSubViewDescription(const MImSubViewDescription &other) 51 | : d_ptr(new MImSubViewDescriptionPrivate(*other.d_ptr)) 52 | { 53 | } 54 | 55 | MImSubViewDescription::~MImSubViewDescription() 56 | { 57 | delete d_ptr; 58 | } 59 | 60 | void MImSubViewDescription::operator=(const MImSubViewDescription &other) 61 | { 62 | *d_ptr = *other.d_ptr; 63 | } 64 | 65 | bool operator==(const MImSubViewDescription &left, const MImSubViewDescription &right) 66 | { 67 | return *left.d_ptr == *right.d_ptr; 68 | } 69 | 70 | QString MImSubViewDescription::pluginId() const 71 | { 72 | Q_D(const MImSubViewDescription); 73 | 74 | return d->pluginId; 75 | } 76 | 77 | QString MImSubViewDescription::id() const 78 | { 79 | Q_D(const MImSubViewDescription); 80 | 81 | return d->id; 82 | } 83 | 84 | QString MImSubViewDescription::title() const 85 | { 86 | Q_D(const MImSubViewDescription); 87 | 88 | return d->title; 89 | } 90 | -------------------------------------------------------------------------------- /src/maliit/plugins/subviewdescription.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MIMSUBVIEWDESCRIPTION_H 15 | #define MIMSUBVIEWDESCRIPTION_H 16 | 17 | #include 18 | 19 | class MImSubViewDescriptionPrivate; 20 | 21 | /*! \ingroup maliitserver 22 | * \brief Query the current subview properties. 23 | */ 24 | class MImSubViewDescription 25 | { 26 | public: 27 | //! Copy constructor. 28 | MImSubViewDescription(const MImSubViewDescription &other); 29 | 30 | //! Destructor. 31 | virtual ~MImSubViewDescription(); 32 | 33 | //! Assignment operator 34 | void operator=(const MImSubViewDescription &other); 35 | 36 | //! Returns true if \a left and \a right describe the same subview. 37 | friend bool operator==(const MImSubViewDescription &left, const MImSubViewDescription &right); 38 | 39 | //! Return plugin id. 40 | QString pluginId() const; 41 | 42 | //! Return subview id 43 | QString id() const; 44 | 45 | //! Return subview title 46 | QString title() const; 47 | 48 | private: 49 | //! Constructor 50 | //! \param plugin Reference to loaded plugin. 51 | explicit MImSubViewDescription(const QString &pluginId, 52 | const QString &subViewId, 53 | const QString &subViewTitle); 54 | 55 | Q_DECLARE_PRIVATE(MImSubViewDescription) 56 | 57 | MImSubViewDescriptionPrivate * const d_ptr; 58 | 59 | friend class MIMPluginManagerPrivate; 60 | }; 61 | 62 | #endif // MIMSUBVIEWDESCRIPTION_H 63 | -------------------------------------------------------------------------------- /src/maliit/plugins/updateevent_p.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MIMUPDATEEVENT_P_H 15 | #define MIMUPDATEEVENT_P_H 16 | 17 | #include 18 | 19 | #include 20 | 21 | class MImUpdateEventPrivate 22 | : public MImExtensionEventPrivate 23 | { 24 | public: 25 | QMap update; 26 | QStringList changedProperties; 27 | Qt::InputMethodHints lastHints; 28 | 29 | explicit MImUpdateEventPrivate(); 30 | 31 | explicit MImUpdateEventPrivate(const QMap &newUpdate, 32 | const QStringList &newChangedProperties, 33 | const Qt::InputMethodHints &newLastHints); 34 | 35 | bool isFlagSet(Qt::InputMethodHint hint, 36 | bool *changed = 0) const; 37 | 38 | QVariant extractProperty(const QString &key, 39 | bool *changed = 0) const; 40 | }; 41 | 42 | #endif // MIMUPDATEEVENT_P_H 43 | -------------------------------------------------------------------------------- /src/maliit/plugins/updatereceiver.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | // Choosing inheritance instead of typedef, as we might want to add 23 | // receiver-specific data later. 24 | class MImUpdateReceiverPrivate 25 | : public MImUpdateEventPrivate 26 | {}; 27 | 28 | MImUpdateReceiver::MImUpdateReceiver(QObject *parent) 29 | : QObject(parent) 30 | , d_ptr(new MImUpdateReceiverPrivate) 31 | {} 32 | 33 | MImUpdateReceiver::~MImUpdateReceiver() 34 | { 35 | // TODO: Find out why using QScopedPointer for the PIMPL fails to compile. 36 | delete d_ptr; 37 | } 38 | 39 | void MImUpdateReceiver::process(MImUpdateEvent *ev) 40 | { 41 | if (not ev) { 42 | return; 43 | } 44 | 45 | // TODO: Replace this ever-growing, switch-like structure with a more 46 | // concise solution, based on Qt reflection (via QMetaObject and Qt 47 | // properties). 48 | Q_D(MImUpdateReceiver); 49 | d->changedProperties = ev->d_func()->changedProperties; 50 | d->update = ev->d_func()->update; 51 | 52 | bool changed = false; 53 | bool value = ev->westernNumericInputEnforced(&changed); 54 | 55 | if (changed) { 56 | Q_EMIT westernNumericInputEnforcedChanged(value); 57 | } 58 | 59 | changed = false; 60 | value = ev->preferNumbers(&changed); 61 | 62 | if (changed) { 63 | Q_EMIT preferNumbersChanged(value); 64 | } 65 | 66 | changed = false; 67 | value = ev->translucentInputMethod(&changed); 68 | 69 | if (changed) { 70 | Q_EMIT translucentInputMethodChanged(value); 71 | } 72 | } 73 | 74 | bool MImUpdateReceiver::westernNumericInputEnforced() const 75 | { 76 | Q_D(const MImUpdateReceiver); 77 | return d->extractProperty(Maliit::InputMethodQuery::westernNumericInputEnforced).toBool(); 78 | } 79 | 80 | bool MImUpdateReceiver::preferNumbers() const 81 | { 82 | Q_D(const MImUpdateReceiver); 83 | return d->isFlagSet(Qt::ImhPreferNumbers); 84 | } 85 | 86 | bool MImUpdateReceiver::translucentInputMethod() const 87 | { 88 | Q_D(const MImUpdateReceiver); 89 | return d->extractProperty(Maliit::InputMethodQuery::translucentInputMethod).toBool(); 90 | } 91 | -------------------------------------------------------------------------------- /src/maliit/plugins/updatereceiver.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MIMUPDATERECEIVER_H 15 | #define MIMUPDATERECEIVER_H 16 | 17 | #include 18 | 19 | class MImUpdateReceiverPrivate; 20 | class MImUpdateEvent; 21 | 22 | /*! \ingroup pluginapi 23 | * \brief An example that turns data-polling from events into data-pushing via 24 | * properties and change notifications. 25 | * 26 | * Used in combination with MImUpdateEvents: The event is propagated down to 27 | * the final component, where it is then processed by an event receiver. The 28 | * receiver therefore acts as an endpoint for events, allowing the actual 29 | * consumers of input method properties to listen to property changes. Using 30 | * this approach, consumers are completely decoupled from the event propagation 31 | * itself. Event receivers implemented in plugins are supposed to be more 32 | * specialized than the generic MImUpdateReceiver. They can be designed to only 33 | * carry the properties that are required for a given endpoint. The life time 34 | * of event receivers usually exceeds the life time of events, which makes it 35 | * possible to keep signal connections between consumers and event receivers 36 | * alive. 37 | */ 38 | class MImUpdateReceiver 39 | : public QObject 40 | { 41 | Q_OBJECT 42 | Q_DISABLE_COPY(MImUpdateReceiver) 43 | Q_DECLARE_PRIVATE(MImUpdateReceiver) 44 | 45 | Q_PROPERTY(bool westernNumericInputEnforced 46 | READ westernNumericInputEnforced 47 | NOTIFY westernNumericInputEnforcedChanged) 48 | Q_PROPERTY(bool preferNumbers 49 | READ preferNumbers 50 | NOTIFY preferNumbersChanged) 51 | Q_PROPERTY(bool translucentInputMethod 52 | READ translucentInputMethod 53 | NOTIFY translucentInputMethodChanged) 54 | 55 | public: 56 | explicit MImUpdateReceiver(QObject *parent = 0); 57 | virtual ~MImUpdateReceiver(); 58 | 59 | void process(MImUpdateEvent *ev); 60 | 61 | bool westernNumericInputEnforced() const; 62 | bool preferNumbers() const; 63 | bool translucentInputMethod() const; 64 | 65 | Q_SIGNALS: 66 | void westernNumericInputEnforcedChanged(bool value); 67 | void preferNumbersChanged(bool value); 68 | void translucentInputMethodChanged(bool value); 69 | 70 | private: 71 | MImUpdateReceiverPrivate *const d_ptr; 72 | }; 73 | 74 | #endif // MIMUPDATERECEIVER_H 75 | -------------------------------------------------------------------------------- /src/maliit/standaloneinputmethod.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Jan Arne Petersen 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License version 2.1 as published by the Free Software Foundation 7 | * and appearing in the file LICENSE.LGPL included in the packaging 8 | * of this file. 9 | * 10 | */ 11 | 12 | #ifndef MALIIT_STANDALONEINPUTMETHOD_H 13 | #define MALIIT_STANDALONEINPUTMETHOD_H 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | 20 | class MAbstractInputMethod; 21 | class MInputContextConnection; 22 | 23 | namespace Maliit 24 | { 25 | class AbstractPlatform; 26 | class StandaloneInputMethodHost; 27 | class WindowGroup; 28 | 29 | namespace Plugins 30 | { 31 | class InputMethodPlugin; 32 | } 33 | 34 | class StandaloneInputMethod: public QObject 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | StandaloneInputMethod(Maliit::Plugins::InputMethodPlugin *plugin); 40 | ~StandaloneInputMethod(); 41 | 42 | private: 43 | void handleWidgetStateChanged(unsigned int clientId, 44 | const QMap &newState, 45 | const QMap &oldState, 46 | bool focusChanged); 47 | 48 | std::unique_ptr mConnection; 49 | QSharedPointer mPlatform; // TODO use std::unique_ptr instead 50 | std::unique_ptr mWindowGroup; 51 | std::unique_ptr mInputMethodHost; 52 | std::unique_ptr mInputMethod; 53 | }; 54 | 55 | std::unique_ptr createConnection(); 56 | 57 | } 58 | 59 | #endif //MALIIT_STANDALONEINPUTMETHOD_H 60 | -------------------------------------------------------------------------------- /src/mattributeextensionid.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | 15 | #include "mattributeextensionid.h" 16 | 17 | #include 18 | 19 | namespace { 20 | const int InvalidId = -1; 21 | const int StandardId = -2; 22 | } 23 | 24 | MAttributeExtensionId::MAttributeExtensionId() 25 | : m_id(InvalidId) 26 | { 27 | } 28 | 29 | MAttributeExtensionId::MAttributeExtensionId(int id, const QString &service) 30 | : m_id(id), 31 | m_service(service) 32 | { 33 | } 34 | 35 | MAttributeExtensionId MAttributeExtensionId::standardAttributeExtensionId() 36 | { 37 | return MAttributeExtensionId(StandardId, QString()); 38 | } 39 | 40 | bool MAttributeExtensionId::isValid() const 41 | { 42 | return m_id >= 0 && !m_service.isEmpty(); 43 | } 44 | 45 | bool MAttributeExtensionId::operator==(const MAttributeExtensionId &other) const 46 | { 47 | return (m_id == other.m_id) && (m_service == other.m_service); 48 | } 49 | 50 | bool MAttributeExtensionId::operator!=(const MAttributeExtensionId &other) const 51 | { 52 | return !operator==(other); 53 | } 54 | 55 | QString MAttributeExtensionId::service() const 56 | { 57 | return m_service; 58 | } 59 | 60 | int MAttributeExtensionId::id() const 61 | { 62 | return m_id; 63 | } 64 | 65 | uint qHash(const MAttributeExtensionId &id) 66 | { 67 | return qHash(QPair(id.m_id, id.m_service)); 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/mattributeextensionid.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | 15 | #ifndef MATTRIBUTEEXTENSIONID_H 16 | #define MATTRIBUTEEXTENSIONID_H 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | //! \internal 23 | /*! \ingroup maliitserver 24 | * \brief Contains global unique identifier for an attribute extension. 25 | * 26 | * Such identifiers are generated by MAttributeExtensionManager::generateId. 27 | */ 28 | class MAttributeExtensionId 29 | { 30 | public: 31 | //! Construct invalid identifier. 32 | MAttributeExtensionId(); 33 | 34 | //! Construct identifier with given application \a id and \a service name. 35 | MAttributeExtensionId(int id, const QString &service); 36 | 37 | //! Return identifier for standard attribute extension 38 | static MAttributeExtensionId standardAttributeExtensionId(); 39 | 40 | //! Return true if identifier is valid. 41 | bool isValid() const; 42 | 43 | //! Returns true if \a other is equal to this object 44 | bool operator==(const MAttributeExtensionId &other) const; 45 | 46 | //! Returns true if \a other is not equal to this object 47 | bool operator!=(const MAttributeExtensionId &other) const; 48 | 49 | //! \return service part of the ID, given to constructor 50 | QString service() const; 51 | 52 | //! Id given by application 53 | int id() const; 54 | 55 | private: 56 | //! Id given by application 57 | int m_id; 58 | 59 | //! Unique application identifier 60 | QString m_service; 61 | 62 | friend uint qHash(const MAttributeExtensionId &id); 63 | }; 64 | 65 | //! Returns hash value for given \a id 66 | uint qHash(const MAttributeExtensionId &id); 67 | 68 | //! \internal_end 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /src/mimhwkeyboardtracker.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | // This file is based on mkeyboardstatetracker.h from libmeegotouch 15 | 16 | #ifndef MIMKEYBOARDSTATETRACKER_H 17 | #define MIMKEYBOARDSTATETRACKER_H 18 | 19 | #include 20 | #include 21 | 22 | class MImHwKeyboardTrackerPrivate; 23 | 24 | //! \internal 25 | /*! \ingroup maliitserver 26 | * \brief Class responsible for tracking the hardware keyboard properties and 27 | * signaling events. 28 | * 29 | * Singleton class. Using isPresent() queries whether the device supports 30 | * hardware keyboard or not. If hardware keyboard is supported, using isOpen() 31 | * to query its current state. Signal stateChanged will be emitted when the 32 | * hardware keyboard state is changed. 33 | */ 34 | class MImHwKeyboardTracker 35 | : public QObject 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | MImHwKeyboardTracker(); 41 | virtual ~MImHwKeyboardTracker(); 42 | 43 | //! \brief Returns whether device has a hardware keyboard. 44 | bool isPresent() const; 45 | 46 | //! \brief Returns whether hardware keyboard is opened. 47 | bool isOpen() const; 48 | 49 | Q_SIGNALS: 50 | //! \brief Emitted whenever the hardware keyboard state changed. 51 | void stateChanged(); 52 | 53 | private: 54 | const QScopedPointer d_ptr; 55 | 56 | Q_DISABLE_COPY(MImHwKeyboardTracker) 57 | Q_DECLARE_PRIVATE(MImHwKeyboardTracker) 58 | }; 59 | //! \internal_end 60 | 61 | #endif // MIMKEYBOARDSTATETRACKER_H 62 | -------------------------------------------------------------------------------- /src/mimhwkeyboardtracker_p.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | // This file is based on mkeyboardstatetracker_p.h from libmeegotouch 15 | 16 | #ifndef MIMHWKEYBOARDTRACKER_P_H 17 | #define MIMHWKEYBOARDTRACKER_P_H 18 | 19 | #include 20 | 21 | class MImHwKeyboardTracker; 22 | 23 | class MImHwKeyboardTrackerPrivate 24 | : public QObject 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit MImHwKeyboardTrackerPrivate(MImHwKeyboardTracker *q_ptr); 30 | ~MImHwKeyboardTrackerPrivate(); 31 | 32 | void detectEvdev(); 33 | void tryEvdevDevice(const char *device); 34 | 35 | QFile *evdevFile; 36 | int evdevTabletModePending; 37 | bool evdevTabletMode; 38 | 39 | bool present; 40 | 41 | public Q_SLOTS: 42 | void evdevEvent(); 43 | 44 | Q_SIGNALS: 45 | void stateChanged(); 46 | }; 47 | 48 | 49 | #endif // MIMHWKEYBOARDTRACKER_P_H 50 | -------------------------------------------------------------------------------- /src/mimhwkeyboardtracker_stub.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Gianni Valdambrini 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License version 2.1 as published by the Free Software Foundation 8 | * and appearing in the file LICENSE.LGPL included in the packaging 9 | * of this file. 10 | */ 11 | 12 | 13 | #include "mimhwkeyboardtracker.h" 14 | 15 | 16 | class MImHwKeyboardTrackerPrivate 17 | : public QObject 18 | { 19 | public: 20 | explicit MImHwKeyboardTrackerPrivate(); 21 | }; 22 | 23 | 24 | MImHwKeyboardTrackerPrivate::MImHwKeyboardTrackerPrivate() 25 | { 26 | 27 | } 28 | 29 | 30 | MImHwKeyboardTracker::MImHwKeyboardTracker() 31 | : QObject(), 32 | d_ptr(new MImHwKeyboardTrackerPrivate) 33 | { 34 | } 35 | 36 | MImHwKeyboardTracker::~MImHwKeyboardTracker() 37 | { 38 | } 39 | 40 | bool MImHwKeyboardTracker::isPresent() const 41 | { 42 | return false; 43 | } 44 | 45 | bool MImHwKeyboardTracker::isOpen() const 46 | { 47 | return false; 48 | } 49 | -------------------------------------------------------------------------------- /src/mimonscreenplugins.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MIMONSCREENPLUGINS_H 15 | #define MIMONSCREENPLUGINS_H 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "mimsettings.h" 24 | 25 | /*! \ingroup maliitserver 26 | * \brief Check the current status of plugins for a subview. 27 | */ 28 | class MImOnScreenPlugins: public QObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | class SubView { 34 | public: 35 | QString plugin; 36 | QString id; 37 | 38 | explicit SubView(); 39 | explicit SubView(const QString &new_plugin, 40 | const QString &new_id = NULL); 41 | 42 | bool operator==(const SubView &other) const; 43 | }; 44 | 45 | explicit MImOnScreenPlugins(); 46 | 47 | bool isEnabled(const QString &plugin) const; 48 | QList enabledSubViews(const QString &plugin) const; 49 | QList enabledSubViews() const; 50 | 51 | bool isSubViewEnabled(const SubView &subview) const; 52 | void setEnabledSubViews(const QList &subViews); 53 | void setAutoEnabledSubViews(const QList &subViews); 54 | 55 | void updateAvailableSubViews(const QList &availableSubViews); 56 | bool isSubViewAvailable(const SubView &subview) const; 57 | bool isSubViewUnavailable(const SubView &subview) const; 58 | 59 | const SubView activeSubView(); 60 | void setActiveSubView(const SubView &subView); 61 | void setAutoActiveSubView(const SubView &subView); 62 | 63 | void setAllSubViewsEnabled(bool enable); 64 | 65 | Q_SIGNALS: 66 | void activeSubViewChanged(); 67 | 68 | void enabledPluginsChanged(); 69 | 70 | private Q_SLOTS: 71 | void updateEnabledSubviews(); 72 | void updateActiveSubview(); 73 | 74 | private: 75 | void autoDetectActiveSubView(); 76 | void autoDetectEnabledSubViews(); 77 | 78 | private: 79 | QList mAvailableSubViews; 80 | QList mEnabledSubViews; 81 | QList mLastEnabledSubViews; 82 | SubView mActiveSubView; 83 | 84 | MImSettings mEnabledSubViewsSettings; 85 | MImSettings mActiveSubViewSettings; 86 | 87 | QSet enabledPlugins; //should be updated when mEnabledSubViews is changed 88 | bool mAllSubviewsEnabled; 89 | 90 | }; 91 | 92 | Q_DECLARE_METATYPE(MImOnScreenPlugins::SubView) 93 | #endif // MIMENABLEDPLUGINS_H 94 | -------------------------------------------------------------------------------- /src/mimserver.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "mimserver.h" 15 | 16 | #include "mimpluginmanager.h" 17 | #include "mimsettings.h" 18 | #include "logging.h" 19 | 20 | class MImServerPrivate 21 | { 22 | public: 23 | explicit MImServerPrivate(); 24 | 25 | // Manager for loading and handling all plugins 26 | MIMPluginManager *pluginManager; 27 | 28 | // Connection to application side (input-context) 29 | QSharedPointer icConnection; 30 | 31 | private: 32 | Q_DISABLE_COPY(MImServerPrivate) 33 | }; 34 | 35 | MImServerPrivate::MImServerPrivate() 36 | {} 37 | 38 | MImServer::MImServer(const QSharedPointer &icConnection, 39 | const QSharedPointer &platform, 40 | QObject *parent) 41 | : QObject(parent) 42 | , d_ptr(new MImServerPrivate) 43 | { 44 | Q_D(MImServer); 45 | 46 | d->icConnection = icConnection; 47 | d->pluginManager = new MIMPluginManager(d->icConnection, platform); 48 | } 49 | 50 | MImServer::~MImServer() 51 | { 52 | } 53 | 54 | void MImServer::configureSettings(MImServer::SettingsType settingsType) 55 | { 56 | switch (settingsType) { 57 | 58 | case TemporarySettings: 59 | MImSettings::setPreferredSettingsType(MImSettings::TemporarySettings); 60 | break; 61 | 62 | case PersistentSettings: 63 | MImSettings::setPreferredSettingsType(MImSettings::PersistentSettings); 64 | break; 65 | 66 | default: 67 | qCCritical(lcMaliitFw) << Q_FUNC_INFO << "Invalid value for preferredSettingType." << settingsType; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/mimserver.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MIMSERVER_H 15 | #define MIMSERVER_H 16 | 17 | #include 18 | #include 19 | 20 | class MInputContextConnection; 21 | class MImServerPrivate; 22 | 23 | 24 | namespace Maliit 25 | { 26 | 27 | class AbstractPlatform; 28 | 29 | } // namespace Maliit 30 | 31 | /* MImServer: The Maliit Input Method Server 32 | * 33 | * Consumers of MImServer are responsible for creating a QApplication (for the mainloop), 34 | * and an MInputContextConnection for communication with clients, and for starting the mainloop. 35 | * Everything else is handled by the server. 36 | */ 37 | class MImServer : public QObject 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | enum SettingsType { 43 | TemporarySettings, 44 | PersistentSettings 45 | }; 46 | 47 | public: 48 | explicit MImServer(const QSharedPointer &icConnection, 49 | const QSharedPointer &platform, 50 | QObject *parent = 0); 51 | ~MImServer(); 52 | 53 | static void configureSettings(MImServer::SettingsType settingsType); 54 | 55 | private: 56 | Q_DISABLE_COPY(MImServer) 57 | Q_DECLARE_PRIVATE(MImServer) 58 | 59 | const QScopedPointer d_ptr; 60 | }; 61 | 62 | #endif // MIMSERVER_H 63 | -------------------------------------------------------------------------------- /src/mimserveroptions.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MIMSERVEROPTIONS_H 15 | #define MIMSERVEROPTIONS_H 16 | 17 | #include 18 | #include 19 | 20 | //! \internal 21 | 22 | /*! \brief Parse command line arguments and update values of members 23 | * of this class. 24 | * \param argc Amount of arguments. 25 | * \param argv Command line parameters. 26 | * \return true if all parameters were recognized by parser 27 | */ 28 | bool parseCommandLine(int argc, const char * const * argv); 29 | 30 | //! Display help message to the screen. 31 | void printHelpMessage(); 32 | 33 | struct MImServerConnectionOptions 34 | { 35 | public: 36 | MImServerConnectionOptions(); 37 | ~MImServerConnectionOptions(); 38 | 39 | //! Contains true if user asks for help or provided incorrect parameter 40 | bool allowAnonymous; 41 | QString overriddenAddress; 42 | }; 43 | 44 | 45 | struct MImServerCommonOptions 46 | { 47 | public: 48 | MImServerCommonOptions(); 49 | 50 | ~MImServerCommonOptions(); 51 | 52 | //! Contains true if user asks for help or provided incorrect parameter 53 | bool showHelp; 54 | }; 55 | 56 | //! \internal_end 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/mimsettingsqsettings.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2012 Mattia Barbon 4 | * Copyright (C) 2012 Canonical Ltd 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MIMSETTINGSQSETTINGS_H 15 | #define MIMSETTINGSQSETTINGS_H 16 | 17 | #include "mimsettings.h" 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | //! \internal 24 | 25 | struct MImSettingsQSettingsBackendPrivate; 26 | 27 | class MImSettingsQSettingsBackend : public MImSettingsBackend 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit MImSettingsQSettingsBackend(QSettings *settingsInstance, const QString &key, QObject *parent = 0); 33 | virtual ~MImSettingsQSettingsBackend(); 34 | 35 | virtual QString key() const; 36 | virtual QVariant value(const QVariant &def) const; 37 | virtual void set(const QVariant &val); 38 | virtual void unset(); 39 | virtual QList listDirs() const; 40 | virtual QList listEntries() const; 41 | 42 | private: 43 | QScopedPointer d_ptr; 44 | 45 | Q_DISABLE_COPY(MImSettingsQSettingsBackend) 46 | Q_DECLARE_PRIVATE(MImSettingsQSettingsBackend) 47 | }; 48 | 49 | 50 | //! \internal 51 | 52 | class MImSettingsQSettingsBackendFactory : public MImSettingsBackendFactory 53 | { 54 | public: 55 | explicit MImSettingsQSettingsBackendFactory(); 56 | explicit MImSettingsQSettingsBackendFactory(const QString &organization, 57 | const QString &application); 58 | virtual ~MImSettingsQSettingsBackendFactory(); 59 | virtual MImSettingsBackend *create(const QString &key, QObject *parent); 60 | 61 | private: 62 | QSettings mSettings; 63 | }; 64 | 65 | class MImSettingsQSettingsTemporaryBackendFactory : public MImSettingsBackendFactory 66 | { 67 | public: 68 | explicit MImSettingsQSettingsTemporaryBackendFactory(); 69 | virtual ~MImSettingsQSettingsTemporaryBackendFactory(); 70 | virtual MImSettingsBackend *create(const QString &key, QObject *parent); 71 | 72 | private: 73 | QTemporaryFile mTempFile; 74 | QScopedPointer mSettings; 75 | }; 76 | 77 | #endif // MIMSETTINGSQSETTINGS_H 78 | -------------------------------------------------------------------------------- /src/mimsubviewoverride.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "mimsubviewoverride.h" 15 | #include "mimonscreenplugins.h" 16 | 17 | MImSubViewOverride::MImSubViewOverride(MImOnScreenPlugins *plugins, 18 | QObject *parent) 19 | : QObject(parent) 20 | , mPlugins(plugins) 21 | {} 22 | 23 | MImSubViewOverride::~MImSubViewOverride() 24 | { 25 | // This will undo the effects of any other active attribute extension that 26 | // currently enabled all subviews! 27 | if (not mPlugins.isNull()) { 28 | mPlugins.data()->setAllSubViewsEnabled(false); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/mimsubviewoverride.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MIMSUBVIEWOVERRIDE_H 15 | #define MIMSUBVIEWOVERRIDE_H 16 | 17 | #include 18 | #include 19 | 20 | class MImOnScreenPlugins; 21 | 22 | //! \internal 23 | //! \ingroup maliitserver 24 | //! \brief A handle class for the enable-all-subviews override which disables the override upon destruction. 25 | class MImSubViewOverride 26 | : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit MImSubViewOverride(MImOnScreenPlugins *plugins, 32 | QObject *parent = 0); 33 | virtual ~MImSubViewOverride(); 34 | 35 | private: 36 | const QPointer mPlugins; 37 | }; 38 | 39 | #endif // MIMSUBVIEWOVERRIDE_H 40 | -------------------------------------------------------------------------------- /src/qt/plugins/shellintegration/inputpanelshell.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys":[ "inputpanel-shell" ] 3 | } -------------------------------------------------------------------------------- /src/qt/plugins/shellintegration/inputpanelshellplugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Jan Arne Petersen 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License version 2.1 as published by the Free Software Foundation 7 | * and appearing in the file LICENSE.LGPL included in the packaging 8 | * of this file. 9 | */ 10 | 11 | #include 12 | 13 | #include "qwaylandinputpanelshellintegration.h" 14 | 15 | QT_BEGIN_NAMESPACE 16 | 17 | namespace QtWaylandClient 18 | { 19 | 20 | class QWaylandInputPanelShellIntegrationPlugin: public QWaylandShellIntegrationPlugin 21 | { 22 | Q_OBJECT 23 | Q_PLUGIN_METADATA(IID QWaylandShellIntegrationFactoryInterface_iid FILE "inputpanelshell.json") 24 | 25 | public: 26 | virtual QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) override; 27 | }; 28 | 29 | QWaylandShellIntegration *QWaylandInputPanelShellIntegrationPlugin::create(const QString &key, const QStringList ¶mList) 30 | { 31 | Q_UNUSED(key); 32 | Q_UNUSED(paramList); 33 | return new QWaylandInputPanelShellIntegration(); 34 | } 35 | 36 | } 37 | 38 | QT_END_NAMESPACE 39 | 40 | #include "inputpanelshellplugin.moc" -------------------------------------------------------------------------------- /src/qt/plugins/shellintegration/qwaylandinputpanelshellintegration.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Jan Arne Petersen 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License version 2.1 as published by the Free Software Foundation 7 | * and appearing in the file LICENSE.LGPL included in the packaging 8 | * of this file. 9 | */ 10 | 11 | #include "qwaylandinputpanelshellintegration.h" 12 | 13 | #include 14 | 15 | #include "qwaylandinputpanelsurface.h" 16 | 17 | QT_BEGIN_NAMESPACE 18 | 19 | namespace QtWaylandClient 20 | { 21 | 22 | QWaylandInputPanelShellIntegration::QWaylandInputPanelShellIntegration() 23 | : QWaylandShellIntegration() 24 | { 25 | } 26 | 27 | QWaylandInputPanelShellIntegration::~QWaylandInputPanelShellIntegration() 28 | { 29 | } 30 | 31 | bool QWaylandInputPanelShellIntegration::initialize(QWaylandDisplay *display) 32 | { 33 | auto result = QWaylandShellIntegration::initialize(display); 34 | const auto globals = display->globals(); 35 | for (auto global: globals) { 36 | if (global.interface == QLatin1String("zwp_input_panel_v1")) { 37 | m_panel.reset(new QtWayland::zwp_input_panel_v1(display->wl_registry(), global.id, 1)); 38 | break; 39 | } 40 | } 41 | return result; 42 | } 43 | 44 | QWaylandShellSurface * 45 | QWaylandInputPanelShellIntegration::createShellSurface(QWaylandWindow *window) 46 | { 47 | struct zwp_input_panel_surface_v1 *ip_surface = m_panel->get_input_panel_surface(window->wlSurface()); 48 | 49 | return new QWaylandInputPanelSurface(ip_surface, window); 50 | } 51 | 52 | } 53 | 54 | QT_END_NAMESPACE -------------------------------------------------------------------------------- /src/qt/plugins/shellintegration/qwaylandinputpanelshellintegration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Jan Arne Petersen 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License version 2.1 as published by the Free Software Foundation 7 | * and appearing in the file LICENSE.LGPL included in the packaging 8 | * of this file. 9 | */ 10 | 11 | #ifndef QWAYLANDINPUTPANELSHELLINTEGRATION_H 12 | #define QWAYLANDINPUTPANELSHELLINTEGRATION_H 13 | 14 | #include 15 | 16 | #include "qwayland-input-method-unstable-v1.h" 17 | 18 | QT_BEGIN_NAMESPACE 19 | 20 | namespace QtWaylandClient 21 | { 22 | 23 | class QWaylandInputPanelShellIntegration: public QWaylandShellIntegration 24 | { 25 | public: 26 | QWaylandInputPanelShellIntegration(); 27 | ~QWaylandInputPanelShellIntegration() override; 28 | 29 | bool initialize(QWaylandDisplay *display) override; 30 | QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; 31 | 32 | private: 33 | QScopedPointer m_panel; 34 | }; 35 | 36 | } 37 | 38 | QT_END_NAMESPACE 39 | 40 | #endif //QWAYLANDINPUTPANELSHELLINTEGRATION_H 41 | -------------------------------------------------------------------------------- /src/qt/plugins/shellintegration/qwaylandinputpanelsurface.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Jan Arne Petersen 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License version 2.1 as published by the Free Software Foundation 7 | * and appearing in the file LICENSE.LGPL included in the packaging 8 | * of this file. 9 | */ 10 | 11 | #include "qwaylandinputpanelsurface.h" 12 | 13 | #include 14 | #include 15 | 16 | QT_BEGIN_NAMESPACE 17 | 18 | Q_LOGGING_CATEGORY(qLcQpaShellIntegration, "qt.qpa.wayland.shell") 19 | 20 | namespace QtWaylandClient 21 | { 22 | 23 | QWaylandInputPanelSurface::QWaylandInputPanelSurface(struct ::zwp_input_panel_surface_v1 *object, 24 | QWaylandWindow *window) 25 | : QWaylandShellSurface(window) 26 | , QtWayland::zwp_input_panel_surface_v1(object) 27 | { 28 | qCDebug(qLcQpaShellIntegration) << Q_FUNC_INFO; 29 | window->applyConfigureWhenPossible(); 30 | } 31 | 32 | QWaylandInputPanelSurface::~QWaylandInputPanelSurface() 33 | { 34 | qCDebug(qLcQpaShellIntegration) << Q_FUNC_INFO; 35 | } 36 | 37 | void QWaylandInputPanelSurface::applyConfigure() 38 | { 39 | set_toplevel(window()->waylandScreen()->output(), position_center_bottom); 40 | } 41 | 42 | } 43 | 44 | QT_END_NAMESPACE 45 | -------------------------------------------------------------------------------- /src/qt/plugins/shellintegration/qwaylandinputpanelsurface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Jan Arne Petersen 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License version 2.1 as published by the Free Software Foundation 7 | * and appearing in the file LICENSE.LGPL included in the packaging 8 | * of this file. 9 | */ 10 | 11 | #ifndef QWAYLANDINPUTPANELSURFACE_H 12 | #define QWAYLANDINPUTPANELSURFACE_H 13 | 14 | #include "qwayland-input-method-unstable-v1.h" 15 | 16 | #include 17 | #include 18 | 19 | QT_BEGIN_NAMESPACE 20 | 21 | Q_DECLARE_LOGGING_CATEGORY(qLcQpaShellIntegration) 22 | 23 | namespace QtWaylandClient 24 | { 25 | 26 | class QWaylandInputPanelSurface : public QWaylandShellSurface, public QtWayland::zwp_input_panel_surface_v1 27 | { 28 | public: 29 | QWaylandInputPanelSurface(struct ::zwp_input_panel_surface_v1 *object, QWaylandWindow *window); 30 | ~QWaylandInputPanelSurface() override; 31 | 32 | void applyConfigure() override; 33 | }; 34 | 35 | } 36 | 37 | QT_END_NAMESPACE 38 | 39 | #endif //QWAYLANDINPUTPANELSURFACE_H 40 | -------------------------------------------------------------------------------- /src/quick/inputmethodquickplugin.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "inputmethodquickplugin.h" 15 | #include "inputmethodquick.h" 16 | #include "maliitquick.h" 17 | #include "keyoverridequick.h" 18 | #include "abstractplatform.h" 19 | 20 | #include 21 | #include 22 | 23 | namespace Maliit 24 | { 25 | 26 | class InputMethodQuickPluginPrivate 27 | { 28 | public: 29 | QSharedPointer m_platform; 30 | const QString m_filename; 31 | const QString m_basename; 32 | QSet m_supported_states; 33 | 34 | InputMethodQuickPluginPrivate(const QString &filename, 35 | const QSharedPointer &platform) 36 | : m_platform (platform), 37 | m_filename(filename), 38 | m_basename(QFileInfo(filename).baseName()), 39 | m_supported_states() 40 | { 41 | m_supported_states << Maliit::OnScreen << Maliit::Hardware; 42 | } 43 | }; 44 | 45 | InputMethodQuickPlugin::InputMethodQuickPlugin(const QString &filename, 46 | const QSharedPointer &platform) 47 | : d_ptr(new InputMethodQuickPluginPrivate(filename, platform)) 48 | { 49 | qmlRegisterUncreatableType("com.meego.maliitquick", 1, 0, "Maliit", 50 | "This is the class used to export Maliit Enums"); 51 | 52 | // this do not have to be included to use it, but it have to be 53 | // registered. 54 | qmlRegisterUncreatableType 55 | ( "com.meego.maliitquick.keyoverridequick", 1, 0, "KeyOverrideQuick", 56 | "This registers KeyOverrideQuick" ); 57 | } 58 | 59 | InputMethodQuickPlugin::~InputMethodQuickPlugin() 60 | {} 61 | 62 | MAbstractInputMethod *InputMethodQuickPlugin::createInputMethod(MAbstractInputMethodHost *host) 63 | { 64 | Q_D(InputMethodQuickPlugin); 65 | 66 | return new InputMethodQuick(host, d->m_filename, d->m_platform); 67 | } 68 | 69 | QSet InputMethodQuickPlugin::supportedStates() const 70 | { 71 | Q_D(const InputMethodQuickPlugin); 72 | 73 | return d->m_supported_states; 74 | } 75 | 76 | QString InputMethodQuickPlugin::name() const 77 | { 78 | Q_D(const InputMethodQuickPlugin); 79 | 80 | return d->m_basename; 81 | } 82 | 83 | } // namespace Maliit 84 | -------------------------------------------------------------------------------- /src/quick/inputmethodquickplugin.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MALIIT_INPUT_METHOD_QUICK_PLUGIN_H 15 | #define MALIIT_INPUT_METHOD_QUICK_PLUGIN_H 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | namespace Maliit 25 | { 26 | 27 | class AbstractPlatform; 28 | class InputMethodQuickPluginPrivate; 29 | 30 | //! \brief Creates an input method plugin that allows to use QML. 31 | //! 32 | //! To create a QML-based virtual keyboard or input method plugin, just drop the 33 | //! QML file in plugin directory. If there are more QML files for the plugin 34 | //! then make sure to put them into some subdirectory or otherwise Maliit server 35 | //! will try to load them as well as separate plugins. 36 | //! The QML components can communicate with the framework through the 37 | //! Maliit::InputMethodQuick context. 38 | //! If the provided Maliit::InputMethodQuick class is not sufficient, then 39 | //! reimplement Maliit::InputMethodQuickPlugin::createInputMethodSettings as 40 | //! well and create a custom MAbstractInputMethod instance there. 41 | class InputMethodQuickPlugin 42 | : public Maliit::Plugins::InputMethodPlugin 43 | { 44 | public: 45 | InputMethodQuickPlugin(const QString &filename, 46 | const QSharedPointer &platform); 47 | virtual ~InputMethodQuickPlugin(); 48 | 49 | //! \reimp 50 | virtual MAbstractInputMethod *createInputMethod(MAbstractInputMethodHost *host); 51 | virtual QSet supportedStates() const; 52 | virtual QString name() const; 53 | //! \reimp_end 54 | 55 | private: 56 | Q_DISABLE_COPY(InputMethodQuickPlugin) 57 | Q_DECLARE_PRIVATE(InputMethodQuickPlugin) 58 | 59 | const QScopedPointer d_ptr; 60 | }; 61 | 62 | } // namespace Maliit 63 | 64 | #endif // MALIIT_INPUT_METHOD_QUICK_PLUGIN_H 65 | -------------------------------------------------------------------------------- /src/quick/keyoverridequick_p.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MALIIT_QUICK_KEY_OVERRIDE_P_H 15 | #define MALIIT_QUICK_KEY_OVERRIDE_P_H 16 | 17 | namespace Maliit 18 | { 19 | 20 | class KeyOverrideQuickPrivate 21 | { 22 | Q_DISABLE_COPY(KeyOverrideQuickPrivate) 23 | 24 | public: 25 | KeyOverrideQuickPrivate(const QString &label, 26 | const QString &icon, 27 | bool highlighted, 28 | bool enabled); 29 | 30 | QString actualLabel; 31 | QString actualIcon; 32 | bool actualHighlighted; 33 | bool actualEnabled; 34 | 35 | QString defaultLabel; 36 | QString defaultIcon; 37 | bool defaultHighlighted; 38 | bool defaultEnabled; 39 | 40 | bool labelIsOverriden; 41 | bool iconIsOverriden; 42 | bool highlightedIsOverriden; 43 | bool enabledIsOverriden; 44 | }; 45 | 46 | } // namespace Maliit 47 | 48 | #endif // MALIIT_QUICK_KEY_OVERRIDE_P_H 49 | -------------------------------------------------------------------------------- /src/quick/maliitquick.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef MALIIT_KEYBOARD_QUICK_H 15 | #define MALIIT_KEYBOARD_QUICK_H 16 | 17 | #include 18 | #include 19 | 20 | //! \brief MaliitQuick exposes Maliit enums to QML-based input methods 21 | class MaliitQuick: public QObject 22 | { 23 | Q_OBJECT 24 | Q_ENUMS(SwitchDirection) 25 | Q_ENUMS(ContentType) 26 | Q_ENUMS(KeyEvent) 27 | Q_ENUMS(PreeditFace) 28 | 29 | public: 30 | //! This enum defines direction of plugin switching 31 | enum SwitchDirection { 32 | SwitchUndefined = Maliit::SwitchUndefined, //!< Special value for uninitialized variables 33 | SwitchForward = Maliit::SwitchForward, //!< Activate next plugin 34 | SwitchBackward = Maliit::SwitchBackward //!< Activate previous plugin 35 | }; 36 | 37 | enum ContentType { 38 | FreeTextContentType = Maliit::FreeTextContentType, 39 | NumberContentType = Maliit::NumberContentType, 40 | PhoneNumberContentType = Maliit::PhoneNumberContentType, 41 | EmailContentType = Maliit::EmailContentType, 42 | UrlContentType = Maliit::UrlContentType, 43 | CustomContentType = Maliit::CustomContentType 44 | }; 45 | 46 | enum KeyEvent { 47 | KeyPress, 48 | KeyRelease, 49 | KeyClick 50 | }; 51 | 52 | enum PreeditFace { 53 | PreeditDefault = Maliit::PreeditDefault, 54 | PreeditNoCandidates = Maliit::PreeditNoCandidates, 55 | PreeditKeyPress = Maliit::PreeditKeyPress 56 | }; 57 | }; 58 | 59 | #endif // MALIIT_KEYBOARD_QUICK_H 60 | -------------------------------------------------------------------------------- /src/unknownplatform.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Openismus GmbH 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #include "unknownplatform.h" 14 | 15 | namespace Maliit 16 | { 17 | 18 | void UnknownPlatform::setupInputPanel(QWindow* window, 19 | Maliit::Position position) 20 | { 21 | Q_UNUSED(window); 22 | Q_UNUSED(position); 23 | // nothing to do. 24 | } 25 | 26 | void UnknownPlatform::setInputRegion(QWindow* window, 27 | const QRegion& region) 28 | { 29 | Q_UNUSED(window); 30 | Q_UNUSED(region); 31 | // nothing to do. 32 | } 33 | 34 | } // namespace Maliit 35 | -------------------------------------------------------------------------------- /src/unknownplatform.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Openismus GmbH 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #ifndef MALIIT_UNKNOWN_PLATFORM_H 14 | #define MALIIT_UNKNOWN_PLATFORM_H 15 | 16 | #include "abstractplatform.h" 17 | 18 | namespace Maliit 19 | { 20 | 21 | class UnknownPlatform : public AbstractPlatform 22 | { 23 | public: 24 | virtual void setupInputPanel(QWindow* window, 25 | Maliit::Position position); 26 | virtual void setInputRegion(QWindow* window, 27 | const QRegion& region); 28 | }; 29 | 30 | } // namespace Maliit 31 | 32 | #endif // MALIIT_UNKNOWN_PLATFORM_H 33 | -------------------------------------------------------------------------------- /src/waylandplatform.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Openismus GmbH 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | #include "waylandplatform.h" 19 | #include "windowdata.h" 20 | 21 | namespace Maliit 22 | { 23 | 24 | class WaylandPlatformPrivate 25 | { 26 | public: 27 | WaylandPlatformPrivate() = default; 28 | ~WaylandPlatformPrivate() = default; 29 | }; 30 | 31 | WaylandPlatform::WaylandPlatform() 32 | : d_ptr(new WaylandPlatformPrivate) 33 | {} 34 | 35 | void WaylandPlatform::setupInputPanel(QWindow* window, 36 | Maliit::Position position) 37 | { 38 | Q_UNUSED(window) 39 | Q_UNUSED(position) 40 | } 41 | 42 | void WaylandPlatform::setInputRegion(QWindow* window, 43 | const QRegion& region) 44 | { 45 | if (not window) { 46 | return; 47 | } 48 | 49 | window->setMask(region); 50 | } 51 | 52 | WaylandPlatform::~WaylandPlatform() 53 | { 54 | 55 | } 56 | 57 | } // namespace Maliit 58 | -------------------------------------------------------------------------------- /src/waylandplatform.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Openismus GmbH 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #ifndef MALIIT_WAYLAND_PLATFORM_H 14 | #define MALIIT_WAYLAND_PLATFORM_H 15 | 16 | #include 17 | 18 | #include "abstractplatform.h" 19 | 20 | namespace Maliit 21 | { 22 | 23 | class WaylandPlatformPrivate; 24 | 25 | class WaylandPlatform : public AbstractPlatform 26 | { 27 | Q_DECLARE_PRIVATE(WaylandPlatform) 28 | 29 | public: 30 | WaylandPlatform(); 31 | ~WaylandPlatform(); 32 | 33 | virtual void setupInputPanel(QWindow* window, 34 | Maliit::Position position); 35 | virtual void setInputRegion(QWindow* window, 36 | const QRegion& region); 37 | 38 | private: 39 | QScopedPointer d_ptr; 40 | }; 41 | 42 | } // namespace Maliit 43 | 44 | #endif // MALIIT_WAYLAND_PLATFORM_H 45 | -------------------------------------------------------------------------------- /src/windowdata.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Openismus GmbH 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #include "windowdata.h" 14 | 15 | namespace Maliit 16 | { 17 | 18 | WindowData::WindowData() 19 | : m_window(), 20 | m_position(Maliit::PositionCenterBottom) 21 | {} 22 | 23 | WindowData::WindowData(QWindow *window, Maliit::Position position) 24 | : m_window(window), 25 | m_position(position) 26 | {} 27 | 28 | } // namespace Maliit 29 | -------------------------------------------------------------------------------- /src/windowdata.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Openismus GmbH 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #ifndef MALIIT_WINDOW_DATA_H 14 | #define MALIIT_WINDOW_DATA_H 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | namespace Maliit 23 | { 24 | 25 | struct WindowData 26 | { 27 | // apparently QVector::append() needs it... 28 | WindowData(); 29 | WindowData(QWindow *window, Maliit::Position position); 30 | 31 | QPointer m_window; 32 | Maliit::Position m_position; 33 | QRegion m_inputMethodArea; 34 | }; 35 | 36 | } // namespace Maliit 37 | 38 | #endif // MALIIT_WINDOW_DATA_H 39 | -------------------------------------------------------------------------------- /src/windowgroup.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Openismus GmbH 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #ifndef MALIIT_SERVER_WINDOW_GROUP_H 14 | #define MALIIT_SERVER_WINDOW_GROUP_H 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "windowdata.h" 24 | 25 | #include 26 | 27 | QT_BEGIN_NAMESPACE 28 | class QWindow; 29 | QT_END_NAMESPACE 30 | 31 | namespace Maliit 32 | { 33 | 34 | class AbstractPlatform; 35 | class WindowGroupPrivate; 36 | 37 | class WindowGroup : public QObject 38 | { 39 | Q_OBJECT 40 | Q_DECLARE_PRIVATE(WindowGroup) 41 | 42 | public: 43 | enum HideMode { 44 | HideImmediate, 45 | HideDelayed 46 | }; 47 | 48 | WindowGroup(const QSharedPointer &platform); 49 | ~WindowGroup(); 50 | 51 | void activate(); 52 | void deactivate(HideMode mode); 53 | 54 | void setupWindow(QWindow *window, Maliit::Position position); 55 | void setScreenRegion(const QRegion ®ion, QWindow *window); 56 | void setInputMethodArea(const QRegion ®ion, QWindow *window); 57 | void setApplicationWindow(WId id); 58 | 59 | Q_SIGNALS: 60 | void inputMethodAreaChanged(const QRegion &inputMethodArea); 61 | 62 | private Q_SLOTS: 63 | void hideWindows(); 64 | void onVisibleChanged(bool visible); 65 | void updateInputMethodArea(); 66 | 67 | private: 68 | bool containsWindow(QWindow *window); 69 | 70 | QSharedPointer m_platform; 71 | QVector m_window_list; 72 | QRegion m_last_im_area; 73 | bool m_active; 74 | QTimer m_hideTimer; 75 | }; 76 | 77 | } // namespace Maliit 78 | 79 | #endif // MALIIT_SERVER_WINDOW_GROUP_H 80 | -------------------------------------------------------------------------------- /src/xcbplatform.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2013 Openismus GmbH 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #ifndef MALIIT_XCB_PLATFORM_H 14 | #define MALIIT_XCB_PLATFORM_H 15 | 16 | #include "abstractplatform.h" 17 | 18 | namespace Maliit 19 | { 20 | 21 | class XCBPlatform : public AbstractPlatform 22 | { 23 | public: 24 | virtual void setupInputPanel(QWindow* window, 25 | Maliit::Position position); 26 | virtual void setInputRegion(QWindow* window, 27 | const QRegion& region); 28 | virtual void setApplicationWindow(QWindow *window, WId appWindowId); 29 | }; 30 | 31 | } // namespace Maliit 32 | 33 | #endif // MALIIT_XCB_PLATFORM_H 34 | -------------------------------------------------------------------------------- /tests/dummyimplugin/dummyimplugin.cpp: -------------------------------------------------------------------------------- 1 | #include "dummyimplugin.h" 2 | #include "dummyinputmethod.h" 3 | 4 | #include 5 | 6 | 7 | DummyImPlugin::DummyImPlugin() 8 | { 9 | allowedStates << Maliit::OnScreen << Maliit::Hardware << Maliit::Accessory; 10 | } 11 | 12 | QString DummyImPlugin::name() const 13 | { 14 | return "DummyImPlugin"; 15 | } 16 | 17 | MAbstractInputMethod * 18 | DummyImPlugin::createInputMethod(MAbstractInputMethodHost *host) 19 | { 20 | return new DummyInputMethod(host); 21 | } 22 | 23 | QSet DummyImPlugin::supportedStates() const 24 | { 25 | return allowedStates; 26 | } 27 | -------------------------------------------------------------------------------- /tests/dummyimplugin/dummyimplugin.h: -------------------------------------------------------------------------------- 1 | #ifndef DUMMYIMPLUGIN_H 2 | #define DUMMYIMPLUGIN_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | //! Dummy input method plugin for ut_mimpluginloader 10 | class DummyImPlugin: public QObject, 11 | public Maliit::Plugins::InputMethodPlugin 12 | { 13 | Q_OBJECT 14 | Q_INTERFACES(Maliit::Plugins::InputMethodPlugin) 15 | Q_PLUGIN_METADATA(IID "org.maliit.tests.dummyimplugin" 16 | FILE "dummyimplugin.json") 17 | 18 | public: 19 | DummyImPlugin(); 20 | 21 | //! \reimp 22 | virtual QString name() const; 23 | 24 | virtual MAbstractInputMethod *createInputMethod(MAbstractInputMethodHost *host); 25 | 26 | virtual QSet supportedStates() const; 27 | //! \reimp_end 28 | 29 | public: 30 | QSet allowedStates; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /tests/dummyimplugin/dummyimplugin.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/tests/dummyimplugin/dummyimplugin.json -------------------------------------------------------------------------------- /tests/dummyimplugin/dummyinputmethod.h: -------------------------------------------------------------------------------- 1 | #ifndef DUMMYINPUTMETHOD_H 2 | #define DUMMYINPUTMETHOD_H 3 | 4 | #include 5 | #include 6 | 7 | class DummyInputMethod : public MAbstractInputMethod 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | 13 | DummyInputMethod(MAbstractInputMethodHost *host); 14 | 15 | //! \reimp 16 | virtual void setState(const QSet &state); 17 | virtual void switchContext(Maliit::SwitchDirection direction, 18 | bool enableAnimation); 19 | virtual QList subViews(Maliit::HandlerState state 20 | = Maliit::OnScreen) const; 21 | virtual void setActiveSubView(const QString &, 22 | Maliit::HandlerState state = Maliit::OnScreen); 23 | virtual QString activeSubView(Maliit::HandlerState state = Maliit::OnScreen) const; 24 | //! \reimp_end 25 | 26 | public: 27 | int setStateCount; 28 | QSet setStateParam; 29 | 30 | int switchContextCallCount; 31 | Maliit::SwitchDirection directionParam; 32 | bool enableAnimationParam; 33 | 34 | int pluginsChangedSignalCount; 35 | 36 | public Q_SLOTS: 37 | void switchMe(); 38 | void switchMe(const QString &name); 39 | 40 | private Q_SLOTS: 41 | void onPluginsChange(); 42 | 43 | private: 44 | QList sViews; 45 | QString activeSView; 46 | }; 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /tests/dummyimplugin2/dummyimplugin2.cpp: -------------------------------------------------------------------------------- 1 | #include "dummyimplugin2.h" 2 | 3 | #include 4 | 5 | 6 | QString DummyImPlugin2::name() const 7 | { 8 | return "DummyImPlugin2"; 9 | } 10 | 11 | MAbstractInputMethod * 12 | DummyImPlugin2::createInputMethod(MAbstractInputMethodHost *) 13 | { 14 | return 0; 15 | } 16 | 17 | QSet DummyImPlugin2::supportedStates() const 18 | { 19 | QSet result; 20 | 21 | result << Maliit::OnScreen << Maliit::Hardware << Maliit::Accessory; 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/dummyimplugin2/dummyimplugin2.h: -------------------------------------------------------------------------------- 1 | #ifndef DUMMYIMPLUGIN2_H 2 | #define DUMMYIMPLUGIN2_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | //! Dummy input method plugin for ut_mimpluginloader 9 | class DummyImPlugin2: public QObject, 10 | public Maliit::Plugins::InputMethodPlugin 11 | { 12 | Q_OBJECT 13 | Q_INTERFACES(Maliit::Plugins::InputMethodPlugin) 14 | Q_PLUGIN_METADATA(IID "org.maliit.tests.dummyimplugin2" 15 | FILE "dummyimplugin2.json") 16 | 17 | public: 18 | //! \reimp 19 | virtual QString name() const; 20 | 21 | virtual MAbstractInputMethod *createInputMethod(MAbstractInputMethodHost *host); 22 | 23 | virtual QSet supportedStates() const; 24 | //! \reimp_end 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /tests/dummyimplugin2/dummyimplugin2.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/tests/dummyimplugin2/dummyimplugin2.json -------------------------------------------------------------------------------- /tests/dummyimplugin3/dummyimplugin3.cpp: -------------------------------------------------------------------------------- 1 | #include "dummyimplugin3.h" 2 | #include "dummyinputmethod3.h" 3 | 4 | #include 5 | 6 | 7 | DummyImPlugin3::DummyImPlugin3() 8 | : setStateCount(0) 9 | { 10 | allowedStates << Maliit::OnScreen << Maliit::Hardware << Maliit::Accessory; 11 | } 12 | 13 | QString DummyImPlugin3::name() const 14 | { 15 | return "DummyImPlugin3"; 16 | } 17 | 18 | MAbstractInputMethod * 19 | DummyImPlugin3::createInputMethod(MAbstractInputMethodHost *host) 20 | { 21 | return new DummyInputMethod3(host); 22 | } 23 | 24 | QSet DummyImPlugin3::supportedStates() const 25 | { 26 | return allowedStates; 27 | } 28 | -------------------------------------------------------------------------------- /tests/dummyimplugin3/dummyimplugin3.h: -------------------------------------------------------------------------------- 1 | #ifndef DUMMYIMPLUGIN3_H 2 | #define DUMMYIMPLUGIN3_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | //! Dummy input method plugin for ut_mimpluginloader 9 | class DummyImPlugin3: public QObject, 10 | public Maliit::Plugins::InputMethodPlugin 11 | { 12 | Q_OBJECT 13 | Q_INTERFACES(Maliit::Plugins::InputMethodPlugin) 14 | Q_PLUGIN_METADATA(IID "org.maliit.tests.dummyimplugin3" 15 | FILE "dummyimplugin3.json") 16 | 17 | public: 18 | DummyImPlugin3(); 19 | 20 | //! \reimp 21 | virtual QString name() const; 22 | 23 | virtual MAbstractInputMethod *createInputMethod(MAbstractInputMethodHost *host); 24 | 25 | virtual QSet supportedStates() const; 26 | //! \reimp_end 27 | 28 | public: 29 | int setStateCount; 30 | QList setStateParam; 31 | QSet allowedStates; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /tests/dummyimplugin3/dummyimplugin3.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/tests/dummyimplugin3/dummyimplugin3.json -------------------------------------------------------------------------------- /tests/dummyimplugin3/dummyinputmethod3.h: -------------------------------------------------------------------------------- 1 | #ifndef DUMMYINPUTMETHOD3_H 2 | #define DUMMYINPUTMETHOD3_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class DummyInputMethod3 : public MAbstractInputMethod 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | 14 | DummyInputMethod3(MAbstractInputMethodHost *host); 15 | 16 | //! \reimp 17 | virtual void setState(const QSet &state); 18 | virtual void switchContext(Maliit::SwitchDirection direction, bool enableAnimation); 19 | virtual QList subViews(Maliit::HandlerState state 20 | = Maliit::OnScreen) const; 21 | virtual void setActiveSubView(const QString &, 22 | Maliit::HandlerState state = Maliit::OnScreen); 23 | virtual QString activeSubView(Maliit::HandlerState state = Maliit::OnScreen) const; 24 | virtual void show(); 25 | //! \reimp_end 26 | 27 | public: 28 | int setStateCount; 29 | QSet setStateParam; 30 | 31 | int switchContextCallCount; 32 | Maliit::SwitchDirection directionParam; 33 | bool enableAnimationParam; 34 | 35 | QVariant localSettingValue; 36 | QScopedPointer setting; 37 | 38 | Q_SIGNALS: 39 | void showCalled(); 40 | 41 | private: 42 | Q_SLOT void handleSettingChanged(); 43 | 44 | void addSubView(const QString &id, const QString &title); 45 | 46 | QList sViews; 47 | QString activeSView; 48 | }; 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /tests/dummyplugin/dummyplugin.cpp: -------------------------------------------------------------------------------- 1 | #include "dummyplugin.h" 2 | 3 | #include 4 | 5 | 6 | QString DummyPlugin::name() 7 | { 8 | return "DummyPlugin"; 9 | } 10 | -------------------------------------------------------------------------------- /tests/dummyplugin/dummyplugin.h: -------------------------------------------------------------------------------- 1 | #ifndef DUMMYPLUGIN_H 2 | #define DUMMYPLUGIN_H 3 | 4 | #include 5 | 6 | class DummyPluginInterface 7 | { 8 | public: 9 | virtual QString name() = 0; 10 | }; 11 | 12 | Q_DECLARE_INTERFACE(DummyPluginInterface, 13 | "DummyPluginInterface/1.0") 14 | 15 | 16 | //! Dummy plugin class for ut_mimpluginloader 17 | class DummyPlugin: public QObject, 18 | public DummyPluginInterface 19 | { 20 | Q_OBJECT 21 | Q_INTERFACES(DummyPluginInterface) 22 | Q_PLUGIN_METADATA(IID "org.maliit.tests.dummyplugin" 23 | FILE "dummyplugin.json") 24 | 25 | public: 26 | virtual QString name(); 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /tests/dummyplugin/dummyplugin.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliit/framework/ba6f7eda338a913f2c339eada3f0382e04f7dd67/tests/dummyplugin/dummyplugin.json -------------------------------------------------------------------------------- /tests/ft_exampleplugin/.gitignore: -------------------------------------------------------------------------------- 1 | ft_exampleplugin 2 | -------------------------------------------------------------------------------- /tests/ft_exampleplugin/ft_exampleplugin.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "ft_exampleplugin.h" 15 | #include "core-utils.h" 16 | #include "gui-utils.h" 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | class MIndicatorServiceClient 26 | {}; 27 | 28 | void Ft_ExamplePlugin::initTestCase() 29 | { 30 | } 31 | 32 | void Ft_ExamplePlugin::cleanupTestCase() 33 | { 34 | } 35 | 36 | void Ft_ExamplePlugin::init() 37 | {} 38 | 39 | void Ft_ExamplePlugin::cleanup() 40 | {} 41 | 42 | 43 | void Ft_ExamplePlugin::testFunction_data() 44 | { 45 | QTest::addColumn("testPluginPath"); 46 | // QTest::newRow("Hello world") 47 | // << "helloworld/libcxxhelloworldplugin.so"; 48 | // QTest::newRow("Override") 49 | // << "override/libcxxoverrideplugin.so"; 50 | } 51 | 52 | void Ft_ExamplePlugin::testFunction() 53 | { 54 | QSKIP("Currently there are no example plugins to test"); 55 | QFETCH(QString, testPluginPath); 56 | 57 | const QDir pluginDir = MaliitTestUtils::isTestingInSandbox() ? 58 | QDir(IN_TREE_TEST_PLUGIN_DIR"/cxx") : QDir(MALIIT_TEST_PLUGINS_DIR"/examples/cxx"); 59 | const QString pluginPath = pluginDir.absoluteFilePath(testPluginPath); 60 | const QString pluginId = QFileInfo(testPluginPath).baseName(); 61 | QVERIFY(pluginDir.exists(pluginPath)); 62 | 63 | QPluginLoader loader(pluginPath); 64 | QObject *pluginInstance = loader.instance(); 65 | QVERIFY(pluginInstance != 0); 66 | 67 | Maliit::Plugins::InputMethodPlugin *plugin = qobject_cast(pluginInstance); 68 | QVERIFY(plugin != 0); 69 | 70 | MaliitTestUtils::TestInputMethodHost host(pluginId, plugin->name()); 71 | plugin->createInputMethod(&host); 72 | 73 | QCOMPARE(host.lastCommit, QString("Maliit")); 74 | QCOMPARE(host.sendCommitCount, 1); 75 | QCOMPARE(host.lastPreedit, QString("Mali")); 76 | QCOMPARE(host.sendPreeditCount, 1); 77 | } 78 | 79 | QTEST_MAIN(Ft_ExamplePlugin) 80 | -------------------------------------------------------------------------------- /tests/ft_exampleplugin/ft_exampleplugin.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef FT_EXAMPLEPLUGIN_H 15 | #define FT_EXAMPLEPLUGIN_H 16 | 17 | #include 18 | #include 19 | 20 | class Ft_ExamplePlugin 21 | : public QObject 22 | { 23 | Q_OBJECT 24 | 25 | private Q_SLOTS: 26 | void initTestCase(); 27 | void cleanupTestCase(); 28 | 29 | void init(); 30 | void cleanup(); 31 | 32 | void testFunction_data(); 33 | void testFunction(); 34 | }; 35 | 36 | #endif // FT_EXAMPLEPLUGIN_H 37 | -------------------------------------------------------------------------------- /tests/ft_mimpluginmanager/.gitignore: -------------------------------------------------------------------------------- 1 | ft_mimpluginmanager 2 | -------------------------------------------------------------------------------- /tests/ft_mimpluginmanager/ft_mimpluginmanager.h: -------------------------------------------------------------------------------- 1 | #ifndef FT_MIMPLUGINLOADER_H 2 | #define FT_MIMPLUGINLOADER_H 3 | 4 | #include 5 | #include 6 | 7 | class MIMPluginManager; 8 | QT_BEGIN_NAMESPACE 9 | class QGraphicsScene; 10 | QT_END_NAMESPACE 11 | 12 | class Ft_MIMPluginManager : public QObject 13 | { 14 | Q_OBJECT 15 | 16 | private Q_SLOTS: 17 | void initTestCase(); 18 | void cleanupTestCase(); 19 | 20 | void init(); 21 | void cleanup(); 22 | 23 | void testLoadPlugins(); 24 | void testSwitchPluginState(); 25 | void testMultiplePlugins(); 26 | void testSwitchPluginBySignal(); 27 | void testSwitchToSpecifiedPlugin(); 28 | void testPluginDescriptions(); 29 | void testPluginSetting(); 30 | 31 | private: 32 | MIMPluginManager *subject; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /tests/qmlplugin/helloworld.qml: -------------------------------------------------------------------------------- 1 | /* * This file is part of meego-im-framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * Contact: Nokia Corporation (directui@nokia.com) 6 | * 7 | * If you have questions regarding the use of this file, please contact 8 | * Nokia at directui@nokia.com. 9 | * 10 | * This library is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License version 2.1 as published by the Free Software Foundation 13 | * and appearing in the file LICENSE.LGPL included in the packaging 14 | * of this file. 15 | */ 16 | 17 | import QtQuick 2.0 18 | 19 | Rectangle { 20 | id: canvas 21 | width: MInputMethodQuick.screenWidth 22 | height: MInputMethodQuick.screenHeight 23 | color: "transparent" 24 | 25 | Rectangle { 26 | id: imArea 27 | width: MInputMethodQuick.screenWidth 28 | height: MInputMethodQuick.screenHeight * 0.5 29 | radius: 10 30 | color: "grey" 31 | border.color: "black" 32 | border.width: 10 33 | anchors.bottom: parent.bottom 34 | anchors.horizontalCenter: parent.horizontalCenter 35 | 36 | Text { 37 | id: buttonText 38 | text: "Hello World!" 39 | anchors.centerIn: parent 40 | } 41 | 42 | MouseArea { 43 | anchors.fill: parent 44 | onClicked: MInputMethodQuick.sendCommit(buttonText.text) 45 | } 46 | } 47 | 48 | Component.onCompleted: { 49 | MInputMethodQuick.setInputMethodArea(Qt.rect(0, MInputMethodQuick.screenHeight - imArea.height, 50 | imArea.width, imArea.height)) 51 | MInputMethodQuick.sendCommit("Maliit") 52 | MInputMethodQuick.sendPreedit("Maliit") 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /tests/sanitychecks/.gitignore: -------------------------------------------------------------------------------- 1 | sanitychecks 2 | -------------------------------------------------------------------------------- /tests/sanitychecks/sanitychecks.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "sanitychecks.h" 15 | 16 | #include "core-utils.h" 17 | 18 | void DeferredSignalEmitter::emitSignal() 19 | { 20 | Q_EMIT deferredSignal(); 21 | } 22 | 23 | void SanityChecks::initTestCase() 24 | { 25 | } 26 | 27 | void SanityChecks::cleanupTestCase() 28 | { 29 | } 30 | 31 | void SanityChecks::init() 32 | { 33 | } 34 | 35 | void SanityChecks::cleanup() 36 | { 37 | } 38 | 39 | /* Verify that it is possible for asyncronous work to happen using the Qt eventloop: 40 | * A callback registered with QTimer:singleShot should be called from the 41 | * event loop when creating a QEventloop and executing it. */ 42 | void SanityChecks::testAsyncronousCallbacks() 43 | { 44 | DeferredSignalEmitter emitter; 45 | QSignalSpy signalSpy(&emitter, SIGNAL(deferredSignal())); 46 | 47 | QTimer::singleShot(0, &emitter, SLOT(emitSignal())); 48 | QCOMPARE(signalSpy.count(), 0); 49 | 50 | // Utilty function that executes a QEventLoop 51 | MaliitTestUtils::waitForSignal(&emitter, SIGNAL(deferredSignal()), 1000); 52 | QCOMPARE(signalSpy.count(), 1); 53 | } 54 | 55 | QTEST_MAIN(SanityChecks) 56 | -------------------------------------------------------------------------------- /tests/sanitychecks/sanitychecks.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef SANITYCHECKS_H 15 | #define SANITYCHECKS_H 16 | 17 | #include 18 | #include 19 | 20 | // Will emit the signal from the Qt event loop after being fired. 21 | class DeferredSignalEmitter : public QObject 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | Q_SIGNAL void deferredSignal(); 27 | Q_SLOT void emitSignal(); 28 | }; 29 | 30 | // Tests the assumptions that the unittests rely on. 31 | class SanityChecks : public QObject 32 | { 33 | Q_OBJECT 34 | 35 | private Q_SLOTS: 36 | void initTestCase(); 37 | void cleanupTestCase(); 38 | 39 | void init(); 40 | void cleanup(); 41 | 42 | void testAsyncronousCallbacks(); 43 | }; 44 | 45 | #endif // SANITYCHECKS_H 46 | -------------------------------------------------------------------------------- /tests/stubs/fakeproperty.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "fakeproperty.h" 15 | #include 16 | 17 | FakeProperty::FakeProperty(const QString &key, QObject *parent) 18 | : keyName(key), 19 | keyValue(QVariant()) 20 | { 21 | Q_UNUSED(parent); 22 | } 23 | 24 | FakeProperty::~FakeProperty() 25 | { 26 | } 27 | 28 | void FakeProperty::setValue(const QVariant &value) 29 | { 30 | bool changed = false; 31 | 32 | if (keyValue != value) 33 | changed = true; 34 | 35 | keyValue = value; 36 | 37 | if (changed) 38 | Q_EMIT valueChanged(); 39 | } 40 | 41 | QVariant FakeProperty::value() 42 | { 43 | return keyValue; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /tests/stubs/fakeproperty.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | #ifndef FAKEPROPERTY_H 14 | #define FAKEPROPERTY_H 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | /** 21 | * This file defines FakeGConf class that can be used to store settings 22 | * in treelike structure, like MImSettings does. All settings are 23 | * stored in-memory only and are valid during the lifetime of FakeGConf 24 | * instance. 25 | */ 26 | 27 | /*! 28 | * \brief Simple in-memory version of gconf settings database. 29 | */ 30 | class FakeProperty : public QObject 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | FakeProperty(const QString &key, QObject *parent = 0); 36 | virtual ~FakeProperty(); 37 | 38 | QString key() const; 39 | 40 | void setValue(const QVariant &v); 41 | QVariant value(); 42 | 43 | Q_SIGNALS: 44 | void valueChanged(); 45 | 46 | private: 47 | QString keyName; 48 | QVariant keyValue; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /tests/ut_maliit_glib_settings/.gitignore: -------------------------------------------------------------------------------- 1 | ut_maliit_glib_settings 2 | -------------------------------------------------------------------------------- /tests/ut_maliit_glib_settings/mockmaliitserver.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Maliit framework 2 | * 3 | * Copyright (C) 2012 Canonical Ltd 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the licence, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef MOCKMALIITSERVER_H 23 | #define MOCKMALIITSERVER_H 24 | 25 | #include 26 | #include 27 | 28 | typedef struct _MockMaliitServerPriv MockMaliitServerPriv; 29 | 30 | typedef struct { 31 | gboolean load_plugin_settings_called; 32 | MockMaliitServerPriv *priv; 33 | GVariant *settings; /* To be set by tests */ 34 | } MockMaliitServer; 35 | 36 | MockMaliitServer *mock_maliit_server_new(); 37 | void mock_maliit_server_free(MockMaliitServer *self); 38 | 39 | GDBusConnection *mock_maliit_server_get_bus(MockMaliitServer *server); 40 | 41 | #endif // MOCKMALIITSERVER_H 42 | -------------------------------------------------------------------------------- /tests/ut_mattributeextensionmanager/.gitignore: -------------------------------------------------------------------------------- 1 | ut_mattributeextensionmanager 2 | -------------------------------------------------------------------------------- /tests/ut_mattributeextensionmanager/toolbar1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 16 | 21 | 23 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 41 | 46 | 11 | 16 | 21 | 23 | 28 | 11 | 16 | 21 | 23 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 41 | 46 | 11 | 16 | 21 | 23 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /tests/ut_mimpluginmanager/ut_mimpluginmanager.h: -------------------------------------------------------------------------------- 1 | #ifndef UT_MIMPLUGINLOADER_H 2 | #define UT_MIMPLUGINLOADER_H 3 | 4 | #include "mimserveroptions.h" 5 | 6 | #include 7 | #include 8 | 9 | class MIMPluginManager; 10 | class MIMPluginManagerPrivate; 11 | class MInputContextTestConnection; 12 | QT_BEGIN_NAMESPACE 13 | class QDBusInterface; 14 | QT_END_NAMESPACE 15 | 16 | class Ut_MIMPluginManager : public QObject 17 | { 18 | Q_OBJECT 19 | 20 | private Q_SLOTS: 21 | void initTestCase(); 22 | void cleanupTestCase(); 23 | 24 | void init(); 25 | void cleanup(); 26 | 27 | void testLoadPlugins(); 28 | void testAddHandlerMap(); 29 | void testSwitchPluginState(); 30 | void testMultiplePlugins(); 31 | void testExistInputMethod(); 32 | 33 | void testPluginSwitcher_data(); 34 | void testPluginSwitcher(); 35 | 36 | void testSwitchToSpecifiedPlugin(); 37 | 38 | void testSwitchShow_data(); 39 | void testSwitchShow(); 40 | 41 | void testSetActivePlugin(); 42 | 43 | void testSubViews(); 44 | void testActiveSubView(); 45 | 46 | void testLoadedPluginsInfo_data(); 47 | void testLoadedPluginsInfo(); 48 | 49 | void testSubViewsInfo_data(); 50 | void testSubViewsInfo(); 51 | 52 | void testEnableAllSubviews(); 53 | 54 | void testPluginSettingsList(); 55 | void testPluginSettingsUpdate(); 56 | 57 | private: 58 | void handleMessages(); 59 | 60 | QString pluginPath; 61 | MIMPluginManager *manager; 62 | MIMPluginManagerPrivate *subject; 63 | MInputContextTestConnection *connection; 64 | void checkHandlerMap(int handler, const QString &name); 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /tests/ut_mimpluginmanagerconfig/.gitignore: -------------------------------------------------------------------------------- 1 | ut_mimpluginmanagerconfig 2 | -------------------------------------------------------------------------------- /tests/ut_mimpluginmanagerconfig/ut_mimpluginmanagerconfig.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2012 One Laptop per Child Association 4 | * 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1 as published by the Free Software Foundation 9 | * and appearing in the file LICENSE.LGPL included in the packaging 10 | * of this file. 11 | */ 12 | 13 | #ifndef UT_MIMPLUGINMANAGERCONFIG_H 14 | #define UT_MIMPLUGINMANAGERCONFIG_H 15 | 16 | #include "mimserveroptions.h" 17 | #include "mimsettingsqsettings.h" 18 | #include 19 | 20 | #include 21 | #include 22 | 23 | class MIMPluginManager; 24 | class MIMPluginManagerPrivate; 25 | class MInputContextConnection; 26 | QT_BEGIN_NAMESPACE 27 | class QDBusInterface; 28 | QT_END_NAMESPACE 29 | 30 | class Ut_MIMPluginManagerConfig : public QObject 31 | { 32 | Q_OBJECT 33 | 34 | private Q_SLOTS: 35 | void initTestCase(); 36 | void cleanupTestCase(); 37 | 38 | void init(); 39 | void cleanup(); 40 | 41 | void testNoActiveSubView(); 42 | void testEmptyConfig(); 43 | void autoLanguageSubView(); 44 | 45 | private: 46 | QString pluginPath; 47 | MImSettings *enabledPluginSettings; 48 | MImSettings *activePluginSettings; 49 | MIMPluginManager *manager; 50 | MIMPluginManagerPrivate *subject; 51 | MInputContextConnection *connection; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /tests/ut_mimserveroptions/.gitignore: -------------------------------------------------------------------------------- 1 | ut_mimserveroptions 2 | 3 | -------------------------------------------------------------------------------- /tests/ut_mimserveroptions/ut_mimserveroptions.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef UT_MIMSERVEROPTIONS_H 15 | #define UT_MIMSERVEROPTIONS_H 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | class Ut_MImServerOptions : public QObject 23 | { 24 | Q_OBJECT 25 | 26 | private Q_SLOTS: 27 | void initTestCase(); 28 | void cleanupTestCase(); 29 | 30 | void init(); 31 | void cleanup(); 32 | 33 | void testCommonOptions_data(); 34 | void testCommonOptions(); 35 | 36 | private: 37 | MImServerCommonOptions commonOptions; 38 | }; 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /tests/ut_mimsettings/.gitignore: -------------------------------------------------------------------------------- 1 | ut_mimsettings 2 | -------------------------------------------------------------------------------- /tests/ut_mimsettings/ut_mimsettings.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef UT_MIMSETTINGS_H 15 | #define UT_MIMSETTINGS_H 16 | 17 | #include 18 | #include 19 | 20 | class Ut_MImSettings : public QObject 21 | { 22 | Q_OBJECT 23 | 24 | private Q_SLOTS: 25 | void initTestCase(); 26 | void cleanupTestCase(); 27 | 28 | void init(); 29 | void cleanup(); 30 | 31 | void testValue(); 32 | void testModifyValue(); 33 | void testUnsetValue(); 34 | void testModifyValueNotification(); 35 | void testListDirs(); 36 | void testListEntries(); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /tests/ut_minputmethodquickplugin/.gitignore: -------------------------------------------------------------------------------- 1 | ut_minputmethodquickplugin -------------------------------------------------------------------------------- /tests/ut_minputmethodquickplugin/ut_minputmethodquickplugin.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "ut_minputmethodquickplugin.h" 15 | #include "core-utils.h" 16 | #include "gui-utils.h" 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | class MIndicatorServiceClient 25 | {}; 26 | 27 | void Ut_MInputMethodQuickPlugin::initTestCase() 28 | { 29 | } 30 | 31 | void Ut_MInputMethodQuickPlugin::cleanupTestCase() 32 | { 33 | } 34 | 35 | void Ut_MInputMethodQuickPlugin::init() 36 | {} 37 | 38 | void Ut_MInputMethodQuickPlugin::cleanup() 39 | {} 40 | 41 | void Ut_MInputMethodQuickPlugin::testQmlSetup() 42 | { 43 | QString testPlugin("helloworld.qml"); 44 | const QDir pluginDir = MaliitTestUtils::isTestingInSandbox() 45 | ? QDir(MaliitTestUtils::getTestDataPath() + "/qmlplugin") 46 | : QDir(MALIIT_TEST_PLUGINS_DIR"/qml/helloworld"); 47 | const QString pluginPath = pluginDir.absoluteFilePath(testPlugin); 48 | const QString pluginId = QFileInfo(testPlugin).baseName(); 49 | QVERIFY(pluginDir.exists(pluginPath)); 50 | 51 | Maliit::Plugins::InputMethodPlugin *plugin 52 | = new Maliit::InputMethodQuickPlugin(pluginPath, 53 | QSharedPointer(new Maliit::UnknownPlatform)); 54 | 55 | MaliitTestUtils::TestInputMethodHost host(pluginId, plugin->name()); 56 | Maliit::InputMethodQuick *testee = static_cast( 57 | plugin->createInputMethod(&host)); 58 | 59 | QVERIFY(not testee->inputMethodArea().isEmpty()); 60 | QCOMPARE(testee->inputMethodArea(), 61 | QRectF(0, qRound(testee->screenHeight() * 0.5), 62 | testee->screenWidth(), qRound(testee->screenHeight() * 0.5))); 63 | 64 | QCOMPARE(host.lastCommit, QString("Maliit")); 65 | QCOMPARE(host.sendCommitCount, 1); 66 | QCOMPARE(host.lastPreedit, QString("Maliit")); 67 | QCOMPARE(host.sendPreeditCount, 1); 68 | } 69 | 70 | QTEST_MAIN(Ut_MInputMethodQuickPlugin) 71 | -------------------------------------------------------------------------------- /tests/ut_minputmethodquickplugin/ut_minputmethodquickplugin.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef UT_MINPUTMETHODQUICKPLUGIN_H 15 | #define UT_MINPUTMETHODQUICKPLUGIN_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | class MIMApplication; 22 | 23 | class Ut_MInputMethodQuickPlugin : public QObject 24 | { 25 | Q_OBJECT 26 | 27 | private Q_SLOTS: 28 | void initTestCase(); 29 | void cleanupTestCase(); 30 | 31 | void init(); 32 | void cleanup(); 33 | 34 | void testQmlSetup(); 35 | 36 | private: 37 | QApplication *app; 38 | }; 39 | 40 | #endif // UT_MINPUTMETHODQUICKPLUGIN_H 41 | -------------------------------------------------------------------------------- /tests/ut_mkeyoverride/.gitignore: -------------------------------------------------------------------------------- 1 | ut_mkeyoverride 2 | -------------------------------------------------------------------------------- /tests/ut_mkeyoverride/ut_mkeyoverride.cpp: -------------------------------------------------------------------------------- 1 | #include "ut_mkeyoverride.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace { 11 | } 12 | Q_DECLARE_METATYPE(MKeyOverride::KeyOverrideAttributes) 13 | 14 | void Ut_MKeyOverride::initTestCase() 15 | { 16 | qRegisterMetaType< MKeyOverride::KeyOverrideAttribute >("MKeyOverride::KeyOverrideAttribute"); 17 | qRegisterMetaType< MKeyOverride::KeyOverrideAttributes >("MKeyOverride::KeyOverrideAttributes"); 18 | } 19 | 20 | void Ut_MKeyOverride::cleanupTestCase() 21 | { 22 | } 23 | 24 | void Ut_MKeyOverride::init() 25 | { 26 | keyId = QString("testKey"); 27 | subject = new MKeyOverride(keyId); 28 | } 29 | 30 | void Ut_MKeyOverride::cleanup() 31 | { 32 | delete subject; 33 | subject = 0; 34 | } 35 | 36 | void Ut_MKeyOverride::testSetProperty() 37 | { 38 | QSignalSpy spy(subject, SIGNAL(keyAttributesChanged(QString, MKeyOverride::KeyOverrideAttributes))); 39 | QVERIFY(spy.isValid()); 40 | 41 | subject->setProperty("label", QVariant(QString("some text"))); 42 | QCOMPARE(spy.count(), 1); 43 | QCOMPARE(spy.first().count(), 2); 44 | QCOMPARE(spy.first().first().toString(), keyId); 45 | QCOMPARE(spy.first().last().value(), 46 | MKeyOverride::KeyOverrideAttributes(MKeyOverride::Label)); 47 | QCOMPARE(subject->label(), QString("some text")); 48 | spy.clear(); 49 | 50 | subject->setProperty("icon", QVariant(QString("some text"))); 51 | QCOMPARE(spy.count(), 1); 52 | QCOMPARE(spy.first().count(), 2); 53 | QCOMPARE(spy.first().first().toString(), keyId); 54 | QCOMPARE(spy.first().last().value(), 55 | MKeyOverride::KeyOverrideAttributes(MKeyOverride::Icon)); 56 | QCOMPARE(subject->icon(), QString("some text")); 57 | spy.clear(); 58 | 59 | subject->setProperty("highlighted", QVariant(true)); 60 | QCOMPARE(spy.count(), 1); 61 | QCOMPARE(spy.first().count(), 2); 62 | QCOMPARE(spy.first().first().toString(), keyId); 63 | QCOMPARE(spy.first().last().value(), 64 | MKeyOverride::KeyOverrideAttributes(MKeyOverride::Highlighted)); 65 | QCOMPARE(subject->highlighted(), true); 66 | spy.clear(); 67 | 68 | subject->setProperty("enabled", QVariant(false)); 69 | QCOMPARE(spy.count(), 1); 70 | QCOMPARE(spy.first().count(), 2); 71 | QCOMPARE(spy.first().first().toString(), keyId); 72 | QCOMPARE(spy.first().last().value(), 73 | MKeyOverride::KeyOverrideAttributes(MKeyOverride::Enabled)); 74 | QCOMPARE(subject->enabled(), false); 75 | spy.clear(); 76 | } 77 | 78 | QTEST_MAIN(Ut_MKeyOverride) 79 | 80 | -------------------------------------------------------------------------------- /tests/ut_mkeyoverride/ut_mkeyoverride.h: -------------------------------------------------------------------------------- 1 | #ifndef UT_MKEYOVERRIDE_H 2 | #define UT_MKEYOVERRIDE_H 3 | 4 | #include 5 | #include 6 | 7 | class MKeyOverride; 8 | 9 | class Ut_MKeyOverride : public QObject 10 | { 11 | Q_OBJECT 12 | 13 | private Q_SLOTS: 14 | void initTestCase(); 15 | void cleanupTestCase(); 16 | 17 | void init(); 18 | void cleanup(); 19 | 20 | void testSetProperty(); 21 | 22 | private: 23 | MKeyOverride *subject; 24 | QString keyId; 25 | }; 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /tests/utils/core-utils.h: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #ifndef CORE_UTILS_H__ 15 | #define CORE_UTILS_H__ 16 | 17 | #include 18 | #include 19 | 20 | namespace MaliitTestUtils { 21 | 22 | bool isTestingInSandbox(); 23 | QString getTestPluginPath(); 24 | QString getTestDataPath(); 25 | void waitForSignal(const QObject* object, const char* signal, int timeout); 26 | } 27 | 28 | #endif // CORE_UTILS_H__ 29 | -------------------------------------------------------------------------------- /tests/utils/gui-utils.cpp: -------------------------------------------------------------------------------- 1 | /* * This file is part of Maliit framework * 2 | * 3 | * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 | * All rights reserved. 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License version 2.1 as published by the Free Software Foundation 10 | * and appearing in the file LICENSE.LGPL included in the packaging 11 | * of this file. 12 | */ 13 | 14 | #include "gui-utils.h" 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | namespace MaliitTestUtils { 22 | 23 | 24 | } 25 | 26 | --------------------------------------------------------------------------------