// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Signals = imports.signals;
const PresenceIface =
;
const PresenceStatus = {
AVAILABLE: 0,
INVISIBLE: 1,
BUSY: 2,
IDLE: 3
};
const Presence = new Gio.DBusProxyClass({
Name: 'GnomeSessionPresence',
Interface: PresenceIface,
_init: function() {
this.parent({ g_bus_type: Gio.BusType.SESSION,
g_name: 'org.gnome.SessionManager',
g_object_path: '/org/gnome/SessionManager/Presence' });
}
});
// Note inhibitors are immutable objects, so they don't
// change at runtime (changes always come in the form
// of new inhibitors)
const InhibitorIface =
;
const Inhibitor = new Gio.DBusProxyClass({
Name: 'GnomeSessionInhibitor',
Interface: InhibitorIface,
_init: function(inhibitor) {
this.parent({ g_bus_type: Gio.BusType.SESSION,
g_name: 'org.gnome.SessionManager',
g_object_path: inhibitor });
}
});
// Not the full interface, only the methods we use
const SessionManagerIface =
;
const SessionManager = new Gio.DBusProxyClass({
Name: 'GnomeSessionManager',
Interface: SessionManagerIface,
_init: function() {
this.parent({ g_bus_type: Gio.BusType.SESSION,
g_name: 'org.gnome.SessionManager',
g_object_path: '/org/gnome/SessionManager' });
},
});