def __init__(self): IBus.init() self.__id = 0 self.__rerun = False self.__test_index = 0 self.__conversion_index = 0 self.__commit_done = False
def setUpClass(cls) -> None: cls._flag = False IBus.init() cls._gsettings = Gio.Settings( schema='org.freedesktop.ibus.engine.typing-booster') cls._orig_dictionary = cls._gsettings.get_string('dictionary') cls._orig_tabenable = cls._gsettings.get_boolean('tabenable') cls._orig_inputmode = cls._gsettings.get_boolean('inputmode') cls._orig_inline_completion = cls._gsettings.get_int( 'inlinecompletion') cls._orig_auto_select_candidate = cls._gsettings.get_boolean( 'autoselectcandidate') signums: List[Optional[signal.Signals]] = [ getattr(signal, s, None) for s in 'SIGINT SIGTERM SIGHUP'.split() ] for signum in filter(None, signums): original_handler = signal.getsignal(signum) GLib.unix_signal_add(GLib.PRIORITY_HIGH, signum, cls.signal_handler, (signum, original_handler))
def launch_engine(exec_by_ibus): IBus.init() IMApp(exec_by_ibus).run()
we will need to revisit how this engine is laid out and likely create our own panel applet to provide a richer input environment and natural controls and to provide a tooltip showing the current partial recognition at that point this engine will be primarily responsible for keeping track of where text was inserted (so that we can remove the text if we need to do a correction). """ import gi gi.require_version('IBus', '1.0') from gi.repository import IBus from gi.repository import GObject, GLib, Gio IBus.init() from . import eventreceiver, interpreter import json, logging, threading, time, errno, socket, select, os log = logging.getLogger(__name__ if __name__ != '__main__' else 'ibus') BUS = None MAINLOOP = None NAME = 'Listener' SERVICE_NAME = NAME.lower() COMPONENT = "org.freedesktop.IBus.%s" % (NAME, ) USER_RUN_DIR = os.environ.get('XDG_RUNTIME_DIR', '/run/user/%s' % (os.geteuid())) RUN_DIR = os.path.join(USER_RUN_DIR, 'listener') DEFAULT_PIPE = os.path.join(RUN_DIR, 'clean-events')
def run(self): IBus.init() self.__mainloop.run()
def launch_engine(exec_by_ibus: bool) -> None: IBus.init() IMApp(exec_by_ibus).run()
# # Copyright (c) 2011 Peng Huang <*****@*****.**> # # 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 import glib import gio from gi.repository import IBus IBus.init() main = glib.MainLoop() bus = IBus.Bus() ic = bus.create_input_context("ibus-test") ic.get_engine() ic.get_engine() ic.get_engine() ic.get_engine()