Skip to content

Commit

Permalink
add initial wayland im implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Oct 19, 2016
1 parent c5cdde6 commit 9f7f01e
Show file tree
Hide file tree
Showing 18 changed files with 924 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Expand Up @@ -36,6 +36,9 @@ find_package(IsoCodes)
find_package(LibXml2)
find_package(XKeyboardConfig)
find_package(Cairo COMPONENTS Cairo XCB EGL)
find_package(Wayland COMPONENTS Client)
find_package(WaylandScanner)
find_package(WaylandProtocols)

set(DEFAULT_XKB_RULES_FILES "${XKEYBOARDCONFIG_XKBBASE}/rules/${DEFAULT_XKB_RULES}.xml")
if (NOT EXISTS "${DEFAULT_XKB_RULES_FILES}")
Expand Down
24 changes: 24 additions & 0 deletions cmake/FindWaylandProtocols.cmake
@@ -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})

1 change: 1 addition & 0 deletions src/frontend/CMakeLists.txt
@@ -1,2 +1,3 @@
add_subdirectory(xim)
add_subdirectory(dbusfrontend)
add_subdirectory(waylandim)
17 changes: 17 additions & 0 deletions src/frontend/waylandim/CMakeLists.txt
@@ -0,0 +1,17 @@
set(WAYLAND_IM_PROTOCOL_SRCS)

ecm_add_wayland_client_protocol(WAYLAND_IM_PROTOCOL_SRCS
PROTOCOL ${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/input-method/input-method-unstable-v1.xml
BASENAME input-method-unstable-v1)

ecm_add_wayland_client_protocol(WAYLAND_IM_PROTOCOL_SRCS
PROTOCOL ${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/text-input/text-input-unstable-v1.xml
BASENAME text-input-unstable-v1)

add_library(waylandim MODULE waylandim.cpp ${WAYLAND_IM_PROTOCOL_SRCS})
target_include_directories(waylandim PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(waylandim Fcitx5::Core Wayland::Client XKBCommon::XKBCommon)
set_target_properties(waylandim PROPERTIES PREFIX "")
install(TARGETS waylandim DESTINATION "${FCITX_INSTALL_ADDONDIR}")
install(FILES waylandim.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon")

8 changes: 8 additions & 0 deletions src/frontend/waylandim/waylandim.conf
@@ -0,0 +1,8 @@
[Addon]
Name=waylandim
Type=SharedLibrary
Library=waylandim
Category=Frontend
Dependencies/0=wayland
Dependencies/Length=1

0 comments on commit 9f7f01e

Please sign in to comment.