Files
qingjian/apps/linux/fcitx5/tests/support/context.h
T
BROX_Lighters. 2b2902d70b feat(linux): 接入 Rust Server 与 Fcitx5 默认候选面板 (#90)
Linux 第一阶段:Rust Server + 薄 Fcitx5 插件 + 用户目录安装,候选窗用 Fcitx5 自带面板。
目前只支持源码安装、手动启动 Server;自绘候选窗、自动启动与打包在后续阶段。
2026-09-20 15:49:20 +08:00

22 lines
818 B
C++

//! 默认面板回归使用的无应用输入上下文。
#pragma once
#include <fcitx/inputcontext.h>
#include <functional>
class Context final : public fcitx::InputContext {
public:
explicit Context(fcitx::InputContextManager &manager) : InputContext(manager, "panel-test") { created(); }
~Context() override { destroy(); }
const char *frontend() const override { return "test"; }
std::string committed;
std::function<void()> onPreedit;
protected:
void commitStringImpl(const std::string &text) override { committed += text; }
void deleteSurroundingTextImpl(int, unsigned int) override {}
void forwardKeyImpl(const fcitx::ForwardKeyEvent &) override {}
void updatePreeditImpl() override {
auto callback = std::move(onPreedit);
if (callback) callback();
}
};