summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-10-06 13:59:52 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-10-06 13:59:52 +0800
commita715f71bc4171298f8e57d1b9b3f8eb42ade1938 (patch)
treebd39cb1d5202942fe647e4a91fe6725e4fa1aa3e
parentbb1339b4e2a4dd5af95bc594b4d35b83fdcbbd5f (diff)
downloadibus-a715f71bc4171298f8e57d1b9b3f8eb42ade1938.tar.gz
ibus-a715f71bc4171298f8e57d1b9b3f8eb42ade1938.tar.xz
ibus-a715f71bc4171298f8e57d1b9b3f8eb42ade1938.zip
Add INotifications interface.
-rw-r--r--ibus/interface/Makefile.am3
-rw-r--r--ibus/interface/inotifications.py56
2 files changed, 58 insertions, 1 deletions
diff --git a/ibus/interface/Makefile.am b/ibus/interface/Makefile.am
index e2bad8e..0e1f8b9 100644
--- a/ibus/interface/Makefile.am
+++ b/ibus/interface/Makefile.am
@@ -24,8 +24,9 @@ ibus_interface_PYTHON = \
ienginefactory.py \
iengine.py \
iibus.py \
- __init__.py \
ipanel.py \
+ inotifications.py \
+ __init__.py \
$(NULL)
ibus_interfacedir = @pkgpythondir@/interface
diff --git a/ibus/interface/inotifications.py b/ibus/interface/inotifications.py
new file mode 100644
index 0000000..7d667f2
--- /dev/null
+++ b/ibus/interface/inotifications.py
@@ -0,0 +1,56 @@
+# vim:set et sts=4 sw=4:
+#
+# ibus - The Input Bus
+#
+# Copyright(c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or(at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+# Boston, MA 02111-1307 USA
+
+__all__ = ("INotifications", )
+
+import dbus.service
+from ibus.common import \
+ IBUS_NOTIFICATIONS_IFACE
+
+class INotifications(dbus.service.Object):
+ # define method decorator.
+ method = lambda **args: \
+ dbus.service.method(dbus_interface = IBUS_NOTIFICATIONS_IFACE, \
+ **args)
+
+ # define signal decorator.
+ signal = lambda **args: \
+ dbus.service.signal(dbus_interface = IBUS_NOTIFICATIONS_IFACE, \
+ **args)
+
+ # define async method decorator.
+ async_method = lambda **args: \
+ dbus.service.method(dbus_interface = IBUS_NOTIFICATIONS_IFACE, \
+ async_callbacks = ("reply_cb", "error_cb"), \
+ **args)
+
+ @method(in_signature="usssasi", out_signature="u")
+ def Notify(self, replaces_id, app_icon, summary, body, actions, expire_timeout): pass
+
+ @method(in_signature="u")
+ def CloseNotification(self, id): pass
+
+ #signals
+ @signal(signature="uu")
+ def NotificationClosed(self, id, reason): pass
+
+ @signal(signature="us")
+ def ActionInvoked(self, id, action_key): pass