word_commit = self.__read("WordCommit", False)
self.__word_commit.set_active(word_commit)
+ self.__auto_reorder = self.__builder.get_object("AutoReorder")
+ auto_reorder = self.__read("AutoReorder", True)
+ self.__auto_reorder.set_active(auto_reorder)
+
# hanja tab
button = self.__builder.get_object("HanjaKeyListAddButton")
button.connect("clicked", self.on_hanja_key_add, None)
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkHBox" id="hbox7">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkCheckButton" id="AutoReorder">
+ <property name="label" translatable="yes">Automatic _reordering</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="padding">12</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
(IBusHangulEngine *hangul);
static gboolean ibus_hangul_engine_has_preedit
(IBusHangulEngine *hangul);
+static bool ibus_hangul_engine_on_transition
+ (HangulInputContext *hic,
+ ucschar c,
+ const ucschar *preedit,
+ void *data);
static void ibus_config_value_changed (IBusConfig *config,
const gchar *section,
static int lookup_table_orientation = 0;
static IBusKeymap *keymap = NULL;
static gboolean word_commit = FALSE;
+static gboolean auto_reorder = TRUE;
static glong
ucschar_strlen (const ucschar* str)
g_variant_unref(value);
}
+ value = ibus_config_get_value (config, "engine/Hangul", "AutoReorder");
+ if (value != NULL) {
+ auto_reorder = g_variant_get_boolean (value);
+ g_variant_unref (value);
+ }
+
keymap = ibus_keymap_get("us");
}
IBusText* tooltip;
hangul->context = hangul_ic_new (hangul_keyboard->str);
+ hangul_ic_connect_callback (hangul->context, "transition",
+ ibus_hangul_engine_on_transition, hangul);
+
hangul->preedit = ustring_new();
hangul->hanja_list = NULL;
hangul->hangul_mode = TRUE;
return FALSE;
}
+static bool
+ibus_hangul_engine_on_transition (HangulInputContext *hic,
+ ucschar c,
+ const ucschar *preedit,
+ void *data)
+{
+ if (!auto_reorder) {
+ if (hangul_is_choseong (c)) {
+ if (hangul_ic_has_jungseong (hic) || hangul_ic_has_jongseong (hic))
+ return false;
+ }
+
+ if (hangul_is_jungseong (c)) {
+ if (hangul_ic_has_jongseong (hic))
+ return false;
+ }
+ }
+
+ return true;
+}
+
static void
ibus_config_value_changed (IBusConfig *config,
const gchar *section,
hanja_key_list_set_from_string(&hanja_keys, str);
} else if (strcmp(name, "WordCommit") == 0) {
word_commit = g_variant_get_boolean (value);
+ } else if (strcmp (name, "AutoReorder") == 0) {
+ auto_reorder = g_variant_get_boolean (value);
}
} else if (strcmp(section, "panel") == 0) {
if (strcmp(name, "lookup_table_orientation") == 0) {