Import Upstream version 5.0.18

This commit is contained in:
hanteng@kylinos.cn 2022-10-08 15:16:30 +08:00
commit 795f515838
655 changed files with 120034 additions and 0 deletions

74
.clang-format Normal file
View File

@ -0,0 +1,74 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: false
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: true
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: true
Standard: Cpp11
IndentWidth: 4
TabWidth: 4
UseTab: Never
BreakBeforeBraces: Attach
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
SortIncludes: true
IncludeCategories:
# C system headers.
- Regex: '^[<"](aio|arpa/inet|assert|complex|cpio|ctype|curses|dirent|dlfcn|errno|fcntl|fenv|float|fmtmsg|fnmatch|ftw|glob|grp|iconv|inttypes|iso646|langinfo|libgen|limits|locale|math|monetary|mqueue|ndbm|netdb|net/if|netinet/in|netinet/tcp|nl_types|poll|pthread|pwd|regex|sched|search|semaphore|setjmp|signal|spawn|stdalign|stdarg|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|strings|stropts|sys/ipc|syslog|sys/mman|sys/msg|sys/resource|sys/select|sys/sem|sys/shm|sys/socket|sys/stat|sys/statvfs|sys/time|sys/times|sys/types|sys/uio|sys/un|sys/utsname|sys/wait|tar|term|termios|tgmath|threads|time|trace|uchar|ulimit|uncntrl|unistd|utime|utmpx|wchar|wctype|wordexp)\.h[">]$'
Priority: 20
# C++ system headers (as of C++17).
- Regex: '^[<"](algorithm|any|array|atomic|bitset|cassert|ccomplex|cctype|cerrno|cfenv|cfloat|charconv|chrono|cinttypes|ciso646|climits|clocale|cmath|codecvt|complex|condition_variable|csetjmp|csignal|cstdalign|cstdarg|cstdbool|cstddef|cstdint|cstdio|cstdlib|cstring|ctgmath|ctime|cuchar|cwchar|cwctype|deque|exception|execution|filesystem|forward_list|fstream|functional|future|initializer_list|iomanip|ios|iosfwd|iostream|istream|iterator|limits|list|locale|map|memory|memory_resource|mutex|new|numeric|optional|ostream|queue|random|ratio|regex|scoped_allocator|set|shared_mutex|sstream|stack|stdexcept|streambuf|string|string_view|strstream|system_error|thread|tuple|type_traits|typeindex|typeinfo|unordered_map|unordered_set|utility|valarray|variant|vector)[">]$'
Priority: 30
# Other libraries' h files (with angles).
- Regex: '^<'
Priority: 40
# Your project's h files.
- Regex: '^[<"]fcitx'
Priority: 45
# Other libraries' h files (with quotes).
- Regex: '^"'
Priority: 50
...

15
.codedocs Normal file
View File

@ -0,0 +1,15 @@
INPUT = src/lib
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = Fcitx
OUTPUT_LANGUAGE = English
SOURCE_BROWSER = YES
FILE_PATTERNS =
QT_AUTOBRIEF = YES
RECURSIVE = YES
STRIP_CODE_COMMENTS = NO
EXCLUDE_PATTERNS = "*/src/lib/fcitx-wayland/*" "*/*_p.h"
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
STRIP_FROM_PATH = src/lib
STRIP_FROM_INC_PATH = src/lib

4
.formatignore Normal file
View File

@ -0,0 +1,4 @@
keynametable.h
keysymgen.h
keysymdef.h
XF86keysym.h

32
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
If the problem is about you can not use fcitx in certain application, or the input window is placed in wrong place, be sure to include which application is being typed, and the output of fcitx5-diagnose command.
Specifically, it is Ok to write the issue in Chinese (either Simplified or Traditional), because lots of developers understand Chinese.
可以用中文(简体或繁体)汇报问题。
The opened issue might be closed right away if it is considered a configuration issue (E.g. required packages not installed, wrong environment variables, misconfiguration like not adding wrong input method engine to the configuration, etc), but you may continue to use the issue comment to follow up for support.
**To Reproduce**
Steps to reproduce the behavior:
1. Open ... app
2. Try to type ...
**Expected behavior**
A clear and concise description of what you expected to happen.
**Desktop (please complete the following information):**
- Desktop: (KDE, GNOME, etc)
- Display server type: X11, Wayland
- The output of fcitx5-diagnose if possible.
**Additional context**
Add any other context about the problem here.

244
CMakeLists.txt Normal file
View File

