|
Packit Service |
1d8f1c |
# vim:set et sts=4 sw=4:
|
|
Packit Service |
1d8f1c |
#
|
|
Packit Service |
1d8f1c |
# ibus - The Input Bus
|
|
Packit Service |
1d8f1c |
#
|
|
Packit Service |
1d8f1c |
# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
|
|
Packit Service |
1d8f1c |
# Copyright (c) 2007-2010 Red Hat, Inc.
|
|
Packit Service |
1d8f1c |
#
|
|
Packit Service |
1d8f1c |
# This library is free software; you can redistribute it and/or
|
|
Packit Service |
1d8f1c |
# modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
# License as published by the Free Software Foundation; either
|
|
Packit Service |
1d8f1c |
# version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
1d8f1c |
#
|
|
Packit Service |
1d8f1c |
# This library is distributed in the hope that it will be useful,
|
|
Packit Service |
1d8f1c |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
1d8f1c |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
1d8f1c |
# Lesser General Public License for more details.
|
|
Packit Service |
1d8f1c |
#
|
|
Packit Service |
1d8f1c |
# You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
# License along with this library; if not, write to the Free Software
|
|
Packit Service |
1d8f1c |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
|
Packit Service |
1d8f1c |
# USA
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
__all__ = ("IEngineFactory", )
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
import dbus.service
|
|
Packit Service |
1d8f1c |
from ibus.common import \
|
|
Packit Service |
1d8f1c |
IBUS_IFACE_ENGINE_FACTORY
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
class IEngineFactory(dbus.service.Object):
|
|
Packit Service |
1d8f1c |
# define method decorator.
|
|
Packit Service |
1d8f1c |
method = lambda **args: \
|
|
Packit Service |
1d8f1c |
dbus.service.method(dbus_interface=IBUS_IFACE_ENGINE_FACTORY, \
|
|
Packit Service |
1d8f1c |
**args)
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
# define async method decorator.
|
|
Packit Service |
1d8f1c |
async_method = lambda **args: \
|
|
Packit Service |
1d8f1c |
dbus.service.method(dbus_interface=IBUS_IFACE_ENGINE_FACTORY, \
|
|
Packit Service |
1d8f1c |
async_callbacks=("reply_cb", "error_cb"), \
|
|
Packit Service |
1d8f1c |
**args)
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
# Return a array. [name, default_language, icon_path, authors, credits]
|
|
Packit Service |
1d8f1c |
@method(out_signature="as")
|
|
Packit Service |
1d8f1c |
def GetInfo(self): pass
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
# Factory should allocate all resources in this method
|
|
Packit Service |
1d8f1c |
@method()
|
|
Packit Service |
1d8f1c |
def Initialize(self): pass
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
# Factory should free all allocated resources in this method
|
|
Packit Service |
1d8f1c |
@method()
|
|
Packit Service |
1d8f1c |
def Uninitialize(self): pass
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
# Create an input context and return the id of the context.
|
|
Packit Service |
1d8f1c |
# If failed, it will return "" or None.
|
|
Packit Service |
1d8f1c |
@method(in_signature="s", out_signature="o")
|
|
Packit Service |
1d8f1c |
def CreateEngine(self, engine_name): pass
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
# Destroy the engine
|
|
Packit Service |
1d8f1c |
@method()
|
|
Packit Service |
1d8f1c |
def Destroy(self): pass
|