Support surrounding-text retrieval.
authorDaiki Ueno <daiki.ueno@gmail.com>
Tue, 5 Apr 2011 14:11:49 +0000 (10:11 -0400)
committerPeng Huang <shawn.p.huang@gmail.com>
Tue, 5 Apr 2011 14:11:49 +0000 (10:11 -0400)
commit06e6abee9f221bdf7c277538ce136154465619d7
tree2d91a9dd312428e2164d19cbbb3dcc8d3fb700bc
parent6a39a86f84fb59c06a246c1bb3f50abbf6c9f8d1
Support surrounding-text retrieval.

Unlike the GtkIMContext API, IBus automatically retrieves
surrounding-text when certain events occurred to the
client ("before filter_keypress", for example).  This makes the
engine API simpler but causes periodical emission of D-Bus
signals for updating surrounding-text information, which is
unwanted for typical engines.

For this reason, the surrounding-text support is currently
disabled by default.  To enable it, pass
--enable-surrounding-text to configure.  Also, even
surrounding-text support is compiled in, IBus does not start
polling until an engine requests surrounding-text using
ibus_engine_get_surrounding_text().  To make the function work
for the first time, clients should retrieve
initial surrounding-text when the engine is enabled (see ibus_im_context_focus_in() and
_ibus_context_enabled_cb() in client/gtk2/ibusimcontext.c).

BUG=Issue#778
TEST=manual

Review URL: http://codereview.appspot.com/4276082
Patch from Daiki Ueno <daiki.ueno@gmail.com>.
13 files changed:
bus/engineproxy.c
bus/engineproxy.h
bus/inputcontext.c
client/gtk2/ibusimcontext.c
configure.ac
ibus/engine.py
ibus/interface/iengine.py
ibus/interface/iinputcontext.py
src/ibusengine.c
src/ibusengine.h
src/ibusinputcontext.c
src/ibusinputcontext.h
src/ibusmarshalers.list