add Simple telex input method
authorMr.LeQuocTuan <Mr.LeQuocTuan@79bd180b-0a32-48ee-ac55-ada8cae9df61>
Thu, 18 Jun 2009 08:08:13 +0000 (08:08 +0000)
committerMr.LeQuocTuan <Mr.LeQuocTuan@79bd180b-0a32-48ee-ac55-ada8cae9df61>
Thu, 18 Jun 2009 08:08:13 +0000 (08:08 +0000)
git-svn-id: svn://localhost/trunk@6 79bd180b-0a32-48ee-ac55-ada8cae9df61

src/scim_unikey_imengine.cpp
ukengine/diff/inputproc.cpp.diff
ukengine/diff/unikey.cpp.diff
ukengine/inputproc.cpp
ukengine/unikey.cpp

index 378532ea637978a62a4125022d32e2b7ca49ad4e..186050973f017b7e7c4e0b42fbeb17c4aa70ea22 100644 (file)
@@ -47,13 +47,19 @@ static unsigned char WordAutoCommit[] =
        'P', 'Q', 'R', 'S', 'T', 'V', 'X', 'Z'
 };
 
-const String          Unikey_IMNames[]    = {"Telex", "Vni", "Viqr"};
-const UkInputMethod   Unikey_IM[]         = {UkTelex, UkVni, UkViqr};
-const unsigned int    NUM_INPUTMETHOD     = sizeof(Unikey_IMNames)/sizeof(Unikey_IMNames[0]);
-
-const String          Unikey_OCNames[]    = {"Unicode",           "TCVN3",            "VNI Win",              "VIQR"};
-const unsigned int    Unikey_OC[]         = {CONV_CHARSET_XUTF8,  CONV_CHARSET_TCVN3, CONV_CHARSET_VNIWIN,    CONV_CHARSET_VIQR};
-const unsigned int    NUM_OUTPUTCHARSET   = sizeof(Unikey_OCNames)/sizeof(Unikey_OCNames[0]);
+const String          Unikey_IMNames[]    = {"Telex", "Vni", "STelex"};
+const UkInputMethod   Unikey_IM[]         = {UkTelex, UkVni, UkSimpleTelex};
+const unsigned int    NUM_INPUTMETHOD     = sizeof(Unikey_IM)/sizeof(Unikey_IM[0]);
+
+const String          Unikey_OCNames[]    = {"Unicode",
+                                             "TCVN3",
+                                             "VNI Win",
+                                             "VIQR"};
+const unsigned int    Unikey_OC[]         = {CONV_CHARSET_XUTF8,
+                                             CONV_CHARSET_TCVN3,
+                                             CONV_CHARSET_VNIWIN,
+                                             CONV_CHARSET_VIQR};
+const unsigned int    NUM_OUTPUTCHARSET   = sizeof(Unikey_OC)/sizeof(Unikey_OC[0]);
 
 ConfigPointer   __config;
 
@@ -779,9 +785,9 @@ void UnikeyInstance::trigger_property(const String &property)
        if (!property.compare(0, strlen("/Unikey/InputMethod/"), "/Unikey/InputMethod/"))
        {
                for (i=0; i<NUM_INPUTMETHOD; i++)
-                       if (!property.compare(property.length()-Unikey_IMNames[i].length(),
-                                                                Unikey_IMNames[i].length(),
-                                                                Unikey_IMNames[i]))
+                       if (!property.compare(strlen("/Unikey/InputMethod/"),
+                                  property.length() - strlen("/Unikey/InputMethod/"),
+                                  Unikey_IMNames[i]))
                        {
                                m_im = i;
                                __config->write(SCIM_IMENGINE_UNIKEY_INPUTMETHOD, m_im);
@@ -794,8 +800,8 @@ void UnikeyInstance::trigger_property(const String &property)
        else if (!property.compare(0, strlen("/Unikey/OutputCharset/"), "/Unikey/OutputCharset/"))
        {
                for (i=0; i<NUM_OUTPUTCHARSET; i++)
-                       if (!property.compare(property.length()-Unikey_OCNames[i].length(),
-                                                                 Unikey_OCNames[i].length(),
+                       if (!property.compare(strlen("/Unikey/OutputCharset/"),
+                                                                 property.length() - strlen("/Unikey/OutputCharset/"),
                                                                  Unikey_OCNames[i]))
                        {
                                m_oc = i;
index 8c44a24c4d3f78e0c1664ab90de058ef7afd7f6c..9625e7ab42fa01e7f20bb289889cdc1629066f34 100644 (file)
@@ -1,5 +1,5 @@
 --- orginal/inputproc.cpp      2009-04-14 00:16:33.000000000 +0700
-+++ inputproc.cpp      2009-06-12 10:42:12.000000000 +0700
++++ inputproc.cpp      2009-06-18 14:39:10.000000000 +0700
 @@ -20,7 +20,7 @@
   * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   * Boston, MA 02111-1307, USA.
@@ -9,3 +9,13 @@
  #include <iostream>
  #include "inputproc.h"
  
+@@ -264,6 +264,9 @@
+         case UkTelex:
+             useBuiltIn(TelexMethodMapping);
+             break;
++        case UkSimpleTelex:
++            useBuiltIn(SimpleTelexMethodMapping);
++            break;
+         case UkVni:
+             useBuiltIn(VniMethodMapping);
+             break;
index 5e660a45be7e7a60b666f5809da96b2516e86d46..78da419488553c37db9e353ce5eac26fa8f36d8e 100644 (file)
@@ -1,5 +1,14 @@
 --- orginal/unikey.cpp 2009-04-14 01:13:02.000000000 +0700
-+++ unikey.cpp 2009-06-12 10:45:31.000000000 +0700
++++ unikey.cpp 2009-06-18 14:32:08.000000000 +0700
+@@ -48,7 +48,7 @@
+ //--------------------------------------------
+ void UnikeySetInputMethod(UkInputMethod im)
+ {
+-  if (im == UkTelex || im == UkVni || im == UkViqr) {
++  if (im == UkTelex || im == UkVni || im == UkSimpleTelex) {
+     pShMem->input.setIM(im);
+     MyKbEngine.reset();
+   }
 @@ -196,3 +196,13 @@
      UnikeyBufChars = sizeof(UnikeyBuf);
      MyKbEngine.restoreKeyStrokes(UnikeyBackspaces, UnikeyBuf, UnikeyBufChars, UnikeyOutput);
index 1dd7c4b1117868a16b2daa2a46bfff197a53883c..a12e31beb7b9715890db82a974c0933274274716 100644 (file)
@@ -264,6 +264,9 @@ int UkInputProcessor::setIM(UkInputMethod im)
         case UkTelex:
             useBuiltIn(TelexMethodMapping);
             break;
+        case UkSimpleTelex:
+            useBuiltIn(SimpleTelexMethodMapping);
+            break;
         case UkVni:
             useBuiltIn(VniMethodMapping);
             break;
index 9251044e56cb9667aa2cd3a40f2acc5c91a96e99..9f8f20046cab63894fd0403bcad56caae8325115 100644 (file)
@@ -48,7 +48,7 @@ UkOutputType UnikeyOutput;
 //--------------------------------------------
 void UnikeySetInputMethod(UkInputMethod im)
 {
-  if (im == UkTelex || im == UkVni || im == UkViqr) {
+  if (im == UkTelex || im == UkVni || im == UkSimpleTelex) {
     pShMem->input.setIM(im);
     MyKbEngine.reset();
   }