summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2014-05-21 09:46:16 +0800
committerPeng Wu <alexepico@gmail.com>2014-05-21 09:46:16 +0800
commit7a98868d07581655b7a11c84005ec9cef7d50539 (patch)
treeba2f8ad45139916ebc2882a820d165a31e5a2765
parent7813d0b1711f08b0164242499c6ac02d30fab966 (diff)
downloadibus-libpinyin-7a98868d07581655b7a11c84005ec9cef7d50539.tar.gz
ibus-libpinyin-7a98868d07581655b7a11c84005ec9cef7d50539.tar.xz
ibus-libpinyin-7a98868d07581655b7a11c84005ec9cef7d50539.zip
remove LibPinyin* class prefix
-rw-r--r--src/PYEngine.cc6
-rw-r--r--src/PYLibPinyin.cc4
-rw-r--r--src/PYMain.cc4
-rw-r--r--src/PYPBopomofoEditor.cc38
-rw-r--r--src/PYPBopomofoEditor.h6
-rw-r--r--src/PYPBopomofoEngine.cc68
-rw-r--r--src/PYPBopomofoEngine.h6
-rw-r--r--src/PYPConfig.cc24
-rw-r--r--src/PYPConfig.h16
-rw-r--r--src/PYPDoublePinyinEditor.cc20
-rw-r--r--src/PYPDoublePinyinEditor.h6
-rw-r--r--src/PYPFullPinyinEditor.cc22
-rw-r--r--src/PYPFullPinyinEditor.h6
-rw-r--r--src/PYPPhoneticEditor.cc64
-rw-r--r--src/PYPPhoneticEditor.h6
-rw-r--r--src/PYPPinyinEditor.cc28
-rw-r--r--src/PYPPinyinEditor.h4
-rw-r--r--src/PYPPinyinEngine.cc98
-rw-r--r--src/PYPPinyinEngine.h6
19 files changed, 216 insertions, 216 deletions
diff --git a/src/PYEngine.cc b/src/PYEngine.cc
index fb32a0e..b275c68 100644
--- a/src/PYEngine.cc
+++ b/src/PYEngine.cc
@@ -168,14 +168,14 @@ ibus_pinyin_engine_constructor (GType type,
if (name) {
if (std::strcmp (name, "libpinyin") == 0 ||
std::strcmp (name, "libpinyin-debug") == 0) {
- engine->engine = new LibPinyinPinyinEngine (IBUS_ENGINE (engine));
+ engine->engine = new PinyinEngine (IBUS_ENGINE (engine));
}
if (std::strcmp (name, "libbopomofo") == 0 ||
std::strcmp (name, "libbopomofo-debug") == 0 ) {
- engine->engine = new LibPinyinBopomofoEngine (IBUS_ENGINE (engine));
+ engine->engine = new BopomofoEngine (IBUS_ENGINE (engine));
}
} else {
- engine->engine = new LibPinyinPinyinEngine (IBUS_ENGINE (engine));
+ engine->engine = new PinyinEngine (IBUS_ENGINE (engine));
}
return (GObject *) engine;
}
diff --git a/src/PYLibPinyin.cc b/src/PYLibPinyin.cc
index 57b61fa..d34956f 100644
--- a/src/PYLibPinyin.cc
+++ b/src/PYLibPinyin.cc
@@ -89,7 +89,7 @@ LibPinyinBackEnd::initPinyinContext (Config *config)
pinyin_instance_t *
LibPinyinBackEnd::allocPinyinInstance ()
{
- Config * config = &LibPinyinPinyinConfig::instance ();
+ Config * config = &PinyinConfig::instance ();
if (NULL == m_pinyin_context) {
m_pinyin_context = initPinyinContext (config);
}
@@ -135,7 +135,7 @@ LibPinyinBackEnd::initChewingContext (Config *config)
pinyin_instance_t *
LibPinyinBackEnd::allocChewingInstance ()
{
- Config *config = &LibPinyinBopomofoConfig::instance ();
+ Config *config = &BopomofoConfig::instance ();
if (NULL == m_chewing_context) {
m_chewing_context = initChewingContext (config);
}
diff --git a/src/PYMain.cc b/src/PYMain.cc
index 4e49d9f..a2e4de3 100644
--- a/src/PYMain.cc
+++ b/src/PYMain.cc
@@ -88,8 +88,8 @@ start_component (void)
LibPinyinBackEnd::init ();
- LibPinyinPinyinConfig::init (bus);
- LibPinyinBopomofoConfig::init (bus);
+ PinyinConfig::init (bus);
+ BopomofoConfig::init (bus);
g_signal_connect ((IBusBus *)bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NULL);
diff --git a/src/PYPBopomofoEditor.cc b/src/PYPBopomofoEditor.cc
index 5c901c2..e0788a7 100644
--- a/src/PYPBopomofoEditor.cc
+++ b/src/PYPBopomofoEditor.cc
@@ -40,29 +40,29 @@ const static gchar * bopomofo_select_keys[] = {
"qweasdzxcr"
};
-LibPinyinBopomofoEditor::LibPinyinBopomofoEditor
+BopomofoEditor::BopomofoEditor
(PinyinProperties & props, Config & config)
- : LibPinyinPhoneticEditor (props, config),
+ : PhoneticEditor (props, config),
m_select_mode (FALSE)
{
m_instance = LibPinyinBackEnd::instance ().allocChewingInstance ();
}
-LibPinyinBopomofoEditor::~LibPinyinBopomofoEditor (void)
+BopomofoEditor::~BopomofoEditor (void)
{
LibPinyinBackEnd::instance ().freeChewingInstance (m_instance);
m_instance = NULL;
}
void
-LibPinyinBopomofoEditor::reset (void)
+BopomofoEditor::reset (void)
{
m_select_mode = FALSE;
- LibPinyinPhoneticEditor::reset ();
+ PhoneticEditor::reset ();
}
gboolean
-LibPinyinBopomofoEditor::insert (gint ch)
+BopomofoEditor::insert (gint ch)
{
/* is full */
if (G_UNLIKELY (m_text.length () >= MAX_PINYIN_LEN))
@@ -77,7 +77,7 @@ LibPinyinBopomofoEditor::insert (gint ch)
gboolean
-LibPinyinBopomofoEditor::processGuideKey (guint keyval, guint keycode,
+BopomofoEditor::processGuideKey (guint keyval, guint keycode,
guint modifiers)
{
if (!m_config.guideKey ())
@@ -99,7 +99,7 @@ LibPinyinBopomofoEditor::processGuideKey (guint keyval, guint keycode,
}
gboolean
-LibPinyinBopomofoEditor::processAuxiliarySelectKey
+BopomofoEditor::processAuxiliarySelectKey
(guint keyval, guint keycode, guint modifiers)
{
if (G_UNLIKELY (cmshm_filter (modifiers) != 0))
@@ -135,7 +135,7 @@ LibPinyinBopomofoEditor::processAuxiliarySelectKey
}
gboolean
-LibPinyinBopomofoEditor::processSelectKey (guint keyval, guint keycode,
+BopomofoEditor::processSelectKey (guint keyval, guint keycode,
guint modifiers)
{
if (G_UNLIKELY (!m_text))
@@ -164,7 +164,7 @@ LibPinyinBopomofoEditor::processSelectKey (guint keyval, guint keycode,
}
gboolean
-LibPinyinBopomofoEditor::processBopomofo (guint keyval, guint keycode,
+BopomofoEditor::processBopomofo (guint keyval, guint keycode,
guint modifiers)
{
if (G_UNLIKELY (cmshm_filter (modifiers) != 0))
@@ -182,7 +182,7 @@ LibPinyinBopomofoEditor::processBopomofo (guint keyval, guint keycode,
}
gboolean
-LibPinyinBopomofoEditor::processKeyEvent (guint keyval, guint keycode,
+BopomofoEditor::processKeyEvent (guint keyval, guint keycode,
guint modifiers)
{
modifiers &= (IBUS_SHIFT_MASK |
@@ -214,7 +214,7 @@ LibPinyinBopomofoEditor::processKeyEvent (guint keyval, guint keycode,
case IBUS_Page_Down: case IBUS_KP_Page_Down:
case IBUS_Tab:
m_select_mode = TRUE;
- return LibPinyinPhoneticEditor::processFunctionKey
+ return PhoneticEditor::processFunctionKey
(keyval, keycode, modifiers);
case IBUS_BackSpace:
@@ -224,18 +224,18 @@ LibPinyinBopomofoEditor::processKeyEvent (guint keyval, guint keycode,
case IBUS_Home: case IBUS_KP_Home:
case IBUS_End: case IBUS_KP_End:
m_select_mode = FALSE;
- return LibPinyinPhoneticEditor::processFunctionKey
+ return PhoneticEditor::processFunctionKey
(keyval, keycode, modifiers);
default:
- return LibPinyinPhoneticEditor::processFunctionKey
+ return PhoneticEditor::processFunctionKey
(keyval, keycode, modifiers);
}
return FALSE;
}
void
-LibPinyinBopomofoEditor::updatePinyin (void)
+BopomofoEditor::updatePinyin (void)
{
if (G_UNLIKELY (m_text.empty ())) {
m_pinyin_len = 0;
@@ -251,7 +251,7 @@ LibPinyinBopomofoEditor::updatePinyin (void)
}
void
-LibPinyinBopomofoEditor::commit ()
+BopomofoEditor::commit ()
{
if (G_UNLIKELY (m_text.empty ()))
return;
@@ -288,12 +288,12 @@ LibPinyinBopomofoEditor::commit ()
pinyin_train(m_instance);
LibPinyinBackEnd::instance ().modified();
- LibPinyinPhoneticEditor::commit ((const gchar *)m_buffer);
+ PhoneticEditor::commit ((const gchar *)m_buffer);
reset();
}
void
-LibPinyinBopomofoEditor::updatePreeditText ()
+BopomofoEditor::updatePreeditText ()
{
/* preedit text = guessed sentence + un-parsed pinyin text */
if (G_UNLIKELY (m_text.empty ())) {
@@ -327,7 +327,7 @@ LibPinyinBopomofoEditor::updatePreeditText ()
}
void
-LibPinyinBopomofoEditor::updateAuxiliaryText (void)
+BopomofoEditor::updateAuxiliaryText (void)
{
if (G_UNLIKELY (m_text.empty ())) {
hideAuxiliaryText ();
diff --git a/src/PYPBopomofoEditor.h b/src/PYPBopomofoEditor.h
index edf8491..0093842 100644
--- a/src/PYPBopomofoEditor.h
+++ b/src/PYPBopomofoEditor.h
@@ -29,11 +29,11 @@ class Config;
#define MAX_PINYIN_LEN 64
-class LibPinyinBopomofoEditor : public LibPinyinPhoneticEditor {
+class BopomofoEditor : public PhoneticEditor {
public:
- LibPinyinBopomofoEditor (PinyinProperties & props, Config & config);
- virtual ~LibPinyinBopomofoEditor (void);
+ BopomofoEditor (PinyinProperties & props, Config & config);
+ virtual ~BopomofoEditor (void);
protected:
String bopomofo;
diff --git a/src/PYPBopomofoEngine.cc b/src/PYPBopomofoEngine.cc
index 75b8b57..1d7107e 100644
--- a/src/PYPBopomofoEngine.cc
+++ b/src/PYPBopomofoEngine.cc
@@ -31,21 +31,21 @@
using namespace PY;
/* constructor */
-LibPinyinBopomofoEngine::LibPinyinBopomofoEngine (IBusEngine *engine)
+BopomofoEngine::BopomofoEngine (IBusEngine *engine)
: Engine (engine),
- m_props (LibPinyinBopomofoConfig::instance ()),
+ m_props (BopomofoConfig::instance ()),
m_prev_pressed_key (IBUS_VoidSymbol),
m_input_mode (MODE_INIT),
- m_fallback_editor (new FallbackEditor (m_props, LibPinyinBopomofoConfig::instance()))
+ m_fallback_editor (new FallbackEditor (m_props, BopomofoConfig::instance()))
{
gint i;
/* create editors */
- m_editors[MODE_INIT].reset (new LibPinyinBopomofoEditor (m_props, LibPinyinBopomofoConfig::instance ()));
- m_editors[MODE_PUNCT].reset (new PunctEditor (m_props, LibPinyinBopomofoConfig::instance ()));
+ m_editors[MODE_INIT].reset (new BopomofoEditor (m_props, BopomofoConfig::instance ()));
+ m_editors[MODE_PUNCT].reset (new PunctEditor (m_props, BopomofoConfig::instance ()));
m_props.signalUpdateProperty ().connect
- (std::bind (&LibPinyinBopomofoEngine::updateProperty, this, _1));
+ (std::bind (&BopomofoEngine::updateProperty, this, _1));
for (i = MODE_INIT; i < MODE_LAST; i++) {
connectEditorSignals (m_editors[i]);
@@ -55,12 +55,12 @@ LibPinyinBopomofoEngine::LibPinyinBopomofoEngine (IBusEngine *engine)
}
/* destructor */
-LibPinyinBopomofoEngine::~LibPinyinBopomofoEngine (void)
+BopomofoEngine::~BopomofoEngine (void)
{
}
gboolean
-LibPinyinBopomofoEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers)
+BopomofoEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers)
{
gboolean retval = FALSE;
@@ -75,7 +75,7 @@ LibPinyinBopomofoEngine::processKeyEvent (guint keyval, guint keycode, guint mod
gboolean triggered = FALSE;
if (m_prev_pressed_key == keyval) {
- if (LibPinyinBopomofoConfig::instance ().ctrlSwitch ()) {
+ if (BopomofoConfig::instance ().ctrlSwitch ()) {
if (keyval == IBUS_Control_L || keyval == IBUS_Control_R)
triggered = TRUE;
} else {
@@ -135,13 +135,13 @@ LibPinyinBopomofoEngine::processKeyEvent (guint keyval, guint keycode, guint mod
}
void
-LibPinyinBopomofoEngine::focusIn (void)
+BopomofoEngine::focusIn (void)
{
registerProperties (m_props.properties ());
}
void
-LibPinyinBopomofoEngine::focusOut (void)
+BopomofoEngine::focusOut (void)
{
Engine::focusOut ();
@@ -149,7 +149,7 @@ LibPinyinBopomofoEngine::focusOut (void)
}
void
-LibPinyinBopomofoEngine::reset (void)
+BopomofoEngine::reset (void)
{
m_prev_pressed_key = IBUS_VoidSymbol;
m_input_mode = MODE_INIT;
@@ -160,49 +160,49 @@ LibPinyinBopomofoEngine::reset (void)
}
void
-LibPinyinBopomofoEngine::enable (void)
+BopomofoEngine::enable (void)
{
m_props.reset ();
}
void
-LibPinyinBopomofoEngine::disable (void)
+BopomofoEngine::disable (void)
{
}
void
-LibPinyinBopomofoEngine::pageUp (void)
+BopomofoEngine::pageUp (void)
{
m_editors[m_input_mode]->pageUp ();
}
void
-LibPinyinBopomofoEngine::pageDown (void)
+BopomofoEngine::pageDown (void)
{
m_editors[m_input_mode]->pageDown ();
}
void
-LibPinyinBopomofoEngine::cursorUp (void)
+BopomofoEngine::cursorUp (void)
{
m_editors[m_input_mode]->cursorUp ();
}
void
-LibPinyinBopomofoEngine::cursorDown (void)
+BopomofoEngine::cursorDown (void)
{
m_editors[m_input_mode]->cursorDown ();
}
inline void
-LibPinyinBopomofoEngine::showSetupDialog (void)
+BopomofoEngine::showSetupDialog (void)
{
g_spawn_command_line_async
(LIBEXECDIR"/ibus-setup-libpinyin bopomofo", NULL);
}
gboolean
-LibPinyinBopomofoEngine::propertyActivate (const gchar *prop_name,
+BopomofoEngine::propertyActivate (const gchar *prop_name,
guint prop_state)
{
const static std::string setup ("setup");
@@ -217,7 +217,7 @@ LibPinyinBopomofoEngine::propertyActivate (const gchar *prop_name,
}
void
-LibPinyinBopomofoEngine::candidateClicked (guint index,
+BopomofoEngine::candidateClicked (guint index,
guint button,
guint state)
{
@@ -225,7 +225,7 @@ LibPinyinBopomofoEngine::candidateClicked (guint index,
}
void
-LibPinyinBopomofoEngine::commitText (Text & text)
+BopomofoEngine::commitText (Text & text)
{
Engine::commitText (text);
if (m_input_mode != MODE_INIT)
@@ -240,33 +240,33 @@ LibPinyinBopomofoEngine::commitText (Text & text)
}
void
-LibPinyinBopomofoEngine::connectEditorSignals (EditorPtr editor)
+BopomofoEngine::connectEditorSignals (EditorPtr editor)
{
editor->signalCommitText ().connect (
- std::bind (&LibPinyinBopomofoEngine::commitText, this, _1));
+ std::bind (&BopomofoEngine::commitText, this, _1));
editor->signalUpdatePreeditText ().connect (
- std::bind (&LibPinyinBopomofoEngine::updatePreeditText, this, _1, _2, _3));
+ std::bind (&BopomofoEngine::updatePreeditText, this, _1, _2, _3));
editor->signalShowPreeditText ().connect (
- std::bind (&LibPinyinBopomofoEngine::showPreeditText, this));
+ std::bind (&BopomofoEngine::showPreeditText, this));
editor->signalHidePreeditText ().connect (
- std::bind (&LibPinyinBopomofoEngine::hidePreeditText, this));
+ std::bind (&BopomofoEngine::hidePreeditText, this));
editor->signalUpdateAuxiliaryText ().connect (
- std::bind (&LibPinyinBopomofoEngine::updateAuxiliaryText, this, _1, _2));
+ std::bind (&BopomofoEngine::updateAuxiliaryText, this, _1, _2));
editor->signalShowAuxiliaryText ().connect (
- std::bind (&LibPinyinBopomofoEngine::showAuxiliaryText, this));
+ std::bind (&BopomofoEngine::showAuxiliaryText, this));
editor->signalHideAuxiliaryText ().connect (
- std::bind (&LibPinyinBopomofoEngine::hideAuxiliaryText, this));
+ std::bind (&BopomofoEngine::hideAuxiliaryText, this));
editor->signalUpdateLookupTable ().connect (
- std::bind (&LibPinyinBopomofoEngine::updateLookupTable, this, _1, _2));
+ std::bind (&BopomofoEngine::updateLookupTable, this, _1, _2));
editor->signalUpdateLookupTableFast ().connect (
- std::bind (&LibPinyinBopomofoEngine::updateLookupTableFast, this, _1, _2));
+ std::bind (&BopomofoEngine::updateLookupTableFast, this, _1, _2));
editor->signalShowLookupTable ().connect (
- std::bind (&LibPinyinBopomofoEngine::showLookupTable, this));
+ std::bind (&BopomofoEngine::showLookupTable, this));
editor->signalHideLookupTable ().connect (
- std::bind (&LibPinyinBopomofoEngine::hideLookupTable, this));
+ std::bind (&BopomofoEngine::hideLookupTable, this));
}
diff --git a/src/PYPBopomofoEngine.h b/src/PYPBopomofoEngine.h
index fc64842..f52de47 100644
--- a/src/PYPBopomofoEngine.h
+++ b/src/PYPBopomofoEngine.h
@@ -28,10 +28,10 @@
namespace PY {
-class LibPinyinBopomofoEngine : public Engine {
+class BopomofoEngine : public Engine {
public:
- LibPinyinBopomofoEngine (IBusEngine *engine);
- ~LibPinyinBopomofoEngine (void);
+ BopomofoEngine (IBusEngine *engine);
+ ~BopomofoEngine (void);
// virtual functions
gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
index 8597b07..a6b8902 100644
--- a/src/PYPConfig.cc
+++ b/src/PYPConfig.cc
@@ -61,8 +61,8 @@ const pinyin_option_t PINYIN_DEFAULT_OPTION =
PINYIN_CORRECT_ALL|
0;
-std::unique_ptr<LibPinyinPinyinConfig> LibPinyinPinyinConfig::m_instance;
-std::unique_ptr<LibPinyinBopomofoConfig> LibPinyinBopomofoConfig::m_instance;
+std::unique_ptr<PinyinConfig> PinyinConfig::m_instance;
+std::unique_ptr<BopomofoConfig> BopomofoConfig::m_instance;
LibPinyinConfig::LibPinyinConfig (Bus & bus, const std::string & name)
: Config (bus, name)
@@ -286,22 +286,22 @@ static const struct{
{5, DOUBLE_PINYIN_XHE}
};
-LibPinyinPinyinConfig::LibPinyinPinyinConfig (Bus & bus)
+PinyinConfig::PinyinConfig (Bus & bus)
: LibPinyinConfig (bus, "pinyin")
{
}
void
-LibPinyinPinyinConfig::init (Bus & bus)
+PinyinConfig::init (Bus & bus)
{
if (m_instance.get () == NULL) {
- m_instance.reset (new LibPinyinPinyinConfig (bus));
+ m_instance.reset (new PinyinConfig (bus));
m_instance->readDefaultValues ();
}
}
void
-LibPinyinPinyinConfig::readDefaultValues (void)
+PinyinConfig::readDefaultValues (void)
{
LibPinyinConfig::readDefaultValues ();
#if !defined(HAVE_IBUS_CONFIG_GET_VALUES)
@@ -352,7 +352,7 @@ LibPinyinPinyinConfig::readDefaultValues (void)
}
gboolean
-LibPinyinPinyinConfig::valueChanged (const std::string &section,
+PinyinConfig::valueChanged (const std::string &section,
const std::string &name,
GVariant *value)
{
@@ -439,22 +439,22 @@ static const struct {
{3, CHEWING_IBM}
};
-LibPinyinBopomofoConfig::LibPinyinBopomofoConfig (Bus & bus)
+BopomofoConfig::BopomofoConfig (Bus & bus)
: LibPinyinConfig (bus, "bopomofo")
{
}
void
-LibPinyinBopomofoConfig::init (Bus & bus)
+BopomofoConfig::init (Bus & bus)
{
if (m_instance.get () == NULL) {
- m_instance.reset (new LibPinyinBopomofoConfig (bus));
+ m_instance.reset (new BopomofoConfig (bus));
m_instance->readDefaultValues ();
}
}
void
-LibPinyinBopomofoConfig::readDefaultValues (void)
+BopomofoConfig::readDefaultValues (void)
{
LibPinyinConfig::readDefaultValues ();
#if !defined(HAVE_IBUS_CONFIG_GET_VALUES)
@@ -486,7 +486,7 @@ LibPinyinBopomofoConfig::readDefaultValues (void)
}
gboolean
-LibPinyinBopomofoConfig::valueChanged (const std::string &section,
+BopomofoConfig::valueChanged (const std::string &section,
const std::string &name,
GVariant *value)
{
diff --git a/src/PYPConfig.h b/src/PYPConfig.h
index 56f8b01..23aa365 100644
--- a/src/PYPConfig.h
+++ b/src/PYPConfig.h
@@ -61,13 +61,13 @@ protected:
};
/* PinyinConfig */
-class LibPinyinPinyinConfig : public LibPinyinConfig {
+class PinyinConfig : public LibPinyinConfig {
public:
static void init (Bus & bus);
- static LibPinyinPinyinConfig & instance (void) { return *m_instance; }
+ static PinyinConfig & instance (void) { return *m_instance; }
protected:
- LibPinyinPinyinConfig (Bus & bus);
+ PinyinConfig (Bus & bus);
virtual void readDefaultValues (void);
virtual gboolean valueChanged (const std::string &section,
@@ -75,17 +75,17 @@ protected:
GVariant *value);
private:
- static std::unique_ptr<LibPinyinPinyinConfig> m_instance;
+ static std::unique_ptr<PinyinConfig> m_instance;
};
/* Bopomof Config */
-class LibPinyinBopomofoConfig : public LibPinyinConfig {
+class BopomofoConfig : public LibPinyinConfig {
public:
static void init (Bus & bus);
- static LibPinyinBopomofoConfig & instance (void) { return *m_instance; }
+ static BopomofoConfig & instance (void) { return *m_instance; }
protected:
- LibPinyinBopomofoConfig (Bus & bus);
+ BopomofoConfig (Bus & bus);
virtual void readDefaultValues (void);
virtual gboolean valueChanged (const std::string &section,
@@ -93,7 +93,7 @@ protected:
GVariant *value);
private:
- static std::unique_ptr<LibPinyinBopomofoConfig> m_instance;
+ static std::unique_ptr<BopomofoConfig> m_instance;
};
};
diff --git a/src/PYPDoublePinyinEditor.cc b/src/PYPDoublePinyinEditor.cc
index b204fcd..45f492f 100644
--- a/src/PYPDoublePinyinEditor.cc
+++ b/src/PYPDoublePinyinEditor.cc
@@ -37,21 +37,21 @@ using namespace PY;
((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
-LibPinyinDoublePinyinEditor::LibPinyinDoublePinyinEditor
+DoublePinyinEditor::DoublePinyinEditor
( PinyinProperties & props, Config & config)
- : LibPinyinPinyinEditor (props, config)
+ : PinyinEditor (props, config)
{
m_instance = LibPinyinBackEnd::instance ().allocPinyinInstance ();
}
-LibPinyinDoublePinyinEditor::~LibPinyinDoublePinyinEditor (void)
+DoublePinyinEditor::~DoublePinyinEditor (void)
{
LibPinyinBackEnd::instance ().freePinyinInstance (m_instance);
m_instance = NULL;
}
gboolean
-LibPinyinDoublePinyinEditor::insert (gint ch)
+DoublePinyinEditor::insert (gint ch)
{
/* is full */
if (G_UNLIKELY (m_text.length () >= MAX_PINYIN_LEN))
@@ -76,13 +76,13 @@ LibPinyinDoublePinyinEditor::insert (gint ch)
return TRUE;
}
-void LibPinyinDoublePinyinEditor::reset (void)
+void DoublePinyinEditor::reset (void)
{
- LibPinyinPinyinEditor::reset ();
+ PinyinEditor::reset ();
}
gboolean
-LibPinyinDoublePinyinEditor::processKeyEvent (guint keyval, guint keycode,
+DoublePinyinEditor::processKeyEvent (guint keyval, guint keycode,
guint modifiers)
{
/* handle ';' key */
@@ -97,11 +97,11 @@ LibPinyinDoublePinyinEditor::processKeyEvent (guint keyval, guint keycode,
}
}
- return LibPinyinPinyinEditor::processKeyEvent (keyval, keycode, modifiers);
+ return PinyinEditor::processKeyEvent (keyval, keycode, modifiers);
}
void
-LibPinyinDoublePinyinEditor::updatePinyin (void)
+DoublePinyinEditor::updatePinyin (void)
{
if (G_UNLIKELY (m_text.empty ())) {
m_pinyin_len = 0;
@@ -118,7 +118,7 @@ LibPinyinDoublePinyinEditor::updatePinyin (void)
void
-LibPinyinDoublePinyinEditor::updateAuxiliaryText (void)
+DoublePinyinEditor::updateAuxiliaryText (void)
{
if (G_UNLIKELY (m_text.empty ())) {
hideAuxiliaryText ();
diff --git a/src/PYPDoublePinyinEditor.h b/src/PYPDoublePinyinEditor.h
index 991ee99..c5cf395 100644
--- a/src/PYPDoublePinyinEditor.h
+++ b/src/PYPDoublePinyinEditor.h
@@ -25,11 +25,11 @@
namespace PY {
-class LibPinyinDoublePinyinEditor : public LibPinyinPinyinEditor {
+class DoublePinyinEditor : public PinyinEditor {
public:
- LibPinyinDoublePinyinEditor (PinyinProperties & props, Config & config);
- ~LibPinyinDoublePinyinEditor (void);
+ DoublePinyinEditor (PinyinProperties & props, Config & config);
+ ~DoublePinyinEditor (void);
gboolean insert (gint ch);
diff --git a/src/PYPFullPinyinEditor.cc b/src/PYPFullPinyinEditor.cc
index d825982..0e70ff5 100644
--- a/src/PYPFullPinyinEditor.cc
+++ b/src/PYPFullPinyinEditor.cc
@@ -25,27 +25,27 @@
using namespace PY;
-LibPinyinFullPinyinEditor::LibPinyinFullPinyinEditor
+FullPinyinEditor::FullPinyinEditor
(PinyinProperties & props, Config & config)
- : LibPinyinPinyinEditor (props, config)
+ : PinyinEditor (props, config)
{
m_instance = LibPinyinBackEnd::instance ().allocPinyinInstance ();
}
-LibPinyinFullPinyinEditor::~LibPinyinFullPinyinEditor (void)
+FullPinyinEditor::~FullPinyinEditor (void)
{
LibPinyinBackEnd::instance ().freePinyinInstance (m_instance);
m_instance = NULL;
}
void
-LibPinyinFullPinyinEditor::reset (void)
+FullPinyinEditor::reset (void)
{
- LibPinyinPinyinEditor::reset ();
+ PinyinEditor::reset ();
}
gboolean
-LibPinyinFullPinyinEditor::insert (gint ch)
+FullPinyinEditor::insert (gint ch)
{
/* is full */
if (G_UNLIKELY (m_text.length () >= MAX_PINYIN_LEN))
@@ -60,15 +60,15 @@ LibPinyinFullPinyinEditor::insert (gint ch)
gboolean
-LibPinyinFullPinyinEditor::processKeyEvent (guint keyval,
+FullPinyinEditor::processKeyEvent (guint keyval,
guint keycode,
guint modifiers)
{
- return LibPinyinPinyinEditor::processKeyEvent (keyval, keycode, modifiers);
+ return PinyinEditor::processKeyEvent (keyval, keycode, modifiers);
}
void
-LibPinyinFullPinyinEditor::updatePinyin (void)
+FullPinyinEditor::updatePinyin (void)
{
if (G_UNLIKELY (m_text.empty ())) {
m_pinyin_len = 0;
@@ -84,7 +84,7 @@ LibPinyinFullPinyinEditor::updatePinyin (void)
}
void
-LibPinyinFullPinyinEditor::updateAuxiliaryText (void)
+FullPinyinEditor::updateAuxiliaryText (void)
{
if (G_UNLIKELY (m_text.empty ())) {
hideAuxiliaryText ();
@@ -140,7 +140,7 @@ LibPinyinFullPinyinEditor::updateAuxiliaryText (void)
}
void
-LibPinyinFullPinyinEditor::update (void)
+FullPinyinEditor::update (void)
{
guint lookup_cursor = getLookupCursor ();
pinyin_guess_full_pinyin_candidates (m_instance, lookup_cursor);
diff --git a/src/PYPFullPinyinEditor.h b/src/PYPFullPinyinEditor.h
index bb92655..cffbdd9 100644
--- a/src/PYPFullPinyinEditor.h
+++ b/src/PYPFullPinyinEditor.h
@@ -25,11 +25,11 @@
namespace PY {
-class LibPinyinFullPinyinEditor : public LibPinyinPinyinEditor {
+class FullPinyinEditor : public PinyinEditor {
public:
- LibPinyinFullPinyinEditor (PinyinProperties & props, Config & config);
- ~LibPinyinFullPinyinEditor (void);
+ FullPinyinEditor (PinyinProperties & props, Config & config);
+ ~FullPinyinEditor (void);
public:
gboolean insert (gint ch);
diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc
index dd18166..0be3a7b 100644
--- a/src/PYPPhoneticEditor.cc
+++ b/src/PYPPhoneticEditor.cc
@@ -26,7 +26,7 @@
using namespace PY;
/* init static members */
-LibPinyinPhoneticEditor::LibPinyinPhoneticEditor (PinyinProperties &props,
+PhoneticEditor::PhoneticEditor (PinyinProperties &props,
Config &config):
Editor (props, config),
m_pinyin_len (0),
@@ -34,11 +34,11 @@ LibPinyinPhoneticEditor::LibPinyinPhoneticEditor (PinyinProperties &props,
{
}
-LibPinyinPhoneticEditor::~LibPinyinPhoneticEditor (){
+PhoneticEditor::~PhoneticEditor (){
}
gboolean
-LibPinyinPhoneticEditor::processSpace (guint keyval, guint keycode,
+PhoneticEditor::processSpace (guint keyval, guint keycode,
guint modifiers)
{
if (!m_text)
@@ -58,7 +58,7 @@ LibPinyinPhoneticEditor::processSpace (guint keyval, guint keycode,
}
gboolean
-LibPinyinPhoneticEditor::processFunctionKey (guint keyval, guint keycode, guint modifiers)
+PhoneticEditor::processFunctionKey (guint keyval, guint keycode, guint modifiers)
{
if (m_text.empty ())
return FALSE;
@@ -163,19 +163,19 @@ LibPinyinPhoneticEditor::processFunctionKey (guint keyval, guint keycode, guint
}
gboolean
-LibPinyinPhoneticEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers)
+PhoneticEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers)
{
return FALSE;
}
void
-LibPinyinPhoneticEditor::updateLookupTableFast (void)
+PhoneticEditor::updateLookupTableFast (void)
{
Editor::updateLookupTableFast (m_lookup_table, TRUE);
}
void
-LibPinyinPhoneticEditor::updateLookupTable (void)
+PhoneticEditor::updateLookupTable (void)
{
m_lookup_table.clear ();
@@ -188,7 +188,7 @@ LibPinyinPhoneticEditor::updateLookupTable (void)
}
gboolean
-LibPinyinPhoneticEditor::fillLookupTableByPage (void)
+PhoneticEditor::fillLookupTableByPage (void)
{
guint len = 0;
pinyin_get_n_candidate (m_instance, &len);
@@ -229,7 +229,7 @@ LibPinyinPhoneticEditor::fillLookupTableByPage (void)
}
void
-LibPinyinPhoneticEditor::pageUp (void)
+PhoneticEditor::pageUp (void)
{
if (G_LIKELY (m_lookup_table.pageUp ())) {
updateLookupTableFast ();
@@ -239,7 +239,7 @@ LibPinyinPhoneticEditor::pageUp (void)
}
void
-LibPinyinPhoneticEditor::pageDown (void)
+PhoneticEditor::pageDown (void)
{
if (G_LIKELY((m_lookup_table.pageDown ()) ||
(fillLookupTableByPage () && m_lookup_table.pageDown()))) {
@@ -250,7 +250,7 @@ LibPinyinPhoneticEditor::pageDown (void)
}
void
-LibPinyinPhoneticEditor::cursorUp (void)
+PhoneticEditor::cursorUp (void)
{
if (G_LIKELY (m_lookup_table.cursorUp ())) {
updateLookupTableFast ();
@@ -260,7 +260,7 @@ LibPinyinPhoneticEditor::cursorUp (void)
}
void
-LibPinyinPhoneticEditor::cursorDown (void)
+PhoneticEditor::cursorDown (void)
{
if (G_LIKELY ((m_lookup_table.cursorPos () == m_lookup_table.size() - 1) &&
(fillLookupTableByPage () == FALSE))) {
@@ -275,13 +275,13 @@ LibPinyinPhoneticEditor::cursorDown (void)
}
void
-LibPinyinPhoneticEditor::candidateClicked (guint index, guint button, guint state)
+PhoneticEditor::candidateClicked (guint index, guint button, guint state)
{
selectCandidateInPage (index);
}
void
-LibPinyinPhoneticEditor::reset (void)
+PhoneticEditor::reset (void)
{
m_pinyin_len = 0;
m_lookup_table.clear ();
@@ -292,7 +292,7 @@ LibPinyinPhoneticEditor::reset (void)
}
void
-LibPinyinPhoneticEditor::update (void)
+PhoneticEditor::update (void)
{
guint lookup_cursor = getLookupCursor ();
pinyin_guess_candidates (m_instance, lookup_cursor);
@@ -303,14 +303,14 @@ LibPinyinPhoneticEditor::update (void)
}
void
-LibPinyinPhoneticEditor::commit (const gchar *str)
+PhoneticEditor::commit (const gchar *str)
{
StaticText text(str);
commitText (text);
}
guint
-LibPinyinPhoneticEditor::getPinyinCursor ()
+PhoneticEditor::getPinyinCursor ()
{
guint len = 0;
pinyin_get_n_pinyin (m_instance, &len);
@@ -335,7 +335,7 @@ LibPinyinPhoneticEditor::getPinyinCursor ()
}
guint
-LibPinyinPhoneticEditor::getLookupCursor (void)
+PhoneticEditor::getLookupCursor (void)
{
guint len = 0;
pinyin_get_n_pinyin (m_instance, &len);
@@ -348,7 +348,7 @@ LibPinyinPhoneticEditor::getLookupCursor (void)
}
gboolean
-LibPinyinPhoneticEditor::selectCandidate (guint i)
+PhoneticEditor::selectCandidate (guint i)
{
guint len = 0;
pinyin_get_n_candidate (m_instance, &len);
@@ -401,7 +401,7 @@ LibPinyinPhoneticEditor::selectCandidate (guint i)
}
gboolean
-LibPinyinPhoneticEditor::selectCandidateInPage (guint i)
+PhoneticEditor::selectCandidateInPage (guint i)
{
guint page_size = m_lookup_table.pageSize ();
guint cursor_pos = m_lookup_table.cursorPos ();
@@ -414,7 +414,7 @@ LibPinyinPhoneticEditor::selectCandidateInPage (guint i)
}
gboolean
-LibPinyinPhoneticEditor::removeCharBefore (void)
+PhoneticEditor::removeCharBefore (void)
{
if (G_UNLIKELY (m_cursor == 0))
return FALSE;
@@ -429,7 +429,7 @@ LibPinyinPhoneticEditor::removeCharBefore (void)
}
gboolean
-LibPinyinPhoneticEditor::removeCharAfter (void)
+PhoneticEditor::removeCharAfter (void)
{
if (G_UNLIKELY (m_cursor == m_text.length ()))
return FALSE;
@@ -443,7 +443,7 @@ LibPinyinPhoneticEditor::removeCharAfter (void)
}
gboolean
-LibPinyinPhoneticEditor::moveCursorLeft (void)
+PhoneticEditor::moveCursorLeft (void)
{
if (G_UNLIKELY (m_cursor == 0))
return FALSE;
@@ -454,7 +454,7 @@ LibPinyinPhoneticEditor::moveCursorLeft (void)
}
gboolean
-LibPinyinPhoneticEditor::moveCursorRight (void)
+PhoneticEditor::moveCursorRight (void)
{
if (G_UNLIKELY (m_cursor == m_text.length ()))
return FALSE;
@@ -465,7 +465,7 @@ LibPinyinPhoneticEditor::moveCursorRight (void)
}
gboolean
-LibPinyinPhoneticEditor::moveCursorToBegin (void)
+PhoneticEditor::moveCursorToBegin (void)
{
if (G_UNLIKELY (m_cursor == 0))
return FALSE;
@@ -476,7 +476,7 @@ LibPinyinPhoneticEditor::moveCursorToBegin (void)
}
gboolean
-LibPinyinPhoneticEditor::moveCursorToEnd (void)
+PhoneticEditor::moveCursorToEnd (void)
{
if (G_UNLIKELY (m_cursor == m_text.length ()))
return FALSE;
@@ -490,7 +490,7 @@ LibPinyinPhoneticEditor::moveCursorToEnd (void)
/* move cursor by word functions */
guint
-LibPinyinPhoneticEditor::getCursorLeftByWord (void)
+PhoneticEditor::getCursorLeftByWord (void)
{
guint16 cursor = 0;
@@ -528,7 +528,7 @@ LibPinyinPhoneticEditor::getCursorLeftByWord (void)
}
guint
-LibPinyinPhoneticEditor::getCursorRightByWord (void)
+PhoneticEditor::getCursorRightByWord (void)
{
guint16 cursor = 0;
@@ -545,7 +545,7 @@ LibPinyinPhoneticEditor::getCursorRightByWord (void)
}
gboolean
-LibPinyinPhoneticEditor::removeWordBefore (void)
+PhoneticEditor::removeWordBefore (void)
{
if (G_UNLIKELY (m_cursor == 0))
return FALSE;
@@ -559,7 +559,7 @@ LibPinyinPhoneticEditor::removeWordBefore (void)
}
gboolean
-LibPinyinPhoneticEditor::removeWordAfter (void)
+PhoneticEditor::removeWordAfter (void)
{
if (G_UNLIKELY (m_cursor == m_text.length ()))
return FALSE;
@@ -572,7 +572,7 @@ LibPinyinPhoneticEditor::removeWordAfter (void)
}
gboolean
-LibPinyinPhoneticEditor::moveCursorLeftByWord (void)
+PhoneticEditor::moveCursorLeftByWord (void)
{
if (G_UNLIKELY (m_cursor == 0))
return FALSE;
@@ -585,7 +585,7 @@ LibPinyinPhoneticEditor::moveCursorLeftByWord (void)
}
gboolean
-LibPinyinPhoneticEditor::moveCursorRightByWord (void)
+PhoneticEditor::moveCursorRightByWord (void)
{
if (G_UNLIKELY (m_cursor == m_text.length ()))
return FALSE;
diff --git a/src/PYPPhoneticEditor.h b/src/PYPPhoneticEditor.h
index 3fe16e4..5708d86 100644
--- a/src/PYPPhoneticEditor.h
+++ b/src/PYPPhoneticEditor.h
@@ -28,10 +28,10 @@
namespace PY {
-class LibPinyinPhoneticEditor : public Editor {
+class PhoneticEditor : public Editor {
public:
- LibPinyinPhoneticEditor (PinyinProperties & props, Config & config);
- virtual ~LibPinyinPhoneticEditor ();
+ PhoneticEditor (PinyinProperties & props, Config & config);
+ virtual ~PhoneticEditor ();
public:
/* virtual functions */
diff --git a/src/PYPPinyinEditor.cc b/src/PYPPinyinEditor.cc
index d8a407b..2ab5151 100644
--- a/src/PYPPinyinEditor.cc
+++ b/src/PYPPinyinEditor.cc
@@ -29,9 +29,9 @@
using namespace PY;
/* init static members*/
-LibPinyinPinyinEditor::LibPinyinPinyinEditor (PinyinProperties & props,
+PinyinEditor::PinyinEditor (PinyinProperties & props,
Config & config)
- : LibPinyinPhoneticEditor (props, config)
+ : PhoneticEditor (props, config)
{
}
@@ -40,7 +40,7 @@ LibPinyinPinyinEditor::LibPinyinPinyinEditor (PinyinProperties & props,
* process pinyin
*/
inline gboolean
-LibPinyinPinyinEditor::processPinyin (guint keyval, guint keycode,
+PinyinEditor::processPinyin (guint keyval, guint keycode,
guint modifiers)
{
if (G_UNLIKELY (cmshm_filter (modifiers) != 0))
@@ -53,7 +53,7 @@ LibPinyinPinyinEditor::processPinyin (guint keyval, guint keycode,
* process numbers
*/
inline gboolean
-LibPinyinPinyinEditor::processNumber (guint keyval, guint keycode,
+PinyinEditor::processNumber (guint keyval, guint keycode,
guint modifiers)
{
guint i;
@@ -84,7 +84,7 @@ LibPinyinPinyinEditor::processNumber (guint keyval, guint keycode,
}
inline gboolean
-LibPinyinPinyinEditor::processPunct (guint keyval, guint keycode,
+PinyinEditor::processPunct (guint keyval, guint keycode,
guint modifiers)
{
if (m_text.empty ())
@@ -137,7 +137,7 @@ LibPinyinPinyinEditor::processPunct (guint keyval, guint keycode,
}
inline gboolean
-LibPinyinPinyinEditor::processFunctionKey (guint keyval, guint keycode,
+PinyinEditor::processFunctionKey (guint keyval, guint keycode,
guint modifiers)
{
if (m_text.empty ())
@@ -166,12 +166,12 @@ LibPinyinPinyinEditor::processFunctionKey (guint keyval, guint keycode,
}
}
- return LibPinyinPhoneticEditor::processFunctionKey (keyval, keycode,
+ return PhoneticEditor::processFunctionKey (keyval, keycode,
modifiers);
}
gboolean
-LibPinyinPinyinEditor::processKeyEvent (guint keyval, guint keycode,
+PinyinEditor::processKeyEvent (guint keyval, guint keycode,
guint modifiers)
{
modifiers &= (IBUS_SHIFT_MASK |
@@ -202,7 +202,7 @@ LibPinyinPinyinEditor::processKeyEvent (guint keyval, guint keycode,
}
void
-LibPinyinPinyinEditor::commit ()
+PinyinEditor::commit ()
{
if (G_UNLIKELY (m_text.empty ()))
return;
@@ -233,12 +233,12 @@ LibPinyinPinyinEditor::commit ()
pinyin_train (m_instance);
LibPinyinBackEnd::instance ().modified ();
- LibPinyinPhoneticEditor::commit ((const gchar *)m_buffer);
+ PhoneticEditor::commit ((const gchar *)m_buffer);
reset();
}
void
-LibPinyinPinyinEditor::updatePreeditText ()
+PinyinEditor::updatePreeditText ()
{
/* preedit text = guessed sentence + un-parsed pinyin text */
if (G_UNLIKELY (m_text.empty ())) {
@@ -272,7 +272,7 @@ LibPinyinPinyinEditor::updatePreeditText ()
}
void
-LibPinyinPinyinEditor::updateAuxiliaryText ()
+PinyinEditor::updateAuxiliaryText ()
{
if (G_UNLIKELY (m_text.empty ())) {
hideAuxiliaryText ();
@@ -309,10 +309,10 @@ LibPinyinPinyinEditor::updateAuxiliaryText ()
}
void
-LibPinyinPinyinEditor::updateLookupTable ()
+PinyinEditor::updateLookupTable ()
{
m_lookup_table.setPageSize (m_config.pageSize ());
m_lookup_table.setOrientation (m_config.orientation ());
- LibPinyinPhoneticEditor::updateLookupTable ();
+ PhoneticEditor::updateLookupTable ();
}
diff --git a/src/PYPPinyinEditor.h b/src/PYPPinyinEditor.h
index d5d6e83..de410de 100644
--- a/src/PYPPinyinEditor.h
+++ b/src/PYPPinyinEditor.h
@@ -29,9 +29,9 @@ namespace PY {
class Config;
-class LibPinyinPinyinEditor : public LibPinyinPhoneticEditor {
+class PinyinEditor : public PhoneticEditor {
public:
- LibPinyinPinyinEditor (PinyinProperties & props, Config & config);
+ PinyinEditor (PinyinProperties & props, Config & config);
protected:
diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc
index 4406239..4171e9a 100644
--- a/src/PYPPinyinEngine.cc
+++ b/src/PYPPinyinEngine.cc
@@ -41,47 +41,47 @@
using namespace PY;
/* constructor */
-LibPinyinPinyinEngine::LibPinyinPinyinEngine (IBusEngine *engine)
+PinyinEngine::PinyinEngine (IBusEngine *engine)
: Engine (engine),
- m_props (LibPinyinPinyinConfig::instance ()),
+ m_props (PinyinConfig::instance ()),
m_prev_pressed_key (IBUS_VoidSymbol),
m_input_mode (MODE_INIT),
- m_fallback_editor (new FallbackEditor (m_props, LibPinyinPinyinConfig::instance ()))
+ m_fallback_editor (new FallbackEditor (m_props, PinyinConfig::instance ()))
{
gint i;
- m_double_pinyin = LibPinyinPinyinConfig::instance ().doublePinyin ();
+ m_double_pinyin = PinyinConfig::instance ().doublePinyin ();
if (m_double_pinyin)
m_editors[MODE_INIT].reset
- (new LibPinyinDoublePinyinEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ (new DoublePinyinEditor (m_props, PinyinConfig::instance ()));
else
m_editors[MODE_INIT].reset
- (new LibPinyinFullPinyinEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ (new FullPinyinEditor (m_props, PinyinConfig::instance ()));
m_editors[MODE_PUNCT].reset
- (new PunctEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ (new PunctEditor (m_props, PinyinConfig::instance ()));
m_editors[MODE_RAW].reset
- (new RawEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ (new RawEditor (m_props, PinyinConfig::instance ()));
#ifdef IBUS_BUILD_LUA_EXTENSION
- m_editors[MODE_EXTENSION].reset (new ExtEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ m_editors[MODE_EXTENSION].reset (new ExtEditor (m_props, PinyinConfig::instance ()));
#else
- m_editors[MODE_EXTENSION].reset (new Editor (m_props, LibPinyinPinyinConfig::instance ()));
+ m_editors[MODE_EXTENSION].reset (new Editor (m_props, PinyinConfig::instance ()));
#endif
#ifdef IBUS_BUILD_ENGLISH_INPUT_MODE
- m_editors[MODE_ENGLISH].reset (new EnglishEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ m_editors[MODE_ENGLISH].reset (new EnglishEditor (m_props, PinyinConfig::instance ()));
#else
- m_editors[MODE_ENGLISH].reset (new Editor (m_props, LibPinyinPinyinConfig::instance ()));
+ m_editors[MODE_ENGLISH].reset (new Editor (m_props, PinyinConfig::instance ()));
#endif
#ifdef IBUS_BUILD_STROKE_INPUT_MODE
- m_editors[MODE_STROKE].reset (new StrokeEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ m_editors[MODE_STROKE].reset (new StrokeEditor (m_props, PinyinConfig::instance ()));
#else
- m_editors[MODE_STROKE].reset (new Editor (m_props, LibPinyinPinyinConfig::instance ()));
+ m_editors[MODE_STROKE].reset (new Editor (m_props, PinyinConfig::instance ()));
#endif
m_props.signalUpdateProperty ().connect
- (std::bind (&LibPinyinPinyinEngine::updateProperty, this, _1));
+ (std::bind (&PinyinEngine::updateProperty, this, _1));
for (i = MODE_INIT; i < MODE_LAST; i++) {
connectEditorSignals (m_editors[i]);
@@ -91,12 +91,12 @@ LibPinyinPinyinEngine::LibPinyinPinyinEngine (IBusEngine *engine)
}
/* destructor */
-LibPinyinPinyinEngine::~LibPinyinPinyinEngine (void)
+PinyinEngine::~PinyinEngine (void)
{
}
gboolean
-LibPinyinPinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers)
+PinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers)
{
gboolean retval = FALSE;
@@ -111,7 +111,7 @@ LibPinyinPinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modif
gboolean triggered = FALSE;
if (m_prev_pressed_key == keyval){
- if (LibPinyinPinyinConfig::instance ().ctrlSwitch ()) {
+ if (PinyinConfig::instance ().ctrlSwitch ()) {
if (keyval == IBUS_Control_L || keyval == IBUS_Control_R)
triggered = TRUE;
} else {
@@ -157,7 +157,7 @@ LibPinyinPinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modif
#ifdef IBUS_BUILD_LUA_EXTENSION
case IBUS_i:
// do not enable lua extension when use double pinyin.
- if (LibPinyinPinyinConfig::instance ().doublePinyin ())
+ if (PinyinConfig::instance ().doublePinyin ())
break;
m_input_mode = MODE_EXTENSION;
break;
@@ -165,7 +165,7 @@ LibPinyinPinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modif
#ifdef IBUS_BUILD_ENGLISH_INPUT_MODE
case IBUS_v:
// do not enable english mode when use double pinyin.
- if (LibPinyinPinyinConfig::instance ().doublePinyin ())
+ if (PinyinConfig::instance ().doublePinyin ())
break;
m_input_mode = MODE_ENGLISH;
break;
@@ -173,7 +173,7 @@ LibPinyinPinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modif
#ifdef IBUS_BUILD_STROKE_INPUT_MODE
case IBUS_u:
// do not enable stroke mode when use double pinyin.
- if (LibPinyinPinyinConfig::instance ().doublePinyin ())
+ if (PinyinConfig::instance ().doublePinyin ())
break;
m_input_mode = MODE_STROKE;
break;
@@ -200,20 +200,20 @@ LibPinyinPinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modif
}
void
-LibPinyinPinyinEngine::focusIn (void)
+PinyinEngine::focusIn (void)
{
/* TODO: check memory leak here,
* or switch full/double pinyin when pinyin config is changed.*/
- if (LibPinyinPinyinConfig::instance ().doublePinyin ()) {
+ if (PinyinConfig::instance ().doublePinyin ()) {
if (!m_double_pinyin) {
- m_editors[MODE_INIT].reset (new LibPinyinDoublePinyinEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ m_editors[MODE_INIT].reset (new DoublePinyinEditor (m_props, PinyinConfig::instance ()));
connectEditorSignals (m_editors[MODE_INIT]);
}
m_double_pinyin = TRUE;
}
else {
if (m_double_pinyin) {
- m_editors[MODE_INIT].reset (new LibPinyinFullPinyinEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ m_editors[MODE_INIT].reset (new FullPinyinEditor (m_props, PinyinConfig::instance ()));
connectEditorSignals (m_editors[MODE_INIT]);
}
m_double_pinyin = FALSE;
@@ -223,7 +223,7 @@ LibPinyinPinyinEngine::focusIn (void)
}
void
-LibPinyinPinyinEngine::focusOut (void)
+PinyinEngine::focusOut (void)
{
Engine::focusOut ();
@@ -231,7 +231,7 @@ LibPinyinPinyinEngine::focusOut (void)
}
void
-LibPinyinPinyinEngine::reset (void)
+PinyinEngine::reset (void)
{
m_prev_pressed_key = IBUS_VoidSymbol;
m_input_mode = MODE_INIT;
@@ -242,49 +242,49 @@ LibPinyinPinyinEngine::reset (void)
}
void
-LibPinyinPinyinEngine::enable (void)
+PinyinEngine::enable (void)
{
m_props.reset ();
}
void
-LibPinyinPinyinEngine::disable (void)
+PinyinEngine::disable (void)
{
}
void
-LibPinyinPinyinEngine::pageUp (void)
+PinyinEngine::pageUp (void)
{
m_editors[m_input_mode]->pageUp ();
}
void
-LibPinyinPinyinEngine::pageDown (void)
+PinyinEngine::pageDown (void)
{
m_editors[m_input_mode]->pageDown ();
}
void
-LibPinyinPinyinEngine::cursorUp (void)
+PinyinEngine::cursorUp (void)
{
m_editors[m_input_mode]->cursorUp ();
}
void
-LibPinyinPinyinEngine::cursorDown (void)
+PinyinEngine::cursorDown (void)
{
m_editors[m_input_mode]->cursorDown ();
}
inline void
-LibPinyinPinyinEngine::showSetupDialog (void)
+PinyinEngine::showSetupDialog (void)
{
g_spawn_command_line_async
(LIBEXECDIR"/ibus-setup-libpinyin pinyin", NULL);
}
gboolean
-LibPinyinPinyinEngine::propertyActivate (const char *prop_name, guint prop_state)
+PinyinEngine::propertyActivate (const char *prop_name, guint prop_state)
{
const static String setup ("setup");
if (m_props.propertyActivate (prop_name, prop_state)) {
@@ -298,13 +298,13 @@ LibPinyinPinyinEngine::propertyActivate (const char *prop_name, guint prop_state
}
void
-LibPinyinPinyinEngine::candidateClicked (guint index, guint button, guint state)
+PinyinEngine::candidateClicked (guint index, guint button, guint state)
{
m_editors[m_input_mode]->candidateClicked (index, button, state);
}
void
-LibPinyinPinyinEngine::commitText (Text & text)
+PinyinEngine::commitText (Text & text)
{
Engine::commitText (text);
if (m_input_mode != MODE_INIT)
@@ -319,31 +319,31 @@ LibPinyinPinyinEngine::commitText (Text & text)
}
void
-LibPinyinPinyinEngine::connectEditorSignals (EditorPtr editor)
+PinyinEngine::connectEditorSignals (EditorPtr editor)
{
editor->signalCommitText ().connect (
- std::bind (&LibPinyinPinyinEngine::commitText, this, _1));
+ std::bind (&PinyinEngine::commitText, this, _1));
editor->signalUpdatePreeditText ().connect (
- std::bind (&LibPinyinPinyinEngine::updatePreeditText, this, _1, _2, _3));
+ std::bind (&PinyinEngine::updatePreeditText, this, _1, _2, _3));
editor->signalShowPreeditText ().connect (
- std::bind (&LibPinyinPinyinEngine::showPreeditText, this));
+ std::bind (&PinyinEngine::showPreeditText, this));
editor->signalHidePreeditText ().connect (
- std::bind (&LibPinyinPinyinEngine::hidePreeditText, this));
+ std::bind (&PinyinEngine::hidePreeditText, this));
editor->signalUpdateAuxiliaryText ().connect (
- std::bind (&LibPinyinPinyinEngine::updateAuxiliaryText, this, _1, _2));
+ std::bind (&PinyinEngine::updateAuxiliaryText, this, _1, _2));
editor->signalShowAuxiliaryText ().connect (
- std::bind (&LibPinyinPinyinEngine::showAuxiliaryText, this));
+ std::bind (&PinyinEngine::showAuxiliaryText, this));
editor->signalHideAuxiliaryText ().connect (
- std::bind (&LibPinyinPinyinEngine::hideAuxiliaryText, this));
+ std::bind (&PinyinEngine::hideAuxiliaryText, this));
editor->signalUpdateLookupTable ().connect (
- std::bind (&LibPinyinPinyinEngine::updateLookupTable, this, _1, _2));
+ std::bind (&PinyinEngine::updateLookupTable, this, _1, _2));
editor->signalUpdateLookupTableFast ().connect (
- std::bind (&LibPinyinPinyinEngine::updateLookupTableFast, this, _1, _2));
+ std::bind (&PinyinEngine::updateLookupTableFast, this, _1, _2));
editor->signalShowLookupTable ().connect (
- std::bind (&LibPinyinPinyinEngine::showLookupTable, this));
+ std::bind (&PinyinEngine::showLookupTable, this));
editor->signalHideLookupTable ().connect (
- std::bind (&LibPinyinPinyinEngine::hideLookupTable, this));
+ std::bind (&PinyinEngine::hideLookupTable, this));
}
diff --git a/src/PYPPinyinEngine.h b/src/PYPPinyinEngine.h
index a7e0e12..fa16cc2 100644
--- a/src/PYPPinyinEngine.h
+++ b/src/PYPPinyinEngine.h
@@ -26,10 +26,10 @@
#include "PYPinyinProperties.h"
namespace PY {
-class LibPinyinPinyinEngine : public Engine {
+class PinyinEngine : public Engine {
public:
- LibPinyinPinyinEngine (IBusEngine *engine);
- ~LibPinyinPinyinEngine (void);
+ PinyinEngine (IBusEngine *engine);
+ ~PinyinEngine (void);
//virtual functions
gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);