Commit 2021311a authored by Daiki Ueno's avatar Daiki Ueno

Add destroyed signal in python binding.

parent b64e91df
......@@ -36,7 +36,15 @@ class Context(gobject.GObject):
'key-released': (
gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_UINT,))
(gobject.TYPE_UINT,)),
'destroyed': (
gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
()),
}
__gproperties__ = {
'keyboard-visible': (bool, None, None, False, gobject.PARAM_READABLE),
}
def __init__(self, giobject):
......@@ -47,6 +55,7 @@ class Context(gobject.GObject):
self.__giobject.connect('disabled', lambda *args: self.emit('disabled'))
self.__giobject.connect('key-pressed', lambda *args: self.emit('key-pressed', args[1]))
self.__giobject.connect('key-released', lambda *args: self.emit('key-released', args[1]))
self.__giobject.connect('destroyed', lambda *args: self.emit('destroyed'))
def get_giobject(self):
return self.__giobject
......
......@@ -22,11 +22,18 @@ from context import Context
class Eekboard(gobject.GObject):
__gtype_name__ = "PYEekboardEekboard"
__gsignals__ = {
'destroyed': (
gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
())
}
def __init__(self):
super(Eekboard, self).__init__()
self.__connection = Gio.bus_get_sync(Gio.BusType.SESSION, None)
self.__eekboard = gi.repository.Eekboard.Eekboard.new(self.__connection, None);
self.__eekboard.connect('destroyed', lambda *args: self.emit('destroyed'))
def create_context(self, client_name):
context = self.__eekboard.create_context(client_name, None)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment