[ibus-pinyin] update to 1.4.0

Peng Wu pwu at fedoraproject.org
Tue Dec 27 04:23:05 UTC 2011


commit e9d6d3facb16862e5311a9f257a9428cb60f8202
Author: Peng Wu <alexepico at gmail.com>
Date:   Tue Dec 27 12:22:56 2011 +0800

    update to 1.4.0

 .gitignore                              |    1 +
 ibus-pinyin-libpinyin-integration.patch | 2120 +++++++++++++++++++++++++++----
 ibus-pinyin.spec                        |    7 +-
 sources                                 |    2 +-
 4 files changed, 1848 insertions(+), 282 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6408d02..6abf8cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ pinyin-database-1.2.99.tar.bz2
 /ibus-pinyin-1.3.99.20110217.tar.gz
 /ibus-pinyin-1.3.99.20110520.tar.gz
 /ibus-pinyin-1.3.99.20110706.tar.gz
+/ibus-pinyin-1.4.0.tar.gz
diff --git a/ibus-pinyin-libpinyin-integration.patch b/ibus-pinyin-libpinyin-integration.patch
index 23a58f0..f46109f 100644
--- a/ibus-pinyin-libpinyin-integration.patch
+++ b/ibus-pinyin-libpinyin-integration.patch
@@ -1,7 +1,7 @@
-From 94bbc5c2f29f2d1e73c202dee9ca30b8ddc01c21 Mon Sep 17 00:00:00 2001
+From 4d0b70d57a872931404868ec3eafd9ae0e5b4441 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 29 Aug 2011 14:14:46 +0800
-Subject: [PATCH 01/88] begin to integrate
+Subject: [PATCH 01/94] begin to integrate
 
 ---
  src/PYPinyinBaseEditor.h |   91 ++++++++++++++++++++++++++++++++++++++++++++++
@@ -106,13 +106,13 @@ index 0000000..0bed00a
 +
 +#endif
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 21ee5c23e325fd7b4816b38b9cc308e17e23c1a3 Mon Sep 17 00:00:00 2001
+From 2fcee36056380fa72fcfab98f55508151b068e1c Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Tue, 30 Aug 2011 18:24:02 +0800
-Subject: [PATCH 02/88] begin to write libpinyin backend singleton
+Subject: [PATCH 02/94] begin to write libpinyin backend singleton
 
 ---
  src/PYLibPinyin.h |   36 ++++++++++++++++++++++++++++++++++++
@@ -162,13 +162,13 @@ index 0000000..cfd8566
 +
 +#endif
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 71e25b32ed628a4692c43b48fa6a150884b05378 Mon Sep 17 00:00:00 2001
+From 7a74baf03f6bdf37d033efa6a66feab936ab255b Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 1 Sep 2011 11:24:02 +0800
-Subject: [PATCH 03/88] rename editor class
+Subject: [PATCH 03/94] rename editor class
 
 ---
  src/PYLibPinyin.h        |    5 +++++
@@ -236,13 +236,13 @@ index 0bed00a..ee200a1 100644
      std::string                 m_selected_special_phrase;
  };
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From b89b25c7c5522b25f4f8a023fea7bf73bb15db68 Mon Sep 17 00:00:00 2001
+From e5da1763d6db253ae4f89880974dfa094ca43c92 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 1 Sep 2011 13:02:24 +0800
-Subject: [PATCH 04/88] rename editor header
+Subject: [PATCH 04/94] rename editor header
 
 ---
  src/PYLibPinyinBaseEditor.h |   92 +++++++++++++++++++++++++++++++++++++++++++
@@ -448,13 +448,13 @@ index ee200a1..0000000
 -
 -#endif
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 9103387c14422521f7449806079bf411ab8f6fd3 Mon Sep 17 00:00:00 2001
+From 772a6b8cb77f01f1832ea25c88db6d9d9d4f3ab9 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 1 Sep 2011 15:13:09 +0800
-Subject: [PATCH 05/88] begin to write libpinyin base editor
+Subject: [PATCH 05/94] begin to write libpinyin base editor
 
 ---
  src/PYLibPinyinBaseEditor.cc |  318 ++++++++++++++++++++++++++++++++++++++++++
@@ -800,13 +800,13 @@ index ee200a1..c7b0d2b 100644
      void commit (const gchar *str);
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 2f3696c5af718b4eeb6113dc0b68bd9525027ec2 Mon Sep 17 00:00:00 2001
+From d14c7c5cef6f21421fe0bc19b1179b202f416e3b Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 1 Sep 2011 15:51:53 +0800
-Subject: [PATCH 06/88] fixes compile
+Subject: [PATCH 06/94] fixes compile
 
 ---
  src/Makefile.am              |    3 +++
@@ -860,13 +860,13 @@ index c7b0d2b..d682a7b 100644
  #include "PYEditor.h"
  #include "PYPinyinParser.h"
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From b6cc94ba4d65f1511aebb5b2da80c958cd882815 Mon Sep 17 00:00:00 2001
+From 5e4d1aba9a99203f8cf664ef0ac6a00368bf8623 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 2 Sep 2011 10:34:06 +0800
-Subject: [PATCH 07/88] add special phrases handle in libpinyin base editor
+Subject: [PATCH 07/94] add special phrases handle in libpinyin base editor
 
 ---
  src/PYLibPinyinBaseEditor.cc |   27 +++++++++++++++++++++------
@@ -943,13 +943,13 @@ index d682a7b..fa5755c 100644
      /* use LibPinyinBackEnd here. */
      std::vector<std::string>    m_special_phrases;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 61aafedfb9cf7718afebb4cb8a3eb82873bafa1d Mon Sep 17 00:00:00 2001
+From 18a7fac7337e7f6d1ec953454cd26ec8a99525b1 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 2 Sep 2011 14:30:11 +0800
-Subject: [PATCH 08/88] begin to write concrete pinyin editors
+Subject: [PATCH 08/94] begin to write concrete pinyin editors
 
 ---
  src/PYLibPinyinDoublePinyinEditor.h |   57 +++++++++++++++++++++++++++++++++
@@ -1087,13 +1087,13 @@ index 0000000..dcc1728
 +
 +#endif
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 56d08018ceb62e0dfaff14cc3456e7b1e65dc53b Mon Sep 17 00:00:00 2001
+From 6294d7dd68f2a3a9d17830bf6c4768af6a374cd1 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 2 Sep 2011 15:26:21 +0800
-Subject: [PATCH 09/88] rename files
+Subject: [PATCH 09/94] rename files
 
 ---
  src/PYLibPinyinBaseEditor.cc        |  332 -----------------------------------
@@ -2239,13 +2239,13 @@ index 0000000..fa5755c
 +
 +#endif
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From b8f7e09a3316035b2b497386885a41e52da7b664 Mon Sep 17 00:00:00 2001
+From 2a351f4f7a5ac32459b94622340de901561b9764 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 2 Sep 2011 15:39:31 +0800
-Subject: [PATCH 10/88] add libpinyin pinyin editor header
+Subject: [PATCH 10/94] add libpinyin pinyin editor header
 
 ---
  src/PYPPinyinEditor.h |   56 +++++++++++++++++++++++++++++++++++++++++++++++++
@@ -2315,13 +2315,13 @@ index 0000000..4213395
 +
 +#endif
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 0d7fdc1f9b71df881fa4353fc0f20a0839c0c78c Mon Sep 17 00:00:00 2001
+From f8dca3a01a6f976fd41a13bb01dac6ab8134eb0f Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 2 Sep 2011 15:49:13 +0800
-Subject: [PATCH 11/88] rename base editor
+Subject: [PATCH 11/94] rename base editor
 
 ---
  src/Makefile.am             |    6 +++-
@@ -2635,13 +2635,13 @@ index 4213395..fd2b2ce 100644
  
  class LibPinyinPinyinEditor : public LibPinyinPhoneticEditor {
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 21c05a2bf76d58a2928fd6e93c2e1f561129ee8f Mon Sep 17 00:00:00 2001
+From 9d7be99bc520bd98cf52fa88f947f3787e411fde Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 2 Sep 2011 16:49:00 +0800
-Subject: [PATCH 12/88] begin to write pinyin editor
+Subject: [PATCH 12/94] begin to write pinyin editor
 
 ---
  src/PYPPinyinEditor.cc |  202 ++++++++++++++++++++++++++++++++++++++++++++++++
@@ -2858,13 +2858,13 @@ index a259a99..a78544d 100644
 +    LibPinyinPhoneticEditor::updateLookupTable ();
 +}
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From b79504595353a90d85b025ab6f3bb426787f26b3 Mon Sep 17 00:00:00 2001
+From 3799224a7f951a40b47f202e428d1d390b53fd25 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 5 Sep 2011 16:59:49 +0800
-Subject: [PATCH 13/88] begin to write bopomofo editor
+Subject: [PATCH 13/94] begin to write bopomofo editor
 
 ---
  src/PYPBopomofoEditor.cc |  374 ++++++++++++++++++++++++++++++++++++++++++++++
@@ -3337,13 +3337,13 @@ index 0000000..bcbf85d
 +
 +#endif
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 5a59f456bb40ea381a8f39858a0a8d3f8e43b074 Mon Sep 17 00:00:00 2001
+From e9f90e33c992e4c463235862acd20a5329381f8e Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 5 Sep 2011 17:13:31 +0800
-Subject: [PATCH 14/88] fixes compile
+Subject: [PATCH 14/94] fixes compile
 
 ---
  src/Makefile.am          |    2 ++
@@ -3420,13 +3420,13 @@ index bcbf85d..f78375f 100644
  
      gboolean insert (gint ch);
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 2c724244d80e4d79385be7e0f5744b286c5b30a1 Mon Sep 17 00:00:00 2001
+From 4e279112646c10657191b8529d0b96d15a9d14dd Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 8 Sep 2011 15:13:17 +0800
-Subject: [PATCH 15/88] add libpinyin deps
+Subject: [PATCH 15/94] add libpinyin deps
 
 ---
  configure.ac            |    5 +++++
@@ -3435,7 +3435,7 @@ Subject: [PATCH 15/88] add libpinyin deps
  3 files changed, 11 insertions(+), 0 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 6afc180..1e3394d 100644
+index 851e94d..b37641a 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -62,6 +62,11 @@ PKG_CHECK_MODULES(SQLITE, [
@@ -3493,13 +3493,13 @@ index 3d64bc4..f222557 100644
      std::string                 m_selected_special_phrase;
  };
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From aa80dfa352b8657202c895062283d9e930735b14 Mon Sep 17 00:00:00 2001
+From 979bbe6338cf796d97953b0a95d13fc00f0bf650 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 8 Sep 2011 18:02:51 +0800
-Subject: [PATCH 16/88] begin to write libpinyin backend
+Subject: [PATCH 16/94] begin to write libpinyin backend
 
 ---
  src/Makefile.am    |    1 +
@@ -3589,13 +3589,13 @@ index d3bc90c..c07b435 100644
      static LibPinyinBackEnd & instance (void) { return *m_instance; }
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 1f6ff1c6791cf266fcff9ac2808f85d902ee4b5f Mon Sep 17 00:00:00 2001
+From c79a32bd545251896d6bc02f27235669abe86774 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 14 Sep 2011 17:49:47 +0800
-Subject: [PATCH 17/88] add set options to libpinyin back end
+Subject: [PATCH 17/94] add set options to libpinyin back end
 
 ---
  src/PYLibPinyin.cc |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -3698,13 +3698,13 @@ index c07b435..83aa1fc 100644
  
  #endif
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 7bb6c26be96489e919736eb719abafcf11796e15 Mon Sep 17 00:00:00 2001
+From 48e7bb8f1db150e6e0ea4b76e1d28d7f349c432d Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 15 Sep 2011 15:19:49 +0800
-Subject: [PATCH 18/88] remove special phrase
+Subject: [PATCH 18/94] remove special phrase
 
 ---
  src/PYPPhoneticEditor.cc |   41 -----------------------------------------
@@ -3810,13 +3810,13 @@ index f222557..f7a3704 100644
  
  };
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From c9a83029d574da3de06bc8d3b3766919acd68c5c Mon Sep 17 00:00:00 2001
+From d8fc6ba5611fd6bb00282446a71da970c249695a Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 16 Sep 2011 15:43:35 +0800
-Subject: [PATCH 19/88] refactor libpinyin phonetic editor
+Subject: [PATCH 19/94] refactor libpinyin phonetic editor
 
 ---
  src/PYPPhoneticEditor.cc |   59 +++++++++++++++++++++++++++++++++++++++------
@@ -3947,13 +3947,13 @@ index f7a3704..a3b03ff 100644
  
  };
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 0afa90502dac19f65253c3bd6d6dd6b97f403ec7 Mon Sep 17 00:00:00 2001
+From a7516b6b7dd80fb57fb8b5db176f907584975b4c Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 16 Sep 2011 15:51:12 +0800
-Subject: [PATCH 20/88] clean up libpinyin bopomofo editor
+Subject: [PATCH 20/94] clean up libpinyin bopomofo editor
 
 ---
  src/PYPBopomofoEditor.cc |   39 +++++++++++++--------------------------
@@ -4031,13 +4031,13 @@ index cb64abd..35c9ed2 100644
  
  gboolean
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 5d0466f732e7520851edb8145c348b29c8bea252 Mon Sep 17 00:00:00 2001
+From a65345601ddcc396d0742c9c46164b8acf567d2b Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 16 Sep 2011 17:31:56 +0800
-Subject: [PATCH 21/88] add m_pinyin_len back
+Subject: [PATCH 21/94] add m_pinyin_len back
 
 ---
  src/PYPPhoneticEditor.cc |   20 +++++++++++---------
@@ -4126,13 +4126,13 @@ index a3b03ff..32a5245 100644
      String                      m_buffer;
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 325056f0f43e86da5621ac04d5261faaabe5041c Mon Sep 17 00:00:00 2001
+From 009663c6c618612a022bfb4cb9dd422e439f573f Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 19 Sep 2011 16:10:48 +0800
-Subject: [PATCH 22/88] write pinyin editor in progress
+Subject: [PATCH 22/94] write pinyin editor in progress
 
 ---
  src/PYPPhoneticEditor.h |    2 +-
@@ -4253,13 +4253,13 @@ index a78544d..a435b82 100644
  
  void
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 6cee400f75eeb9d977cb3bb64df8dc282ab31aa7 Mon Sep 17 00:00:00 2001
+From acca31ee1da743f2f4850eb6562dba73aa9c6a7d Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 19 Sep 2011 16:26:42 +0800
-Subject: [PATCH 23/88] begin to write libpinyin full pinyin editor
+Subject: [PATCH 23/94] begin to write libpinyin full pinyin editor
 
 ---
  src/Makefile.am            |    1 +
@@ -4350,13 +4350,13 @@ index 0000000..9712d97
 +}
 +
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From b50a6e074f608f640afb074231ed643240bf26b3 Mon Sep 17 00:00:00 2001
+From 48297caeed02607f0f124510d488d71e69b8e303 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Tue, 20 Sep 2011 13:52:05 +0800
-Subject: [PATCH 24/88] write update pinyin
+Subject: [PATCH 24/94] write update pinyin
 
 ---
  src/PYPFullPinyinEditor.cc |   31 +++++++++++++++++++++++++++++++
@@ -4416,13 +4416,13 @@ index a6e74c4..afb52d5 100644
  
  };
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 3ceb1022d20885ed032a3b0275a48fe8cf96182d Mon Sep 17 00:00:00 2001
+From a71b5e486260f98e527d6fe9b538a1af2089b6ed Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Tue, 20 Sep 2011 16:12:46 +0800
-Subject: [PATCH 25/88] add char edit
+Subject: [PATCH 25/94] add char edit
 
 ---
  src/PYPFullPinyinEditor.cc |   39 +++++++++++++++++++++++++++++++++++++++
