Skip to content

Commit

Permalink
Merge branch 'master' into vitual_keyboard_better_interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt authored Dec 4, 2024
2 parents cc76666 + 39b2d94 commit 4004e7e
Show file tree
Hide file tree
Showing 101 changed files with 1,897 additions and 834 deletions.
80 changes: 59 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.6.0)
project(fcitx VERSION 5.1.11)
project(fcitx VERSION 5.1.12)
set(FCITX_VERSION ${PROJECT_VERSION})

find_package(ECM REQUIRED 1.0.0)
Expand All @@ -20,7 +20,8 @@ include(CheckSymbolExists)
#######################################################################
# Options
#######################################################################
option(ENABLE_TEST "Build Test" On)
option(ENABLE_TESTING_ADDONS "Build testing frontend, im and ui addons" On)
option(ENABLE_TEST "Build Test (Need ENABLE_TESTING_ADDONS=On)" 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")
Expand All @@ -31,12 +32,14 @@ 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 libuv/libdbus if not found." On)
option(USE_SYSTEMD "Use systemd for event loop and dbus, will fallback to libuv/libdbus if not found. Only used when EVENT_LOOP_BACKEND is auto." On)
option(ENABLE_XDGAUTOSTART "Enable xdg autostart desktop file installation" On)
option(USE_FLATPAK_ICON "Use flatpak icon name for desktop files" Off)
option(ENABLE_EMOJI "Enable emoji module" On)
option(ENABLE_LIBUUID "Use libuuid for uuid generation" On)
option(BUILD_SPELL_DICT "Build en_dict.fscd for English spell check" On)
set(NO_PREEDIT_APPS "gvim.*,wps.*,wpp.*,et.*" CACHE STRING "Disable preedit for follwing app by default.")
set(EVENT_LOOP_BACKEND "auto" CACHE STRING "Set the underlying event loop implementation, valid values are auto,systemd,libuv,none")

if (ENABLE_EMOJI)
find_package(ZLIB REQUIRED)
Expand All @@ -46,35 +49,67 @@ 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 ()
set(CANDIDATE_EVENT_LOOP_BACKENDS)

if (USE_FLATPAK_ICON)
set(FCITX_ICON_NAME "org.fcitx.Fcitx5")
else()
set(FCITX_ICON_NAME "fcitx")
if (EVENT_LOOP_BACKEND STREQUAL "auto")
if (USE_SYSTEMD)
list(APPEND CANDIDATE_EVENT_LOOP_BACKENDS systemd)
endif()

list(APPEND CANDIDATE_EVENT_LOOP_BACKENDS libuv)
elseif (EVENT_LOOP_BACKEND STREQUAL "systemd")
list(APPEND CANDIDATE_EVENT_LOOP_BACKENDS systemd)
elseif (EVENT_LOOP_BACKEND STREQUAL "libuv")
list(APPEND CANDIDATE_EVENT_LOOP_BACKENDS libuv)
elseif (EVENT_LOOP_BACKEND STREQUAL "none")
list(APPEND CANDIDATE_EVENT_LOOP_BACKENDS none)
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()
set(FCITX_EVENT_LOOP_BACKEND "")
foreach(CANDIDATE_EVENT_LOOP_BACKEND IN LISTS CANDIDATE_EVENT_LOOP_BACKENDS)
if (CANDIDATE_EVENT_LOOP_BACKEND STREQUAL systemd)
find_package(Systemd)
if (TARGET Systemd::Systemd)
set(FCITX_EVENT_LOOP_BACKEND "systemd")
break()
endif()
elseif (CANDIDATE_EVENT_LOOP_BACKEND STREQUAL libuv)
if (NOT LIBUV_TARGET)
if (NOT (TARGET PkgConfig::LibUV))
pkg_check_modules(LibUV IMPORTED_TARGET "libuv")
set(LIBUV_TARGET PkgConfig::LibUV)
endif()
endif()

if (NOT LIBUV_TARGET)
if (NOT (TARGET PkgConfig::LibUV))
pkg_check_modules(LibUV REQUIRED IMPORTED_TARGET "libuv")
if (TARGET "${LIBUV_TARGET}")
set(FCITX_EVENT_LOOP_BACKEND "libuv")
break()
endif()
set(LIBUV_TARGET PkgConfig::LibUV)
elseif (CANDIDATE_EVENT_LOOP_BACKEND STREQUAL none)
set(FCITX_EVENT_LOOP_BACKEND "none")
break()
endif()
endforeach()

if (ENABLE_DBUS AND NOT (FCITX_EVENT_LOOP_BACKEND STREQUAL systemd))
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 (FCITX_EVENT_LOOP_BACKEND STREQUAL "")
message(FATAL_ERROR "Failed to find a valid event loop backend. Backends checked: ${CANDIDATE_EVENT_LOOP_BACKENDS}")
endif()

if (USE_FLATPAK_ICON)
set(FCITX_ICON_NAME "org.fcitx.Fcitx5")
else()
set(FCITX_ICON_NAME "fcitx")
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly")
Expand Down Expand Up @@ -192,7 +227,10 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(po)
add_subdirectory(testing)

if (ENABLE_TESTING_ADDONS)
add_subdirectory(testing)
endif()

#######################################################################
# Test features
Expand Down
7 changes: 6 additions & 1 deletion cmake/Fcitx5CompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(CMAKE_C_STANDARD 99)
set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}")

