Modified to decide whether to display candidate window according to layout style tizen_2.1 2.1b_release accepted/tizen_2.1/20130425.024921 submit/tizen_2.1/20130424.234148
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 4 Apr 2013 14:37:13 +0000 (23:37 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 4 Apr 2013 14:37:13 +0000 (23:37 +0900)
Change-Id: Ifa06042e08d90919eda51eaf55527f89415c14e5

configure.ac
packaging/ise-engine-tables.spec
src/Makefile.am
src/scim_table_imengine.cpp
src/scim_table_imengine.h

index da22427..dca0000 100755 (executable)
@@ -35,6 +35,8 @@ AC_TYPE_SIZE_T
 
 # Check SCIM 
 PKG_CHECK_MODULES(SCIM,[isf >= $ISF_VERSION])
+# Check Ecore
+PKG_CHECK_MODULES(ECORE,[ecore >= 0.0])
 
 # Check if we should build setup module
 PKG_CHECK_MODULES(SCIM_GTKUTILS,[scim-gtkutils >= $SCIM_VERSION],
index f987d87..8ebe547 100644 (file)
@@ -21,6 +21,7 @@ BuildRequires:  prelink
 BuildRequires:  gettext-tools
 Requires:      isf >= %{isf_version}
 BuildRequires: isf-devel >= %{isf_version}
+BuildRequires:  pkgconfig(ecore)
 
 %if %{build_scim_setup}
 Requires:      gtk2 >= 2.0.0
index a6c7f68..c63033a 100755 (executable)
@@ -43,15 +43,16 @@ module_LTLIBRARIES  = table.la
 
 table_la_SOURCES       = scim_table_imengine.cpp
 
-table_la_CFLAGS                = @SCIM_CFLAGS@
-table_la_CXXFLAGS      = @SCIM_CFLAGS@
+table_la_CFLAGS                = @SCIM_CFLAGS@ @ECORE_CFLAGS@
+table_la_CXXFLAGS      = @SCIM_CFLAGS@ @ECORE_CFLAGS@
 
 table_la_LDFLAGS       = -avoid-version \
                          -rpath $(moduledir) \
                          -module \
                          @LIBTOOL_EXPORT_OPTIONS@ \
                          @LTLIBINTL@ \
-                         @SCIM_LIBS@ 
+                         @SCIM_LIBS@ \
+                         @ECORE_LIBS@
 
 table_la_LIBADD                = libgentable.la
 
index fa4bd8c..c54424a 100755 (executable)
@@ -52,6 +52,9 @@
 #include <unistd.h>
 #include <scim.h>
 #include <set>
+
+#include <Ecore_IMF.h>
+
 #include "scim_table_imengine.h"
 #include "scim_table_private.h"
 
@@ -784,7 +787,11 @@ TableInstance::reset ()
     m_inputing_key = 0;
 
     m_iconv.set_encoding (get_encoding ());
-    refresh_lookup_table (true, false);
+    if (m_lookup_table_always_on) {
+        refresh_lookup_table (true, false);
+    } else {
+        hide_lookup_table();
+    }
     hide_preedit_string ();
     hide_aux_string ();
 }
@@ -799,7 +806,7 @@ TableInstance::focus_in ()
         m_add_phrase_mode = 0;
     }
 
-    refresh_lookup_table (true, false);
+    //refresh_lookup_table (true, false);
     refresh_preedit ();
     refresh_aux_string ();
     initialize_properties ();
@@ -832,6 +839,28 @@ TableInstance::trigger_property (const String &property)
 }
  
 void
+TableInstance::set_layout (unsigned int layout)
+{
+    switch (layout)
+    {
+        case ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL:
+        case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER:
+        case ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL:
+        case ECORE_IMF_INPUT_PANEL_LAYOUT_URL:
+            refresh_lookup_table (true, false);
+            m_lookup_table_always_on = true;
+            break;
+        case ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER:
+        case ECORE_IMF_INPUT_PANEL_LAYOUT_IP:
+        case ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH:
+        case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY:
+            hide_lookup_table ();
+            m_lookup_table_always_on = false;
+            break;
+    }
+}
+
+void
 TableInstance::initialize_properties ()
 {
     PropertyList proplist;
index b251321..8d0fbda 100755 (executable)
@@ -123,6 +123,8 @@ class TableInstance : public IMEngineInstanceBase
     bool m_forward;
     bool m_focused;
 
+    bool m_lookup_table_always_on;
+
     std::vector<String>     m_inputted_keys;
     std::vector<WideString> m_converted_strings;
     std::vector<uint32>     m_converted_indexes;
@@ -164,6 +166,11 @@ public:
     virtual void focus_out ();
     virtual void trigger_property (const String &property);
 
+    /**
+     * decide whether to display candidate window according to layout
+     */
+    virtual void set_layout (unsigned int layout);
+
 private:
     bool caret_left ();
     bool caret_right ();