11
12
// Subset of gnome-mag's Magnifier dbus interface -- to be expanded. See:
12
13
// http://git.gnome.org/browse/gnome-mag/tree/xml/...Magnifier.xml
13
const MagnifierIface = {
14
name: MAG_SERVICE_NAME,
16
{ name: 'setActive', inSignature: 'b', outSignature: '' },
17
{ name: 'isActive', inSignature: '', outSignature: 'b' },
18
{ name: 'showCursor', inSignature: '', outSignature: '' },
19
{ name: 'hideCursor', inSignature: '', outSignature: '' },
20
{ name: 'createZoomRegion', inSignature: 'ddaiai', outSignature: 'o' },
21
{ name: 'addZoomRegion', inSignature: 'o', outSignature: 'b' },
22
{ name: 'getZoomRegions', inSignature: '', outSignature: 'ao' },
23
{ name: 'clearAllZoomRegions', inSignature: '', outSignature: '' },
24
{ name: 'fullScreenCapable', inSignature: '', outSignature: 'b' },
26
{ name: 'setCrosswireSize', inSignature: 'i', outSignature: '' },
27
{ name: 'getCrosswireSize', inSignature: '', outSignature: 'i' },
28
{ name: 'setCrosswireLength', inSignature: 'i', outSignature: '' },
29
{ name: 'getCrosswireLength', inSignature: '', outSignature: 'i' },
30
{ name: 'setCrosswireClip', inSignature: 'b', outSignature: '' },
31
{ name: 'getCrosswireClip', inSignature: '', outSignature: 'b' },
32
{ name: 'setCrosswireColor', inSignature: 'u', outSignature: '' },
33
{ name: 'getCrosswireColor', inSignature: '', outSignature: 'u' }
14
const MagnifierIface = <interface name={MAG_SERVICE_NAME}>
15
<method name="setActive">
16
<arg type="b" direction="in" />
18
<method name="isActive">
19
<arg type="b" direction="out" />
21
<method name="showCursor" />
22
<method name="hideCursor" />
23
<method name="createZoomRegion">
24
<arg type="d" direction="in" />
25
<arg type="d" direction="in" />
26
<arg type="ai" direction="in" />
27
<arg type="ai" direction="in" />
28
<arg type="o" direction="out" />
30
<method name="addZoomRegion">
31
<arg type="o" direction="in" />
32
<arg type="b" direction="out" />
34
<method name="getZoomRegions">
35
<arg type="ao" direction="out" />
37
<method name="clearAllZoomRegions" />
38
<method name="fullScreenCapable">
39
<arg type="b" direction="out" />
41
<method name="setCrosswireSize">
42
<arg type="i" direction="in" />
44
<method name="getCrosswireSize">
45
<arg type="i" direction="out" />
47
<method name="setCrosswireLength">
48
<arg type="i" direction="in" />
50
<method name="getCrosswireLength">
51
<arg type="i" direction="out" />
53
<method name="setCrosswireClip">
54
<arg type="b" direction="in" />
56
<method name="getCrosswireClip">
57
<arg type="b" direction="out" />
59
<method name="setCrosswireColor">
60
<arg type="u" direction="in" />
62
<method name="getCrosswireColor">
63
<arg type="u" direction="out" />
39
67
// Subset of gnome-mag's ZoomRegion dbus interface -- to be expanded. See:
40
68
// http://git.gnome.org/browse/gnome-mag/tree/xml/...ZoomRegion.xml
41
const ZoomRegionIface = {
42
name: ZOOM_SERVICE_NAME,
44
{ name: 'setMagFactor', inSignature: 'dd', outSignature: ''},
45
{ name: 'getMagFactor', inSignature: '', outSignature: 'dd' },
46
{ name: 'setRoi', inSignature: 'ai', outSignature: '' },
47
{ name: 'getRoi', inSignature: '', outSignature: 'ai' },
48
{ name: 'shiftContentsTo', inSignature: 'ii', outSignature: 'b' },
49
{ name: 'moveResize', inSignature: 'ai', outSignature: '' }
69
const ZoomRegionIface = <interface name={ZOOM_SERVICE_NAME}>
70
<method name="setMagFactor">
71
<arg type="d" direction="in" />
72
<arg type="d" direction="in" />
74
<method name="getMagFactor">
75
<arg type="d" direction="out" />
76
<arg type="d" direction="out" />
78
<method name="setRoi">
79
<arg type="ai" direction="in" />
81
<method name="getRoi">
82
<arg type="ai" direction="out" />
84
<method name="shiftContentsTo">
85
<arg type="i" direction="in" />
86
<arg type="i" direction="in" />
87
<arg type="b" direction="out" />
89
<method name="moveResize">
90
<arg type="ai" direction="in" />
55
94
// For making unique ZoomRegion DBus proxy object paths of the form:
56
95
// '/org/gnome/Magnifier/ZoomRegion/zoomer0',
57
96
// '/org/gnome/Magnifier/ZoomRegion/zoomer1', etc.
58
97
let _zoomRegionInstanceCount = 0;
60
function ShellMagnifier() {
99
const ShellMagnifier = new Lang.Class({
100
Name: 'ShellMagnifier',
64
ShellMagnifier.prototype = {
65
102
_init: function() {
66
103
this._zoomers = {};
67
DBus.session.exportObject(MAG_SERVICE_PATH, this);
105
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(MagnifierIface, this);
106
this._dbusImpl.export(Gio.DBus.session, MAG_SERVICE_PATH);