@@ -4479,13 +4479,13 @@ index 5194ef8..2b8babc 100644
                                              guint keycode,
                                              guint modifiers)
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 5ccaad1bdee85c6762ddfbf52bba6e8e2f82fd0a Mon Sep 17 00:00:00 2001
+From 0af6961241de8fe55420ae3196582ccf3a7a883e Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 21 Sep 2011 10:14:49 +0800
-Subject: [PATCH 26/88] write full pinyin editor in progress
+Subject: [PATCH 26/94] write full pinyin editor in progress
 
 ---
  src/PYPFullPinyinEditor.cc |  131 +++++++++++++++++++++++++++++++++++++++++++-
@@ -4634,13 +4634,13 @@ index 2b8babc..7e764c7 100644
  
  gboolean
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From b9dce30dd8b368769f7843594ba3210a097bd6cc Mon Sep 17 00:00:00 2001
+From c692d73e9a7953f785dfc6b75b458d2056baa717 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 21 Sep 2011 10:34:46 +0800
-Subject: [PATCH 27/88] use m_pinyin_poses in full pinyin editor
+Subject: [PATCH 27/94] use m_pinyin_poses in full pinyin editor
 
 ---
  src/PYPFullPinyinEditor.cc |   32 ++++++++++++++++++++++----------
@@ -4715,13 +4715,13 @@ index 7e764c7..0a05c5a 100644
  
      m_cursor = cursor;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 9b3f8d14380de93c3b697a55cfd1df6dd8316eb3 Mon Sep 17 00:00:00 2001
+From 45fc184f99a90c32d282732b5adf1199b219016c Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 21 Sep 2011 11:25:58 +0800
-Subject: [PATCH 28/88] use pinyin pos
+Subject: [PATCH 28/94] use pinyin pos
 
 ---
  src/PYPPhoneticEditor.cc |   14 ++++++++------
@@ -4776,13 +4776,13 @@ index a435b82..68617a3 100644
  
      /* append rest text */
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 31e29393f3d7069c7dbbbda11d0cb354838a0e2c Mon Sep 17 00:00:00 2001
+From 9d968ec9eb391d26b1762dfeae1699e92a4e6614 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 21 Sep 2011 11:39:17 +0800
-Subject: [PATCH 29/88] re-factor full pinyin editor
+Subject: [PATCH 29/94] re-factor full pinyin editor
 
 ---
  src/PYPFullPinyinEditor.cc |   83 +++++++++++++++++++------------------------
@@ -4940,13 +4940,13 @@ index afb52d5..11e53cb 100644
  
  };
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From f612432ccf5bd9d3fc9617bf52f1f99e2b7b5c0a Mon Sep 17 00:00:00 2001
+From 1bf1279f74ca5eb26e1250d862d5c6d722cc10f6 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 21 Sep 2011 12:22:55 +0800
-Subject: [PATCH 30/88] add update aux text func for full pinyin
+Subject: [PATCH 30/94] add update aux text func for full pinyin
 
 ---
  src/PYPFullPinyinEditor.cc |   37 +++++++++++++++++++++++++++++++++++++
@@ -5050,13 +5050,13 @@ index fd2b2ce..41aafc6 100644
      virtual gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 62d47f889316ff95b764333bb10f9f0211e32558 Mon Sep 17 00:00:00 2001
+From 05035a2ca103c6dc795bcd810df7fba86f22f8a7 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 21 Sep 2011 14:02:14 +0800
-Subject: [PATCH 31/88] begin to add double pinyin editor
+Subject: [PATCH 31/94] begin to add double pinyin editor
 
 ---
  src/Makefile.am              |    1 +
@@ -5123,13 +5123,13 @@ index 0000000..5eb2067
 +    return LibPinyinPinyinEditor::processKeyEvent (keyval, keycode, modifiers);
 +}
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 1e16137bf37a2bc597740585e2809679bc5b7605 Mon Sep 17 00:00:00 2001
+From 490d506672590d37242cbb45cc8ec871d6f23137 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 21 Sep 2011 14:18:36 +0800
-Subject: [PATCH 32/88] move cursor edit funcs to pinyin editor
+Subject: [PATCH 32/94] move cursor edit funcs to pinyin editor
 
 ---
  src/PYPDoublePinyinEditor.h |    2 +
@@ -5580,13 +5580,13 @@ index 41aafc6..974d2a5 100644
  
  };
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 17a5f2c269d903f892b59ab2a28e8476b5fa0035 Mon Sep 17 00:00:00 2001
+From dde9caeb198ab9756555ac8e040090941e53abba Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 21 Sep 2011 14:52:09 +0800
-Subject: [PATCH 33/88] add update pinyin
+Subject: [PATCH 33/94] add update pinyin
 
 ---
  src/PYPDoublePinyinEditor.cc |   16 ++++++++++++++++
@@ -5670,13 +5670,13 @@ index 9c1644e..05de60d 100644
  
  void
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 15e5c137425de55f79c0c51d9ede5c9482e5f745 Mon Sep 17 00:00:00 2001
+From cb25a0b9ee36d12d09ef9a0644888bfd2066252a Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 22 Sep 2011 14:24:09 +0800
-Subject: [PATCH 34/88] write double pinyin editor
+Subject: [PATCH 34/94] write double pinyin editor
 
 ---
  src/PYPDoublePinyinEditor.cc |   93 ++++++++++++++++++++++++++++++++++++++++++
@@ -5835,13 +5835,13 @@ index 08fc04e..8108002 100644
      for (guint i = 0; i < pinyin_keys->len; ++i) {
          if (G_LIKELY (i))
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From dc1008b9450edadac06e5927f4bfc53914339619 Mon Sep 17 00:00:00 2001
+From 204a6f858e9a2e6577f78d2368474d048b643098 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 22 Sep 2011 14:35:40 +0800
-Subject: [PATCH 35/88] begin to write bopomofo editor
+Subject: [PATCH 35/94] begin to write bopomofo editor
 
 ---
  src/PYPBopomofoEditor.cc |  119 ----------------------------------------------
@@ -6048,13 +6048,13 @@ index 974d2a5..00b49ce 100644
      guint getCursorLeftByWord (void);
      guint getCursorRightByWord (void);
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 4fa55bf0d8333d1bb21c64572d017e05a22f4d48 Mon Sep 17 00:00:00 2001
+From 3b2103d9293ce891f4b47173f60b194916046b18 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 22 Sep 2011 15:00:11 +0800
-Subject: [PATCH 36/88] write bopomofo editor in progress
+Subject: [PATCH 36/94] write bopomofo editor in progress
 
 ---
  src/PYPBopomofoEditor.cc |   68 ++++++++++++++++++++++++++++++++++++++++++++++
@@ -6158,13 +6158,13 @@ index 00b49ce..974d2a5 100644
      guint getCursorLeftByWord (void);
      guint getCursorRightByWord (void);
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From cd133bc9853f92d5c8ab72fd74a9a4d0670390fe Mon Sep 17 00:00:00 2001
+From aea71c5a524cb814cb1697ed4b97a944eb899db6 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 22 Sep 2011 15:18:37 +0800
-Subject: [PATCH 37/88] write bopomofo editor
+Subject: [PATCH 37/94] write bopomofo editor
 
 ---
  src/PYPBopomofoEditor.cc |   35 ++++++++++++++++++++++++++++++++++-
@@ -6254,13 +6254,13 @@ index 8108002..5599416 100644
      /* text after pinyin */
      const gchar *p = m_text.c_str() + m_pinyin_len;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 57d303dd2b725c56abea46490609e0cd3d1f2938 Mon Sep 17 00:00:00 2001
+From 567aec11de7f8df43a12deda4227ebd975ef6d2e Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 22 Sep 2011 15:31:06 +0800
-Subject: [PATCH 38/88] remove m_pinyins
+Subject: [PATCH 38/94] remove m_pinyins
 
 ---
  src/PYPBopomofoEditor.cc     |    1 -
@@ -6365,13 +6365,13 @@ index 56a8ee4..9d522bf 100644
      LookupTable                 m_lookup_table;
      String                      m_buffer;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From f37f4807b0408d4269ad6a57e8a29049c18cabb1 Mon Sep 17 00:00:00 2001
+From 809905b63d340e823190625ccd82a248fe66e2b8 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 22 Sep 2011 15:49:29 +0800
-Subject: [PATCH 39/88] fixes Makefile.am
+Subject: [PATCH 39/94] fixes Makefile.am
 
 ---
  src/Makefile.am          |    2 ++
@@ -6404,13 +6404,13 @@ index 0c7e46f..db4f9b4 100644
  
      return TRUE;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 4adb383aeaeb0053f161283888609ea3078e2bdb Mon Sep 17 00:00:00 2001
+From 57911c37fc0f515d7459e1c7e95ce356bb0d9f66 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 23 Sep 2011 14:44:10 +0800
-Subject: [PATCH 40/88] add set chewing options
+Subject: [PATCH 40/94] add set chewing options
 
 ---
  src/PYLibPinyin.cc |   29 ++++++++++++++++++++++++++++-
@@ -6483,13 +6483,13 @@ index 83aa1fc..538930c 100644
      /* use static initializer in C++. */
      static LibPinyinBackEnd & instance (void) { return *m_instance; }
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 67ddca2bedeb5716ba8f2ec049d67f65db562a80 Mon Sep 17 00:00:00 2001
+From 80723f3558c00e6f5008434ae8c568fdcf0ac8e4 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 26 Sep 2011 15:33:00 +0800
-Subject: [PATCH 41/88] add libpinyin pinyin/chewing scheme options
+Subject: [PATCH 41/94] add libpinyin pinyin/chewing scheme options
 
 ---
  src/PYLibPinyin.cc |   45 ++++++++++++++++++++++++++++++++++++++-------
@@ -6595,13 +6595,13 @@ index 538930c..3d40b1d 100644
  private:
      static std::unique_ptr<LibPinyinBackEnd> m_instance;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 97cd3846b283bb7554604f692f027a5259ab4380 Mon Sep 17 00:00:00 2001
+From 3497f64da0b6b6e7ffb85769b05e49f04221b08f Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 28 Sep 2011 15:08:11 +0800
-Subject: [PATCH 42/88] add PYPPinyinEngine.h
+Subject: [PATCH 42/94] add PYPPinyinEngine.h
 
 ---
  src/Makefile.am       |    1 +
@@ -6708,13 +6708,13 @@ index 0000000..d8040c1
 +
 +#endif
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 269e8a835a6ac38a1c4b099f9a62bde9375e9a21 Mon Sep 17 00:00:00 2001
+From 1de241261875c35144a0a732849e057bc9bcc962 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 28 Sep 2011 17:09:11 +0800
-Subject: [PATCH 43/88] add libpinyin pinyin engine
+Subject: [PATCH 43/94] add libpinyin pinyin engine
 
 ---
  src/Makefile.am        |    1 +
@@ -7066,13 +7066,13 @@ index 0000000..2877702
 +        std::bind (&LibPinyinPinyinEngine::hideLookupTable, this));
 +}
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From a0b8bc5114056a844e59998766c886f26768cef8 Mon Sep 17 00:00:00 2001
+From b7042d52ffb286de6231a43b3c53947a78c19155 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 28 Sep 2011 17:30:41 +0800
-Subject: [PATCH 44/88] write bopomofo editor
+Subject: [PATCH 44/94] write bopomofo editor
 
 ---
  src/PYPBopomofoEditor.cc |  131 ++++++++++++++++++++++++++++++++++++++++++++++
@@ -7370,13 +7370,13 @@ index 9d522bf..f2d7309 100644
      virtual void updateAuxiliaryText (void) = 0;
      virtual void updatePreeditText (void) = 0;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From d372fbc3c073d37496be1571fdd6a0fec86307ea Mon Sep 17 00:00:00 2001
+From a06c8ad7f26ca41a2c52bd824bed0fc0461ba58b Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 28 Sep 2011 17:35:18 +0800
-Subject: [PATCH 45/88] re-factor pinyin editor
+Subject: [PATCH 45/94] re-factor pinyin editor
 
 ---
  src/PYPPinyinEditor.cc |   73 +-----------------------------------------------
@@ -7501,13 +7501,13 @@ index 974d2a5..87fe210 100644
  
  protected:
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From a87fbe8b02845f67eec4443abb5eee373579c999 Mon Sep 17 00:00:00 2001
+From 6a7e7ef94cc3e457fcd81bb9988ff83a9e1c9406 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 28 Sep 2011 17:51:56 +0800
-Subject: [PATCH 46/88] polish code
+Subject: [PATCH 46/94] polish code
 
 ---
  src/PYPPinyinEngine.cc |   29 +++++++++--------------------
@@ -7591,13 +7591,13 @@ index d8040c1..7a2d635 100644
      EditorPtr m_fallback_editor;
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From a7fa96bf9d0081b3b85fe8177a1b51268267d9e4 Mon Sep 17 00:00:00 2001
+From 5c5f74abcc1f29a8da8c66dbb9db9a58dbb4cf4a Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 29 Sep 2011 10:28:25 +0800
-Subject: [PATCH 47/88] fixes libpinyin pinyin engine
+Subject: [PATCH 47/94] fixes libpinyin pinyin engine
 
 ---
  src/PYPPinyinEngine.cc |    4 +++-
@@ -7630,13 +7630,13 @@ index f8e20ee..1fc4933 100644
  
  void
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From f94b146760628458572483726768faa5cf5cf756 Mon Sep 17 00:00:00 2001
+From b35d3416c2ea19f1ec33b622db3968f1c78804e2 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 29 Sep 2011 11:03:50 +0800
-Subject: [PATCH 48/88] re-factor libpinyin backend
+Subject: [PATCH 48/94] re-factor libpinyin backend
 
 ---
  src/PYLibPinyin.cc |   22 ++++++++++++++++------
@@ -7695,7 +7695,7 @@ index 3d40b1d..212bf53 100644
      gboolean setFuzzyOptions (Config *config, pinyin_context_t *context);
  
 diff --git a/src/PYMain.cc b/src/PYMain.cc
-index 021201f..a19a5bf 100644
+index f786b70..d24cc3c 100644
 --- a/src/PYMain.cc
 +++ b/src/PYMain.cc
 @@ -30,6 +30,7 @@
@@ -7706,7 +7706,7 @@ index 021201f..a19a5bf 100644
  
  using namespace PY;
  
-@@ -83,6 +84,7 @@ start_component (void)
+@@ -88,6 +89,7 @@ start_component (void)
      Database::init ();
      PinyinConfig::init (bus);
      BopomofoConfig::init (bus);
@@ -7714,7 +7714,7 @@ index 021201f..a19a5bf 100644
  
      g_signal_connect ((IBusBus *)bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NULL);
  
-@@ -143,6 +145,7 @@ sigterm_cb (int sig)
+@@ -148,6 +150,7 @@ sigterm_cb (int sig)
  static void
  atexit_cb (void)
  {
@@ -7723,13 +7723,13 @@ index 021201f..a19a5bf 100644
  }
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 5f27536c62860b9436bd38ad509b195c26c1a288 Mon Sep 17 00:00:00 2001
+From 08242f69f3740431d0fadc352fbcad7535827eb1 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 29 Sep 2011 13:46:48 +0800
-Subject: [PATCH 49/88] add PYPBopomofoEngine.h
+Subject: [PATCH 49/94] add PYPBopomofoEngine.h
 
 ---
  src/Makefile.am         |    1 +
@@ -7840,13 +7840,13 @@ index 0000000..f767908
 +
 +#endif
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From a4d249bf8ed06be72eb667d12639a1ba77418d44 Mon Sep 17 00:00:00 2001
+From 6438ef7044c5d6d5e6e187dfd7d5c57deb601e8c Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 29 Sep 2011 14:59:44 +0800
-Subject: [PATCH 50/88] add PYPBopomofoEngine.cc
+Subject: [PATCH 50/94] add PYPBopomofoEngine.cc
 
 ---
  src/Makefile.am          |    1 +
@@ -8127,13 +8127,13 @@ index 0000000..e48e9af
 +
 +
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From fdb0faafb87135edb9ac6b9d25525dbc2f268f71 Mon Sep 17 00:00:00 2001
+From 4de98d738a224f4e7a72e01c2be24d280fbb4f3a Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 29 Sep 2011 15:08:52 +0800
-Subject: [PATCH 51/88] add libpinyin engines to PYEngine.cc
+Subject: [PATCH 51/94] add libpinyin engines to PYEngine.cc
 
 ---
  src/PYEngine.cc |   25 ++++++++++++++++++++-----