if(NOT APPLE)
if(NOT APPLE AND NOT EMSCRIPTEN)
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}")
endif()
Expand All @@ -23,6 +23,11 @@ if (POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()

if (POLICY CMP0067)
# make check_cxx_source_compiles honors CMAKE_CXX_STANDARD
cmake_policy(SET CMP0067 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")
Expand Down
9 changes: 7 additions & 2 deletions data/fcitx5-configtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export TEXTDOMAIN=fcitx5

if command -v kdialog > /dev/null 2>&1; then
message() {
kdialog --msgbox "$1"
kdialog --yesno "$1"
}
error() {
kdialog --error "$1"
}
elif command -v zenity > /dev/null 2>&1; then
message() {
zenity --info --text="$1"
zenity --question --text="$1"
}
error() {
zenity --error --text="$1"
Expand Down Expand Up @@ -138,6 +138,11 @@ run_xdg() {
;;
esac

# user choose no
if [ $? -ne 0 ]; then
exit
fi

if command="$(command -v xdg-open 2>/dev/null)"; then
exec "$command" "$HOME/.config/fcitx5"
fi
Expand Down
1 change: 1 addition & 0 deletions data/org.fcitx.Fcitx5.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<binary>fcitx5</binary>
</provides>
<releases>
<release version="5.1.11" date="2024-10-08"/>
<release version="5.1.10" date="2024-05-30"/>
<release version="5.1.9" date="2024-04-22"/>
<release version="5.1.8" date="2024-02-28"/>
Expand Down
40 changes: 20 additions & 20 deletions po/ru.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: fcitx5\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2024-06-13 20:24+0000\n"
"POT-Creation-Date: 2024-07-26 20:24+0000\n"
"PO-Revision-Date: 2017-11-23 04:14+0000\n"
"Last-Translator: Dmitry <[email protected]>, 2024\n"
"Language-Team: Russian (https://app.transifex.com/fcitx/teams/12005/ru/)\n"
Expand Down Expand Up @@ -179,7 +179,7 @@ msgstr ""
msgid "Allow input method in the password field"
msgstr "Разрешить метод ввода в поле пароля"

#: src/im/keyboard/keyboard.h:44 src/modules/quickphrase/quickphrase.h:25
#: src/im/keyboard/keyboard.h:44 src/modules/quickphrase/quickphrase.h:31
msgid "Alt"
msgstr "Alt"

Expand All @@ -195,12 +195,12 @@ msgstr "Всегда устанавливайте раскладку тольк
#: src/lib/fcitx-utils/key.cpp:151
msgctxt "Key name"
msgid "Application Left"
msgstr "Application Left"
msgstr "Приложение слева"

#: src/lib/fcitx-utils/key.cpp:152
msgctxt "Key name"
msgid "Application Right"
msgstr "Application Right"
msgstr "Приложение справа"

#: src/im/keyboard/keyboard.h:99
msgid "Applications disabled for long press"
Expand Down Expand Up @@ -255,7 +255,7 @@ msgstr "Фоновое изображение"
#: src/lib/fcitx-utils/key.cpp:42
msgctxt "Key name"
msgid "Backspace"
msgstr "BackSpace"
msgstr "Backspace"

#: data/fcitx5-diagnose.sh:827
msgid "Bash Version:"
Expand Down Expand Up @@ -453,7 +453,7 @@ msgstr "Изменить конфигурацию Fcitx 5"
msgid "Check box"
msgstr "Флажок"

#: src/im/keyboard/keyboard.h:68 src/modules/quickphrase/quickphrase.h:37
#: src/im/keyboard/keyboard.h:68 src/modules/quickphrase/quickphrase.h:43
msgid "Choose key modifier"
msgstr "Выбрать клавишу-модификатор"

Expand Down Expand Up @@ -497,19 +497,19 @@ msgctxt "Key name"
msgid "Community"
msgstr "Сообщество"

#: src/im/keyboard/keyboard.cpp:706
#: src/im/keyboard/keyboard.cpp:708
msgid "Completion"
msgstr "Завершение"

#: src/im/keyboard/keyboard.cpp:697
#: src/im/keyboard/keyboard.cpp:699
msgid "Completion is disabled."
msgstr "Завершение отключено."

#: src/im/keyboard/keyboard.cpp:700
#: src/im/keyboard/keyboard.cpp:702
msgid "Completion is enabled temporarily."
msgstr "Завершение временно включено."

#: src/im/keyboard/keyboard.cpp:702
#: src/im/keyboard/keyboard.cpp:704
msgid "Completion is enabled."
msgstr "Завершение включено."

Expand Down Expand Up @@ -546,7 +546,7 @@ msgstr "Настройка:"
msgid "Configure"
msgstr "Настроить"

#: src/im/keyboard/keyboard.h:45 src/modules/quickphrase/quickphrase.h:25
#: src/im/keyboard/keyboard.h:45 src/modules/quickphrase/quickphrase.h:31
msgid "Control"
msgstr "Control"

Expand Down Expand Up @@ -726,7 +726,7 @@ msgctxt "Key name"
msgid "Down"
msgstr "Вниз"

#: src/modules/quickphrase/quickphrase.h:43
#: src/modules/quickphrase/quickphrase.h:49
msgid "Editor"
msgstr "Редактор"

Expand Down Expand Up @@ -757,7 +757,7 @@ msgstr "Включить"
msgid "Enable Blur on KWin"
msgstr "Включить размытие на KWin"

#: src/modules/quickphrase/quickphrase.h:39
#: src/modules/quickphrase/quickphrase.h:45
msgid "Enable Spell check"
msgstr "Включить проверку орфографии"

Expand Down Expand Up @@ -863,7 +863,7 @@ msgstr "Не удалось найти ${1} в кеше immodule в ${2}"
msgid "Failed to find ${1} in the output of ${2}"
msgstr "Не удалось найти ${1} в выводе ${2}"

#: src/modules/quickphrase/quickphrase.h:41
#: src/modules/quickphrase/quickphrase.h:47
msgid "Fallback Spell check language"
msgstr "Резервный язык проверки орфографии"

Expand Down Expand Up @@ -1331,7 +1331,7 @@ msgstr ""
msgid "Image"
msgstr "Изображение"

#: src/im/keyboard/keyboard.cpp:705 src/lib/fcitx/instance.cpp:458
#: src/im/keyboard/keyboard.cpp:707 src/lib/fcitx/instance.cpp:458
#: src/lib/fcitx/instance.cpp:686 src/lib/fcitx/instance.cpp:848
#: src/modules/notificationitem/notificationitem.cpp:142
#: src/modules/notificationitem/notificationitem.cpp:230
Expand Down Expand Up @@ -2015,7 +2015,7 @@ msgstr "Нет"
msgid "No clipboard history."
msgstr "История буфера обмена отсутствует."

#: src/im/keyboard/keyboard.h:44 src/modules/quickphrase/quickphrase.h:24
#: src/im/keyboard/keyboard.h:44 src/modules/quickphrase/quickphrase.h:30
msgid "None"
msgstr "Нет"

Expand Down Expand Up @@ -2054,7 +2054,7 @@ msgstr "NumLock"
msgid "Number of entries"
msgstr "Количество входов"

#: src/im/keyboard/keyboard.cpp:691
#: src/im/keyboard/keyboard.cpp:693
msgid ""
"Only emoji support is found. To enable spell checking, you may need to "
"install spell check data for the language."
Expand Down Expand Up @@ -2232,7 +2232,7 @@ msgstr "Файлы модуля Qt IM:"
msgid "Quick Phrase"
msgstr "Быстрая фраза"

#: src/modules/quickphrase/quickphrase.cpp:470
#: src/modules/quickphrase/quickphrase.cpp:488
msgid "Quick Phrase: "
msgstr "Быстрая фраза: "

Expand Down Expand Up @@ -2522,7 +2522,7 @@ msgctxt "Key name"
msgid "Subtitle"
msgstr "Подзаголовок"

#: src/im/keyboard/keyboard.h:45 src/modules/quickphrase/quickphrase.h:25
#: src/im/keyboard/keyboard.h:45 src/modules/quickphrase/quickphrase.h:31
msgid "Super"
msgstr "Super"

Expand Down Expand Up @@ -2734,7 +2734,7 @@ msgid "Trigger Input Method"
msgstr "Активация метода ввода"

#: src/modules/imselector/imselector.h:28
#: src/modules/quickphrase/quickphrase.h:32 src/modules/unicode/unicode.h:28
#: src/modules/quickphrase/quickphrase.h:38 src/modules/unicode/unicode.h:28
#: src/modules/clipboard/clipboard.h:48
msgid "Trigger Key"
msgstr "Клавиша-триггер"
Expand Down
Loading

0 comments on commit 4004e7e

Please sign in to comment.