/usr/share/cinnamon/js/misc/interfaces.js is in cinnamon-common 2.8.6-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | // -*- mode: js; js-indent-level: 4;
const Gio = imports.gi.Gio;
const SETTINGS_DAEMON_NAME = "org.cinnamon.SettingsDaemon";
const SETTINGS_DAEMON_POWER_PATH = "/org/cinnamon/SettingsDaemon/Power";
const DBusIface = '\
<node> \
<interface name="org.freedesktop.DBus"> \
<method name="GetNameOwner"> \
<arg type="s" direction="in" /> \
<arg type="s" direction="out" /> \
</method> \
<method name="ListNames"> \
<arg type="as" direction="out" /> \
</method> \
<signal name="NameOwnerChanged"> \
<arg type="s" direction="out" /> \
<arg type="s" direction="out" /> \
<arg type="s" direction="out" /> \
</signal> \
</interface> \
</node>';
function getDBus() {
let proxy = Gio.DBusProxy.makeProxyWrapper(DBusIface);
return new proxy(Gio.DBus.session,
'org.freedesktop.DBus',
'/org/freedesktop/DBus');
}
function getDBusAsync(callback) {
let proxy = Gio.DBusProxy.makeProxyWrapper(DBusIface);
new proxy(Gio.DBus.session,
'org.freedesktop.DBus',
'/org/freedesktop/DBus',
callback);
}
/****************************************
* Generic property monitor *
****************************************/
const DBusProperties = '\
<node> \
<interface name="org.freedesktop.DBus.Properties"> \
<method name="Get"> \
<arg direction="in" name="interface" type="s"/> \
<arg direction="in" name="propname" type="s"/> \
<arg direction="out" name="value" type="v"/> \
</method> \
<method name="Set"> \
<arg direction="in" name="interface" type="s"/> \
<arg direction="in" name="propname" type="s"/> \
<arg direction="in" name="value" type="v"/> \
</method> \
<method name="GetAll"> \
<arg direction="in" name="interface" type="s"/> \
<arg direction="out" name="props" type="a{sv}"/> \
</method> \
<signal name="PropertiesChanged"> \
<arg type="s" direction="out" /> \
<arg type="a{sv}" direction="out" /> \
<arg type="as" direction="out" /> \
</signal> \
</interface> \
</node>';
function getDBusProperties(name, path) {
let proxy = Gio.DBusProxy.makeProxyWrapper(DBusProperties);
return new proxy(Gio.DBus.session,
name,
path);
}
function getDBusPropertiesAsync(name, path, callback) {
let proxy = Gio.DBusProxy.makeProxyWrapper(DBusProperties);
new proxy(Gio.DBus.session,
name,
path,
callback);
}
/****************************************
* org.cinnamon.SettingsDaemon services *
****************************************/
let xml = { };
xml['org.cinnamon.SettingsDaemon.Power'] =
[
"<node> \
<interface name='org.cinnamon.SettingsDaemon.Power'> \
<property name='Icon' type='s' access='read'/> \
<property name='Tooltip' type='s' access='read'/> \
<method name='GetPrimaryDevice'> \
<arg name='device' type='(sssusdut)' direction='out' /> \
</method> \
<method name='GetDevices'> \
<arg name='devices' type='a(sssusdut)' direction='out' /> \
</method> \
</interface> \
</node>",
SETTINGS_DAEMON_NAME,
SETTINGS_DAEMON_POWER_PATH
];
xml['org.cinnamon.SettingsDaemon.Power.Screen'] =
[
"<node> \
<interface name='org.cinnamon.SettingsDaemon.Power.Screen'> \
<method name='StepUp'> \
<arg type='u' name='new_percentage' direction='out'/> \
</method> \
<method name='StepDown'> \
<arg type='u' name='new_percentage' direction='out'/> \
</method> \
<method name='GetPercentage'> \
<arg type='u' name='percentage' direction='out'/> \
</method> \
<method name='SetPercentage'> \
<arg type='u' name='percentage' direction='in'/> \
<arg type='u' name='new_percentage' direction='out'/> \
</method> \
<signal name='Changed'/> \
</interface> \
</node>",
SETTINGS_DAEMON_NAME,
SETTINGS_DAEMON_POWER_PATH
];
xml['org.cinnamon.SettingsDaemon.Power.Keyboard'] =
[
"<node> \
<interface name='org.cinnamon.SettingsDaemon.Power.Keyboard'> \
<method name='StepUp'> \
<arg type='u' name='new_percentage' direction='out'/> \
</method> \
<method name='StepDown'> \
<arg type='u' name='new_percentage' direction='out'/> \
</method> \
<method name='Toggle'> \
<arg type='u' name='new_percentage' direction='out'/> \
</method> \
<method name='GetPercentage'> \
<arg type='u' name='percentage' direction='out'/> \
</method> \
<method name='SetPercentage'> \
<arg type='u' name='percentage' direction='in'/> \
<arg type='u' name='new_percentage' direction='out'/> \
</method> \
<signal name='Changed'> \
</signal> \
</interface> \
</node>",
SETTINGS_DAEMON_NAME,
SETTINGS_DAEMON_POWER_PATH
];
xml['org.cinnamon.SettingsDaemon.XRANDR_2'] =
[
"<node> \
<interface name='org.cinnamon.SettingsDaemon.XRANDR_2'> \
<annotation name='org.freedesktop.DBus.GLib.CSymbol' value='csd_xrandr_manager_2'/> \
<method name='ApplyConfiguration'> \
<arg name='parent_window_id' type='x' direction='in'/> \
<arg name='timestamp' type='x' direction='in'/> \
</method> \
<method name='VideoModeSwitch'> \
<arg name='timestamp' type='x' direction='in'/> \
</method> \
<method name='Rotate'> \
<arg name='timestamp' type='x' direction='in'/> \
</method> \
<method name='RotateTo'> \
<arg name='rotation' type='i' direction='in'/> \
<arg name='timestamp' type='x' direction='in'/> \
</method> \
</interface> \
</node>",
SETTINGS_DAEMON_NAME,
'/org/cinnamon/SettingsDaemon/XRANDR'
];
/****************************************
* Ownable interfaces *
****************************************/
const MEDIA_PLAYER_2_PATH = "/org/mpris/MediaPlayer2";
let xml_with_owner = { };
xml_with_owner['org.mpris.MediaPlayer2'] =
[
"<node> \
<interface name='org.mpris.MediaPlayer2'> \
<method name='Raise'/> \
<method name='Quit'/> \
<property name='CanQuit' type='b' access='read'/> \
<property name='CanRaise' type='b' access='read'/> \
<property name='HasTrackList' type='b' access='read'/> \
<property name='Identity' type='s' access='read'/> \
<property name='DesktopEntry' type='s' access='read'/> \
<property name='SupportedUriSchemes' type='as' access='read'/> \
<property name='SupportedMimeTypes' type='as' access='read'/> \
</interface> \
</node>",
MEDIA_PLAYER_2_PATH
]
xml_with_owner['org.mpris.MediaPlayer2.Player'] =
[
"<node> \
<interface name='org.mpris.MediaPlayer2.Player'> \
<method name='Next'/> \
<method name='Previous'/> \
<method name='Pause'/> \
<method name='PlayPause'/> \
<method name='Stop'/> \
<method name='Play'/> \
<method name='Seek'> \
<arg direction='in' name='Offset' type='x'/> \
</method> \
<method name='SetPosition'> \
<arg direction='in' name='TrackId' type='o'/> \
<arg direction='in' name='Position' type='x'/> \
</method> \
<method name='OpenUri'> \
<arg direction='in' name='Uri' type='s'/> \
</method> \
<signal name='Seeked'> \
<arg name='Position' type='x'/> \
</signal> \
<property name='PlaybackStatus' type='s' access='read'/> \
<property name='LoopStatus' type='s' access='readwrite'/> \
<property name='Rate' type='d' access='readwrite'/> \
<property name='Shuffle' type='b' access='readwrite'/> \
<property name='Metadata' type='a{sv}' access='read'/> \
<property name='Volume' type='d' access='readwrite'/> \
<property name='Position' type='x' access='read'/> \
<property name='MinimumRate' type='d' access='read'/> \
<property name='MaximumRate' type='d' access='read'/> \
<property name='CanGoNext' type='b' access='read'/> \
<property name='CanGoPrevious' type='b' access='read'/> \
<property name='CanPlay' type='b' access='read'/> \
<property name='CanPause' type='b' access='read'/> \
<property name='CanSeek' type='b' access='read'/> \
<property name='CanControl' type='b' access='read'/> \
</interface> \
</node>",
MEDIA_PLAYER_2_PATH
]
/*
More to come
*/
/***********
* Factory *
***********/
function getDBusProxy(which) {
let proxy = Gio.DBusProxy.makeProxyWrapper(xml[which][0]);
return new proxy(Gio.DBus.session,
xml[which][1],
xml[which][2]);
}
function getDBusProxyAsync(which, callback) {
let proxy = Gio.DBusProxy.makeProxyWrapper(xml[which][0]);
new proxy(Gio.DBus.session,
xml[which][1],
xml[which][2],
callback);
}
function getDBusProxyWithOwner(which, owner) {
let proxy = Gio.DBusProxy.makeProxyWrapper(xml_with_owner[which][0]);
return new proxy(Gio.DBus.session,
owner,
xml_with_owner[which][1]);
}
function getDBusProxyWithOwnerAsync(which, owner, callback) {
let proxy = Gio.DBusProxy.makeProxyWrapper(xml_with_owner[which][0]);
new proxy(Gio.DBus.session,
owner,
xml_with_owner[which][1],
callback);
}
|