/usr/share/gnome-shell/extensions/mediaplayer@patapon.info/dbus.js is in gnome-shell-extension-mediaplayer 3.5-3.
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 | /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
/* jshint esnext: true */
/* jshint multistr: true */
/**
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Settings = Me.imports.settings;
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>';
const DBusProxy = Gio.DBusProxy.makeProxyWrapper(DBusIface);
const PropertiesIface = '<node>\
<interface name="org.freedesktop.DBus.Properties">\
<method name="Get">\
<arg type="s" direction="in" />\
<arg type="s" direction="in" />\
<arg type="v" direction="out" />\
</method>\
<method name="GetAll"> \
<arg direction="in" type="s"/> \
<arg direction="out" 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>';
const PropertiesProxy = Gio.DBusProxy.makeProxyWrapper(PropertiesIface);
const MediaServer2Iface = '<node>\
<interface name="org.mpris.MediaPlayer2">\
<method name="Raise" />\
<method name="Quit" />\
<property name="CanRaise" type="b" access="read" />\
<property name="CanQuit" 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" />\
</interface>\
</node>';
const MediaServer2Proxy = Gio.DBusProxy.makeProxyWrapper(MediaServer2Iface);
// For some reason the Nuvola dev was told to scab in a non-spec
// prop and method for the support of setting ratings instead of
// making a seperate ratings extension interface.
// Oh well, they really don't hurt anything. No other player will try
// to use them anyway...
const MediaServer2PlayerIface = '<node>\
<interface name="org.mpris.MediaPlayer2.Player">\
<method name="PlayPause" />\
<method name="Next" />\
<method name="Previous" />\
<method name="Stop" />\
<method name="SetPosition">\
<arg type="o" direction="in" />\
<arg type="x" direction="in" />\
</method>\
<method name="NuvolaSetRating">\
<arg type="d" direction="in" />\
</method>\
<property name="NuvolaCanRate" 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="CanGoNext" type="b" access="read" />\
<property name="CanGoPrevious" type="b" access="read" />\
<property name="Metadata" type="a{sv}" access="read" />\
<property name="Volume" type="d" access="readwrite" />\
<property name="LoopStatus" type="s" access="readwrite" />\
<property name="Shuffle" type="b" access="readwrite" />\
<property name="PlaybackStatus" type="s" access="read" />\
<signal name="Seeked">\
<arg type="x" direction="out" />\
</signal>\
</interface>\
</node>';
const MediaServer2PlayerProxy = Gio.DBusProxy.makeProxyWrapper(MediaServer2PlayerIface);
const MediaServer2PlaylistsIface = '<node>\
<interface name="org.mpris.MediaPlayer2.Playlists">\
<method name="ActivatePlaylist">\
<arg type="o" direction="in" />\
</method>\
<method name="GetPlaylists">\
<arg type="u" direction="in" />\
<arg type="u" direction="in" />\
<arg type="s" direction="in" />\
<arg type="b" direction="in" />\
<arg type="a(oss)" direction="out" />\
</method>\
<property name="PlaylistCount" type="u" access="read" />\
<property name="Orderings" type="as" access="read" />\
<property name="ActivePlaylist" type="(b(oss))" access="read" />\
<signal name="PlaylistChanged">\
<arg type="(oss)" direction="out" />\
</signal>\
</interface>\
</node>';
const MediaServer2PlaylistsProxy = Gio.DBusProxy.makeProxyWrapper(MediaServer2PlaylistsIface);
const MediaServer2TracklistIface = '<node>\
<interface name="org.mpris.MediaPlayer2.TrackList">\
<method name="GetTracksMetadata">\
<arg type="ao" direction="in" />\
<arg type="aa{sv}" direction="out" />\
</method>\
<method name="GoTo">\
<arg type="o" direction="in" />\
</method>\
<property name="Tracks" type="ao" access="read" />\
<signal name="TrackListReplaced">\
<arg type="ao" direction="out" />\
<arg type="o" direction="out" />\
</signal>\
<signal name="TrackAdded">\
<arg type="a{sv}" direction="out" />\
<arg type="o" direction="out" />\
</signal>\
<signal name="TrackRemoved">\
<arg type="o" direction="out" />\
</signal>\
<signal name="TrackMetadataChanged">\
<arg type="o" direction="out" />\
<arg type="a{sv}" direction="out" />\
</signal>\
</interface>\
</node>';
const MediaServer2TracklistProxy = Gio.DBusProxy.makeProxyWrapper(MediaServer2TracklistIface);
const PithosRatingsIface = '<node>\
<interface name="org.mpris.MediaPlayer2.ExtensionPithosRatings">\
<method name="LoveSong">\
<arg type="o" direction="in" />\
</method>\
<method name="BanSong">\
<arg type="o" direction="in" />\
</method>\
<method name="TiredSong">\
<arg type="o" direction="in" />\
</method>\
<method name="UnRateSong">\
<arg type="o" direction="in" />\
</method>\
<property name="HasPithosExtension" type="b" access="read" />\
</interface>\
</node>';
const PithosRatingsProxy = Gio.DBusProxy.makeProxyWrapper(PithosRatingsIface);
const RatingsExtensionIface = '<node>\
<interface name="org.mpris.MediaPlayer2.ExtensionSetRatings">\
<method name="SetRating">\
<arg type="o" direction="in" />\
<arg type="d" direction="in" />\
</method>\
<property name="HasRatingsExtension" type="b" access="read" />\
</interface>\
</node>';
const RatingsExtensionProxy = Gio.DBusProxy.makeProxyWrapper(RatingsExtensionIface);
const Rhythmbox3Iface = '<node>\
<interface name="org.gnome.Rhythmbox3.RhythmDB">\
<method name="SetEntryProperties">\
<arg type="s" direction="in" />\
<arg type="a{sv}" direction="in" />\
</method>\
</interface>\
</node>';
const Rhythmbox3Proxy = Gio.DBusProxy.makeProxyWrapper(Rhythmbox3Iface);
function DBus() {
return new DBusProxy(Gio.DBus.session, 'org.freedesktop.DBus',
'/org/freedesktop/DBus');
}
function Properties(owner, callback) {
new PropertiesProxy(Gio.DBus.session, owner,
'/org/mpris/MediaPlayer2',
callback);
}
function MediaServer2(owner, callback) {
new MediaServer2Proxy(Gio.DBus.session, owner,
'/org/mpris/MediaPlayer2',
callback);
}
function MediaServer2Player(owner, callback) {
new MediaServer2PlayerProxy(Gio.DBus.session, owner,
'/org/mpris/MediaPlayer2',
callback);
}
function MediaServer2Playlists(owner, callback) {
new MediaServer2PlaylistsProxy(Gio.DBus.session, owner,
'/org/mpris/MediaPlayer2',
callback);
}
function MediaServer2Tracklist(owner, callback) {
new MediaServer2TracklistProxy(Gio.DBus.session, owner,
'/org/mpris/MediaPlayer2',
callback);
}
function PithosRatings(owner, callback) {
if (owner != 'org.mpris.MediaPlayer2.pithos') {
callback(false);
}
else {
let proxy = new PithosRatingsProxy(Gio.DBus.session, owner,
'/org/mpris/MediaPlayer2');
if (proxy.HasPithosExtension) {
callback(proxy);
}
else {
callback(false);
}
}
}
function RatingsExtension(owner, callback) {
if (Settings.SUPPORTS_RATINGS_EXTENSION.indexOf(owner) == -1) {
callback(false);
}
else {
let proxy = new RatingsExtensionProxy(Gio.DBus.session, owner,
'/org/mpris/MediaPlayer2');
if (proxy.HasRatingsExtension) {
callback(proxy);
}
else {
callback(false);
}
}
}
function RhythmboxRatings(owner) {
if (owner != 'org.mpris.MediaPlayer2.rhythmbox') {
return false;
}
else {
return new Rhythmbox3Proxy(Gio.DBus.session, "org.gnome.Rhythmbox3",
"/org/gnome/Rhythmbox3/RhythmDB");
}
}
|