@@ -8183,13 +8183,13 @@ index 7987146..3a34afc 100644
      }
      return (GObject *) engine;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 485d515721c2127a9a1fa8996799cdbd900d1b72 Mon Sep 17 00:00:00 2001
+From 5eafd4293c651be31bd1fdc8e406f8db48dcd8af Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 30 Sep 2011 10:30:11 +0800
-Subject: [PATCH 52/88] add show setup
+Subject: [PATCH 52/94] add show setup
 
 ---
  src/PYPBopomofoEngine.cc |    3 ++-
@@ -8235,13 +8235,13 @@ index 1fc4933..c163cfc 100644
  
  gboolean
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 0c6b69bce0c9bf0c79bd4d3db464e6c2eb8cb1e7 Mon Sep 17 00:00:00 2001
+From fd1f18c48e6fbec50e8c908552c446c60363a94b Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 30 Sep 2011 10:54:25 +0800
-Subject: [PATCH 53/88] add lazy init
+Subject: [PATCH 53/94] add lazy init
 
 ---
  src/PYLibPinyin.cc |   45 ++++++++++++++++++++++++++++++++++++++++-----
@@ -8334,13 +8334,13 @@ index 212bf53..44ed727 100644
      static LibPinyinBackEnd & instance (void) { return *m_instance; }
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From f1073c63e615ab2b7159937b586007a75a0b492a Mon Sep 17 00:00:00 2001
+From e5870dfe0dc3a85182b8f92322ac25127de10af5 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 7 Oct 2011 12:53:14 +0800
-Subject: [PATCH 54/88] write libpinyin backend
+Subject: [PATCH 54/94] write libpinyin backend
 
 ---
  src/PYLibPinyin.cc |   10 ++++++++++
@@ -8396,13 +8396,13 @@ index a7097fe..d76e612 100644
      for (guint i = 0; i < G_N_ELEMENTS (chewing_options); i++) {
          if (map == chewing_options[i].bopomofo_keyboard) {
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From a7efa0d82a7c4cae3a22f1f0e446ca5fff005ffd Mon Sep 17 00:00:00 2001
+From 1e7522cfd85fbf7ed2ef512ae8f093039f7a699d Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 7 Oct 2011 13:05:20 +0800
-Subject: [PATCH 55/88] write PYConfig
+Subject: [PATCH 55/94] write PYConfig
 
 ---
  src/PYConfig.cc |    7 +++++++
@@ -8434,13 +8434,13 @@ index 1373607..9e539c8 100644
  
  static const struct {
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From a73a74a6c1ecb79b7fde223e1e71e6cbec04c802 Mon Sep 17 00:00:00 2001
+From 1e18f80266808ba71138775d73244abff6f2fdd7 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Sat, 8 Oct 2011 10:03:26 +0800
-Subject: [PATCH 56/88] alloc/free pinyin instance
+Subject: [PATCH 56/94] alloc/free pinyin instance
 
 ---
  src/PYMain.cc                |    2 +-
@@ -8452,10 +8452,10 @@ Subject: [PATCH 56/88] alloc/free pinyin instance
  6 files changed, 18 insertions(+), 3 deletions(-)
 
 diff --git a/src/PYMain.cc b/src/PYMain.cc
-index a19a5bf..c4895ec 100644
+index d24cc3c..ae7c4cd 100644
 --- a/src/PYMain.cc
 +++ b/src/PYMain.cc
-@@ -82,9 +82,9 @@ start_component (void)
+@@ -87,9 +87,9 @@ start_component (void)
      }
  
      Database::init ();
@@ -8570,23 +8570,23 @@ index 87fe210..3c61918 100644
  public:
      LibPinyinPinyinEditor (PinyinProperties & props, Config & config);
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From d4baea8eb96460c50d241933713b0e419a9abddf Mon Sep 17 00:00:00 2001
+From 4f1d32d049a3769fb09b43dc130353a1f1b8766b Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Sat, 8 Oct 2011 10:11:35 +0800
-Subject: [PATCH 57/88] add engines
+Subject: [PATCH 57/94] add engines
 
 ---
  src/PYMain.cc |   32 +++++++++++++++++++++++++++++++-
  1 files changed, 31 insertions(+), 1 deletions(-)
 
 diff --git a/src/PYMain.cc b/src/PYMain.cc
-index c4895ec..3516b90 100644
+index ae7c4cd..4031582 100644
 --- a/src/PYMain.cc
 +++ b/src/PYMain.cc
-@@ -103,7 +103,8 @@ start_component (void)
+@@ -108,7 +108,8 @@ start_component (void)
                                                       "zh_CN",
                                                       "GPL",
                                                       "Peng Huang <shawn.p.huang at gmail.com>\n"
@@ -8596,7 +8596,7 @@ index c4895ec..3516b90 100644
                                                       PKGDATADIR "/icons/ibus-pinyin.svg",
                                                       "us"));
      ibus_component_add_engine (component,
-@@ -113,20 +114,49 @@ start_component (void)
+@@ -118,20 +119,49 @@ start_component (void)
                                                       "zh_CN",
                                                       "GPL",
                                                       "BYVoid <byvoid1 at gmail.com>\n"
@@ -8647,13 +8647,13 @@ index c4895ec..3516b90 100644
      }
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 33a08c7702e7bdf816cd4e9a21fd8190d2cbc35d Mon Sep 17 00:00:00 2001
+From 4f6d9fdb5723b7d9141524dfcb3c049ee37a2ed7 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Sat, 8 Oct 2011 10:37:40 +0800
-Subject: [PATCH 58/88] fixes full editor
+Subject: [PATCH 58/94] fixes full editor
 
 ---
  src/PYPFullPinyinEditor.cc |    5 ++++-
@@ -8719,13 +8719,13 @@ index c163cfc..4aae9a9 100644
          }
          retval = m_editors[m_input_mode]->processKeyEvent (keyval, keycode, modifiers);
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 1d4b7682ac6e05758e2d9dd45b373d48903568b1 Mon Sep 17 00:00:00 2001
+From c22d0d6a24c969821e60f624fd93b1851fc334ab Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Sat, 8 Oct 2011 11:29:03 +0800
-Subject: [PATCH 59/88] fixes double pinyin
+Subject: [PATCH 59/94] fixes double pinyin
 
 ---
  src/PYPDoublePinyinEditor.cc |    8 +++++++-
@@ -8774,13 +8774,13 @@ index 0b7d603..69ed5ab 100644
      const gchar * p = m_text.c_str() + m_pinyin_len;
      m_buffer << p;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From de6e93108fc2c3b2ce3b8fba522a3edad082b738 Mon Sep 17 00:00:00 2001
+From 6a11e90a42cbca5c4a0990b5af780a61e4770d1e Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Sat, 8 Oct 2011 11:40:11 +0800
-Subject: [PATCH 60/88] fixes chewing editor
+Subject: [PATCH 60/94] fixes chewing editor
 
 ---
  src/PYEngine.cc          |    2 +-
@@ -8830,13 +8830,13 @@ index f13fcc9..1a330cc 100644
      const gchar * p = m_text.c_str() + m_pinyin_len;
      m_buffer << p;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From fd277418074f4ee9c587f95cf93ce83bb71bb4ce Mon Sep 17 00:00:00 2001
+From 68542b98d00d853e4a697a037905e10bc4671d5d Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Sat, 8 Oct 2011 18:53:12 +0800
-Subject: [PATCH 61/88] add to pinyin.xml.in.in
+Subject: [PATCH 61/94] add to pinyin.xml.in.in
 
 ---
  src/pinyin.xml.in.in |   28 ++++++++++++++++++++++++++++
@@ -8882,13 +8882,13 @@ index 94b803a..f8ada12 100644
  
  </component>
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 2451a4c83885e796d7ddfee9d0321d56bc3703ef Mon Sep 17 00:00:00 2001
+From c8ca05ddaeb49f990ce486ad66b2d0eb84c57b7c Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Sat, 8 Oct 2011 19:01:16 +0800
-Subject: [PATCH 62/88] fixes update preedit text
+Subject: [PATCH 62/94] fixes update preedit text
 
 ---
  src/PYPBopomofoEditor.cc |   14 ++++++++------
@@ -8948,13 +8948,13 @@ index 817f621..3d7deff 100644
      /* append rest text */
      const gchar *p = m_text.c_str () + m_pinyin_len;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 83bd966f202824cbb431a581fea626f1252ce96e Mon Sep 17 00:00:00 2001
+From bb096fc88fdfb03deb8e29f0865676f540ce3669 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 10 Oct 2011 13:08:27 +0800
-Subject: [PATCH 63/88] update main.py
+Subject: [PATCH 63/94] update main.py
 
 ---
  setup/main.py |   21 +++++++++++++++------
@@ -9027,13 +9027,13 @@ index 0e3a729..197ea8b 100644
  
  if __name__ == "__main__":
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 6ecd8e73f2d5d035f36c5083aa8e69dbf198c671 Mon Sep 17 00:00:00 2001
+From 4b6fb2b018f52b1af75fa8aebb629497fef5a07f Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 10 Oct 2011 14:08:17 +0800
-Subject: [PATCH 64/88] add update when select candidate
+Subject: [PATCH 64/94] add update when select candidate
 
 ---
  src/PYPBopomofoEditor.cc |    2 ++
@@ -9097,13 +9097,13 @@ index 3d7deff..4b8aa21 100644
  }
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 8c5d9452dba95acae0adfd06769f262f18614041 Mon Sep 17 00:00:00 2001
+From f93acc44b3cc2c14ed739c9a70ca2538dd970789 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 10 Oct 2011 15:25:20 +0800
-Subject: [PATCH 65/88] fixes commit/reset
+Subject: [PATCH 65/94] fixes commit/reset
 
 ---
  src/PYPPhoneticEditor.cc |    1 +
@@ -9122,13 +9122,13 @@ index a5d7675..c50b265 100644
      Editor::reset ();
  }
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 4ecd95e7e241ab53934483b36bb7fba2717afc54 Mon Sep 17 00:00:00 2001
+From 84ba51d4a668b8b6d7f93f2c142b9def4c1fba09 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 10 Oct 2011 17:30:39 +0800
-Subject: [PATCH 66/88] fixes space handle
+Subject: [PATCH 66/94] fixes space handle
 
 ---
  src/PYPPhoneticEditor.cc |    7 ++-----
@@ -9174,13 +9174,13 @@ index 4b8aa21..195d0e3 100644
      return TRUE;
  }
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 9a5d9bdde8bb12ac38af7a1eb2b7bb73a1ccf3ff Mon Sep 17 00:00:00 2001
+From 5250368d8b054195b68388fe9675778f582f28ed Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Tue, 11 Oct 2011 11:14:18 +0800
-Subject: [PATCH 67/88] fixes choose candidate
+Subject: [PATCH 67/94] fixes choose candidate
 
 ---
  src/PYPPhoneticEditor.cc |    8 +++++++-
@@ -9207,13 +9207,13 @@ index dc494d5..6be7079 100644
  }
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From a4054b39925e3c194d6e8dddad6bbc403dd74ac0 Mon Sep 17 00:00:00 2001
+From a83024ca7e24c5a1bd3054f7824d985e2f67bbf8 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Tue, 25 Oct 2011 14:11:13 +0800
-Subject: [PATCH 68/88] update pinyin.xml.in.in
+Subject: [PATCH 68/94] update pinyin.xml.in.in
 
 ---
  src/pinyin.xml.in.in |   10 ++++++++--
@@ -9254,13 +9254,13 @@ index f8ada12..d2b267d 100644
  
  </component>
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 4c36af48e4a173a7008d2742fbdf1e0a97481c1b Mon Sep 17 00:00:00 2001
+From 4d6a548b773ab5d59641208b5668a000287075d3 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Tue, 25 Oct 2011 14:36:36 +0800
-Subject: [PATCH 69/88] add user data directory support
+Subject: [PATCH 69/94] add user data directory support
 
 ---
  src/PYLibPinyin.cc |   16 +++++++++++++++-
@@ -9304,13 +9304,13 @@ index d76e612..077e7e0 100644
      return pinyin_alloc_instance (m_chewing_context);
  }
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From e4f2fa619027b987645b0c5e5cf4d5d152c67306 Mon Sep 17 00:00:00 2001
+From 59b266d410cedb70f2b8b2aa8c1619184b2fb0ee Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Wed, 26 Oct 2011 10:10:58 +0800
-Subject: [PATCH 70/88] add save support
+Subject: [PATCH 70/94] add save support
 
 ---
  src/PYLibPinyin.cc       |   51 ++++++++++++++++++++++++++++++++++++++++++++++
@@ -9460,13 +9460,13 @@ index 195d0e3..e676f6d 100644
      reset();
  }
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 025580e8f4ad1d758729e467e73011046fdba64b Mon Sep 17 00:00:00 2001
+From 8c9b93ed7da9df14257b6f8d555a8b5a6defccae Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 27 Oct 2011 11:36:59 +0800
-Subject: [PATCH 71/88] hide bopomofo
+Subject: [PATCH 71/94] hide bopomofo
 
 ---
  src/pinyin.xml.in.in |   23 ++++-------------------
@@ -9520,13 +9520,13 @@ index d2b267d..93b14a1 100644
 -
  </component>
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 8f1412f1d5b326cb93202e7fa91a017fe1dfba4d Mon Sep 17 00:00:00 2001
+From ad473e4b6d938b5e4cba72ecb49a4e5cc756cb4a Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 31 Oct 2011 11:18:09 +0800
-Subject: [PATCH 72/88] improves pinyin.xml
+Subject: [PATCH 72/94] improves pinyin.xml
 
 ---
  src/pinyin.xml.in.in |    6 +++---
@@ -9564,13 +9564,13 @@ index 93b14a1..862801b 100644
  			<author>Peng Huang &lt;shawn.p.huang at gmail.com&gt;
                          Peng Wu &lt;alexepico at gmail.com&gt;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 4593004fbcf97c5a8499fe9cadf540b8a9c14d7d Mon Sep 17 00:00:00 2001
+From ff59fc1cc01c973d43cef4365293b906690c6481 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 3 Nov 2011 11:31:05 +0800
-Subject: [PATCH 73/88] fixes select candidate
+Subject: [PATCH 73/94] fixes select candidate
 
 ---
  src/PYPPhoneticEditor.cc |    4 ++++
@@ -9592,13 +9592,13 @@ index 6be7079..dc66689 100644
  
      /* NOTE: deal with normal candidates selection here by libpinyin. */
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 2144da157696caac27450a11922fb2ef90ddb6c9 Mon Sep 17 00:00:00 2001
+From 1aa1e525b824b52795fdd84551077f4fdd1d3982 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Thu, 3 Nov 2011 13:19:12 +0800
-Subject: [PATCH 74/88] add compile flags
+Subject: [PATCH 74/94] add compile flags
 
 ---
  configure.ac    |   14 +++++++++++++-
@@ -9609,7 +9609,7 @@ Subject: [PATCH 74/88] add compile flags
  5 files changed, 49 insertions(+), 10 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 1e3394d..36b54c9 100644
+index b37641a..02de9b7 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -63,9 +63,20 @@ PKG_CHECK_MODULES(SQLITE, [
@@ -9741,7 +9741,7 @@ index 27cc312..2563b9a 100644
          engine->engine = new PinyinEngine (IBUS_ENGINE (engine));
      }
 diff --git a/src/PYMain.cc b/src/PYMain.cc
-index 3516b90..01f3b49 100644
+index 4031582..49fd7ec 100644
 --- a/src/PYMain.cc
 +++ b/src/PYMain.cc
 @@ -30,7 +30,9 @@
@@ -9754,7 +9754,7 @@ index 3516b90..01f3b49 100644
  
  using namespace PY;
  
-@@ -82,7 +84,9 @@ start_component (void)
+@@ -87,7 +89,9 @@ start_component (void)
      }
  
      Database::init ();
@@ -9764,7 +9764,7 @@ index 3516b90..01f3b49 100644
      PinyinConfig::init (bus);
      BopomofoConfig::init (bus);
  
