Added interface for supporting unconventional input devices 92/70592/3
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 17 May 2016 08:22:08 +0000 (17:22 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Tue, 14 Jun 2016 13:10:38 +0000 (06:10 -0700)
Change-Id: If6ed2985230ba257f460ac7cbfef7bb740d1097e

src/sclconnection-isf.cpp [changed mode: 0755->0644]
src/sclconnection-isf.h [changed mode: 0755->0644]
src/sclconnection.cpp [changed mode: 0755->0644]
src/sclconnection.h [changed mode: 0755->0644]
src/sclcore.cpp [changed mode: 0755->0644]
src/sclcore.h [changed mode: 0755->0644]
src/sclcorecallback.h
src/sclcoreimpl.h [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 6b3e340..54d0e5b
@@ -534,6 +534,19 @@ static void slot_candidate_hide(const scim::HelperAgent *agent, int ic, const sc
     }
 }
 
+static void slot_process_input_device_event(const scim::HelperAgent *agent, scim::uint32 &type, char *data, size_t &len, scim::uint32 &ret) {
+    CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
+    if (impl) {
+        ISCLCoreEventCallback *callback = impl->get_core_event_callback();
+        if (callback) {
+            /* Input Device Event callback is available in versions after 1.1 */
+            if (check_interface_version(callback, 1, 1)) {
+                callback->on_process_input_device_event(type, data, len, &ret);
+            }
+        }
+    }
+}
+
 /* Internal input handler function */
 Eina_Bool input_handler(void *data, Ecore_Fd_Handler *fd_handler)
 {
@@ -631,6 +644,7 @@ sclboolean CSCLConnectionISF::init()
         m_helper_agent.signal_connect_process_key_event(scim::slot(slot_process_key_event));
         m_helper_agent.signal_connect_candidate_show(scim::slot(slot_candidate_show));
         m_helper_agent.signal_connect_candidate_hide(scim::slot(slot_candidate_hide));
+        m_helper_agent.signal_connect_process_input_device_event(scim::slot(slot_process_input_device_event));
 
         m_initialized = TRUE;
     }
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 5a4771a..5087bb5 100644 (file)
@@ -85,8 +85,34 @@ struct ISCLCoreEventCallback {
 
     virtual void on_candidate_show(sclint ic, const sclchar *ic_uuid) {}
     virtual void on_candidate_hide(sclint ic, const sclchar *ic_uuid) {}
+
+    /* Added in callback interface version 1.1 */
+    virtual void on_process_input_device_event(sclu32 &type, sclchar *data, size_t &len, sclu32 *ret) {}
+
+    ISCLCoreEventCallback() {
+        /* Current callback interface version is 1.1 */
+        m_version_major = 1;
+        m_version_minor = 1;
+    }
+    sclint get_version_major() { return m_version_major; }
+    sclint get_version_minor() { return m_version_minor; }
+private:
+    int m_version_major;
+    int m_version_minor;
 };
 
+inline sclboolean check_interface_version(ISCLCoreEventCallback *callback, int version_major, int version_minor)
+{
+    if (callback) {
+        if (callback->get_version_major() >= version_major) {
+            if (callback->get_version_minor() >= version_minor) {
+                return TRUE;
+            }
+        }
+    }
+    return FALSE;
+}
+
 }
 
 //SCL_END_DECLS
old mode 100755 (executable)
new mode 100644 (file)