dbusServices: Port to ESM

We want to replace gjs' custom (and now legacy) imports system
with standard EcmaScript modules: JS developers are already
familiar with them, they have better tooling support and using
standard features over non-standard ones is generally the right
thing to do.

Our D-Bus services are separate from the main process, and thus
can be ported separately (except for the few imports that are
shared with the main process' code base).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2786>
This commit is contained in:
Florian Müllner
2023-05-25 20:31:22 +02:00
parent eacabbf443
commit 612e04165e
13 changed files with 70 additions and 70 deletions

View File

@ -1,14 +1,13 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported ScreencastService */
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import Gst from 'gi://Gst?version=1.0';
import Gtk from 'gi://Gtk?version=4.0';
imports.gi.versions.Gst = '1.0';
imports.gi.versions.Gtk = '4.0';
import {ServiceImplementation} from './dbusService.js';
const { Gio, GLib, Gst, Gtk } = imports.gi;
const { loadInterfaceXML, loadSubInterfaceXML } = imports.misc.dbusUtils;
const {loadInterfaceXML, loadSubInterfaceXML} = imports.misc.dbusUtils;
const Signals = imports.misc.signals;
const { ServiceImplementation } = imports.dbusService;
const ScreencastIface = loadInterfaceXML('org.gnome.Shell.Screencast');
@ -400,7 +399,7 @@ var Recorder = class extends Signals.EventEmitter {
}
};
var ScreencastService = class extends ServiceImplementation {
export const ScreencastService = class extends ServiceImplementation {
static canScreencast() {
if (!Gst.init_check(null))
return false;