2011-09-28 09:16:26 -04:00
|
|
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
2011-09-06 16:17:08 -04:00
|
|
|
|
2011-11-20 11:52:50 -05:00
|
|
|
const Gio = imports.gi.Gio;
|
2011-09-06 16:17:08 -04:00
|
|
|
const Lang = imports.lang;
|
|
|
|
const Shell = imports.gi.Shell;
|
|
|
|
const Signals = imports.signals;
|
|
|
|
|
2013-10-24 17:51:58 -04:00
|
|
|
const FprintManagerIface = '<node> \
|
|
|
|
<interface name="net.reactivated.Fprint.Manager"> \
|
|
|
|
<method name="GetDefaultDevice"> \
|
|
|
|
<arg type="o" direction="out" /> \
|
|
|
|
</method> \
|
|
|
|
</interface> \
|
|
|
|
</node>';
|
2011-09-06 16:17:08 -04:00
|
|
|
|
2012-04-27 17:51:18 -04:00
|
|
|
const FprintManagerInfo = Gio.DBusInterfaceInfo.new_for_xml(FprintManagerIface);
|
2011-09-06 16:17:08 -04:00
|
|
|
|
2011-11-20 11:52:50 -05:00
|
|
|
function FprintManager() {
|
2012-04-27 17:51:18 -04: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 15:56:19 -04:00
|
|
|
g_flags: (Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
|
2012-04-27 17:51:18 -04:00
|
|
|
|
2017-03-14 16:02:51 -04:00
|
|
|
try {
|
|
|
|
self.init(null);
|
|
|
|
} catch(e) {
|
|
|
|
log('Failed to connect to Fprint service: ' + e.message);
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2012-04-27 17:51:18 -04:00
|
|
|
return self;
|
|
|
|
}
|