forked from sarim/ibus-avro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main-seed.js
executable file
·70 lines (63 loc) · 2.16 KB
/
main-seed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env seed
const IBus = imports.gi.IBus;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
Seed.include('avro-lib.js');
IBus.init();
//get the ibus bus
var bus = new IBus.Bus();
if( bus.is_connected() ){
var avroengine = new GType({
name: "avroengine",
parent: GObject.type_from_name('IBusEngine'),
init: function(klass){
//print("i am geting warmed up");
//for (i in this.signal) print (i);
// this.signal.enable.connect(function() {
// print("enabled");
// });
klass.signal.connect("process-key-event", function(engine, keyval, keycode, state){
//for (i in engine) print (i);
return true;
});
}
});
var factory = new IBus.Factory.c_new( bus.get_connection() );
//factory.add_engine("avro-phonetic",GObject.type_from_name('avroengine'));
factory.signal.connect('create-engine', function(f, engine_name) {
var engine = new IBus.Engine({
engine_name: engine_name,
object_path: '/org/freedesktop/IBus/Engine/1',
connection: bus.get_connection()
});
engine.signal.connect("process-key-event", function(engine, keyval, keycode, state) {
//for (i in engine) print (i);
pri;
return true;
});
return engine;
});
var component = new IBus.Component({
name:"org.freedesktop.IBus.Avro",
description:"Avro phonetic Component",
version:"0.1.0",
license:"GPL",
author:"Sarim Khan <[email protected]>",
homepage:"http://omicronlab.com",
exec:"/home/sarim/avro/main.js",
textdomain:"avro-phonetic"
});
var avroenginedesc = new IBus.EngineDesc({
name:"avro-phonetic",
longname:"avro phonetic",
description:"Avro Phonetic Engine",
language:"bn",
license:"GPL",
author:"Sarim Khan <[email protected]>",
icon:"/home/sarim/avro-bangla.png",
layout:"us"
});
component.add_engine (avroenginedesc);
bus.register_component (component);
IBus.main();
}