Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix name conflict with rime for static build #8

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/hallelujah.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,17 @@ void HallelujahState::updatePreedit(InputContext *ic) {
preedit.setCursor(buffer_.cursor());
}

PreeditMode mode = ic->capabilityFlags().test(CapabilityFlag::Preedit)
? *engine_->config().preeditMode
: PreeditMode::No;
hallelujah::PreeditMode mode =
ic->capabilityFlags().test(CapabilityFlag::Preedit)
? *engine_->config().preeditMode
: hallelujah::PreeditMode::No;
auto &inputPanel = ic->inputPanel();
switch (mode) {
case PreeditMode::No:
case hallelujah::PreeditMode::No:
inputPanel.setPreedit(preedit);
inputPanel.setClientPreedit(Text());
break;
case PreeditMode::ComposingText:
case hallelujah::PreeditMode::ComposingText:
inputPanel.setClientPreedit(preedit);
break;
}
Expand Down
22 changes: 13 additions & 9 deletions src/hallelujah.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@
#include <unordered_map>

namespace fcitx {
namespace hallelujah {
enum class PreeditMode { No, ComposingText };

FCITX_CONFIG_ENUM_NAME_WITH_I18N(PreeditMode, N_("Do not show"),
N_("Composing text"))
} // namespace hallelujah

FCITX_CONFIGURATION(
HallelujahEngineConfig,
OptionWithAnnotation<PreeditMode, PreeditModeI18NAnnotation> preeditMode{
this, "PreeditMode", _("Preedit Mode"), PreeditMode::ComposingText};
Option<bool> showIPA{this, "ShowIPA", _("Show IPA"), true};
Option<bool> showTranslation{this, "ShowTranslation", _("Show translation"),
true};
Option<bool> commitWithSpace{this, "CommitWithSpace",
_("Commit with space"), false};);
FCITX_CONFIGURATION(HallelujahEngineConfig,
OptionWithAnnotation<hallelujah::PreeditMode,
hallelujah::PreeditModeI18NAnnotation>
preeditMode{this, "PreeditMode", _("Preedit Mode"),
hallelujah::PreeditMode::ComposingText};
Option<bool> showIPA{this, "ShowIPA", _("Show IPA"), true};
Option<bool> showTranslation{this, "ShowTranslation",
_("Show translation"), true};
Option<bool> commitWithSpace{this, "CommitWithSpace",
_("Commit with space"),
false};);

struct HallelujahWord {
HallelujahWord(const std::vector<std::string> &translation,
Expand Down