1 /* vim:set et sts=4 sw=4:
5 * Copyright(c) 2011 Peng Huang <shawn.p.huang@gmail.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or(at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 * Boston, MA 02111-1307 USA
25 class DummyEngine : IBus.EngineSimple {
28 public int main(string[] args) {
31 IBus.Bus bus = new IBus.Bus();
32 if (!bus.is_connected()) {
33 warning("ibus-daemon does not exist.");
38 IBus.BusNameFlag.REPLACE_EXISTING |
39 IBus.BusNameFlag.ALLOW_REPLACEMENT;
40 uint retval = bus.request_name("org.freedesktop.IBus.Simple", flags);
43 warning("Registry bus name org.freedesktop.IBus.Simple failed!");
47 bus.disconnected.connect((bus) => {
48 debug("bus disconnected");
52 IBus.Factory factory = new IBus.Factory(bus.get_connection());
56 factory.create_engine.connect((factory, name) => {
57 const string path = "/org/freedesktop/IBus/engine/simple/%d";
58 IBus.Engine engine = new IBus.Engine.type(
59 typeof(IBus.EngineSimple), name,
60 path.printf(++id), bus.get_connection());