Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: src/IBusChewingEngine.gob

Issue 2436006: Add support for selecting candidates via mouseclick. (Closed) Base URL: ssh://git@chromiumos-git/ibus-chewing.git
Patch Set: Code Review Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IBusChewingEngine-keys.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IBusChewingEngine.gob
diff --git a/src/IBusChewingEngine.gob b/src/IBusChewingEngine.gob
index 2248debd730af8366fd256ab1d54020baff241d9..ee7eb95675602aee9a5c4f6dca683afc5e409222 100644
--- a/src/IBusChewingEngine.gob
+++ b/src/IBusChewingEngine.gob
@@ -140,6 +140,8 @@ IBusKeymap *ibus_keymap_get(gchar *keymap_name);
%privateheader{
gboolean ibus_chewing_engine_process_key_event(IBusEngine *engine,
guint keyval, guint modifiers);
+void ibus_chewing_engine_candidate_clicked(IBusEngine *engine, guint index,
+ guint button, guint state);
#ifndef IBUS_1_1
gboolean ibus_chewing_engine_process_key_event_1_2(IBusEngine *engine,
@@ -268,6 +270,7 @@ class IBus:Chewing:Engine from IBus:Engine{
#else
ibus_engine_class->process_key_event = ibus_chewing_engine_process_key_event_1_2;
#endif /* IBUS_1_1 */
+ ibus_engine_class->candidate_clicked = ibus_chewing_engine_candidate_clicked;
}
private void load_setting(self){
@@ -741,6 +744,25 @@ class IBus:Chewing:Engine from IBus:Engine{
}
}
+ protected void handle_candidate_clicked(self, guint index, guint button, guint state){
+ if (index >= chewing_get_candPerPage(self->context)) {
+ G_DEBUG_MSG(3,"[I3] handle_cadidate_clicked(-, %u, %u, %u) ... index out of range.", index, button, state);
+ return;
+ }
+ if (self->inputMode==CHEWING_INPUT_MODE_SELECTING_DONE){
+ int* keys = chewing_get_selKey(self->context);
+ if (!keys) {
+ G_DEBUG_MSG(3,"[I3] handle_cadidate_clicked(-, %u, %u, %u) ... No sel keys.", index, button, state);
+ return;
+ }
+ ibus_chewing_engine_set_status_flag(self, ENGINE_STATUS_NEED_COMMIT);
+ chewing_handle_Default(self->context, keys[index]);
+ self_update(self);
+ } else {
+ G_DEBUG_MSG(3,"[I3] handle_cadidate_clicked() ... Wrong mode: %u", self->inputMode);
+ }
+ }
+
/*
* determine_input_mode:
*
« no previous file with comments | « no previous file | src/IBusChewingEngine-keys.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698