summaryrefslogtreecommitdiffstats
path: root/src/PYPPinyinEngine.cc
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 /src/PYPPinyinEngine.cc
parent7813d0b1711f08b0164242499c6ac02d30fab966 (diff)
downloadibus-libpinyin-7a98868d07581655b7a11c84005ec9cef7d50539.tar.gz
ibus-libpinyin-7a98868d07581655b7a11c84005ec9cef7d50539.tar.xz
ibus-libpinyin-7a98868d07581655b7a11c84005ec9cef7d50539.zip
remove LibPinyin* class prefix
Diffstat (limited to 'src/PYPPinyinEngine.cc')
-rw-r--r--src/PYPPinyinEngine.cc98
1 files changed, 49 insertions, 49 deletions
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));
}