self._update ()
return True
elif keyval == keysyms.space:
- self._commit_string (self._preedit_string)
- self._preedit_string = ""
- self._update ()
+ if self._lookup_table.get_number_of_candidates () > 0:
+ self._commit_string (self._lookup_table.get_current_candidate ()[0])
+ else:
+ self._commit_string (self._preedit_string)
return False
elif keyval >= keysyms._1 and keyval <= keysyms._9:
index = keyval - keysyms._1
attrs.append (ibus.AttributeForeground (0xff0000, 0, preedit_len))
for text in self._dict.suggest (self._preedit_string):
self._lookup_table.append_candidate (text)
-
- self.AuxStringChanged (self._preedit_string, attrs.to_dbus_value ())
+ self.UpdateAuxString (self._preedit_string, attrs.to_dbus_value (), preedit_len > 0)
attrs.append (ibus.AttributeUnderline (pango.UNDERLINE_SINGLE, 0, preedit_len))
- self.PreeditChanged (self._preedit_string, attrs.to_dbus_value (), dbus.Int32 (preedit_len))
+ self.UpdatePreedit (self._preedit_string, attrs.to_dbus_value (), dbus.Int32 (preedit_len), preedit_len > 0)
self._update_lookup_table ()
def _update_lookup_table (self):
- self.UpdateLookupTable (self._lookup_table.to_dbus_value ())
+ show = self._lookup_table.get_number_of_candidates () > 0
+ self.UpdateLookupTable (self._lookup_table.to_dbus_value (), show)
def FocusIn (self):
gchar *preedit_string;
PangoAttrList *preedit_attrs;
gint preedit_cursor;
+ gboolean preedit_show;
};
/* functions prototype */
static void gik_im_client_commit_string(GikIMClient *client,
const gchar *string);
-static void gik_im_client_preedit_changed
+static void gik_im_client_update_preedit
(GikIMClient *client,
const gchar *string,
PangoAttrList *attrs,
- gint cursor_pos);
+ gint cursor_pos,
+ gboolean show);
static void gik_im_client_sync_hotkeys (GikIMClient *client);
static gboolean _ibus_call_with_reply_and_block
}
static void
-gik_im_client_preedit_changed (GikIMClient *client, const gchar *string, PangoAttrList *attrs, gint cursor_pos)
+gik_im_client_update_preedit (GikIMClient *client, const gchar *string,
+ PangoAttrList *attrs, gint cursor_pos, gboolean show)
{
GikIMClientPrivate *priv = client->priv;
if (priv->preedit_string) {
}
priv->preedit_cursor = cursor_pos;
+ priv->preedit_show = show;
if (priv->context) {
g_signal_emit_by_name (priv->context, "preedit-changed");
}
}
static void
-_gik_signal_preedit_changed_handler (DBusConnection *connection, DBusMessage *message, GikIMClient *client)
+_gik_signal_update_preedit_handler (DBusConnection *connection, DBusMessage *message, GikIMClient *client)
{
- /* Handle PreeditChanged signal */
+ /* Handle UpdatePreedit signal */
DBusError error = {0};
- gchar *string = NULL;
- gint cursor = 0;
DBusMessageIter iter, sub_iter;
gint type, sub_type;
+
+ gchar *string = NULL;
PangoAttrList *attrs = NULL;
+ gint cursor = 0;
+ gboolean show = False;
if (!dbus_message_iter_init (message, &iter)) {
- g_warning ("The PreeditChanged signal does have args!");
+ g_warning ("The UpdatePreedit signal does have args!");
return;
}
type = dbus_message_iter_get_arg_type (&iter);
if (type != DBUS_TYPE_STRING) {
- g_warning ("The frist argument of PreeditChanged signal must be a String");
+ g_warning ("The frist argument of UpdatePreedit signal must be a String");
return;
}
dbus_message_iter_get_basic (&iter, &string);
type = dbus_message_iter_get_arg_type (&iter);
if (type != DBUS_TYPE_ARRAY) {
- g_warning ("The secode argument of PreeditChanged signal must be a Struct Array");
+ g_warning ("The secode argument of UpdatePreedit signal must be a Struct Array");
return;
}
if (dbus_message_iter_get_array_len (&sub_iter) > 0) {
if (dbus_message_iter_get_arg_type (&sub_iter) != DBUS_TYPE_ARRAY ||
dbus_message_iter_get_element_type (&sub_iter) != DBUS_TYPE_INT32 ) {
- g_warning ("The secode argument of PreeditChanged signal must be a Struct Array");
+ g_warning ("The secode argument of UpdatePreedit signal must be a Struct Array");
return;
}
dbus_message_iter_get_fixed_array (&sub_sub_iter, &values, &length);
if (length <= 0) {
- g_warning ("The element of the second argument of PreeditChanged should not be a empty array");
+ g_warning ("The element of the second argument of UpdatePreedit should not be a empty array");
continue;
}
type = dbus_message_iter_get_arg_type (&iter);
if (type != DBUS_TYPE_INT32) {
- g_warning ("The third argument of PreeditChanged signal must be an Int32 %c", type);
+ g_warning ("The third argument of UpdatePreedit signal must be an Int32 %c", type);
pango_attr_list_unref (attrs);
return;
}
dbus_message_iter_get_basic (&iter, &cursor);
dbus_message_iter_next (&iter);
- gik_im_client_preedit_changed (client, string, attrs, cursor);
+ type = dbus_message_iter_get_arg_type (&iter);
+ if (type != DBUS_TYPE_BOOLEAN) {
+ g_warning ("The third argument of UpdatePreedit signal must be an Int32 %c", type);
+ pango_attr_list_unref (attrs);
+ return;
+ }
+ dbus_message_iter_get_basic (&iter, &show);
+ dbus_message_iter_next (&iter);
+
+ gik_im_client_update_preedit (client, string, attrs, cursor, show);
pango_attr_list_unref (attrs);
}
} handlers[] = {
{ DBUS_INTERFACE_DBUS, "NameOwnerChanged", _gik_signal_name_owner_changed_handler },
{ IBUS_IFACE, "CommitString", _gik_signal_commit_string_handler },
- { IBUS_IFACE, "PreeditChanged", _gik_signal_preedit_changed_handler },
+ { IBUS_IFACE, "UpdatePreedit", _gik_signal_update_preedit_handler },
{ IBUS_IFACE, "Enabled", _gik_signal_enabled_handler },
{ IBUS_IFACE, "Disabled", _gik_signal_disabled_handler },
{0},
{
GikIMClientPrivate *priv = client->priv;
+ if (priv->preedit_show) {
+ if (str) *str = g_strdup ("");
+ if (attrs) *attrs = pango_attr_list_new ();
+ if (cursor_pos) *cursor_pos = 0;
+ return True;
+ }
+
if (str) {
*str = g_strdup (priv->preedit_string ? priv->preedit_string: "");
}
@method ()
def Reset (self): pass
-
+
# signals for lookup table
@method ()
def PageUp (self): pass
-
+
@method ()
def PageDown (self): pass
-
+
@method ()
def CursorUp (self): pass
-
+
@method ()
def CursorDown (self): pass
-
+
@method (in_signature = "b")
def SetEnable (self, enable): pass
@signal (signature="ubu")
def ForwardKeyEvent (self, keyval, is_press, state): pass
- @signal (signature="saaii")
- def PreeditChanged (self, text, attrs, cursor_pos): pass
+ @signal (signature="saaiib")
+ def UpdatePreedit (self, text, attrs, cursor_pos, show): pass
# below signals are optional. The engine could create and maintain panel by self.
@signal (signature="v")
def UpdateProperties (self, properties): pass
- @signal (signature="sv")
- def AuxStringChanged (self, text, attrs): pass
+ @signal (signature="svb")
+ def UpdateAuxString (self, text, attrs, show): pass
- @signal (signature="v")
- def UpdateLookupTable (self, lookup_table): pass
+ @signal ()
+ def ShowAuxStringChanged (self): pass
+
+ @signal ()
+ def HideAuxStringChanged (self): pass
+
+ @signal (signature="vb")
+ def UpdateLookupTable (self, lookup_table, show): pass
@signal ()
def ShowLookupTable (self): pass
@method (in_signature="iiii")
def SetCursorLocation (self, x, y, w, h): pass
- @method (in_signature="svu")
- def SetPreeditString (self, text, attrs, cursor_pos): pass
+ @method (in_signature="svub")
+ def UpdatePreedit (self, text, attrs, cursor_pos, show): pass
@method ()
def ShowPreeditString (self): pass
@method ()
def HidePreeditString (self): pass
- @method (in_signature="sv")
- def SetAuxString (self, text, attrs): pass
+ @method (in_signature="svb")
+ def UpdateAuxString (self, text, attrs, show): pass
@method ()
def ShowAuxString (self): pass
@method ()
def HideAuxString (self): pass
- @method (in_signature="v")
- def UpdateLookupTable (self, lookup_table): pass
+ @method (in_signature="vb")
+ def UpdateLookupTable (self, lookup_table, show): pass
@method ()
def ShowCandidateWindow (self): pass
def HideLanguageBar (self): pass
@method ()
+ def Reste (self): pass
+
+ @method ()
def Destroy (self): pass
#signals
self._focused_client.focus_out ()
# Install all callback functions
- id = client.connect ("preedit-changed", self._preedit_changed_cb)
+ id = client.connect ("update-preedit", self._update_preedit_cb)
self._client_handlers.append (id)
- id = client.connect ("aux-string-changed", self._aux_string_changed_cb)
+ id = client.connect ("update-aux-string", self._update_aux_string_cb)
self._client_handlers.append (id)
id = client.connect ("update-lookup-table", self._update_lookup_table_cb)
self._client_handlers.append (id)
- id = client.connect ("show-lookup-table", self._show_lookup_table_cb)
- self._client_handlers.append (id)
- id = client.connect ("hide-lookup-table", self._hide_lookup_table_cb)
- self._client_handlers.append (id)
+ self._panel.reset ()
self._focused_client = client
self._last_focused_client = client
client.focus_in ()
del self._client_handlers[:]
self._focused_client = None
client.focus_out ()
+ self._panel.reset ()
def reset (self, dbusconn):
client = self._lookup_client (dbusconn)
+ self._panel.reset ()
client.reset ()
def is_enabled (self, dbusconn):
raise ibus.IBusException ("not register the client")
return self._clients[dbusconn]
- def _preedit_changed_cb (self, client, text, attrs, cursor_pos):
+ def _update_preedit_cb (self, client, text, attrs, cursor_pos, show):
assert self._focused_client == client
- self._panel.set_preedit_string (text, attrs, cursor_pos)
+ self._panel.update_preedit_string (text, attrs, cursor_pos, show)
- def _aux_string_changed_cb (self, client, text, attrs):
+ def _update_aux_string_cb (self, client, text, attrs, show):
assert self._focused_client == client
- self._panel.set_aux_string (text, attrs)
+ self._panel.update_aux_string (text, attrs, show)
- def _update_lookup_table_cb (self, client, lookup_table):
+ def _update_lookup_table_cb (self, client, lookup_table, show):
assert self._focused_client == client
- self._panel.update_lookup_table (lookup_table)
+ self._panel.update_lookup_table (lookup_table, show)
def _show_lookup_table_cb (self, client, lookup_table):
assert self._focused_client == client
class Client (ibus.Object):
__gsignals__ = {
- "preedit-changed" : (
+ "update-preedit" : (
gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
- (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_INT)),
- "aux-string-changed" : (
+ (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_INT, gobject.TYPE_BOOLEAN)),
+ "update-aux-string" : (
gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
- (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)),
+ (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_BOOLEAN)),
"update-lookup-table" : (
gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
- (gobject.TYPE_PYOBJECT, )),
- "show-lookup-table" : (
- gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE,
- ()),
- "hide-lookup-table" : (
- gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE,
- ())
+ (gobject.TYPE_PYOBJECT, gobject.TYPE_BOOLEAN)),
}
def __init__ (self, name, ibusconn):
def commit_string (self, text):
self._ibusconn.emit_dbus_signal ("CommitString", text)
- def preedit_changed (self, text, attrs, cursor_pos):
+ def update_preedit (self, text, attrs, cursor_pos, show):
if self._use_preedit:
- self._ibusconn.emit_dbus_signal ("PreeditChanged", text, attrs, cursor_pos)
+ self._ibusconn.emit_dbus_signal ("UpdatePreedit", text, attrs, cursor_pos, show)
else:
# show preedit on panel
- self.emit ("preedit-changed", text, attrs, cursor_pos)
+ self.emit ("update-preedit", text, attrs, cursor_pos, show)
def set_engine (self, engine):
if self._engine == engine:
def _commit_string_cb (self, engine, text):
self.commit_string (text)
- def _preedit_changed_cb (self, engine, text, attrs, cursor_pos):
- self.preedit_changed (text, attrs, cursor_pos)
+ def _update_preedit_cb (self, engine, text, attrs, cursor_pos, show):
+ self.update_preedit (text, attrs, cursor_pos, show)
- def _aux_string_changed_cb (self, engine, text, attrs):
+ def _update_aux_string_cb (self, engine, text, attrs, show):
self._aux_string = text
self._aux_attrs = attrs
- self.emit ("aux-string-changed", text, attrs)
+ self.emit ("update-aux-string", text, attrs, show)
- def _update_lookup_table_cb (self, engine, lookup_table):
+ def _update_lookup_table_cb (self, engine, lookup_table, show):
self._lookup_table = lookup_table
- self.emit ("update-lookup-table", lookup_table)
-
- def _show_lookup_table_cb (self, engine):
- self._show_lookup_table = True
- self.emit ("show-lookup-table")
-
- def _hide_lookup_table_cb (self, engine):
- self._show_lookup_table = False
- self.emit ("hide-lookup-table")
+ self.emit ("update-lookup-table", lookup_table, show)
def _remove_engine_handlers (self):
assert self._engine != None
self._engine_handler_ids.append (id)
id = self._engine.connect ("commit-string", self._commit_string_cb)
self._engine_handler_ids.append (id)
- id = self._engine.connect ("preedit-changed", self._preedit_changed_cb)
+ id = self._engine.connect ("update-preedit", self._update_preedit_cb)
self._engine_handler_ids.append (id)
- id = self._engine.connect ("aux-string-changed", self._aux_string_changed_cb)
+ id = self._engine.connect ("update-aux-string", self._update_aux_string_cb)
self._engine_handler_ids.append (id)
id = self._engine.connect ("update-lookup-table", self._update_lookup_table_cb)
self._engine_handler_ids.append (id)
- id = self._engine.connect ("show-lookup-table", self._show_lookup_table_cb)
- self._engine_handler_ids.append (id)
- id = self._engine.connect ("hide-lookup-table", self._hide_lookup_table_cb)
- self._engine_handler_ids.append (id)
gobject.type_register (Client)
gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
(gobject.TYPE_UINT, gobject.TYPE_BOOLEAN, gobject.TYPE_UINT )),
- "preedit-changed" : (
+ "update-preedit" : (
gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
- (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_INT)),
- "aux-string-changed" : (
+ (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_INT, gobject.TYPE_BOOLEAN)),
+ "update-aux-string" : (
gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
- (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)),
+ (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_BOOLEAN)),
"update-lookup-table" : (
gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
- (gobject.TYPE_PYOBJECT, )),
- "show-lookup-table" : (
- gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE,
- ()),
- "hide-lookup-table" : (
- gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE,
- ())
+ (gobject.TYPE_PYOBJECT, gobject.TYPE_BOOLEAN)),
}
def __init__ (self, factory, ibusconn, object_path):
args = message.get_args_list ()
self.emit ("forward-key-event", args[0], bool (arg[1]), arg[2])
return True
- elif message.is_signal (ibus.IBUS_ENGINE_IFACE, "PreeditChanged"):
+ elif message.is_signal (ibus.IBUS_ENGINE_IFACE, "UpdatePreedit"):
args = message.get_args_list ()
- self.emit ("preedit-changed", args[0], args[1], args[2])
+ self.emit ("update-preedit", args[0], args[1], args[2], args[3])
return True
- elif message.is_signal (ibus.IBUS_ENGINE_IFACE, "AuxStringChanged"):
+ elif message.is_signal (ibus.IBUS_ENGINE_IFACE, "UpdateAuxString"):
args = message.get_args_list ()
- self.emit ("aux-string-changed", args[0], args[1])
+ self.emit ("update-aux-string", args[0], args[1], args[2])
return True
elif message.is_signal (ibus.IBUS_ENGINE_IFACE, "UpdateLookupTable"):
args = message.get_args_list ()
- self.emit ("update-lookup-table", args[0])
- return True
- elif message.is_signal (ibus.IBUS_ENGINE_IFACE, "ShowLookupTable"):
- self.emit ("show-lookup-table")
- return True
- elif message.is_signal (ibus.IBUS_ENGINE_IFACE, "HideLookupTable"):
- self.emit ("hide-lookup-table")
+ self.emit ("update-lookup-table", args[0], args[1])
return True
else:
return False
def set_cursor_location (self, x, y, w, h):
self._panel.SetCursorLocation (x, y, w, h)
- def set_preedit_string (self, text, attrs, cursor_pos):
- self._panel.SetPreeditString (text, attrs, cursor_pos)
+ def update_preedit (self, text, attrs, cursor_pos, show):
+ self._panel.UpdatePreedit (text, attrs, cursor_pos, show)
def show_preedit_string (self):
self._panel.ShowPreeditString ()
def hide_preedit_string (self):
slef._panel.HidePreeditString ()
- def set_aux_string (self, text, attrs):
- self._panel.SetAuxString (text, attrs)
+ def update_aux_string (self, text, attrs, show):
+ self._panel.UpdateAuxString (text, attrs, show)
def show_aux_string (self):
self._panel.ShowAuxString ()
def hide_aux_string (self):
slef._panel.HideAuxString ()
- def update_lookup_table (self, lookup_table):
- self._panel.UpdateLookupTable (lookup_table)
+ def update_lookup_table (self, lookup_table, show):
+ self._panel.UpdateLookupTable (lookup_table, show)
def show_candidate_window (self):
self._panel.ShowCandidateWindow ()
def hide_language_bar (self):
self._panel.HideLanguageBar ()
+ def reset (self):
+ self._panel.Reste ()
+
def destroy (self):
if self._ibusconn != None:
self._panel.Destroy ()
else:
self._labels[0][0].set_text ("1.")
-
class CandidatePanel (gtk.VBox):
__gproperties__ = {
'orientation' : (gtk.Orientation, # type
self._orientation = gtk.ORIENTATION_HORIZONTAL
self._orientation = gtk.ORIENTATION_VERTICAL
self._show_preedit_string = False
- self._preedit_string = "preedit string"
+ self._show_aux_string = False
+ self._show_lookup_table = False
+ self._preedit_string = ""
self._preedit_attrs = pango.AttrList ()
- self._aux_string = "aux string"
+ self._aux_string = ""
self._aux_attrs = pango.AttrList ()
self._lookup_table = None
self._aux_label.set_alignment (0.0, 0.5)
self._aux_label.set_padding (8, 0)
self._tooltips.set_tip (self._aux_label, "Aux string")
+ self._aux_label.set_no_show_all (True)
+ if self._show_aux_string:
+ self._aux_label.show ()
# create candidates area
self._candidate_area = CandidateArea (self._orientation)
+ self._candidate_area.set_no_show_all (True)
+ if self._show_lookup_table:
+ self._candidate_area.show_all ()
# create state label
self._state_label = gtk.Label ()
self.hide_all ()
self.show_all ()
-
def show_preedit_string (self):
self._show_preedit_string = True
self._preedit_label.show ()
+ self._check_show_states ()
def hide_preedit_string (self):
- self._hide_preedit_string = False
+ self._show_preedit_string = False
self._preedit_label.hide ()
+ self._check_show_states ()
- def set_aux_string (self, text, attrs):
+ def update_preedit (self, text, attrs, cursor_pos, show):
attrs = PangoAttrList (attrs)
+ if show:
+ self.show_preedit_string ()
+ else:
+ self.hide_preedit_string ()
+ self._preedit_string = text
+ self._preedit_label.set_text (text)
+ if attrs == None:
+ attrs = pango.AttrList ()
+ self._preedit_attrs = attrs
+ self._preedit_label.set_attributes (attrs)
+
+ def show_aux_string (self):
+ self._show_aux_string = True
+ self._aux_label.show ()
+ self._check_show_states ()
+
+ def hide_aux_string (self):
+ self._show_aux_string = False
+ self._aux_label.hide ()
+ self._check_show_states ()
+
+ def update_aux_string (self, text, attrs, show):
+ attrs = PangoAttrList (attrs)
+
+ if show:
+ self.show_aux_string ()
+ else:
+ self.hide_aux_string ()
+
self._aux_string = text
self._aux_label.set_text (text)
if attrs == None:
self._aux_attrs = attrs
self._aux_label.set_attributes (attrs)
- def set_preedit_string (self, text, attrs, cursor_pos):
- attrs = PangoAttrList (attrs)
- self._preedit_string = text
- self._preedit_label.set_text (text)
- if attrs == None:
- attrs = pango.AttrList ()
- self._preedit_attrs = attrs
- self._preedit_label.set_attributes (attrs)
+ def show_lookup_table (self):
+ self._show_lookup_table = True
+ self._candidate_area.set_no_show_all (False)
+ self._candidate_area.show_all ()
+ self._check_show_states ()
+
+ def hide_lookup_table (self):
+ self._show_lookup_table = False
+ self._candidate_area.hide_all ()
+ self._candidate_area.set_no_show_all (True)
+ self._check_show_states ()
+
+ def update_lookup_table (self, lookup_table, show):
+ if lookup_table == None:
+ lookup_table = ibus.LookupTable ()
+
+ if show:
+ self.show_lookup_table ()
+ else:
+ self.hide_lookup_table ()
- def set_lookup_table (self, lookup_table):
self._lookup_table = lookup_table
candidates = self._lookup_table.get_canidates_in_current_page ()
candidates = map (lambda x: (x[0], PangoAttrList (x[1])), candidates)
self._candidate_area.set_candidates (candidates, self._lookup_table.get_cursor_pos_in_current_page ())
+ def _check_show_states (self):
+ if self._show_preedit_string or \
+ self._show_aux_string or \
+ self._show_lookup_table:
+ self.show_all ()
+ self.emit ("show")
+ else:
+ self.hide_all ()
+ self.emit ("hide")
+
+ def reset (self):
+ self.hide ()
+ self.hide_preedit_string ()
+ self.hide_aux_string ()
+ self.hide_lookup_table ()
+ self.set_preedit_string ("", None, 0)
+ self.set_aux_string ("", None)
+ self.set_lookup_table (None)
+
def set_orientation (self, orientation):
if self._orientation == orientation:
return
self._candidate_panel.connect ("size-request", self._size_request_cb)
self._candidate_panel.connect ("cursor-up", lambda x: self.emit ("cursor-up"))
self._candidate_panel.connect ("cursor-down", lambda x: self.emit ("cursor-down"))
+ self._candidate_panel.connect ("show", lambda x: self.show ())
+ self._candidate_panel.connect ("hide", lambda x: self.hide ())
self.add (self._candidate_panel)
self.move (100, 100)
- self.show_all ()
- def set_preedit_string (self, text, attrs, cursor_pos):
- self._candidate_panel.set_preedit_string (text, attrs, cursor_pos)
+ def update_preedit (self, text, attrs, cursor_pos, show):
+ self._candidate_panel.update_preedit (text, attrs, cursor_pos, show)
def show_preedit_string (self, text, attrs):
self._candidate_panel.show_preedit_string ()
def hide_preedit_string (self, text, attrs):
self._candidate_panel.hide_preedit_string ()
- def set_aux_string (self, text, attrs):
- self._candidate_panel.set_aux_string (text, attrs)
+ def update_aux_string (self, text, attrs, show):
+ self._candidate_panel.update_aux_string (text, attrs, show)
- def set_lookup_table (self, lookup_table):
- self._candidate_panel.set_lookup_table (lookup_table)
+ def update_lookup_table (self, lookup_table, show):
+ self._candidate_panel.update_lookup_table (lookup_table, show)
+
+ def reset (self):
+ self.hide ()
+ self._candidate_panel.reset ()
def _size_request_cb (self, widget, size):
self.resize (1, 1)
def _size_request_cb (self, widget, size):
self.resize (size.width, size.height)
+ def reset (self):
+ pass
+
def do_size_allocate (self, allocation):
gtk.Window.do_size_allocate (self, allocation)
root = gdk.get_default_root_window ()
def set_cursor_location (self, x, y, w, h):
self._candidate_panel.move (x + w, y + h)
-
- def set_preedit_string (self, text, attrs, cursor_pos):
- self._candidate_panel.set_preedit_string (text, attrs, cursor_pos)
+
+ def update_preedit (self, text, attrs, cursor_pos, show):
+ self._candidate_panel.update_preedit (text, attrs, cursor_pos, show)
def show_preedit_string (self):
self._candidate_panel.show_preedit_string ()
def hide_preedit_string (self):
self._candidate_panel.hide_preedit_string ()
- def set_aux_string (self, text, attrs):
- self._candidate_panel.set_aux_string (text, attrs)
+ def update_aux_string (self, text, attrs, show):
+ self._candidate_panel.update_aux_string (text, attrs, show)
def show_aux_string (self):
self._candidate_panel.show_aux_string ()
def hide_aux_string (self):
self._candidate_panel.hide_aux_string ()
-
- def update_lookup_table (self, lookup_table):
- self._candidate_panel.set_lookup_table (lookup_table)
+
+ def update_lookup_table (self, lookup_table, show):
+ self._candidate_panel.update_lookup_table (lookup_table, show)
def show_candidate_window (self):
self._candidate_panel.show ()
def hide_language_bar (self):
selk._language_bar.hide ()
+ def reset (self):
+ self._candidate_panel.reset ()
+ self._language_bar.reset ()
+
class PanelProxy (interface.IPanel):
def __init__ (self, dbusconn, object_path):
interface.IPanel.__init__ (self, dbusconn, object_path)
def SetCursorLocation (self, x, y, w, h):
self._panel.set_cursor_location (x, y, w, h)
-
- def SetPreeditString (self, text, attrs, cursor_pos):
+
+ def UpdatePreedit (self, text, attrs, cursor_pos, show):
attrs = ibus.attr_list_from_dbus_value (attrs)
- self._panel.set_preedit_string (text, atrrs, cursor_pos)
+ self._panel.update_preedit (text, atrrs, cursor_pos, show)
def ShowPreeditString (self):
self._panel.show_preedit_string ()
def HidePreeditString (self):
self._panel.hide_preedit_string ()
- def SetAuxString (self, text, attrs):
+ def UpdateAuxString (self, text, attrs, show):
attrs = ibus.attr_list_from_dbus_value (attrs)
- self._panel.set_aux_string (text, attrs)
+ self._panel.update_aux_string (text, attrs, show)
def ShowAuxString (self):
self._panel.show_aux_string ()
def HideAuxString (self):
self._panel.hide_aux_string ()
- def UpdateLookupTable (self, lookup_table):
+ def UpdateLookupTable (self, lookup_table, show):
lookup_table = ibus.lookup_table_from_dbus_value (lookup_table)
- self._panel.update_lookup_table (lookup_table)
+ self._panel.update_lookup_table (lookup_table, show)
def ShowCandidateWindow (self):
self._panel.show_candidate_window ()
def HideLanguageBar (self):
self._panel.hide_language_bar ()
+ def Reset (self):
+ self._panel.reset ()
+
def Destroy (self):
self._pabel.destroy ()