summaryrefslogtreecommitdiffstats
path: root/ibus
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-05-18 23:00:43 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-05-18 23:00:43 +0800
commit2a863969bc557ba3847062558b349f7976ae42fc (patch)
tree72bfc8c4bd1b134c9af9e4582e61816dfc40b759 /ibus
parent3c627611dc49468d1d2ff9485c98a71666c78226 (diff)
downloadibus-2a863969bc557ba3847062558b349f7976ae42fc.tar.gz
ibus-2a863969bc557ba3847062558b349f7976ae42fc.tar.xz
ibus-2a863969bc557ba3847062558b349f7976ae42fc.zip
WIP.
Diffstat (limited to 'ibus')
-rw-r--r--ibus/common.py2
-rw-r--r--ibus/interface.py106
2 files changed, 81 insertions, 27 deletions
diff --git a/ibus/common.py b/ibus/common.py
index 76eab3e..6794901 100644
--- a/ibus/common.py
+++ b/ibus/common.py
@@ -5,6 +5,8 @@ IBUS_IFACE = "org.freedesktop.IBus"
IBUS_PATH = "/org/freedesktop/IBus"
IBUS_NAME = "org.freedesktop.IBus"
+IBUS_PANEL_IFACE = "org.freedesktop.IBus.Panel"
+
IBUS_ENGINE_FACTORY_IFACE = "org.freedesktop.IBus.EngineFactory"
IBUS_ENGINE_IFACE = "org.freedesktop.IBus.Engine"
diff --git a/ibus/interface.py b/ibus/interface.py
index 52a7028..65f3473 100644
--- a/ibus/interface.py
+++ b/ibus/interface.py
@@ -1,44 +1,43 @@
import dbus.service
from common import \
- IBUS_NAME, \
IBUS_IFACE, \
- IBUS_PATH, \
+ IBUS_PANEL_IFACE, \
IBUS_ENGINE_IFACE, \
IBUS_ENGINE_FACTORY_IFACE
class IIBus (dbus.service.Object):
# define method decorator.
method = lambda **args: \
- dbus.service.method (dbus_interface=IBUS_IFACE, \
- connection_keyword="dbusconn", \
+ dbus.service.method (dbus_interface = IBUS_IFACE, \
+ connection_keyword = "dbusconn", \
**args)
# define async method decorator.
async_method = lambda **args: \
- dbus.service.method (dbus_interface=IBUS_IFACE, \
- connection_keyword="dbusconn", \
- async_callbacks=("reply_cb", "error_cb"), \
+ dbus.service.method (dbus_interface = IBUS_IFACE, \
+ connection_keyword = "dbusconn", \
+ async_callbacks = ("reply_cb", "error_cb"), \
**args)
- @method (out_signature="s")
+ @method (out_signature = "s")
def GetIBusAddress (self, dbusconn): pass
- @method (in_signature="s")
+ @method (in_signature = "s")
def RegisterClient (self, client_name, dbusconn): pass
@method ()
def UnregisterClient (self, dbusconn): pass
- @method (in_signature="ao")
+ @method (in_signature = "ao")
def RegisterFactories (self, object_paths, dbusconn): pass
- @method (in_signature="ao")
+ @method (in_signature = "ao")
def UnregisterFactories (self, object_paths, dbusconn): pass
- @async_method (in_signature="ubu", out_signature="b")
+ @async_method (in_signature = "ubu", out_signature = "b")
def ProcessKeyEvent (self, keyval, is_press, state, dbusconn, reply_cb, error_cb): pass
- @method (in_signature="iiii")
+ @method (in_signature = "iiii")
def SetCursorLocation (self, x, y, w, h, dbusconn): pass
@method ()
@@ -50,22 +49,22 @@ class IIBus (dbus.service.Object):
@method ()
def Reset (self, dbusconn): pass
- @method (out_signature="b")
+ @method (out_signature = "b")
def IsEnabled (self, dbusconn): pass
class IEngineFactory (dbus.service.Object):
# define method decorator.
method = lambda **args: \
- dbus.service.method (dbus_interface=IBUS_ENGINE_FACTORY_IFACE, \
+ dbus.service.method (dbus_interface = IBUS_ENGINE_FACTORY_IFACE, \
**args)
# define async method decorator.
async_method = lambda **args: \
- dbus.service.method (dbus_interface=IBUS_ENGINE_FACTORY_IFACE, \
- async_callbacks=("reply_cb", "error_cb"), \
+ dbus.service.method (dbus_interface = IBUS_ENGINE_FACTORY_IFACE, \
+ async_callbacks = ("reply_cb", "error_cb"), \
**args)
# Return a array. [name, language, icon_path, authors, credits]
- @method (out_signature="as")
+ @method (out_signature = "as")
def GetInfo (self): pass
# Factory should allocate all resources in this method
@@ -78,31 +77,31 @@ class IEngineFactory (dbus.service.Object):
# Create an input context and return the id of the context.
# If failed, it will return "" or None.
- @method (out_signature="o")
+ @method (out_signature = "o")
def CreateEngine (self): pass
class IEngine (dbus.service.Object):
# define method decorator.
method = lambda **args: \
- dbus.service.method (dbus_interface=IBUS_ENGINE_IFACE, \
+ dbus.service.method (dbus_interface = IBUS_ENGINE_IFACE, \
**args)
# define signal decorator.
signal = lambda **args: \
- dbus.service.signal (dbus_interface=IBUS_ENGINE_IFACE, \
+ dbus.service.signal (dbus_interface = IBUS_ENGINE_IFACE, \
**args)
# define async method decorator.
async_method = lambda **args: \
- dbus.service.method (dbus_interface=IBUS_ENGINE_IFACE, \
- async_callbacks=("reply_cb", "error_cb"), \
+ dbus.service.method (dbus_interface = IBUS_ENGINE_IFACE, \
+ async_callbacks = ("reply_cb", "error_cb"), \
**args)
- @method (in_signature="ubu", out_signature="b")
+ @method (in_signature = "ubu", out_signature = "b")
def ProcessKeyEvent (self, keyval, is_press, state):
pass
- @method (in_signature="iiii")
+ @method (in_signature = "iiii")
def SetCursorLocation (self, x, y, w, h): pass
@method ()
@@ -114,11 +113,64 @@ class IEngine (dbus.service.Object):
@method ()
def Reset (self): pass
- @method (in_signature="b")
+ @method (in_signature = "b")
def SetEnable (self, enable): pass
@method ()
def Destroy (self): pass
- @signal ()
+ @signal (signature = "s")
def CommitString (self, text): pass
+
+ @signal (signature = "saaii")
+ def PreeditChanged (self, text, attrs, cursor_pos):
+ pass
+
+ @signal (signature = "a(saai)i")
+ def LookupTableChanged (self, lookup_table, cursor_pos):
+ pass
+
+ @signal ()
+ def LookupTablePageUp (self):
+ pass
+
+ @signal ()
+ def LookupTablePageDown (self):
+ pass
+
+ @signal ()
+ def LookupTableCursorUp (self):
+ pass
+
+ @signal ()
+ def LookupTableCursorDown (self):
+ pass
+
+class IPanel (dbus.service.Object):
+ # define method decorator.
+ method = lambda **args: \
+ dbus.service.method (dbus_interface = IBUS_PANEL_IFACE, \
+ **args)
+
+ # define signal decorator.
+ signal = lambda **args: \
+ dbus.service.signal (dbus_interface = IBUS_PANEL_IFACE, \
+ **args)
+
+ # define async method decorator.
+ async_method = lambda **args: \
+ dbus.service.method (dbus_interface = IBUS_PANE_IFACE, \
+ async_callbacks = ("reply_cb", "error_cb"), \
+ **args)
+
+ @signal ()
+ def PageUp (self): pass
+
+ @signal ()
+ def PageDown (self): pass
+
+ @signal ()
+ def CursorUp (self): pass
+
+ @signal ()
+ def CursorDown (self): pass