Skip to content

Commit

Permalink
fix name conflict with rime for static build
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Nov 9, 2024
1 parent ab38f76 commit c4cb3ac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
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

0 comments on commit c4cb3ac

Please sign in to comment.