Add Makefile.am for qt.
[ibus.git] / ibusdaemon / connection.py
blobf1d28825751e38edd3501def03e26159fdbfb0d1
1 import dbus.lowlevel
2 import ibus
3 import gobject
5 class Connection (ibus.Object):
6 __gsignals__ = {
7 "dbus-signal" : (
8 gobject.SIGNAL_RUN_FIRST,
9 gobject.TYPE_NONE,
10 (gobject.TYPE_PYOBJECT, )
13 def __init__ (self, dbusconn):
14 ibus.Object.__init__ (self)
15 self._dbusconn = dbusconn
17 def get_object (self, path):
18 return self._dbusconn.get_object ("no.name", path)
20 def emit_dbus_signal (self, name, *args):
21 message = dbus.lowlevel.SignalMessage (ibus.IBUS_PATH, ibus.IBUS_IFACE, name)
22 message.append (*args)
23 self._dbusconn.send_message (message)
24 self._dbusconn.flush ()
26 def do_destroy (self):
27 self._dbusconn = None
29 def dispatch_dbus_signal (self, message):
30 self.emit ("dbus-signal", message)
32 gobject.type_register (Connection)