_scim_config = config;
CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
if (impl) {
- impl->run(display.c_str());
+ impl->on_run(display.c_str());
}
}
}
m_impl = NULL;
}
+void CSCLCore::run()
+{
+ if (m_impl) {
+ m_impl->run();
+ }
+}
+
void CSCLCore::config_reload()
{
if (m_impl) {
CSCLCore(ISCLCoreEventCallback *callback);
~CSCLCore();
+ void run();
+
/**
* @brief Request ISF to reload all configuration.
*/
virtual void on_get_app_info(SclCoreAppInfo *info) {}
virtual void on_init() {}
+ virtual void on_run(int argc, char **argv) {}
virtual void on_exit() {}
virtual void on_attach_input_context(sclint ic, const sclchar *ic_uuid) {}
virtual void on_detach_input_context(sclint ic, const sclchar *ic_uuid) {}
CSCLCoreImpl::CSCLCoreImpl()
{
m_event_callback = NULL;
+ m_display = NULL;
}
CSCLCoreImpl::~CSCLCoreImpl()
{
+ if (m_display) {
+ free(m_display);
+ m_display = NULL;
+ }
}
CSCLCoreImpl*
m_connection.get_keyboard_ise(uuid);
}
-void CSCLCoreImpl::run(const sclchar *display)
+void CSCLCoreImpl::on_run(const sclchar *display)
{
m_core_ui.init();
m_connection.init();
- m_core_ui.run(display);
+ if (m_display) {
+ free (m_display);
+ }
+
+ m_display = strdup(display);
+
+ if (m_event_callback) {
+ m_event_callback->on_run(1, NULL);
+ }
+}
+
+void CSCLCoreImpl::run()
+{
+ m_core_ui.run(m_display);
m_connection.fini();
m_core_ui.fini();
private:
CSCLCoreImpl();
+ sclchar* m_display;
+
public:
~CSCLCoreImpl();
static CSCLCoreImpl* get_instance();
void init(const sclchar *display);
void fini();
- void run(const sclchar *display);
+ void on_run(const sclchar *display);
+ void run();
void set_core_event_callback(ISCLCoreEventCallback *callback);
ISCLCoreEventCallback* get_core_event_callback();