Added set_path_info function to HelperModule to support OSP based keyboard
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 15 Nov 2012 10:33:02 +0000 (19:33 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 19 Nov 2012 07:00:05 +0000 (16:00 +0900)
Change-Id: I00e5f4952eee136cfde3d0b456a8ce76727046ce

ism/src/scim_helper_module.cpp
ism/src/scim_helper_module.h

index 2a883b4..6e1338e 100644 (file)
@@ -75,6 +75,9 @@ HelperModule::load (const String &name)
         m_set_arg_info =
             (HelperModuleSetArgInfoFunc) m_module.symbol ("scim_helper_module_set_arg_info");
 
+        m_set_path_info =
+            (HelperModuleSetPathInfoFunc) m_module.symbol ("scim_helper_module_set_path_info");
+
         if (!m_number_of_helpers || !m_get_helper_info || !m_run_helper) {
             m_module.unload ();
             m_number_of_helpers = 0;
@@ -83,6 +86,10 @@ HelperModule::load (const String &name)
             m_run_helper = 0;
             return false;
         }
+
+        if (m_set_path_info) {
+            m_set_path_info(m_module.get_path().c_str());
+        }
     } catch (...) {
         m_module.unload ();
         m_number_of_helpers = 0;
index 981c7e1..9953a0f 100644 (file)
@@ -114,6 +114,19 @@ typedef void (*HelperModuleRunHelperFunc)       (const String &uuid, const Confi
 typedef void (*HelperModuleSetArgInfoFunc)       (int argc, char *argv []);
 
 /**
+ * @brief Deliver the .so filepath to ISE currently being loaded.
+ *
+ * In Tizen platform, there are cases that helper module requires the filepath of .so file
+ * currently being loaded, since the binary does not contain any information such as ModuleName or UUID.
+ * This function delivers the filepath information to those applications,
+ * so that it can acquire the necessary information using the filepath information.
+ * This also should be removed when there is no need for the filepath since this is only tizen-specific.
+ *
+ * @param path The filepath of the .so file currently being loaded
+ */
+typedef void (*HelperModuleSetPathInfoFunc)       (const char *path);
+
+/**
  * @brief The class used to load a Helper module and run its Helpers.
  *
  * This class should not be used directly. HelperManager should be used instead.
@@ -127,6 +140,7 @@ class HelperModule
     HelperModuleGetHelperLangFunc   m_get_helper_lang;
     HelperModuleRunHelperFunc       m_run_helper;
     HelperModuleSetArgInfoFunc      m_set_arg_info;
+    HelperModuleSetPathInfoFunc     m_set_path_info;
 
     HelperModule (const HelperModule &);
     HelperModule & operator= (const HelperModule &);