-@@ -119,6 +123,7 @@ start_component (void)
+@@ -124,6 +128,7 @@ start_component (void)
                                                       PKGDATADIR "/icons/ibus-bopomofo.svg",
                                                       "us"));
  
@@ -9772,7 +9772,7 @@ index 3516b90..01f3b49 100644
      ibus_component_add_engine (component,
                                 ibus_engine_desc_new ("libpinyin-debug",
                                                       N_("Intelligent Pinyin (debug)"),
-@@ -141,22 +146,26 @@ start_component (void)
+@@ -146,22 +151,26 @@ start_component (void)
                                                       "Peng Huang <shawn.p.huang at gmail.com>",
                                                       PKGDATADIR "/icons/ibus-bopomofo.svg",
                                                       "us"));
@@ -9800,7 +9800,7 @@ index 3516b90..01f3b49 100644
          ibus_bus_register_component (bus, component);
      }
  
-@@ -175,7 +184,9 @@ sigterm_cb (int sig)
+@@ -180,7 +189,9 @@ sigterm_cb (int sig)
  static void
  atexit_cb (void)
  {
@@ -9811,13 +9811,13 @@ index 3516b90..01f3b49 100644
  }
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 904f00a369b4d8f007fb2e840f4d72eba63aca9c Mon Sep 17 00:00:00 2001
+From c17b5a6fba9af303e7d8c1d8a2575aeccc6fe596 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 7 Nov 2011 12:53:41 +0800
-Subject: [PATCH 75/88] fixes 'hon' auto correction
+Subject: [PATCH 75/94] fixes 'hon' auto correction
 
 ---
  src/PYPFullPinyinEditor.cc |    4 +++-
@@ -9839,13 +9839,13 @@ index 69ed5ab..07073b6 100644
          g_array_append_val (m_instance->m_pinyin_keys, key);
          g_array_append_val (m_instance->m_pinyin_poses, pos);
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From cad2d04e2923d8dfb1ee784dc830fb9a0d137271 Mon Sep 17 00:00:00 2001
+From 9ea1f7abfe470fd0b2f4832eee612e98d62072b4 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 7 Nov 2011 13:14:06 +0800
-Subject: [PATCH 76/88] update header
+Subject: [PATCH 76/94] update header
 
 ---
  src/PYPBopomofoEditor.h |   10 ----------
@@ -9949,13 +9949,13 @@ index 3c61918..815b7a0 100644
  
  };
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From b37af69de6c6a95104fbfd9597d82eaa725a4701 Mon Sep 17 00:00:00 2001
+From b068207b550f53309f5950ee14a2124224c36841 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 7 Nov 2011 13:33:28 +0800
-Subject: [PATCH 77/88] copy move cursor by word functions
+Subject: [PATCH 77/94] copy move cursor by word functions
 
 ---
  src/PYPPhoneticEditor.cc |   99 ++++++++++++++++++++++++++++++++++++++++++++++
@@ -10069,13 +10069,13 @@ index dc66689..ac94ba7 100644
 +    return TRUE;
 +}
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From e16d6d5644811bea4590099d6da32d3d5f0cc33d Mon Sep 17 00:00:00 2001
+From 266f166b84f396dac50f4cdc4106527a635ade4b Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 7 Nov 2011 13:39:58 +0800
-Subject: [PATCH 78/88] remove cursor by word functions
+Subject: [PATCH 78/94] remove cursor by word functions
 
 ---
  src/PYPBopomofoEditor.cc |   98 ----------------------------------------------
@@ -10294,13 +10294,13 @@ index e676f6d..7acf3a9 100644
 -    return TRUE;
 -}
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 6c4f3c3e563dc4fee3d67586a05d844b521ba95d Mon Sep 17 00:00:00 2001
+From d51411dd4f9e728c68ccdf9949198fa6f16b753f Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 7 Nov 2011 14:22:19 +0800
-Subject: [PATCH 79/88] show guessed sentence in lookup table
+Subject: [PATCH 79/94] show guessed sentence in lookup table
 
 ---
  src/PYPPhoneticEditor.cc |   35 ++++++++++++++++++++++++++++++-----
@@ -10376,13 +10376,13 @@ index ac94ba7..a249b54 100644
      updatePreeditText ();
      updateAuxiliaryText ();
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 8e514f3a25e4a1263a4ae5f1a67d15a5be1afeb0 Mon Sep 17 00:00:00 2001
+From 4b12c07f98d9e0cb437034ad5215b9001e98321e Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 7 Nov 2011 14:40:06 +0800
-Subject: [PATCH 80/88] fixes select candidate
+Subject: [PATCH 80/94] fixes select candidate
 
 ---
  src/PYPPhoneticEditor.cc |   16 +++++++++++++++-
@@ -10425,13 +10425,13 @@ index a249b54..c5c8041 100644
  
      return TRUE;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 266ac40226616566faba3d8e3d048876e0587c40 Mon Sep 17 00:00:00 2001
+From 2db3c83f7ed2dbcba3c579cfe9963577eaf58a59 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 7 Nov 2011 14:50:54 +0800
-Subject: [PATCH 81/88] add get lookup cursor function
+Subject: [PATCH 81/94] add get lookup cursor function
 
 ---
  src/PYPPhoneticEditor.cc |   35 ++++++++++++++++++++---------------
@@ -10530,13 +10530,13 @@ index b2235f3..1360e58 100644
      /* inline functions */
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 3f49177498706dd75b6af0ed0c784b89de9fb785 Mon Sep 17 00:00:00 2001
+From 7a10a4c189f8f28333c4bd8857a9bba4fd009a59 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 7 Nov 2011 15:09:46 +0800
-Subject: [PATCH 82/88] show the rest of guessed sentence
+Subject: [PATCH 82/94] show the rest of guessed sentence
 
 ---
  src/PYPPhoneticEditor.cc |    8 +++++---
@@ -10569,13 +10569,13 @@ index b9dbc85..4f2c1e1 100644
              continue;
          }
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 1a34555e19202d5ba9e813fdc5d915b8d969fac6 Mon Sep 17 00:00:00 2001
+From 705c791f5c535bc02c349c6ea686d6b69db6b559 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Tue, 8 Nov 2011 13:03:31 +0800
-Subject: [PATCH 83/88] clean code
+Subject: [PATCH 83/94] clean code
 
 ---
  src/PYPPhoneticEditor.cc |   40 +++++++++++++++++-----------------------
@@ -10646,13 +10646,13 @@ index 4f2c1e1..e79e492 100644
  
      return TRUE;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 6754d3911acd4cdfdd0f234d26f2489b50d50d4b Mon Sep 17 00:00:00 2001
+From 4052c696561ff06e74029cd1ec43355295e15e8c Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Tue, 8 Nov 2011 13:14:34 +0800
-Subject: [PATCH 84/88] remove duplicated candidates
+Subject: [PATCH 84/94] remove duplicated candidates
 
 ---
  src/PYPPhoneticEditor.cc |    9 ++++++++-
@@ -10690,13 +10690,13 @@ index e79e492..b5903ae 100644
          if (G_UNLIKELY (!m_props.modeSimp ())) { /* Traditional Chinese */
              candidate.truncate (0);
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From c103ad7e656ffde9e7142cfc98e83e43ea26c6f4 Mon Sep 17 00:00:00 2001
+From 3fbb80c187f3dc4b7296d838a78a054fe82d3266 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Tue, 8 Nov 2011 14:14:48 +0800
-Subject: [PATCH 85/88] fixes first candidate
+Subject: [PATCH 85/94] fixes first candidate
 
 ---
  src/PYPPhoneticEditor.cc |    8 ++++++--
@@ -10723,13 +10723,13 @@ index b5903ae..b691e88 100644
              g_free (tmp);
              continue;
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 277449c339c32684fa2dfe008c302873a2c20266 Mon Sep 17 00:00:00 2001
+From 0fb453ad10c68a4a4462c1e163afd5825696d9d3 Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Mon, 14 Nov 2011 14:23:10 +0800
-Subject: [PATCH 86/88] fixes fill candidates
+Subject: [PATCH 86/94] fixes fill candidates
 
 ---
  src/PYPPhoneticEditor.cc |    3 +++
@@ -10750,13 +10750,13 @@ index b691e88..a713a71 100644
              (m_candidates, phrase_token_t, i);
  
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From 1343e7456f8a0aad71136caab52bdd2638e001d9 Mon Sep 17 00:00:00 2001
+From 092b927577798f6e4742c6a0d8e98fcd4d30adea Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Tue, 22 Nov 2011 10:54:35 +0800
-Subject: [PATCH 87/88] fixes pinyin yunmu 'v' handle
+Subject: [PATCH 87/94] fixes pinyin yunmu 'v' handle
 
 ---
  src/PYPFullPinyinEditor.cc |   13 ++++++++++++-
@@ -10787,13 +10787,13 @@ index 07073b6..9c019e3 100644
          pos.set_pos (py.begin); pos.set_length (py.len);
          g_array_append_val (m_instance->m_pinyin_keys, key);
 -- 
-1.7.7.3
+1.7.7.4
 
 
-From a7c9c2fed157923cdd5f01d782c8b569a287f7b5 Mon Sep 17 00:00:00 2001
+From 31abb4ac2825319bd33bd9f6748cc4627ab5311e Mon Sep 17 00:00:00 2001
 From: Peng Wu <alexepico at gmail.com>
 Date: Fri, 25 Nov 2011 15:23:41 +0800
-Subject: [PATCH 88/88] fixes process space in libpinyin phonetic editor
+Subject: [PATCH 88/94] fixes process space in libpinyin phonetic editor
 
 ---
  src/PYPPhoneticEditor.cc |    9 ++++++++-
@@ -10820,5 +10820,1567 @@ index a713a71..32a30a2 100644
  }
  
 -- 
