WIP.
authorHuang Peng <shawn.p.huang@gmail.com>
Tue, 27 May 2008 14:46:40 +0000 (22:46 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Tue, 27 May 2008 14:46:40 +0000 (22:46 +0800)
ibus/interface.py
ibusdaemon/client.py
ibusdaemon/engine.py

index 9e1db419ac977b117a73073d49a980bb67984e74..10eddf1c4ed1347db095b96d6bc391404b875da9 100644 (file)
@@ -119,6 +119,9 @@ class IEngine (dbus.service.Object):
        @method (in_signature = "b")
        def SetEnable (self, enable): pass
 
+       @method (in_signature = "s")
+       def TriggerProperty (self, property): pass
+
        @method ()
        def Destroy (self): pass
 
@@ -132,6 +135,9 @@ class IEngine (dbus.service.Object):
        def PreeditChanged (self, text, attrs, cursor_pos): pass
 
        # below signals are optional. The engine could create and maintain panel by self.
+       @signal ()
+       def UpdateProperties (self, properties): pass
+
        @signal ()
        def AuxStringChanged (self, text, attrs): pass
 
index 21e7eacc65a5da3ad10fe49f0314a70cbc0938ac..160d973b9e89e869fbfce792f939ecb03aab850a 100644 (file)
@@ -93,6 +93,18 @@ class Client (ibus.Object):
        def _preedit_changed_cb (self, engine, text, attrs, cursor):
                self.preedit_changed (self, text, attrs, cursor)
 
+       def _aux_string_changed_cb (self, engine, text, attrs):
+               pass
+
+       def _update_lookup_table (self, engine, lookup_table):
+               pass
+       
+       def _show_lookup_table (self, engine):
+               pass
+       
+       def _hide_lookup_table (self, engine):
+               pass
+
        def _remove_engine_handlers (self):
                assert self._engine != None
                for id in self._engine_handler_ids:
@@ -101,7 +113,17 @@ class Client (ibus.Object):
 
        def _install_engine_handlers (self):
                id = self._engine.connect ("destroy", self._engine_destroy_cb)
+               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)
                self._engine_handler_ids.append (id)
+               id = self._engine.connect ("aux-string-changed", self._aux_string_changed_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)
+
index 360dbcb098c77e27a6e9d1402dcf4dfd8fb1481b..df488b0bb0703de42e3dd49f52898668a76d5faa 100644 (file)
@@ -52,14 +52,12 @@ class Engine (ibus.Object):
                        self.emit ("forward-key-event", args[0], arg[1], arg[2])
                        return True
                elif message.is_signal (ibus.IBUS_ENGINE_IFACE, "PreeditChanged"):
-                       args = message.get_args_list ()
                        attrs = ibus.attr_list_from_dbus_value (args[1])
-                       self.emit ("preedit-changed", args[0], attrs, args[2])
+                       self.emit ("preedit-changed", args[0], args[1], args[2])
                        return True
                elif message.is_signal (ibus.IBUS_ENGINE_IFACE, "AuxStringChanged"):
-                       args = message.get_args_list ()
                        attrs = ibus.attr_list_from_dbus_value (args[1])
-                       self.emit ("aux-string-changed", args[0], attrs)
+                       self.emit ("aux-string-changed", args[0], args[1])
                        return True
                elif message.is_signal (ibus.IBUS_ENGINE_IFACE, "UpdateLookupTable"):
                        args = message.get_args_list ()