@ -0,0 +1,244 @@
cmake_minimum_required(VERSION 3.6.0)
project(fcitx VERSION 5.1.0)
set(FCITX_VERSION ${PROJECT_VERSION})
find_package(ECM REQUIRED 1.0.0)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
#######################################################################
# CMake macros
#######################################################################
include(FeatureSummary)
include(GNUInstallDirs)
include(ECMSetupVersion)
include(GenerateExportHeader)
include(WriteBasicConfigVersionFile)
include(ECMUninstallTarget)
include(src/lib/fcitx-utils/Fcitx5Macros.cmake)
include(CheckSymbolExists)
#######################################################################
# Options
#######################################################################
option(ENABLE_TEST "Build Test" On)
option(ENABLE_COVERAGE "Build the project with gcov support (Need ENABLE_TEST=On)" Off)
set(GCOV_TOOL "gcov" CACHE STRING "Path to gcov tool used by coverage.")
set(DEFAULT_XKB_RULES "evdev" CACHE STRING "Xkb rules name")
option(ENABLE_ENCHANT "Enable enchant for word predication" On)
option(ENABLE_X11 "Enable X11 support" On)
option(ENABLE_WAYLAND "Enable wayland support" On)
option(ENABLE_DBUS "Enable DBus" On)
option(ENABLE_DOC "Build doxygen" Off)
option(ENABLE_SERVER "Build a fcitx as server, disable this option if you want to use fcitx as an embedded library." On)
option(ENABLE_KEYBOARD "Enable key event translation with XKB and build keyboard engine" On)
option(USE_SYSTEMD "Use systemd for event loop and dbus, will fallback to libevent/libdbus if not found." On)
option(ENABLE_XDGAUTOSTART "Enable xdg autostart desktop file installation" On)
option(USE_FLATPAK_ICON "Use flatpak icon name for desktop files" Off)
set(CLDR_DIR "" CACHE STRING "Unicode CLDR (Common Locale Data Repository) directory")
option(ENABLE_EMOJI "Enable emoji loading for CLDR" On)
option(ENABLE_LIBUUID "Use libuuid for uuid generation" On)
set(NO_PREEDIT_APPS "gvim.*,wps.*,wpp.*,et.*" CACHE STRING "Disable preedit for follwing app by default.")
if (CLDR_DIR STREQUAL "")
if (IS_DIRECTORY "${CMAKE_INSTALL_FULL_DATADIR}/unicode/cldr")
set(CLDR_DIR "${CMAKE_INSTALL_FULL_DATADIR}/unicode/cldr")
else(IS_DIRECTORY "/usr/share/unicode/cldr")
set(CLDR_DIR "/usr/share/unicode/cldr")
endif()
endif()
set(EMOJI_FOUND FALSE)
if (ENABLE_EMOJI)
if (CLDR_DIR STREQUAL "" OR NOT IS_DIRECTORY "${CLDR_DIR}/common/annotations/")
message(WARNING "Could not find Unicode CLDR Annotation directory")
else()
set(EMOJI_FOUND TRUE)
endif()
endif()
if ((ENABLE_WAYLAND OR ENABLE_X11) AND NOT ENABLE_KEYBOARD)
message(FATAL_ERROR "X11 and Wayland require ENABLE_KEYBOARD to be set to ON.")
endif ()
#######################################################################
# Find packages
#######################################################################
find_package(PkgConfig REQUIRED)
if (USE_SYSTEMD)
find_package(Systemd)
endif ()
if (USE_FLATPAK_ICON)
set(FCITX_ICON_NAME "org.fcitx.Fcitx5")
else()
set(FCITX_ICON_NAME "fcitx")
endif()
if (NOT TARGET Systemd::Systemd)
if (ENABLE_DBUS)
pkg_check_modules(DBus REQUIRED IMPORTED_TARGET "dbus-1")
pkg_get_variable(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "dbus-1" "system_bus_default_address")
endif()
if (NOT (TARGET libevent::core OR TARGET PkgConfig::LibEvent))
find_package(Libevent)
endif()
if (TARGET libevent::core)
set(LIBEVENT_TARGET libevent::core)
else()
pkg_check_modules(LibEvent REQUIRED IMPORTED_TARGET "libevent_core")
set(LIBEVENT_TARGET PkgConfig::LibEvent)
endif()
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly")
find_package(LibKVM REQUIRED)
endif()
find_package(DL REQUIRED)
if (NOT TARGET LibIntl::LibIntl)
find_package(LibIntl REQUIRED)
endif()
if (ENABLE_LIBUUID)
find_package(LibUUID REQUIRED)
endif()
find_package(Pthread REQUIRED)
find_package(Execinfo)
find_package(Gettext REQUIRED)
if (NOT (TARGET fmt::fmt OR TARGET fmt::fmt-header-only))
find_package(fmt REQUIRED)
endif()
if (TARGET fmt::fmt-header-only)
set(FMT_TARGET fmt::fmt-header-only)
else()
set(FMT_TARGET fmt::fmt)
endif ()
set(REQUIRED_XKBCOMMON_COMPONENTS XKBCommon)
if (ENABLE_X11)
set(REQUIRED_XKBCOMMON_COMPONENTS ${REQUIRED_XKBCOMMON_COMPONENTS} X11)
find_package(XCB REQUIRED COMPONENTS XCB AUX XKB XFIXES ICCCM XINERAMA RANDR EWMH KEYSYMS)
find_package(XCBImdkit 1.0.3 REQUIRED)
pkg_check_modules(CairoXCB REQUIRED IMPORTED_TARGET cairo-xcb)
pkg_check_modules(XkbFile REQUIRED IMPORTED_TARGET "xkbfile")
endif()
if (EMOJI_FOUND OR ENABLE_KEYBOARD)
find_package(Expat REQUIRED)
endif()
if (ENABLE_KEYBOARD)
find_package(XKBCommon REQUIRED COMPONENTS ${REQUIRED_XKBCOMMON_COMPONENTS})
find_package(IsoCodes REQUIRED)
find_package(XKeyboardConfig REQUIRED)
pkg_check_modules(JsonC REQUIRED IMPORTED_TARGET "json-c")
set(DEFAULT_XKB_RULES_FILES "${XKEYBOARDCONFIG_XKBBASE}/rules/${DEFAULT_XKB_RULES}.xml")
if (NOT EXISTS "${DEFAULT_XKB_RULES_FILES}")
message(FATAL_ERROR "Could not find default xkb rules file: ${DEFAULT_XKB_RULES_FILES}")
endif()
endif()
# Library for classicui painting
if (ENABLE_X11 OR ENABLE_WAYLAND)
pkg_check_modules(Cairo IMPORTED_TARGET cairo)
pkg_check_modules(Pango IMPORTED_TARGET pango pangocairo)
pkg_check_modules(GdkPixbuf IMPORTED_TARGET gdk-pixbuf-2.0)
pkg_check_modules(GioUnix IMPORTED_TARGET gio-unix-2.0)
endif()
if (ENABLE_WAYLAND)
set(REQUIRED_WAYLAND_COMPONENTS Client)
find_package(Wayland REQUIRED COMPONENTS ${REQUIRED_WAYLAND_COMPONENTS})
find_package(WaylandScanner REQUIRED)
find_package(WaylandProtocols REQUIRED)
pkg_check_modules(Gio IMPORTED_TARGET gio-2.0)
endif()
if(ENABLE_ENCHANT)
pkg_check_modules(Enchant IMPORTED_TARGET "enchant-2")
if(NOT TARGET PkgConfig::Enchant)
pkg_check_modules(Enchant IMPORTED_TARGET "enchant" REQUIRED)
endif()
endif()
if (TARGET Wayland::Client AND ENABLE_WAYLAND)
set(WAYLAND_FOUND TRUE)
else()
set(WAYLAND_FOUND FALSE)
endif()
# directory needed by bsd
if(NOT CMAKE_INSTALL_LIBDATADIR)
set(CMAKE_INSTALL_LIBDATADIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "libdata root (LIBDIR)")
endif()
get_filename_component(CMAKE_INSTALL_FULL_LIBDATADIR "${CMAKE_INSTALL_LIBDATADIR}" ABSOLUTE)
mark_as_advanced(CMAKE_INSTALL_LIBDATADIR)
mark_as_advanced(CMAKE_INSTALL_FULL_LIBDATADIR)
include(Fcitx5CompilerSettings)
set(FCITX_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(FCITX_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set(FCITX_INSTALL_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR})
set(FCITX_INSTALL_LIBDATADIR ${CMAKE_INSTALL_FULL_LIBDATADIR})
set(FCITX_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_FULL_LIBEXECDIR})
set(FCITX_INSTALL_DATADIR ${CMAKE_INSTALL_FULL_DATADIR})
set(FCITX_INSTALL_PKGDATADIR "${CMAKE_INSTALL_FULL_DATADIR}/fcitx5")
set(FCITX_INSTALL_BINDIR ${CMAKE_INSTALL_FULL_BINDIR})
set(FCITX_INSTALL_LOCALEDIR ${CMAKE_INSTALL_FULL_LOCALEDIR})
set(FCITX_INSTALL_ADDONDIR "${CMAKE_INSTALL_FULL_LIBDIR}/fcitx5")
set(FCITX_INSTALL_CMAKECONFIG_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/cmake")
set(FCITX_INSTALL_MODULE_HEADER_DIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}/Fcitx5/Module/fcitx-module")
# TODO mac/win
set(FCITX_LIBRARY_SUFFIX ".so")
check_function_exists(pipe2 HAVE_PIPE2)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(po)
add_subdirectory(testing)
#######################################################################
# Test features
#######################################################################
if (ENABLE_TEST)
enable_testing()
add_subdirectory(test)
if (ENABLE_COVERAGE)
add_custom_target(coverage
COMMAND "${CMAKE_CTEST_COMMAND}"
COMMAND lcov --gcov-tool "${GCOV_TOOL}" --no-external --capture --directory ./ -b "${CMAKE_CURRENT_SOURCE_DIR}" --output-file coverage.info
COMMAND genhtml coverage.info --output-directory "coverage_pages"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
endif ()
if (ENABLE_DOC)
find_package(Doxygen REQUIRED)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/.codedocs" FCITX_DOXYGEN_CONFIGURATION)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY)
add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

4
Doxyfile.in Normal file
View File

@ -0,0 +1,4 @@
OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/doc/
PROJECT_NUMBER = @FCITX_VERSION@
@FCITX_DOXYGEN_CONFIGURATION@

View File

@ -0,0 +1,468 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, 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.
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.
<one line to give the library's name and an idea of what it does.>
Copyright (C) <year> <name of author>
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 Street, 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.
< signature of Ty Coon > , 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

3
Messages.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
gen_pot cxx:desktop:appdata:sh fcitx5 po .

22
README.md Normal file
View File

@ -0,0 +1,22 @@
Next generation of fcitx
==========================
Fcitx 5 is a generic input method framework released under LGPL-2.1+.
[![Jenkins Build Status](https://img.shields.io/jenkins/s/https/jenkins.fcitx-im.org/job/fcitx5.svg)](https://jenkins.fcitx-im.org/job/fcitx5/)
[![Coverity Scan Status](https://img.shields.io/coverity/scan/9063.svg)](https://scan.coverity.com/projects/fcitx-fcitx5)
[![Documentation](https://codedocs.xyz/fcitx/fcitx5.svg)](https://codedocs.xyz/fcitx/fcitx5/)
* Wiki: [https://fcitx-im.org/](https://fcitx-im.org/)
- Registration require explicit approval due to the spam, please send an email to the mail list if you do not get approved.
* Discussion:
- [fcitx [at] googlegroups.com](https://groups.google.com/g/fcitx)
- [https://github.com/fcitx/fcitx5/discussions](https://github.com/fcitx/fcitx5/discussions)
- Telegram: https://fcitx-im.org/telegram/captcha.html
- IRC: [#fcitx [at] libera.chat](https://web.libera.chat/?channels=#fcitx)
* Bug report: [https://github.com/fcitx/fcitx5/issues](https://github.com/fcitx/fcitx5/issues)
- You can always report any fcitx 5 issue here, it might be transfer to other repos later.
* Translation: [https://www.transifex.com/fcitx/](https://www.transifex.com/fcitx/)
- Do not send pull request for translation updates.
- The translation will be automatically pushed to git repository nightly, but not vice versa.
[![Packaging status](https://repology.org/badge/vertical-allrepos/fcitx5.svg)](https://repology.org/project/fcitx5/versions)

View File

@ -0,0 +1,38 @@
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED TRUE)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--as-needed ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined -Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}")
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN On)
if (POLICY CMP0063)
# No sane project should be affected by CMP0063, so suppress the warnings
# generated by the above visibility settings in CMake >= 3.3
cmake_policy(SET CMP0063 NEW)
endif()
if(ENABLE_COVERAGE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
endif()
# RPATH
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_FULL_LIBDIR}" _isSystemPlatformLibDir)
list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_FULL_LIBDIR}" _isSystemCxxLibDir)
if("${_isSystemPlatformLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1")
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif("${_isSystemPlatformLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1")

51
cmake/FindDL.cmake Normal file
View File

@ -0,0 +1,51 @@
# - find where dlopen and friends are located.
# DL_FOUND - system has dynamic linking interface available
# DL_INCLUDE_DIR - where dlfcn.h is located.
# DL_LIBRARY - libraries needed to use dlopen
include(CheckFunctionExists)
include(CheckSymbolExists)
find_path(DL_INCLUDE_DIR NAMES dlfcn.h)
find_library(DL_LIBRARY NAMES dl)
if(DL_LIBRARY)
set(DL_FOUND TRUE)
else(DL_LIBRARY)
check_function_exists(dlopen DL_FOUND)
# If dlopen can be found without linking in dl then dlopen is part
# of libc, so don't need to link extra libs.
set(DL_LIBRARY "")
endif(DL_LIBRARY)
if (DL_FOUND)
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
set(CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARY})
set(CMAKE_REQUIRED_INCLUDES ${DL_INCLUDE_DIR})
check_symbol_exists(dlmopen "dlfcn.h" HAS_DLMOPEN)
unset(CMAKE_REQUIRED_DEFINITIONS)
unset(CMAKE_REQUIRED_LIBRARIES)
unset(CMAKE_REQUIRED_INCLUDES)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DL
FOUND_VAR
DL_FOUND
REQUIRED_VARS
DL_INCLUDE_DIR
)
mark_as_advanced(DL_INCLUDE_DIR DL_LIBRARY)
if(DL_FOUND AND NOT TARGET DL::DL)
if (DL_LIBRARY)
add_library(DL::DL UNKNOWN IMPORTED)
set_target_properties(DL::DL PROPERTIES
IMPORTED_LOCATION "${DL_LIBRARY}")
else()
add_library(DL::DL INTERFACE IMPORTED )
endif()
set_target_properties(DL::DL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${DL_INCLUDE_DIR}"
)
endif()

46
cmake/FindExecinfo.cmake Normal file
View File

@ -0,0 +1,46 @@
# Try to find Execinfo functionality
# Once done this will define
#
# EXECINFO_FOUND - system has LibExecinfo
# EXECINFO_INCLUDE_DIR - LibExecinfo include directory
# EXECINFO_LIBRARY - Library needed to use Execinfo
include(CheckFunctionExists)
find_path(EXECINFO_INCLUDE_DIR NAMES execinfo.h)
if (EXECINFO_INCLUDE_DIR)
check_function_exists(backtrace EXECINFO_LIBC_HAS_BACKTRACE)
if (EXECINFO_LIBC_HAS_BACKTRACE)
set(EXECINFO_LIBRARY "")
set(EXECINFO_FOUND TRUE)
else ()
find_library(EXECINFO_LIBRARY NAMES execinfo libexecinfo )
if (EXECINFO_LIBRARY)
set(EXECINFO_FOUND TRUE)
endif()
endif ()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Execinfo
FOUND_VAR
EXECINFO_FOUND
REQUIRED_VARS
EXECINFO_INCLUDE_DIR
)
mark_as_advanced(EXECINFO_INCLUDE_DIR EXECINFO_LIBRARY EXECINFO_LIBC_HAS_BACKTRACE)
if(EXECINFO_FOUND AND NOT TARGET Execinfo::Execinfo)
if (EXECINFO_LIBRARY)
add_library(Execinfo::Execinfo UNKNOWN IMPORTED)
set_target_properties(Execinfo::Execinfo PROPERTIES
IMPORTED_LOCATION "${EXECINFO_LIBRARY}")
else()
add_library(Execinfo::Execinfo INTERFACE IMPORTED )
endif()
set_target_properties(Execinfo::Execinfo PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${EXECINFO_INCLUDE_DIR}"
)
endif()

54
cmake/FindExpat.cmake Normal file
View File

@ -0,0 +1,54 @@
#.rst:
# FindExpat
# -----------
#
# Try to find the Expat xml processing library
#
# Once done this will define
#
# ::
#
# EXPAT_FOUND - System has Expat
# EXPAT_INCLUDE_DIR - The Expat include directory
# EXPAT_LIBRARIES - The libraries needed to use Expat
# EXPAT_DEFINITIONS - Compiler switches required for using Expat
# EXPAT_VERSION_STRING - the version of Expat found (since CMake 2.8.8)
# use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_EXPAT QUIET expat)
find_path(EXPAT_INCLUDE_DIR NAMES expat.h
HINTS
${PC_EXPAT_INCLUDEDIR}
${PC_EXPAT_INCLUDE_DIRS}
)
find_library(EXPAT_LIBRARIES NAMES expat
HINTS
${PC_EXPAT_LIBDIR}
${PC_EXPAT_LIBRARY_DIRS}
)
if(PC_EXPAT_VERSION)
set(EXPAT_VERSION_STRING ${PC_EXPAT_VERSION})
endif()
# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Expat
REQUIRED_VARS EXPAT_LIBRARIES EXPAT_INCLUDE_DIR
VERSION_VAR EXPAT_VERSION_STRING)
mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARIES)
if (EXPAT_FOUND AND NOT TARGET Expat::Expat)
add_library(Expat::Expat UNKNOWN IMPORTED)
set_target_properties(Expat::Expat PROPERTIES
IMPORTED_LOCATION "${EXPAT_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${EXPAT_INCLUDE_DIR}"
)
endif()

32
cmake/FindIsoCodes.cmake Normal file
View File

@ -0,0 +1,32 @@
# - Try to find the IsoCodes libraries
# Once done this will define
#
# ISOCODES_FOUND - system has ISOCODES
# ISOCODES_INCLUDE_DIR - the ISOCODES include directory
# ISOCODES_LIBRARIES - ISOCODES library
#
# Copyright (c) 2012 CSSlayer <wengxt@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if(ISOCODES_INCLUDE_DIR AND ISOCODES_LIBRARIES)
# Already in cache, be silent
set(ISOCODES_FIND_QUIETLY TRUE)
endif(ISOCODES_INCLUDE_DIR AND ISOCODES_LIBRARIES)
find_package(PkgConfig)
pkg_check_modules(PC_ISOCODES iso-codes)
find_file(ISOCODES_ISO639_JSON iso_639-3.json
HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
)
find_file(ISOCODES_ISO3166_JSON iso_3166-1.json
HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IsoCodes DEFAULT_MSG ISOCODES_ISO639_JSON ISOCODES_ISO3166_JSON)
mark_as_advanced(ISOCODES_ISO639_JSON ISOCODES_ISO3166_JSON)

41
cmake/FindLibIntl.cmake Normal file
View File

@ -0,0 +1,41 @@
# - find where dlopen and friends are located.
# LibIntl_FOUND - system has dynamic linking interface available
# LibIntl_INCLUDE_DIR - where dlfcn.h is located.
# LibIntl_LIBRARY - libraries needed to use dlopen
include(CheckFunctionExists)
find_path(LibIntl_INCLUDE_DIR NAMES libintl.h)
find_library(LibIntl_LIBRARY NAMES intl)
if(LibIntl_LIBRARY)
set(LibIntl_FOUND TRUE)
else(LibIntl_LIBRARY)
check_function_exists(dgettext LibIntl_FOUND)
# If dlopen can be found without linking in dl then dlopen is part
# of libc, so don't need to link extra libs.
set(LibIntl_LIBRARY "")
endif(LibIntl_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibIntl
FOUND_VAR
LibIntl_FOUND
REQUIRED_VARS
LibIntl_INCLUDE_DIR
)
mark_as_advanced(LibIntl_INCLUDE_DIR LibIntl_LIBRARY)
if(LibIntl_FOUND AND NOT TARGET LibIntl::LibIntl)
if (LibIntl_LIBRARY)
add_library(LibIntl::LibIntl UNKNOWN IMPORTED)
set_target_properties(LibIntl::LibIntl PROPERTIES
IMPORTED_LOCATION "${LibIntl_LIBRARY}")
else()
add_library(LibIntl::LibIntl INTERFACE IMPORTED )
endif()
set_target_properties(LibIntl::LibIntl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LibIntl_INCLUDE_DIR}"
)
endif()

25
cmake/FindLibKVM.cmake Normal file
View File

@ -0,0 +1,25 @@
# Try to find LibKVM functionality
# Once done this will define
#
# LIBKVM_FOUND - system has LibKVM
# LIBKVM_INCLUDE_DIR - LibKVM include directory
# LIBKVM_LIBRARIES - Libraries needed to use LibKVM
#
find_path(LIBKVM_INCLUDE_DIR kvm.h)
find_library(LIBKVM_LIBRARIES NAMES kvm)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibKVM
REQUIRED_VARS LIBKVM_INCLUDE_DIR LIBKVM_LIBRARIES
)
mark_as_advanced(LIBKVM_INCLUDE_DIR LIBKVM_LIBRARIES)
if(LIBKVM_FOUND AND NOT TARGET LibKVM::LibKVM)
add_library(LibKVM::LibKVM UNKNOWN IMPORTED)
set_target_properties(LibKVM::LibKVM PROPERTIES
IMPORTED_LOCATION "${LIBKVM_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBKVM_INCLUDE_DIR}"
)
endif()

43
cmake/FindLibUUID.cmake Normal file
View File

@ -0,0 +1,43 @@
find_package(PkgConfig)
pkg_check_modules(PKG_LIBUUID QUIET uuid)
set(LIBUUID_DEFINITIONS ${PKG_LIBUUID_CFLAGS_OTHER})
set(LIBUUID_VERSION ${PKG_LIBUUID_VERSION})
find_path(LIBUUID_INCLUDE_DIR
NAMES uuid.h
HINTS ${PKG_LIBUUID_INCLUDE_DIRS}
)
find_library(LIBUUID_LIBRARY
NAMES uuid
HINTS ${PKG_LIBUUID_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibUUID
FOUND_VAR
LIBUUID_FOUND
REQUIRED_VARS
LIBUUID_LIBRARY
LIBUUID_INCLUDE_DIR
VERSION_VAR
LIBUUID_VERSION
)
if(LIBUUID_FOUND AND NOT TARGET LibUUID::LibUUID)
add_library(LibUUID::LibUUID UNKNOWN IMPORTED)
set_target_properties(LibUUID::LibUUID PROPERTIES
IMPORTED_LOCATION "${LIBUUID_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${LIBUUID_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBUUID_INCLUDE_DIR}"
)
endif()
mark_as_advanced(LIBUUID_INCLUDE_DIR LIBUUID_LIBRARY)
include(FeatureSummary)
set_package_properties(LibUUID PROPERTIES
URL "http://www.kernel.org/pub/linux/utils/util-linux/"
DESCRIPTION "uuid library in util-linux"
)

57
cmake/FindPango.cmake Normal file
View File

@ -0,0 +1,57 @@
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake)
ecm_find_package_version_check(Pango)
# Note that this list needs to be ordered such that any component
# appears after its dependencies
set(Pango_known_components
Pango
Cairo
Ft2
Xft)
set(Pango_Pango_component_deps)
set(Pango_Pango_pkg_config "pango")
set(Pango_Pango_lib "pango-1.0")
set(Pango_Pango_header "pango/pango.h")
set(Pango_Cairo_component_deps Pango)
set(Pango_Cairo_pkg_config "pangocairo")
set(Pango_Cairo_lib "pangocairo-1.0")
set(Pango_Cairo_header "pango/pangocairo.h")
set(Pango_Ft2_component_deps Pango)
set(Pango_Ft2_pkg_config "pangoft2")
set(Pango_Ft2_lib "pangoft2-1.0")
set(Pango_Ft2_header "pango/pangoft2.h")
set(Pango_Xft_component_deps Pango)
set(Pango_Xft_pkg_config "pangoxft")
set(Pango_Xft_lib "pangoxft-1.0")
set(Pango_Xft_header "pango/pangoxft.h")
ecm_find_package_parse_components(Pango
RESULT_VAR Pango_components
KNOWN_COMPONENTS ${Pango_known_components}
)
ecm_find_package_handle_library_components(Pango
COMPONENTS ${Pango_components}
)
find_package_handle_standard_args(Pango
FOUND_VAR
Pango_FOUND
REQUIRED_VARS
Pango_LIBRARIES
VERSION_VAR
Pango_VERSION
HANDLE_COMPONENTS
)
include(FeatureSummary)
set_package_properties(Pango PROPERTIES
URL "http://www.pango.org/"
DESCRIPTION "A library for layout and rendering of text"
)

59
cmake/FindPthread.cmake Normal file
View File

@ -0,0 +1,59 @@
# Try to find Pthread functionality
# Once done this will define
#
# PTHREAD_FOUND - system has Pthread
# PTHREAD_INCLUDE_DIR - Pthread include directory
# PTHREAD_LIBRARIES - Libraries needed to use Pthread
#
# TODO: This will enable translations only if Gettext functionality is
# present in libc. Must have more robust system for release, where Gettext
# functionality can also reside in standalone Gettext library, or the one
# embedded within kdelibs (cf. gettext.m4 from Gettext source).
#
# Copyright (c) 2006, Chusslove Illich, <caslav.ilic@gmx.net>
# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org>
# Copyright (c) 2016, Xuetian Weng <wengxt@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
find_path(PTHREAD_INCLUDE_DIR NAMES pthread.h)
if(PTHREAD_INCLUDE_DIR)
include(CheckFunctionExists)
check_function_exists(pthread_create PTHREAD_LIBC_HAS_PTHREAD_CREATE)
if (PTHREAD_LIBC_HAS_PTHREAD_CREATE)
set(PTHREAD_LIBRARIES)
set(PTHREAD_LIB_FOUND TRUE)
else (PTHREAD_LIBC_HAS_PTHREAD_CREATE)
find_library(PTHREAD_LIBRARIES NAMES pthread libpthread )
if(PTHREAD_LIBRARIES)
set(PTHREAD_LIB_FOUND TRUE)
endif(PTHREAD_LIBRARIES)
endif (PTHREAD_LIBC_HAS_PTHREAD_CREATE)
endif(PTHREAD_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Pthread
FOUND_VAR
PTHREAD_FOUND
REQUIRED_VARS
PTHREAD_INCLUDE_DIR PTHREAD_LIB_FOUND
)
if(PTHREAD_FOUND AND NOT TARGET Pthread::Pthread)
if (PTHREAD_LIBRARIES)
add_library(Pthread::Pthread UNKNOWN IMPORTED)
set_target_properties(Pthread::Pthread PROPERTIES
IMPORTED_LOCATION "${PTHREAD_LIBRARIES}")
else()
add_library(Pthread::Pthread INTERFACE IMPORTED )
endif()
set_target_properties(Pthread::Pthread PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PTHREAD_INCLUDE_DIR}"
)
endif()
mark_as_advanced(PTHREAD_INCLUDE_DIR PTHREAD_LIBRARIES PTHREAD_LIBC_HAS_PTHREAD_CREATE PTHREAD_LIB_FOUND)

44
cmake/FindSystemd.cmake Normal file
View File

@ -0,0 +1,44 @@
find_package(PkgConfig)
pkg_check_modules(PKG_SYSTEMD QUIET systemd)
set(SYSTEMD_DEFINITIONS ${PKG_SYSTEMD_CFLAGS_OTHER})
set(SYSTEMD_VERSION ${PKG_SYSTEMD_VERSION})
find_path(SYSTEMD_INCLUDE_DIR
NAMES systemd/sd-bus.h systemd/sd-event.h
HINTS ${PKG_SYSTEMD_INCLUDE_DIRS}
)
find_library(SYSTEMD_LIBRARY
NAMES systemd
HINTS ${PKG_SYSTEMD_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Systemd
FOUND_VAR
SYSTEMD_FOUND
REQUIRED_VARS
SYSTEMD_LIBRARY
SYSTEMD_INCLUDE_DIR
VERSION_VAR
SYSTEMD_VERSION
)
if(SYSTEMD_FOUND AND NOT TARGET Systemd::Systemd)
add_library(Systemd::Systemd UNKNOWN IMPORTED)
set_target_properties(Systemd::Systemd PROPERTIES
IMPORTED_LOCATION "${SYSTEMD_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${SYSTEMD_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${SYSTEMD_INCLUDE_DIR}"
)
endif()
mark_as_advanced(SYSTEMD_INCLUDE_DIR SYSTEMD_ARCH_INCLUDE_DIR SYSTEMD_LIBRARY)
include(FeatureSummary)
set_package_properties(Systemd PROPERTIES
URL "http://www.freedesktop.org/wiki/Software/systemd"
DESCRIPTION "A system and service manager for Linux"
)

View File

@ -0,0 +1,24 @@
find_package(PkgConfig)
pkg_check_modules(WaylandProtocols QUIET "wayland-protocols>=${WaylandProtocols_FIND_VERSION}")
pkg_get_variable(WaylandProtocols_PKGDATADIR wayland-protocols pkgdatadir)
mark_as_advanced(WaylandProtocols_PKGDATADIR)
string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}")
find_package_handle_standard_args(WaylandProtocols
FOUND_VAR
WaylandProtocols_FOUND
REQUIRED_VARS
WaylandProtocols_PKGDATADIR
VERSION_VAR
WaylandProtocols_VERSION
HANDLE_COMPONENTS
)
set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND})
set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR})
set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION})