-1.7.7.3
+1.7.7.4
+
+
+From 904ce4a5ade3e04c063081b549b75efafad73f56 Mon Sep 17 00:00:00 2001
+From: Peng Wu <alexepico at gmail.com>
+Date: Tue, 20 Dec 2011 16:42:41 +0800
+Subject: [PATCH 89/94] add LibPinyin Config
+
+---
+ src/Makefile.am  |    2 +
+ src/PYPConfig.cc |  496 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/PYPConfig.h  |  100 +++++++++++
+ 3 files changed, 598 insertions(+), 0 deletions(-)
+ create mode 100644 src/PYPConfig.cc
+ create mode 100644 src/PYPConfig.h
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index dd6c7a4..0b4787d 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -44,6 +44,7 @@ ibus_engine_pinyin_built_h_sources = \
+ ibus_engine_pinyin_c_sources = \
+ 	PYBopomofoEditor.cc \
+ 	PYBopomofoEngine.cc \
++	PYPConfig.cc \
+ 	PYConfig.cc \
+ 	PYDatabase.cc \
+ 	PYDoublePinyinEditor.cc \
+@@ -114,6 +115,7 @@ ibus_engine_pinyin_h_sources = \
+ 	PYPBopomofoEditor.h \
+ 	PYPPinyinEngine.h \
+ 	PYPBopomofoEngine.h \
++	PYPConfig.h \
+ 	$(NULL)
+ 
+ if IBUS_BUILD_LIBPINYIN
+diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
+new file mode 100644
+index 0000000..da3d770
+--- /dev/null
++++ b/src/PYPConfig.cc
+@@ -0,0 +1,496 @@
++/* vim:set et ts=4 sts=4:
++ *
++ * ibus-pinyin - The Chinese PinYin engine for IBus
++ *
++ * Copyright (c) 2008-2010 Peng Huang <shawn.p.huang at gmail.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++#include "PYPConfig.h"
++
++#include "PYBus.h"
++#ifdef IBUS_BUILD_LIBPINYIN
++#include <pinyin.h>
++#include "PYLibPinyin.h"
++#endif
++
++namespace PY {
++
++const gchar * const CONFIG_CORRECT_PINYIN            = "CorrectPinyin";
++const gchar * const CONFIG_FUZZY_PINYIN              = "FuzzyPinyin";
++const gchar * const CONFIG_ORIENTATION               = "LookupTableOrientation";
++const gchar * const CONFIG_PAGE_SIZE                 = "LookupTablePageSize";
++const gchar * const CONFIG_SHIFT_SELECT_CANDIDATE    = "ShiftSelectCandidate";
++const gchar * const CONFIG_MINUS_EQUAL_PAGE          = "MinusEqualPage";
++const gchar * const CONFIG_COMMA_PERIOD_PAGE         = "CommaPeriodPage";
++const gchar * const CONFIG_AUTO_COMMIT               = "AutoCommit";
++const gchar * const CONFIG_DOUBLE_PINYIN             = "DoublePinyin";
++const gchar * const CONFIG_DOUBLE_PINYIN_SCHEMA      = "DoublePinyinSchema";
++const gchar * const CONFIG_DOUBLE_PINYIN_SHOW_RAW    = "DoublePinyinShowRaw";
++const gchar * const CONFIG_INIT_CHINESE              = "InitChinese";
++const gchar * const CONFIG_INIT_FULL                 = "InitFull";
++const gchar * const CONFIG_INIT_FULL_PUNCT           = "InitFullPunct";
++const gchar * const CONFIG_INIT_SIMP_CHINESE         = "InitSimplifiedChinese";
++const gchar * const CONFIG_SPECIAL_PHRASES           = "SpecialPhrases";
++const gchar * const CONFIG_BOPOMOFO_KEYBOARD_MAPPING = "BopomofoKeyboardMapping";
++const gchar * const CONFIG_SELECT_KEYS               = "SelectKeys";
++const gchar * const CONFIG_GUIDE_KEY                 = "GuideKey";
++const gchar * const CONFIG_AUXILIARY_SELECT_KEY_F    = "AuxiliarySelectKey_F";
++const gchar * const CONFIG_AUXILIARY_SELECT_KEY_KP   = "AuxiliarySelectKey_KP";
++const gchar * const CONFIG_ENTER_KEY                 = "EnterKey";
++
++const guint PINYIN_DEFAULT_OPTION =
++        PINYIN_INCOMPLETE |
++        CHEWING_INCOMPLETE|
++        PINYIN_CORRECT_ALL|
++        0;
++
++std::unique_ptr<LibPinyinPinyinConfig> LibPinyinPinyinConfig::m_instance;
++std::unique_ptr<LibPinyinBopomofoConfig> LibPinyinBopomofoConfig::m_instance;
++
++LibPinyinConfig::LibPinyinConfig (Bus & bus, const std::string & name)
++    : Config (bus, name)
++{
++    initDefaultValues ();
++    g_signal_connect (get<IBusConfig> (),
++                      "value-changed",
++                      G_CALLBACK (valueChangedCallback),
++                      this);
++}
++
++LibPinyinConfig::~LibPinyinConfig (void)
++{
++}
++
++void
++LibPinyinConfig::initDefaultValues (void)
++{
++    m_option = PINYIN_DEFAULT_OPTION;
++    m_option_mask = PINYIN_INCOMPLETE | CHEWING_INCOMPLETE | PINYIN_CORRECT_ALL;
++
++    m_orientation = IBUS_ORIENTATION_HORIZONTAL;
++    m_page_size = 5;
++    m_shift_select_candidate = FALSE;
++    m_minus_equal_page = TRUE;
++    m_comma_period_page = TRUE;
++    m_auto_commit = FALSE;
++
++    m_double_pinyin = FALSE;
++    m_double_pinyin_schema = 0;
++    m_double_pinyin_show_raw = FALSE;
++
++    m_init_chinese = TRUE;
++    m_init_full = FALSE;
++    m_init_full_punct = TRUE;
++    m_init_simp_chinese = TRUE;
++    m_special_phrases = TRUE;
++}
++
++static const struct {
++    const gchar * const name;
++    guint option;
++} options [] = {
++    { "IncompletePinyin",       PINYIN_INCOMPLETE|CHEWING_INCOMPLETE},
++    /* fuzzy pinyin */
++    { "FuzzyPinyin_C_CH",       PINYIN_AMB_C_CH      },
++    { "FuzzyPinyin_CH_C",       PINYIN_AMB_C_CH      },
++    { "FuzzyPinyin_Z_ZH",       PINYIN_AMB_Z_ZH      },
++    { "FuzzyPinyin_ZH_Z",       PINYIN_AMB_Z_ZH      },
++    { "FuzzyPinyin_S_SH",       PINYIN_AMB_S_SH      },
++    { "FuzzyPinyin_SH_S",       PINYIN_AMB_S_SH      },
++    { "FuzzyPinyin_L_N",        PINYIN_AMB_L_N       },
++    { "FuzzyPinyin_N_L",        PINYIN_AMB_L_N       },
++    { "FuzzyPinyin_F_H",        PINYIN_AMB_F_H       },
++    { "FuzzyPinyin_H_F",        PINYIN_AMB_F_H       },
++    { "FuzzyPinyin_L_R",        PINYIN_AMB_L_R       },
++    { "FuzzyPinyin_R_L",        PINYIN_AMB_L_R       },
++    { "FuzzyPinyin_K_G",        PINYIN_AMB_G_K       },
++    { "FuzzyPinyin_G_K",        PINYIN_AMB_G_K       },
++    { "FuzzyPinyin_AN_ANG",     PINYIN_AMB_AN_ANG    },
++    { "FuzzyPinyin_ANG_AN",     PINYIN_AMB_AN_ANG    },
++    { "FuzzyPinyin_EN_ENG",     PINYIN_AMB_EN_ENG    },
++    { "FuzzyPinyin_ENG_EN",     PINYIN_AMB_EN_ENG    },
++    { "FuzzyPinyin_IN_ING",     PINYIN_AMB_IN_ING    },
++    { "FuzzyPinyin_ING_IN",     PINYIN_AMB_IN_ING    },
++};
++
++void
++LibPinyinConfig::readDefaultValues (void)
++{
++#if defined(HAVE_IBUS_CONFIG_GET_VALUES)
++    /* read all values together */
++    initDefaultValues ();
++    GVariant *values =
++            ibus_config_get_values (get<IBusConfig> (), m_section.c_str ());
++    g_return_if_fail (values != NULL);
++
++    GVariantIter iter;
++    gchar *name;
++    GVariant *value;
++    g_variant_iter_init (&iter, values);
++    while (g_variant_iter_next (&iter, "{sv}", &name, &value)) {
++        valueChanged (m_section, name, value);
++        g_free (name);
++        g_variant_unref (value);
++    }
++    g_variant_unref (values);
++#else
++    /* others */
++    m_orientation = read (CONFIG_ORIENTATION, 0);
++    if (m_orientation != IBUS_ORIENTATION_VERTICAL &&
++        m_orientation != IBUS_ORIENTATION_HORIZONTAL) {
++        m_orientation = IBUS_ORIENTATION_HORIZONTAL;
++        g_warn_if_reached ();
++    }
++    m_page_size = read (CONFIG_PAGE_SIZE, 5);
++    if (m_page_size > 10) {
++        m_page_size = 5;
++        g_warn_if_reached ();
++    }
++
++    /* fuzzy pinyin */
++    if (read (CONFIG_FUZZY_PINYIN, false))
++        m_option_mask |= PINYIN_AMB_ALL;
++    else
++        m_option_mask &= ~PINYIN_AMB_ALL;
++
++    /* read values */
++    for (guint i = 0; i < G_N_ELEMENTS (options); i++) {
++        if (read (options[i].name,
++                  (options[i].option & PINYIN_DEFAULT_OPTION) != 0)) {
++            m_option |= options[i].option;
++        }
++        else {
++            m_option &= ~options[i].option;
++        }
++    }
++#endif
++}
++
++
++static inline bool
++normalizeGVariant (GVariant *value, bool defval)
++{
++    if (value == NULL || g_variant_classify (value) != G_VARIANT_CLASS_BOOLEAN)
++        return defval;
++    return g_variant_get_boolean (value);
++}
++
++static inline gint
++normalizeGVariant (GVariant *value, gint defval)
++{
++    if (value == NULL || g_variant_classify (value) != G_VARIANT_CLASS_INT32)
++        return defval;
++    return g_variant_get_int32 (value);
++}
++
++static inline std::string
++normalizeGVariant (GVariant *value, const std::string &defval)
++{
++    if (value == NULL || g_variant_classify (value) != G_VARIANT_CLASS_STRING)
++        return defval;
++    return g_variant_get_string (value, NULL);
++}
++
++gboolean
++LibPinyinConfig::valueChanged (const std::string &section,
++                               const std::string &name,
++                               GVariant          *value)
++{
++    if (m_section != section)
++        return FALSE;
++
++    /* lookup table page size */
++    if (CONFIG_ORIENTATION == name) {
++        m_orientation = normalizeGVariant (value, IBUS_ORIENTATION_HORIZONTAL);
++        if (m_orientation != IBUS_ORIENTATION_VERTICAL &&
++            m_orientation != IBUS_ORIENTATION_HORIZONTAL) {
++            m_orientation = IBUS_ORIENTATION_HORIZONTAL;
++            g_warn_if_reached ();
++        }
++    }
++    else if (CONFIG_PAGE_SIZE == name) {
++        m_page_size = normalizeGVariant (value, 5);
++        if (m_page_size > 10) {
++            m_page_size = 5;
++            g_warn_if_reached ();
++        }
++    }
++    /* fuzzy pinyin */
++    else if (CONFIG_FUZZY_PINYIN == name) {
++        if (normalizeGVariant (value, false))
++            m_option_mask |= PINYIN_AMB_ALL;
++        else
++            m_option_mask &= ~PINYIN_AMB_ALL;
++    }
++    else {
++        for (guint i = 0; i < G_N_ELEMENTS (options); i++) {
++            if (G_LIKELY (options[i].name != name))
++                continue;
++            if (normalizeGVariant (value,
++                    (options[i].option & PINYIN_DEFAULT_OPTION) != 0))
++                m_option |= options[i].option;
++            else
++                m_option &= ~options[i].option;
++            return TRUE;
++        }
++        return FALSE;
++    }
++    return TRUE;
++}
++
++void
++LibPinyinConfig::valueChangedCallback (IBusConfig  *config,
++                                       const gchar *section,
++                                       const gchar *name,
++                                       GVariant    *value,
++                                       LibPinyinConfig *self)
++{
++    self->valueChanged (section, name, value);
++    if (self->m_section != section)
++        return;
++#ifdef IBUS_BUILD_LIBPINYIN
++    if (self->m_section == "engine/Pinyin")
++        LibPinyinBackEnd::instance ().setPinyinOptions (self);
++    if (self->m_section == "engine/Bopomofo")
++        LibPinyinBackEnd::instance ().setChewingOptions (self);
++#endif
++}
++
++static const struct {
++    const gchar * const name;
++    guint option;
++} pinyin_options [] = {
++    /* correct */
++    { "CorrectPinyin_GN_NG",    PINYIN_CORRECT_GN_NG    },
++    { "CorrectPinyin_GN_NG",    PINYIN_CORRECT_GN_NG    },
++    { "CorrectPinyin_MG_NG",    PINYIN_CORRECT_MG_NG    },
++    { "CorrectPinyin_IOU_IU",   PINYIN_CORRECT_IOU_IU   },
++    { "CorrectPinyin_UEI_UI",   PINYIN_CORRECT_UEI_UI   },
++    { "CorrectPinyin_UEN_UN",   PINYIN_CORRECT_UEN_UN   },
++    { "CorrectPinyin_UE_VE",    PINYIN_CORRECT_UE_VE    },
++    { "CorrectPinyin_V_U",      PINYIN_CORRECT_V_U      },
++    { "CorrectPinyin_VE_UE",    PINYIN_CORRECT_V_U      },
++    { "CorrectPinyin_ON_ONG",   PINYIN_CORRECT_ON_ONG   },
++};
++
++LibPinyinPinyinConfig::LibPinyinPinyinConfig (Bus & bus)
++    : LibPinyinConfig (bus, "Pinyin")
++{
++}
++
++void
++LibPinyinPinyinConfig::init (Bus & bus)
++{
++    if (m_instance.get () == NULL) {
++        m_instance.reset (new LibPinyinPinyinConfig (bus));
++        m_instance->readDefaultValues ();
++    }
++}
++
++void
++LibPinyinPinyinConfig::readDefaultValues (void)
++{
++    LibPinyinConfig::readDefaultValues ();
++#if !defined(HAVE_IBUS_CONFIG_GET_VALUES)
++    /* double pinyin */
++    m_double_pinyin = read (CONFIG_DOUBLE_PINYIN, false);
++    m_double_pinyin_schema = read (CONFIG_DOUBLE_PINYIN_SCHEMA, 0);
++    if (m_double_pinyin_schema > DOUBLE_PINYIN_LAST) {
++        m_double_pinyin_schema = 0;
++        g_warn_if_reached ();
++    }
++    m_double_pinyin_show_raw = read (CONFIG_DOUBLE_PINYIN_SHOW_RAW, false);
++
++    /* init states */
++    m_init_chinese = read (CONFIG_INIT_CHINESE, true);
++    m_init_full = read (CONFIG_INIT_FULL, false);
++    m_init_full_punct = read (CONFIG_INIT_FULL_PUNCT, true);
++    m_init_simp_chinese = read (CONFIG_INIT_SIMP_CHINESE, true);
++
++    m_special_phrases = read (CONFIG_SPECIAL_PHRASES, true);
++
++    /* other */
++    m_shift_select_candidate = read (CONFIG_SHIFT_SELECT_CANDIDATE, false);
++    m_minus_equal_page = read (CONFIG_MINUS_EQUAL_PAGE, true);
++    m_comma_period_page = read (CONFIG_COMMA_PERIOD_PAGE, true);
++    m_auto_commit = read (CONFIG_AUTO_COMMIT, false);
++
++    /* correct pinyin */
++    if (read (CONFIG_CORRECT_PINYIN, true))
++        m_option_mask |= PINYIN_CORRECT_ALL;
++    else
++        m_option_mask &= ~PINYIN_CORRECT_ALL;
++
++    /* read values */
++    for (guint i = 0; i < G_N_ELEMENTS (pinyin_options); i++) {
++        if (read (pinyin_options[i].name,
++                (pinyin_options[i].option & PINYIN_DEFAULT_OPTION) != 0))
++            m_option |= pinyin_options[i].option;
++        else
++            m_option &= ~pinyin_options[i].option;
++    }
++#endif
++}
++
++gboolean
++LibPinyinPinyinConfig::valueChanged (const std::string &section,
++                                     const std::string &name,
++                                     GVariant          *value)
++{
++    if (m_section != section)
++        return FALSE;
++
++    if (LibPinyinConfig::valueChanged (section, name, value))
++        return TRUE;
++
++    /* double pinyin */
++    if (CONFIG_DOUBLE_PINYIN == name)
++        m_double_pinyin = normalizeGVariant (value, false);
++    else if (CONFIG_DOUBLE_PINYIN_SCHEMA == name) {
++        m_double_pinyin_schema = normalizeGVariant (value, 0);
++#if 0
++        if (m_double_pinyin_schema > DOUBLE_PINYIN_LAST) {
++            m_double_pinyin_schema = 0;
++            g_warn_if_reached ();
++        }
++#endif
++    }
++    else if (CONFIG_DOUBLE_PINYIN_SHOW_RAW == name)
++        m_double_pinyin_show_raw = normalizeGVariant (value, false);
++    /* init states */
++    else if (CONFIG_INIT_CHINESE == name)
++        m_init_chinese = normalizeGVariant (value, true);
++    else if (CONFIG_INIT_FULL == name)
++        m_init_full = normalizeGVariant (value, true);
++    else if (CONFIG_INIT_FULL_PUNCT == name)
++        m_init_full_punct = normalizeGVariant (value, true);
++    else if (CONFIG_INIT_SIMP_CHINESE == name)
++        m_init_simp_chinese = normalizeGVariant (value, true);
++    else if (CONFIG_SPECIAL_PHRASES == name)
++        m_special_phrases = normalizeGVariant (value, true);
++    /* others */
++    else if (CONFIG_SHIFT_SELECT_CANDIDATE == name)
++        m_shift_select_candidate = normalizeGVariant (value, false);
++    else if (CONFIG_MINUS_EQUAL_PAGE == name)
++        m_minus_equal_page = normalizeGVariant (value, true);
++    else if (CONFIG_COMMA_PERIOD_PAGE == name)
++        m_comma_period_page = normalizeGVariant (value, true);
++    else if (CONFIG_AUTO_COMMIT == name)
++        m_auto_commit = normalizeGVariant (value, false);
++    /* correct pinyin */
++    else if (CONFIG_CORRECT_PINYIN == name) {
++        if (normalizeGVariant (value, true))
++            m_option_mask |= PINYIN_CORRECT_ALL;
++        else
++            m_option_mask &= ~PINYIN_CORRECT_ALL;
++    }
++    else {
++        for (guint i = 0; i < G_N_ELEMENTS (pinyin_options); i++) {
++            if (G_LIKELY (pinyin_options[i].name != name))
++                continue;
++            if (normalizeGVariant (value,
++                    (pinyin_options[i].option & PINYIN_DEFAULT_OPTION) != 0))
++                m_option |= pinyin_options[i].option;
++            else
++                m_option &= ~pinyin_options[i].option;
++            return TRUE;
++        }
++        return FALSE;
++    }
++    return TRUE;
++}
++
++LibPinyinBopomofoConfig::LibPinyinBopomofoConfig (Bus & bus)
++    : LibPinyinConfig (bus, "Bopomofo")
++{
++}
++
++void
++LibPinyinBopomofoConfig::init (Bus & bus)
++{
++    if (m_instance.get () == NULL) {
++        m_instance.reset (new LibPinyinBopomofoConfig (bus));
++        m_instance->readDefaultValues ();
++    }
++}
++
++void
++LibPinyinBopomofoConfig::readDefaultValues (void)
++{
++    LibPinyinConfig::readDefaultValues ();
++#if !defined(HAVE_IBUS_CONFIG_GET_VALUES)
++    /* init states */
++    m_init_chinese = read (CONFIG_INIT_CHINESE, true);
++    m_init_full = read (CONFIG_INIT_FULL, false);
++    m_init_full_punct = read (CONFIG_INIT_FULL_PUNCT, true);
++    m_init_simp_chinese = read (CONFIG_INIT_SIMP_CHINESE, false);
++
++    m_special_phrases = read (CONFIG_SPECIAL_PHRASES, false);
++
++    m_bopomofo_keyboard_mapping = read (CONFIG_BOPOMOFO_KEYBOARD_MAPPING, 0);
++
++    m_select_keys = read (CONFIG_SELECT_KEYS, 0);
++    if (m_select_keys >= 9) m_select_keys = 0;
++    m_guide_key = read (CONFIG_GUIDE_KEY, true);
++    m_auxiliary_select_key_f = read (CONFIG_AUXILIARY_SELECT_KEY_F, true);
++    m_auxiliary_select_key_kp = read (CONFIG_AUXILIARY_SELECT_KEY_KP, true);
++    m_enter_key = read (CONFIG_ENTER_KEY, true);
++#endif
++}
++
++gboolean
++LibPinyinBopomofoConfig::valueChanged (const std::string &section,
++                                       const std::string &name,
++                                       GVariant          *value)
++{
++    if (m_section != section)
++        return FALSE;
++
++    if (LibPinyinConfig::valueChanged (section, name, value))
++        return TRUE;
++
++    /* init states */
++    if (CONFIG_INIT_CHINESE == name)
++        m_init_chinese = normalizeGVariant (value, true);
++    else if (CONFIG_INIT_FULL == name)
++        m_init_full = normalizeGVariant (value, true);
++    else if (CONFIG_INIT_FULL_PUNCT == name)
++        m_init_full_punct = normalizeGVariant (value, true);
++    else if (CONFIG_INIT_SIMP_CHINESE == name)
++        m_init_simp_chinese = normalizeGVariant (value, false);
++    else if (CONFIG_SPECIAL_PHRASES == name)
++        m_special_phrases = normalizeGVariant (value, false);
++    else if (CONFIG_BOPOMOFO_KEYBOARD_MAPPING == name)
++        m_bopomofo_keyboard_mapping = normalizeGVariant (value, 0);
++    else if (CONFIG_SELECT_KEYS == name) {
++        m_select_keys = normalizeGVariant (value, 0);
++        if (m_select_keys >= 9) m_select_keys = 0;
++    }
++    else if (CONFIG_GUIDE_KEY == name)
++        m_guide_key = normalizeGVariant (value, true);
++    else if (CONFIG_AUXILIARY_SELECT_KEY_F == name)
++        m_auxiliary_select_key_f = normalizeGVariant (value, true);
++    else if (CONFIG_AUXILIARY_SELECT_KEY_KP == name)
++        m_auxiliary_select_key_kp = normalizeGVariant (value, true);
++    else if (CONFIG_ENTER_KEY == name)
++        m_enter_key = normalizeGVariant (value, true);
++    else
++        return FALSE;
++    return TRUE;
++
++}
++
++};
+diff --git a/src/PYPConfig.h b/src/PYPConfig.h
+new file mode 100644
+index 0000000..19d3ba5
+--- /dev/null
++++ b/src/PYPConfig.h
+@@ -0,0 +1,100 @@
++/* vim:set et ts=4 sts=4:
++ *
++ * ibus-pinyin - The Chinese PinYin engine for IBus
++ *
++ * Copyright (c) 2008-2010 Peng Huang <shawn.p.huang at gmail.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++#ifndef __PY_LIBPINYIN_CONFIG_H_
++#define __PY_LIBPINYIN_CONFIG_H_
++
++#ifdef HAVE_CONFIG_H
++#  include <config.h>
++#endif
++
++#include <string>
++#include <ibus.h>
++#include "PYUtil.h"
++#include "PYObject.h"
++#include "PYConfig.h"
++#include <pinyin.h>
++
++namespace PY {
++
++class Bus;
++
++class LibPinyinConfig : public Config {
++protected:
++    LibPinyinConfig (Bus & bus, const std::string & name);
++    virtual ~LibPinyinConfig (void);
++
++public:
++
++protected:
++    void initDefaultValues (void);
++
++    virtual void readDefaultValues (void);
++    virtual gboolean valueChanged (const std::string  &section,
++                                   const std::string  &name,
++                                   GVariant           *value);
++private:
++    static void valueChangedCallback (IBusConfig     *config,
++                                      const gchar    *section,
++                                      const gchar    *name,
++                                      GVariant       *value,
++                                      LibPinyinConfig *self);
++
++protected:
++};
++
++/* PinyinConfig */
++class LibPinyinPinyinConfig : public LibPinyinConfig {
++public:
++    static void init (Bus & bus);
++    static LibPinyinPinyinConfig & instance (void) { return *m_instance; }
++
++protected:
++    LibPinyinPinyinConfig (Bus & bus);
++    virtual void readDefaultValues (void);
++
++    virtual gboolean valueChanged (const std::string &section,
++                                   const std::string &name,
++                                   GVariant          *value);
++
++private:
++    static std::unique_ptr<LibPinyinPinyinConfig> m_instance;
++};
++
++/* Bopomof Config */
++class LibPinyinBopomofoConfig : public LibPinyinConfig {
++public:
++    static void init (Bus & bus);
++    static LibPinyinBopomofoConfig & instance (void) { return *m_instance; }
++
++protected:
++    LibPinyinBopomofoConfig (Bus & bus);
++    virtual void readDefaultValues (void);
++
++    virtual gboolean valueChanged (const std::string &section,
++                                   const std::string &name,
++                                   GVariant          *value);
++
++private:
++    static std::unique_ptr<LibPinyinBopomofoConfig> m_instance;
++};
++
++};
++#endif
+-- 
+1.7.7.4
+
+
+From fa92d8b0c2100ed37983f1bd210695d16ce9182b Mon Sep 17 00:00:00 2001
+From: Peng Wu <alexepico at gmail.com>
+Date: Tue, 20 Dec 2011 17:05:00 +0800
+Subject: [PATCH 90/94] forked PY::Config
+
+---
+ src/PYLibPinyin.cc |   96 ++++++++++++----------------------------------------
+ src/PYLibPinyin.h  |    7 ++--
+ 2 files changed, 26 insertions(+), 77 deletions(-)
+
+diff --git a/src/PYLibPinyin.cc b/src/PYLibPinyin.cc
+index 062b3c9..fea2f25 100644
+--- a/src/PYLibPinyin.cc
++++ b/src/PYLibPinyin.cc
+@@ -20,8 +20,8 @@
+  */
+ 
+ #include "PYLibPinyin.h"
+-#include "PYTypes.h"
+-#include "PYConfig.h"
++#include <pinyin.h>
++#include "PYPConfig.h"
+ 
+ #define LIBPINYIN_SAVE_TIMEOUT   (5 * 60)
+ 
+@@ -111,69 +111,17 @@ LibPinyinBackEnd::finalize (void) {
+     m_instance.reset ();
+ }
+ 
+-/* Here are the fuzzy pinyin options conversion table. */
+-static const struct {
+-    guint ibus_pinyin_option;
+-    PinyinAmbiguity libpinyin_option;
+-} fuzzy_options [] = {
+-    /* fuzzy pinyin */
+-    { PINYIN_FUZZY_C_CH,        PINYIN_AmbCiChi        },
+-    { PINYIN_FUZZY_CH_C,        PINYIN_AmbChiCi        },
+-    { PINYIN_FUZZY_Z_ZH,        PINYIN_AmbZiZhi        },
+-    { PINYIN_FUZZY_ZH_Z,        PINYIN_AmbZhiZi        },
+-    { PINYIN_FUZZY_S_SH,        PINYIN_AmbSiShi        },
+-    { PINYIN_FUZZY_SH_S,        PINYIN_AmbShiSi        },
+-    { PINYIN_FUZZY_L_N,         PINYIN_AmbLeNe         },
+-    { PINYIN_FUZZY_N_L,         PINYIN_AmbNeLe         },
+-    { PINYIN_FUZZY_F_H,         PINYIN_AmbFoHe         },
+-    { PINYIN_FUZZY_H_F,         PINYIN_AmbHeFo         },
+-    { PINYIN_FUZZY_L_R,         PINYIN_AmbLeRi         },
+-    { PINYIN_FUZZY_R_L,         PINYIN_AmbRiLe         },
+-    { PINYIN_FUZZY_K_G,         PINYIN_AmbKeGe         },
+-    { PINYIN_FUZZY_G_K,         PINYIN_AmbGeKe         },
+-    { PINYIN_FUZZY_AN_ANG,      PINYIN_AmbAnAng        },
+-    { PINYIN_FUZZY_ANG_AN,      PINYIN_AmbAngAn        },
+-    { PINYIN_FUZZY_EN_ENG,      PINYIN_AmbEnEng        },
+-    { PINYIN_FUZZY_ENG_EN,      PINYIN_AmbEngEn        },
+-    { PINYIN_FUZZY_IN_ING,      PINYIN_AmbInIng        },
+-    { PINYIN_FUZZY_ING_IN,      PINYIN_AmbIngIn        }
+-};
+-
+-
+-gboolean
+-LibPinyinBackEnd::setFuzzyOptions (Config *config, pinyin_context_t *context)
+-{
+-    g_assert (context);
+-
+-    guint option = config->option ();
+-    PinyinCustomSettings custom;
+-
+-    custom.set_use_incomplete (option & PINYIN_INCOMPLETE_PINYIN);
+-    custom.set_use_ambiguities (PINYIN_AmbAny, false);
+-
+-    /* copy values */
+-    for (guint i = 0; i < G_N_ELEMENTS (fuzzy_options); i++) {
+-        if ( option & fuzzy_options[i].ibus_pinyin_option )
+-            custom.set_use_ambiguities
+-                (fuzzy_options[i].libpinyin_option, true);
+-    }
+-
+-    pinyin_set_options(context, &custom);
+-
+-    return TRUE;
+-}
+-
+ /* Here are the double pinyin keyboard scheme mapping table. */
+ static const struct{
+     gint double_pinyin_keyboard;
+-    PinyinShuangPinScheme shuang_pin_keyboard;
+-} shuang_pin_options [] = {
+-    {0, SHUANG_PIN_MS},
+-    {1, SHUANG_PIN_ZRM},
+-    {2, SHUANG_PIN_ABC},
+-    {3, SHUANG_PIN_ZIGUANG},
+-    {4, SHUANG_PIN_PYJJ},
+-    {5, SHUANG_PIN_XHE}
++    DoublePinyinScheme scheme;
++} double_pinyin_options [] = {
++    {0, DOUBLE_PINYIN_MS},
++    {1, DOUBLE_PINYIN_ZRM},
++    {2, DOUBLE_PINYIN_ABC},
++    {3, DOUBLE_PINYIN_ZIGUANG},
++    {4, DOUBLE_PINYIN_PYJJ},
++    {5, DOUBLE_PINYIN_XHE}
+ };
+ 
+ gboolean
+@@ -183,27 +131,27 @@ LibPinyinBackEnd::setPinyinOptions (Config *config)
+         return FALSE;
+ 
+     const gint map = config->doublePinyinSchema ();
+-    for (guint i = 0; i < G_N_ELEMENTS (shuang_pin_options); i++) {
+-        if (map == shuang_pin_options[i].double_pinyin_keyboard) {
+-            /* TODO: set double pinyin scheme. */
+-            PinyinShuangPinScheme scheme = shuang_pin_options[i].shuang_pin_keyboard;
++    for (guint i = 0; i < G_N_ELEMENTS (double_pinyin_options); i++) {
++        if (map == double_pinyin_options[i].double_pinyin_keyboard) {
++            /* set double pinyin scheme. */
++            DoublePinyinScheme scheme = double_pinyin_options[i].scheme;
+             pinyin_set_double_pinyin_scheme (m_pinyin_context, scheme);
+         }
+     }
+ 
+-    setFuzzyOptions (config, m_pinyin_context);
++    pinyin_set_options (m_pinyin_context, config->option());
+     return TRUE;
+ }
+ 
+ /* Here are the chewing keyboard scheme mapping table. */
+ static const struct {
+     gint bopomofo_keyboard;
+-    PinyinZhuYinScheme chewing_keyboard;
++    ChewingScheme scheme;
+ } chewing_options [] = {
+-    {0, ZHUYIN_STANDARD},
+-    {1, ZHUYIN_GIN_YIEH},
+-    {2, ZHUYIN_ET26},
+-    {3, ZHUYIN_IBM}
++    {0, CHEWING_STANDARD},
++    {1, CHEWING_GINYIEH},
++    {2, CHEWING_ETEN},
++    {3, CHEWING_IBM}
+ };
+ 
+ 
+@@ -217,12 +165,12 @@ LibPinyinBackEnd::setChewingOptions (Config *config)
+     for (guint i = 0; i < G_N_ELEMENTS (chewing_options); i++) {
+         if (map == chewing_options[i].bopomofo_keyboard) {
+             /* TODO: set chewing scheme. */
+-            PinyinZhuYinScheme scheme = chewing_options[i].chewing_keyboard;
++            ChewingScheme scheme = chewing_options[i].scheme;
+             pinyin_set_chewing_scheme (m_chewing_context, scheme);
+         }
+     }
+ 
+-    setFuzzyOptions (config, m_chewing_context);
++    pinyin_set_options(m_chewing_context, config->option());
+     return TRUE;
+ }
+ 
+diff --git a/src/PYLibPinyin.h b/src/PYLibPinyin.h
+index 32919b9..c264395 100644
+--- a/src/PYLibPinyin.h
++++ b/src/PYLibPinyin.h
+@@ -23,7 +23,10 @@
+ #define __PY_LIB_PINYIN_H_
+ 
+ #include <memory>
+-#include <pinyin.h>
++#include <glib.h>
++
++typedef struct _pinyin_context_t pinyin_context_t;
++typedef struct _pinyin_instance_t pinyin_instance_t;
+ 
+ namespace PY {
+ 
+@@ -50,8 +53,6 @@ public:
+     static void init (void);
+     static void finalize (void);
+ 
+-protected:
+-    gboolean setFuzzyOptions (Config *config, pinyin_context_t *context);
+ 
+ private:
+     gboolean saveUserDB (void);
+-- 
+1.7.7.4
+
+
+From e0af17eacda954dadaf84c474e6dedd707986f80 Mon Sep 17 00:00:00 2001
+From: Peng Wu <alexepico at gmail.com>
+Date: Tue, 20 Dec 2011 17:28:48 +0800
+Subject: [PATCH 91/94] use new parsers
+
+---
+ src/Makefile.am              |    2 +-
+ src/PYPBopomofoEditor.cc     |   15 ++++++-----
+ src/PYPDoublePinyinEditor.cc |   23 +++++++-----------
+ src/PYPFullPinyinEditor.cc   |   52 ++++++++---------------------------------
+ src/PYPPhoneticEditor.cc     |   18 +++++++-------
+ src/PYPPhoneticEditor.h      |    1 -
+ src/PYPPinyinEditor.cc       |    2 +-
+ 7 files changed, 38 insertions(+), 75 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 0b4787d..c967aa7 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -44,7 +44,6 @@ ibus_engine_pinyin_built_h_sources = \
+ ibus_engine_pinyin_c_sources = \
+ 	PYBopomofoEditor.cc \
+ 	PYBopomofoEngine.cc \
+-	PYPConfig.cc \
+ 	PYConfig.cc \
+ 	PYDatabase.cc \
+ 	PYDoublePinyinEditor.cc \
+@@ -120,6 +119,7 @@ ibus_engine_pinyin_h_sources = \
+ 
+ if IBUS_BUILD_LIBPINYIN
+ ibus_engine_pinyin_c_sources += \
++	PYPConfig.cc \
+ 	PYLibPinyin.cc \
+ 	PYPPhoneticEditor.cc \
+ 	PYPPinyinEditor.cc \
+diff --git a/src/PYPBopomofoEditor.cc b/src/PYPBopomofoEditor.cc
+index 39a7c95..63ec0b5 100644
+--- a/src/PYPBopomofoEditor.cc
++++ b/src/PYPBopomofoEditor.cc
+@@ -241,7 +241,7 @@ LibPinyinBopomofoEditor::updatePinyin (void)
+     if (G_UNLIKELY (m_text.empty ())) {
+         m_pinyin_len = 0;
+         /* TODO: check whether to replace "" with NULL. */
+-        pinyin_parse_more_chewings (m_instance, "");
++        pinyin_parse_more_chewings (m_instance, NULL);
+         return;
+     }
+ 
+@@ -348,18 +348,19 @@ LibPinyinBopomofoEditor::updateAuxiliaryText (void)
+ 
+     // guint pinyin_cursor = getPinyinCursor ();
+     PinyinKeyVector & pinyin_keys = m_instance->m_pinyin_keys;
+-    PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_poses;
++    PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_key_rests;
+     for (guint i = 0; i < pinyin_keys->len; ++i) {
+         PinyinKey *key = &g_array_index (pinyin_keys, PinyinKey, i);
+         PinyinKeyPos *pos = &g_array_index (pinyin_poses, PinyinKeyPos, i);
+-        guint cursor = pos->get_pos ();
++        guint cursor = pos->m_raw_begin;
+ 
+         if (G_UNLIKELY (cursor == m_cursor)) { /* at word boundary. */
+-            m_buffer << '|' << key->get_key_zhuyin_string ();
++            m_buffer << '|' << key->get_chewing_string ();
+         } else if (G_LIKELY ( cursor < m_cursor &&
+-                              m_cursor < pos->get_end_pos() )) { /* in word */
++                              m_cursor < pos->m_raw_end )) { /* in word */
+             /* raw text */
+-            String raw = m_text.substr (cursor, pos->get_length ());
++            String raw = m_text.substr (cursor,
++                                        pos->m_raw_end - pos->m_raw_begin);
+             guint offset = m_cursor - cursor;
+             m_buffer << ' ';
+             String before = raw.substr (0, offset);
+@@ -373,7 +374,7 @@ LibPinyinBopomofoEditor::updateAuxiliaryText (void)
+                 m_buffer << bopomofo_char[keyvalToBopomofo (*iter)];
+             }
+         } else { /* other words */
+-            m_buffer << ' ' << key->get_key_zhuyin_string ();
++            m_buffer << ' ' << key->get_chewing_string ();
+         }
+     }
+ 
+diff --git a/src/PYPDoublePinyinEditor.cc b/src/PYPDoublePinyinEditor.cc
+index 4ea039e..74fc648 100644
+--- a/src/PYPDoublePinyinEditor.cc
++++ b/src/PYPDoublePinyinEditor.cc
+@@ -23,9 +23,6 @@
+ #include "PYConfig.h"
+ #include "PYLibPinyin.h"
+ 
+-#define DEFINE_DOUBLE_PINYIN_TABLES
+-#include "PYDoublePinyinTable.h"
+-
+ using namespace PY;
+ 
+ /*
+@@ -36,11 +33,6 @@ using namespace PY;
+ #define ID(c) \
+     ((c >= IBUS_a && c <= IBUS_z) ? c - IBUS_a : (c == IBUS_semicolon ? 26 : -1))
+ 
+-#define ID_TO_SHENG(id) \
+-    (double_pinyin_map[m_config.doublePinyinSchema ()].sheng[id])
+-#define ID_TO_YUNS(id) \
+-    (double_pinyin_map[m_config.doublePinyinSchema ()].yun[id])
+-
+ #define IS_ALPHA(c) \
+         ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
+ 
+@@ -71,9 +63,11 @@ LibPinyinDoublePinyinEditor::insert (gint ch)
+         return FALSE;
+     }
+ 
++#if 0
+     if (G_UNLIKELY (m_text.empty () && ID_TO_SHENG (id) == PINYIN_ID_VOID)) {
+         return FALSE;
+     }
++#endif
+ 
+     m_text.insert (m_cursor++, ch);
+     updatePinyin ();
+@@ -130,23 +124,24 @@ LibPinyinDoublePinyinEditor::updateAuxiliaryText (void)
+ 
+     // guint pinyin_cursor = getPinyinCursor ();
+     PinyinKeyVector & pinyin_keys = m_instance->m_pinyin_keys;
+-    PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_poses;
++    PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_key_rests;
+     for (guint i = 0; i < pinyin_keys->len; ++i) {
+         PinyinKey *key = &g_array_index (pinyin_keys, PinyinKey, i);
+         PinyinKeyPos *pos = &g_array_index (pinyin_poses, PinyinKeyPos, i);
+-        guint cursor = pos->get_pos ();
++        guint cursor = pos->m_raw_begin;
+ 
+         if (G_UNLIKELY (cursor == m_cursor)) { /* at word boundary. */
+-            m_buffer << '|' << key->get_key_string ();
++            m_buffer << '|' << key->get_pinyin_string ();
+         } else if (G_LIKELY ( cursor < m_cursor &&
+-                              m_cursor < pos->get_end_pos() )) { /* in word */
++                              m_cursor < pos->m_raw_end )) { /* in word */
+             /* raw text */
+-            String raw = m_text.substr (cursor, pos->get_length ());
++            String raw = m_text.substr (cursor,
++                                        pos->m_raw_end - pos->m_raw_begin);
+             guint offset = m_cursor - cursor;
+             m_buffer << ' ' << raw.substr (0, offset)
+                      << '|' << raw.substr (offset);
+         } else { /* other words */
+-            m_buffer << ' ' << key->get_key_string ();
++            m_buffer << ' ' << key->get_pinyin_string ();
+         }
+     }
+ 
+diff --git a/src/PYPFullPinyinEditor.cc b/src/PYPFullPinyinEditor.cc
+index 9c019e3..3ef36b3 100644
+--- a/src/PYPFullPinyinEditor.cc
++++ b/src/PYPFullPinyinEditor.cc
+@@ -73,45 +73,12 @@ LibPinyinFullPinyinEditor::updatePinyin (void)
+     if (G_UNLIKELY (m_text.empty ())) {
+         m_pinyin_len = 0;
+         /* TODO: check whether to replace "" with NULL. */
+-        pinyin_parse_more_full_pinyins (m_instance, "");
++        pinyin_parse_more_full_pinyins (m_instance, NULL);
+         return;
+     }
+ 
+-    PinyinArray pinyins (MAX_PINYIN_LEN);
+-
+-    m_pinyin_len = PinyinParser::parse (m_text,               // text
+-                                        m_text.length (),     // text length
+-                                        m_config.option (),   // option
+-                                        pinyins,              // result
+-                                        MAX_PHRASE_LEN);      // max result length
+-
+-    /* propagate to libpinyin */
+-    g_array_set_size (m_instance->m_pinyin_keys, 0);
+-    g_array_set_size (m_instance->m_pinyin_poses, 0);
+-
+-    PinyinKey key; PinyinKeyPos pos;
+-    PinyinArray::const_iterator iter = pinyins.begin ();
+-    for ( ; iter != pinyins.end (); ++iter ) {
+-        PinyinSegment py = *iter;
+-        String pinyin = py.pinyin->sheng;
+-        gunichar yun_v = g_utf8_get_char("ΓΌ");
+-        gchar buf[7];
+-        for (const gchar * p = py.pinyin->yun; *p; p = g_utf8_next_char (p)){
+-            gunichar cur_yun = g_utf8_get_char (p);
+-            if (G_UNLIKELY(yun_v == cur_yun)) {
+-                pinyin += "v";
+-            } else {
+-                gint len = g_unichar_to_utf8 (cur_yun, buf);
+-                buf[len] = '\0';
+-                pinyin += buf;
+-            }
+-        }
+-        pinyin_parse_full_pinyin (m_instance, (const char *)pinyin, &key);
+-        pos.set_pos (py.begin); pos.set_length (py.len);
+-        g_array_append_val (m_instance->m_pinyin_keys, key);
+-        g_array_append_val (m_instance->m_pinyin_poses, pos);
+-    }
+-
++    m_pinyin_len =
++        pinyin_parse_more_full_pinyins (m_instance, m_text.c_str ());
+     pinyin_guess_sentence (m_instance);
+ }
+ 
+@@ -127,23 +94,24 @@ LibPinyinFullPinyinEditor::updateAuxiliaryText ()
+ 
+     // guint pinyin_cursor = getPinyinCursor ();
+     PinyinKeyVector & pinyin_keys = m_instance->m_pinyin_keys;
+-    PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_poses;
++    PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_key_rests;
+     for (guint i = 0; i < pinyin_keys->len; ++i) {
+         PinyinKey *key = &g_array_index (pinyin_keys, PinyinKey, i);
+         PinyinKeyPos *pos = &g_array_index (pinyin_poses, PinyinKeyPos, i);
+-        guint cursor = pos->get_pos ();
++        guint cursor = pos->m_raw_begin;
+ 
+         if (G_UNLIKELY (cursor == m_cursor)) { /* at word boundary. */
+-            m_buffer << '|' << key->get_key_string ();
++            m_buffer << '|' << key->get_pinyin_string ();
+         } else if (G_LIKELY ( cursor < m_cursor &&
+-                              m_cursor < pos->get_end_pos() )) { /* in word */
++                              m_cursor < pos->m_raw_end )) { /* in word */
+             /* raw text */
+-            String raw = m_text.substr (cursor, pos->get_length ());
++            String raw = m_text.substr (cursor,
++                                        pos->m_raw_end - pos->m_raw_begin);
+             guint offset = m_cursor - cursor;
+             m_buffer << ' ' << raw.substr (0, offset)
+                      << '|' << raw.substr (offset);
+         } else { /* other words */
+-            m_buffer << ' ' << key->get_key_string ();
++            m_buffer << ' ' << key->get_pinyin_string ();
+         }
+     }
+ 
+diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc
+index 32a30a2..82cdbf3 100644
+--- a/src/PYPPhoneticEditor.cc
++++ b/src/PYPPhoneticEditor.cc
+@@ -338,12 +338,12 @@ guint
+ LibPinyinPhoneticEditor::getPinyinCursor ()
+ {
+     /* Translate cursor position to pinyin position. */
+-    PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_poses;
++    PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_key_rests;
+     guint pinyin_cursor = pinyin_poses->len;
+     for (size_t i = 0; i < pinyin_poses->len; ++i) {
+         PinyinKeyPos *pos = &g_array_index
+             (pinyin_poses, PinyinKeyPos, i);
+-        if (pos->get_pos () <= m_cursor && m_cursor < pos->get_end_pos ())
++        if (pos->m_raw_begin <= m_cursor && m_cursor < pos->m_raw_end)
+             pinyin_cursor = i;
+     }
+ 
+@@ -381,7 +381,7 @@ LibPinyinPhoneticEditor::selectCandidate (guint i)
+     guint8 len = pinyin_choose_candidate (m_instance, lookup_cursor, *token);
+     pinyin_guess_sentence (m_instance);
+ 
+-    PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_poses;
++    PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_key_rests;
+     lookup_cursor += len;
+     if (lookup_cursor == pinyin_poses->len) {
+         commit();
+@@ -389,7 +389,7 @@ LibPinyinPhoneticEditor::selectCandidate (guint i)
+     }
+     PinyinKeyPos *pos = &g_array_index
+         (pinyin_poses, PinyinKeyPos, lookup_cursor);
+-    m_cursor = pos->get_pos();
++    m_cursor = pos->m_raw_begin;
+ 
+     return TRUE;
+ }
+@@ -491,18 +491,18 @@ LibPinyinPhoneticEditor::getCursorLeftByWord (void)
+     if (G_UNLIKELY (m_cursor > m_pinyin_len)) {
+         cursor = m_pinyin_len;
+     } else {
+-        PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_poses;
++        PinyinKeyPosVector & pinyin_poses = m_instance->m_pinyin_key_rests;
+         guint pinyin_cursor = getPinyinCursor ();
+         PinyinKeyPos *pos = &g_array_index
+             (pinyin_poses, PinyinKeyPos, pinyin_cursor);
+-        cursor = pos->m_pos;
++        cursor = pos->m_raw_begin;
+ 
+         /* cursor at the begin of one pinyin */
+         g_return_val_if_fail (pinyin_cursor > 0, 0);
+         if ( cursor == m_cursor) {
+             pos = &g_array_index
+                 (pinyin_poses, PinyinKeyPos, pinyin_cursor - 1);
+-            cursor = pos->m_pos;
++            cursor = pos->m_raw_begin;
+         }
+     }
+ 
+@@ -519,8 +519,8 @@ LibPinyinPhoneticEditor::getCursorRightByWord (void)
+     } else {
+         guint pinyin_cursor = getPinyinCursor ();
+         PinyinKeyPos *pos = &g_array_index
+-            (m_instance->m_pinyin_poses, PinyinKeyPos, pinyin_cursor);
+-        cursor = pos->get_end_pos ();
++            (m_instance->m_pinyin_key_rests, PinyinKeyPos, pinyin_cursor);
++        cursor = pos->m_raw_end;
+     }
+ 
+     return cursor;
+diff --git a/src/PYPPhoneticEditor.h b/src/PYPPhoneticEditor.h
+index 1360e58..92c19d7 100644
+--- a/src/PYPPhoneticEditor.h
++++ b/src/PYPPhoneticEditor.h
+@@ -24,7 +24,6 @@
+ #include <pinyin.h>
+ #include "PYLookupTable.h"
+ #include "PYEditor.h"
+-#include "PYPinyinParser.h"
+ 
+ 
+ namespace PY {
+diff --git a/src/PYPPinyinEditor.cc b/src/PYPPinyinEditor.cc
+index 7acf3a9..2391485 100644
+--- a/src/PYPPinyinEditor.cc
++++ b/src/PYPPinyinEditor.cc
+@@ -286,7 +286,7 @@ LibPinyinPinyinEditor::updateAuxiliaryText ()
+         if (G_LIKELY (i))
+             m_buffer << ' ';
+         PinyinKey *key = &g_array_index (pinyin_keys, PinyinKey, i);
+-        m_buffer << key->get_key_string ();
++        m_buffer << key->get_pinyin_string ();
+     }
+ 
+     /* append rest text */
+-- 
+1.7.7.4
+
+
+From 98118c2e9ef40e1ce33806a03d206a0e6027e65f Mon Sep 17 00:00:00 2001
+From: Peng Wu <alexepico at gmail.com>
+Date: Wed, 21 Dec 2011 12:53:51 +0800
+Subject: [PATCH 92/94] update bopomofo editor
+
+---
+ src/PYPBopomofoEditor.cc     |   43 ++++++++++++++++-------------------------
+ src/PYPBopomofoEditor.h      |    1 -
+ src/PYPDoublePinyinEditor.cc |    2 +-
+ src/PYPFullPinyinEditor.cc   |    2 +-
+ 4 files changed, 19 insertions(+), 29 deletions(-)
+
+diff --git a/src/PYPBopomofoEditor.cc b/src/PYPBopomofoEditor.cc
+index 63ec0b5..81ac541 100644
+--- a/src/PYPBopomofoEditor.cc
++++ b/src/PYPBopomofoEditor.cc
+@@ -26,10 +26,6 @@
+ #include "PYHalfFullConverter.h"
+ 
+ 
+-namespace PY {
+-#include "PYBopomofoKeyboard.h"
+-};
+-
+ using namespace PY;
+ 
+ const static gchar * bopomofo_select_keys[] = {
+@@ -174,7 +170,7 @@ LibPinyinBopomofoEditor::processBopomofo (guint keyval, guint keycode,
+     if (G_UNLIKELY (cmshm_filter (modifiers) != 0))
+         return m_text ? TRUE : FALSE;
+ 
+-    if (keyvalToBopomofo (keyval) == BOPOMOFO_ZERO)
++    if (!(pinyin_in_chewing_keyboard (m_instance, keyval, NULL)))
+         return FALSE;
+ 
+     m_select_mode = FALSE;
+@@ -250,20 +246,6 @@ LibPinyinBopomofoEditor::updatePinyin (void)
+     pinyin_guess_sentence (m_instance);
+ }
+ 
+-gint
+-LibPinyinBopomofoEditor::keyvalToBopomofo(gint ch)
+-{
+-    const gint keyboard = m_config.bopomofoKeyboardMapping ();    
+-    gint len = G_N_ELEMENTS (bopomofo_keyboard[keyboard]);
+-
+-    for ( gint i = 0; i < len; ++i ) {
+-        if ( bopomofo_keyboard[keyboard][i][0] == ch )
+-            return bopomofo_keyboard[keyboard][i][1];
+-    }
+-
+-    return BOPOMOFO_ZERO;
+-}
+-
+ void
+ LibPinyinBopomofoEditor::commit ()
+ {
+@@ -285,15 +267,17 @@ LibPinyinBopomofoEditor::commit ()
+     /* text after pinyin */
+     const gchar *p = m_text.c_str() + m_pinyin_len;
+     while (*p != '\0') {
+-        if (keyvalToBopomofo (*p)) {
+-            m_buffer << keyvalToBopomofo (*p);
++        const char * symbol = NULL;
++        if (pinyin_in_chewing_keyboard(m_instance, *p, &symbol)) {
++            m_buffer << symbol;
+         } else {
+             if (G_UNLIKELY (m_props.modeFull ())) {
+-                m_buffer.appendUnichar (HalfFullConverter::toFull (*p++));
++                m_buffer.appendUnichar (HalfFullConverter::toFull (*p));
+             } else {
+-                m_buffer << p;
++                m_buffer << *p;
+             }
+         }
++        ++p;
+     }
+ 
+     pinyin_train(m_instance);
+@@ -360,18 +344,25 @@ LibPinyinBopomofoEditor::updateAuxiliaryText (void)
+                               m_cursor < pos->m_raw_end )) { /* in word */
+             /* raw text */
+             String raw = m_text.substr (cursor,
+-                                        pos->m_raw_end - pos->m_raw_begin);
++                                        pos->length ());
+             guint offset = m_cursor - cursor;
+             m_buffer << ' ';
+             String before = raw.substr (0, offset);
+             String after = raw.substr (offset);
+             String::const_iterator iter;
++            const char * symbol = NULL;
+             for ( iter = before.begin (); iter != before.end (); ++iter) {
+-                m_buffer << bopomofo_char[keyvalToBopomofo (*iter)];
++                if ( pinyin_in_chewing_keyboard(m_instance, *iter, &symbol))
++                    m_buffer << symbol;
++                else
++                    m_buffer << *iter;
+             }
+             m_buffer << '|';
+             for ( iter = after.begin (); iter != after.end (); ++iter) {
+-                m_buffer << bopomofo_char[keyvalToBopomofo (*iter)];
++                if ( pinyin_in_chewing_keyboard(m_instance, *iter, &symbol))
++                    m_buffer << symbol;
++                else
++                    m_buffer << *iter;
+             }
+         } else { /* other words */
+             m_buffer << ' ' << key->get_chewing_string ();
+diff --git a/src/PYPBopomofoEditor.h b/src/PYPBopomofoEditor.h
+index 1df1731..c86de9a 100644
+--- a/src/PYPBopomofoEditor.h
++++ b/src/PYPBopomofoEditor.h
+@@ -55,7 +55,6 @@ protected:
+     void reset ();
+ 
+     gboolean insert (gint ch);
+-    gint keyvalToBopomofo (gint ch);
+ 
+ };
+ 
+diff --git a/src/PYPDoublePinyinEditor.cc b/src/PYPDoublePinyinEditor.cc
+index 74fc648..fff791e 100644
+--- a/src/PYPDoublePinyinEditor.cc
++++ b/src/PYPDoublePinyinEditor.cc
+@@ -136,7 +136,7 @@ LibPinyinDoublePinyinEditor::updateAuxiliaryText (void)
+                               m_cursor < pos->m_raw_end )) { /* in word */
+             /* raw text */
+             String raw = m_text.substr (cursor,
+-                                        pos->m_raw_end - pos->m_raw_begin);
++                                        pos->length ());
+             guint offset = m_cursor - cursor;
+             m_buffer << ' ' << raw.substr (0, offset)
+                      << '|' << raw.substr (offset);
+diff --git a/src/PYPFullPinyinEditor.cc b/src/PYPFullPinyinEditor.cc
+index 3ef36b3..2111143 100644
+--- a/src/PYPFullPinyinEditor.cc
++++ b/src/PYPFullPinyinEditor.cc
+@@ -106,7 +106,7 @@ LibPinyinFullPinyinEditor::updateAuxiliaryText ()
+                               m_cursor < pos->m_raw_end )) { /* in word */
+             /* raw text */
+             String raw = m_text.substr (cursor,
+-                                        pos->m_raw_end - pos->m_raw_begin);
++                                        pos->length ());
+             guint offset = m_cursor - cursor;
+             m_buffer << ' ' << raw.substr (0, offset)
+                      << '|' << raw.substr (offset);
+-- 
+1.7.7.4
+
+
+From 163b21e23f0621e6cfaf424b914aa33bda891294 Mon Sep 17 00:00:00 2001
+From: Peng Wu <alexepico at gmail.com>
+Date: Thu, 22 Dec 2011 10:54:11 +0800
+Subject: [PATCH 93/94] switch to LibPinyin*Config
+
+---
+ src/PYLibPinyin.cc       |    4 ++--
+ src/PYMain.cc            |    4 ++++
+ src/PYPBopomofoEngine.cc |    9 +++++----
+ src/PYPPinyinEngine.cc   |   33 +++++++++++++++++----------------
+ 4 files changed, 28 insertions(+), 22 deletions(-)
+
+diff --git a/src/PYLibPinyin.cc b/src/PYLibPinyin.cc
+index fea2f25..b0e09ea 100644
+--- a/src/PYLibPinyin.cc
++++ b/src/PYLibPinyin.cc
+@@ -64,7 +64,7 @@ LibPinyinBackEnd::allocPinyinInstance ()
+             g_free(userdir); userdir = NULL;
+         }
+         m_pinyin_context = pinyin_init ("/usr/share/libpinyin/data", userdir);
+-        setPinyinOptions (&PinyinConfig::instance ());
++        setPinyinOptions (&LibPinyinPinyinConfig::instance ());
+         g_free(userdir);
+     }
+     return pinyin_alloc_instance (m_pinyin_context);
+@@ -87,7 +87,7 @@ LibPinyinBackEnd::allocChewingInstance ()
+             g_free(userdir); userdir = NULL;
+         }
+         m_chewing_context = pinyin_init ("/usr/share/libpinyin/data", NULL);
+-        setChewingOptions (&BopomofoConfig::instance ());
++        setChewingOptions (&LibPinyinBopomofoConfig::instance ());
+         g_free(userdir);
+     }
+     return pinyin_alloc_instance (m_chewing_context);
+diff --git a/src/PYMain.cc b/src/PYMain.cc
+index 49fd7ec..33e1831 100644
+--- a/src/PYMain.cc
++++ b/src/PYMain.cc
+@@ -29,6 +29,7 @@
+ #include "PYPointer.h"
+ #include "PYBus.h"
+ #include "PYConfig.h"
++#include "PYPConfig.h"
+ #include "PYDatabase.h"
+ #ifdef IBUS_BUILD_LIBPINYIN
+ #include "PYLibPinyin.h"
+@@ -94,6 +95,9 @@ start_component (void)
+ #endif
+     PinyinConfig::init (bus);
+     BopomofoConfig::init (bus);
++    LibPinyinPinyinConfig::init (bus);
++    LibPinyinBopomofoConfig::init (bus);
++
+ 
+     g_signal_connect ((IBusBus *)bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NULL);
+ 
+diff --git a/src/PYPBopomofoEngine.cc b/src/PYPBopomofoEngine.cc
+index a8ff6fc..96b218d 100644
+--- a/src/PYPBopomofoEngine.cc
++++ b/src/PYPBopomofoEngine.cc
+@@ -26,22 +26,23 @@
+ #include "PYPBopomofoEditor.h"
+ #include "PYFallbackEditor.h"
+ #include "PYConfig.h"
++#include "PYPConfig.h"
+ 
+ using namespace PY;
+ 
+ /* constructor */
+ LibPinyinBopomofoEngine::LibPinyinBopomofoEngine (IBusEngine *engine)
+     : Engine (engine),
+-      m_props (BopomofoConfig::instance ()),
++      m_props (LibPinyinBopomofoConfig::instance ()),
+       m_prev_pressed_key (IBUS_VoidSymbol),
+       m_input_mode (MODE_INIT),
+-      m_fallback_editor (new FallbackEditor (m_props, BopomofoConfig::instance()))
++      m_fallback_editor (new FallbackEditor (m_props, LibPinyinBopomofoConfig::instance()))
+ {
+     gint i;
+ 
+     /* create editors */
+-    m_editors[MODE_INIT].reset (new LibPinyinBopomofoEditor (m_props, BopomofoConfig::instance ()));
+-    m_editors[MODE_PUNCT].reset (new PunctEditor (m_props, BopomofoConfig::instance ()));
++    m_editors[MODE_INIT].reset (new LibPinyinBopomofoEditor (m_props, LibPinyinBopomofoConfig::instance ()));
++    m_editors[MODE_PUNCT].reset (new PunctEditor (m_props, LibPinyinBopomofoConfig::instance ()));
+ 
+     m_props.signalUpdateProperty ().connect
+         (std::bind (&LibPinyinBopomofoEngine::updateProperty, this, _1));
+diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc
+index 4aae9a9..2526d30 100644
+--- a/src/PYPPinyinEngine.cc
++++ b/src/PYPPinyinEngine.cc
+@@ -22,6 +22,7 @@
+ #include "PYPPinyinEngine.h"
+ #include <string>
+ #include "PYConfig.h"
++#include "PYPConfig.h"
+ #include "PYPunctEditor.h"
+ #include "PYRawEditor.h"
+ #ifdef IBUS_BUILD_LUA_EXTENSION
+@@ -39,36 +40,36 @@ using namespace PY;
+ /* constructor */
+ LibPinyinPinyinEngine::LibPinyinPinyinEngine (IBusEngine *engine)
+     : Engine (engine),
+-      m_props (PinyinConfig::instance ()),
++      m_props (LibPinyinPinyinConfig::instance ()),
+       m_prev_pressed_key (IBUS_VoidSymbol),
+       m_input_mode (MODE_INIT),
+-      m_fallback_editor (new FallbackEditor (m_props, PinyinConfig::instance ()))
++      m_fallback_editor (new FallbackEditor (m_props, LibPinyinPinyinConfig::instance ()))
+ {
+     gint i;
+ 
+-    m_double_pinyin = PinyinConfig::instance ().doublePinyin ();
++    m_double_pinyin = LibPinyinPinyinConfig::instance ().doublePinyin ();
+ 
+     if (m_double_pinyin)
+         m_editors[MODE_INIT].reset
+-            (new LibPinyinDoublePinyinEditor (m_props, PinyinConfig::instance ()));
++            (new LibPinyinDoublePinyinEditor (m_props, LibPinyinPinyinConfig::instance ()));
+     else
+         m_editors[MODE_INIT].reset
+-            (new LibPinyinFullPinyinEditor (m_props, PinyinConfig::instance ()));
++            (new LibPinyinFullPinyinEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ 
+     m_editors[MODE_PUNCT].reset
+-        (new PunctEditor (m_props, PinyinConfig::instance ()));
++        (new PunctEditor (m_props, LibPinyinPinyinConfig::instance ()));
+     m_editors[MODE_RAW].reset
+-        (new RawEditor (m_props, PinyinConfig::instance ()));
++        (new RawEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ 
+ #ifdef IBUS_BUILD_LUA_EXTENSION
+-    m_editors[MODE_EXTENSION].reset (new ExtEditor (m_props, PinyinConfig::instance ()));
++    m_editors[MODE_EXTENSION].reset (new ExtEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ #else
+-    m_editors[MODE_EXTENSION].reset (new Editor (m_props, PinyinConfig::instance ()));
++    m_editors[MODE_EXTENSION].reset (new Editor (m_props, LibPinyinPinyinConfig::instance ()));
+ #endif
+ #ifdef IBUS_BUILD_ENGLISH_INPUT_MODE
+-    m_editors[MODE_ENGLISH].reset (new EnglishEditor (m_props, PinyinConfig::instance ()));
++    m_editors[MODE_ENGLISH].reset (new EnglishEditor (m_props, LibPinyinPinyinConfig::instance ()));
+ #else
+-    m_editors[MODE_ENGLISH].reset (new Editor (m_props, PinyinConfig::instance ()));
++    m_editors[MODE_ENGLISH].reset (new Editor (m_props, LibPinyinPinyinConfig::instance ()));
+ #endif
+ 
+     m_props.signalUpdateProperty ().connect
+@@ -135,7 +136,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 (PinyinConfig::instance ().doublePinyin ())
++                    if (LibPinyinPinyinConfig::instance ().doublePinyin ())
+                         break;
+                     m_input_mode = MODE_EXTENSION;
+                     break;
+@@ -143,7 +144,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 (PinyinConfig::instance ().doublePinyin ())
++                    if (LibPinyinPinyinConfig::instance ().doublePinyin ())
+                         break;
+                     m_input_mode = MODE_ENGLISH;
+                     break;
+@@ -174,16 +175,16 @@ LibPinyinPinyinEngine::focusIn (void)
+ {
+     /* TODO: check memory leak here,
+      *       or switch full/double pinyin when pinyin config is changed.*/
+-    if (PinyinConfig::instance ().doublePinyin ()) {
++    if (LibPinyinPinyinConfig::instance ().doublePinyin ()) {
+         if (!m_double_pinyin) {
+-            m_editors[MODE_INIT].reset (new LibPinyinDoublePinyinEditor (m_props, PinyinConfig::instance ()));
++            m_editors[MODE_INIT].reset (new LibPinyinDoublePinyinEditor (m_props, LibPinyinPinyinConfig::instance ()));
+             connectEditorSignals (m_editors[MODE_INIT]);
+         }
+         m_double_pinyin = TRUE;
+     }
+     else {
+         if (m_double_pinyin) {
+-            m_editors[MODE_INIT].reset (new LibPinyinFullPinyinEditor (m_props, PinyinConfig::instance ()));
++            m_editors[MODE_INIT].reset (new LibPinyinFullPinyinEditor (m_props, LibPinyinPinyinConfig::instance ()));
+             connectEditorSignals (m_editors[MODE_INIT]);
+         }
+         m_double_pinyin = FALSE;
+-- 
+1.7.7.4
+
+
+From 9d175347f6bbe6b1655c34fee71fb7aad3b24e31 Mon Sep 17 00:00:00 2001
+From: Peng Wu <alexepico at gmail.com>
+Date: Tue, 27 Dec 2011 10:47:15 +0800
+Subject: [PATCH 94/94] fixes PYConfig
+
+---
+ src/PYConfig.cc  |    9 ---------
+ src/PYPConfig.cc |    4 +---
+ 2 files changed, 1 insertions(+), 12 deletions(-)
+
+diff --git a/src/PYConfig.cc b/src/PYConfig.cc
+index 47a7a7e..6241647 100644
+--- a/src/PYConfig.cc
++++ b/src/PYConfig.cc
+@@ -23,9 +23,6 @@
+ #include "PYTypes.h"
+ #include "PYBus.h"
+ #include "PYDoublePinyinTable.h"
+-#ifdef IBUS_BUILD_LIBPINYIN
+-#include "PYLibPinyin.h"
+-#endif
+ 
+ namespace PY {
+ 
+@@ -341,12 +338,6 @@ Config::valueChangedCallback (IBusConfig  *config,
+     self->valueChanged (section, name, value);
+     if (self->m_section != section)
+         return;
+-#ifdef IBUS_BUILD_LIBPINYIN
+-    if (self->m_section == "engine/Pinyin")
+-        LibPinyinBackEnd::instance ().setPinyinOptions (self);
+-    if (self->m_section == "engine/Bopomofo")
+-        LibPinyinBackEnd::instance ().setChewingOptions (self);
+-#endif
+ }
+ 
+ static const struct {
+diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
+index da3d770..43bedd6 100644
+--- a/src/PYPConfig.cc
++++ b/src/PYPConfig.cc
+@@ -20,11 +20,9 @@
+  */
+ #include "PYPConfig.h"
+ 
+-#include "PYBus.h"
+-#ifdef IBUS_BUILD_LIBPINYIN
+ #include <pinyin.h>
++#include "PYBus.h"
+ #include "PYLibPinyin.h"
+-#endif
+ 
+ namespace PY {
+ 
+-- 
+1.7.7.4
 
diff --git a/ibus-pinyin.spec b/ibus-pinyin.spec
index dd1f86b..335cc07 100644
--- a/ibus-pinyin.spec
+++ b/ibus-pinyin.spec
@@ -1,6 +1,6 @@
 Name:       ibus-pinyin
-Version:    1.3.99.20110706
-Release:    13%{?dist}
+Version:    1.4.0
+Release:    1%{?dist}
 Summary:    The Chinese Pinyin and Bopomofo engines for IBus input platform
 License:    GPLv2+
 Group:      System Environment/Libraries
@@ -117,6 +117,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/ibus-pinyin/db/android.db
 
 %changelog
+* Tue Dec 27 2011  Peng Wu <pwu at redhat.com> - 1.4.0-1
+- Update to 1.4.0, and refresh ibus-pinyin-libpinyin-integration.patch
+
 * Wed Nov 30 2011  Peng Wu <pwu at redhat.com> - 1.3.99.20110706-13
 - Change i386 to i686
 
diff --git a/sources b/sources
index 3bdb332..e4bdb3b 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-0d9d5d78106c2d36c28a00b74aa9a6c3  ibus-pinyin-1.3.99.20110706.tar.gz
+2cef66bef079969689a7e0fdb7b7f767  ibus-pinyin-1.4.0.tar.gz
 d0951b8daa7f56a2cbd3b6b4e42532e0  pinyin-database-1.2.99.tar.bz2


More information about the scm-commits mailing list