# 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],
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
#include <unistd.h>
#include <scim.h>
#include <set>
+
+#include <Ecore_IMF.h>
+
#include "scim_table_imengine.h"
#include "scim_table_private.h"
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 ();
}
m_add_phrase_mode = 0;
}
- refresh_lookup_table (true, false);
+ //refresh_lookup_table (true, false);
refresh_preedit ();
refresh_aux_string ();
initialize_properties ();
}
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;
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;
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 ();