Modified to decide whether to display candidate window according to layout style tizen_2.1 2.1b_release accepted/tizen/20130520.101416 accepted/tizen/20130912.092216 accepted/tizen/20130912.095835 accepted/tizen/20130912.101306 accepted/tizen/20130912.144356 accepted/tizen/20130912.191853 accepted/tizen/20130912.195951 accepted/tizen_2.1/20130425.024742 submit/tizen/20130517.045352 submit/tizen/20130912.075910 submit/tizen/20130912.090220 submit/tizen_2.1/20130424.234136
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 4 Apr 2013 14:37:52 +0000 (23:37 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 4 Apr 2013 14:37:52 +0000 (23:37 +0900)
Change-Id: I1f08a3f1b71d39cee868ab7628b1da6287a97057

configure.ac
packaging/sunpinyin.spec
wrapper/scim/src/Makefile.am
wrapper/scim/src/sunpinyin_imengine.cpp
wrapper/scim/src/sunpinyin_imengine.h

index 77017c4..d7304f2 100755 (executable)
@@ -51,6 +51,7 @@ ISF_VERSION=1.0.0
 PKG_CHECK_MODULES(ISF,[isf >= $ISF_VERSION])
 PKG_CHECK_MODULES(SQLITE, [sqlite3 >= 0.0])
 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.0])
+PKG_CHECK_MODULES(ECORE, [ecore >= 0.0])
 
 # Check if we should build setup module
 PKG_CHECK_MODULES(ISF_GTKUTILS,[isf-gtkutils >= $ISF_VERSION],
index 8cfbdd5..b8f6465 100755 (executable)
@@ -10,6 +10,7 @@ BuildRequires:  gettext-tools
 BuildRequires:  pkgconfig(isf)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(sqlite3)
+BuildRequires:  pkgconfig(ecore)
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
index 5c295a1..c14cec3 100755 (executable)
@@ -30,7 +30,6 @@ noinst_HEADERS        = imi_scimwin.h\
                        sunpinyin_utils.h
 
 
-############### ise-engine-xt9.la ###################
 moduledir = @SUNPINYIN_MODULE_DIR@/IMEngine
 module_LTLIBRARIES = ise-engine-sunpinyin.la
 
@@ -39,12 +38,13 @@ ise_engine_sunpinyin_la_SOURCES =imi_scimwin.cpp\
                                   sunpinyin_lookup_table.cpp\
                                   sunpinyin_utils.cpp
 
-ise_engine_sunpinyin_la_CXXFLAGS = @ISF_CFLAGS@ ${ise_engine_sunpinyin_DEFINES}
+ise_engine_sunpinyin_la_CXXFLAGS = @ISF_CFLAGS@ @ECORE_CFLAGS@ ${ise_engine_sunpinyin_DEFINES}
 
 ise_engine_sunpinyin_la_LDFLAGS = -avoid-version \
                                        -module \
                                        -export-dynamic\
                                        @ISF_LIBS@\
+                                       @ECORE_LIBS@\
                                         -lstdc++
 
 ise_engine_sunpinyin_la_LIBADD = $(top_builddir)/src/libsunpinyin.la
index aa40557..1fec43b 100644 (file)
@@ -61,6 +61,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include <Ecore_IMF.h>
+
 #include <imi_options.h>
 #include <imi_view.h>
 #include <ic_history.h>
@@ -395,7 +397,11 @@ SunPyInstance::reset ()
     //hide_aux_string ();
     //m_pv->updateWindows(m_pv->clearIC());
     //refresh_all_properties ();
-    show_lookup_table ();
+    if (m_lookup_table_always_on) {
+        show_lookup_table ();
+    } else {
+        hide_lookup_table ();
+    }
     m_pv->updateWindows(CIMIView::PREEDIT_MASK | CIMIView::CANDIDATE_MASK);
 }
 
@@ -404,7 +410,7 @@ SunPyInstance::focus_in ()
 {
     SCIM_DEBUG_IMENGINE(3) << get_id() << ": focus_in ()\n";
     m_focused = true;
-    show_lookup_table ();
+    //show_lookup_table ();
     initialize_all_properties ();
     
     hide_preedit_string ();
@@ -448,6 +454,27 @@ SunPyInstance::trigger_property (const String &property)
     }
 }
 
+void
+SunPyInstance::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:
+            show_lookup_table ();
+            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
 SunPyInstance::init_lookup_table_labels ()
index 9024a53..299e425 100755 (executable)
@@ -89,6 +89,7 @@ class SunPyInstance : public IMEngineInstanceBase
     CommonLookupTable   *m_common_lookup_table;
     Connection           m_reload_signal_connection;
     bool                 m_focused;
+    bool                 m_lookup_table_always_on;
     
   public:
     SunPyInstance(SunPyFactory *factory,
@@ -119,6 +120,10 @@ class SunPyInstance : public IMEngineInstanceBase
      * update the configuration of the input method
      */
     virtual void trigger_property (const String &property);
+    /**
+     * decide whether to display candidate window according to layout
+     */
+    virtual void set_layout (unsigned int layout);
 
 public:
     /**