Skip to content

Commit

Permalink
enable keyboard (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Dec 27, 2023
1 parent 047f3a4 commit 224e240
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ jobs:
brew install \
fmt \
extra-cmake-modules \
libxkbcommon \
iso-codes \
json-c \
ninja
pip install "dmgbuild[badge_icons]"
Expand All @@ -68,6 +71,9 @@ jobs:
arm-brew-install \
fmt \
gettext \
libxkbcommon \
iso-codes \
json-c \
openssl@3 \
libevent
cp -f /usr/local/bin/msgfmt /opt/homebrew/bin
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ option(ENABLE_WAYLAND "" OFF)
option(ENABLE_DBUS "" OFF)
option(ENABLE_DOC "" OFF)
option(ENABLE_SERVER "" OFF)
option(ENABLE_KEYBOARD "" OFF)
option(USE_SYSTEMD "" OFF)
option(ENABLE_XDGAUTOSTART "" OFF)
option(ENABLE_EMOJI "" OFF)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Cross build from Intel to Apple Silicon is performed in [CI](.github/workflows/c

### Install dependencies
```sh
brew install cmake ninja extra-cmake-modules gettext fmt libevent
brew install cmake ninja extra-cmake-modules gettext fmt libevent libxkbcommon iso-codes json-c
```

### Build with CMake
Expand Down
6 changes: 6 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ add_executable(Fcitx5
add_dependencies(Fcitx5 macosfrontend)

target_include_directories(Fcitx5 PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/include")
target_include_directories(Fcitx5 PRIVATE
"${PROJECT_SOURCE_DIR}/fcitx5/src/im/keyboard"
"${PROJECT_SOURCE_DIR}/fcitx5/src/modules/quickphrase/"
"${CMAKE_CURRENT_BINARY_DIR}/../fcitx5"
)

target_link_libraries(Fcitx5
"-Xlinker -rpath -Xlinker '${CMAKE_INSTALL_PREFIX}/lib'"
SwiftFcitx
Fcitx5::Core
keyboard
macosfrontend
)

Expand Down
4 changes: 4 additions & 0 deletions src/fcitx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <fcitx/addonmanager.h>
#include <fcitx/instance.h>
#include "../macosfrontend/macosfrontend.h"
#include "keyboard.h"
#include "nativestreambuf.h"

#define APP_CONTENTS_PATH "/Library/Input Methods/Fcitx5.app/Contents"
Expand All @@ -12,8 +13,11 @@ std::unique_ptr<fcitx::EventDispatcher> p_dispatcher;
fcitx::MacosFrontend *p_frontend = nullptr;
fcitx::ICUUID ic_uuid;

fcitx::KeyboardEngineFactory keyboardFactory;
fcitx::MacosFrontendFactory macosFrontendFactory;
fcitx::StaticAddonRegistry staticAddon = {
std::make_pair<std::string, fcitx::AddonFactory *>("keyboard",
&keyboardFactory),
std::make_pair<std::string, fcitx::AddonFactory *>("macosfrontend",
&macosFrontendFactory)};

Expand Down

0 comments on commit 224e240

Please sign in to comment.