2011-09-28 13:16:26 +00:00
|
|
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
2011-09-06 20:17:08 +00:00
|
|
|
|
2011-11-20 16:52:50 +00:00
|
|
|
const Gio = imports.gi.Gio;
|
2011-09-06 20:17:08 +00:00
|
|
|
|
2018-08-23 00:55:02 +00:00
|
|
|
const FprintManagerIface = `
|
|
|
|
<node>
|
|
|
|
<interface name="net.reactivated.Fprint.Manager">
|
|
|
|
<method name="GetDefaultDevice">
|
|
|
|
<arg type="o" direction="out" />
|
|
|
|
</method>
|
|
|
|
</interface>
|
|
|
|
</node>`;
|
2011-09-06 20:17:08 +00:00
|
|
|
|
2012-04-27 21:51:18 +00:00
|
|
|
const FprintManagerInfo = Gio.DBusInterfaceInfo.new_for_xml(FprintManagerIface);
|
2011-09-06 20:17:08 +00:00
|
|
|
|
2011-11-20 16:52:50 +00:00
|
|
|
function FprintManager() {
|
2012-04-27 21:51:18 +00:00
|
|
|
var self = new Gio.DBusProxy({ g_connection: Gio.DBus.system,
|
|
|
|
g_interface_name: FprintManagerInfo.name,
|
|
|
|
g_interface_info: FprintManagerInfo,
|
|
|
|
g_name: 'net.reactivated.Fprint',
|
|
|
|
g_object_path: '/net/reactivated/Fprint/Manager',
|
2012-09-13 19:56:19 +00:00
|
|
|
g_flags: (Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
|
2012-04-27 21:51:18 +00:00
|
|
|
|
2017-03-14 20:02:51 +00:00
|
|
|
try {
|
|
|
|
self.init(null);
|
2019-01-29 01:26:39 +00:00
|
|
|
} catch (e) {
|
2017-03-14 20:02:51 +00:00
|
|
|
log('Failed to connect to Fprint service: ' + e.message);
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2012-04-27 21:51:18 +00:00
|
|
|
return self;
|
|
|
|
}
|