#include "sclconnection-isf.h"
#include "sclcoreimpl.h"
-
+#include <isf_control.h>
#include <Elementary.h>
#include <dlog.h>
CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
if (impl) {
- ISCLCoreEventCallback *callback = impl->get_core_event_callback();
- if (callback) {
- SclCoreAppInfo appinfo;
- callback->on_get_app_info(&appinfo);
- m_helper_info.uuid = scim::String(appinfo.uuid.c_str());
- m_helper_info.name = scim::String(appinfo.name.c_str());
- m_helper_info.option = scim::SCIM_HELPER_STAND_ALONE | scim::SCIM_HELPER_NEED_SCREEN_INFO |
- scim::SCIM_HELPER_NEED_SPOT_LOCATION_INFO | scim::SCIM_HELPER_AUTO_RESTART;
+ sclchar *uuid = impl->get_uuid();
+ if (uuid) {
+ sclchar *name = NULL;
+ int options = 0;
+ if (isf_control_get_ise_info(uuid, &name, NULL, NULL, &options) == 0) {
+ m_helper_info.uuid = scim::String(uuid);
+ m_helper_info.name = scim::String(name);
+ m_helper_info.option = (scluint)options;
+ if (name)
+ free(name);
+ }
}
}
bool scim_helper_module_get_helper_info (unsigned int idx, scim::HelperInfo &info) {
CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
if (impl) {
- ISCLCoreEventCallback *callback = impl->get_core_event_callback();
- if (callback) {
- SclCoreAppInfo appinfo;
- callback->on_get_app_info(&appinfo);
- info.uuid = scim::String(appinfo.uuid.c_str());
- info.name = scim::String(appinfo.name.c_str());
- info.option = scim::SCIM_HELPER_STAND_ALONE | scim::SCIM_HELPER_NEED_SCREEN_INFO |
- scim::SCIM_HELPER_NEED_SPOT_LOCATION_INFO | scim::SCIM_HELPER_AUTO_RESTART;
-
- return true;
+ sclchar *uuid = impl->get_uuid();
+ if (uuid) {
+ sclchar *name = NULL;
+ int options = 0;
+ if (isf_control_get_ise_info(uuid, &name, NULL, NULL, &options) == 0) {
+ info.uuid = scim::String(uuid);
+ info.name = scim::String(name);
+ info.option = (scluint)options;
+ if (name)
+ free(name);
+ }
}
}
return false;
scim::String scim_helper_module_get_helper_language (unsigned int idx) {
CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
if (impl) {
- ISCLCoreEventCallback *callback = impl->get_core_event_callback();
- if (callback) {
- SclCoreAppInfo appinfo;
- callback->on_get_app_info(&appinfo);
- return scim::String(appinfo.language.c_str());
+ sclchar *uuid = impl->get_uuid();
+ if (uuid) {
+ sclchar *language = NULL;
+ if (isf_control_get_ise_info(uuid, NULL, &language, NULL, NULL) == 0) {
+ if (language) {
+ scim::String lang = scim::String(language);
+ free(language);
+ return lang;
+ }
+ }
}
}
return scim::String("");
_scim_config = config;
CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
if (impl) {
- impl->on_run(display.c_str());
+ impl->on_run(uuid.c_str(), display.c_str());
}
}
}
{
m_event_callback = NULL;
m_display = NULL;
+ m_uuid = NULL;
}
CSCLCoreImpl::~CSCLCoreImpl()
free(m_display);
m_display = NULL;
}
+ if (m_uuid) {
+ free(m_uuid);
+ m_uuid = NULL;
+ }
}
CSCLCoreImpl*
return &m_connection;
}
+sclchar* CSCLCoreImpl::get_uuid()
+{
+ return m_uuid;
+}
+
void CSCLCoreImpl::config_reload()
{
m_connection.config_reload();
m_connection.get_keyboard_ise(uuid);
}
-void CSCLCoreImpl::on_run(const sclchar *display)
+void CSCLCoreImpl::on_run(const sclchar *uuid, const sclchar *display)
{
m_core_ui.init();
m_connection.init();
+ if (m_uuid) {
+ free (m_uuid);
+ }
+
+ m_uuid = strdup(uuid);
+
if (m_display) {
free (m_display);
}
m_display = strdup(display);
if (m_event_callback) {
- m_event_callback->on_run(1, NULL);
+ m_event_callback->on_run(0, NULL);
}
}
void init(const sclchar *display);
void fini();
- void on_run(const sclchar *display);
+ void on_run(const sclchar *uuid, const sclchar *display);
void run();
void set_core_event_callback(ISCLCoreEventCallback *callback);
CSCLCoreUI* get_core_ui();
CSCLConnection* get_connection();
+ sclchar* get_uuid();
void config_reload();
sclboolean config_read_int(const sclchar *name, sclint &value);
CSCLConnection m_connection;
CSCLCoreUI m_core_ui;
+ sclchar *m_uuid;
};
}
#include "sclcoreui-efl.h"
#include "sclcoreimpl.h"
-
+#include <isf_control.h>
#include <Elementary.h>
#include <dlog.h>
std::string name;
CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
if (impl) {
- ISCLCoreEventCallback *callback = impl->get_core_event_callback();
- if (callback) {
- SclCoreAppInfo appinfo;
- callback->on_get_app_info(&appinfo);
- name = appinfo.name;
+ sclchar *uuid = impl->get_uuid();
+ if (uuid) {
+ sclchar *label = NULL;
+ if (isf_control_get_ise_info(uuid, &label, NULL, NULL, NULL) == 0) {
+ name = std::string(label);
+ if (label)
+ free(label);
+ }
}
argv [0] = const_cast<char *> (name.c_str());