(iface)
| 24 | * @returns {string | null} the XML string or null if it is not found |
| 25 | */ |
| 26 | export function loadInterfaceXML(iface) { |
| 27 | _ensureIfaceResource(); |
| 28 | |
| 29 | const uri = `resource:///org/gnome/shell/dbus-interfaces/${iface}.xml`; |
| 30 | const f = Gio.File.new_for_uri(uri); |
| 31 | |
| 32 | try { |
| 33 | const [ok_, bytes] = f.load_contents(null); |
| 34 | return new TextDecoder().decode(bytes); |
| 35 | } catch { |
| 36 | log(`Failed to load D-Bus interface ${iface}`); |
| 37 | } |
| 38 | |
| 39 | return null; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * @param {string} iface the interface name |
no test coverage detected
searching dependent graphs…