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: