Fixed bug 5103 - Port fcitx support to both fcitx 4 & 5

wengxt

Due to the new major fcitx version is coming close, the existing code need to be ported to use new Fcitx dbus interface.

The new dbus interface is supported by both fcitx 4 and 5, and has a good side effect, which is that it will work with flatpak for free. Also the patch remove the dependency on fcitx header. Instead, it just hardcodes a few enum value in the code so need to handle the different header for fcitx4 or 5.
This commit is contained in:
Sam Lantinga
2020-05-11 14:31:04 -07:00
parent 33642b47b2
commit eadc8693dd
9 changed files with 160 additions and 113 deletions

View File

@@ -1213,6 +1213,8 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS)
set(HAVE_DBUS_DBUS_H TRUE)
include_directories(${DBUS_INCLUDE_DIRS})
list(APPEND EXTRA_LIBS ${DBUS_LIBRARIES})
# Fcitx need only dbus.
set(HAVE_FCITX TRUE)
endif()
pkg_search_module(IBUS ibus-1.0 ibus)
@@ -1220,6 +1222,9 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS)
set(HAVE_IBUS_IBUS_H TRUE)
include_directories(${IBUS_INCLUDE_DIRS})
list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
endif()
if (HAVE_IBUS_IBUS_H OR HAVE_FCITX)
add_definitions(-DSDL_USE_IME)
endif()
if(HAVE_LIBUNWIND_H)
@@ -1229,8 +1234,6 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS)
list(APPEND EXTRA_LIBS ${UNWIND_LIBRARIES} ${UNWIND_GENERIC_LIBRARIES})
endif()
endif()
check_include_file("fcitx/frontend.h" HAVE_FCITX_FRONTEND_H)
endif()
if(INPUT_TSLIB)