pax_global_header00006660000000000000000000000064126216256400014516gustar00rootroot0000000000000052 comment=7baa76f7edae9d498acdb05c4868a78c9eba1de3 inputcontext-gtk-0.99.1/000077500000000000000000000000001262162564000151455ustar00rootroot00000000000000inputcontext-gtk-0.99.1/.gitignore000066400000000000000000000002401262162564000171310ustar00rootroot00000000000000core *-stamp Makefile doxygen.log* .moc .obj *.a *.so *.so.* *.o moc_* gen_* *.swp *~ *.pro.user *.gcov *.gcda *.gcno /meego-im-framework.schemas *.tar.* *.md5 inputcontext-gtk-0.99.1/LICENSE.LGPL000066400000000000000000000622331262162564000167150ustar00rootroot00000000000000GNU Lesser General Public License Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. signature of Ty Coon, 1 April 1990 Ty Coon, President of Vice inputcontext-gtk-0.99.1/NEWS000066400000000000000000000003521262162564000156440ustar00rootroot000000000000000.99.1 ====== CHANGES * Move maliit-glib back to maliit-framework * Fail gracefully without running maliit server * Make X11 support conditionally 0.99.0 ====== CHANGES * GTK+ input context moved into a separate repository/package inputcontext-gtk-0.99.1/VERSION000066400000000000000000000000071262162564000162120ustar00rootroot000000000000000.99.1 inputcontext-gtk-0.99.1/config.pri000066400000000000000000000130161262162564000171270ustar00rootroot00000000000000MALIIT_VERSION = $$system(cat $$PWD/VERSION) MALIIT_INTERFACE_VERSION = 1.0 MALIIT_PLUGINS_INTERFACE_VERSION = 1.0 MALIIT_PLUGINS_QUICK_INTERFACE_VERSION = 0.80 MALIIT_FRAMEWORK_INTERFACE_VERSION = 0.80 MALIIT_CONNECTION_INTERFACE_VERSION = 0.80 MALIIT_SERVER_INTERFACE_VERSION = 0.80 MALIIT_ABI_VERSION = $$MALIIT_VERSION # For libmaliit MALIIT_LIB = maliit MALIIT_SETTINGS_LIB = maliit-settings MALIIT_HEADER = maliit MALIIT_FRAMEWORK_HEADER = maliit/framework include(defines.pri) # Linker optimization for release build QMAKE_LFLAGS_RELEASE+=-Wl,--as-needed # Compiler warnings are error if the build type is debug QMAKE_CXXFLAGS_DEBUG+=-Werror -O0 QMAKE_CFLAGS_DEBUG+=-Werror -O0 OBJECTS_DIR = .obj MOC_DIR = .moc isEmpty(MALIIT_VERSION) { MALIIT_VERSION=$$MALIIT_VERSION } isEmpty(PREFIX) { PREFIX = /usr } isEmpty(BINDIR) { BINDIR = $$PREFIX/bin } isEmpty(LIBDIR) { LIBDIR = $$PREFIX/lib } isEmpty(INCLUDEDIR) { INCLUDEDIR = $$PREFIX/include } DATADIR = $$PREFIX/share isEmpty(DOCDIR) { DOCDIR = $$DATADIR/doc } isEmpty(MALIIT_PLUGINS_DIR) { MALIIT_PLUGINS_DIR = $$LIBDIR/$$MALIIT_PLUGINS } DEFINES += MALIIT_PLUGINS_DIR=\\\"$$MALIIT_PLUGINS_DIR\\\" isEmpty(MALIIT_PLUGINS_DATA_DIR) { MALIIT_PLUGINS_DATA_DIR = $$DATADIR/$$MALIIT_PLUGINS_DATA } DEFINES += MALIIT_PLUGINS_DATA_DIR=\\\"$$MALIIT_PLUGINS_DATA_DIR\\\" isEmpty(MALIIT_FACTORY_PLUGINS_DIR) { MALIIT_FACTORY_PLUGINS_DIR = $$MALIIT_PLUGINS_DIR/factories } DEFINES += MALIIT_FACTORY_PLUGINS_DIR=\\\"$$MALIIT_FACTORY_PLUGINS_DIR\\\" isEmpty(MALIIT_ENABLE_MULTITOUCH) { MALIIT_ENABLE_MULTITOUCH=true } MALIIT_EXTENSIONS_DIR = $$DATADIR/$$MALIIT_ATTRIBUTE_EXTENSIONS/ DEFINES += MALIIT_EXTENSIONS_DIR=\\\"$$MALIIT_EXTENSIONS_DIR\\\" isEmpty(MALIIT_DEFAULT_HW_PLUGIN) { MALIIT_DEFAULT_HW_PLUGIN = libmaliit-keyboard-plugin.so } isEmpty(MALIIT_DEFAULT_PLUGIN) { MALIIT_DEFAULT_PLUGIN = libmaliit-keyboard-plugin.so } DEFINES += MALIIT_CONFIG_ROOT=\\\"$$MALIIT_CONFIG_ROOT\\\" DEFINES += MALIIT_FRAMEWORK_USE_INTERNAL_API # Do not define keywords signals, slots, emit and foreach because of # conflicts with 3rd party libraries. CONFIG += no_keywords unix { MALIIT_STATIC_PREFIX=lib MALIIT_STATIC_SUFFIX=.a MALIIT_DYNAMIC_PREFIX=lib MALIIT_DYNAMIC_SUFFIX=.so MALIIT_ABI_VERSION_MAJOR= } win32 { # qmake puts libraries in subfolders in build tree on Windows (installation is unaffected) release { MALIIT_STATIC_PREFIX=release/lib MALIIT_DYNAMIC_PREFIX=release/ } debug { MALIIT_STATIC_PREFIX=debug/lib MALIIT_DYNAMIC_PREFIX=debug/ } # one would suspect this to be .lib, but qmake with mingw uses .a MALIIT_STATIC_SUFFIX=.a # qmake adds the first component of the version as part of the DLL name on Windows MALIIT_ABI_VERSIONS=$$split(MALIIT_ABI_VERSION, ".") MALIIT_ABI_VERSION_MAJOR=$$member(MALIIT_ABI_VERSIONS, 0) MALIIT_DYNAMIC_SUFFIX=$${MALIIT_ABI_VERSION_MAJOR}.dll } defineReplace(maliitStaticLib) { return($${MALIIT_STATIC_PREFIX}$${1}$${MALIIT_STATIC_SUFFIX}) } defineReplace(maliitDynamicLib) { return($${MALIIT_DYNAMIC_PREFIX}$${1}$${MALIIT_DYNAMIC_SUFFIX}) } mac { # Do mac stuff here M_BUILD_FEATURES = debug M_PROFILE_PARTS = INCLUDEPATH += include/ } contains(QT_CONFIG,embedded) { CONFIG += qws } # Use x11 on unix systems without lighthouse (qpa) or QWS (qws) unix:!qpa:!qws { CONFIG += x11 } contains(QT_MAJOR_VERSION, 4) { QT_WIDGETS = gui } else { QT_WIDGETS = gui widgets wayland { DEFINES += HAVE_WAYLAND } } MALIIT_INSTALL_PRF = $$[QT_INSTALL_DATA]/mkspecs/features local-install { MALIIT_INSTALL_PRF = $$replace(MALIIT_INSTALL_PRF, $$[QT_INSTALL_PREFIX], $$PREFIX) } defineTest(outputFile) { out = $$OUT_PWD/$$1 in = $$PWD/$${1}.in !exists($$in) { error($$in does not exist!) return(false) } MALIIT_IN_DIR = $$PWD MALIIT_OUT_DIR = $$OUT_PWD variables = MALIIT_FRAMEWORK_FEATURE \ PREFIX \ BINDIR \ INCLUDEDIR \ LIBDIR \ DOCDIR \ MALIIT_PLUGINS_DIR \ MALIIT_PLUGINS_DATA_DIR \ MALIIT_FACTORY_PLUGINS_DIR \ MALIIT_VERSION \ MALIIT_ENABLE_MULTITOUCH \ MALIIT_DEFAULT_HW_PLUGIN \ MALIIT_DEFAULT_PLUGIN \ MALIIT_QUICK_FEATURE \ MALIIT_PLUGINS_LIB \ MALIIT_PLUGINS_HEADER \ MALIIT_LIB \ MALIIT_HEADER \ MALIIT_PLUGINS_QUICK_LIB \ MALIIT_PLUGINS_QUICK_HEADER \ MALIIT_PLUGINS_QUICK_FACTORY \ MALIIT_SETTINGS_LIB \ MALIIT_IN_DIR \ MALIIT_OUT_DIR \ MALIIT_PACKAGENAME \ MALIIT_PACKAGE_BRIEF \ MALIIT_FRAMEWORK_HEADER \ MALIIT_SERVER_ARGUMENTS \ MALIIT_CONNECTION_HEADER \ MALIIT_CONNECTION_LIB \ MALIIT_SERVER_HEADER \ MALIIT_ABI_VERSION_MAJOR \ command = "sed" for(var, variables) { command += "-e \"s;@$$var@;$$eval($$var);g\"" } command += $$in > $$out system(mkdir -p $$dirname(out)) system($$command) system(chmod --reference=$$in $$out) QMAKE_DISTCLEAN += $$1 export(QMAKE_DISTCLEAN) return(true) } defineTest(outputFiles) { files = $$ARGS for(file, files) { !outputFile($$file):return(false) } return(true) } inputcontext-gtk-0.99.1/defines.pri000066400000000000000000000015101262162564000172730ustar00rootroot00000000000000MALIIT_PLUGINS = maliit/plugins MALIIT_PLUGINS_DATA = maliit/plugins MALIIT_SERVER = maliit-server MALIIT_PLUGINS_LIB = maliit-plugins MALIIT_PLUGINS_QUICK_LIB = maliit-plugins-quick MALIIT_PLUGINS_HEADER = maliit/plugins MALIIT_PLUGINS_QUICK_HEADER = maliit/plugins-quick MALIIT_PLUGINS_QUICK_FACTORY = maliit-plugins-quick-factory MALIIT_SERVER_HEADER = maliit/server MALIIT_PACKAGENAME = maliit-inputcontext-gtk MALIIT_PACKAGE_BRIEF = Maliit Framework MALIIT_ATTRIBUTE_EXTENSIONS = $${MALIIT_PACKAGENAME}/extensions MALIIT_CONFIG_ROOT = /maliit/ MALIIT_INPUTCONTEXT_NAME = Maliit MALIIT_INPUTCONTEXT_TARGETNAME = maliit-inputcontext-qt4 MALIIT_INPUTCONTEXTPLUGIN_TARGETNAME = maliit-qt4 MALIIT_DIRECTINPUTCONTEXTPLUGIN_TARGETNAME = maliit-direct-qt4 MALIIT_CONNECTION_LIB = maliit-connection MALIIT_CONNECTION_HEADER = maliit/connection inputcontext-gtk-0.99.1/gtk-input-context/000077500000000000000000000000001262162564000205515ustar00rootroot00000000000000inputcontext-gtk-0.99.1/gtk-input-context/.gitignore000066400000000000000000000004311262162564000225370ustar00rootroot00000000000000*.o *.lo *.la Makefile Makefile.in aclocal.m4 .deps .libs autom4te.cache/ build/ config.guess config.h config.h.in config.log config.rpath config.status config.sub configure depcomp install-sh libtool ltmain.sh missing m4/lt*.m4 m4/libtool.m4 m4/intltool.m4 mkinstalldirs stamp-h1 inputcontext-gtk-0.99.1/gtk-input-context/AUTHORS000066400000000000000000000001151262162564000216160ustar00rootroot00000000000000Raymond Liu Claudio Saavedra inputcontext-gtk-0.99.1/gtk-input-context/COPYING000066400000000000000000000635011262162564000216110ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/000077500000000000000000000000001262162564000226125ustar00rootroot00000000000000inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/client-gtk.pro000066400000000000000000000042771262162564000254070ustar00rootroot00000000000000TOP_DIR = ../.. include($$TOP_DIR/config.pri) TEMPLATE = lib TARGET = im-maliit CONFIG += plugin CONFIG += link_pkgconfig PKGCONFIG += gtk+-2.0 maliit-glib QMAKE_CXXFLAGS_DEBUG+=-Wno-error=deprecated-declarations QMAKE_CFLAGS_DEBUG+=-Wno-error=deprecated-declarations DEFINES += G_LOG_DOMAIN=\\\"Maliit\\\" x11 { DEFINES += HAVE_X11 } HEADERS += \ ../client-gtk/client-imcontext-gtk.h \ ../client-gtk/qt-gtk-translate.h \ ../client-gtk/qt-keysym-map.h \ ../client-gtk/debug.h \ SOURCES += \ ../client-gtk/gtk-imcontext-plugin.c \ ../client-gtk/client-imcontext-gtk.c \ ../client-gtk/qt-gtk-translate.cpp \ ../client-gtk/qt-keysym-map.cpp \ ../client-gtk/debug.c \ GTK2_IM_LIBDIR = $$system(pkg-config --variable=libdir gtk+-2.0) GTK2_PREFIX = $$system(pkg-config --variable prefix gtk+-2.0) local-install { GTK2_IM_LIBDIR = $$replace(GTK2_IM_LIBDIR, $$GTK2_PREFIX, $$PREFIX) } GTK2_BINARY_VERSION = $$system(pkg-config --variable=gtk_binary_version gtk+-2.0) GTK2_DIR = $$GTK2_IM_LIBDIR/gtk-2.0/$$GTK2_BINARY_VERSION GTK2_IM_MODULEDIR = $$GTK2_DIR/immodules target.path += $$GTK2_IM_MODULEDIR INSTALLS += target !disable-gtk-cache-update { # need to make sure dynamic linker can find maliit libraries when running gtk-query-module ldconfig.extra = ldconfig ldconfig.path = . # dummy path INSTALLS += ldconfig DISTRO = $$system(lsb_release -s -i) DISTRO_VERSION = $$system(lsb_release -s -r) isEqual(DISTRO, Ubuntu) { QUERY_IM_BIN = gtk-query-immodules-2.0 greaterThan(DISTRO_VERSION, 11) { QUERY_IM_BIN = $$GTK2_IM_LIBDIR/libgtk2.0-0/gtk-query-immodules-2.0 } update-im-cache.path = $$GTK2_DIR/ update-im-cache.extra = $$QUERY_IM_BIN > $$GTK2_DIR/gtk.immodules update-im-cache.uninstall = $$QUERY_IM_BIN > $$GTK2_DIR/gtk.immodules INSTALLS *= update-im-cache } HOST = $$system(pkg-config --variable gtk_host gtk+-2.0) system(test -e /etc/fedora-release) { update-im-cache.path = $$GTK2_DIR/ update-im-cache.extra = update-gtk-immodules $$HOST update-im-cache.uninstall = update-gtk-immodules $$HOST INSTALLS *= update-im-cache } } inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/client-imcontext-gtk.c000066400000000000000000001055441262162564000270400ustar00rootroot00000000000000/* * Copyright (C) 2010, Intel Corporation. * Copyright (C) 2012 One Laptop per Child Association * Copyright (C) 2012 Canonical Ltd * * Author: Raymond Liu * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #include #include #ifdef HAVE_X11 #include // For retrieving XID #endif /* HAVE_X11 */ #include "client-imcontext-gtk.h" #include "qt-gtk-translate.h" #include "debug.h" static GType _meego_imcontext_type = 0; static GtkIMContextClass *parent_class = NULL; static MeegoIMContext *focused_imcontext = NULL; static GtkWidget *focused_widget = NULL; gboolean redirect_keys = FALSE; static void meego_imcontext_finalize(GObject *object); static void meego_imcontext_class_init(MeegoIMContextClass *klass); static void meego_imcontext_init(MeegoIMContext *meego_imcontext); static void meego_imcontext_focus_in(GtkIMContext *context); static void meego_imcontext_focus_out(GtkIMContext *context); static gboolean meego_imcontext_filter_key_event(GtkIMContext *context, GdkEventKey *event); static void meego_imcontext_reset(GtkIMContext *context); static void meego_imcontext_get_preedit_string(GtkIMContext *context, gchar **str, PangoAttrList **attrs, gint *cursor_pos); static void meego_imcontext_set_preedit_enabled(GtkIMContext *context, gboolean enabled); static void meego_imcontext_set_client_window(GtkIMContext *context, GdkWindow *window); static void meego_imcontext_set_cursor_location(GtkIMContext *context, GdkRectangle *area); static void meego_imcontext_update_widget_info(MeegoIMContext *imcontext); static gboolean meego_imcontext_im_initiated_hide(MaliitContext *obj, GDBusMethodInvocation *invocation, gpointer user_data); static gboolean meego_imcontext_commit_string(MaliitContext *obj, GDBusMethodInvocation *invocation, const gchar *string, gint replacement_start, gint replacement_length, gint cursor_pos, gpointer user_data); static gboolean meego_imcontext_update_preedit(MaliitContext *obj, GDBusMethodInvocation *invocation, const gchar *string, GVariant *formatListData, gint replaceStart, gint replaceLength, gint cursorPos, gpointer user_data); static gboolean meego_imcontext_key_event(MaliitContext *obj, GDBusMethodInvocation *invocation, gint type, gint key, gint modifiers, const gchar *text, gboolean auto_repeat, gint count, guchar request_type, gpointer user_data); static gboolean meego_imcontext_set_redirect_keys(MaliitContext *obj, GDBusMethodInvocation *invocation, gboolean enabled, gpointer user_data); static gboolean meego_imcontext_notify_extended_attribute_changed (MaliitContext *obj, GDBusMethodInvocation *invocation, gint id, const gchar *target, const gchar *target_item, const gchar *attribute, GVariant *variant_value, gpointer user_data); static gboolean meego_imcontext_update_input_method_area (MaliitContext *obj, GDBusMethodInvocation *invocation, gint x, gint y, gint width, gint height, gpointer user_data); static void meego_imcontext_invoke_action(MaliitServer *obj, const char *action, const char* sequence, gpointer user_data); static GtkIMContext *meego_imcontext_get_slave_imcontext(void); #ifdef HAVE_X11 static const gchar *const WIDGET_INFO_WIN_ID = "winId"; #endif /* HAVE_X11 */ static const gchar *const WIDGET_INFO_FOCUS_STATE = "focusState"; static const gchar *const WIDGET_INFO_ATTRIBUTE_EXTENSION_ID = "toolbarId"; static const gchar *const WIDGET_INFO_ATTRIBUTE_EXTENSION_FILENAME = "toolbar"; static const gchar *const WIDGET_INFO_SURROUNDING_TEXT = "surroundingText"; static const gchar *const WIDGET_INFO_CURSOR_POSITION = "cursorPosition"; GType meego_imcontext_get_type() { return _meego_imcontext_type; } void meego_imcontext_register_type(GTypeModule *type_module) { static const GTypeInfo meego_imcontext_info = { sizeof(MeegoIMContextClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) meego_imcontext_class_init, NULL, NULL, sizeof(MeegoIMContext), 0, (GInstanceInitFunc) meego_imcontext_init, NULL }; if (_meego_imcontext_type) return; if (type_module) { _meego_imcontext_type = g_type_module_register_type( type_module, GTK_TYPE_IM_CONTEXT, "MeegoIMContext", &meego_imcontext_info, (GTypeFlags)0); } else { _meego_imcontext_type = g_type_register_static( GTK_TYPE_IM_CONTEXT, "MeegoIMContext", &meego_imcontext_info, (GTypeFlags)0); } } // staff for fallback slave GTK simple imcontext static void slave_commit(GtkIMContext *slave, const char *text, gpointer data) { UNUSED(slave); UNUSED(data); DBG("text = %s", text); if (focused_imcontext && text) { g_signal_emit_by_name(focused_imcontext, "commit", text); } } static void slave_preedit_changed(GtkIMContext *slave, gpointer data) { UNUSED(data); gchar *str = NULL; gint cursor_pos = 0; PangoAttrList *attrs = NULL; STEP(); if (!focused_imcontext || !slave) return; gtk_im_context_get_preedit_string(slave, &str, &attrs, &cursor_pos); if (str != NULL) { g_free(focused_imcontext->preedit_str); focused_imcontext->preedit_str = str; } focused_imcontext->preedit_cursor_pos = cursor_pos; if (focused_imcontext->preedit_attrs != NULL) pango_attr_list_unref(focused_imcontext->preedit_attrs); focused_imcontext->preedit_attrs = attrs; g_signal_emit_by_name(focused_imcontext, "preedit-changed"); } static GtkIMContext * meego_imcontext_get_slave_imcontext(void) { static GtkIMContext *slave_ic = NULL; if (!slave_ic) { slave_ic = gtk_im_context_simple_new(); //g_signal_connect(G_OBJECT(slave_ic), "preedit-start", G_CALLBACK(slave_preedit_start), NULL); //g_signal_connect(G_OBJECT(slave_ic), "preedit-end", G_CALLBACK(slave_preedit_end), NULL); g_signal_connect(G_OBJECT(slave_ic), "preedit-changed", G_CALLBACK(slave_preedit_changed), NULL); g_signal_connect(G_OBJECT(slave_ic), "commit", G_CALLBACK(slave_commit), NULL); } return slave_ic; } GtkIMContext * meego_imcontext_new(void) { MeegoIMContext *ic = MEEGO_IMCONTEXT(g_object_new(MEEGO_TYPE_IMCONTEXT, NULL)); return GTK_IM_CONTEXT(ic); } static void meego_imcontext_dispose(GObject *object) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(object); if (imcontext->context) g_signal_handlers_disconnect_by_data (imcontext->context, object); if (imcontext->server) g_signal_handlers_disconnect_by_data (imcontext->server, object); g_clear_object(&imcontext->context); g_clear_object(&imcontext->server); G_OBJECT_CLASS(parent_class)->dispose(object); } static void meego_imcontext_finalize(GObject *object) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(object); if (imcontext->widget_state) g_variant_unref(imcontext->widget_state); if (imcontext->client_window) g_object_unref(imcontext->client_window); if (imcontext->registry) g_object_unref(imcontext->registry); G_OBJECT_CLASS(parent_class)->finalize(object); } static void meego_imcontext_class_init(MeegoIMContextClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); parent_class = (GtkIMContextClass *)g_type_class_peek_parent(klass); GtkIMContextClass *imclass = GTK_IM_CONTEXT_CLASS(klass); gobject_class->dispose = meego_imcontext_dispose; gobject_class->finalize = meego_imcontext_finalize; imclass->focus_in = meego_imcontext_focus_in; imclass->focus_out = meego_imcontext_focus_out; imclass->filter_keypress = meego_imcontext_filter_key_event; imclass->reset = meego_imcontext_reset; imclass->set_client_window = meego_imcontext_set_client_window; imclass->get_preedit_string = meego_imcontext_get_preedit_string; imclass->set_cursor_location = meego_imcontext_set_cursor_location; imclass->set_use_preedit = meego_imcontext_set_preedit_enabled; } static MaliitContext * get_context(MeegoIMContext *context) { GError *error = NULL; if (!context->context && maliit_is_running()) { context->context = maliit_get_context_sync(NULL, &error); if (context->context) { g_object_ref(context->context); g_signal_connect(context->context, "handle-im-initiated-hide", G_CALLBACK(meego_imcontext_im_initiated_hide), context); g_signal_connect(context->context, "handle-commit-string", G_CALLBACK(meego_imcontext_commit_string), context); g_signal_connect(context->context, "handle-update-preedit", G_CALLBACK(meego_imcontext_update_preedit), context); g_signal_connect(context->context, "handle-key-event", G_CALLBACK(meego_imcontext_key_event), context); g_signal_connect(context->context, "handle-set-redirect-keys", G_CALLBACK(meego_imcontext_set_redirect_keys), context); g_signal_connect(context->context, "handle-notify-extended-attribute-changed", G_CALLBACK(meego_imcontext_notify_extended_attribute_changed), context); g_signal_connect(context->context, "handle-update-input-method-area", G_CALLBACK(meego_imcontext_update_input_method_area), context); } else { g_warning("Unable to connect to context: %s", error->message); g_clear_error(&error); } } return context->context; } static MaliitServer * get_server(MeegoIMContext *context) { GError *error = NULL; if (!context->server && maliit_is_running()) { get_context(context); context->server = maliit_get_server_sync(NULL, &error); if (context->server) { g_object_ref(context->server); g_signal_connect(context->server, "invoke-action", G_CALLBACK(meego_imcontext_invoke_action), context); } else { g_warning("Unable to connect to server: %s", error->message); g_clear_error(&error); } } return context->server; } static void meego_imcontext_init(MeegoIMContext *self) { self->client_window = NULL; self->cursor_location.x = -1; self->cursor_location.y = -1; self->cursor_location.width = 0; self->cursor_location.height = 0; self->preedit_str = NULL; self->preedit_attrs = NULL; self->preedit_cursor_pos = 0; self->focus_state = FALSE; if (maliit_is_running()) { get_context(self); self->registry = maliit_attribute_extension_registry_get_instance(); } } static void meego_imcontext_focus_in(GtkIMContext *context) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(context); gboolean focus_changed = TRUE; GError *error = NULL; if (!maliit_is_running()) return; DBG("imcontext = %p", imcontext); if (focused_imcontext && focused_imcontext != imcontext) meego_imcontext_focus_out(GTK_IM_CONTEXT(focused_imcontext)); focused_imcontext = imcontext; imcontext->focus_state = TRUE; meego_imcontext_update_widget_info(imcontext); if (maliit_server_call_activate_context_sync(get_server(imcontext), NULL, &error)) { if (maliit_server_call_update_widget_information_sync(get_server(imcontext), imcontext->widget_state, focus_changed, NULL, &error)) { if (!maliit_server_call_show_input_method_sync(get_server(imcontext), NULL, &error)) { g_warning("Unable to show input method: %s", error->message); g_clear_error(&error); } } else { g_warning("Unable to update widget information: %s", error->message); g_clear_error(&error); } } else { g_warning("Unable to activate context: %s", error->message); g_clear_error(&error); } // TODO: anything else than call "activateContext" and "showInputMethod" ? } static void meego_imcontext_focus_out(GtkIMContext *context) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(context); GError *error = NULL; if (!maliit_is_running()) return; DBG("imcontext = %p", imcontext); meego_imcontext_reset(context); imcontext->focus_state = FALSE; focused_imcontext = NULL; focused_widget = NULL; meego_imcontext_update_widget_info(imcontext); if (maliit_server_call_update_widget_information_sync(get_server(imcontext), imcontext->widget_state, TRUE, NULL, &error)) { if (!maliit_server_call_hide_input_method_sync(get_server(imcontext), NULL, &error)) { g_warning("Unable to hide input method: %s", error->message); g_clear_error(&error); } } else { g_warning("Unable to update widget information: %s", error->message); g_clear_error(&error); } // TODO: anything else than call "hideInputMethod" ? } static gboolean meego_imcontext_filter_key_event(GtkIMContext *context, GdkEventKey *event) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(context); int qevent_type = 0, qt_keycode = 0, qt_modifier = 0; gchar *text = ""; GError *error = NULL; if (!maliit_is_running()) { gchar string[10]; gunichar c = gdk_keyval_to_unicode(event->keyval); #if GTK_MAJOR_VERSION == 2 GdkModifierType no_text_input_mask = GDK_MOD1_MASK | GDK_CONTROL_MASK; #elif GTK_MAJOR_VERSION == 3 GdkDisplay *display = gdk_window_get_display(event->window); GdkKeymap *keymap = gdk_keymap_get_for_display(display); GdkModifierIntent intent = GDK_MODIFIER_INTENT_NO_TEXT_INPUT; GdkModifierType no_text_input_mask = gdk_keymap_get_modifier_mask(keymap, intent); #endif /* GTK_MAJOR_VERSION */ if (c && !g_unichar_iscntrl(c) && event->type == GDK_KEY_PRESS && !(event->state & no_text_input_mask)) { string[g_unichar_to_utf8(c, string)] = 0; g_signal_emit_by_name(imcontext, "commit", string); return TRUE; } return FALSE; } focused_widget = gtk_get_event_widget((GdkEvent *)event); DBG("event type=0x%x, state=0x%x, keyval=0x%x, keycode=0x%x, group=%d", event->type, event->state, event->keyval, event->hardware_keycode, event->group); if (focused_imcontext != imcontext) meego_imcontext_focus_in(context); if ((event->state & IM_FORWARD_MASK) || !redirect_keys) { GtkIMContext *slave = meego_imcontext_get_slave_imcontext(); return gtk_im_context_filter_keypress(slave, event); } if (!gdk_key_event_to_qt(event, &qevent_type, &qt_keycode, &qt_modifier)) return FALSE; if (!maliit_server_call_process_key_event_sync(get_server(imcontext), qevent_type, qt_keycode, qt_modifier, text, 0, 1, event->hardware_keycode, event->state, event->time, NULL, &error)) { g_warning("Unable to process key event: %s", error->message); g_clear_error(&error); } return TRUE; } static void meego_imcontext_reset(GtkIMContext *context) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(context); GError *error = NULL; if (!maliit_is_running()) return; DBG("imcontext = %p", imcontext); if (imcontext != focused_imcontext) { return; } /* Commit preedit if it is not empty */ if (focused_imcontext && focused_imcontext->preedit_str && focused_imcontext->preedit_str[0]) { char *commit_string = focused_imcontext->preedit_str; focused_imcontext->preedit_str = g_strdup(""); focused_imcontext->preedit_cursor_pos = 0; g_signal_emit_by_name(focused_imcontext, "preedit-changed"); g_signal_emit_by_name(focused_imcontext, "commit", commit_string); g_free(commit_string); } if (!maliit_server_call_reset_sync(get_server(imcontext), NULL, &error)) { g_warning("Unable to reset: %s", error->message); g_clear_error(&error); } } static void meego_imcontext_get_preedit_string(GtkIMContext *context, gchar **str, PangoAttrList **attrs, gint *cursor_pos) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(context); if (!maliit_is_running()) { if (str) *str = g_strdup(""); if (attrs) *attrs = pango_attr_list_new(); if (cursor_pos) *cursor_pos = 0; return; } DBG("imcontext = %p", imcontext); if (str) { if (imcontext->preedit_str) *str = g_strdup(imcontext->preedit_str); else *str = g_strdup(""); } if (attrs) { if (imcontext->preedit_attrs) { *attrs = imcontext->preedit_attrs; pango_attr_list_ref(imcontext->preedit_attrs); } else { *attrs = pango_attr_list_new(); } } if (cursor_pos) *cursor_pos = imcontext->preedit_cursor_pos; } static void meego_imcontext_set_preedit_enabled(GtkIMContext *context, gboolean enabled) { UNUSED(context); UNUSED(enabled); if (!maliit_is_running()) return; // TODO: Seems QT/MEEGO don't need it, it will always showing preedit. return; } static void meego_imcontext_set_client_window(GtkIMContext *context, GdkWindow *window) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(context); if (!maliit_is_running()) return; STEP(); if (imcontext->client_window) g_object_unref(imcontext->client_window); if (window) g_object_ref(window); imcontext->client_window = window; // TODO: might need to update cursor position or other staff later using this info? } static void meego_imcontext_set_cursor_location(GtkIMContext *context, GdkRectangle *area) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(context); //DBG("imcontext = %p, x=%d, y=%d, w=%d, h=%d", imcontext, // area->x, area->y, area->width, area->height); if (!maliit_is_running()) return; imcontext->cursor_location = *area; // TODO: call updateWidgetInformation? //The cursor location from GTK widget is simillar to ImMicroFocus info of a QWidget //Thus we might need to update Qt::ImMicroFocus info according to this. //But MEEGO IM seems not using this info at all } /* Update the widget_state map with current information about the widget. */ void meego_imcontext_update_widget_info(MeegoIMContext *imcontext) { GVariantDict dict; /* Clear table */ g_variant_dict_init(&dict, NULL); /* Focus state */ g_variant_dict_insert(&dict, WIDGET_INFO_FOCUS_STATE, "b", imcontext->focus_state); if (imcontext->focus_state) { /* Window ID */ #ifdef HAVE_X11 #if GTK_MAJOR_VERSION == 2 if (imcontext->client_window) { guint64 xid = GDK_WINDOW_XID(imcontext->client_window); g_variant_dict_insert(&dict, WIDGET_INFO_WIN_ID, "t", xid); } #elif GTK_MAJOR_VERSION == 3 if (GDK_IS_X11_WINDOW(imcontext->client_window)) { guint64 xid = GDK_WINDOW_XID(imcontext->client_window); g_variant_dict_insert(&dict, WIDGET_INFO_WIN_ID, "t", xid); } #endif /* GTK_MAJOR_VERSION */ #endif /* HAVE_X11 */ /* Attribute extensions */ if (imcontext->client_window) { gpointer user_data = NULL; GtkWidget* widget = NULL; MaliitAttributeExtension *extension; gdk_window_get_user_data (imcontext->client_window, &user_data); widget = GTK_WIDGET (user_data); user_data = g_object_get_qdata (G_OBJECT (widget), MALIIT_ATTRIBUTE_EXTENSION_DATA_QUARK); if (user_data) { extension = MALIIT_ATTRIBUTE_EXTENSION (user_data); g_variant_dict_insert (&dict, WIDGET_INFO_ATTRIBUTE_EXTENSION_ID, "i", maliit_attribute_extension_get_id (extension)); g_variant_dict_insert (&dict, WIDGET_INFO_ATTRIBUTE_EXTENSION_FILENAME, "s", maliit_attribute_extension_get_filename (extension)); } } /* Surrounding text */ GtkIMContext *context = GTK_IM_CONTEXT(imcontext); gchar *surrounding_text; gint cursor_index; if (gtk_im_context_get_surrounding(context, &surrounding_text, &cursor_index)) { g_variant_dict_insert(&dict, WIDGET_INFO_SURROUNDING_TEXT, "s", surrounding_text); g_variant_dict_insert(&dict, WIDGET_INFO_CURSOR_POSITION, "i", cursor_index); } } imcontext->widget_state = g_variant_ref_sink(g_variant_dict_end(&dict)); } // Call back functions for dbus obj gboolean meego_imcontext_im_initiated_hide(MaliitContext *obj, GDBusMethodInvocation *invocation, gpointer user_data) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(user_data); if (imcontext != focused_imcontext) return FALSE; if (focused_imcontext && focused_imcontext->client_window) { gpointer user_data = NULL; GtkWidget* parent_widget = NULL; gdk_window_get_user_data (focused_imcontext->client_window, &user_data); parent_widget = GTK_WIDGET (user_data); while (parent_widget && !GTK_IS_WINDOW (parent_widget)) { parent_widget = gtk_widget_get_parent (parent_widget); } if (parent_widget) { gtk_window_set_focus (GTK_WINDOW (parent_widget), NULL); maliit_context_complete_im_initiated_hide (obj, invocation); return TRUE; } } return FALSE; } gboolean meego_imcontext_commit_string(MaliitContext *obj, GDBusMethodInvocation *invocation, const gchar *string, int replacement_start G_GNUC_UNUSED, int replacement_length G_GNUC_UNUSED, int cursor_pos G_GNUC_UNUSED, gpointer user_data) { DBG("string is:%s", string); MeegoIMContext *imcontext = MEEGO_IMCONTEXT(user_data); if (imcontext != focused_imcontext) return FALSE; if (focused_imcontext) { g_free(focused_imcontext->preedit_str); focused_imcontext->preedit_str = g_strdup(""); focused_imcontext->preedit_cursor_pos = 0; g_signal_emit_by_name(focused_imcontext, "preedit-changed"); g_signal_emit_by_name(focused_imcontext, "commit", string); maliit_context_complete_commit_string(obj, invocation); return TRUE; } return FALSE; } typedef enum { MaliitPreeditDefault, MaliitPreeditNoCandidates, MaliitPreeditKeyPress, MaliitPreeditUnconvertible, MaliitPreeditActive } MaliitPreeditFace; static void get_byte_range_from_unicode_offsets (const gchar *string, gint utf8_start, gint utf8_length, gint *byte_start, gint *byte_end) { gint start; gint end; /* we provide start index and length in utf8 characters, but pango * expects start and end indices in bytes. */ if (g_utf8_validate (string, -1, NULL)) { const gchar * const start_pointer = g_utf8_offset_to_pointer (string, utf8_start); const gchar * const end_pointer = g_utf8_offset_to_pointer (string, utf8_start + utf8_length); /* pointer arithmetics, there you have it. */ start = start_pointer - string; end = end_pointer - string; } else { start = utf8_start; end = utf8_start + utf8_length; } if (byte_start) { *byte_start = start; } if (byte_end) { *byte_end = end; } } gboolean meego_imcontext_update_preedit(MaliitContext *obj, GDBusMethodInvocation *invocation, const gchar *string, GVariant *formatListData, gint replaceStart G_GNUC_UNUSED, gint replaceLength G_GNUC_UNUSED, gint cursorPos, gpointer user_data) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(user_data); if (imcontext != focused_imcontext) return FALSE; DBG("imcontext = %p string = %s cursorPos = %d", imcontext, string, cursorPos); if (focused_imcontext) { guint iter; PangoAttrList* attrs; g_free(focused_imcontext->preedit_str); focused_imcontext->preedit_str = g_strdup(string); /* If cursorPos is -1 explicitly set it to the end of the preedit */ if (cursorPos == -1) { cursorPos = g_utf8_strlen(string, -1); } focused_imcontext->preedit_cursor_pos = cursorPos; /* attributes */ attrs = pango_attr_list_new(); for (iter = 0; iter < g_variant_n_children(formatListData); ++iter) { gint start; gint length; MaliitPreeditFace preedit_face; gint byte_start; gint byte_end; PangoAttribute* new_attrs[2] = { NULL, NULL }; gint attr_iter; g_variant_get_child(formatListData, iter, "(iii)", &start, &length, &preedit_face); get_byte_range_from_unicode_offsets(string, start, length, &byte_start, &byte_end); switch (preedit_face) { case MaliitPreeditNoCandidates: new_attrs[0] = pango_attr_underline_new (PANGO_UNDERLINE_ERROR); new_attrs[1] = pango_attr_underline_color_new (65535, 0, 0); break; case MaliitPreeditUnconvertible: { const gint gray = (2 << 15) - 1; /* halfway from 0 to 65535 */ new_attrs[0] = pango_attr_foreground_new (gray, gray, gray); } break; case MaliitPreeditActive: new_attrs[0] = pango_attr_foreground_new(39168, 12800, 52224); new_attrs[1] = pango_attr_weight_new(PANGO_WEIGHT_BOLD); break; case MaliitPreeditKeyPress: case MaliitPreeditDefault: new_attrs[0] = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE); new_attrs[1] = pango_attr_underline_color_new(0, 0, 0); break; } for (attr_iter = 0; attr_iter < 2; ++attr_iter) { if (new_attrs[attr_iter]) { new_attrs[attr_iter]->start_index = byte_start; new_attrs[attr_iter]->end_index = byte_end; pango_attr_list_insert(attrs, new_attrs[attr_iter]); } } } if (focused_imcontext->preedit_attrs) { pango_attr_list_unref (focused_imcontext->preedit_attrs); } focused_imcontext->preedit_attrs = attrs; g_signal_emit_by_name(focused_imcontext, "preedit-changed"); maliit_context_complete_update_preedit(obj, invocation); return TRUE; } return FALSE; } gboolean meego_imcontext_key_event(MaliitContext *obj, GDBusMethodInvocation *invocation, gint type, gint key, gint modifiers, const gchar *text, gboolean auto_repeat G_GNUC_UNUSED, int count G_GNUC_UNUSED, guchar request_type G_GNUC_UNUSED, gpointer user_data) { GdkEventKey *event = NULL; GdkWindow *window = NULL; STEP(); MeegoIMContext *imcontext = MEEGO_IMCONTEXT(user_data); if (imcontext != focused_imcontext) return FALSE; if (focused_imcontext) window = focused_imcontext->client_window; event = qt_key_event_to_gdk(type, key, modifiers, text, window); if (!event) return FALSE; event->send_event = TRUE; event->state |= IM_FORWARD_MASK; gdk_event_put((GdkEvent *)event); gdk_event_free((GdkEvent *)event); maliit_context_complete_key_event(obj, invocation); return TRUE; } static unsigned int find_signal(const char *action, const char *alternative, GtkWidget *widget) { unsigned int signal = g_signal_lookup(action, G_OBJECT_TYPE(widget)); if (signal || alternative == NULL) { return signal; } return g_signal_lookup(alternative, G_OBJECT_TYPE(widget)); } void meego_imcontext_invoke_action(MaliitServer *obj G_GNUC_UNUSED, const char *action, const char *sequence G_GNUC_UNUSED, gpointer user_data) { GtkWidget* widget = NULL; MeegoIMContext *imcontext = MEEGO_IMCONTEXT(user_data); if (imcontext != focused_imcontext) return; gdk_window_get_user_data (imcontext->client_window, &user_data); widget = GTK_WIDGET (user_data); if (widget) { char *alternative = NULL; unsigned int signal; if (g_strcmp0(action, "copy") == 0 || g_strcmp0(action, "cut") == 0 || g_strcmp0(action, "paste") == 0) { alternative = g_strdup_printf("%s-clipboard", action); } signal = find_signal(action, alternative, widget); g_free(alternative); if (signal) { g_signal_emit(widget, signal, 0); return; } } } gboolean meego_imcontext_set_redirect_keys(MaliitContext *obj, GDBusMethodInvocation *invocation, gboolean enabled, gpointer user_data G_GNUC_UNUSED) { DBG("enabled = %d", enabled); redirect_keys = enabled; maliit_context_complete_set_redirect_keys(obj, invocation); return TRUE; } gboolean meego_imcontext_notify_extended_attribute_changed (MaliitContext *obj, GDBusMethodInvocation *invocation, gint id, const gchar *target, const gchar *target_item, const gchar *attribute, GVariant *variant_value, gpointer user_data) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(user_data); if (imcontext != focused_imcontext) return FALSE; maliit_attribute_extension_registry_update_attribute (focused_imcontext->registry, id, target, target_item, attribute, variant_value); maliit_context_complete_notify_extended_attribute_changed(obj, invocation); return TRUE; } gboolean meego_imcontext_update_input_method_area (MaliitContext *obj, GDBusMethodInvocation *invocation, gint x, gint y, gint width, gint height, gpointer user_data) { MeegoIMContext *imcontext = MEEGO_IMCONTEXT(user_data); GdkRectangle cursor_rect, osk_rect = { x, y, width, height }; guint clear_area_id; if (!imcontext->client_window) return FALSE; if (imcontext->keyboard_area.x == x && imcontext->keyboard_area.y == y && imcontext->keyboard_area.width == width && imcontext->keyboard_area.height == height) return FALSE; clear_area_id = g_signal_lookup ("clear-area", GTK_TYPE_IM_CONTEXT); if (clear_area_id == 0) return FALSE; imcontext->keyboard_area = osk_rect; gdk_window_get_root_coords (imcontext->client_window, imcontext->cursor_location.x, imcontext->cursor_location.y, &cursor_rect.x, &cursor_rect.y); cursor_rect.width = imcontext->cursor_location.width; cursor_rect.height = imcontext->cursor_location.height; g_signal_emit (imcontext, clear_area_id, 0, &osk_rect, &cursor_rect); maliit_context_complete_update_input_method_area(obj, invocation); return TRUE; } inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/client-imcontext-gtk.h000066400000000000000000000052131262162564000270350ustar00rootroot00000000000000/* * Copyright (C) 2010, Intel Corporation. * * Author: Raymond Liu * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #ifndef _CLIENT_IMCONTEXT_GTK_H #define _CLIENT_IMCONTEXT_GTK_H #include #include #include #include G_BEGIN_DECLS // Be careful not to override the existing flag of GDK // Currently bit 15-25 unused, so we pick a middle one. typedef enum { IM_FORWARD_MASK = 1 << 20 } IMModifierType; typedef struct _MeegoIMContext MeegoIMContext; typedef struct _MeegoIMContextClass MeegoIMContextClass; #define MEEGO_TYPE_IMCONTEXT (meego_imcontext_get_type()) #define MEEGO_IMCONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MEEGO_TYPE_IMCONTEXT, MeegoIMContext)) #define MEEGO_IMCONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MEEGO_TYPE_IMCONTEXT, MeegoIMContextClass)) #define MEEGO_IS_IMCONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MEEGO_TYPE_IMCONTEXT)) #define MEEGO_IS_IMCONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MEEGO_TYPE_IMCONTEXT)) #define MEEGO_IMCONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MEEGO_TYPE_IMCONTEXT, MeegoIMContextClass)) struct _MeegoIMContext { GtkIMContext parent; MaliitServer *server; MaliitContext *context; MaliitAttributeExtensionRegistry *registry; GdkWindow *client_window; GdkRectangle cursor_location; gchar *preedit_str; PangoAttrList *preedit_attrs; gint preedit_cursor_pos; GVariant *widget_state; /* Mapping between string and GVariants with properties of the focused widget */ gboolean focus_state; /* TRUE means a widget is focused, FALSE means no widget is focused */ GdkRectangle keyboard_area; }; struct _MeegoIMContextClass { GtkIMContextClass parent; }; GType meego_imcontext_get_type(void); void meego_imcontext_register_type(GTypeModule *type_module); GtkIMContext *meego_imcontext_new(void); G_END_DECLS #endif //_CLIENT_IMCONTEXT_GTK_H inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/debug.c000066400000000000000000000007161262162564000240500ustar00rootroot00000000000000#include "debug.h" #include gboolean maliit_is_debug_enabled(void) { static gint debug_enabled = -1; if (debug_enabled == -1) { const char *enabled_debug_var = g_getenv("MALIIT_DEBUG"); if (enabled_debug_var && strlen(enabled_debug_var) > 0 && strcmp(enabled_debug_var, "0") != 0) { debug_enabled = 1; } else { debug_enabled = 0; } } return debug_enabled == 1; } inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/debug.h000066400000000000000000000004411262162564000240500ustar00rootroot00000000000000#ifndef _DEBUG_H #define _DEBUG_H #include G_BEGIN_DECLS gboolean maliit_is_debug_enabled(void); #define DBG(x, a...) if (maliit_is_debug_enabled()) { g_debug("%s: " x, __FUNCTION__, ##a); } #define STEP() DBG("") #define UNUSED(v) (void)v; G_END_DECLS #endif // _DEBUG_H inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/gtk-imcontext-plugin.c000066400000000000000000000036211262162564000270510ustar00rootroot00000000000000/* * Copyright (C) 2010, Intel Corporation. * * Author: Raymond Liu * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #include #include #include #include #include #include "client-imcontext-gtk.h" #include "debug.h" static const GtkIMContextInfo meego_im_info = { "Maliit", /* ID */ "Maliit Input Method", "maliit", /* Gettext domain */ "", "en:ja:ko:zh:*" }; static const GtkIMContextInfo *info_list[] = { &meego_im_info }; void im_module_init(GTypeModule *type_module); void im_module_exit(void); void im_module_list(const GtkIMContextInfo ***contexts, int *context_number); GtkIMContext *im_module_create(const gchar *context_id); void im_module_init(GTypeModule *type_module) { STEP(); g_type_module_use(type_module); meego_imcontext_register_type(type_module); STEP(); } void im_module_exit() { STEP(); } void im_module_list(const GtkIMContextInfo ***contexts, int *context_number) { *contexts = info_list; *context_number = G_N_ELEMENTS(info_list); } GtkIMContext * im_module_create(const gchar *context_id) { if (g_strcmp0(context_id, "Maliit") == 0) { return meego_imcontext_new(); } else { return NULL; } } inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/qt-gtk-translate.cpp000066400000000000000000000076761262162564000265400ustar00rootroot00000000000000/* * Copyright (C) 2010, Intel Corporation. * * Author: Raymond Liu * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #include "debug.h" #include #include #include "qt-keysym-map.h" // To workaround glib >= 2.25 where signals is used, while QT already define it as C++ keyword: protected #ifdef signals #undef signals #endif #include "qt-gtk-translate.h" GdkEventKey * compose_gdk_keyevent(GdkEventType type, guint keyval, guint state, GdkWindow *window) { GdkEventKey *event = NULL; #if GTK_CHECK_VERSION (3, 0, 0) GdkDisplay *display; GdkDeviceManager *device_manager; GdkDevice *client_pointer; #endif if ((type != GDK_KEY_PRESS) && (type != GDK_KEY_RELEASE)) return NULL; event = (GdkEventKey *)(gdk_event_new(type)); event->length = 0; event->string = 0; event->is_modifier = 0; event->time = GDK_CURRENT_TIME; event->state = state; #if GTK_CHECK_VERSION (3, 0, 0) display = gdk_window_get_display (window); device_manager = gdk_display_get_device_manager (display); client_pointer = gdk_device_manager_get_client_pointer (device_manager); gdk_event_set_device ((GdkEvent *)event, gdk_device_get_associated_device (client_pointer)); #endif if (type == GDK_KEY_RELEASE) event->state |= GDK_RELEASE_MASK; event->keyval = keyval; event->window = window; if (event->window) { GdkKeymap *key_map = gdk_keymap_get_default(); GdkKeymapKey *keys; gint n; g_object_ref(event->window); // seems when event is freed, the event->window will be unref if (gdk_keymap_get_entries_for_keyval(key_map, event->keyval, &keys, &n)) { event->hardware_keycode = keys[0].keycode; event->group = keys[0].group; } else { event->hardware_keycode = 0; event->group = 0; } } DBG("event type=0x%x, state=0x%x, keyval=0x%x, keycode=0x%x, group=%d", event->type, event->state, event->keyval, event->hardware_keycode, event->group); return event; } GdkEventKey * qt_key_event_to_gdk(int type, int key, int modifiers, const char *text, GdkWindow *window) { Q_UNUSED(text); guint state = 0; guint keyval; STEP(); if ((type != QEvent::KeyPress) && (type != QEvent::KeyRelease)) return NULL; if (modifiers & Qt::ShiftModifier) state |= GDK_SHIFT_MASK; if (modifiers & Qt::ControlModifier) state |= GDK_CONTROL_MASK; if (modifiers & Qt::AltModifier) state |= GDK_MOD1_MASK; keyval = QtKeyToXKeySym(key); if (type == QEvent::KeyPress) { return compose_gdk_keyevent(GDK_KEY_PRESS, keyval, state, window); } else { return compose_gdk_keyevent(GDK_KEY_RELEASE, keyval, state, window); } } gboolean gdk_key_event_to_qt(GdkEventKey *event, int *type, int *key, int *modifier) { switch (event->type) { case GDK_KEY_PRESS: *type = QEvent::KeyPress; break; case GDK_KEY_RELEASE: *type = QEvent::KeyRelease; break; default: return FALSE; } *key = XKeySymToQTKey(event->keyval); if (*key == Qt::Key_unknown) { qWarning("Unkonwn key"); return FALSE; } *modifier = Qt::NoModifier; if (event->state & GDK_SHIFT_MASK) *modifier |= Qt::ShiftModifier; if (event->state & GDK_CONTROL_MASK) *modifier |= Qt::ControlModifier; if (event->state & GDK_MOD1_MASK) *modifier |= Qt::AltModifier; if (event->state & GDK_META_MASK) *modifier |= Qt::MetaModifier; DBG("qtkey type =%d, qtkey=0x%x, modifier=0x%x", *type, *key, *modifier); return TRUE; } inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/qt-gtk-translate.h000066400000000000000000000022631262162564000261700ustar00rootroot00000000000000/* * Copyright (C) 2010, Intel Corporation. * * Author: Raymond Liu * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #ifndef _QT_GTK_TRANSLATE_H #define _QT_GTK_TRANSLATE_H #include G_BEGIN_DECLS GdkEventKey *compose_gdk_keyevent(GdkEventType type, guint keyval, guint state, GdkWindow *window); GdkEventKey *qt_key_event_to_gdk(int type, int key, int modifiers, const char *text, GdkWindow *window); gboolean gdk_key_event_to_qt(GdkEventKey *event, int *type, int *key, int *modifier); G_END_DECLS #endif //_QT_GTK_TRANSLATE_H inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/qt-keysym-map.cpp000066400000000000000000000502471262162564000260440ustar00rootroot00000000000000/* * Copyright (C) 2001 Ellis Whitehead * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). * Copyright (C) 2010, Intel Corporation. * * Author: Raymond Liu * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #include #include #include "qt-keysym-map.h" #include "debug.h" #if 0 typedef struct { int QtKey; uint XKeySym; } KeySymMap; static const KeySymMap QtKeyXSymMaps[] = { { '/', XK_KP_Divide }, { '*', XK_KP_Multiply }, { '-', XK_KP_Subtract }, { '+', XK_KP_Add }, { Qt::Key_Escape, XK_Escape }, { Qt::Key_Tab, XK_Tab }, { Qt::Key_Backtab, XK_ISO_Left_Tab }, { Qt::Key_Backspace, XK_BackSpace }, { Qt::Key_Return, XK_Return }, { Qt::Key_Enter, XK_KP_Enter }, { Qt::Key_Insert, XK_Insert }, { Qt::Key_Delete, XK_Delete }, { Qt::Key_Pause, XK_Pause }, { Qt::Key_Print, XK_Print }, { Qt::Key_SysReq, XK_Sys_Req }, { Qt::Key_Home, XK_Home }, { Qt::Key_End, XK_End }, { Qt::Key_Left, XK_Left }, { Qt::Key_Up, XK_Up }, { Qt::Key_Right, XK_Right }, { Qt::Key_Down, XK_Down }, { Qt::Key_CapsLock, XK_Caps_Lock }, { Qt::Key_NumLock, XK_Num_Lock }, { Qt::Key_ScrollLock, XK_Scroll_Lock }, { Qt::Key_F1, XK_F1 }, { Qt::Key_F2, XK_F2 }, { Qt::Key_F3, XK_F3 }, { Qt::Key_F4, XK_F4 }, { Qt::Key_F5, XK_F5 }, { Qt::Key_F6, XK_F6 }, { Qt::Key_F7, XK_F7 }, { Qt::Key_F8, XK_F8 }, { Qt::Key_F9, XK_F9 }, { Qt::Key_F10, XK_F10 }, { Qt::Key_F11, XK_F11 }, { Qt::Key_F12, XK_F12 }, { Qt::Key_F13, XK_F13 }, { Qt::Key_F14, XK_F14 }, { Qt::Key_F15, XK_F15 }, { Qt::Key_F16, XK_F16 }, { Qt::Key_F17, XK_F17 }, { Qt::Key_F18, XK_F18 }, { Qt::Key_F19, XK_F19 }, { Qt::Key_F20, XK_F20 }, { Qt::Key_F21, XK_F21 }, { Qt::Key_F22, XK_F22 }, { Qt::Key_F23, XK_F23 }, { Qt::Key_F24, XK_F24 }, { Qt::Key_F25, XK_F25 }, { Qt::Key_F26, XK_F26 }, { Qt::Key_F27, XK_F27 }, { Qt::Key_F28, XK_F28 }, { Qt::Key_F29, XK_F29 }, { Qt::Key_F30, XK_F30 }, { Qt::Key_F31, XK_F31 }, { Qt::Key_F32, XK_F32 }, { Qt::Key_F33, XK_F33 }, { Qt::Key_F34, XK_F34 }, { Qt::Key_F35, XK_F35 }, { Qt::Key_Super_L, XK_Super_L }, { Qt::Key_Super_R, XK_Super_R }, { Qt::Key_Menu, XK_Menu }, { Qt::Key_Hyper_L, XK_Hyper_L }, { Qt::Key_Hyper_R, XK_Hyper_R }, { Qt::Key_Help, XK_Help }, { Qt::Key_Return, XK_KP_Enter }, { Qt::Key_Multi_key, XK_Multi_key }, { Qt::Key_Codeinput, XK_Codeinput }, { Qt::Key_SingleCandidate, XK_SingleCandidate }, { Qt::Key_MultipleCandidate, XK_MultipleCandidate }, { Qt::Key_PreviousCandidate, XK_PreviousCandidate }, { Qt::Key_Mode_switch, XK_Mode_switch }, { Qt::Key_Kanji, XK_Kanji }, { Qt::Key_Muhenkan, XK_Muhenkan }, { Qt::Key_Henkan, XK_Henkan }, { Qt::Key_Romaji, XK_Romaji }, { Qt::Key_Hiragana, XK_Hiragana }, { Qt::Key_Katakana, XK_Katakana }, { Qt::Key_Hiragana_Katakana, XK_Hiragana_Katakana }, { Qt::Key_Zenkaku, XK_Zenkaku }, { Qt::Key_Hankaku, XK_Hankaku }, { Qt::Key_Zenkaku_Hankaku, XK_Zenkaku_Hankaku }, { Qt::Key_Touroku, XK_Touroku }, { Qt::Key_Massyo, XK_Massyo }, { Qt::Key_Kana_Lock, XK_Kana_Lock }, { Qt::Key_Kana_Shift, XK_Kana_Shift }, { Qt::Key_Eisu_Shift, XK_Eisu_Shift }, { Qt::Key_Eisu_toggle, XK_Eisu_toggle }, { Qt::Key_Hangul, XK_Hangul }, { Qt::Key_Hangul_Start, XK_Hangul_Start }, { Qt::Key_Hangul_End, XK_Hangul_End }, { Qt::Key_Hangul_Hanja, XK_Hangul_Hanja }, { Qt::Key_Hangul_Jamo, XK_Hangul_Jamo }, { Qt::Key_Hangul_Romaja, XK_Hangul_Romaja }, { Qt::Key_Hangul_Jeonja, XK_Hangul_Jeonja }, { Qt::Key_Hangul_Banja, XK_Hangul_Banja }, { Qt::Key_Hangul_PreHanja, XK_Hangul_PreHanja }, { Qt::Key_Hangul_Special, XK_Hangul_Special }, { 0, 0 } }; #else typedef struct { uint XKeySym; int QtKey; } KeySymMap; // keyboard mapping table, modified from QKeymapper_x11.cpp static const KeySymMap QtKeyXSymMaps[] = { // misc keys { XK_Escape, Qt::Key_Escape }, { XK_Tab, Qt::Key_Tab }, { XK_ISO_Left_Tab, Qt::Key_Backtab }, { XK_BackSpace, Qt::Key_Backspace }, { XK_Return, Qt::Key_Return }, { XK_Insert, Qt::Key_Insert }, { XK_Delete, Qt::Key_Delete }, { XK_Clear, Qt::Key_Delete }, { XK_Pause, Qt::Key_Pause }, { XK_Print, Qt::Key_Print }, { 0x1005FF60, Qt::Key_SysReq }, // hardcoded Sun SysReq { 0x1007ff00, Qt::Key_SysReq }, // hardcoded X386 SysReq // cursor movement { XK_Home, Qt::Key_Home }, { XK_End, Qt::Key_End }, { XK_Left, Qt::Key_Left }, { XK_Up, Qt::Key_Up }, { XK_Right, Qt::Key_Right }, { XK_Down, Qt::Key_Down }, { XK_Prior, Qt::Key_PageUp }, { XK_Next, Qt::Key_PageDown }, // modifiers { XK_Shift_L, Qt::Key_Shift }, { XK_Shift_R, Qt::Key_Shift }, { XK_Shift_Lock, Qt::Key_Shift }, { XK_Control_L, Qt::Key_Control }, { XK_Control_R, Qt::Key_Control }, { XK_Meta_L, Qt::Key_Meta }, { XK_Meta_R, Qt::Key_Meta }, { XK_Alt_L, Qt::Key_Alt }, { XK_Alt_R, Qt::Key_Alt }, { XK_Caps_Lock, Qt::Key_CapsLock }, { XK_Num_Lock, Qt::Key_NumLock }, { XK_Scroll_Lock, Qt::Key_ScrollLock }, { XK_Super_L, Qt::Key_Super_L }, { XK_Super_R, Qt::Key_Super_R }, { XK_Menu, Qt::Key_Menu }, { XK_Hyper_L, Qt::Key_Hyper_L }, { XK_Hyper_R, Qt::Key_Hyper_R }, { XK_Help, Qt::Key_Help }, { 0x1000FF74, Qt::Key_Backtab }, // hardcoded HP backtab { 0x1005FF10, Qt::Key_F11 }, // hardcoded Sun F36 (labeled F11) { 0x1005FF11, Qt::Key_F12 }, // hardcoded Sun F37 (labeled F12) // function keys { XK_F1, Qt::Key_F1 }, { XK_F2, Qt::Key_F2 }, { XK_F3, Qt::Key_F3 }, { XK_F4, Qt::Key_F4 }, { XK_F5, Qt::Key_F5 }, { XK_F6, Qt::Key_F6 }, { XK_F7, Qt::Key_F7 }, { XK_F8, Qt::Key_F8 }, { XK_F9, Qt::Key_F9 }, { XK_F10, Qt::Key_F10 }, { XK_F11, Qt::Key_F11 }, { XK_F12, Qt::Key_F12 }, { XK_F13, Qt::Key_F13 }, { XK_F14, Qt::Key_F14 }, { XK_F15, Qt::Key_F15 }, { XK_F16, Qt::Key_F16 }, { XK_F17, Qt::Key_F17 }, { XK_F18, Qt::Key_F18 }, { XK_F19, Qt::Key_F19 }, { XK_F20, Qt::Key_F20 }, // numeric and function keypad keys { XK_KP_Space, Qt::Key_Space }, { XK_KP_Tab, Qt::Key_Tab }, { XK_KP_Enter, Qt::Key_Enter }, { XK_KP_F1, Qt::Key_F1 }, { XK_KP_F2, Qt::Key_F2 }, { XK_KP_F3, Qt::Key_F3 }, { XK_KP_F4, Qt::Key_F4 }, { XK_KP_Home, Qt::Key_Home }, { XK_KP_Left, Qt::Key_Left }, { XK_KP_Up, Qt::Key_Up }, { XK_KP_Right, Qt::Key_Right }, { XK_KP_Down, Qt::Key_Down }, { XK_KP_Prior, Qt::Key_PageUp }, { XK_KP_Next, Qt::Key_PageDown }, { XK_KP_End, Qt::Key_End }, { XK_KP_Begin, Qt::Key_Clear }, { XK_KP_Insert, Qt::Key_Insert }, { XK_KP_Delete, Qt::Key_Delete }, { XK_KP_Equal, Qt::Key_Equal }, { XK_KP_Multiply, Qt::Key_Asterisk }, { XK_KP_Add, Qt::Key_Plus }, { XK_KP_Separator, Qt::Key_Comma }, { XK_KP_Subtract, Qt::Key_Minus }, { XK_KP_Decimal, Qt::Key_Period }, { XK_KP_Divide, Qt::Key_Slash }, { XK_KP_0, Qt::Key_0 }, { XK_KP_1, Qt::Key_1 }, { XK_KP_2, Qt::Key_2 }, { XK_KP_3, Qt::Key_3 }, { XK_KP_4, Qt::Key_4 }, { XK_KP_5, Qt::Key_5 }, { XK_KP_6, Qt::Key_6 }, { XK_KP_7, Qt::Key_7 }, { XK_KP_8, Qt::Key_8 }, { XK_KP_9, Qt::Key_9 }, //International input method support keys //International & multi-key character composition { XK_ISO_Level3_Shift, Qt::Key_AltGr }, { XK_Multi_key, Qt::Key_Multi_key }, { XK_Codeinput, Qt::Key_Codeinput }, { XK_SingleCandidate, Qt::Key_SingleCandidate }, { XK_MultipleCandidate, Qt::Key_MultipleCandidate }, { XK_PreviousCandidate, Qt::Key_PreviousCandidate }, // Misc Functions { XK_Mode_switch, Qt::Key_Mode_switch }, { XK_script_switch, Qt::Key_Mode_switch }, // Japanese keyboard support { XK_Kanji, Qt::Key_Kanji }, { XK_Muhenkan, Qt::Key_Muhenkan }, //{ XK_Henkan_Mode, Qt::Key_Henkan_Mode }, { XK_Henkan_Mode, Qt::Key_Henkan }, { XK_Henkan, Qt::Key_Henkan }, { XK_Romaji, Qt::Key_Romaji }, { XK_Hiragana, Qt::Key_Hiragana }, { XK_Katakana, Qt::Key_Katakana }, { XK_Hiragana_Katakana, Qt::Key_Hiragana_Katakana }, { XK_Zenkaku, Qt::Key_Zenkaku }, { XK_Hankaku, Qt::Key_Hankaku }, { XK_Zenkaku_Hankaku, Qt::Key_Zenkaku_Hankaku }, { XK_Touroku, Qt::Key_Touroku }, { XK_Massyo, Qt::Key_Massyo }, { XK_Kana_Lock, Qt::Key_Kana_Lock }, { XK_Kana_Shift, Qt::Key_Kana_Shift }, { XK_Eisu_Shift, Qt::Key_Eisu_Shift }, { XK_Eisu_toggle, Qt::Key_Eisu_toggle }, //{ XK_Kanji_Bangou, Qt::Key_Kanji_Bangou }, //{ XK_Zen_Koho, Qt::Key_Zen_Koho }, //{ XK_Mae_Koho, Qt::Key_Mae_Koho }, { XK_Kanji_Bangou, Qt::Key_Codeinput }, { XK_Zen_Koho, Qt::Key_MultipleCandidate }, { XK_Mae_Koho, Qt::Key_PreviousCandidate }, #ifdef XK_KOREAN // Korean keyboard support { XK_Hangul, Qt::Key_Hangul }, { XK_Hangul_Start, Qt::Key_Hangul_Start }, { XK_Hangul_End, Qt::Key_Hangul_End }, { XK_Hangul_Hanja, Qt::Key_Hangul_Hanja }, { XK_Hangul_Jamo, Qt::Key_Hangul_Jamo }, { XK_Hangul_Romaja, Qt::Key_Hangul_Romaja }, //{ XK_Hangul_Codeinput, Qt::Key_Hangul_Codeinput }, { XK_Hangul_Codeinput, Qt::Key_Codeinput }, { XK_Hangul_Jeonja, Qt::Key_Hangul_Jeonja }, { XK_Hangul_Banja, Qt::Key_Hangul_Banja }, { XK_Hangul_PreHanja, Qt::Key_Hangul_PreHanja }, { XK_Hangul_PostHanja, Qt::Key_Hangul_PostHanja }, //{ XK_Hangul_SingleCandidate,Qt::Key_Hangul_SingleCandidate }, //{ XK_Hangul_MultipleCandidate,Qt::Key_Hangul_MultipleCandidate }, //{ XK_Hangul_PreviousCandidate,Qt::Key_Hangul_PreviousCandidate }, { XK_Hangul_SingleCandidate, Qt::Key_SingleCandidate }, { XK_Hangul_MultipleCandidate,Qt::Key_MultipleCandidate }, { XK_Hangul_PreviousCandidate,Qt::Key_PreviousCandidate }, { XK_Hangul_Special, Qt::Key_Hangul_Special }, //{ XK_Hangul_switch, Qt::Key_Hangul_switch }, { XK_Hangul_switch, Qt::Key_Mode_switch }, #endif // XK_KOREAN // dead keys { XK_dead_grave, Qt::Key_Dead_Grave }, { XK_dead_acute, Qt::Key_Dead_Acute }, { XK_dead_circumflex, Qt::Key_Dead_Circumflex }, { XK_dead_tilde, Qt::Key_Dead_Tilde }, { XK_dead_macron, Qt::Key_Dead_Macron }, { XK_dead_breve, Qt::Key_Dead_Breve }, { XK_dead_abovedot, Qt::Key_Dead_Abovedot }, { XK_dead_diaeresis, Qt::Key_Dead_Diaeresis }, { XK_dead_abovering, Qt::Key_Dead_Abovering }, { XK_dead_doubleacute, Qt::Key_Dead_Doubleacute }, { XK_dead_caron, Qt::Key_Dead_Caron }, { XK_dead_cedilla, Qt::Key_Dead_Cedilla }, { XK_dead_ogonek, Qt::Key_Dead_Ogonek }, { XK_dead_iota, Qt::Key_Dead_Iota }, { XK_dead_voiced_sound, Qt::Key_Dead_Voiced_Sound }, { XK_dead_semivoiced_sound, Qt::Key_Dead_Semivoiced_Sound }, { XK_dead_belowdot, Qt::Key_Dead_Belowdot }, { XK_dead_hook, Qt::Key_Dead_Hook }, { XK_dead_horn, Qt::Key_Dead_Horn }, // Special keys from X.org - This include multimedia keys, // wireless/bluetooth/uwb keys , special launcher keys, etc. #if 0 { XF86XK_Back, Qt::Key_Back }, { XF86XK_Forward, Qt::Key_Forward }, { XF86XK_Stop, Qt::Key_Stop }, { XF86XK_Refresh, Qt::Key_Refresh }, { XF86XK_Favorites, Qt::Key_Favorites }, { XF86XK_AudioMedia, Qt::Key_LaunchMedia }, { XF86XK_OpenURL, Qt::Key_OpenUrl }, { XF86XK_HomePage, Qt::Key_HomePage }, { XF86XK_Search, Qt::Key_Search }, { XF86XK_AudioLowerVolume, Qt::Key_VolumeDown }, { XF86XK_AudioMute, Qt::Key_VolumeMute }, { XF86XK_AudioRaiseVolume, Qt::Key_VolumeUp }, { XF86XK_AudioPlay, Qt::Key_MediaPlay }, { XF86XK_AudioStop, Qt::Key_MediaStop }, { XF86XK_AudioPrev, Qt::Key_MediaPrevious }, { XF86XK_AudioNext, Qt::Key_MediaNext }, { XF86XK_AudioRecord, Qt::Key_MediaRecord }, { XF86XK_Mail, Qt::Key_LaunchMail }, { XF86XK_MyComputer, Qt::Key_Launch0 }, { XF86XK_Calculator, Qt::Key_Calculator }, { XF86XK_Memo, Qt::Key_Memo }, { XF86XK_ToDoList, Qt::Key_ToDoList }, { XF86XK_Calendar, Qt::Key_Calendar }, { XF86XK_PowerDown, Qt::Key_PowerDown }, { XF86XK_ContrastAdjust, Qt::Key_ContrastAdjust }, { XF86XK_Standby, Qt::Key_Standby }, { XF86XK_MonBrightnessUp, Qt::Key_MonBrightnessUp }, { XF86XK_MonBrightnessDown, Qt::Key_MonBrightnessDown }, { XF86XK_KbdLightOnOff, Qt::Key_KeyboardLightOnOff }, { XF86XK_KbdBrightnessUp, Qt::Key_KeyboardBrightnessUp }, { XF86XK_KbdBrightnessDown, Qt::Key_KeyboardBrightnessDown }, { XF86XK_PowerOff, Qt::Key_PowerOff }, { XF86XK_WakeUp, Qt::Key_WakeUp }, { XF86XK_Eject, Qt::Key_Eject }, { XF86XK_ScreenSaver, Qt::Key_ScreenSaver }, { XF86XK_WWW, Qt::Key_WWW }, { XF86XK_Sleep, Qt::Key_Sleep }, { XF86XK_LightBulb, Qt::Key_LightBulb }, { XF86XK_Shop, Qt::Key_Shop }, { XF86XK_History, Qt::Key_History }, { XF86XK_AddFavorite, Qt::Key_AddFavorite }, { XF86XK_HotLinks, Qt::Key_HotLinks }, { XF86XK_BrightnessAdjust, Qt::Key_BrightnessAdjust }, { XF86XK_Finance, Qt::Key_Finance }, { XF86XK_Community, Qt::Key_Community }, { XF86XK_AudioRewind, Qt::Key_AudioRewind }, { XF86XK_BackForward, Qt::Key_BackForward }, { XF86XK_ApplicationLeft, Qt::Key_ApplicationLeft }, { XF86XK_ApplicationRight, Qt::Key_ApplicationRight }, { XF86XK_Book, Qt::Key_Book }, { XF86XK_CD, Qt::Key_CD }, { XF86XK_Calculater, Qt::Key_Calculator }, { XF86XK_Clear, Qt::Key_Clear }, { XF86XK_ClearGrab, Qt::Key_ClearGrab }, { XF86XK_Close, Qt::Key_Close }, { XF86XK_Copy, Qt::Key_Copy }, { XF86XK_Cut, Qt::Key_Cut }, { XF86XK_Display, Qt::Key_Display }, { XF86XK_DOS, Qt::Key_DOS }, { XF86XK_Documents, Qt::Key_Documents }, { XF86XK_Excel, Qt::Key_Excel }, { XF86XK_Explorer, Qt::Key_Explorer }, { XF86XK_Game, Qt::Key_Game }, { XF86XK_Go, Qt::Key_Go }, { XF86XK_iTouch, Qt::Key_iTouch }, { XF86XK_LogOff, Qt::Key_LogOff }, { XF86XK_Market, Qt::Key_Market }, { XF86XK_Meeting, Qt::Key_Meeting }, { XF86XK_MenuKB, Qt::Key_MenuKB }, { XF86XK_MenuPB, Qt::Key_MenuPB }, { XF86XK_MySites, Qt::Key_MySites }, { XF86XK_News, Qt::Key_News }, { XF86XK_OfficeHome, Qt::Key_OfficeHome }, { XF86XK_Option, Qt::Key_Option }, { XF86XK_Paste, Qt::Key_Paste }, { XF86XK_Phone, Qt::Key_Phone }, { XF86XK_Reply, Qt::Key_Reply }, { XF86XK_Reload, Qt::Key_Reload }, { XF86XK_RotateWindows, Qt::Key_RotateWindows }, { XF86XK_RotationPB, Qt::Key_RotationPB }, { XF86XK_RotationKB, Qt::Key_RotationKB }, { XF86XK_Save, Qt::Key_Save }, { XF86XK_Send, Qt::Key_Send }, { XF86XK_Spell, Qt::Key_Spell }, { XF86XK_SplitScreen, Qt::Key_SplitScreen }, { XF86XK_Support, Qt::Key_Support }, { XF86XK_TaskPane, Qt::Key_TaskPane }, { XF86XK_Terminal, Qt::Key_Terminal }, { XF86XK_Tools, Qt::Key_Tools }, { XF86XK_Travel, Qt::Key_Travel }, { XF86XK_Video, Qt::Key_Video }, { XF86XK_Word, Qt::Key_Word }, { XF86XK_Xfer, Qt::Key_Xfer }, { XF86XK_ZoomIn, Qt::Key_ZoomIn }, { XF86XK_ZoomOut, Qt::Key_ZoomOut }, { XF86XK_Away, Qt::Key_Away }, { XF86XK_Messenger, Qt::Key_Messenger }, { XF86XK_WebCam, Qt::Key_WebCam }, { XF86XK_MailForward, Qt::Key_MailForward }, { XF86XK_Pictures, Qt::Key_Pictures }, { XF86XK_Music, Qt::Key_Music }, { XF86XK_Battery, Qt::Key_Battery }, { XF86XK_Bluetooth, Qt::Key_Bluetooth }, { XF86XK_WLAN, Qt::Key_WLAN }, { XF86XK_UWB, Qt::Key_UWB }, { XF86XK_AudioForward, Qt::Key_AudioForward }, { XF86XK_AudioRepeat, Qt::Key_AudioRepeat }, { XF86XK_AudioRandomPlay, Qt::Key_AudioRandomPlay }, { XF86XK_Subtitle, Qt::Key_Subtitle }, { XF86XK_AudioCycleTrack, Qt::Key_AudioCycleTrack }, { XF86XK_Time, Qt::Key_Time }, { XF86XK_Select, Qt::Key_Select }, { XF86XK_View, Qt::Key_View }, { XF86XK_TopMenu, Qt::Key_TopMenu }, { XF86XK_Bluetooth, Qt::Key_Bluetooth }, { XF86XK_Suspend, Qt::Key_Suspend }, { XF86XK_Hibernate, Qt::Key_Hibernate }, { XF86XK_Launch0, Qt::Key_Launch2 }, { XF86XK_Launch1, Qt::Key_Launch3 }, { XF86XK_Launch2, Qt::Key_Launch4 }, { XF86XK_Launch3, Qt::Key_Launch5 }, { XF86XK_Launch4, Qt::Key_Launch6 }, { XF86XK_Launch5, Qt::Key_Launch7 }, { XF86XK_Launch6, Qt::Key_Launch8 }, { XF86XK_Launch7, Qt::Key_Launch9 }, { XF86XK_Launch8, Qt::Key_LaunchA }, { XF86XK_Launch9, Qt::Key_LaunchB }, { XF86XK_LaunchA, Qt::Key_LaunchC }, { XF86XK_LaunchB, Qt::Key_LaunchD }, { XF86XK_LaunchC, Qt::Key_LaunchE }, { XF86XK_LaunchD, Qt::Key_LaunchF }, #endif { 0, 0} }; #endif int QtKeyToXKeySym(int qtKey) { // TODO: Need to complete this function for all scenario. int i; int count = sizeof(QtKeyXSymMaps)/sizeof(KeySymMap); if (qtKey < 0x1000) { //return QChar(qtKey).toLower().unicode(); return qtKey; } for(i = 0; i < count; i++ ) { if( QtKeyXSymMaps[i].QtKey == qtKey ) { return QtKeyXSymMaps[i].XKeySym; } } return 0; } int XKeySymToQTKey(uint keySym) { int i; int count = sizeof(QtKeyXSymMaps)/sizeof(KeySymMap); if ((keySym < 0x1000)) { //if (keySym >= 'a' && keySym <= 'z') // return QChar(keySym).toUpper().toAscii(); return keySym; } #ifdef Q_WS_WIN if(keySym < 0x3000) return keySym; #else if (keySym < 0x3000 ) return keySym | Qt::UNICODE_ACCEL; for(i = 0; i < count; i++) if(QtKeyXSymMaps[i].XKeySym == keySym) return QtKeyXSymMaps[i].QtKey; #endif return Qt::Key_unknown; } inputcontext-gtk-0.99.1/gtk-input-context/client-gtk/qt-keysym-map.h000066400000000000000000000002761262162564000255060ustar00rootroot00000000000000#ifndef _QT_KEYSYM_MAP_H #define _QT_KEYSYM_MAP_H #include G_BEGIN_DECLS int QtKeyToXKeySym(int qtKey); int XKeySymToQTKey(uint keySym); G_END_DECLS #endif //_QT_KEYSYM_MAP_H inputcontext-gtk-0.99.1/gtk-input-context/client-gtk3/000077500000000000000000000000001262162564000226755ustar00rootroot00000000000000inputcontext-gtk-0.99.1/gtk-input-context/client-gtk3/client-gtk3.pro000066400000000000000000000046471262162564000255560ustar00rootroot00000000000000TOP_DIR = ../.. include($$TOP_DIR/config.pri) TEMPLATE = lib TARGET = im-maliit CONFIG += plugin CONFIG += link_pkgconfig PKGCONFIG += gtk+-3.0 maliit-glib QMAKE_CXXFLAGS_DEBUG+=-Wno-error=deprecated-declarations QMAKE_CFLAGS_DEBUG+=-Wno-error=deprecated-declarations DEFINES += G_LOG_DOMAIN=\\\"Maliit\\\" x11 { DEFINES += HAVE_X11 } HEADERS += \ ../client-gtk/client-imcontext-gtk.h \ ../client-gtk/qt-gtk-translate.h \ ../client-gtk/qt-keysym-map.h \ ../client-gtk/debug.h \ SOURCES += \ ../client-gtk/gtk-imcontext-plugin.c \ ../client-gtk/client-imcontext-gtk.c \ ../client-gtk/qt-gtk-translate.cpp \ ../client-gtk/qt-keysym-map.cpp \ ../client-gtk/debug.c \ GTK3_IM_LIBDIR = $$system(pkg-config --variable=libdir gtk+-3.0) GTK3_PREFIX = $$system(pkg-config --variable prefix gtk+-3.0) local-install { GTK3_IM_LIBDIR = $$replace(GTK3_IM_LIBDIR, $$GTK3_PREFIX, $$PREFIX) } GTK3_BINARY_VERSION = $$system(pkg-config --variable=gtk_binary_version gtk+-3.0) GTK3_DIR = $$GTK3_IM_LIBDIR/gtk-3.0/$$GTK3_BINARY_VERSION GTK3_IM_MODULEDIR = $$GTK3_DIR/immodules target.path += $$GTK3_IM_MODULEDIR INSTALLS += target !disable-gtk-cache-update { # need to make sure dynamic linker can find maliit libraries when running gtk-query-module ldconfig.extra = ldconfig ldconfig.path = . # dummy path INSTALLS += ldconfig DISTRO = $$system(lsb_release -s -i) DISTRO_VERSION = $$system(lsb_release -s -r) isEqual(DISTRO, Ubuntu) { QUERY_IM_BIN = gtk-query-immodules-3.0 greaterThan(DISTRO_VERSION, 11) { QUERY_IM_BIN = $$GTK3_IM_LIBDIR/libgtk-3-0/gtk-query-immodules-3.0 } update-im-cache.path = $$GTK3_DIR/ update-im-cache.extra = $$QUERY_IM_BIN > $$GTK3_DIR/gtk.immodules update-im-cache.uninstall = $$QUERY_IM_BIN > $$GTK3_DIR/gtk.immodules INSTALLS *= update-im-cache } system(test -e /etc/fedora-release) { update-im-cache.path = $$GTK3_DIR/ 64bit = $$find(GTK3_IM_LIBDIR, lib64) !isEmpty(64bit) { update-im-cache.extra = gtk-query-immodules-3.0-64 --update-cache update-im-cache.uninstall = gtk-query-immodules-3.0-64 --update-cache } else { update-im-cache.extra = gtk-query-immodules-3.0-32 --update-cache update-im-cache.uninstall = gtk-query-immodules-3.0-32 --update-cache } INSTALLS *= update-im-cache } } inputcontext-gtk-0.99.1/gtk-input-context/gtk-input-context.pro000066400000000000000000000002421262162564000246750ustar00rootroot00000000000000include(../config.pri) TEMPLATE = subdirs system(pkg-config gtk+-2.0) { SUBDIRS += client-gtk } system(pkg-config gtk+-3.0) { SUBDIRS += client-gtk3 } inputcontext-gtk-0.99.1/maliit-inputcontext-gtk.pro000066400000000000000000000034511262162564000224760ustar00rootroot00000000000000include(./config.pri) !isEmpty(HELP) { # Output help help_string = \ Important build options: \ \\n\\t PREFIX : Install prefix (default: /usr) \ \\n\\t {BIN,LIB,INCLUDE,DOC}DIR : Install prefix for specific types of files \ \\nRecognised CONFIG flags: \ \\n\\t x11 : Compile with X11 support \ \\n\\t disable-gtk-cache-update : Do not update GTK2/3 input method caches (used for packaging) \ \\n\\t local-install : Install everything underneath PREFIX, nothing to system directories reported by GTK+, Qt, DBus etc. \ \\nInfluential environment variables: \ \\n\\t PKG_CONFIG_PATH : Override standard directories to look for pkg-config information \ \\nExamples: \ \\n\\t qmake \ \\n\\t qmake PREFIX=/usr LIBDIR=/usr/lib64 CONFIG+=disable-gtk-cache-update \ \\n\\t qmake PREFIX=/usr MALIIT_DEFAULT_PLUGIN=libmykeyboard.so !build_pass:system(echo -e \"$$help_string\") } else { config_string = Tip: Run qmake HELP=1 for a list of all supported build options !build_pass:system(echo -e \"$$config_string\") } CONFIG += ordered TEMPLATE = subdirs SUBDIRS = gtk-input-context QMAKE_EXTRA_TARGETS += check-xml check-xml.target = check-xml check-xml.CONFIG = recursive QMAKE_EXTRA_TARGETS += check check.target = check check.CONFIG = recursive DIST_NAME = $$MALIIT_PACKAGENAME-$$MALIIT_VERSION DIST_PATH = $$OUT_PWD/$$DIST_NAME TARBALL_SUFFIX = .tar.bz2 TARBALL_PATH = $$DIST_PATH$$TARBALL_SUFFIX # The 'make dist' target # Creates a tarball QMAKE_EXTRA_TARGETS += release release.target = release release.commands += git archive HEAD --prefix=$$DIST_NAME/ | bzip2 > $$TARBALL_PATH; release.commands += md5sum $$TARBALL_PATH | cut -d \' \' -f 1 > $$DIST_PATH\\.md5 OTHER_FILES += NEWS README INSTALL.local