44
cmake/FindXKBCommon.cmake Normal file
View File

@ -0,0 +1,44 @@
include(ECMFindModuleHelpersStub)
ecm_find_package_version_check(XKBCommon)
# Note that this list needs to be ordered such that any component
# appears after its dependencies
set(XKBCommon_known_components
XKBCommon
X11)
set(XKBCommon_XKBCommon_component_deps)
set(XKBCommon_XKBCommon_pkg_config "xkbcommon")
set(XKBCommon_XKBCommon_lib "xkbcommon")
set(XKBCommon_XKBCommon_header "xkbcommon/xkbcommon.h")
set(XKBCommon_X11_component_deps XKBCommon)
set(XKBCommon_X11_pkg_config "xkbcommon-x11")
set(XKBCommon_X11_lib "xkbcommon-x11")
set(XKBCommon_X11_header "xkbcommon/xkbcommon-x11.h")
ecm_find_package_parse_components(XKBCommon
RESULT_VAR XKBCommon_components
KNOWN_COMPONENTS ${XKBCommon_known_components}
)
ecm_find_package_handle_library_components(XKBCommon
COMPONENTS ${XKBCommon_components}
)
find_package_handle_standard_args(XKBCommon
FOUND_VAR
XKBCommon_FOUND
REQUIRED_VARS
XKBCommon_LIBRARIES
VERSION_VAR
XKBCommon_VERSION
HANDLE_COMPONENTS
)
include(FeatureSummary)
set_package_properties(XKBCommon PROPERTIES
URL "http://xkbcommon.org"
DESCRIPTION "Keyboard handling library using XKB data"
)

