From: Ji-hoon Lee Date: Thu, 4 Apr 2013 14:37:13 +0000 (+0900) Subject: Modified to decide whether to display candidate window according to layout style X-Git-Tag: submit/tizen_2.1/20130424.234148^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0eb3a826562ef20c84f69ecbf23c60aae0c4c38d;p=platform%2Fcore%2Fuifw%2Fise-engine-tables.git Modified to decide whether to display candidate window according to layout style Change-Id: Ifa06042e08d90919eda51eaf55527f89415c14e5 --- diff --git a/configure.ac b/configure.ac index da22427..dca0000 100755 --- a/configure.ac +++ b/configure.ac @@ -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], diff --git a/packaging/ise-engine-tables.spec b/packaging/ise-engine-tables.spec index f987d87..8ebe547 100644 --- a/packaging/ise-engine-tables.spec +++ b/packaging/ise-engine-tables.spec @@ -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 diff --git a/src/Makefile.am b/src/Makefile.am index a6c7f68..c63033a 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/scim_table_imengine.cpp b/src/scim_table_imengine.cpp index fa4bd8c..c54424a 100755 --- a/src/scim_table_imengine.cpp +++ b/src/scim_table_imengine.cpp @@ -52,6 +52,9 @@ #include #include #include + +#include + #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 (); @@ -831,6 +838,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 () { diff --git a/src/scim_table_imengine.h b/src/scim_table_imengine.h index b251321..8d0fbda 100755 --- a/src/scim_table_imengine.h +++ b/src/scim_table_imengine.h @@ -123,6 +123,8 @@ class TableInstance : public IMEngineInstanceBase bool m_forward; bool m_focused; + bool m_lookup_table_always_on; + std::vector m_inputted_keys; std::vector m_converted_strings; std::vector 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 ();