memcpy(&ise_context, buf, sizeof(ise_context));
if (ise_context.imdata_size > 0) {
- callback->on_set_imdata(buf + sizeof(ise_context), ise_context.imdata_size);
+ char imdata[1024] = {0};
+ memcpy((void *)imdata, buf + sizeof(ise_context), ise_context.imdata_size);
+ callback->on_set_imdata(imdata, ise_context.imdata_size);
}
+
+ if (len >= (sizeof(Ise_Context) + ise_context.imdata_size))
+ callback->on_set_mime_type(buf + sizeof(ise_context) + ise_context.imdata_size);
} else {
LOGD("\n-=-= WARNING - buf %p len %d size %d \n", buf, len, sizeof(ise_context));
}
}
}
+static void slot_set_mime_type(const scim::HelperAgent *agent, const scim::String &mime_type) {
+ CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
+ if (impl) {
+ ISCLCoreEventCallback *callback = impl->get_core_event_callback();
+ if (callback) {
+ callback->on_set_mime_type(mime_type.c_str());
+ }
+ }
+}
+
/* Internal input handler function */
Eina_Bool input_handler(void *data, Ecore_Fd_Handler *fd_handler)
{
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_helper_agent.signal_connect_set_prediction_hint(scim::slot(slot_set_prediction_hint));
+ m_helper_agent.signal_connect_set_mime_type(scim::slot(slot_set_mime_type));
m_initialized = TRUE;
}
virtual void on_process_input_device_event(sclu32 &type, sclchar *data, size_t &len, sclu32 *ret) {}
virtual void on_set_prediction_hint(const sclchar *prediction_hint) {}
+ virtual void on_set_mime_type(const sclchar *mime_type) {}
ISCLCoreEventCallback() {
/* Current callback interface version is 1.1 */