View File

@ -0,0 +1,20 @@
find_package(PkgConfig)
pkg_check_modules(PKG_XKEYBOARDCONFIG QUIET xkeyboard-config)
pkg_get_variable(XKEYBOARDCONFIG_XKBBASE xkeyboard-config xkb_base)
pkg_get_variable(XKEYBOARDCONFIG_DATADIR xkeyboard-config datadir)
set(XKEYBOARDCONFIG_VERSION ${PKG_XKEYBOARDCONFIG_VERSION})
mark_as_advanced(XKEYBOARDCONFIG_VERSION)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(XKeyboardConfig
FOUND_VAR
XKEYBOARDCONFIG_FOUND
REQUIRED_VARS
XKEYBOARDCONFIG_XKBBASE
XKEYBOARDCONFIG_DATADIR
VERSION_VAR
XKEYBOARDCONFIG_VERSION
)

53
config.h.in Normal file
View File

@ -0,0 +1,53 @@
/*
* SPDX-FileCopyrightText: 2017-2017 CSSlayer <wengxt@gmail.com>
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*
*/
#ifndef _FCITX5_CONFIG_H_IN_
#define _FCITX5_CONFIG_H_IN_
#define FCITX_INSTALL_LIBDIR "@FCITX_INSTALL_LIBDIR@"
#define FCITX_INSTALL_LIBDATADIR "@FCITX_INSTALL_LIBDATADIR@"
#define FCITX_INSTALL_LIBEXECDIR "@FCITX_INSTALL_LIBEXECDIR@"
#define FCITX_INSTALL_DATADIR "@FCITX_INSTALL_DATADIR@"
#define FCITX_INSTALL_PKGDATADIR "@FCITX_INSTALL_PKGDATADIR@"
#define FCITX_INSTALL_BINDIR "@FCITX_INSTALL_BINDIR@"
#define FCITX_INSTALL_LOCALEDIR "@FCITX_INSTALL_LOCALEDIR@"
#define FCITX_INSTALL_ADDONDIR "@FCITX_INSTALL_ADDONDIR@"
#define FCITX_LIBRARY_SUFFIX "@FCITX_LIBRARY_SUFFIX@"
#define FCITX_VERSION_STRING "@FCITX_VERSION@"
#define ISOCODES_ISO639_JSON "@ISOCODES_ISO639_JSON@"
#define ISOCODES_ISO3166_JSON "@ISOCODES_ISO3166_JSON@"
#define XKEYBOARDCONFIG_XKBBASE "@XKEYBOARDCONFIG_XKBBASE@"
#define DEFAULT_XKB_RULES "@DEFAULT_XKB_RULES@"
#define NO_PREEDIT_APPS "@NO_PREEDIT_APPS@"
#cmakedefine ENABLE_LIBUUID
#cmakedefine ENABLE_DBUS
#cmakedefine ENABLE_KEYBOARD
#cmakedefine EXECINFO_FOUND
#cmakedefine ENCHANT_FOUND
#cmakedefine ENABLE_ENCHANT
#cmakedefine PRESAGE_FOUND
#cmakedefine ENABLE_PRESAGE
#cmakedefine LIBKVM_FOUND
#cmakedefine CAIRO_EGL_FOUND
#cmakedefine ENABLE_X11
#cmakedefine WAYLAND_FOUND
#cmakedefine HAS_DLMOPEN
#cmakedefine USE_FLATPAK_ICON
#define XKEYBOARDCONFIG_DATADIR "@XKEYBOARDCONFIG_DATADIR@"
#define DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@"
#define CLDR_DIR "@CLDR_DIR@"
#cmakedefine HAVE_PIPE2
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#endif // _FCITX5_CONFIG_H_IN_

