};
void ise_send_string(const sclchar *key_value);
-void ise_update_preedit_string(const sclchar *str);
+void ise_update_preedit_string(const sclchar *str, const sclboolean underline = TRUE);
void ise_send_event(sclulong key_event, sclulong key_mask);
void ise_forward_key_event(sclulong key_event);
*
*/
+#define Uses_SCIM_ATTRIBUTE
+
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <vconf.h>
#include <Ecore_IMF.h>
#include <Elementary.h>
+#include <scim.h>
#include "sclui.h"
#include "sclcore.h"
* Send the preedit string to input framework
*/
void
-ise_update_preedit_string(const sclchar *str)
+ise_update_preedit_string(const sclchar *str, const sclboolean underline)
{
int ic = -1;
if (!check_ic_temporary(g_keyboard_state.ic)) {
ic = g_keyboard_state.ic;
}
- g_core.update_preedit_string(ic, "", str);
+ if (underline) {
+ /* Count UTF-8 string length */
+ int len = 0;
+ const sclchar *s = str;
+ while (*s) len += (*s++ & 0xc0) != 0x80;
+ scim::Attribute attr;
+ attr.set_start(0);
+ attr.set_length(len);
+ attr.set_type(scim::SCIM_ATTR_DECORATE);
+ attr.set_value(scim::SCIM_ATTR_DECORATE_UNDERLINE);
+ std::vector<scim::Attribute> underline_attribute;
+ underline_attribute.push_back(attr);
+ g_core.update_preedit_string(ic, "", str, underline_attribute);
+ } else {
+ g_core.update_preedit_string(ic, "", str);
+ }
LOGD("ic : %x, %s\n", ic, str);
}
iconv_string(AUTOMATA_BASE_ENCODING, SYSTEM_OUTPUT_ENCODING,
(const char*)(CJI_GetMakeCode().ucode), buffer, CJI_GetMakeCode().size * 2, KOREAN_ENCODING_BUFFER_SIZE);
if (buffer[0] || makecode.size > 0) {
- ise_update_preedit_string(buffer);
+ ise_update_preedit_string(buffer, FALSE);
ret = TRUE;
}