|
Packit |
3ff832 |
# vim:set et sts=4 sw=4:
|
|
Packit |
3ff832 |
#
|
|
Packit |
3ff832 |
# ibus - The Input Bus
|
|
Packit |
3ff832 |
#
|
|
Packit |
3ff832 |
# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
|
|
Packit |
3ff832 |
# Copyright (c) 2007-2010 Red Hat, Inc.
|
|
Packit |
3ff832 |
#
|
|
Packit |
3ff832 |
# This library is free software; you can redistribute it and/or
|
|
Packit |
3ff832 |
# modify it under the terms of the GNU Lesser General Public
|
|
Packit |
3ff832 |
# License as published by the Free Software Foundation; either
|
|
Packit |
3ff832 |
# version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
3ff832 |
#
|
|
Packit |
3ff832 |
# This library is distributed in the hope that it will be useful,
|
|
Packit |
3ff832 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
3ff832 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
3ff832 |
# Lesser General Public License for more details.
|
|
Packit |
3ff832 |
#
|
|
Packit |
3ff832 |
# You should have received a copy of the GNU Lesser General Public
|
|
Packit |
3ff832 |
# License along with this library; if not, write to the Free Software
|
|
Packit |
3ff832 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
|
Packit |
3ff832 |
# USA
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
__all__ = ("IIBus", )
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
import dbus.service
|
|
Packit |
3ff832 |
from ibus.common import \
|
|
Packit |
3ff832 |
IBUS_IFACE_IBUS, \
|
|
Packit |
3ff832 |
IBUS_IFACE_CONFIG
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
class IIBus(dbus.service.Object):
|
|
Packit |
3ff832 |
# define method decorator.
|
|
Packit |
3ff832 |
method = lambda **args: \
|
|
Packit |
3ff832 |
dbus.service.method(dbus_interface=IBUS_IFACE_IBUS, \
|
|
Packit |
3ff832 |
connection_keyword="dbusconn", \
|
|
Packit |
3ff832 |
**args)
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
# define async method decorator.
|
|
Packit |
3ff832 |
async_method = lambda **args: \
|
|
Packit |
3ff832 |
dbus.service.method(dbus_interface=IBUS_IFACE_IBUS, \
|
|
Packit |
3ff832 |
connection_keyword="dbusconn", \
|
|
Packit |
3ff832 |
async_callbacks=("reply_cb", "error_cb"), \
|
|
Packit |
3ff832 |
**args)
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
# define signal decorator.
|
|
Packit |
3ff832 |
signal = lambda **args: \
|
|
Packit |
3ff832 |
dbus.service.signal(dbus_interface=IBUS_IFACE_IBUS, \
|
|
Packit |
3ff832 |
**args)
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
@method(out_signature="s")
|
|
Packit |
3ff832 |
def GetAddress(self, dbusconn): pass
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
# methods for ibus clients
|
|
Packit |
3ff832 |
@method(in_signature="s", out_signature="o")
|
|
Packit |
3ff832 |
def CreateInputContext(self, client_name, dbusconn): pass
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
@method(out_signature="o")
|
|
Packit |
3ff832 |
def CurrentInputContext(self, dbusconn): pass
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
# general methods
|
|
Packit |
3ff832 |
@method(in_signature="av")
|
|
Packit |
3ff832 |
def RegisterComponent(self, components, dbusconn): pass
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
@method(out_signature="av")
|
|
Packit |
3ff832 |
def ListEngines(self, dbusconn): pass
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
@method(in_signature="as", out_signature="av")
|
|
Packit |
3ff832 |
def GetEnginesByNames(self, names, dbusconn): pass
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
@method(out_signature="av")
|
|
Packit |
3ff832 |
def ListActiveEngines(self, dbusconn): pass
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
@method(in_signature="s")
|
|
Packit |
3ff832 |
def SetGlobalEngine(self, name, dbusconn):pass
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
@method(in_signature="b")
|
|
Packit |
3ff832 |
def Exit(self, restart, dbusconn): pass
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
@method(in_signature="v", out_signature="v")
|
|
Packit |
3ff832 |
def Ping(self, data, dbusconn): pass
|
|
Packit |
3ff832 |
|
|
Packit |
3ff832 |
@signal(signature="")
|
|
Packit |
3ff832 |
def RegistryChanged(self): pass
|
|
Packit |
3ff832 |
|