32
data/CMakeLists.txt Normal file
View File

@ -0,0 +1,32 @@
add_subdirectory(icon)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fcitx5-configtool.desktop.in.in
${CMAKE_CURRENT_BINARY_DIR}/fcitx5-configtool.desktop.in @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/org.fcitx.Fcitx5.desktop.in.in
${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.desktop.in @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fcitx5-diagnose.sh
${CMAKE_CURRENT_BINARY_DIR}/fcitx5-diagnose ESCAPE_QUOTES @ONLY)
fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/fcitx5-configtool.desktop.in
fcitx5-configtool.desktop)
fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.desktop.in
org.fcitx.Fcitx5.desktop)
fcitx5_translate_desktop_file(org.fcitx.Fcitx5.metainfo.xml.in
org.fcitx.Fcitx5.metainfo.xml XML)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.desktop"
"${CMAKE_CURRENT_BINARY_DIR}/fcitx5-configtool.desktop"
DESTINATION "${FCITX_INSTALL_DATADIR}/applications")
if (ENABLE_XDGAUTOSTART)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.desktop" DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/autostart)
endif()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.metainfo.xml" DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
install(FILES fcitx5-configtool.sh RENAME fcitx5-configtool DESTINATION "${FCITX_INSTALL_BINDIR}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fcitx5-diagnose" DESTINATION "${FCITX_INSTALL_BINDIR}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY default DESTINATION "${FCITX_INSTALL_PKGDATADIR}" COMPONENT config)

2
data/default/ar_DZ Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=ara-azerty

2
data/default/as_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=

2
data/default/ast_ES Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_as_phonetic

2
data/default/az_AZ Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=az

2
data/default/be_BY Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=by

2
data/default/bg_BG Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=bg-phonetic

2
data/default/bn_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_bn_inscript

2
data/default/cat_ES Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=es-cat

2
data/default/cs_CZ Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=cz

2
data/default/de_CH Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=ch

2
data/default/de_DE Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=de

2
data/default/el_CY Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=gr

2
data/default/el_GR Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=gr

2
data/default/en_GB Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=gb

2
data/default/en_US Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=us

2
data/default/en_ZA Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=za

2
data/default/es_ES Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=es

2
data/default/es_GT Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=latam

2
data/default/es_MX Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=latam

2
data/default/fr_BE Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=be

2
data/default/fr_CH Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=ch-fr

2
data/default/fr_FR Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=fr-oss

2
data/default/gl_ES Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=es

2
data/default/gu_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_gu_inscript

2
data/default/he_IL Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=il

2
data/default/hi_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_hi_inscript

2
data/default/id_ID Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=us

2
data/default/it_IT Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=it

4
data/default/ja_JP Normal file
View File

@ -0,0 +1,4 @@
[DefaultInputMethod]
0=kkc
1=mozc
2=anthy

2
data/default/kn_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_kn_kgp

2
data/default/ko_KR Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=hangul

2
data/default/mai_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_mai_inscript

2
data/default/ml_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_ml_inscript

2
data/default/mr_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_mr_inscript

2
data/default/nl_NL Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=us-altgr-intl

2
data/default/or_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_or_inscript

2
data/default/pa_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_pa_inscript

2
data/default/pl_PL Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=pl

2
data/default/pt_BR Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=br

2
data/default/pt_PT Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=pt

2
data/default/ru_RU Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=ru

2
data/default/sd_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_sd_inscript

2
data/default/sk_SK Normal file
View File

@ -0,0 +1,2 @@
[ExtraLayout]
0=sk

2
data/default/ta_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_ta_tamil99

2
data/default/te_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_ts_inscript

2
data/default/ur_IN Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=m17n_ur_phonetic

3
data/default/zh_CN Normal file
View File

@ -0,0 +1,3 @@
[DefaultInputMethod]
0=pinyin
1=rime

3
data/default/zh_HK Normal file
View File

@ -0,0 +1,3 @@
[DefaultInputMethod]
0=cangjie
1=rime

2
data/default/zh_TW Normal file
View File

@ -0,0 +1,2 @@
[DefaultInputMethod]
0=chewing

View File

@ -0,0 +1,12 @@
[Desktop Entry]
Name=Fcitx 5 Configuration
GenericName=Input Method Configuration
Comment=Change Fcitx 5 Configuration
Exec=@FCITX_INSTALL_BINDIR@/fcitx5-configtool
Icon=@FCITX_ICON_NAME@
Type=Application
Categories=Settings;
X-KDE-StartupNotify=false
StartupNotify=false
X-AppStream-Ignore=true
NotShowIn=KDE

168
data/fcitx5-configtool.sh Executable file
View File

@ -0,0 +1,168 @@
#!/bin/sh
#--------------------------------------
# fcitx-configtool
#
export TEXTDOMAIN=fcitx5
if which kdialog > /dev/null 2>&1; then
message() {
kdialog --msgbox "$1"
}
error() {
kdialog --error "$1"
}
elif which zenity > /dev/null 2>&1; then
message() {
zenity --info --text="$1"
}
error() {
zenity --error --text="$1"
}
else
message() {
echo "$1"
}
error() {
echo "$1" >&2
}
fi
if which gettext > /dev/null 2>&1; then
_() {
gettext "$@"
}
else
_() {
echo "$@"
}
fi
# from xdg-open
detectDE() {
# see https://bugs.freedesktop.org/show_bug.cgi?id=34164
unset GREP_OPTIONS
local desktop
if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
for desktop in $(echo "${XDG_CURRENT_DESKTOP}" | tr ":" "\n"); do
case "${desktop}" in
GNOME)
DE=gnome
break
;;
KDE)
DE=kde
break
;;
LXDE)
DE=lxde
break
;;
XFCE)
DE=xfce
break
esac
done
fi
if [ x"$DE" = x"" ]; then
# classic fallbacks
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
elif xprop -root KDE_FULL_SESSION 2> /dev/null | grep ' = \"true\"$' > /dev/null 2>&1; then DE=kde;
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate;
elif dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1 ; then DE=gnome;
elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce
fi
fi
if [ x"$DE" = x"" ]; then
# fallback to checking $DESKTOP_SESSION
case "$DESKTOP_SESSION" in
gnome)
DE=gnome;
;;
LXDE|Lubuntu)
DE=lxde;
;;
xfce|xfce4|'Xfce Session')
DE=xfce;
;;
esac
fi
if [ x"$DE" = x"" ]; then
# fallback to uname output for other platforms
case "$(uname 2>/dev/null)" in
Darwin)
DE=darwin;
;;
esac
fi
if [ x"$DE" = x"gnome" ]; then
# gnome-default-applications-properties is only available in GNOME 2.x
# but not in GNOME 3.x
which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3"
fi
}
run_kde() {
if (systemsettings5 --list 2>/dev/null | grep ^kcm_fcitx5 > /dev/null 2>&1); then
exec systemsettings5 kcm_fcitx5
fi
}
run_qt() {
if which fcitx5-config-qt > /dev/null 2>&1; then
exec fcitx5-config-qt
fi
return 1
}
run_xdg() {
case "$DE" in
kde)
message "$(_ "You're currently running KDE, but KCModule for fcitx couldn't be found, the package name of this KCModule is usually kcm-fcitx or kde-config-fcitx. Now it will open config directory.")"
;;
*)
message "$(_ "You're currently running Fcitx with GUI, but fcitx5-config-qt couldn't be found. Now it will open config directory.")"
;;
esac
if command="$(which xdg-open 2>/dev/null)"; then
exec "$command" "$HOME/.config/fcitx5"
fi
}
_which_cmdline() {
cmd="$(which "$1")" || return 1
shift
echo "$cmd $*"
}
detectDE
# even if we are not on KDE, we should still try kde, some wrongly
# configured kde desktop cannot be detected (usually missing xprop)
# and if kde one can work, so why not use it if gtk, gtk3 not work?
# xdg/editor is never a preferred solution
case "$DE" in
kde)
order="kde qt xdg"
;;
*)
order="qt kde xdg"
;;
esac
for cmd in $order; do
run_${cmd}
done
echo 'Cannot find a command to run.' >&2

1810
data/fcitx5-diagnose.sh Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
org.fcitx.Fcitx5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1 @@
org.fcitx.Fcitx5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

View File

@ -0,0 +1 @@
org.fcitx.Fcitx5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
org.fcitx.Fcitx5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1 @@
org.fcitx.Fcitx5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1 @@
org.fcitx.Fcitx5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

9
data/icon/CMakeLists.txt Normal file
View File

@ -0,0 +1,9 @@
foreach(size 16 22 24 32 48 128)
install(DIRECTORY ${size}x${size} DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor"
PATTERN .* EXCLUDE
PATTERN *~ EXCLUDE)
endforeach(size 16 22 24 32 48 128)
install(DIRECTORY scalable DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor"
PATTERN ".*" EXCLUDE
PATTERN "*~" EXCLUDE)

View File

@ -0,0 +1 @@
org.fcitx.Fcitx5.svg

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -0,0 +1,15 @@
[Desktop Entry]
Name=Fcitx 5
GenericName=Input Method
Comment=Start Input Method
Exec=@FCITX_INSTALL_BINDIR@/fcitx5
Icon=@FCITX_ICON_NAME@
Terminal=false
Type=Application
Categories=System;Utility;
StartupNotify=false
X-GNOME-AutoRestart=false
X-GNOME-Autostart-Notify=false
X-KDE-autostart-after=panel
X-KDE-StartupNotify=false
X-KDE-Wayland-VirtualKeyboard=true

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop-application">
<id>org.fcitx.Fcitx5</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.1+</project_license>
<name>Fcitx 5</name>
<summary>Input Method</summary>
<description>
<p>
Fcitx is an input method framework.
It can help you to type your own language. It also features variant choice of addons that improve your typing experience.
</p>
</description>
<project_group>Fcitx</project_group>
<url type="homepage">https://fcitx-im.org/</url>
<url type="bugtracker">https://github.com/fcitx/fcitx5/issues</url>
<url type="help">https://fcitx-im.org/wiki/Fcitx</url>
<screenshots>
<screenshot type="default">
<caption>Typing with Fcitx and Kimpanel</caption>
<image>https://fcitx-im.org/images/8/80/Fcitx-Keyboard.png</image>
</screenshot>
</screenshots>
<provides>
<binary>fcitx5</binary>
</provides>
<releases>
<release version="5.0.19" date="2022-08-29"/>
<release version="5.0.18" date="2022-07-03"/>
<release version="5.0.17" date="2022-06-01"/>
<release version="5.0.16" date="2022-05-22"/>
<release version="5.0.15" date="2022-03-09"/>
<release version="5.0.14" date="2022-02-01"/>
<release version="5.0.13" date="2022-01-08"/>
<release version="5.0.12" date="2021-12-18"/>
<release version="5.0.11" date="2021-12-04"/>
<release version="5.0.10" date="2021-11-05"/>
<release version="5.0.9" date="2021-08-29"/>
<release version="5.0.8" date="2021-05-04"/>
<release version="5.0.7" date="2021-03-22"/>
<release version="5.0.6" date="2021-03-21"/>
<release version="5.0.5" date="2021-02-18"/>
<release version="5.0.4" date="2021-01-11"/>
<release version="5.0.3" date="2020-12-04"/>
<release version="5.0.2" date="2020-12-03"/>
<release version="5.0.1" date="2020-11-03"/>
<release version="5.0.0" date="2020-10-30"/>
</releases>
<launchable type="desktop-id">org.fcitx.Fcitx5.desktop</launchable>
<content_rating type="oars-1.1"/>
</component>

1
po/CMakeLists.txt Normal file
View File

@ -0,0 +1 @@
fcitx5_install_translation(fcitx5)

12
po/LINGUAS Normal file
View File

@ -0,0 +1,12 @@
ca
da
de
es
fr
he
ja
ko
ru
zh_CN
zh_TW

2541
po/ca.po Normal file

File diff suppressed because it is too large Load Diff

2589
po/da.po Normal file

File diff suppressed because it is too large Load Diff

2543
po/de.po Normal file

File diff suppressed because it is too large Load Diff

2541
po/es.po Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More