mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
js: Port to modules
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1499>
This commit is contained in:
parent
d9198317ae
commit
a751e213f6
162 changed files with 2183 additions and 2336 deletions
|
|
@ -1,29 +1,28 @@
|
|||
/* exported AccessDialogDBus */
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Pango from 'gi://Pango';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const CheckBox = imports.ui.checkBox;
|
||||
const Dialog = imports.ui.dialog;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
import * as CheckBox from './checkBox.js';
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as ModalDialog from './modalDialog.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
|
||||
const RequestIface = loadInterfaceXML('org.freedesktop.impl.portal.Request');
|
||||
const AccessIface = loadInterfaceXML('org.freedesktop.impl.portal.Access');
|
||||
|
||||
/** @enum {number} */
|
||||
var DialogResponse = {
|
||||
const DialogResponse = {
|
||||
OK: 0,
|
||||
CANCEL: 1,
|
||||
CLOSED: 2,
|
||||
};
|
||||
|
||||
var AccessDialog = GObject.registerClass(
|
||||
const AccessDialog = GObject.registerClass(
|
||||
class AccessDialog extends ModalDialog.ModalDialog {
|
||||
_init(invocation, handle, title, description, body, options) {
|
||||
super._init({ styleClass: 'access-dialog' });
|
||||
|
|
@ -128,7 +127,7 @@ class AccessDialog extends ModalDialog.ModalDialog {
|
|||
}
|
||||
});
|
||||
|
||||
var AccessDialogDBus = class {
|
||||
export class AccessDialogDBus {
|
||||
constructor() {
|
||||
this._accessDialog = null;
|
||||
|
||||
|
|
@ -166,4 +165,4 @@ var AccessDialogDBus = class {
|
|||
|
||||
this._accessDialog = dialog;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,31 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported AppSwitcherPopup, GroupCyclerPopup, WindowSwitcherPopup,
|
||||
WindowCyclerPopup */
|
||||
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import St from 'gi://St';
|
||||
import Shell from 'gi://Shell';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const SwitcherPopup = imports.ui.switcherPopup;
|
||||
import * as Main from './main.js';
|
||||
import * as SwitcherPopup from './switcherPopup.js';
|
||||
|
||||
var APP_ICON_HOVER_TIMEOUT = 200; // milliseconds
|
||||
const APP_ICON_HOVER_TIMEOUT = 200; // milliseconds
|
||||
|
||||
var THUMBNAIL_DEFAULT_SIZE = 256;
|
||||
var THUMBNAIL_POPUP_TIME = 500; // milliseconds
|
||||
var THUMBNAIL_FADE_TIME = 100; // milliseconds
|
||||
const THUMBNAIL_DEFAULT_SIZE = 256;
|
||||
const THUMBNAIL_POPUP_TIME = 500; // milliseconds
|
||||
const THUMBNAIL_FADE_TIME = 100; // milliseconds
|
||||
|
||||
var WINDOW_PREVIEW_SIZE = 128;
|
||||
var APP_ICON_SIZE = 96;
|
||||
var APP_ICON_SIZE_SMALL = 48;
|
||||
const WINDOW_PREVIEW_SIZE = 128;
|
||||
const APP_ICON_SIZE = 96;
|
||||
const APP_ICON_SIZE_SMALL = 48;
|
||||
|
||||
const baseIconSizes = [96, 64, 48, 32, 22];
|
||||
|
||||
/** @enum {number} */
|
||||
var AppIconMode = {
|
||||
const AppIconMode = {
|
||||
THUMBNAIL_ONLY: 1,
|
||||
APP_ICON_ONLY: 2,
|
||||
BOTH: 3,
|
||||
|
|
@ -48,20 +46,23 @@ function _createWindowClone(window, size) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Meta.Workspace} workspace
|
||||
* @returns {Meta.Window}
|
||||
*/
|
||||
function getWindows(workspace) {
|
||||
// We ignore skip-taskbar windows in switchers, but if they are attached
|
||||
// to their parent, their position in the MRU list may be more appropriate
|
||||
// than the parent; so start with the complete list ...
|
||||
let windows = global.display.get_tab_list(Meta.TabList.NORMAL_ALL,
|
||||
workspace);
|
||||
let windows = global.display.get_tab_list(Meta.TabList.NORMAL_ALL, workspace);
|
||||
// ... map windows to their parent where appropriate ...
|
||||
return windows.map(w => {
|
||||
return w.is_attached_dialog() ? w.get_transient_for() : w;
|
||||
// ... and filter out skip-taskbar windows and duplicates
|
||||
}).filter((w, i, a) => !w.skip_taskbar && a.indexOf(w) == i);
|
||||
}).filter((w, i, a) => !w.skip_taskbar && a.indexOf(w) === i);
|
||||
}
|
||||
|
||||
var AppSwitcherPopup = GObject.registerClass(
|
||||
export const AppSwitcherPopup = GObject.registerClass(
|
||||
class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -404,7 +405,7 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
|
|||
}
|
||||
});
|
||||
|
||||
var CyclerHighlight = GObject.registerClass(
|
||||
const CyclerHighlight = GObject.registerClass(
|
||||
class CyclerHighlight extends St.Widget {
|
||||
_init() {
|
||||
super._init({ layout_manager: new Clutter.BinLayout() });
|
||||
|
|
@ -470,7 +471,7 @@ class CyclerHighlight extends St.Widget {
|
|||
|
||||
// We don't show an actual popup, so just provide what SwitcherPopup
|
||||
// expects instead of inheriting from SwitcherList
|
||||
var CyclerList = GObject.registerClass({
|
||||
const CyclerList = GObject.registerClass({
|
||||
Signals: {
|
||||
'item-activated': { param_types: [GObject.TYPE_INT] },
|
||||
'item-entered': { param_types: [GObject.TYPE_INT] },
|
||||
|
|
@ -483,7 +484,7 @@ var CyclerList = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var CyclerPopup = GObject.registerClass({
|
||||
const CyclerPopup = GObject.registerClass({
|
||||
GTypeFlags: GObject.TypeFlags.ABSTRACT,
|
||||
}, class CyclerPopup extends SwitcherPopup.SwitcherPopup {
|
||||
_init() {
|
||||
|
|
@ -539,7 +540,7 @@ var CyclerPopup = GObject.registerClass({
|
|||
});
|
||||
|
||||
|
||||
var GroupCyclerPopup = GObject.registerClass(
|
||||
export const GroupCyclerPopup = GObject.registerClass(
|
||||
class GroupCyclerPopup extends CyclerPopup {
|
||||
_init() {
|
||||
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.app-switcher' });
|
||||
|
|
@ -572,7 +573,7 @@ class GroupCyclerPopup extends CyclerPopup {
|
|||
}
|
||||
});
|
||||
|
||||
var WindowSwitcherPopup = GObject.registerClass(
|
||||
export const WindowSwitcherPopup = GObject.registerClass(
|
||||
class WindowSwitcherPopup extends SwitcherPopup.SwitcherPopup {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -630,7 +631,7 @@ class WindowSwitcherPopup extends SwitcherPopup.SwitcherPopup {
|
|||
}
|
||||
});
|
||||
|
||||
var WindowCyclerPopup = GObject.registerClass(
|
||||
export const WindowCyclerPopup = GObject.registerClass(
|
||||
class WindowCyclerPopup extends CyclerPopup {
|
||||
_init() {
|
||||
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.window-switcher' });
|
||||
|
|
@ -661,7 +662,7 @@ class WindowCyclerPopup extends CyclerPopup {
|
|||
}
|
||||
});
|
||||
|
||||
var AppIcon = GObject.registerClass(
|
||||
export const AppIcon = GObject.registerClass(
|
||||
class AppIcon extends St.BoxLayout {
|
||||
_init(app) {
|
||||
super._init({
|
||||
|
|
@ -688,7 +689,7 @@ class AppIcon extends St.BoxLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var AppSwitcher = GObject.registerClass(
|
||||
const AppSwitcher = GObject.registerClass(
|
||||
class AppSwitcher extends SwitcherPopup.SwitcherList {
|
||||
_init(apps, altTabPopup) {
|
||||
super._init(true);
|
||||
|
|
@ -905,7 +906,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
|
|||
}
|
||||
});
|
||||
|
||||
var ThumbnailSwitcher = GObject.registerClass(
|
||||
const ThumbnailSwitcher = GObject.registerClass(
|
||||
class ThumbnailSwitcher extends SwitcherPopup.SwitcherList {
|
||||
_init(windows) {
|
||||
super._init(false);
|
||||
|
|
@ -995,7 +996,7 @@ class ThumbnailSwitcher extends SwitcherPopup.SwitcherList {
|
|||
}
|
||||
});
|
||||
|
||||
var WindowIcon = GObject.registerClass(
|
||||
export const WindowIcon = GObject.registerClass(
|
||||
class WindowIcon extends St.BoxLayout {
|
||||
_init(window, mode) {
|
||||
super._init({
|
||||
|
|
@ -1055,7 +1056,7 @@ class WindowIcon extends St.BoxLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var WindowSwitcher = GObject.registerClass(
|
||||
const WindowSwitcher = GObject.registerClass(
|
||||
class WindowSwitcher extends SwitcherPopup.SwitcherList {
|
||||
_init(windows, mode) {
|
||||
super._init(true);
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Animation, AnimatedIcon, Spinner */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Gio = imports.gi.Gio;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Gio from 'gi://Gio';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Params = imports.misc.params;
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
var ANIMATED_ICON_UPDATE_TIMEOUT = 16;
|
||||
var SPINNER_ANIMATION_TIME = 300;
|
||||
var SPINNER_ANIMATION_DELAY = 1000;
|
||||
const ANIMATED_ICON_UPDATE_TIMEOUT = 16;
|
||||
const SPINNER_ANIMATION_TIME = 300;
|
||||
const SPINNER_ANIMATION_DELAY = 1000;
|
||||
|
||||
var Animation = GObject.registerClass(
|
||||
export const Animation = GObject.registerClass(
|
||||
class Animation extends St.Bin {
|
||||
_init(file, width, height, speed) {
|
||||
const themeContext = St.ThemeContext.get_for_stage(global.stage);
|
||||
|
|
@ -118,14 +117,14 @@ class Animation extends St.Bin {
|
|||
}
|
||||
});
|
||||
|
||||
var AnimatedIcon = GObject.registerClass(
|
||||
export const AnimatedIcon = GObject.registerClass(
|
||||
class AnimatedIcon extends Animation {
|
||||
_init(file, size) {
|
||||
super._init(file, size, size, ANIMATED_ICON_UPDATE_TIMEOUT);
|
||||
}
|
||||
});
|
||||
|
||||
var Spinner = GObject.registerClass(
|
||||
export const Spinner = GObject.registerClass(
|
||||
class Spinner extends AnimatedIcon {
|
||||
_init(size, params) {
|
||||
params = Params.parse(params, {
|
||||
|
|
|
|||
|
|
@ -1,46 +1,46 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported AppDisplay, AppSearchProvider */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Gio from 'gi://Gio';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Pango from 'gi://Pango';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const AppFavorites = imports.ui.appFavorites;
|
||||
const { AppMenu } = imports.ui.appMenu;
|
||||
const BoxPointer = imports.ui.boxpointer;
|
||||
const DND = imports.ui.dnd;
|
||||
const GrabHelper = imports.ui.grabHelper;
|
||||
const IconGrid = imports.ui.iconGrid;
|
||||
const Layout = imports.ui.layout;
|
||||
const Main = imports.ui.main;
|
||||
const PageIndicators = imports.ui.pageIndicators;
|
||||
const ParentalControlsManager = imports.misc.parentalControlsManager;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const Search = imports.ui.search;
|
||||
const SwipeTracker = imports.ui.swipeTracker;
|
||||
const Params = imports.misc.params;
|
||||
const SystemActions = imports.misc.systemActions;
|
||||
import * as AppFavorites from './appFavorites.js';
|
||||
import {AppMenu} from './appMenu.js';
|
||||
import * as BoxPointer from './boxpointer.js';
|
||||
import * as DND from './dnd.js';
|
||||
import * as GrabHelper from './grabHelper.js';
|
||||
import * as IconGrid from './iconGrid.js';
|
||||
import * as Layout from './layout.js';
|
||||
import * as PageIndicators from './pageIndicators.js';
|
||||
import * as ParentalControlsManager from '../misc/parentalControlsManager.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
import * as Search from './search.js';
|
||||
import * as SwipeTracker from './swipeTracker.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as SystemActions from '../misc/systemActions.js';
|
||||
|
||||
var MENU_POPUP_TIMEOUT = 600;
|
||||
var POPDOWN_DIALOG_TIMEOUT = 500;
|
||||
import * as Main from './main.js';
|
||||
|
||||
var FOLDER_SUBICON_FRACTION = .4;
|
||||
const MENU_POPUP_TIMEOUT = 600;
|
||||
const POPDOWN_DIALOG_TIMEOUT = 500;
|
||||
|
||||
var VIEWS_SWITCH_TIME = 400;
|
||||
var VIEWS_SWITCH_ANIMATION_DELAY = 100;
|
||||
const FOLDER_SUBICON_FRACTION = .4;
|
||||
|
||||
var SCROLL_TIMEOUT_TIME = 150;
|
||||
const VIEWS_SWITCH_TIME = 400;
|
||||
const VIEWS_SWITCH_ANIMATION_DELAY = 100;
|
||||
|
||||
var APP_ICON_SCALE_IN_TIME = 500;
|
||||
var APP_ICON_SCALE_IN_DELAY = 700;
|
||||
const SCROLL_TIMEOUT_TIME = 150;
|
||||
|
||||
var APP_ICON_TITLE_EXPAND_TIME = 200;
|
||||
var APP_ICON_TITLE_COLLAPSE_TIME = 100;
|
||||
const APP_ICON_SCALE_IN_TIME = 500;
|
||||
const APP_ICON_SCALE_IN_DELAY = 700;
|
||||
|
||||
const APP_ICON_TITLE_EXPAND_TIME = 200;
|
||||
const APP_ICON_TITLE_COLLAPSE_TIME = 100;
|
||||
|
||||
const FOLDER_DIALOG_ANIMATION_TIME = 200;
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ function _findBestFolderName(apps) {
|
|||
return null;
|
||||
}
|
||||
|
||||
const AppGrid = GObject.registerClass({
|
||||
export const AppGrid = GObject.registerClass({
|
||||
Properties: {
|
||||
'indicators-padding': GObject.ParamSpec.boxed('indicators-padding',
|
||||
'Indicators padding', 'Indicators padding',
|
||||
|
|
@ -1284,7 +1284,7 @@ var BaseAppView = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var PageManager = GObject.registerClass({
|
||||
const PageManager = GObject.registerClass({
|
||||
Signals: { 'layout-changed': {} },
|
||||
}, class PageManager extends GObject.Object {
|
||||
_init() {
|
||||
|
|
@ -1345,7 +1345,7 @@ var PageManager = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var AppDisplay = GObject.registerClass(
|
||||
export const AppDisplay = GObject.registerClass(
|
||||
class AppDisplay extends BaseAppView {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
@ -1788,7 +1788,7 @@ class AppDisplay extends BaseAppView {
|
|||
}
|
||||
});
|
||||
|
||||
var AppSearchProvider = class AppSearchProvider {
|
||||
export class AppSearchProvider {
|
||||
constructor() {
|
||||
this._appSys = Shell.AppSystem.get_default();
|
||||
this.id = 'applications';
|
||||
|
|
@ -1879,9 +1879,9 @@ var AppSearchProvider = class AppSearchProvider {
|
|||
return new SystemActionIcon(this, resultMeta);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var AppViewItem = GObject.registerClass(
|
||||
export const AppViewItem = GObject.registerClass(
|
||||
class AppViewItem extends St.Button {
|
||||
_init(params = {}, isDraggable = true, expandTitleOnHover = true) {
|
||||
super._init({
|
||||
|
|
@ -2098,7 +2098,7 @@ class AppViewItem extends St.Button {
|
|||
}
|
||||
});
|
||||
|
||||
var FolderGrid = GObject.registerClass(
|
||||
const FolderGrid = GObject.registerClass(
|
||||
class FolderGrid extends AppGrid {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
@ -2118,7 +2118,7 @@ class FolderGrid extends AppGrid {
|
|||
}
|
||||
});
|
||||
|
||||
var FolderView = GObject.registerClass(
|
||||
export const FolderView = GObject.registerClass(
|
||||
class FolderView extends BaseAppView {
|
||||
_init(folder, id, parentView) {
|
||||
super._init({
|
||||
|
|
@ -2313,7 +2313,7 @@ class FolderView extends BaseAppView {
|
|||
}
|
||||
});
|
||||
|
||||
var FolderIcon = GObject.registerClass({
|
||||
export const FolderIcon = GObject.registerClass({
|
||||
Signals: {
|
||||
'apps-changed': {},
|
||||
},
|
||||
|
|
@ -2489,7 +2489,7 @@ var FolderIcon = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var AppFolderDialog = GObject.registerClass({
|
||||
export const AppFolderDialog = GObject.registerClass({
|
||||
Signals: {
|
||||
'open-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
|
||||
},
|
||||
|
|
@ -2974,7 +2974,7 @@ var AppFolderDialog = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var AppIcon = GObject.registerClass({
|
||||
export const AppIcon = GObject.registerClass({
|
||||
Signals: {
|
||||
'menu-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
|
||||
'sync-tooltip': {},
|
||||
|
|
@ -3279,7 +3279,7 @@ var AppIcon = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var SystemActionIcon = GObject.registerClass(
|
||||
const SystemActionIcon = GObject.registerClass(
|
||||
class SystemActionIcon extends Search.GridSearchResult {
|
||||
activate() {
|
||||
SystemActions.getDefault().activateAction(this.metaInfo['id']);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported getAppFavorites */
|
||||
|
||||
const Shell = imports.gi.Shell;
|
||||
const ParentalControlsManager = imports.misc.parentalControlsManager;
|
||||
const Signals = imports.misc.signals;
|
||||
import Shell from 'gi://Shell';
|
||||
import * as ParentalControlsManager from '../misc/parentalControlsManager.js';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
import * as Main from './main.js';
|
||||
|
||||
// In alphabetical order
|
||||
const RENAMED_DESKTOP_IDS = {
|
||||
|
|
@ -210,7 +209,7 @@ var appFavoritesInstance = null;
|
|||
/**
|
||||
* @returns {AppFavorites}
|
||||
*/
|
||||
function getAppFavorites() {
|
||||
export function getAppFavorites() {
|
||||
if (appFavoritesInstance == null)
|
||||
appFavoritesInstance = new AppFavorites();
|
||||
return appFavoritesInstance;
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported AppMenu */
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
|
||||
const AppFavorites = imports.ui.appFavorites;
|
||||
const Main = imports.ui.main;
|
||||
const ParentalControlsManager = imports.misc.parentalControlsManager;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
var AppMenu = class AppMenu extends PopupMenu.PopupMenu {
|
||||
import * as AppFavorites from './appFavorites.js';
|
||||
import * as Main from './main.js';
|
||||
import * as ParentalControlsManager from '../misc/parentalControlsManager.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
|
||||
export class AppMenu extends PopupMenu.PopupMenu {
|
||||
/**
|
||||
* @param {Clutter.Actor} sourceActor - actor the menu is attached to
|
||||
* @param {St.Side} side - arrow side
|
||||
|
|
@ -292,4 +292,4 @@ var AppMenu = class AppMenu extends PopupMenu.PopupMenu {
|
|||
}, item);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
/* exported AudioDeviceSelectionDBus */
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Dialog = imports.ui.dialog;
|
||||
const Main = imports.ui.main;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as ModalDialog from './modalDialog.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
import * as Main from './main.js';
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
|
||||
var AudioDevice = {
|
||||
const AudioDevice = {
|
||||
HEADPHONES: 1 << 0,
|
||||
HEADSET: 1 << 1,
|
||||
MICROPHONE: 1 << 2,
|
||||
|
|
@ -21,7 +20,7 @@ var AudioDevice = {
|
|||
|
||||
const AudioDeviceSelectionIface = loadInterfaceXML('org.gnome.Shell.AudioDeviceSelection');
|
||||
|
||||
var AudioDeviceSelectionDialog = GObject.registerClass({
|
||||
const AudioDeviceSelectionDialog = GObject.registerClass({
|
||||
Signals: { 'device-selected': { param_types: [GObject.TYPE_UINT] } },
|
||||
}, class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
|
||||
_init(devices) {
|
||||
|
|
@ -150,7 +149,7 @@ var AudioDeviceSelectionDialog = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var AudioDeviceSelectionDBus = class AudioDeviceSelectionDBus {
|
||||
export class AudioDeviceSelectionDBus {
|
||||
constructor() {
|
||||
this._audioSelectionDialog = null;
|
||||
|
||||
|
|
@ -211,4 +210,4 @@ var AudioDeviceSelectionDBus = class AudioDeviceSelectionDBus {
|
|||
|
||||
invocation.return_value(null);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported SystemBackground, BackgroundManager */
|
||||
|
||||
// READ THIS FIRST
|
||||
// Background handling is a maze of objects, both objects in this file, and
|
||||
|
|
@ -94,21 +93,21 @@
|
|||
// MetaBackgroundImage MetaBackgroundImage
|
||||
// MetaBackgroundImage MetaBackgroundImage
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GDesktopEnums = imports.gi.GDesktopEnums;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const GnomeBG = imports.gi.GnomeBG;
|
||||
const GnomeDesktop = imports.gi.GnomeDesktop;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Signals = imports.misc.signals;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GDesktopEnums from 'gi://GDesktopEnums';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import GnomeBG from 'gi://GnomeBG';
|
||||
import GnomeDesktop from 'gi://GnomeDesktop';
|
||||
import Meta from 'gi://Meta';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const LoginManager = imports.misc.loginManager;
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
import * as LoginManager from '../misc/loginManager.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
var DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff);
|
||||
const DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff);
|
||||
|
||||
const BACKGROUND_SCHEMA = 'org.gnome.desktop.background';
|
||||
const PRIMARY_COLOR_KEY = 'primary-color';
|
||||
|
|
@ -121,14 +120,14 @@ const PICTURE_URI_DARK_KEY = 'picture-uri-dark';
|
|||
const INTERFACE_SCHEMA = 'org.gnome.desktop.interface';
|
||||
const COLOR_SCHEME_KEY = 'color-scheme';
|
||||
|
||||
var FADE_ANIMATION_TIME = 1000;
|
||||
const FADE_ANIMATION_TIME = 1000;
|
||||
|
||||
// These parameters affect how often we redraw.
|
||||
// The first is how different (percent crossfaded) the slide show
|
||||
// has to look before redrawing and the second is the minimum
|
||||
// frequency (in seconds) we're willing to wake up
|
||||
var ANIMATION_OPACITY_STEP_INCREMENT = 4.0;
|
||||
var ANIMATION_MIN_WAKEUP_INTERVAL = 1.0;
|
||||
const ANIMATION_OPACITY_STEP_INCREMENT = 4.0;
|
||||
const ANIMATION_MIN_WAKEUP_INTERVAL = 1.0;
|
||||
|
||||
let _backgroundCache = null;
|
||||
|
||||
|
|
@ -142,7 +141,7 @@ function _fileEqual0(file1, file2) {
|
|||
return file1.equal(file2);
|
||||
}
|
||||
|
||||
var BackgroundCache = class BackgroundCache extends Signals.EventEmitter {
|
||||
class BackgroundCache extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -227,7 +226,7 @@ var BackgroundCache = class BackgroundCache extends Signals.EventEmitter {
|
|||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {BackgroundCache}
|
||||
|
|
@ -238,7 +237,7 @@ function getBackgroundCache() {
|
|||
return _backgroundCache;
|
||||
}
|
||||
|
||||
var Background = GObject.registerClass({
|
||||
const Background = GObject.registerClass({
|
||||
Signals: { 'loaded': {}, 'bg-changed': {} },
|
||||
}, class Background extends Meta.Background {
|
||||
_init(params) {
|
||||
|
|
@ -532,7 +531,7 @@ var Background = GObject.registerClass({
|
|||
|
||||
let _systemBackground;
|
||||
|
||||
var SystemBackground = GObject.registerClass({
|
||||
export const SystemBackground = GObject.registerClass({
|
||||
Signals: { 'loaded': {} },
|
||||
}, class SystemBackground extends Meta.BackgroundActor {
|
||||
_init() {
|
||||
|
|
@ -555,7 +554,7 @@ var SystemBackground = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var BackgroundSource = class BackgroundSource {
|
||||
class BackgroundSource {
|
||||
constructor(layoutManager, settingsSchema) {
|
||||
// Allow override the background image setting for performance testing
|
||||
this._layoutManager = layoutManager;
|
||||
|
|
@ -649,9 +648,9 @@ var BackgroundSource = class BackgroundSource {
|
|||
|
||||
this._backgrounds = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var Animation = GObject.registerClass(
|
||||
const Animation = GObject.registerClass(
|
||||
class Animation extends GnomeBG.BGSlideShow {
|
||||
_init(params) {
|
||||
super._init(params);
|
||||
|
|
@ -691,7 +690,7 @@ class Animation extends GnomeBG.BGSlideShow {
|
|||
}
|
||||
});
|
||||
|
||||
var BackgroundManager = class BackgroundManager extends Signals.EventEmitter {
|
||||
export class BackgroundManager extends Signals.EventEmitter {
|
||||
constructor(params) {
|
||||
super();
|
||||
params = Params.parse(params, {
|
||||
|
|
@ -847,4 +846,4 @@ var BackgroundManager = class BackgroundManager extends Signals.EventEmitter {
|
|||
|
||||
return backgroundActor;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported addBackgroundMenu */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import St from 'gi://St';
|
||||
|
||||
const BoxPointer = imports.ui.boxpointer;
|
||||
const Main = imports.ui.main;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
import * as BoxPointer from './boxpointer.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
|
||||
var BackgroundMenu = class BackgroundMenu extends PopupMenu.PopupMenu {
|
||||
import * as Main from './main.js';
|
||||
|
||||
export class BackgroundMenu extends PopupMenu.PopupMenu {
|
||||
constructor(layoutManager) {
|
||||
super(layoutManager.dummyCursor, 0, St.Side.TOP);
|
||||
|
||||
|
|
@ -22,13 +22,13 @@ var BackgroundMenu = class BackgroundMenu extends PopupMenu.PopupMenu {
|
|||
layoutManager.uiGroup.add_actor(this.actor);
|
||||
this.actor.hide();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Meta.BackgroundActor} actor
|
||||
* @param {import('./layout.js').LayoutManager} layoutManager
|
||||
*/
|
||||
function addBackgroundMenu(actor, layoutManager) {
|
||||
export function addBackgroundMenu(actor, layoutManager) {
|
||||
actor.reactive = true;
|
||||
actor._backgroundMenu = new BackgroundMenu(layoutManager);
|
||||
actor._backgroundManager = new PopupMenu.PopupMenuManager(actor);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
/* exported BarLevel */
|
||||
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const St = imports.gi.St;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
var BarLevel = GObject.registerClass({
|
||||
export const BarLevel = GObject.registerClass({
|
||||
Properties: {
|
||||
'value': GObject.ParamSpec.double(
|
||||
'value', 'value', 'value',
|
||||
|
|
|
|||
|
|
@ -1,26 +1,23 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported BoxPointer */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
import * as Main from './main.js';
|
||||
|
||||
var PopupAnimation = {
|
||||
export const PopupAnimation = {
|
||||
NONE: 0,
|
||||
SLIDE: 1 << 0,
|
||||
FADE: 1 << 1,
|
||||
FULL: ~0,
|
||||
};
|
||||
|
||||
var POPUP_ANIMATION_TIME = 150;
|
||||
const POPUP_ANIMATION_TIME = 150;
|
||||
|
||||
/**
|
||||
* BoxPointer:
|
||||
* @side: side to draw the arrow on
|
||||
* @binProperties: Properties to set on contained bin
|
||||
*
|
||||
* An actor which displays a triangle "arrow" pointing to a given
|
||||
* side. The .bin property is a container in which content can be
|
||||
|
|
@ -30,7 +27,7 @@ var POPUP_ANIMATION_TIME = 150;
|
|||
* totally inside the monitor workarea if possible.
|
||||
*
|
||||
*/
|
||||
var BoxPointer = GObject.registerClass({
|
||||
export const BoxPointer = GObject.registerClass({
|
||||
Signals: { 'arrow-side-changed': {} },
|
||||
}, class BoxPointer extends St.Widget {
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,28 +1,27 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Calendar, CalendarMessageList, DBusEventSource */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const MessageList = imports.ui.messageList;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const Mpris = imports.ui.mpris;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const {ensureActorVisibleInScrollView} = imports.misc.animationUtils;
|
||||
import * as Main from './main.js';
|
||||
import * as MessageList from './messageList.js';
|
||||
import * as MessageTray from './messageTray.js';
|
||||
import * as Mpris from './mpris.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
import {ensureActorVisibleInScrollView} from '../misc/animationUtils.js';
|
||||
|
||||
const {formatDateWithCFormatString, formatTimeSpan} = imports.misc.dateUtils;
|
||||
const {loadInterfaceXML} = imports.misc.fileUtils;
|
||||
import {formatDateWithCFormatString, formatTimeSpan} from '../misc/dateUtils.js';
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
|
||||
var SHOW_WEEKDATE_KEY = 'show-weekdate';
|
||||
const SHOW_WEEKDATE_KEY = 'show-weekdate';
|
||||
|
||||
var MESSAGE_ICON_SIZE = -1; // pick up from CSS
|
||||
const MESSAGE_ICON_SIZE = -1; // pick up from CSS
|
||||
|
||||
var NC_ = (context, str) => `${context}\u0004${str}`;
|
||||
const NC_ = (context, str) => `${context}\u0004${str}`;
|
||||
|
||||
function sameYear(dateA, dateB) {
|
||||
return dateA.getYear() == dateB.getYear();
|
||||
|
|
@ -83,19 +82,19 @@ function _getCalendarDayAbbreviation(dayNumber) {
|
|||
|
||||
// Abstraction for an appointment/event in a calendar
|
||||
|
||||
var CalendarEvent = class CalendarEvent {
|
||||
class CalendarEvent {
|
||||
constructor(id, date, end, summary) {
|
||||
this.id = id;
|
||||
this.date = date;
|
||||
this.end = end;
|
||||
this.summary = summary;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Interface for appointments/events - e.g. the contents of a calendar
|
||||
//
|
||||
|
||||
var EventSourceBase = GObject.registerClass({
|
||||
export const EventSourceBase = GObject.registerClass({
|
||||
GTypeFlags: GObject.TypeFlags.ABSTRACT,
|
||||
Properties: {
|
||||
'has-calendars': GObject.ParamSpec.boolean(
|
||||
|
|
@ -143,7 +142,7 @@ var EventSourceBase = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var EmptyEventSource = GObject.registerClass(
|
||||
export const EmptyEventSource = GObject.registerClass(
|
||||
class EmptyEventSource extends EventSourceBase {
|
||||
get isLoading() {
|
||||
return false;
|
||||
|
|
@ -211,7 +210,7 @@ function _eventOverlapsInterval(e0, e1, i0, i1) {
|
|||
}
|
||||
|
||||
// an implementation that reads data from a session bus service
|
||||
var DBusEventSource = GObject.registerClass(
|
||||
export const DBusEventSource = GObject.registerClass(
|
||||
class DBusEventSource extends EventSourceBase {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -411,7 +410,7 @@ class DBusEventSource extends EventSourceBase {
|
|||
}
|
||||
});
|
||||
|
||||
var Calendar = GObject.registerClass({
|
||||
export const Calendar = GObject.registerClass({
|
||||
Signals: { 'selected-date-changed': { param_types: [GLib.DateTime.$gtype] } },
|
||||
}, class Calendar extends St.Widget {
|
||||
_init() {
|
||||
|
|
@ -766,7 +765,7 @@ var Calendar = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var NotificationMessage = GObject.registerClass(
|
||||
export const NotificationMessage = GObject.registerClass(
|
||||
class NotificationMessage extends MessageList.Message {
|
||||
_init(notification) {
|
||||
super._init(notification.title, notification.bannerBodyText);
|
||||
|
|
@ -817,7 +816,7 @@ class NotificationMessage extends MessageList.Message {
|
|||
}
|
||||
});
|
||||
|
||||
var TimeLabel = GObject.registerClass(
|
||||
const TimeLabel = GObject.registerClass(
|
||||
class NotificationTimeLabel extends St.Label {
|
||||
_init(datetime) {
|
||||
super._init({
|
||||
|
|
@ -834,7 +833,7 @@ class NotificationTimeLabel extends St.Label {
|
|||
}
|
||||
});
|
||||
|
||||
var NotificationSection = GObject.registerClass(
|
||||
const NotificationSection = GObject.registerClass(
|
||||
class NotificationSection extends MessageList.MessageListSection {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -896,7 +895,7 @@ class NotificationSection extends MessageList.MessageListSection {
|
|||
}
|
||||
});
|
||||
|
||||
var Placeholder = GObject.registerClass(
|
||||
const Placeholder = GObject.registerClass(
|
||||
class Placeholder extends St.BoxLayout {
|
||||
_init() {
|
||||
super._init({ style_class: 'message-list-placeholder', vertical: true });
|
||||
|
|
@ -930,7 +929,7 @@ class DoNotDisturbSwitch extends PopupMenu.Switch {
|
|||
}
|
||||
});
|
||||
|
||||
var CalendarMessageList = GObject.registerClass(
|
||||
export const CalendarMessageList = GObject.registerClass(
|
||||
class CalendarMessageList extends St.Widget {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
/* exported CheckBox */
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Pango = imports.gi.Pango;
|
||||
const St = imports.gi.St;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Pango from 'gi://Pango';
|
||||
import St from 'gi://St';
|
||||
|
||||
var CheckBox = GObject.registerClass(
|
||||
export const CheckBox = GObject.registerClass(
|
||||
class CheckBox extends St.Button {
|
||||
_init(label) {
|
||||
let container = new St.BoxLayout({
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported CloseDialog */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Dialog = imports.ui.dialog;
|
||||
const Main = imports.ui.main;
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as Main from './main.js';
|
||||
|
||||
var FROZEN_WINDOW_BRIGHTNESS = -0.3;
|
||||
var DIALOG_TRANSITION_TIME = 150;
|
||||
var ALIVE_TIMEOUT = 5000;
|
||||
const FROZEN_WINDOW_BRIGHTNESS = -0.3;
|
||||
const DIALOG_TRANSITION_TIME = 150;
|
||||
const ALIVE_TIMEOUT = 5000;
|
||||
|
||||
var CloseDialog = GObject.registerClass({
|
||||
export const CloseDialog = GObject.registerClass({
|
||||
Implements: [Meta.CloseDialog],
|
||||
Properties: {
|
||||
'window': GObject.ParamSpec.override('window', Meta.CloseDialog),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
/* exported ComponentManager */
|
||||
const Main = imports.ui.main;
|
||||
import * as Main from './main.js';
|
||||
|
||||
var ComponentManager = class {
|
||||
export class ComponentManager {
|
||||
constructor() {
|
||||
this._allComponents = {};
|
||||
this._enabledComponents = [];
|
||||
|
|
@ -28,8 +27,7 @@ var ComponentManager = class {
|
|||
}
|
||||
|
||||
async _importComponent(name) {
|
||||
// TODO: Import as module
|
||||
let module = await imports.ui.components[name];
|
||||
let module = await import(`./components/${name}.js`);
|
||||
return module.Component;
|
||||
}
|
||||
|
||||
|
|
@ -59,4 +57,4 @@ var ComponentManager = class {
|
|||
return;
|
||||
component.disable();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Component */
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Params = imports.misc.params;
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import * as Params from '../../misc/params.js';
|
||||
|
||||
const GnomeSession = imports.misc.gnomeSession;
|
||||
const Main = imports.ui.main;
|
||||
const ShellMountOperation = imports.ui.shellMountOperation;
|
||||
import * as GnomeSession from '../../misc/gnomeSession.js';
|
||||
import * as Main from '../main.js';
|
||||
import * as ShellMountOperation from '../shellMountOperation.js';
|
||||
|
||||
var GNOME_SESSION_AUTOMOUNT_INHIBIT = 16;
|
||||
const GNOME_SESSION_AUTOMOUNT_INHIBIT = 16;
|
||||
|
||||
// GSettings keys
|
||||
const SETTINGS_SCHEMA = 'org.gnome.desktop.media-handling';
|
||||
const SETTING_ENABLE_AUTOMOUNT = 'automount';
|
||||
|
||||
var AUTORUN_EXPIRE_TIMEOUT_SECS = 10;
|
||||
const AUTORUN_EXPIRE_TIMEOUT_SECS = 10;
|
||||
|
||||
var AutomountManager = class {
|
||||
class AutomountManager {
|
||||
constructor() {
|
||||
this._settings = new Gio.Settings({ schema_id: SETTINGS_SCHEMA });
|
||||
this._activeOperations = new Map();
|
||||
|
|
@ -253,5 +252,6 @@ var AutomountManager = class {
|
|||
volume._allowAutorunExpireId = id;
|
||||
GLib.Source.set_name_by_id(id, '[gnome-shell] volume.allowAutorun');
|
||||
}
|
||||
};
|
||||
var Component = AutomountManager;
|
||||
}
|
||||
|
||||
export {AutomountManager as Component};
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Component */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
const GnomeSession = imports.misc.gnomeSession;
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
import * as GnomeSession from '../../misc/gnomeSession.js';
|
||||
import * as Main from '../main.js';
|
||||
import * as MessageTray from '../messageTray.js';
|
||||
|
||||
Gio._promisify(Gio.Mount.prototype, 'guess_content_type');
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
|
||||
// GSettings keys
|
||||
const SETTINGS_SCHEMA = 'org.gnome.desktop.media-handling';
|
||||
|
|
@ -22,7 +21,7 @@ const SETTING_IGNORE = 'autorun-x-content-ignore';
|
|||
const SETTING_OPEN_FOLDER = 'autorun-x-content-open-folder';
|
||||
|
||||
/** @enum {number} */
|
||||
var AutorunSetting = {
|
||||
const AutorunSetting = {
|
||||
RUN: 0,
|
||||
IGNORE: 1,
|
||||
FILES: 2,
|
||||
|
|
@ -86,7 +85,7 @@ function HotplugSniffer() {
|
|||
'/org/gnome/Shell/HotplugSniffer');
|
||||
}
|
||||
|
||||
var ContentTypeDiscoverer = class {
|
||||
class ContentTypeDiscoverer {
|
||||
constructor() {
|
||||
this._settings = new Gio.Settings({ schema_id: SETTINGS_SCHEMA });
|
||||
}
|
||||
|
|
@ -127,9 +126,9 @@ var ContentTypeDiscoverer = class {
|
|||
|
||||
return [apps, contentTypes];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var AutorunManager = class {
|
||||
class AutorunManager {
|
||||
constructor() {
|
||||
this._session = new GnomeSession.SessionManager();
|
||||
this._volumeMonitor = Gio.VolumeMonitor.get();
|
||||
|
|
@ -161,9 +160,9 @@ var AutorunManager = class {
|
|||
_onMountRemoved(monitor, mount) {
|
||||
this._dispatcher.removeMount(mount);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var AutorunDispatcher = class {
|
||||
class AutorunDispatcher {
|
||||
constructor(manager) {
|
||||
this._manager = manager;
|
||||
this._sources = [];
|
||||
|
|
@ -255,9 +254,9 @@ var AutorunDispatcher = class {
|
|||
// destroy the notification source
|
||||
source.destroy();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var AutorunSource = GObject.registerClass(
|
||||
const AutorunSource = GObject.registerClass(
|
||||
class AutorunSource extends MessageTray.Source {
|
||||
_init(manager, mount, apps) {
|
||||
super._init(mount.get_name());
|
||||
|
|
@ -282,7 +281,7 @@ class AutorunSource extends MessageTray.Source {
|
|||
}
|
||||
});
|
||||
|
||||
var AutorunNotification = GObject.registerClass(
|
||||
const AutorunNotification = GObject.registerClass(
|
||||
class AutorunNotification extends MessageTray.Notification {
|
||||
_init(manager, source) {
|
||||
super._init(source, source.title);
|
||||
|
|
@ -346,4 +345,4 @@ class AutorunNotification extends MessageTray.Notification {
|
|||
}
|
||||
});
|
||||
|
||||
var Component = AutorunManager;
|
||||
export {AutorunManager as Component};
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Component */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gcr = imports.gi.Gcr;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gcr from 'gi://Gcr';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Pango from 'gi://Pango';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Dialog = imports.ui.dialog;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const ShellEntry = imports.ui.shellEntry;
|
||||
const CheckBox = imports.ui.checkBox;
|
||||
const {wiggle} = imports.misc.animationUtils;
|
||||
import * as Dialog from '../dialog.js';
|
||||
import * as ModalDialog from '../modalDialog.js';
|
||||
import * as ShellEntry from '../shellEntry.js';
|
||||
import * as CheckBox from '../checkBox.js';
|
||||
import {wiggle} from '../misc/animationUtils.js';
|
||||
|
||||
var KeyringDialog = GObject.registerClass(
|
||||
const KeyringDialog = GObject.registerClass(
|
||||
class KeyringDialog extends ModalDialog.ModalDialog {
|
||||
_init() {
|
||||
super._init({ styleClass: 'prompt-dialog' });
|
||||
|
|
@ -184,7 +183,7 @@ class KeyringDialog extends ModalDialog.ModalDialog {
|
|||
}
|
||||
});
|
||||
|
||||
var KeyringDummyDialog = class {
|
||||
class KeyringDummyDialog {
|
||||
constructor() {
|
||||
this.prompt = new Shell.KeyringPrompt();
|
||||
this.prompt.connect('show-password', this._cancelPrompt.bind(this));
|
||||
|
|
@ -194,9 +193,9 @@ var KeyringDummyDialog = class {
|
|||
_cancelPrompt() {
|
||||
this.prompt.cancel();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var KeyringPrompter = GObject.registerClass(
|
||||
const KeyringPrompter = GObject.registerClass(
|
||||
class KeyringPrompter extends Gcr.SystemPrompter {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -232,4 +231,4 @@ class KeyringPrompter extends Gcr.SystemPrompter {
|
|||
}
|
||||
});
|
||||
|
||||
var Component = KeyringPrompter;
|
||||
export {KeyringPrompter as Component};
|
||||
|
|
|
|||
|
|
@ -1,28 +1,27 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Component */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const NM = imports.gi.NM;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Signals = imports.misc.signals;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import NM from 'gi://NM';
|
||||
import Pango from 'gi://Pango';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Signals from '../../misc/signals.js';
|
||||
|
||||
const Dialog = imports.ui.dialog;
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const ShellEntry = imports.ui.shellEntry;
|
||||
import * as Dialog from '../dialog.js';
|
||||
import * as Main from '../main.js';
|
||||
import * as MessageTray from '../messageTray.js';
|
||||
import * as ModalDialog from '../modalDialog.js';
|
||||
import * as ShellEntry from '../shellEntry.js';
|
||||
|
||||
Gio._promisify(Shell.NetworkAgent.prototype, 'init_async');
|
||||
Gio._promisify(Shell.NetworkAgent.prototype, 'search_vpn_plugin');
|
||||
|
||||
const VPN_UI_GROUP = 'VPN Plugin UI';
|
||||
|
||||
var NetworkSecretDialog = GObject.registerClass(
|
||||
const NetworkSecretDialog = GObject.registerClass(
|
||||
class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
||||
_init(agent, requestId, connection, settingName, hints, flags, contentOverride) {
|
||||
super._init({ styleClass: 'prompt-dialog' });
|
||||
|
|
@ -418,7 +417,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
|||
}
|
||||
});
|
||||
|
||||
var VPNRequestHandler = class extends Signals.EventEmitter {
|
||||
class VPNRequestHandler extends Signals.EventEmitter {
|
||||
constructor(agent, requestId, authHelper, serviceType, connection, hints, flags) {
|
||||
super();
|
||||
|
||||
|
|
@ -676,9 +675,9 @@ var VPNRequestHandler = class extends Signals.EventEmitter {
|
|||
this.destroy();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var NetworkAgent = class {
|
||||
class NetworkAgent {
|
||||
constructor() {
|
||||
this._native = new Shell.NetworkAgent({
|
||||
identifier: 'org.gnome.Shell.NetworkAgent',
|
||||
|
|
@ -880,5 +879,6 @@ var NetworkAgent = class {
|
|||
externalUIMode: ['true', 'yes', 'on', '1'].includes(trimmedProp),
|
||||
};
|
||||
}
|
||||
};
|
||||
var Component = NetworkAgent;
|
||||
}
|
||||
|
||||
export {NetworkAgent as Component};
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Component */
|
||||
|
||||
const AccountsService = imports.gi.AccountsService;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Pango = imports.gi.Pango;
|
||||
const PolkitAgent = imports.gi.PolkitAgent;
|
||||
const Polkit = imports.gi.Polkit;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import AccountsService from 'gi://AccountsService';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Pango from 'gi://Pango';
|
||||
import PolkitAgent from 'gi://PolkitAgent';
|
||||
import Polkit from 'gi://Polkit';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Dialog = imports.ui.dialog;
|
||||
const Main = imports.ui.main;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const ShellEntry = imports.ui.shellEntry;
|
||||
const UserWidget = imports.ui.userWidget;
|
||||
const {wiggle} = imports.misc.animationUtils;
|
||||
import * as Dialog from '../dialog.js';
|
||||
import * as Main from '../main.js';
|
||||
import * as ModalDialog from '../modalDialog.js';
|
||||
import * as ShellEntry from '../shellEntry.js';
|
||||
import * as UserWidget from '../userWidget.js';
|
||||
import {wiggle} from '../misc/animationUtils.js';
|
||||
|
||||
/** @enum {number} */
|
||||
const DialogMode = {
|
||||
|
|
@ -28,7 +27,7 @@ const DIALOG_ICON_SIZE = 64;
|
|||
|
||||
const DELAYED_RESET_TIMEOUT = 200;
|
||||
|
||||
var AuthenticationDialog = GObject.registerClass({
|
||||
const AuthenticationDialog = GObject.registerClass({
|
||||
Signals: { 'done': { param_types: [GObject.TYPE_BOOLEAN] } },
|
||||
}, class AuthenticationDialog extends ModalDialog.ModalDialog {
|
||||
_init(actionId, description, cookie, userNames) {
|
||||
|
|
@ -414,7 +413,7 @@ var AuthenticationDialog = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var AuthenticationAgent = GObject.registerClass(
|
||||
const AuthenticationAgent = GObject.registerClass(
|
||||
class AuthenticationAgent extends Shell.PolkitAuthenticationAgent {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -474,4 +473,4 @@ class AuthenticationAgent extends Shell.PolkitAuthenticationAgent {
|
|||
}
|
||||
});
|
||||
|
||||
var Component = AuthenticationAgent;
|
||||
export {AuthenticationAgent as Component};
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Component */
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const St = imports.gi.St;
|
||||
|
||||
var Tpl = null;
|
||||
var Tp = null;
|
||||
let Tpl = null;
|
||||
let Tp = null;
|
||||
try {
|
||||
({ TelepathyGLib: Tp, TelepathyLogger: Tpl } = imports.gi);
|
||||
({default: Tp} = await import('gi://TelepathyGlib'));
|
||||
({default: Tpl} = await import('gi://TelepathyLogger'));
|
||||
|
||||
Gio._promisify(Tp.Channel.prototype, 'close_async');
|
||||
Gio._promisify(Tp.TextChannel.prototype, 'send_message_async');
|
||||
|
|
@ -20,30 +19,30 @@ try {
|
|||
console.debug('Skipping chat support, telepathy not found');
|
||||
}
|
||||
|
||||
const History = imports.misc.history;
|
||||
const Main = imports.ui.main;
|
||||
const MessageList = imports.ui.messageList;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const Params = imports.misc.params;
|
||||
const Util = imports.misc.util;
|
||||
import * as History from '../../misc/history.js';
|
||||
import * as Main from '../main.js';
|
||||
import * as MessageList from '../messageList.js';
|
||||
import * as MessageTray from '../messageTray.js';
|
||||
import * as Params from '../../misc/params.js';
|
||||
import * as Util from '../../misc/util.js';
|
||||
|
||||
const HAVE_TP = Tp != null && Tpl != null;
|
||||
|
||||
// See Notification.appendMessage
|
||||
var SCROLLBACK_IMMEDIATE_TIME = 3 * 60; // 3 minutes
|
||||
var SCROLLBACK_RECENT_TIME = 15 * 60; // 15 minutes
|
||||
var SCROLLBACK_RECENT_LENGTH = 20;
|
||||
var SCROLLBACK_IDLE_LENGTH = 5;
|
||||
const SCROLLBACK_IMMEDIATE_TIME = 3 * 60; // 3 minutes
|
||||
const SCROLLBACK_RECENT_TIME = 15 * 60; // 15 minutes
|
||||
const SCROLLBACK_RECENT_LENGTH = 20;
|
||||
const SCROLLBACK_IDLE_LENGTH = 5;
|
||||
|
||||
// See Source._displayPendingMessages
|
||||
var SCROLLBACK_HISTORY_LINES = 10;
|
||||
const SCROLLBACK_HISTORY_LINES = 10;
|
||||
|
||||
// See Notification._onEntryChanged
|
||||
var COMPOSING_STOP_TIMEOUT = 5;
|
||||
const COMPOSING_STOP_TIMEOUT = 5;
|
||||
|
||||
var CHAT_EXPAND_LINES = 12;
|
||||
const CHAT_EXPAND_LINES = 12;
|
||||
|
||||
var NotificationDirection = {
|
||||
const NotificationDirection = {
|
||||
SENT: 'chat-sent',
|
||||
RECEIVED: 'chat-received',
|
||||
};
|
||||
|
|
@ -101,7 +100,7 @@ const ChatMessage = HAVE_TP ? GObject.registerClass({
|
|||
}) : null;
|
||||
|
||||
|
||||
var TelepathyComponent = class {
|
||||
class TelepathyComponent {
|
||||
constructor() {
|
||||
this._client = null;
|
||||
|
||||
|
|
@ -131,9 +130,9 @@ var TelepathyComponent = class {
|
|||
|
||||
this._client.unregister();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var TelepathyClient = HAVE_TP ? GObject.registerClass(
|
||||
const TelepathyClient = HAVE_TP ? GObject.registerClass(
|
||||
class TelepathyClient extends Tp.BaseClient {
|
||||
_init() {
|
||||
// channel path -> ChatSource
|
||||
|
|
@ -306,7 +305,7 @@ class TelepathyClient extends Tp.BaseClient {
|
|||
}
|
||||
}) : null;
|
||||
|
||||
var ChatSource = HAVE_TP ? GObject.registerClass(
|
||||
const ChatSource = HAVE_TP ? GObject.registerClass(
|
||||
class ChatSource extends MessageTray.Source {
|
||||
_init(account, conn, channel, contact, client) {
|
||||
this._account = account;
|
||||
|
|
@ -666,7 +665,7 @@ class ChatNotificationMessage extends GObject.Object {
|
|||
}
|
||||
}) : null;
|
||||
|
||||
var ChatNotification = HAVE_TP ? GObject.registerClass({
|
||||
const ChatNotification = HAVE_TP ? GObject.registerClass({
|
||||
Signals: {
|
||||
'message-removed': { param_types: [ChatNotificationMessage.$gtype] },
|
||||
'message-added': { param_types: [ChatNotificationMessage.$gtype] },
|
||||
|
|
@ -841,7 +840,7 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({
|
|||
}
|
||||
}) : null;
|
||||
|
||||
var ChatLineBox = GObject.registerClass(
|
||||
const ChatLineBox = GObject.registerClass(
|
||||
class ChatLineBox extends St.BoxLayout {
|
||||
vfunc_get_preferred_height(forWidth) {
|
||||
let [, natHeight] = super.vfunc_get_preferred_height(forWidth);
|
||||
|
|
@ -849,7 +848,7 @@ class ChatLineBox extends St.BoxLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var ChatNotificationBanner = GObject.registerClass(
|
||||
const ChatNotificationBanner = GObject.registerClass(
|
||||
class ChatNotificationBanner extends MessageTray.NotificationBanner {
|
||||
_init(notification) {
|
||||
super._init(notification);
|
||||
|
|
@ -1020,4 +1019,4 @@ class ChatNotificationBanner extends MessageTray.NotificationBanner {
|
|||
}
|
||||
});
|
||||
|
||||
var Component = TelepathyComponent;
|
||||
export const Component = TelepathyComponent;
|
||||
|
|
|
|||
|
|
@ -1,25 +1,24 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported CtrlAltTabManager */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const SwitcherPopup = imports.ui.switcherPopup;
|
||||
const Params = imports.misc.params;
|
||||
import * as Main from './main.js';
|
||||
import * as SwitcherPopup from './switcherPopup.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
var POPUP_APPICON_SIZE = 96;
|
||||
const POPUP_APPICON_SIZE = 96;
|
||||
|
||||
var SortGroup = {
|
||||
export const SortGroup = {
|
||||
TOP: 0,
|
||||
MIDDLE: 1,
|
||||
BOTTOM: 2,
|
||||
};
|
||||
|
||||
var CtrlAltTabManager = class CtrlAltTabManager {
|
||||
export class CtrlAltTabManager {
|
||||
constructor() {
|
||||
this._items = [];
|
||||
this.addGroup(global.window_group,
|
||||
|
|
@ -141,9 +140,9 @@ var CtrlAltTabManager = class CtrlAltTabManager {
|
|||
_focusWindows(timestamp) {
|
||||
global.display.focus_default_window(timestamp);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var CtrlAltTabPopup = GObject.registerClass(
|
||||
const CtrlAltTabPopup = GObject.registerClass(
|
||||
class CtrlAltTabPopup extends SwitcherPopup.SwitcherPopup {
|
||||
_init(items) {
|
||||
super._init(items);
|
||||
|
|
@ -172,7 +171,7 @@ class CtrlAltTabPopup extends SwitcherPopup.SwitcherPopup {
|
|||
}
|
||||
});
|
||||
|
||||
var CtrlAltTabSwitcher = GObject.registerClass(
|
||||
const CtrlAltTabSwitcher = GObject.registerClass(
|
||||
class CtrlAltTabSwitcher extends SwitcherPopup.SwitcherList {
|
||||
_init(items) {
|
||||
super._init(true);
|
||||
|
|
|
|||
|
|
@ -1,25 +1,24 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Dash */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const AppDisplay = imports.ui.appDisplay;
|
||||
const AppFavorites = imports.ui.appFavorites;
|
||||
const DND = imports.ui.dnd;
|
||||
const IconGrid = imports.ui.iconGrid;
|
||||
const Main = imports.ui.main;
|
||||
const Overview = imports.ui.overview;
|
||||
import * as AppDisplay from './appDisplay.js';
|
||||
import * as AppFavorites from './appFavorites.js';
|
||||
import * as DND from './dnd.js';
|
||||
import * as IconGrid from './iconGrid.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Overview from './overview.js';
|
||||
|
||||
var DASH_ANIMATION_TIME = 200;
|
||||
var DASH_ITEM_LABEL_SHOW_TIME = 150;
|
||||
var DASH_ITEM_LABEL_HIDE_TIME = 100;
|
||||
var DASH_ITEM_HOVER_TIMEOUT = 300;
|
||||
const DASH_ANIMATION_TIME = 200;
|
||||
const DASH_ITEM_LABEL_SHOW_TIME = 150;
|
||||
const DASH_ITEM_LABEL_HIDE_TIME = 100;
|
||||
const DASH_ITEM_HOVER_TIMEOUT = 300;
|
||||
|
||||
/**
|
||||
* @param {AppDisplay.AppIcon} source
|
||||
|
|
@ -31,7 +30,7 @@ function getAppFromSource(source) {
|
|||
return null;
|
||||
}
|
||||
|
||||
var DashIcon = GObject.registerClass(
|
||||
export const DashIcon = GObject.registerClass(
|
||||
class DashIcon extends AppDisplay.AppIcon {
|
||||
_init(app) {
|
||||
super._init(app, {
|
||||
|
|
@ -62,7 +61,7 @@ class DashIcon extends AppDisplay.AppIcon {
|
|||
|
||||
// A container like StBin, but taking the child's scale into account
|
||||
// when requesting a size
|
||||
var DashItemContainer = GObject.registerClass(
|
||||
export const DashItemContainer = GObject.registerClass(
|
||||
class DashItemContainer extends St.Widget {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
@ -200,7 +199,7 @@ class DashItemContainer extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var ShowAppsIcon = GObject.registerClass(
|
||||
export const ShowAppsIcon = GObject.registerClass(
|
||||
class ShowAppsIcon extends DashItemContainer {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -285,7 +284,7 @@ class ShowAppsIcon extends DashItemContainer {
|
|||
}
|
||||
});
|
||||
|
||||
var DragPlaceholderItem = GObject.registerClass(
|
||||
const DragPlaceholderItem = GObject.registerClass(
|
||||
class DragPlaceholderItem extends DashItemContainer {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -293,7 +292,7 @@ class DragPlaceholderItem extends DashItemContainer {
|
|||
}
|
||||
});
|
||||
|
||||
var EmptyDropTargetItem = GObject.registerClass(
|
||||
const EmptyDropTargetItem = GObject.registerClass(
|
||||
class EmptyDropTargetItem extends DashItemContainer {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -317,7 +316,7 @@ class DashIconsLayout extends Clutter.BoxLayout {
|
|||
|
||||
const baseIconSizes = [16, 22, 24, 32, 48, 64];
|
||||
|
||||
var Dash = GObject.registerClass({
|
||||
export const Dash = GObject.registerClass({
|
||||
Signals: { 'icon-size-changed': {} },
|
||||
}, class Dash extends St.Widget {
|
||||
_init() {
|
||||
|
|
|
|||
|
|
@ -1,24 +1,22 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported DateMenuButton */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GnomeDesktop = imports.gi.GnomeDesktop;
|
||||
const GObject = imports.gi.GObject;
|
||||
const GWeather = imports.gi.GWeather;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GnomeDesktop from 'gi://GnomeDesktop';
|
||||
import GObject from 'gi://GObject';
|
||||
import GWeather from 'gi://GWeather';
|
||||
import Pango from 'gi://Pango';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const Calendar = imports.ui.calendar;
|
||||
const Weather = imports.misc.weather;
|
||||
const DateUtils = imports.misc.dateUtils;
|
||||
import * as Main from './main.js';
|
||||
import * as PanelMenu from './panelMenu.js';
|
||||
import * as Calendar from './calendar.js';
|
||||
import * as Weather from '../misc/weather.js';
|
||||
|
||||
const {formatDateWithCFormatString, formatTime} = imports.misc.dateUtils;
|
||||
const {loadInterfaceXML} = imports.misc.fileUtils;
|
||||
import {formatDateWithCFormatString, formatTime, clearCachedLocalTimeZone} from '../misc/dateUtils.js';
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
|
||||
const NC_ = (context, str) => `${context}\u0004${str}`;
|
||||
const T_ = Shell.util_translate_time_string;
|
||||
|
|
@ -52,7 +50,7 @@ function _gDateTimeToDate(datetime) {
|
|||
return new Date(datetime.to_unix() * 1000 + datetime.get_microsecond() / 1000);
|
||||
}
|
||||
|
||||
var TodayButton = GObject.registerClass(
|
||||
const TodayButton = GObject.registerClass(
|
||||
class TodayButton extends St.Button {
|
||||
_init(calendar) {
|
||||
// Having the ability to go to the current date if the user is already
|
||||
|
|
@ -109,7 +107,7 @@ class TodayButton extends St.Button {
|
|||
}
|
||||
});
|
||||
|
||||
var EventsSection = GObject.registerClass(
|
||||
const EventsSection = GObject.registerClass(
|
||||
class EventsSection extends St.Button {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
@ -328,7 +326,7 @@ class EventsSection extends St.Button {
|
|||
}
|
||||
});
|
||||
|
||||
var WorldClocksSection = GObject.registerClass(
|
||||
const WorldClocksSection = GObject.registerClass(
|
||||
class WorldClocksSection extends St.Button {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
@ -534,7 +532,7 @@ class WorldClocksSection extends St.Button {
|
|||
}
|
||||
});
|
||||
|
||||
var WeatherSection = GObject.registerClass(
|
||||
const WeatherSection = GObject.registerClass(
|
||||
class WeatherSection extends St.Button {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
@ -727,7 +725,7 @@ class WeatherSection extends St.Button {
|
|||
}
|
||||
});
|
||||
|
||||
var MessagesIndicator = GObject.registerClass(
|
||||
const MessagesIndicator = GObject.registerClass(
|
||||
class MessagesIndicator extends St.Icon {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
@ -788,7 +786,7 @@ class MessagesIndicator extends St.Icon {
|
|||
}
|
||||
});
|
||||
|
||||
var FreezableBinLayout = GObject.registerClass(
|
||||
const FreezableBinLayout = GObject.registerClass(
|
||||
class FreezableBinLayout extends Clutter.BinLayout {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -828,7 +826,7 @@ class FreezableBinLayout extends Clutter.BinLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var CalendarColumnLayout = GObject.registerClass(
|
||||
const CalendarColumnLayout = GObject.registerClass(
|
||||
class CalendarColumnLayout extends Clutter.BoxLayout {
|
||||
_init(actors) {
|
||||
super._init({orientation: Clutter.Orientation.VERTICAL});
|
||||
|
|
@ -847,7 +845,7 @@ class CalendarColumnLayout extends Clutter.BoxLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var DateMenuButton = GObject.registerClass(
|
||||
export const DateMenuButton = GObject.registerClass(
|
||||
class DateMenuButton extends PanelMenu.Button {
|
||||
_init() {
|
||||
let hbox;
|
||||
|
|
@ -970,7 +968,7 @@ class DateMenuButton extends PanelMenu.Button {
|
|||
}
|
||||
|
||||
_updateTimeZone() {
|
||||
DateUtils.clearCachedLocalTimeZone();
|
||||
clearCachedLocalTimeZone();
|
||||
|
||||
this._calendar.updateTimeZone();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Dialog, MessageDialogContent, ListSection, ListSectionItem */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Pango = imports.gi.Pango;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Pango from 'gi://Pango';
|
||||
import St from 'gi://St';
|
||||
|
||||
function _setLabel(label, value) {
|
||||
label.set({
|
||||
|
|
@ -15,7 +14,7 @@ function _setLabel(label, value) {
|
|||
});
|
||||
}
|
||||
|
||||
var Dialog = GObject.registerClass(
|
||||
export const Dialog = GObject.registerClass(
|
||||
class Dialog extends St.Widget {
|
||||
_init(parentActor, styleClass) {
|
||||
super._init({
|
||||
|
|
@ -156,7 +155,7 @@ class Dialog extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var MessageDialogContent = GObject.registerClass({
|
||||
export const MessageDialogContent = GObject.registerClass({
|
||||
Properties: {
|
||||
'title': GObject.ParamSpec.string(
|
||||
'title', 'title', 'title',
|
||||
|
|
@ -248,7 +247,7 @@ var MessageDialogContent = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ListSection = GObject.registerClass({
|
||||
export const ListSection = GObject.registerClass({
|
||||
Properties: {
|
||||
'title': GObject.ParamSpec.string(
|
||||
'title', 'title', 'title',
|
||||
|
|
@ -293,7 +292,7 @@ var ListSection = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ListSectionItem = GObject.registerClass({
|
||||
export const ListSectionItem = GObject.registerClass({
|
||||
Properties: {
|
||||
'icon-actor': GObject.ParamSpec.object(
|
||||
'icon-actor', 'icon-actor', 'Icon actor',
|
||||
|
|
|
|||
49
js/ui/dnd.js
49
js/ui/dnd.js
|
|
@ -1,25 +1,24 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported addDragMonitor, removeDragMonitor, makeDraggable */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Signals = imports.misc.signals;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
// Time to scale down to maxDragActorSize
|
||||
var SCALE_ANIMATION_TIME = 250;
|
||||
const SCALE_ANIMATION_TIME = 250;
|
||||
// Time to animate to original position on cancel
|
||||
var SNAP_BACK_ANIMATION_TIME = 250;
|
||||
const SNAP_BACK_ANIMATION_TIME = 250;
|
||||
// Time to animate to original position on success
|
||||
var REVERT_ANIMATION_TIME = 750;
|
||||
const REVERT_ANIMATION_TIME = 750;
|
||||
|
||||
/** @enum {number} */
|
||||
varragMotionResult = {
|
||||
export const DragMotionResult = {
|
||||
NO_DROP: 0,
|
||||
COPY_DROP: 1,
|
||||
MOVE_DROP: 2,
|
||||
|
|
@ -27,24 +26,24 @@ varragMotionResult = {
|
|||
};
|
||||
|
||||
/** @enum {number} */
|
||||
varragState = {
|
||||
const DragState = {
|
||||
INIT: 0,
|
||||
DRAGGING: 1,
|
||||
CANCELLED: 2,
|
||||
};
|
||||
|
||||
var DRAG_CURSOR_MAP = {
|
||||
const DRAG_CURSOR_MAP = {
|
||||
0: Meta.Cursor.DND_UNSUPPORTED_TARGET,
|
||||
1: Meta.Cursor.DND_COPY,
|
||||
2: Meta.Cursor.DND_MOVE,
|
||||
};
|
||||
|
||||
var DragDropResult = {
|
||||
export const DragDropResult = {
|
||||
FAILURE: 0,
|
||||
SUCCESS: 1,
|
||||
CONTINUE: 2,
|
||||
};
|
||||
var dragMonitors = [];
|
||||
export const dragMonitors = [];
|
||||
|
||||
let eventHandlerActor = null;
|
||||
let currentDraggable = null;
|
||||
|
|
@ -79,23 +78,23 @@ function _getRealActorScale(actor) {
|
|||
/**
|
||||
* @param {DragMonitor} monitor
|
||||
*/
|
||||
function addDragMonitor(monitor) {
|
||||
export function addDragMonitor(monitor) {
|
||||
dragMonitors.push(monitor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {DragMonitor} monitor
|
||||
*/
|
||||
function removeDragMonitor(monitor) {
|
||||
export function removeDragMonitor(monitor) {
|
||||
for (let i = 0; i < dragMonitors.length; i++) {
|
||||
if (dragMonitors[i] == monitor) {
|
||||
if (dragMonitors[i] === monitor) {
|
||||
dragMonitors.splice(i, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var _Draggable = class _Draggable extends Signals.EventEmitter {
|
||||
class _Draggable extends Signals.EventEmitter {
|
||||
constructor(actor, params) {
|
||||
super();
|
||||
|
||||
|
|
@ -112,9 +111,9 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
|
|||
|
||||
if (!params.manualMode) {
|
||||
this.actor.connect('button-press-event',
|
||||
this._onButtonPress.bind(this));
|
||||
this._onButtonPress.bind(this));
|
||||
this.actor.connect('touch-event',
|
||||
this._onTouchEvent.bind(this));
|
||||
this._onTouchEvent.bind(this));
|
||||
}
|
||||
|
||||
this.actor.connect('destroy', () => {
|
||||
|
|
@ -866,7 +865,7 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
|
|||
this._dragState = DragState.INIT;
|
||||
currentDraggable = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* makeDraggable:
|
||||
|
|
@ -890,6 +889,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
|
|||
* target wants to reuse the actor, it's up to the drop target to
|
||||
* reset these values.
|
||||
*/
|
||||
function makeDraggable(actor, params) {
|
||||
export function makeDraggable(actor, params) {
|
||||
return new _Draggable(actor, params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported EdgeDragAction */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
import * as Main from './main.js';
|
||||
|
||||
var EDGE_THRESHOLD = 20;
|
||||
var DRAG_DISTANCE = 80;
|
||||
const EDGE_THRESHOLD = 20;
|
||||
const DRAG_DISTANCE = 80;
|
||||
|
||||
var EdgeDragAction = GObject.registerClass({
|
||||
export const EdgeDragAction = GObject.registerClass({
|
||||
Signals: {
|
||||
'activated': {},
|
||||
'progress': { param_types: [GObject.TYPE_DOUBLE] },
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported init, EndSessionDialog */
|
||||
/*
|
||||
* Copyright 2010-2016 Red Hat, Inc
|
||||
*
|
||||
|
|
@ -17,25 +16,25 @@
|
|||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
const AccountsService = imports.gi.AccountsService;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Polkit = imports.gi.Polkit;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const UPower = imports.gi.UPowerGlib;
|
||||
import AccountsService from 'gi://AccountsService';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Pango from 'gi://Pango';
|
||||
import Polkit from 'gi://Polkit';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import UPower from 'gi://UPowerGlib';
|
||||
|
||||
const CheckBox = imports.ui.checkBox;
|
||||
const Dialog = imports.ui.dialog;
|
||||
const GnomeSession = imports.misc.gnomeSession;
|
||||
const LoginManager = imports.misc.loginManager;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const UserWidget = imports.ui.userWidget;
|
||||
import * as CheckBox from './checkBox.js';
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as GnomeSession from '../misc/gnomeSession.js';
|
||||
import * as LoginManager from '../misc/loginManager.js';
|
||||
import * as ModalDialog from './modalDialog.js';
|
||||
import * as UserWidget from './userWidget.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
|
||||
const _ITEM_ICON_SIZE = 64;
|
||||
|
||||
|
|
@ -159,7 +158,7 @@ const DialogContent = {
|
|||
4 /* DialogType.UPGRADE_RESTART */: restartUpgradeDialogContent,
|
||||
};
|
||||
|
||||
var MAX_USERS_IN_SESSION_DIALOG = 5;
|
||||
const MAX_USERS_IN_SESSION_DIALOG = 5;
|
||||
|
||||
const LogindSessionIface = loadInterfaceXML('org.freedesktop.login1.Session');
|
||||
const LogindSession = Gio.DBusProxy.makeProxyWrapper(LogindSessionIface);
|
||||
|
|
@ -224,14 +223,14 @@ function _setCheckBoxLabel(checkBox, text) {
|
|||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
export function init() {
|
||||
// This always returns the same singleton object
|
||||
// By instantiating it initially, we register the
|
||||
// bus object, etc.
|
||||
new EndSessionDialog();
|
||||
}
|
||||
|
||||
var EndSessionDialog = GObject.registerClass(
|
||||
const EndSessionDialog = GObject.registerClass(
|
||||
class EndSessionDialog extends ModalDialog.ModalDialog {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ import Polkit from 'gi://Polkit';
|
|||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const SignalTracker = imports.misc.signalTracker;
|
||||
const {adjustAnimationTime} = imports.misc.animationUtils;
|
||||
import * as SignalTracker from '../misc/signalTracker.js';
|
||||
import {adjustAnimationTime} from '../misc/animationUtils.js';
|
||||
|
||||
setConsoleLogDomain('GNOME Shell');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +1,26 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported init, installExtension, uninstallExtension, checkForUpdates */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Soup = imports.gi.Soup;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Soup from 'gi://Soup';
|
||||
|
||||
const Config = imports.misc.config;
|
||||
const Dialog = imports.ui.dialog;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const FileUtils = imports.misc.fileUtils;
|
||||
const Main = imports.ui.main;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as ExtensionUtils from '../misc/extensionUtils.js';
|
||||
import * as FileUtils from '../misc/fileUtils.js';
|
||||
import * as Main from './main.js';
|
||||
import * as ModalDialog from './modalDialog.js';
|
||||
|
||||
Gio._promisify(Soup.Session.prototype, 'send_and_read_async');
|
||||
Gio._promisify(Gio.OutputStream.prototype, 'write_bytes_async');
|
||||
Gio._promisify(Gio.IOStream.prototype, 'close_async');
|
||||
Gio._promisify(Gio.Subprocess.prototype, 'wait_check_async');
|
||||
|
||||
var REPOSITORY_URL_DOWNLOAD = 'https://extensions.gnome.org/download-extension/%s.shell-extension.zip';
|
||||
var REPOSITORY_URL_INFO = 'https://extensions.gnome.org/extension-info/';
|
||||
var REPOSITORY_URL_UPDATE = 'https://extensions.gnome.org/update-info/';
|
||||
const REPOSITORY_URL_DOWNLOAD = 'https://extensions.gnome.org/download-extension/%s.shell-extension.zip';
|
||||
const REPOSITORY_URL_INFO = 'https://extensions.gnome.org/extension-info/';
|
||||
const REPOSITORY_URL_UPDATE = 'https://extensions.gnome.org/update-info/';
|
||||
|
||||
let _httpSession;
|
||||
|
||||
|
|
@ -30,7 +29,7 @@ let _httpSession;
|
|||
* @param {Gio.DBusMethodInvocation} invocation - the caller
|
||||
* @returns {void}
|
||||
*/
|
||||
async function installExtension(uuid, invocation) {
|
||||
export async function installExtension(uuid, invocation) {
|
||||
const params = {
|
||||
uuid,
|
||||
shell_version: Config.PACKAGE_VERSION,
|
||||
|
|
@ -63,7 +62,7 @@ async function installExtension(uuid, invocation) {
|
|||
/**
|
||||
* @param {string} uuid
|
||||
*/
|
||||
function uninstallExtension(uuid) {
|
||||
export function uninstallExtension(uuid) {
|
||||
let extension = Main.extensionManager.lookup(uuid);
|
||||
if (!extension)
|
||||
return false;
|
||||
|
|
@ -153,7 +152,7 @@ async function extractExtensionArchive(bytes, dir) {
|
|||
* @param {string} uuid - extension uuid
|
||||
* @returns {void}
|
||||
*/
|
||||
async function downloadExtensionUpdate(uuid) {
|
||||
export async function downloadExtensionUpdate(uuid) {
|
||||
if (!Main.extensionManager.updatesSupported)
|
||||
return;
|
||||
|
||||
|
|
@ -184,7 +183,7 @@ async function downloadExtensionUpdate(uuid) {
|
|||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
async function checkForUpdates() {
|
||||
export async function checkForUpdates() {
|
||||
if (!Main.extensionManager.updatesSupported)
|
||||
return;
|
||||
|
||||
|
|
@ -244,7 +243,7 @@ async function checkForUpdates() {
|
|||
}
|
||||
}
|
||||
|
||||
var InstallExtensionDialog = GObject.registerClass(
|
||||
const InstallExtensionDialog = GObject.registerClass(
|
||||
class InstallExtensionDialog extends ModalDialog.ModalDialog {
|
||||
_init(uuid, info, invocation) {
|
||||
super._init({ styleClass: 'extension-dialog' });
|
||||
|
|
@ -311,6 +310,6 @@ class InstallExtensionDialog extends ModalDialog.ModalDialog {
|
|||
}
|
||||
});
|
||||
|
||||
function init() {
|
||||
export function init() {
|
||||
_httpSession = new Soup.Session();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,20 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported init connect disconnect ExtensionManager */
|
||||
|
||||
const GLib = imports.gi.GLib;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Signals = imports.misc.signals;
|
||||
import GLib from 'gi://GLib';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
import Shell from 'gi://Shell';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const ExtensionDownloader = imports.ui.extensionDownloader;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const FileUtils = imports.misc.fileUtils;
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
import * as ExtensionDownloader from './extensionDownloader.js';
|
||||
import {ExtensionState, ExtensionType} from '../misc/extensionUtils.js';
|
||||
import * as FileUtils from '../misc/fileUtils.js';
|
||||
import * as Main from './main.js';
|
||||
import * as MessageTray from './messageTray.js';
|
||||
|
||||
const Config = imports.misc.config;
|
||||
|
||||
const { ExtensionState, ExtensionType } = ExtensionUtils;
|
||||
|
||||
const ENABLED_EXTENSIONS_KEY = 'enabled-extensions';
|
||||
const DISABLED_EXTENSIONS_KEY = 'disabled-extensions';
|
||||
const DISABLE_USER_EXTENSIONS_KEY = 'disable-user-extensions';
|
||||
|
|
@ -25,7 +22,7 @@ const EXTENSION_DISABLE_VERSION_CHECK_KEY = 'disable-extension-version-validatio
|
|||
|
||||
const UPDATE_CHECK_TIMEOUT = 24 * 60 * 60; // 1 day in seconds
|
||||
|
||||
var ExtensionManager = class extends Signals.EventEmitter {
|
||||
export class ExtensionManager extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -768,7 +765,7 @@ var ExtensionManager = class extends Signals.EventEmitter {
|
|||
await this._onEnabledExtensionsChanged();
|
||||
await this._enableAllExtensions();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const ExtensionUpdateSource = GObject.registerClass(
|
||||
class ExtensionUpdateSource extends MessageTray.Source {
|
||||
|
|
|
|||
|
|
@ -20,15 +20,14 @@
|
|||
* Contributor:
|
||||
* Magdalen Berns <m.berns@sms.ed.ac.uk>
|
||||
*/
|
||||
/* exported FocusCaretTracker */
|
||||
|
||||
const Atspi = imports.gi.Atspi;
|
||||
const Signals = imports.misc.signals;
|
||||
import Atspi from 'gi://Atspi';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const CARETMOVED = 'object:text-caret-moved';
|
||||
const STATECHANGED = 'object:state-changed';
|
||||
|
||||
var FocusCaretTracker = class FocusCaretTracker extends Signals.EventEmitter {
|
||||
export class FocusCaretTracker extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -88,4 +87,4 @@ var FocusCaretTracker = class FocusCaretTracker extends Signals.EventEmitter {
|
|||
this._atspiListener.deregister(CARETMOVED);
|
||||
this._caretListenerRegistered = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported GrabHelper */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
/**
|
||||
* GrabHelper:
|
||||
|
|
@ -18,7 +17,7 @@ const Params = imports.misc.params;
|
|||
* after you call ungrab(), but instead pass an 'onUngrab' callback when you
|
||||
* call grab().
|
||||
*/
|
||||
class GrabHelper {
|
||||
export class GrabHelper {
|
||||
/**
|
||||
* @param {Clutter.Actor} owner the actor that owns the GrabHelper
|
||||
* @param {*} params optional parameters to pass to Main.pushModal()
|
||||
|
|
@ -293,4 +292,4 @@ class GrabHelper {
|
|||
|
||||
return Clutter.EVENT_STOP;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported CandidatePopup */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const IBus = imports.gi.IBus;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import IBus from 'gi://IBus';
|
||||
import St from 'gi://St';
|
||||
|
||||
const BoxPointer = imports.ui.boxpointer;
|
||||
const Main = imports.ui.main;
|
||||
import * as BoxPointer from './boxpointer.js';
|
||||
import * as Main from './main.js';
|
||||
|
||||
var MAX_CANDIDATES_PER_PAGE = 16;
|
||||
const MAX_CANDIDATES_PER_PAGE = 16;
|
||||
|
||||
var DEFAULT_INDEX_LABELS = [
|
||||
const DEFAULT_INDEX_LABELS = [
|
||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
||||
'a', 'b', 'c', 'd', 'e', 'f',
|
||||
];
|
||||
|
||||
var CandidateArea = GObject.registerClass({
|
||||
const CandidateArea = GObject.registerClass({
|
||||
Signals: {
|
||||
'candidate-clicked': {
|
||||
param_types: [
|
||||
|
|
@ -146,7 +145,7 @@ var CandidateArea = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var CandidatePopup = GObject.registerClass(
|
||||
export const CandidatePopup = GObject.registerClass(
|
||||
class IbusCandidatePopup extends BoxPointer.BoxPointer {
|
||||
_init() {
|
||||
super._init(St.Side.TOP);
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported BaseIcon, IconGrid, IconGridLayout */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Params = imports.misc.params;
|
||||
const Main = imports.ui.main;
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as Main from './main.js';
|
||||
|
||||
var ICON_SIZE = 96;
|
||||
const ICON_SIZE = 96;
|
||||
|
||||
var PAGE_SWITCH_TIME = 300;
|
||||
const PAGE_SWITCH_TIME = 300;
|
||||
|
||||
/** @enum {number} */
|
||||
var IconSize = {
|
||||
const IconSize = {
|
||||
LARGE: 96,
|
||||
MEDIUM: 64,
|
||||
MEDIUM_SMALL: 48,
|
||||
|
|
@ -25,8 +24,8 @@ var IconSize = {
|
|||
TINY: 16,
|
||||
};
|
||||
|
||||
var APPICON_ANIMATION_OUT_SCALE = 3;
|
||||
var APPICON_ANIMATION_OUT_TIME = 250;
|
||||
const APPICON_ANIMATION_OUT_SCALE = 3;
|
||||
const APPICON_ANIMATION_OUT_TIME = 250;
|
||||
|
||||
const ICON_POSITION_DELAY = 10;
|
||||
|
||||
|
|
@ -49,11 +48,11 @@ const defaultGridModes = [
|
|||
},
|
||||
];
|
||||
|
||||
var LEFT_DIVIDER_LEEWAY = 20;
|
||||
var RIGHT_DIVIDER_LEEWAY = 20;
|
||||
const LEFT_DIVIDER_LEEWAY = 20;
|
||||
const RIGHT_DIVIDER_LEEWAY = 20;
|
||||
|
||||
/** @enum {number} */
|
||||
var DragLocation = {
|
||||
export const DragLocation = {
|
||||
INVALID: 0,
|
||||
START_EDGE: 1,
|
||||
ON_ICON: 2,
|
||||
|
|
@ -61,7 +60,7 @@ var DragLocation = {
|
|||
EMPTY_SPACE: 4,
|
||||
};
|
||||
|
||||
var BaseIcon = GObject.registerClass(
|
||||
export const BaseIcon = GObject.registerClass(
|
||||
class BaseIcon extends Shell.SquareBin {
|
||||
_init(label, params) {
|
||||
params = Params.parse(params, {
|
||||
|
|
@ -243,7 +242,7 @@ function swap(value, length) {
|
|||
return length - value - 1;
|
||||
}
|
||||
|
||||
var IconGridLayout = GObject.registerClass({
|
||||
export const IconGridLayout = GObject.registerClass({
|
||||
Properties: {
|
||||
'allow-incomplete-pages': GObject.ParamSpec.boolean('allow-incomplete-pages',
|
||||
'Allow incomplete pages', 'Allow incomplete pages',
|
||||
|
|
@ -1160,7 +1159,7 @@ var IconGridLayout = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var IconGrid = GObject.registerClass({
|
||||
export const IconGrid = GObject.registerClass({
|
||||
Signals: {
|
||||
'pages-changed': {},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
/* exported InhibitShortcutsDialog */
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Pango from 'gi://Pango';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Dialog = imports.ui.dialog;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const PermissionStore = imports.misc.permissionStore;
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as ModalDialog from './modalDialog.js';
|
||||
import * as PermissionStore from '../misc/permissionStore.js';
|
||||
|
||||
const APP_ALLOWLIST = ['org.gnome.Settings.desktop'];
|
||||
const APP_PERMISSIONS_TABLE = 'gnome';
|
||||
|
|
@ -16,9 +15,9 @@ const APP_PERMISSIONS_ID = 'shortcuts-inhibitor';
|
|||
const GRANTED = 'GRANTED';
|
||||
const DENIED = 'DENIED';
|
||||
|
||||
var DialogResponse = Meta.InhibitShortcutsDialogResponse;
|
||||
const DialogResponse = Meta.InhibitShortcutsDialogResponse;
|
||||
|
||||
var InhibitShortcutsDialog = GObject.registerClass({
|
||||
export const InhibitShortcutsDialog = GObject.registerClass({
|
||||
Implements: [Meta.InhibitShortcutsDialog],
|
||||
Properties: {
|
||||
'window': GObject.ParamSpec.override('window', Meta.InhibitShortcutsDialog),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import './environment.js';
|
|||
imports._promiseNative.setMainLoopHook(() => {
|
||||
// Queue starting the shell
|
||||
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
|
||||
imports.ui.main.start().catch(e => {
|
||||
import('./main.js').then(main => main.start()).catch(e => {
|
||||
const error = new GLib.Error(
|
||||
Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED,
|
||||
e.message);
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
/* exported KbdA11yDialog */
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
|
||||
const Dialog = imports.ui.dialog;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as ModalDialog from './modalDialog.js';
|
||||
|
||||
const KEYBOARD_A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard';
|
||||
const KEY_STICKY_KEYS_ENABLED = 'stickykeys-enable';
|
||||
const KEY_SLOW_KEYS_ENABLED = 'slowkeys-enable';
|
||||
|
||||
var KbdA11yDialog = GObject.registerClass(
|
||||
export const KbdA11yDialog = GObject.registerClass(
|
||||
class KbdA11yDialog extends GObject.Object {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,29 +1,27 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported KeyboardManager */
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import IBus from 'gi://IBus';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const IBus = imports.gi.IBus;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Signals = imports.misc.signals;
|
||||
import * as EdgeDragAction from './edgeDragAction.js';
|
||||
import * as InputSourceManager from './status/keyboard.js';
|
||||
import * as IBusManager from '../misc/ibusManager.js';
|
||||
import * as BoxPointer from './boxpointer.js';
|
||||
import * as Main from './main.js';
|
||||
import * as PageIndicators from './pageIndicators.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
import * as SwipeTracker from './swipeTracker.js';
|
||||
|
||||
const EdgeDragAction = imports.ui.edgeDragAction;
|
||||
const InputSourceManager = imports.ui.status.keyboard;
|
||||
const IBusManager = imports.misc.ibusManager;
|
||||
const BoxPointer = imports.ui.boxpointer;
|
||||
const Main = imports.ui.main;
|
||||
const PageIndicators = imports.ui.pageIndicators;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const SwipeTracker = imports.ui.swipeTracker;
|
||||
|
||||
var KEYBOARD_ANIMATION_TIME = 150;
|
||||
var KEYBOARD_REST_TIME = KEYBOARD_ANIMATION_TIME * 2;
|
||||
var KEY_LONG_PRESS_TIME = 250;
|
||||
const KEYBOARD_ANIMATION_TIME = 150;
|
||||
const KEYBOARD_REST_TIME = KEYBOARD_ANIMATION_TIME * 2;
|
||||
const KEY_LONG_PRESS_TIME = 250;
|
||||
|
||||
const A11Y_APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
|
||||
const SHOW_KEYBOARD = 'screen-keyboard-enabled';
|
||||
|
|
@ -35,7 +33,7 @@ const KEY_SIZE = 2;
|
|||
const KEY_RELEASE_TIMEOUT = 50;
|
||||
const BACKSPACE_WORD_DELETE_THRESHOLD = 50;
|
||||
|
||||
var AspectContainer = GObject.registerClass(
|
||||
const AspectContainer = GObject.registerClass(
|
||||
class AspectContainer extends St.Widget {
|
||||
_init(params) {
|
||||
super._init(params);
|
||||
|
|
@ -82,7 +80,7 @@ class AspectContainer extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var KeyContainer = GObject.registerClass(
|
||||
const KeyContainer = GObject.registerClass(
|
||||
class KeyContainer extends St.Widget {
|
||||
_init() {
|
||||
const gridLayout = new Clutter.GridLayout({
|
||||
|
|
@ -166,7 +164,7 @@ class KeyContainer extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var Suggestions = GObject.registerClass(
|
||||
const Suggestions = GObject.registerClass(
|
||||
class Suggestions extends St.BoxLayout {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
@ -203,7 +201,7 @@ class Suggestions extends St.BoxLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var LanguageSelectionPopup = class extends PopupMenu.PopupMenu {
|
||||
class LanguageSelectionPopup extends PopupMenu.PopupMenu {
|
||||
constructor(actor) {
|
||||
super(actor, 0.5, St.Side.BOTTOM);
|
||||
|
||||
|
|
@ -262,9 +260,9 @@ var LanguageSelectionPopup = class extends PopupMenu.PopupMenu {
|
|||
this.sourceActor.disconnectObject(this);
|
||||
super.destroy();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var Key = GObject.registerClass({
|
||||
const Key = GObject.registerClass({
|
||||
Signals: {
|
||||
'long-press': {},
|
||||
'pressed': {},
|
||||
|
|
@ -520,7 +518,7 @@ var Key = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var KeyboardModel = class {
|
||||
class KeyboardModel {
|
||||
constructor(groupName) {
|
||||
let names = [groupName];
|
||||
if (groupName.includes('+'))
|
||||
|
|
@ -552,9 +550,9 @@ var KeyboardModel = class {
|
|||
getKeysForLevel(levelName) {
|
||||
return this._model.levels.find(level => level == levelName);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var FocusTracker = class extends Signals.EventEmitter {
|
||||
class FocusTracker extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -651,9 +649,9 @@ var FocusTracker = class extends Signals.EventEmitter {
|
|||
|
||||
return rect;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var EmojiPager = GObject.registerClass({
|
||||
const EmojiPager = GObject.registerClass({
|
||||
Properties: {
|
||||
'delta': GObject.ParamSpec.int(
|
||||
'delta', 'delta', 'delta',
|
||||
|
|
@ -936,7 +934,7 @@ var EmojiPager = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var EmojiSelection = GObject.registerClass({
|
||||
const EmojiSelection = GObject.registerClass({
|
||||
Signals: {
|
||||
'emoji-selected': { param_types: [GObject.TYPE_STRING] },
|
||||
'close-request': {},
|
||||
|
|
@ -1121,7 +1119,7 @@ var EmojiSelection = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var Keypad = GObject.registerClass({
|
||||
const Keypad = GObject.registerClass({
|
||||
Signals: {
|
||||
'keyval': { param_types: [GObject.TYPE_UINT] },
|
||||
},
|
||||
|
|
@ -1178,7 +1176,7 @@ var Keypad = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var KeyboardManager = class extends Signals.EventEmitter {
|
||||
export class KeyboardManager extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -1297,9 +1295,9 @@ var KeyboardManager = class extends Signals.EventEmitter {
|
|||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var Keyboard = GObject.registerClass({
|
||||
export const Keyboard = GObject.registerClass({
|
||||
Signals: {
|
||||
'visibility-changed': {},
|
||||
},
|
||||
|
|
@ -2170,7 +2168,7 @@ var Keyboard = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var KeyboardController = class extends Signals.EventEmitter {
|
||||
class KeyboardController extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -2279,4 +2277,4 @@ var KeyboardController = class extends Signals.EventEmitter {
|
|||
this._virtualDevice.notify_keyval(Clutter.get_current_event_time() * 1000,
|
||||
keyval, Clutter.KeyState.RELEASED);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,27 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported MonitorConstraint, LayoutManager */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Signals = imports.misc.signals;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const Background = imports.ui.background;
|
||||
const BackgroundMenu = imports.ui.backgroundMenu;
|
||||
import * as Background from './background.js';
|
||||
import * as BackgroundMenu from './backgroundMenu.js';
|
||||
|
||||
const DND = imports.ui.dnd;
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
const Ripples = imports.ui.ripples;
|
||||
import * as DND from './dnd.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as Ripples from './ripples.js';
|
||||
|
||||
var STARTUP_ANIMATION_TIME = 500;
|
||||
var BACKGROUND_FADE_ANIMATION_TIME = 1000;
|
||||
const STARTUP_ANIMATION_TIME = 500;
|
||||
const BACKGROUND_FADE_ANIMATION_TIME = 1000;
|
||||
|
||||
var HOT_CORNER_PRESSURE_THRESHOLD = 100; // pixels
|
||||
var HOT_CORNER_PRESSURE_TIMEOUT = 1000; // ms
|
||||
const HOT_CORNER_PRESSURE_THRESHOLD = 100; // pixels
|
||||
const HOT_CORNER_PRESSURE_TIMEOUT = 1000; // ms
|
||||
|
||||
const SCREEN_TRANSITION_DELAY = 250; // ms
|
||||
const SCREEN_TRANSITION_DURATION = 500; // ms
|
||||
|
|
@ -38,7 +37,7 @@ function isPopupMetaWindow(actor) {
|
|||
}
|
||||
}
|
||||
|
||||
var MonitorConstraint = GObject.registerClass({
|
||||
export const MonitorConstraint = GObject.registerClass({
|
||||
Properties: {
|
||||
'primary': GObject.ParamSpec.boolean('primary',
|
||||
'Primary', 'Track primary monitor',
|
||||
|
|
@ -155,7 +154,7 @@ var MonitorConstraint = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var Monitor = class Monitor {
|
||||
class Monitor {
|
||||
constructor(index, geometry, geometryScale) {
|
||||
this.index = index;
|
||||
this.x = geometry.x;
|
||||
|
|
@ -168,7 +167,7 @@ var Monitor = class Monitor {
|
|||
get inFullscreen() {
|
||||
return global.display.get_monitor_in_fullscreen(this.index);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const UiActor = GObject.registerClass(
|
||||
class UiActor extends St.Widget {
|
||||
|
|
@ -189,7 +188,7 @@ const defaultParams = {
|
|||
affectsInputRegion: true,
|
||||
};
|
||||
|
||||
var LayoutManager = GObject.registerClass({
|
||||
export const LayoutManager = GObject.registerClass({
|
||||
Signals: {
|
||||
'hot-corners-changed': {},
|
||||
'startup-complete': {},
|
||||
|
|
@ -1131,7 +1130,7 @@ var LayoutManager = GObject.registerClass({
|
|||
//
|
||||
// This class manages a "hot corner" that can toggle switching to
|
||||
// overview.
|
||||
var HotCorner = GObject.registerClass(
|
||||
export const HotCorner = GObject.registerClass(
|
||||
class HotCorner extends Clutter.Actor {
|
||||
_init(layoutManager, monitor, x, y) {
|
||||
super._init();
|
||||
|
|
@ -1299,7 +1298,7 @@ class HotCorner extends Clutter.Actor {
|
|||
}
|
||||
});
|
||||
|
||||
var PressureBarrier = class PressureBarrier extends Signals.EventEmitter {
|
||||
class PressureBarrier extends Signals.EventEmitter {
|
||||
constructor(threshold, timeout, actionMode) {
|
||||
super();
|
||||
|
||||
|
|
@ -1441,9 +1440,9 @@ var PressureBarrier = class PressureBarrier extends Signals.EventEmitter {
|
|||
if (this._currentPressure >= this._threshold)
|
||||
this._trigger();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var ScreenTransition = GObject.registerClass(
|
||||
const ScreenTransition = GObject.registerClass(
|
||||
class ScreenTransition extends Clutter.Actor {
|
||||
_init() {
|
||||
super._init({ visible: false });
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Lightbox */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Params = imports.misc.params;
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
var DEFAULT_FADE_FACTOR = 0.4;
|
||||
var VIGNETTE_BRIGHTNESS = 0.5;
|
||||
var VIGNETTE_SHARPNESS = 0.7;
|
||||
export const DEFAULT_FADE_FACTOR = 0.4;
|
||||
export const VIGNETTE_BRIGHTNESS = 0.5;
|
||||
export const VIGNETTE_SHARPNESS = 0.7;
|
||||
|
||||
const VIGNETTE_DECLARATIONS = ' \
|
||||
uniform float brightness; \n\
|
||||
|
|
@ -29,7 +28,7 @@ cogl_color_out.a *= 1.0 - pixel_brightness * brightness; \n\
|
|||
cogl_color_out.a += (rand(position) - 0.5) / 100.0; \n';
|
||||
|
||||
|
||||
var RadialShaderEffect = GObject.registerClass({
|
||||
const RadialShaderEffect = GObject.registerClass({
|
||||
Properties: {
|
||||
'brightness': GObject.ParamSpec.float(
|
||||
'brightness', 'brightness', 'brightness',
|
||||
|
|
@ -89,7 +88,7 @@ var RadialShaderEffect = GObject.registerClass({
|
|||
/**
|
||||
* Lightbox:
|
||||
*/
|
||||
var Lightbox = GObject.registerClass({
|
||||
export const Lightbox = GObject.registerClass({
|
||||
Properties: {
|
||||
'active': GObject.ParamSpec.boolean(
|
||||
'active', 'active', 'active', GObject.ParamFlags.READABLE, false),
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported LocatePointer */
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const Ripples = imports.ui.ripples;
|
||||
const Main = imports.ui.main;
|
||||
import Gio from 'gi://Gio';
|
||||
import * as Ripples from './ripples.js';
|
||||
import * as Main from './main.js';
|
||||
|
||||
const LOCATE_POINTER_KEY = "locate-pointer";
|
||||
const LOCATE_POINTER_SCHEMA = "org.gnome.desktop.interface";
|
||||
const LOCATE_POINTER_KEY = 'locate-pointer';
|
||||
const LOCATE_POINTER_SCHEMA = 'org.gnome.desktop.interface';
|
||||
|
||||
var LocatePointer = class {
|
||||
export class LocatePointer {
|
||||
constructor() {
|
||||
this._settings = new Gio.Settings({ schema_id: LOCATE_POINTER_SCHEMA });
|
||||
this._settings.connect(`changed::${LOCATE_POINTER_KEY}`, () => this._syncEnabled());
|
||||
|
|
@ -36,4 +35,4 @@ var LocatePointer = class {
|
|||
let [x, y] = global.get_pointer();
|
||||
this._ripples.playAnimation(x, y);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,31 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported LookingGlass */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Cogl = imports.gi.Cogl;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Signals = imports.misc.signals;
|
||||
const System = imports.system;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Cogl from 'gi://Cogl';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Meta from 'gi://Meta';
|
||||
import Pango from 'gi://Pango';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
import System from 'system';
|
||||
|
||||
const History = imports.misc.history;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const ShellEntry = imports.ui.shellEntry;
|
||||
const Main = imports.ui.main;
|
||||
const JsParse = imports.misc.jsParse;
|
||||
|
||||
const { ExtensionState } = ExtensionUtils;
|
||||
import * as History from '../misc/history.js';
|
||||
import {ExtensionState} from '../misc/extensionUtils.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
import * as ShellEntry from './shellEntry.js';
|
||||
import * as Main from './main.js';
|
||||
import * as JsParse from '../misc/jsParse.js';
|
||||
|
||||
const CHEVRON = '>>> ';
|
||||
|
||||
/* Imports...feel free to add here as needed */
|
||||
const commandHeader = `
|
||||
const {Clutter, Gio, GLib, GObject, Meta, Shell, St} = imports.gi;
|
||||
const Main = await imports.ui.main;
|
||||
const Main = await import('resource:///org/gnome/shell/ui/main.js');
|
||||
|
||||
/* Utility functions...we should probably be able to use these
|
||||
* in the shell core code too. */
|
||||
|
|
@ -43,9 +40,10 @@ const AsyncFunction = async function () {}.constructor;
|
|||
|
||||
const HISTORY_KEY = 'looking-glass-history';
|
||||
// Time between tabs for them to count as a double-tab event
|
||||
var AUTO_COMPLETE_DOUBLE_TAB_DELAY = 500;
|
||||
var AUTO_COMPLETE_SHOW_COMPLETION_ANIMATION_DURATION = 200;
|
||||
var AUTO_COMPLETE_GLOBAL_KEYWORDS = _getAutoCompleteGlobalKeywords();
|
||||
|
||||
const AUTO_COMPLETE_DOUBLE_TAB_DELAY = 500;
|
||||
const AUTO_COMPLETE_SHOW_COMPLETION_ANIMATION_DURATION = 200;
|
||||
const AUTO_COMPLETE_GLOBAL_KEYWORDS = _getAutoCompleteGlobalKeywords();
|
||||
|
||||
const LG_ANIMATION_TIME = 500;
|
||||
|
||||
|
|
@ -68,7 +66,7 @@ function _getAutoCompleteGlobalKeywords() {
|
|||
return keywords.concat(windowProperties).concat(headerProperties);
|
||||
}
|
||||
|
||||
var AutoComplete = class AutoComplete extends Signals.EventEmitter {
|
||||
class AutoComplete extends Signals.EventEmitter {
|
||||
constructor(entry) {
|
||||
super();
|
||||
|
||||
|
|
@ -133,10 +131,9 @@ var AutoComplete = class AutoComplete extends Signals.EventEmitter {
|
|||
|
||||
this._entry.clutter_text.insert_text(additionalCompletionText, cursorPos);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
var Notebook = GObject.registerClass({
|
||||
const Notebook = GObject.registerClass({
|
||||
Signals: { 'selection': { param_types: [Clutter.Actor.$gtype] } },
|
||||
}, class Notebook extends St.BoxLayout {
|
||||
_init() {
|
||||
|
|
@ -282,7 +279,7 @@ function objectToString(o) {
|
|||
}
|
||||
}
|
||||
|
||||
var ObjLink = GObject.registerClass(
|
||||
const ObjLink = GObject.registerClass(
|
||||
class ObjLink extends St.Button {
|
||||
_init(lookingGlass, o, title) {
|
||||
let text;
|
||||
|
|
@ -310,7 +307,7 @@ class ObjLink extends St.Button {
|
|||
}
|
||||
});
|
||||
|
||||
var Result = GObject.registerClass(
|
||||
const Result = GObject.registerClass(
|
||||
class Result extends St.BoxLayout {
|
||||
_init(lookingGlass, command, o, index) {
|
||||
super._init({ vertical: true });
|
||||
|
|
@ -333,7 +330,7 @@ class Result extends St.BoxLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var WindowList = GObject.registerClass({
|
||||
const WindowList = GObject.registerClass({
|
||||
}, class WindowList extends St.BoxLayout {
|
||||
_init(lookingGlass) {
|
||||
super._init({ name: 'Windows', vertical: true, style: 'spacing: 8px' });
|
||||
|
|
@ -386,7 +383,7 @@ var WindowList = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ObjInspector = GObject.registerClass(
|
||||
const ObjInspector = GObject.registerClass(
|
||||
class ObjInspector extends St.ScrollView {
|
||||
_init(lookingGlass) {
|
||||
super._init({
|
||||
|
|
@ -525,7 +522,7 @@ class ObjInspector extends St.ScrollView {
|
|||
}
|
||||
});
|
||||
|
||||
var RedBorderEffect = GObject.registerClass(
|
||||
const RedBorderEffect = GObject.registerClass(
|
||||
class RedBorderEffect extends Clutter.Effect {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -577,7 +574,7 @@ class RedBorderEffect extends Clutter.Effect {
|
|||
}
|
||||
});
|
||||
|
||||
var Inspector = GObject.registerClass({
|
||||
const Inspector = GObject.registerClass({
|
||||
Signals: {
|
||||
'closed': {},
|
||||
'target': { param_types: [Clutter.Actor.$gtype, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
|
||||
|
|
@ -718,7 +715,7 @@ var Inspector = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var Extensions = GObject.registerClass({
|
||||
const Extensions = GObject.registerClass({
|
||||
}, class Extensions extends St.BoxLayout {
|
||||
_init(lookingGlass) {
|
||||
super._init({ vertical: true, name: 'lookingGlassExtensions' });
|
||||
|
|
@ -887,7 +884,7 @@ var Extensions = GObject.registerClass({
|
|||
});
|
||||
|
||||
|
||||
var ActorLink = GObject.registerClass({
|
||||
const ActorLink = GObject.registerClass({
|
||||
Signals: {
|
||||
'inspect-actor': {},
|
||||
},
|
||||
|
|
@ -940,7 +937,7 @@ var ActorLink = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ActorTreeViewer = GObject.registerClass(
|
||||
const ActorTreeViewer = GObject.registerClass(
|
||||
class ActorTreeViewer extends St.BoxLayout {
|
||||
_init(lookingGlass) {
|
||||
super._init();
|
||||
|
|
@ -1067,7 +1064,7 @@ class ActorTreeViewer extends St.BoxLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var DebugFlag = GObject.registerClass({
|
||||
const DebugFlag = GObject.registerClass({
|
||||
GTypeFlags: GObject.TypeFlags.ABSTRACT,
|
||||
}, class DebugFlag extends St.Button {
|
||||
_init(label) {
|
||||
|
|
@ -1132,7 +1129,7 @@ var DebugFlag = GObject.registerClass({
|
|||
});
|
||||
|
||||
|
||||
var ClutterDebugFlag = GObject.registerClass(
|
||||
const ClutterDebugFlag = GObject.registerClass(
|
||||
class ClutterDebugFlag extends DebugFlag {
|
||||
_init(categoryName, flagName) {
|
||||
super._init(flagName);
|
||||
|
|
@ -1161,7 +1158,7 @@ class ClutterDebugFlag extends DebugFlag {
|
|||
}
|
||||
});
|
||||
|
||||
var MutterPaintDebugFlag = GObject.registerClass(
|
||||
const MutterPaintDebugFlag = GObject.registerClass(
|
||||
class MutterPaintDebugFlag extends DebugFlag {
|
||||
_init(flagName) {
|
||||
super._init(flagName);
|
||||
|
|
@ -1182,7 +1179,7 @@ class MutterPaintDebugFlag extends DebugFlag {
|
|||
}
|
||||
});
|
||||
|
||||
var MutterTopicDebugFlag = GObject.registerClass(
|
||||
const MutterTopicDebugFlag = GObject.registerClass(
|
||||
class MutterTopicDebugFlag extends DebugFlag {
|
||||
_init(flagName) {
|
||||
super._init(flagName);
|
||||
|
|
@ -1203,7 +1200,7 @@ class MutterTopicDebugFlag extends DebugFlag {
|
|||
}
|
||||
});
|
||||
|
||||
var UnsafeModeDebugFlag = GObject.registerClass(
|
||||
const UnsafeModeDebugFlag = GObject.registerClass(
|
||||
class UnsafeModeDebugFlag extends DebugFlag {
|
||||
_init() {
|
||||
super._init('unsafe-mode');
|
||||
|
|
@ -1222,7 +1219,7 @@ class UnsafeModeDebugFlag extends DebugFlag {
|
|||
}
|
||||
});
|
||||
|
||||
var DebugFlags = GObject.registerClass(
|
||||
const DebugFlags = GObject.registerClass(
|
||||
class DebugFlags extends St.BoxLayout {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
@ -1279,7 +1276,7 @@ class DebugFlags extends St.BoxLayout {
|
|||
});
|
||||
|
||||
|
||||
var LookingGlass = GObject.registerClass(
|
||||
export const LookingGlass = GObject.registerClass(
|
||||
class LookingGlass extends St.BoxLayout {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
|
|||
|
|
@ -1,27 +1,26 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Magnifier */
|
||||
|
||||
const Atspi = imports.gi.Atspi;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GDesktopEnums = imports.gi.GDesktopEnums;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Signals = imports.misc.signals;
|
||||
import Atspi from 'gi://Atspi';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GDesktopEnums from 'gi://GDesktopEnums';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const Background = imports.ui.background;
|
||||
const FocusCaretTracker = imports.ui.focusCaretTracker;
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
const PointerWatcher = imports.ui.pointerWatcher;
|
||||
import * as Background from './background.js';
|
||||
import * as FocusCaretTracker from './focusCaretTracker.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as PointerWatcher from './pointerWatcher.js';
|
||||
|
||||
var CROSSHAIRS_CLIP_SIZE = [100, 100];
|
||||
var NO_CHANGE = 0.0;
|
||||
const CROSSHAIRS_CLIP_SIZE = [100, 100];
|
||||
const NO_CHANGE = 0.0;
|
||||
|
||||
var POINTER_REST_TIME = 1000; // milliseconds
|
||||
const POINTER_REST_TIME = 1000; // milliseconds
|
||||
|
||||
// Settings
|
||||
const MAGNIFIER_SCHEMA = 'org.gnome.desktop.a11y.magnifier';
|
||||
|
|
@ -47,7 +46,7 @@ const CROSS_HAIRS_OPACITY_KEY = 'cross-hairs-opacity';
|
|||
const CROSS_HAIRS_LENGTH_KEY = 'cross-hairs-length';
|
||||
const CROSS_HAIRS_CLIP_KEY = 'cross-hairs-clip';
|
||||
|
||||
var MouseSpriteContent = GObject.registerClass({
|
||||
const MouseSpriteContent = GObject.registerClass({
|
||||
Implements: [Clutter.Content],
|
||||
}, class MouseSpriteContent extends GObject.Object {
|
||||
_init() {
|
||||
|
|
@ -95,7 +94,7 @@ var MouseSpriteContent = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var Magnifier = class Magnifier extends Signals.EventEmitter {
|
||||
export class Magnifier extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -758,9 +757,9 @@ var Magnifier = class Magnifier extends Signals.EventEmitter {
|
|||
this._zoomRegions[0].setContrast(contrast);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var ZoomRegion = class ZoomRegion {
|
||||
class ZoomRegion {
|
||||
constructor(magnifier, mouseSourceActor) {
|
||||
this._magnifier = magnifier;
|
||||
this._focusCaretTracker = new FocusCaretTracker.FocusCaretTracker();
|
||||
|
|
@ -1822,7 +1821,7 @@ var ZoomRegion = class ZoomRegion {
|
|||
}
|
||||
}
|
||||
|
||||
var Crosshairs = GObject.registerClass(
|
||||
const Crosshairs = GObject.registerClass(
|
||||
class Crosshairs extends Clutter.Actor {
|
||||
_init() {
|
||||
// Set the group containing the crosshairs to three times the desktop
|
||||
|
|
|
|||
222
js/ui/main.js
222
js/ui/main.js
|
|
@ -1,61 +1,52 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported componentManager, notificationDaemon, windowAttentionHandler,
|
||||
ctrlAltTabManager, padOsdService, osdWindowManager,
|
||||
osdMonitorLabeler, shellMountOpDBusService, shellDBusService,
|
||||
shellAccessDialogDBusService, shellAudioSelectionDBusService,
|
||||
screenSaverDBus, uiGroup, magnifier, xdndHandler, keyboard,
|
||||
kbdA11yDialog, introspectService, start, pushModal, popModal,
|
||||
activateWindow, moveWindowToMonitorAndWorkspace,
|
||||
createLookingGlass, initializeDeferredWork,
|
||||
getStyleVariant, getThemeStylesheet, setThemeStylesheet, screenshotUI */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const AccessDialog = imports.ui.accessDialog;
|
||||
const AudioDeviceSelection = imports.ui.audioDeviceSelection;
|
||||
const Components = imports.ui.components;
|
||||
const CtrlAltTab = imports.ui.ctrlAltTab;
|
||||
const EndSessionDialog = imports.ui.endSessionDialog;
|
||||
const ExtensionSystem = imports.ui.extensionSystem;
|
||||
const ExtensionDownloader = imports.ui.extensionDownloader;
|
||||
const InputMethod = imports.misc.inputMethod;
|
||||
const Introspect = imports.misc.introspect;
|
||||
const Keyboard = imports.ui.keyboard;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const OsdWindow = imports.ui.osdWindow;
|
||||
const OsdMonitorLabeler = imports.ui.osdMonitorLabeler;
|
||||
const Overview = imports.ui.overview;
|
||||
const PadOsd = imports.ui.padOsd;
|
||||
const Panel = imports.ui.panel;
|
||||
const Params = imports.misc.params;
|
||||
const RunDialog = imports.ui.runDialog;
|
||||
const WelcomeDialog = imports.ui.welcomeDialog;
|
||||
const Layout = imports.ui.layout;
|
||||
const LoginManager = imports.misc.loginManager;
|
||||
const LookingGlass = imports.ui.lookingGlass;
|
||||
const NotificationDaemon = imports.ui.notificationDaemon;
|
||||
const WindowAttentionHandler = imports.ui.windowAttentionHandler;
|
||||
const Screenshot = imports.ui.screenshot;
|
||||
const ScreenShield = imports.ui.screenShield;
|
||||
const SessionMode = imports.ui.sessionMode;
|
||||
const ShellDBus = imports.ui.shellDBus;
|
||||
const ShellMountOperation = imports.ui.shellMountOperation;
|
||||
const WindowManager = imports.ui.windowManager;
|
||||
const Magnifier = imports.ui.magnifier;
|
||||
const XdndHandler = imports.ui.xdndHandler;
|
||||
const KbdA11yDialog = imports.ui.kbdA11yDialog;
|
||||
const LocatePointer = imports.ui.locatePointer;
|
||||
const PointerA11yTimeout = imports.ui.pointerA11yTimeout;
|
||||
const ParentalControlsManager = imports.misc.parentalControlsManager;
|
||||
import * as AccessDialog from './accessDialog.js';
|
||||
import * as AudioDeviceSelection from './audioDeviceSelection.js';
|
||||
import * as Components from './components.js';
|
||||
import * as CtrlAltTab from './ctrlAltTab.js';
|
||||
import * as EndSessionDialog from './endSessionDialog.js';
|
||||
import * as ExtensionSystem from './extensionSystem.js';
|
||||
import * as ExtensionDownloader from './extensionDownloader.js';
|
||||
import * as InputMethod from '../misc/inputMethod.js';
|
||||
import * as Introspect from '../misc/introspect.js';
|
||||
import * as Keyboard from './keyboard.js';
|
||||
import * as MessageTray from './messageTray.js';
|
||||
import * as ModalDialog from './modalDialog.js';
|
||||
import * as OsdWindow from './osdWindow.js';
|
||||
import * as OsdMonitorLabeler from './osdMonitorLabeler.js';
|
||||
import * as Overview from './overview.js';
|
||||
import * as PadOsd from './padOsd.js';
|
||||
import * as Panel from './panel.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as RunDialog from './runDialog.js';
|
||||
import * as WelcomeDialog from './welcomeDialog.js';
|
||||
import * as Layout from './layout.js';
|
||||
import * as LoginManager from '../misc/loginManager.js';
|
||||
import * as LookingGlass from './lookingGlass.js';
|
||||
import * as NotificationDaemon from './notificationDaemon.js';
|
||||
import * as WindowAttentionHandler from './windowAttentionHandler.js';
|
||||
import * as Screenshot from './screenshot.js';
|
||||
import * as ScreenShield from './screenShield.js';
|
||||
import * as SessionMode from './sessionMode.js';
|
||||
import * as ShellDBus from './shellDBus.js';
|
||||
import * as ShellMountOperation from './shellMountOperation.js';
|
||||
import * as WindowManager from './windowManager.js';
|
||||
import * as Magnifier from './magnifier.js';
|
||||
import * as XdndHandler from './xdndHandler.js';
|
||||
import * as KbdA11yDialog from './kbdA11yDialog.js';
|
||||
import * as LocatePointer from './locatePointer.js';
|
||||
import * as PointerA11yTimeout from './pointerA11yTimeout.js';
|
||||
import * as ParentalControlsManager from '../misc/parentalControlsManager.js';
|
||||
const Config = imports.misc.config;
|
||||
const Util = imports.misc.util;
|
||||
import * as Util from '../misc/util.js';
|
||||
|
||||
const WELCOME_DIALOG_LAST_SHOWN_VERSION = 'welcome-dialog-last-shown-version';
|
||||
// Make sure to mention the point release, otherwise it will show every time
|
||||
|
|
@ -64,41 +55,42 @@ const WELCOME_DIALOG_LAST_TOUR_CHANGE = '40.beta';
|
|||
const LOG_DOMAIN = 'GNOME Shell';
|
||||
const GNOMESHELL_STARTED_MESSAGE_ID = 'f3ea493c22934e26811cd62abe8e203a';
|
||||
|
||||
var componentManager = null;
|
||||
var extensionManager = null;
|
||||
var panel = null;
|
||||
var overview = null;
|
||||
var runDialog = null;
|
||||
var lookingGlass = null;
|
||||
var welcomeDialog = null;
|
||||
var wm = null;
|
||||
var messageTray = null;
|
||||
var screenShield = null;
|
||||
var notificationDaemon = null;
|
||||
var windowAttentionHandler = null;
|
||||
var ctrlAltTabManager = null;
|
||||
var padOsdService = null;
|
||||
var osdWindowManager = null;
|
||||
var osdMonitorLabeler = null;
|
||||
var sessionMode = null;
|
||||
var screenshotUI = null;
|
||||
var shellAccessDialogDBusService = null;
|
||||
var shellAudioSelectionDBusService = null;
|
||||
var shellDBusService = null;
|
||||
var shellMountOpDBusService = null;
|
||||
var screenSaverDBus = null;
|
||||
var modalCount = 0;
|
||||
var actionMode = Shell.ActionMode.NONE;
|
||||
var modalActorFocusStack = [];
|
||||
var uiGroup = null;
|
||||
var magnifier = null;
|
||||
var xdndHandler = null;
|
||||
var keyboard = null;
|
||||
var layoutManager = null;
|
||||
var kbdA11yDialog = null;
|
||||
var inputMethod = null;
|
||||
var introspectService = null;
|
||||
var locatePointer = null;
|
||||
export let componentManager = null;
|
||||
export let extensionManager = null;
|
||||
export let panel = null;
|
||||
export let overview = null;
|
||||
export let runDialog = null;
|
||||
export let lookingGlass = null;
|
||||
export let welcomeDialog = null;
|
||||
export let wm = null;
|
||||
export let messageTray = null;
|
||||
export let screenShield = null;
|
||||
export let notificationDaemon = null;
|
||||
export let windowAttentionHandler = null;
|
||||
export let ctrlAltTabManager = null;
|
||||
export let padOsdService = null;
|
||||
export let osdWindowManager = null;
|
||||
export let osdMonitorLabeler = null;
|
||||
export let sessionMode = null;
|
||||
export let screenshotUI = null;
|
||||
export let shellAccessDialogDBusService = null;
|
||||
export let shellAudioSelectionDBusService = null;
|
||||
export let shellDBusService = null;
|
||||
export let shellMountOpDBusService = null;
|
||||
export let screenSaverDBus = null;
|
||||
export let modalCount = 0;
|
||||
export let actionMode = Shell.ActionMode.NONE;
|
||||
export let modalActorFocusStack = [];
|
||||
export let uiGroup = null;
|
||||
export let magnifier = null;
|
||||
export let xdndHandler = null;
|
||||
export let keyboard = null;
|
||||
export let layoutManager = null;
|
||||
export let kbdA11yDialog = null;
|
||||
export let inputMethod = null;
|
||||
export let introspectService = null;
|
||||
export let locatePointer = null;
|
||||
|
||||
let _startDate;
|
||||
let _defaultCssStylesheet = null;
|
||||
let _cssStylesheet = null;
|
||||
|
|
@ -147,7 +139,7 @@ function _sessionUpdated() {
|
|||
}
|
||||
|
||||
/** @returns {void} */
|
||||
async function start() {
|
||||
export async function start() {
|
||||
globalThis.log = console.log;
|
||||
|
||||
// Chain up async errors reported from C
|
||||
|
|
@ -408,7 +400,7 @@ function _getStylesheet(name) {
|
|||
}
|
||||
|
||||
/** @returns {string} */
|
||||
function getStyleVariant() {
|
||||
export function getStyleVariant() {
|
||||
const {colorScheme} = St.Settings.get();
|
||||
switch (sessionMode.colorScheme) {
|
||||
case 'force-dark':
|
||||
|
|
@ -460,7 +452,7 @@ function _loadDefaultStylesheet() {
|
|||
* @returns {?Gio.File}: A #GFile that contains the theme CSS,
|
||||
* null if using the default
|
||||
*/
|
||||
function getThemeStylesheet() {
|
||||
export function getThemeStylesheet() {
|
||||
return _cssStylesheet;
|
||||
}
|
||||
|
||||
|
|
@ -471,11 +463,11 @@ function getThemeStylesheet() {
|
|||
*
|
||||
* Set the theme CSS file that the shell will load
|
||||
*/
|
||||
function setThemeStylesheet(cssStylesheet) {
|
||||
export function setThemeStylesheet(cssStylesheet) {
|
||||
_cssStylesheet = cssStylesheet ? Gio.File.new_for_path(cssStylesheet) : null;
|
||||
}
|
||||
|
||||
function reloadThemeResource() {
|
||||
export function reloadThemeResource() {
|
||||
if (_themeResource)
|
||||
_themeResource._unregister();
|
||||
|
||||
|
|
@ -500,7 +492,7 @@ function _loadOskLayouts() {
|
|||
*
|
||||
* Reloads the theme CSS file
|
||||
*/
|
||||
function loadTheme() {
|
||||
export function loadTheme() {
|
||||
let themeContext = St.ThemeContext.get_for_stage(global.stage);
|
||||
let previousTheme = themeContext.get_theme();
|
||||
|
||||
|
|
@ -528,7 +520,7 @@ function loadTheme() {
|
|||
* @param {string} msg A message
|
||||
* @param {string} details Additional information
|
||||
*/
|
||||
function notify(msg, details) {
|
||||
export function notify(msg, details) {
|
||||
let source = new MessageTray.SystemNotificationSource();
|
||||
messageTray.add(source);
|
||||
let notification = new MessageTray.Notification(source, msg, details);
|
||||
|
|
@ -543,7 +535,7 @@ function notify(msg, details) {
|
|||
*
|
||||
* See shell_global_notify_problem().
|
||||
*/
|
||||
function notifyError(msg, details) {
|
||||
export function notifyError(msg, details) {
|
||||
// Also print to stderr so it's logged somewhere
|
||||
if (details)
|
||||
console.warn(`error: ${msg}: ${details}`);
|
||||
|
|
@ -597,7 +589,7 @@ function _findModal(grab) {
|
|||
*
|
||||
* @returns {Clutter.Grab}: the grab handle created
|
||||
*/
|
||||
function pushModal(actor, params) {
|
||||
export function pushModal(actor, params) {
|
||||
params = Params.parse(params, {
|
||||
timestamp: global.get_current_time(),
|
||||
options: 0,
|
||||
|
|
@ -654,7 +646,7 @@ function pushModal(actor, params) {
|
|||
* initiated event. If not provided then the value of
|
||||
* global.get_current_time() is assumed.
|
||||
*/
|
||||
function popModal(grab, timestamp) {
|
||||
export function popModal(grab, timestamp) {
|
||||
if (timestamp == undefined)
|
||||
timestamp = global.get_current_time();
|
||||
|
||||
|
|
@ -719,7 +711,7 @@ function popModal(grab, timestamp) {
|
|||
*
|
||||
* @returns {LookingGlass.LookingGlass}
|
||||
*/
|
||||
function createLookingGlass() {
|
||||
export function createLookingGlass() {
|
||||
if (lookingGlass == null)
|
||||
lookingGlass = new LookingGlass.LookingGlass();
|
||||
|
||||
|
|
@ -729,14 +721,14 @@ function createLookingGlass() {
|
|||
/**
|
||||
* Opens the run dialog
|
||||
*/
|
||||
function openRunDialog() {
|
||||
export function openRunDialog() {
|
||||
if (runDialog == null)
|
||||
runDialog = new RunDialog.RunDialog();
|
||||
|
||||
runDialog.open();
|
||||
}
|
||||
|
||||
function openWelcomeDialog() {
|
||||
export function openWelcomeDialog() {
|
||||
if (welcomeDialog === null)
|
||||
welcomeDialog = new WelcomeDialog.WelcomeDialog();
|
||||
|
||||
|
|
@ -753,7 +745,7 @@ function openWelcomeDialog() {
|
|||
* Activates @window, switching to its workspace first if necessary,
|
||||
* and switching out of the overview if it's currently active
|
||||
*/
|
||||
function activateWindow(window, time, workspaceNum) {
|
||||
export function activateWindow(window, time, workspaceNum) {
|
||||
let workspaceManager = global.workspace_manager;
|
||||
let activeWorkspaceNum = workspaceManager.get_active_workspace_index();
|
||||
let windowWorkspaceNum = workspaceNum !== undefined ? workspaceNum : window.get_workspace().index();
|
||||
|
|
@ -780,7 +772,7 @@ function activateWindow(window, time, workspaceNum) {
|
|||
* @param {number} workspaceIndex - the requested workspace
|
||||
* @param {bool} append - create workspace if it doesn't exist
|
||||
*/
|
||||
function moveWindowToMonitorAndWorkspace(window, monitorIndex, workspaceIndex, append = false) {
|
||||
export function moveWindowToMonitorAndWorkspace(window, monitorIndex, workspaceIndex, append = false) {
|
||||
// We need to move the window before changing the workspace, because
|
||||
// the move itself could cause a workspace change if the window enters
|
||||
// the primary monitor
|
||||
|
|
@ -801,15 +793,15 @@ function moveWindowToMonitorAndWorkspace(window, monitorIndex, workspaceIndex, a
|
|||
|
||||
// TODO - replace this timeout with some system to guess when the user might
|
||||
// be e.g. just reading the screen and not likely to interact.
|
||||
var DEFERRED_TIMEOUT_SECONDS = 20;
|
||||
var _deferredWorkData = {};
|
||||
const DEFERRED_TIMEOUT_SECONDS = 20;
|
||||
let _deferredWorkData = {};
|
||||
// Work scheduled for some point in the future
|
||||
var _deferredWorkQueue = [];
|
||||
let _deferredWorkQueue = [];
|
||||
// Work we need to process before the next redraw
|
||||
var _beforeRedrawQueue = [];
|
||||
let _beforeRedrawQueue = [];
|
||||
// Counter to assign work ids
|
||||
var _deferredWorkSequence = 0;
|
||||
var _deferredTimeoutId = 0;
|
||||
let _deferredWorkSequence = 0;
|
||||
let _deferredTimeoutId = 0;
|
||||
|
||||
function _runDeferredWork(workId) {
|
||||
if (!_deferredWorkData[workId])
|
||||
|
|
@ -868,7 +860,7 @@ function _queueBeforeRedraw(workId) {
|
|||
*
|
||||
* @returns {string}: A string work identifier
|
||||
*/
|
||||
function initializeDeferredWork(actor, callback) {
|
||||
export function initializeDeferredWork(actor, callback) {
|
||||
// Turn into a string so we can use as an object property
|
||||
let workId = `${++_deferredWorkSequence}`;
|
||||
_deferredWorkData[workId] = {
|
||||
|
|
@ -900,7 +892,7 @@ function initializeDeferredWork(actor, callback) {
|
|||
* for example when data being displayed by the actor has
|
||||
* changed.
|
||||
*/
|
||||
function queueDeferredWork(workId) {
|
||||
export function queueDeferredWork(workId) {
|
||||
let data = _deferredWorkData[workId];
|
||||
if (!data) {
|
||||
let message = `Invalid work id ${workId}`;
|
||||
|
|
@ -921,7 +913,7 @@ function queueDeferredWork(workId) {
|
|||
}
|
||||
}
|
||||
|
||||
var RestartMessage = GObject.registerClass(
|
||||
const RestartMessage = GObject.registerClass(
|
||||
class RestartMessage extends ModalDialog.ModalDialog {
|
||||
_init(message) {
|
||||
super._init({
|
||||
|
|
@ -947,7 +939,7 @@ function showRestartMessage(message) {
|
|||
restartMessage.open();
|
||||
}
|
||||
|
||||
var AnimationsSettings = class {
|
||||
class AnimationsSettings {
|
||||
constructor() {
|
||||
this._animationsEnabled = true;
|
||||
this._handles = new Set();
|
||||
|
|
@ -1008,4 +1000,4 @@ var AnimationsSettings = class {
|
|||
this._syncAnimationsEnabled();
|
||||
handle.connect('stopped', this._onRemoteAccessHandleStopped.bind(this));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
/* exported MessageListSection */
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Pango = imports.gi.Pango;
|
||||
const St = imports.gi.St;
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Meta from 'gi://Meta';
|
||||
import Pango from 'gi://Pango';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Util = imports.misc.util;
|
||||
import * as Main from './main.js';
|
||||
import * as MessageTray from './messageTray.js';
|
||||
|
||||
var MESSAGE_ANIMATION_TIME = 100;
|
||||
import * as Util from '../misc/util.js';
|
||||
|
||||
var DEFAULT_EXPAND_LINES = 6;
|
||||
const MESSAGE_ANIMATION_TIME = 100;
|
||||
|
||||
const DEFAULT_EXPAND_LINES = 6;
|
||||
|
||||
/**
|
||||
* @param {string} text
|
||||
* @param {boolean} allowMarkup
|
||||
* @returns {string}
|
||||
*/
|
||||
function _fixMarkup(text, allowMarkup) {
|
||||
export function _fixMarkup(text, allowMarkup) {
|
||||
if (allowMarkup) {
|
||||
// Support &, ", ', < and >, escape all other
|
||||
// occurrences of '&'.
|
||||
|
|
@ -43,7 +43,7 @@ function _fixMarkup(text, allowMarkup) {
|
|||
return GLib.markup_escape_text(text, -1);
|
||||
}
|
||||
|
||||
var URLHighlighter = GObject.registerClass(
|
||||
export const URLHighlighter = GObject.registerClass(
|
||||
class URLHighlighter extends St.Label {
|
||||
_init(text = '', lineWrap, allowMarkup) {
|
||||
super._init({
|
||||
|
|
@ -171,7 +171,7 @@ class URLHighlighter extends St.Label {
|
|||
}
|
||||
});
|
||||
|
||||
var ScaleLayout = GObject.registerClass(
|
||||
const ScaleLayout = GObject.registerClass(
|
||||
class ScaleLayout extends Clutter.BinLayout {
|
||||
_init(params) {
|
||||
this._container = null;
|
||||
|
|
@ -214,7 +214,7 @@ class ScaleLayout extends Clutter.BinLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var LabelExpanderLayout = GObject.registerClass({
|
||||
const LabelExpanderLayout = GObject.registerClass({
|
||||
Properties: {
|
||||
'expansion': GObject.ParamSpec.double('expansion',
|
||||
'Expansion',
|
||||
|
|
@ -308,7 +308,7 @@ var LabelExpanderLayout = GObject.registerClass({
|
|||
});
|
||||
|
||||
|
||||
var Message = GObject.registerClass({
|
||||
export const Message = GObject.registerClass({
|
||||
Signals: {
|
||||
'close': {},
|
||||
'expanded': {},
|
||||
|
|
@ -555,7 +555,7 @@ var Message = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var MessageListSection = GObject.registerClass({
|
||||
export const MessageListSection = GObject.registerClass({
|
||||
Properties: {
|
||||
'can-clear': GObject.ParamSpec.boolean(
|
||||
'can-clear', 'can-clear', 'can-clear',
|
||||
|
|
|
|||
|
|
@ -1,42 +1,40 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported NotificationPolicy, NotificationGenericPolicy,
|
||||
NotificationApplicationPolicy, Source, SourceActor,
|
||||
SystemNotificationSource, MessageTray */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Calendar = imports.ui.calendar;
|
||||
const GnomeSession = imports.misc.gnomeSession;
|
||||
const Layout = imports.ui.layout;
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
const SignalTracker = imports.misc.signalTracker;
|
||||
import * as Calendar from './calendar.js';
|
||||
import * as GnomeSession from '../misc/gnomeSession.js';
|
||||
import * as Layout from './layout.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as SignalTracker from '../misc/signalTracker.js';
|
||||
|
||||
const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
|
||||
|
||||
var ANIMATION_TIME = 200;
|
||||
var NOTIFICATION_TIMEOUT = 4000;
|
||||
export const ANIMATION_TIME = 200;
|
||||
|
||||
var HIDE_TIMEOUT = 200;
|
||||
var LONGER_HIDE_TIMEOUT = 600;
|
||||
const NOTIFICATION_TIMEOUT = 4000;
|
||||
|
||||
var MAX_NOTIFICATIONS_IN_QUEUE = 3;
|
||||
var MAX_NOTIFICATIONS_PER_SOURCE = 3;
|
||||
var MAX_NOTIFICATION_BUTTONS = 3;
|
||||
const HIDE_TIMEOUT = 200;
|
||||
const LONGER_HIDE_TIMEOUT = 600;
|
||||
|
||||
const MAX_NOTIFICATIONS_IN_QUEUE = 3;
|
||||
const MAX_NOTIFICATIONS_PER_SOURCE = 3;
|
||||
const MAX_NOTIFICATION_BUTTONS = 3;
|
||||
|
||||
// We delay hiding of the tray if the mouse is within MOUSE_LEFT_ACTOR_THRESHOLD
|
||||
// range from the point where it left the tray.
|
||||
var MOUSE_LEFT_ACTOR_THRESHOLD = 20;
|
||||
const MOUSE_LEFT_ACTOR_THRESHOLD = 20;
|
||||
|
||||
var IDLE_TIME = 1000;
|
||||
const IDLE_TIME = 1000;
|
||||
|
||||
var State = {
|
||||
export const State = {
|
||||
HIDDEN: 0,
|
||||
SHOWING: 1,
|
||||
SHOWN: 2,
|
||||
|
|
@ -51,7 +49,7 @@ var State = {
|
|||
// and REPLACED for notifications that were destroyed as a consequence of a
|
||||
// newer version having replaced them.
|
||||
/** @enum {number} */
|
||||
var NotificationDestroyedReason = {
|
||||
export const NotificationDestroyedReason = {
|
||||
EXPIRED: 1,
|
||||
DISMISSED: 2,
|
||||
SOURCE_CLOSED: 3,
|
||||
|
|
@ -63,7 +61,7 @@ var NotificationDestroyedReason = {
|
|||
// through the notification daemon. HIGH urgency value is used for chats received
|
||||
// through the Telepathy client.
|
||||
/** @enum {number} */
|
||||
var Urgency = {
|
||||
export const Urgency = {
|
||||
LOW: 0,
|
||||
NORMAL: 1,
|
||||
HIGH: 2,
|
||||
|
|
@ -77,12 +75,12 @@ var Urgency = {
|
|||
// status) and hence the same for every user. This affects whether the content
|
||||
// of a notification is shown on the lock screen.
|
||||
/** @enum {number} */
|
||||
var PrivacyScope = {
|
||||
export const PrivacyScope = {
|
||||
USER: 0,
|
||||
SYSTEM: 1,
|
||||
};
|
||||
|
||||
var FocusGrabber = class FocusGrabber {
|
||||
class FocusGrabber {
|
||||
constructor(actor) {
|
||||
this._actor = actor;
|
||||
this._prevKeyFocusActor = null;
|
||||
|
|
@ -133,14 +131,14 @@ var FocusGrabber = class FocusGrabber {
|
|||
global.stage.set_key_focus(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// NotificationPolicy:
|
||||
// An object that holds all bits of configurable policy related to a notification
|
||||
// source, such as whether to play sound or honour the critical bit.
|
||||
//
|
||||
// A notification without a policy object will inherit the default one.
|
||||
var NotificationPolicy = GObject.registerClass({
|
||||
export const NotificationPolicy = GObject.registerClass({
|
||||
GTypeFlags: GObject.TypeFlags.ABSTRACT,
|
||||
Properties: {
|
||||
'enable': GObject.ParamSpec.boolean(
|
||||
|
|
@ -195,7 +193,7 @@ var NotificationPolicy = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var NotificationGenericPolicy = GObject.registerClass({
|
||||
export const NotificationGenericPolicy = GObject.registerClass({
|
||||
}, class NotificationGenericPolicy extends NotificationPolicy {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -225,7 +223,7 @@ var NotificationGenericPolicy = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var NotificationApplicationPolicy = GObject.registerClass({
|
||||
export const NotificationApplicationPolicy = GObject.registerClass({
|
||||
}, class NotificationApplicationPolicy extends NotificationPolicy {
|
||||
_init(id) {
|
||||
super._init();
|
||||
|
|
@ -353,7 +351,7 @@ var NotificationApplicationPolicy = GObject.registerClass({
|
|||
// @source allows playing sounds).
|
||||
//
|
||||
// [1] https://developer.gnome.org/notification-spec/#markup
|
||||
var Notification = GObject.registerClass({
|
||||
export const Notification = GObject.registerClass({
|
||||
Properties: {
|
||||
'acknowledged': GObject.ParamSpec.boolean(
|
||||
'acknowledged', 'acknowledged', 'acknowledged',
|
||||
|
|
@ -505,7 +503,7 @@ var Notification = GObject.registerClass({
|
|||
});
|
||||
SignalTracker.registerDestroyableType(Notification);
|
||||
|
||||
var NotificationBanner = GObject.registerClass({
|
||||
export const NotificationBanner = GObject.registerClass({
|
||||
Signals: {
|
||||
'done-displaying': {},
|
||||
'unfocused': {},
|
||||
|
|
@ -602,7 +600,7 @@ var NotificationBanner = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var SourceActor = GObject.registerClass(
|
||||
export const SourceActor = GObject.registerClass(
|
||||
class SourceActor extends St.Widget {
|
||||
_init(source, size) {
|
||||
super._init();
|
||||
|
|
@ -642,7 +640,7 @@ class SourceActor extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var Source = GObject.registerClass({
|
||||
export const Source = GObject.registerClass({
|
||||
Properties: {
|
||||
'count': GObject.ParamSpec.int(
|
||||
'count', 'count', 'count',
|
||||
|
|
@ -808,7 +806,7 @@ var Source = GObject.registerClass({
|
|||
});
|
||||
SignalTracker.registerDestroyableType(Source);
|
||||
|
||||
var MessageTray = GObject.registerClass({
|
||||
export const MessageTray = GObject.registerClass({
|
||||
Signals: {
|
||||
'queue-changed': {},
|
||||
'source-added': { param_types: [Source.$gtype] },
|
||||
|
|
@ -1420,7 +1418,7 @@ var MessageTray = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var SystemNotificationSource = GObject.registerClass(
|
||||
export const SystemNotificationSource = GObject.registerClass(
|
||||
class SystemNotificationSource extends Source {
|
||||
_init() {
|
||||
super._init(_("System Information"), 'dialog-information-symbolic');
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported ModalDialog */
|
||||
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Dialog = imports.ui.dialog;
|
||||
const Layout = imports.ui.layout;
|
||||
const Lightbox = imports.ui.lightbox;
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as Layout from './layout.js';
|
||||
import * as Lightbox from './lightbox.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
var OPEN_AND_CLOSE_TIME = 100;
|
||||
var FADE_OUT_DIALOG_TIME = 1000;
|
||||
const OPEN_AND_CLOSE_TIME = 100;
|
||||
const FADE_OUT_DIALOG_TIME = 1000;
|
||||
|
||||
/** @enum {number} */
|
||||
var State = {
|
||||
export const State = {
|
||||
OPENED: 0,
|
||||
CLOSED: 1,
|
||||
OPENING: 2,
|
||||
|
|
@ -25,7 +24,7 @@ var State = {
|
|||
FADED_OUT: 4,
|
||||
};
|
||||
|
||||
var ModalDialog = GObject.registerClass({
|
||||
export const ModalDialog = GObject.registerClass({
|
||||
Properties: {
|
||||
'state': GObject.ParamSpec.int('state', 'Dialog state', 'state',
|
||||
GObject.ParamFlags.READABLE,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
/* exported MediaSection */
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Signals = imports.misc.signals;
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const MessageList = imports.ui.messageList;
|
||||
import * as Main from './main.js';
|
||||
import * as MessageList from './messageList.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
|
||||
const DBusIface = loadInterfaceXML('org.freedesktop.DBus');
|
||||
const DBusProxy = Gio.DBusProxy.makeProxyWrapper(DBusIface);
|
||||
|
|
@ -21,7 +20,7 @@ const MprisPlayerProxy = Gio.DBusProxy.makeProxyWrapper(MprisPlayerIface);
|
|||
|
||||
const MPRIS_PLAYER_PREFIX = 'org.mpris.MediaPlayer2.';
|
||||
|
||||
var MediaMessage = GObject.registerClass(
|
||||
export const MediaMessage = GObject.registerClass(
|
||||
class MediaMessage extends MessageList.Message {
|
||||
_init(player) {
|
||||
super._init('', '');
|
||||
|
|
@ -92,7 +91,7 @@ class MediaMessage extends MessageList.Message {
|
|||
}
|
||||
});
|
||||
|
||||
var MprisPlayer = class MprisPlayer extends Signals.EventEmitter {
|
||||
export class MprisPlayer extends Signals.EventEmitter {
|
||||
constructor(busName) {
|
||||
super();
|
||||
|
||||
|
|
@ -245,9 +244,9 @@ var MprisPlayer = class MprisPlayer extends Signals.EventEmitter {
|
|||
this.emit('hide');
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var MediaSection = GObject.registerClass(
|
||||
export const MediaSection = GObject.registerClass(
|
||||
class MediaSection extends MessageList.MessageListSection {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,24 +1,23 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported NotificationDaemon */
|
||||
|
||||
const GdkPixbuf = imports.gi.GdkPixbuf;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import GdkPixbuf from 'gi://GdkPixbuf';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Config = imports.misc.config;
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const Params = imports.misc.params;
|
||||
import * as Main from './main.js';
|
||||
import * as MessageTray from './messageTray.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
|
||||
const FdoNotificationsIface = loadInterfaceXML('org.freedesktop.Notifications');
|
||||
|
||||
/** @enum {number} */
|
||||
var NotificationClosedReason = {
|
||||
const NotificationClosedReason = {
|
||||
EXPIRED: 1,
|
||||
DISMISSED: 2,
|
||||
APP_CLOSED: 3,
|
||||
|
|
@ -26,13 +25,13 @@ var NotificationClosedReason = {
|
|||
};
|
||||
|
||||
/** @enum {number} */
|
||||
var Urgency = {
|
||||
const Urgency = {
|
||||
LOW: 0,
|
||||
NORMAL: 1,
|
||||
CRITICAL: 2,
|
||||
};
|
||||
|
||||
var FdoNotificationDaemon = class FdoNotificationDaemon {
|
||||
class FdoNotificationDaemon {
|
||||
constructor() {
|
||||
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(FdoNotificationsIface, this);
|
||||
this._dbusImpl.export(Gio.DBus.session, '/org/freedesktop/Notifications');
|
||||
|
|
@ -337,9 +336,9 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
|||
this._dbusImpl.emit_signal('ActionInvoked',
|
||||
GLib.Variant.new('(us)', [id, action]));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var FdoNotificationDaemonSource = GObject.registerClass(
|
||||
const FdoNotificationDaemonSource = GObject.registerClass(
|
||||
class FdoNotificationDaemonSource extends MessageTray.Source {
|
||||
_init(title, pid, sender, appId) {
|
||||
this.pid = pid;
|
||||
|
|
@ -465,7 +464,7 @@ const PRIORITY_URGENCY_MAP = {
|
|||
urgent: MessageTray.Urgency.CRITICAL,
|
||||
};
|
||||
|
||||
var GtkNotificationDaemonNotification = GObject.registerClass(
|
||||
const GtkNotificationDaemonNotification = GObject.registerClass(
|
||||
class GtkNotificationDaemonNotification extends MessageTray.Notification {
|
||||
_init(source, notification) {
|
||||
super._init(source);
|
||||
|
|
@ -556,7 +555,7 @@ function getPlatformData() {
|
|||
|
||||
function InvalidAppError() {}
|
||||
|
||||
var GtkNotificationDaemonAppSource = GObject.registerClass(
|
||||
const GtkNotificationDaemonAppSource = GObject.registerClass(
|
||||
class GtkNotificationDaemonAppSource extends MessageTray.Source {
|
||||
_init(appId) {
|
||||
let objectPath = objectPathFromAppId(appId);
|
||||
|
|
@ -667,7 +666,7 @@ class GtkNotificationDaemonAppSource extends MessageTray.Source {
|
|||
|
||||
const GtkNotificationsIface = loadInterfaceXML('org.gtk.Notifications');
|
||||
|
||||
var GtkNotificationDaemon = class GtkNotificationDaemon {
|
||||
class GtkNotificationDaemon {
|
||||
constructor() {
|
||||
this._sources = {};
|
||||
|
||||
|
|
@ -771,11 +770,11 @@ var GtkNotificationDaemon = class GtkNotificationDaemon {
|
|||
|
||||
invocation.return_value(null);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var NotificationDaemon = class NotificationDaemon {
|
||||
export class NotificationDaemon {
|
||||
constructor() {
|
||||
this._fdoNotificationDaemon = new FdoNotificationDaemon();
|
||||
this._gtkNotificationDaemon = new GtkNotificationDaemon();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported OsdMonitorLabeler */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
|
||||
var OsdMonitorLabel = GObject.registerClass(
|
||||
import * as Main from './main.js';
|
||||
|
||||
const OsdMonitorLabel = GObject.registerClass(
|
||||
class OsdMonitorLabel extends St.Widget {
|
||||
_init(monitor, label) {
|
||||
super._init({ x_expand: true, y_expand: true });
|
||||
|
|
@ -49,7 +49,7 @@ class OsdMonitorLabel extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var OsdMonitorLabeler = class {
|
||||
export class OsdMonitorLabeler {
|
||||
constructor() {
|
||||
this._monitorManager = global.backend.get_monitor_manager();
|
||||
this._client = null;
|
||||
|
|
@ -118,4 +118,4 @@ var OsdMonitorLabeler = class {
|
|||
|
||||
this._reset();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported OsdWindowManager */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import St from 'gi://St';
|
||||
|
||||
const BarLevel = imports.ui.barLevel;
|
||||
const Layout = imports.ui.layout;
|
||||
const Main = imports.ui.main;
|
||||
import * as BarLevel from './barLevel.js';
|
||||
import * as Layout from './layout.js';
|
||||
import * as Main from './main.js';
|
||||
|
||||
var HIDE_TIMEOUT = 1500;
|
||||
var FADE_TIME = 100;
|
||||
var LEVEL_ANIMATION_TIME = 100;
|
||||
const HIDE_TIMEOUT = 1500;
|
||||
const FADE_TIME = 100;
|
||||
const LEVEL_ANIMATION_TIME = 100;
|
||||
|
||||
var OsdWindow = GObject.registerClass(
|
||||
export const OsdWindow = GObject.registerClass(
|
||||
class OsdWindow extends Clutter.Actor {
|
||||
_init(monitorIndex) {
|
||||
super._init({
|
||||
|
|
@ -145,7 +144,7 @@ class OsdWindow extends Clutter.Actor {
|
|||
}
|
||||
});
|
||||
|
||||
var OsdWindowManager = class {
|
||||
export class OsdWindowManager {
|
||||
constructor() {
|
||||
this._osdWindows = [];
|
||||
Main.layoutManager.connect('monitors-changed',
|
||||
|
|
@ -193,4 +192,4 @@ var OsdWindowManager = class {
|
|||
for (let i = 0; i < this._osdWindows.length; i++)
|
||||
this._osdWindows[i].cancel();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,33 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Overview, ANIMATION_TIME */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Signals = imports.misc.signals;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
// Time for initial animation going into Overview mode;
|
||||
// this is defined here to make it available in imports.
|
||||
var ANIMATION_TIME = 250;
|
||||
export const ANIMATION_TIME = 250;
|
||||
|
||||
const DND = imports.ui.dnd;
|
||||
const LayoutManager = imports.ui.layout;
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const OverviewControls = imports.ui.overviewControls;
|
||||
const Params = imports.misc.params;
|
||||
const SwipeTracker = imports.ui.swipeTracker;
|
||||
const WindowManager = imports.ui.windowManager;
|
||||
const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
|
||||
import * as DND from './dnd.js';
|
||||
import * as LayoutManager from './layout.js';
|
||||
import * as Main from './main.js';
|
||||
import * as MessageTray from './messageTray.js';
|
||||
import * as OverviewControls from './overviewControls.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as SwipeTracker from './swipeTracker.js';
|
||||
import * as WindowManager from './windowManager.js';
|
||||
import * as WorkspaceThumbnail from './workspaceThumbnail.js';
|
||||
|
||||
var DND_WINDOW_SWITCH_TIMEOUT = 750;
|
||||
const DND_WINDOW_SWITCH_TIMEOUT = 750;
|
||||
|
||||
var OVERVIEW_ACTIVATION_TIMEOUT = 0.5;
|
||||
const OVERVIEW_ACTIVATION_TIMEOUT = 0.5;
|
||||
|
||||
var ShellInfo = class {
|
||||
class ShellInfo {
|
||||
constructor() {
|
||||
this._source = null;
|
||||
}
|
||||
|
|
@ -65,9 +64,9 @@ var ShellInfo = class {
|
|||
|
||||
this._source.showNotification(notification);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var OverviewActor = GObject.registerClass(
|
||||
const OverviewActor = GObject.registerClass(
|
||||
class OverviewActor extends St.BoxLayout {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
@ -149,7 +148,7 @@ const OVERVIEW_SHOWN_TRANSITIONS = {
|
|||
},
|
||||
};
|
||||
|
||||
var Overview = class extends Signals.EventEmitter {
|
||||
export class Overview extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -725,4 +724,4 @@ var Overview = class extends Signals.EventEmitter {
|
|||
get searchEntry() {
|
||||
return this._overview.searchEntry;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,39 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported ControlsManager */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import GLib from 'gi://GLib';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const AppDisplay = imports.ui.appDisplay;
|
||||
const Dash = imports.ui.dash;
|
||||
const Layout = imports.ui.layout;
|
||||
const Main = imports.ui.main;
|
||||
const Overview = imports.ui.overview;
|
||||
const SearchController = imports.ui.searchController;
|
||||
const Util = imports.misc.util;
|
||||
const WindowManager = imports.ui.windowManager;
|
||||
const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
|
||||
const WorkspacesView = imports.ui.workspacesView;
|
||||
import * as AppDisplay from './appDisplay.js';
|
||||
import * as Dash from './dash.js';
|
||||
import * as Layout from './layout.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Overview from './overview.js';
|
||||
import * as SearchController from './searchController.js';
|
||||
import * as Util from '../misc/util.js';
|
||||
import * as WindowManager from './windowManager.js';
|
||||
import * as WorkspaceThumbnail from './workspaceThumbnail.js';
|
||||
import * as WorkspacesView from './workspacesView.js';
|
||||
|
||||
const SMALL_WORKSPACE_RATIO = 0.15;
|
||||
const DASH_MAX_HEIGHT_RATIO = 0.15;
|
||||
|
||||
const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard';
|
||||
|
||||
var SIDE_CONTROLS_ANIMATION_TIME = Overview.ANIMATION_TIME;
|
||||
export const SIDE_CONTROLS_ANIMATION_TIME = 250;
|
||||
|
||||
/** @enum {number} */
|
||||
var ControlsState = {
|
||||
export const ControlsState = {
|
||||
HIDDEN: 0,
|
||||
WINDOW_PICKER: 1,
|
||||
APP_GRID: 2,
|
||||
};
|
||||
|
||||
var ControlsManagerLayout = GObject.registerClass(
|
||||
const ControlsManagerLayout = GObject.registerClass(
|
||||
class ControlsManagerLayout extends Clutter.BoxLayout {
|
||||
_init(searchEntry, appDisplay, workspacesDisplay, workspacesThumbnails,
|
||||
searchController, dash, stateAdjustment) {
|
||||
|
|
@ -265,7 +264,7 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var OverviewAdjustment = GObject.registerClass({
|
||||
export const OverviewAdjustment = GObject.registerClass({
|
||||
Properties: {
|
||||
'gesture-in-progress': GObject.ParamSpec.boolean(
|
||||
'gesture-in-progress', 'Gesture in progress', 'Gesture in progress',
|
||||
|
|
@ -316,7 +315,7 @@ var OverviewAdjustment = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ControlsManager = GObject.registerClass(
|
||||
export const ControlsManager = GObject.registerClass(
|
||||
class ControlsManager extends St.Widget {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
|
|||
|
|
@ -1,24 +1,23 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported PadOsd, PadOsdService */
|
||||
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GDesktopEnums = imports.gi.GDesktopEnums;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Rsvg = imports.gi.Rsvg;
|
||||
const St = imports.gi.St;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GDesktopEnums from 'gi://GDesktopEnums';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Pango from 'gi://Pango';
|
||||
import Rsvg from 'gi://Rsvg';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Signals = imports.misc.signals;
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const Layout = imports.ui.layout;
|
||||
import * as Main from './main.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
import * as Layout from './layout.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
|
||||
const ACTIVE_COLOR = "#729fcf";
|
||||
|
||||
|
|
@ -31,7 +30,7 @@ const CCW = 1;
|
|||
const UP = 0;
|
||||
const DOWN = 1;
|
||||
|
||||
var PadChooser = GObject.registerClass({
|
||||
const PadChooser = GObject.registerClass({
|
||||
Signals: { 'pad-selected': { param_types: [Clutter.InputDevice.$gtype] } },
|
||||
}, class PadChooser extends St.Button {
|
||||
_init(device, groupDevices) {
|
||||
|
|
@ -100,7 +99,7 @@ var PadChooser = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var KeybindingEntry = GObject.registerClass({
|
||||
const KeybindingEntry = GObject.registerClass({
|
||||
Signals: { 'keybinding-edited': { param_types: [GObject.TYPE_STRING] } },
|
||||
}, class KeybindingEntry extends St.Entry {
|
||||
_init() {
|
||||
|
|
@ -120,7 +119,7 @@ var KeybindingEntry = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ActionComboBox = GObject.registerClass({
|
||||
const ActionComboBox = GObject.registerClass({
|
||||
Signals: { 'action-selected': { param_types: [GObject.TYPE_INT] } },
|
||||
}, class ActionComboBox extends St.Button {
|
||||
_init() {
|
||||
|
|
@ -209,7 +208,7 @@ var ActionComboBox = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ActionEditor = GObject.registerClass({
|
||||
const ActionEditor = GObject.registerClass({
|
||||
Signals: { 'done': {} },
|
||||
}, class ActionEditor extends St.Widget {
|
||||
_init() {
|
||||
|
|
@ -297,7 +296,7 @@ var ActionEditor = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var PadDiagram = GObject.registerClass({
|
||||
const PadDiagram = GObject.registerClass({
|
||||
Properties: {
|
||||
'left-handed': GObject.ParamSpec.boolean('left-handed',
|
||||
'left-handed', 'Left handed',
|
||||
|
|
@ -641,7 +640,7 @@ var PadDiagram = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var PadOsd = GObject.registerClass({
|
||||
export const PadOsd = GObject.registerClass({
|
||||
Signals: {
|
||||
'pad-selected': { param_types: [Clutter.InputDevice.$gtype] },
|
||||
'closed': {},
|
||||
|
|
@ -963,7 +962,7 @@ var PadOsd = GObject.registerClass({
|
|||
|
||||
const PadOsdIface = loadInterfaceXML('org.gnome.Shell.Wacom.PadOsd');
|
||||
|
||||
var PadOsdService = class extends Signals.EventEmitter {
|
||||
export class PadOsdService extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -994,4 +993,4 @@ var PadOsdService = class extends Signals.EventEmitter {
|
|||
global.display.request_pad_osd(padDevice, editionMode);
|
||||
invocation.return_value(null);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported PageIndicators */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const GObject = imports.gi.GObject;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
const INDICATOR_INACTIVE_OPACITY = 128;
|
||||
const INDICATOR_INACTIVE_OPACITY_HOVER = 255;
|
||||
const INDICATOR_INACTIVE_SCALE = 2 / 3;
|
||||
const INDICATOR_INACTIVE_SCALE_PRESSED = 0.5;
|
||||
|
||||
var PageIndicators = GObject.registerClass({
|
||||
export const PageIndicators = GObject.registerClass({
|
||||
Signals: { 'page-activated': { param_types: [GObject.TYPE_INT] } },
|
||||
}, class PageIndicators extends St.BoxLayout {
|
||||
_init(orientation = Clutter.Orientation.VERTICAL) {
|
||||
|
|
|
|||
|
|
@ -1,50 +1,49 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Panel */
|
||||
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Animation = imports.ui.animation;
|
||||
const { AppMenu } = imports.ui.appMenu;
|
||||
import * as Animation from './animation.js';
|
||||
import {AppMenu} from './appMenu.js';
|
||||
const Config = imports.misc.config;
|
||||
const CtrlAltTab = imports.ui.ctrlAltTab;
|
||||
const DND = imports.ui.dnd;
|
||||
const Overview = imports.ui.overview;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const {QuickSettingsMenu, SystemIndicator} = imports.ui.quickSettings;
|
||||
const Main = imports.ui.main;
|
||||
import * as CtrlAltTab from './ctrlAltTab.js';
|
||||
import * as DND from './dnd.js';
|
||||
import * as Overview from './overview.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
import * as PanelMenu from './panelMenu.js';
|
||||
import {QuickSettingsMenu, SystemIndicator} from './quickSettings.js';
|
||||
import * as Main from './main.js';
|
||||
|
||||
const RemoteAccessStatus = imports.ui.status.remoteAccess;
|
||||
const PowerProfileStatus = imports.ui.status.powerProfiles;
|
||||
const RFKillStatus = imports.ui.status.rfkill;
|
||||
const CameraStatus = imports.ui.status.camera;
|
||||
const VolumeStatus = imports.ui.status.volume;
|
||||
const BrightnessStatus = imports.ui.status.brightness;
|
||||
const SystemStatus = imports.ui.status.system;
|
||||
const LocationStatus = imports.ui.status.location;
|
||||
const NightLightStatus = imports.ui.status.nightLight;
|
||||
const DarkModeStatus = imports.ui.status.darkMode;
|
||||
const BacklightStatus = imports.ui.status.backlight;
|
||||
const ThunderboltStatus = imports.ui.status.thunderbolt;
|
||||
const AutoRotateStatus = imports.ui.status.autoRotate;
|
||||
const BackgroundAppsStatus = imports.ui.status.backgroundApps;
|
||||
import * as RemoteAccessStatus from './status/remoteAccess.js';
|
||||
import * as PowerProfileStatus from './status/powerProfiles.js';
|
||||
import * as RFKillStatus from './status/rfkill.js';
|
||||
import * as CameraStatus from './status/camera.js';
|
||||
import * as VolumeStatus from './status/volume.js';
|
||||
import * as BrightnessStatus from './status/brightness.js';
|
||||
import * as SystemStatus from './status/system.js';
|
||||
import * as LocationStatus from './status/location.js';
|
||||
import * as NightLightStatus from './status/nightLight.js';
|
||||
import * as DarkModeStatus from './status/darkMode.js';
|
||||
import * as BacklightStatus from './status/backlight.js';
|
||||
import * as ThunderboltStatus from './status/thunderbolt.js';
|
||||
import * as AutoRotateStatus from './status/autoRotate.js';
|
||||
import * as BackgroundAppsStatus from './status/backgroundApps.js';
|
||||
|
||||
const {DateMenuButton} = imports.ui.dateMenu;
|
||||
const {ATIndicator} = imports.ui.status.accessibility;
|
||||
const {InputSourceIndicator} = imports.ui.status.keyboard;
|
||||
const {DwellClickIndicator} = imports.ui.status.dwellClick;
|
||||
const {ScreenRecordingIndicator, ScreenSharingIndicator} = imports.ui.status.remoteAccess;
|
||||
import {DateMenuButton} from './dateMenu.js';
|
||||
import {ATIndicator} from './status/accessibility.js';
|
||||
import {InputSourceIndicator} from './status/keyboard.js';
|
||||
import {DwellClickIndicator} from './status/dwellClick.js';
|
||||
import {ScreenRecordingIndicator, ScreenSharingIndicator} from './status/remoteAccess.js';
|
||||
|
||||
var PANEL_ICON_SIZE = 16;
|
||||
var APP_MENU_ICON_MARGIN = 0;
|
||||
const PANEL_ICON_SIZE = 16;
|
||||
const APP_MENU_ICON_MARGIN = 0;
|
||||
|
||||
var BUTTON_DND_ACTIVATION_TIMEOUT = 250;
|
||||
const BUTTON_DND_ACTIVATION_TIMEOUT = 250;
|
||||
|
||||
const N_QUICK_SETTINGS_COLUMNS = 2;
|
||||
|
||||
|
|
@ -56,8 +55,8 @@ const N_QUICK_SETTINGS_COLUMNS = 2;
|
|||
* this menu also handles startup notification for it. So when we
|
||||
* have an active startup notification, we switch modes to display that.
|
||||
*/
|
||||
var AppMenuButton = GObject.registerClass({
|
||||
Signals: { 'changed': {} },
|
||||
const AppMenuButton = GObject.registerClass({
|
||||
Signals: {'changed': {}},
|
||||
}, class AppMenuButton extends PanelMenu.Button {
|
||||
_init(panel) {
|
||||
super._init(0.0, null, true);
|
||||
|
|
@ -257,7 +256,7 @@ var AppMenuButton = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ActivitiesButton = GObject.registerClass(
|
||||
const ActivitiesButton = GObject.registerClass(
|
||||
class ActivitiesButton extends PanelMenu.Button {
|
||||
_init() {
|
||||
super._init(0.0, null, true);
|
||||
|
|
@ -350,7 +349,7 @@ class UnsafeModeIndicator extends SystemIndicator {
|
|||
}
|
||||
});
|
||||
|
||||
var QuickSettings = GObject.registerClass(
|
||||
const QuickSettings = GObject.registerClass(
|
||||
class QuickSettings extends PanelMenu.Button {
|
||||
constructor() {
|
||||
super(0.0, C_('System menu in the top bar', 'System'), true);
|
||||
|
|
@ -368,10 +367,8 @@ class QuickSettings extends PanelMenu.Button {
|
|||
|
||||
async _setupIndicators() {
|
||||
if (Config.HAVE_NETWORKMANAGER) {
|
||||
// TODO: This will be an asynchronous import once this migrates
|
||||
// to modules. Add a no-op await now to enforce this being an async
|
||||
// function.
|
||||
const NetworkStatus = await imports.ui.status.network;
|
||||
/** @type {import('./status/network.js')} */
|
||||
const NetworkStatus = await import('./status/network.js');
|
||||
|
||||
this._network = new NetworkStatus.Indicator();
|
||||
} else {
|
||||
|
|
@ -379,10 +376,8 @@ class QuickSettings extends PanelMenu.Button {
|
|||
}
|
||||
|
||||
if (Config.HAVE_BLUETOOTH) {
|
||||
// TODO: This will be an asynchronous import once this migrates
|
||||
// to modules. Add a no-op await now to enforce this being an async
|
||||
// function.
|
||||
const BluetoothStatus = await imports.ui.status.bluetooth;
|
||||
/** @type {import('./status/bluetooth.js')} */
|
||||
const BluetoothStatus = await import('./status/bluetooth.js');
|
||||
|
||||
this._bluetooth = new BluetoothStatus.Indicator();
|
||||
} else {
|
||||
|
|
@ -467,7 +462,7 @@ const PANEL_ITEM_IMPLEMENTATIONS = {
|
|||
'screenSharing': ScreenSharingIndicator,
|
||||
};
|
||||
|
||||
var Panel = GObject.registerClass(
|
||||
export const Panel = GObject.registerClass(
|
||||
class Panel extends St.Widget {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Button, SystemIndicator */
|
||||
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const St = imports.gi.St;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
|
||||
var ButtonBox = GObject.registerClass(
|
||||
export const ButtonBox = GObject.registerClass(
|
||||
class ButtonBox extends St.Widget {
|
||||
_init(params) {
|
||||
params = Params.parse(params, {
|
||||
|
|
@ -95,7 +94,7 @@ class ButtonBox extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var Button = GObject.registerClass({
|
||||
export const Button = GObject.registerClass({
|
||||
Signals: { 'menu-set': {} },
|
||||
}, class PanelMenuButton extends ButtonBox {
|
||||
_init(menuAlignment, nameText, dontCreateMenu) {
|
||||
|
|
@ -204,7 +203,7 @@ var Button = GObject.registerClass({
|
|||
* of an icon and a menu section, which will be composed into the
|
||||
* aggregate menu.
|
||||
*/
|
||||
var SystemIndicator = GObject.registerClass(
|
||||
export const SystemIndicator = GObject.registerClass(
|
||||
class SystemIndicator extends St.BoxLayout {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
/* exported PointerA11yTimeout */
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const St = imports.gi.St;
|
||||
const Main = imports.ui.main;
|
||||
const Cairo = imports.cairo;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import St from 'gi://St';
|
||||
import * as Main from './main.js';
|
||||
import Cairo from 'gi://cairo';
|
||||
|
||||
const SUCCESS_ZOOM_OUT_DURATION = 150;
|
||||
|
||||
var PieTimer = GObject.registerClass({
|
||||
const PieTimer = GObject.registerClass({
|
||||
Properties: {
|
||||
'angle': GObject.ParamSpec.double(
|
||||
'angle', 'angle', 'angle',
|
||||
|
|
@ -109,7 +108,7 @@ var PieTimer = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var PointerA11yTimeout = class PointerA11yTimeout {
|
||||
export class PointerA11yTimeout {
|
||||
constructor() {
|
||||
let seat = Clutter.get_default_backend().get_default_seat();
|
||||
|
||||
|
|
@ -134,4 +133,4 @@ var PointerA11yTimeout = class PointerA11yTimeout {
|
|||
global.display.set_cursor(Meta.Cursor.DEFAULT);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported getPointerWatcher */
|
||||
|
||||
const GLib = imports.gi.GLib;
|
||||
import GLib from 'gi://GLib';
|
||||
|
||||
// We stop polling if the user is idle for more than this amount of time
|
||||
var IDLE_TIME = 1000;
|
||||
const IDLE_TIME = 1000;
|
||||
|
||||
// This file implements a reasonably efficient system for tracking the position
|
||||
// of the mouse pointer. We simply query the pointer from the X server in a loop,
|
||||
|
|
@ -15,14 +14,14 @@ let _pointerWatcher = null;
|
|||
/**
|
||||
* @returns {PointerWatcher}
|
||||
*/
|
||||
function getPointerWatcher() {
|
||||
export function getPointerWatcher() {
|
||||
if (_pointerWatcher == null)
|
||||
_pointerWatcher = new PointerWatcher();
|
||||
|
||||
return _pointerWatcher;
|
||||
}
|
||||
|
||||
var PointerWatch = class {
|
||||
class PointerWatch {
|
||||
constructor(watcher, interval, callback) {
|
||||
this.watcher = watcher;
|
||||
this.interval = interval;
|
||||
|
|
@ -35,9 +34,9 @@ var PointerWatch = class {
|
|||
remove() {
|
||||
this.watcher._removeWatch(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var PointerWatcher = class {
|
||||
class PointerWatcher {
|
||||
constructor() {
|
||||
this._idleMonitor = global.backend.get_core_idle_monitor();
|
||||
this._idleMonitor.add_idle_watch(IDLE_TIME, this._onIdleMonitorBecameIdle.bind(this));
|
||||
|
|
@ -126,4 +125,4 @@ var PointerWatcher = class {
|
|||
i++;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,20 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported PopupMenuItem, PopupSeparatorMenuItem, Switch, PopupSwitchMenuItem,
|
||||
PopupImageMenuItem, PopupMenu, PopupDummyMenu, PopupSubMenu,
|
||||
PopupMenuSection, PopupSubMenuMenuItem, PopupMenuManager */
|
||||
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Signals = imports.misc.signals;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const BoxPointer = imports.ui.boxpointer;
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
import * as BoxPointer from './boxpointer.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
/** @enum {number} */
|
||||
var Ornament = {
|
||||
export const Ornament = {
|
||||
NONE: 0,
|
||||
DOT: 1,
|
||||
CHECK: 2,
|
||||
|
|
@ -34,10 +31,11 @@ function isPopupMenuItemVisible(child) {
|
|||
|
||||
/**
|
||||
* arrowIcon
|
||||
*
|
||||
* @param {St.Side} side - Side to which the arrow points.
|
||||
* @returns {St.Icon} a new arrow icon
|
||||
*/
|
||||
function arrowIcon(side) {
|
||||
export function arrowIcon(side) {
|
||||
let iconName;
|
||||
switch (side) {
|
||||
case St.Side.TOP:
|
||||
|
|
@ -65,7 +63,7 @@ function arrowIcon(side) {
|
|||
return arrow;
|
||||
}
|
||||
|
||||
var PopupBaseMenuItem = GObject.registerClass({
|
||||
export const PopupBaseMenuItem = GObject.registerClass({
|
||||
Properties: {
|
||||
'active': GObject.ParamSpec.boolean('active', 'active', 'active',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
|
|
@ -268,7 +266,7 @@ var PopupBaseMenuItem = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var PopupMenuItem = GObject.registerClass(
|
||||
export const PopupMenuItem = GObject.registerClass(
|
||||
class PopupMenuItem extends PopupBaseMenuItem {
|
||||
_init(text, params) {
|
||||
super._init(params);
|
||||
|
|
@ -284,7 +282,7 @@ class PopupMenuItem extends PopupBaseMenuItem {
|
|||
});
|
||||
|
||||
|
||||
var PopupSeparatorMenuItem = GObject.registerClass(
|
||||
export const PopupSeparatorMenuItem = GObject.registerClass(
|
||||
class PopupSeparatorMenuItem extends PopupBaseMenuItem {
|
||||
_init(text) {
|
||||
super._init({
|
||||
|
|
@ -315,7 +313,7 @@ class PopupSeparatorMenuItem extends PopupBaseMenuItem {
|
|||
}
|
||||
});
|
||||
|
||||
var Switch = GObject.registerClass({
|
||||
export const Switch = GObject.registerClass({
|
||||
Properties: {
|
||||
'state': GObject.ParamSpec.boolean(
|
||||
'state', 'state', 'state',
|
||||
|
|
@ -355,7 +353,7 @@ var Switch = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var PopupSwitchMenuItem = GObject.registerClass({
|
||||
export const PopupSwitchMenuItem = GObject.registerClass({
|
||||
Signals: { 'toggled': { param_types: [GObject.TYPE_BOOLEAN] } },
|
||||
}, class PopupSwitchMenuItem extends PopupBaseMenuItem {
|
||||
_init(text, active, params) {
|
||||
|
|
@ -445,7 +443,7 @@ var PopupSwitchMenuItem = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var PopupImageMenuItem = GObject.registerClass(
|
||||
export const PopupImageMenuItem = GObject.registerClass(
|
||||
class PopupImageMenuItem extends PopupBaseMenuItem {
|
||||
_init(text, icon, params) {
|
||||
super._init(params);
|
||||
|
|
@ -482,7 +480,7 @@ class PopupImageMenuItem extends PopupBaseMenuItem {
|
|||
}
|
||||
});
|
||||
|
||||
var PopupMenuBase = class extends Signals.EventEmitter {
|
||||
export class PopupMenuBase extends Signals.EventEmitter {
|
||||
constructor(sourceActor, styleClass) {
|
||||
super();
|
||||
|
||||
|
|
@ -809,9 +807,9 @@ var PopupMenuBase = class extends Signals.EventEmitter {
|
|||
|
||||
Main.sessionMode.disconnectObject(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var PopupMenu = class extends PopupMenuBase {
|
||||
export class PopupMenu extends PopupMenuBase {
|
||||
constructor(sourceActor, arrowAlignment, arrowSide) {
|
||||
super(sourceActor, 'popup-menu-content');
|
||||
|
||||
|
|
@ -953,9 +951,9 @@ var PopupMenu = class extends PopupMenuBase {
|
|||
|
||||
super.destroy();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var PopupDummyMenu = class extends Signals.EventEmitter {
|
||||
export class PopupDummyMenu extends Signals.EventEmitter {
|
||||
constructor(sourceActor) {
|
||||
super();
|
||||
|
||||
|
|
@ -991,9 +989,9 @@ var PopupDummyMenu = class extends Signals.EventEmitter {
|
|||
destroy() {
|
||||
this.emit('destroy');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var PopupSubMenu = class extends PopupMenuBase {
|
||||
export class PopupSubMenu extends PopupMenuBase {
|
||||
constructor(sourceActor, sourceArrow) {
|
||||
super(sourceActor);
|
||||
|
||||
|
|
@ -1130,7 +1128,7 @@ var PopupSubMenu = class extends PopupMenuBase {
|
|||
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* PopupMenuSection:
|
||||
|
|
@ -1140,7 +1138,7 @@ var PopupSubMenu = class extends PopupMenuBase {
|
|||
* can add it to another menu), but is completely transparent
|
||||
* to the user
|
||||
*/
|
||||
var PopupMenuSection = class extends PopupMenuBase {
|
||||
export class PopupMenuSection extends PopupMenuBase {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -1160,9 +1158,9 @@ var PopupMenuSection = class extends PopupMenuBase {
|
|||
close() {
|
||||
this.emit('open-state-changed', false);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var PopupSubMenuMenuItem = GObject.registerClass(
|
||||
export const PopupSubMenuMenuItem = GObject.registerClass(
|
||||
class PopupSubMenuMenuItem extends PopupBaseMenuItem {
|
||||
_init(text, wantIcon) {
|
||||
super._init();
|
||||
|
|
@ -1269,7 +1267,7 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem {
|
|||
/* Basic implementation of a menu manager.
|
||||
* Call addMenu to add menus
|
||||
*/
|
||||
var PopupMenuManager = class {
|
||||
export class PopupMenuManager {
|
||||
constructor(owner, grabParams) {
|
||||
this._grabParams = Params.parse(grabParams,
|
||||
{ actionMode: Shell.ActionMode.POPUP });
|
||||
|
|
@ -1394,4 +1392,4 @@ var PopupMenuManager = class {
|
|||
if (isUser)
|
||||
menu.close(BoxPointer.PopupAnimation.FULL);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,24 @@
|
|||
/* exported QuickToggle, QuickMenuToggle, QuickSlider, QuickSettingsMenu, SystemIndicator */
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Pango = imports.gi.Pango;
|
||||
const St = imports.gi.St;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Meta from 'gi://Meta';
|
||||
import Pango from 'gi://Pango';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const {Slider} = imports.ui.slider;
|
||||
import * as Main from './main.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
import {Slider} from './slider.js';
|
||||
|
||||
const {PopupAnimation} = imports.ui.boxpointer;
|
||||
import {PopupAnimation} from './boxpointer.js';
|
||||
|
||||
const DIM_BRIGHTNESS = -0.4;
|
||||
const POPUP_ANIMATION_TIME = 400;
|
||||
|
||||
const MENU_BUTTON_BRIGHTNESS = 0.1;
|
||||
|
||||
var QuickSettingsItem = GObject.registerClass({
|
||||
export const QuickSettingsItem = GObject.registerClass({
|
||||
Properties: {
|
||||
'has-menu': GObject.ParamSpec.boolean(
|
||||
'has-menu', 'has-menu', 'has-menu',
|
||||
|
|
@ -42,7 +40,7 @@ var QuickSettingsItem = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var QuickToggle = GObject.registerClass({
|
||||
export const QuickToggle = GObject.registerClass({
|
||||
Properties: {
|
||||
'title': GObject.ParamSpec.string('title', '', '',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
|
|
@ -143,7 +141,7 @@ var QuickToggle = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var QuickMenuToggle = GObject.registerClass({
|
||||
export const QuickMenuToggle = GObject.registerClass({
|
||||
Properties: {
|
||||
'title': GObject.ParamSpec.string('title', '', '',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
|
|
@ -234,7 +232,7 @@ var QuickMenuToggle = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var QuickSlider = GObject.registerClass({
|
||||
export const QuickSlider = GObject.registerClass({
|
||||
Properties: {
|
||||
'icon-name': GObject.ParamSpec.override('icon-name', St.Button),
|
||||
'gicon': GObject.ParamSpec.object('gicon', '', '',
|
||||
|
|
@ -707,7 +705,7 @@ const QuickSettingsLayout = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var QuickSettingsMenu = class extends PopupMenu.PopupMenu {
|
||||
export const QuickSettingsMenu = class extends PopupMenu.PopupMenu {
|
||||
constructor(sourceActor, nColumns = 1) {
|
||||
super(sourceActor, 0, St.Side.TOP);
|
||||
|
||||
|
|
@ -818,7 +816,7 @@ var QuickSettingsMenu = class extends PopupMenu.PopupMenu {
|
|||
}
|
||||
};
|
||||
|
||||
var SystemIndicator = GObject.registerClass(
|
||||
export const SystemIndicator = GObject.registerClass(
|
||||
class SystemIndicator extends St.BoxLayout {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported loadRemoteSearchProviders */
|
||||
|
||||
const GdkPixbuf = imports.gi.GdkPixbuf;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import GdkPixbuf from 'gi://GdkPixbuf';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const FileUtils = imports.misc.fileUtils;
|
||||
import * as FileUtils from '../misc/fileUtils.js';
|
||||
|
||||
const KEY_FILE_GROUP = 'Shell Search Provider';
|
||||
|
||||
|
|
@ -61,8 +60,8 @@ const SearchProvider2Iface = `
|
|||
</interface>
|
||||
</node>`;
|
||||
|
||||
var SearchProviderProxyInfo = Gio.DBusInterfaceInfo.new_for_xml(SearchProviderIface);
|
||||
var SearchProvider2ProxyInfo = Gio.DBusInterfaceInfo.new_for_xml(SearchProvider2Iface);
|
||||
const SearchProviderProxyInfo = Gio.DBusInterfaceInfo.new_for_xml(SearchProviderIface);
|
||||
const SearchProvider2ProxyInfo = Gio.DBusInterfaceInfo.new_for_xml(SearchProvider2Iface);
|
||||
|
||||
/**
|
||||
* loadRemoteSearchProviders:
|
||||
|
|
@ -70,7 +69,7 @@ var SearchProvider2ProxyInfo = Gio.DBusInterfaceInfo.new_for_xml(SearchProvider2
|
|||
* @param {Gio.Settings} searchSettings - search settings
|
||||
* @returns {RemoteSearchProvider[]} - the list of remote providers
|
||||
*/
|
||||
function loadRemoteSearchProviders(searchSettings) {
|
||||
export function loadRemoteSearchProviders(searchSettings) {
|
||||
let objectPaths = {};
|
||||
let loadedProviders = [];
|
||||
|
||||
|
|
@ -193,7 +192,7 @@ function loadRemoteSearchProviders(searchSettings) {
|
|||
return loadedProviders;
|
||||
}
|
||||
|
||||
var RemoteSearchProvider = class {
|
||||
class RemoteSearchProvider {
|
||||
constructor(appInfo, dbusName, dbusPath, autoStart, proxyInfo) {
|
||||
if (!proxyInfo)
|
||||
proxyInfo = SearchProviderProxyInfo;
|
||||
|
|
@ -313,9 +312,9 @@ var RemoteSearchProvider = class {
|
|||
log(`Search provider ${this.appInfo.get_id()} does not implement LaunchSearch`);
|
||||
this.appInfo.launch([], global.create_app_launch_context(0, -1));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var RemoteSearchProvider2 = class extends RemoteSearchProvider {
|
||||
class RemoteSearchProvider2 extends RemoteSearchProvider {
|
||||
constructor(appInfo, dbusName, dbusPath, autoStart) {
|
||||
super(appInfo, dbusName, dbusPath, autoStart, SearchProvider2ProxyInfo);
|
||||
|
||||
|
|
@ -331,4 +330,4 @@ var RemoteSearchProvider2 = class extends RemoteSearchProvider {
|
|||
this.proxy.LaunchSearchAsync(
|
||||
terms, global.get_current_time()).catch(logError);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Ripples */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import St from 'gi://St';
|
||||
|
||||
// Shamelessly copied from the layout "hotcorner" ripples implementation
|
||||
var Ripples = class Ripples {
|
||||
export class Ripples {
|
||||
constructor(px, py, styleClass) {
|
||||
this._x = 0;
|
||||
this._y = 0;
|
||||
|
|
@ -108,4 +107,4 @@ var Ripples = class Ripples {
|
|||
this._animRipple(this._ripple2, 50, 1000, 0.0, 0.7, 1.25);
|
||||
this._animRipple(this._ripple3, 350, 1000, 0.0, 0.3, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,19 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported RunDialog */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Dialog = imports.ui.dialog;
|
||||
const Main = imports.ui.main;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const ShellEntry = imports.ui.shellEntry;
|
||||
const Util = imports.misc.util;
|
||||
const History = imports.misc.history;
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as Main from './main.js';
|
||||
import * as ModalDialog from './modalDialog.js';
|
||||
import * as ShellEntry from './shellEntry.js';
|
||||
import * as Util from '../misc/util.js';
|
||||
import * as History from '../misc/history.js';
|
||||
|
||||
const HISTORY_KEY = 'command-history';
|
||||
|
||||
|
|
@ -25,7 +24,7 @@ const TERMINAL_SCHEMA = 'org.gnome.desktop.default-applications.terminal';
|
|||
const EXEC_KEY = 'exec';
|
||||
const EXEC_ARG_KEY = 'exec-arg';
|
||||
|
||||
var RunDialog = GObject.registerClass(
|
||||
export const RunDialog = GObject.registerClass(
|
||||
class RunDialog extends ModalDialog.ModalDialog {
|
||||
_init() {
|
||||
super._init({
|
||||
|
|
|
|||
|
|
@ -1,28 +1,27 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported ScreenShield */
|
||||
|
||||
const AccountsService = imports.gi.AccountsService;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import AccountsService from 'gi://AccountsService';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Signals = imports.misc.signals;
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const GnomeSession = imports.misc.gnomeSession;
|
||||
const OVirt = imports.gdm.oVirt;
|
||||
const LoginManager = imports.misc.loginManager;
|
||||
const Lightbox = imports.ui.lightbox;
|
||||
const Main = imports.ui.main;
|
||||
const Overview = imports.ui.overview;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const ShellDBus = imports.ui.shellDBus;
|
||||
const SmartcardManager = imports.misc.smartcardManager;
|
||||
import * as GnomeSession from '../misc/gnomeSession.js';
|
||||
import * as OVirt from '../gdm/oVirt.js';
|
||||
import * as LoginManager from '../misc/loginManager.js';
|
||||
import * as Lightbox from './lightbox.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Overview from './overview.js';
|
||||
import * as MessageTray from './messageTray.js';
|
||||
import * as ShellDBus from './shellDBus.js';
|
||||
import * as SmartcardManager from '../misc/smartcardManager.js';
|
||||
|
||||
const {adjustAnimationTime} = imports.misc.animationUtils;
|
||||
import {adjustAnimationTime} from '../misc/animationUtils.js';
|
||||
|
||||
const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
|
||||
const LOCK_ENABLED_KEY = 'lock-enabled';
|
||||
|
|
@ -38,9 +37,9 @@ const LOCKED_STATE_STR = 'screenShield.locked';
|
|||
// - MANUAL_FADE_TIME is used for lowering the shield when asked by the user,
|
||||
// or when cancelling the dialog
|
||||
// - CURTAIN_SLIDE_TIME is used when raising the shield before unlocking
|
||||
var STANDARD_FADE_TIME = 10000;
|
||||
var MANUAL_FADE_TIME = 300;
|
||||
var CURTAIN_SLIDE_TIME = 300;
|
||||
const STANDARD_FADE_TIME = 10000;
|
||||
const MANUAL_FADE_TIME = 300;
|
||||
const CURTAIN_SLIDE_TIME = 300;
|
||||
|
||||
/**
|
||||
* If you are setting org.gnome.desktop.session.idle-delay directly in dconf,
|
||||
|
|
@ -50,7 +49,7 @@ var CURTAIN_SLIDE_TIME = 300;
|
|||
* This will ensure that the screen blanks at the right time when it fades out.
|
||||
* https://bugzilla.gnome.org/show_bug.cgi?id=668703 explains the dependency.
|
||||
*/
|
||||
var ScreenShield = class extends Signals.EventEmitter {
|
||||
export class ScreenShield extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -707,4 +706,4 @@ var ScreenShield = class extends Signals.EventEmitter {
|
|||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported ScreenshotService, ScreenshotUI, showScreenshotUI, captureScreenshot */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Cogl = imports.gi.Cogl;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Cogl from 'gi://Cogl';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import GLib from 'gi://GLib';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const GrabHelper = imports.ui.grabHelper;
|
||||
const Layout = imports.ui.layout;
|
||||
const Lightbox = imports.ui.lightbox;
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const Workspace = imports.ui.workspace;
|
||||
import * as GrabHelper from './grabHelper.js';
|
||||
import * as Layout from './layout.js';
|
||||
import * as Lightbox from './lightbox.js';
|
||||
import * as Main from './main.js';
|
||||
import * as MessageTray from './messageTray.js';
|
||||
import * as Workspace from './workspace.js';
|
||||
|
||||
Gio._promisify(Shell.Screenshot.prototype, 'pick_color');
|
||||
Gio._promisify(Shell.Screenshot.prototype, 'screenshot');
|
||||
|
|
@ -25,15 +24,15 @@ Gio._promisify(Shell.Screenshot.prototype, 'screenshot_area');
|
|||
Gio._promisify(Shell.Screenshot.prototype, 'screenshot_stage_to_content');
|
||||
Gio._promisify(Shell.Screenshot, 'composite_to_stream');
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
const { DBusSenderChecker } = imports.misc.util;
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
import {DBusSenderChecker} from '../misc/util.js';
|
||||
|
||||
const ScreenshotIface = loadInterfaceXML('org.gnome.Shell.Screenshot');
|
||||
|
||||
const ScreencastIface = loadInterfaceXML('org.gnome.Shell.Screencast');
|
||||
const ScreencastProxy = Gio.DBusProxy.makeProxyWrapper(ScreencastIface);
|
||||
|
||||
var IconLabelButton = GObject.registerClass(
|
||||
const IconLabelButton = GObject.registerClass(
|
||||
class IconLabelButton extends St.Button {
|
||||
_init(iconName, label, params) {
|
||||
super._init(params);
|
||||
|
|
@ -44,7 +43,7 @@ class IconLabelButton extends St.Button {
|
|||
});
|
||||
this.set_child(this._container);
|
||||
|
||||
this._container.add_child(new St.Icon({ icon_name: iconName }));
|
||||
this._container.add_child(new St.Icon({icon_name: iconName}));
|
||||
this._container.add_child(new St.Label({
|
||||
text: label,
|
||||
x_align: Clutter.ActorAlign.CENTER,
|
||||
|
|
@ -52,7 +51,7 @@ class IconLabelButton extends St.Button {
|
|||
}
|
||||
});
|
||||
|
||||
var Tooltip = GObject.registerClass(
|
||||
export const Tooltip = GObject.registerClass(
|
||||
class Tooltip extends St.Label {
|
||||
_init(widget, params) {
|
||||
super._init(params);
|
||||
|
|
@ -120,7 +119,7 @@ class Tooltip extends St.Label {
|
|||
}
|
||||
});
|
||||
|
||||
var UIAreaIndicator = GObject.registerClass(
|
||||
const UIAreaIndicator = GObject.registerClass(
|
||||
class UIAreaIndicator extends St.Widget {
|
||||
_init(params) {
|
||||
super._init(params);
|
||||
|
|
@ -229,7 +228,7 @@ class UIAreaIndicator extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var UIAreaSelector = GObject.registerClass({
|
||||
const UIAreaSelector = GObject.registerClass({
|
||||
Signals: { 'drag-started': {}, 'drag-ended': {} },
|
||||
}, class UIAreaSelector extends St.Widget {
|
||||
_init(params) {
|
||||
|
|
@ -700,7 +699,7 @@ var UIAreaSelector = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var UIWindowSelectorLayout = GObject.registerClass(
|
||||
const UIWindowSelectorLayout = GObject.registerClass(
|
||||
class UIWindowSelectorLayout extends Workspace.WorkspaceLayout {
|
||||
_init(monitorIndex) {
|
||||
super._init(null, monitorIndex, null);
|
||||
|
|
@ -765,7 +764,7 @@ class UIWindowSelectorLayout extends Workspace.WorkspaceLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var UIWindowSelectorWindow = GObject.registerClass(
|
||||
const UIWindowSelectorWindow = GObject.registerClass(
|
||||
class UIWindowSelectorWindow extends St.Button {
|
||||
_init(actor, params) {
|
||||
super._init(params);
|
||||
|
|
@ -937,7 +936,7 @@ class UIWindowSelectorWindow extends St.Button {
|
|||
}
|
||||
});
|
||||
|
||||
var UIWindowSelector = GObject.registerClass(
|
||||
const UIWindowSelector = GObject.registerClass(
|
||||
class UIWindowSelector extends St.Widget {
|
||||
_init(monitorIndex, params) {
|
||||
super._init(params);
|
||||
|
|
@ -1005,7 +1004,7 @@ const UIMode = {
|
|||
SCREENCAST: 1,
|
||||
};
|
||||
|
||||
var ScreenshotUI = GObject.registerClass({
|
||||
export const ScreenshotUI = GObject.registerClass({
|
||||
Properties: {
|
||||
'screencast-in-progress': GObject.ParamSpec.boolean(
|
||||
'screencast-in-progress',
|
||||
|
|
@ -2279,7 +2278,7 @@ function showScreenRecordingUI() {
|
|||
});
|
||||
}
|
||||
|
||||
var ScreenshotService = class {
|
||||
export class ScreenshotService {
|
||||
constructor() {
|
||||
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(ScreenshotIface, this);
|
||||
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell/Screenshot');
|
||||
|
|
@ -2595,9 +2594,9 @@ var ScreenshotService = class {
|
|||
this._removeShooterForSender(invocation.get_sender());
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var SelectArea = GObject.registerClass(
|
||||
export const SelectArea = GObject.registerClass(
|
||||
class SelectArea extends St.Widget {
|
||||
_init() {
|
||||
this._startX = -1;
|
||||
|
|
@ -2700,7 +2699,7 @@ class SelectArea extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var RecolorEffect = GObject.registerClass({
|
||||
const RecolorEffect = GObject.registerClass({
|
||||
Properties: {
|
||||
color: GObject.ParamSpec.boxed(
|
||||
'color', 'color', 'replacement color',
|
||||
|
|
@ -2829,7 +2828,7 @@ var RecolorEffect = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var PickPixel = GObject.registerClass(
|
||||
export const PickPixel = GObject.registerClass(
|
||||
class PickPixel extends St.Widget {
|
||||
_init(screenshot) {
|
||||
super._init({ visible: false, reactive: true });
|
||||
|
|
@ -2921,9 +2920,9 @@ class PickPixel extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var FLASHSPOT_ANIMATION_OUT_TIME = 500; // milliseconds
|
||||
const FLASHSPOT_ANIMATION_OUT_TIME = 500; // milliseconds
|
||||
|
||||
var Flashspot = GObject.registerClass(
|
||||
export const Flashspot = GObject.registerClass(
|
||||
class Flashspot extends Lightbox.Lightbox {
|
||||
_init(area) {
|
||||
super._init(Main.uiGroup, {
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ import Meta from 'gi://Meta';
|
|||
import Shell from 'gi://Shell';
|
||||
|
||||
const Config = imports.misc.config;
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
const Util = imports.misc.util;
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as Util from '../misc/util.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
|
||||
// This module provides functionality for driving the shell user interface
|
||||
// in an automated fashion. The primary current use case for this is
|
||||
|
|
|
|||
|
|
@ -1,28 +1,27 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported SearchResultsView */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const AppDisplay = imports.ui.appDisplay;
|
||||
const IconGrid = imports.ui.iconGrid;
|
||||
const Main = imports.ui.main;
|
||||
const ParentalControlsManager = imports.misc.parentalControlsManager;
|
||||
const RemoteSearch = imports.ui.remoteSearch;
|
||||
const {ensureActorVisibleInScrollView} = imports.misc.animationUtils;
|
||||
import * as AppDisplay from './appDisplay.js';
|
||||
import * as IconGrid from './iconGrid.js';
|
||||
import * as Main from './main.js';
|
||||
import * as ParentalControlsManager from '../misc/parentalControlsManager.js';
|
||||
import * as RemoteSearch from './remoteSearch.js';
|
||||
import {ensureActorVisibleInScrollView} from '../misc/animationUtils.js';
|
||||
|
||||
const { Highlighter } = imports.misc.util;
|
||||
import {Highlighter} from '../misc/util.js';
|
||||
|
||||
const SEARCH_PROVIDERS_SCHEMA = 'org.gnome.desktop.search-providers';
|
||||
|
||||
var MAX_LIST_SEARCH_RESULTS_ROWS = 5;
|
||||
const MAX_LIST_SEARCH_RESULTS_ROWS = 5;
|
||||
|
||||
var MaxWidthBox = GObject.registerClass(
|
||||
const MaxWidthBox = GObject.registerClass(
|
||||
class MaxWidthBox extends St.BoxLayout {
|
||||
vfunc_allocate(box) {
|
||||
let themeNode = this.get_theme_node();
|
||||
|
|
@ -40,7 +39,7 @@ class MaxWidthBox extends St.BoxLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var SearchResult = GObject.registerClass(
|
||||
export const SearchResult = GObject.registerClass(
|
||||
class SearchResult extends St.Button {
|
||||
_init(provider, metaInfo, resultsView) {
|
||||
this.provider = provider;
|
||||
|
|
@ -69,7 +68,7 @@ class SearchResult extends St.Button {
|
|||
}
|
||||
});
|
||||
|
||||
var ListSearchResult = GObject.registerClass(
|
||||
export const ListSearchResult = GObject.registerClass(
|
||||
class ListSearchResult extends SearchResult {
|
||||
_init(provider, metaInfo, resultsView) {
|
||||
super._init(provider, metaInfo, resultsView);
|
||||
|
|
@ -129,7 +128,7 @@ class ListSearchResult extends SearchResult {
|
|||
}
|
||||
});
|
||||
|
||||
var GridSearchResult = GObject.registerClass(
|
||||
export const GridSearchResult = GObject.registerClass(
|
||||
class GridSearchResult extends SearchResult {
|
||||
_init(provider, metaInfo, resultsView) {
|
||||
super._init(provider, metaInfo, resultsView);
|
||||
|
|
@ -149,7 +148,7 @@ class GridSearchResult extends SearchResult {
|
|||
}
|
||||
});
|
||||
|
||||
var SearchResultsBase = GObject.registerClass({
|
||||
const SearchResultsBase = GObject.registerClass({
|
||||
GTypeFlags: GObject.TypeFlags.ABSTRACT,
|
||||
Properties: {
|
||||
'focus-child': GObject.ParamSpec.object(
|
||||
|
|
@ -281,7 +280,7 @@ var SearchResultsBase = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ListSearchResults = GObject.registerClass(
|
||||
export const ListSearchResults = GObject.registerClass(
|
||||
class ListSearchResults extends SearchResultsBase {
|
||||
_init(provider, resultsView) {
|
||||
super._init(provider, resultsView);
|
||||
|
|
@ -336,7 +335,7 @@ class ListSearchResults extends SearchResultsBase {
|
|||
}
|
||||
});
|
||||
|
||||
var GridSearchResultsLayout = GObject.registerClass({
|
||||
const GridSearchResultsLayout = GObject.registerClass({
|
||||
Properties: {
|
||||
'spacing': GObject.ParamSpec.int('spacing', 'Spacing', 'Spacing',
|
||||
GObject.ParamFlags.READWRITE, 0, GLib.MAXINT32, 0),
|
||||
|
|
@ -455,7 +454,7 @@ var GridSearchResultsLayout = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var GridSearchResults = GObject.registerClass(
|
||||
export const GridSearchResults = GObject.registerClass(
|
||||
class GridSearchResults extends SearchResultsBase {
|
||||
_init(provider, resultsView) {
|
||||
super._init(provider, resultsView);
|
||||
|
|
@ -539,7 +538,7 @@ class GridSearchResults extends SearchResultsBase {
|
|||
}
|
||||
});
|
||||
|
||||
var SearchResultsView = GObject.registerClass({
|
||||
export const SearchResultsView = GObject.registerClass({
|
||||
Signals: {'terms-changed': {}},
|
||||
}, class SearchResultsView extends St.BoxLayout {
|
||||
_init() {
|
||||
|
|
@ -891,7 +890,7 @@ var SearchResultsView = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ProviderInfo = GObject.registerClass(
|
||||
const ProviderInfo = GObject.registerClass(
|
||||
class ProviderInfo extends St.Button {
|
||||
_init(provider) {
|
||||
this.provider = provider;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported SearchController */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const Search = imports.ui.search;
|
||||
const ShellEntry = imports.ui.shellEntry;
|
||||
import * as Main from './main.js';
|
||||
import * as Search from './search.js';
|
||||
import * as ShellEntry from './shellEntry.js';
|
||||
|
||||
var FocusTrap = GObject.registerClass(
|
||||
const FocusTrap = GObject.registerClass(
|
||||
class FocusTrap extends St.Widget {
|
||||
vfunc_navigate_focus(from, direction) {
|
||||
if (direction === St.DirectionType.TAB_FORWARD ||
|
||||
|
|
@ -26,7 +25,7 @@ function getTermsForSearchString(searchString) {
|
|||
return searchString.split(/\s+/);
|
||||
}
|
||||
|
||||
var SearchController = GObject.registerClass({
|
||||
export const SearchController = GObject.registerClass({
|
||||
Properties: {
|
||||
'search-active': GObject.ParamSpec.boolean(
|
||||
'search-active', 'search-active', 'search-active',
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported SessionMode, listModes */
|
||||
|
||||
const GLib = imports.gi.GLib;
|
||||
const Signals = imports.misc.signals;
|
||||
import GLib from 'gi://GLib';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
|
||||
const FileUtils = imports.misc.fileUtils;
|
||||
const Params = imports.misc.params;
|
||||
import * as FileUtils from '../misc/fileUtils.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
import {LoginDialog} from '../gdm/loginDialog.js';
|
||||
import {UnlockDialog} from '../ui/unlockDialog.js';
|
||||
|
||||
const Config = imports.misc.config;
|
||||
|
||||
|
|
@ -53,7 +55,7 @@ const _modes = {
|
|||
hasNotifications: true,
|
||||
isGreeter: true,
|
||||
isPrimary: true,
|
||||
unlockDialog: imports.gdm.loginDialog.LoginDialog,
|
||||
unlockDialog: LoginDialog,
|
||||
components: Config.HAVE_NETWORKMANAGER
|
||||
? ['networkAgent', 'polkitAgent']
|
||||
: ['polkitAgent'],
|
||||
|
|
@ -90,7 +92,7 @@ const _modes = {
|
|||
hasNotifications: true,
|
||||
isLocked: false,
|
||||
isPrimary: true,
|
||||
unlockDialog: imports.ui.unlockDialog.UnlockDialog,
|
||||
unlockDialog: UnlockDialog,
|
||||
components: USER_SESSION_COMPONENTS,
|
||||
panel: {
|
||||
left: ['activities'],
|
||||
|
|
@ -135,7 +137,7 @@ function _loadModes() {
|
|||
_loadMode(dir, info);
|
||||
}
|
||||
|
||||
function listModes() {
|
||||
export function listModes() {
|
||||
_loadModes();
|
||||
let loop = new GLib.MainLoop(null, false);
|
||||
let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
|
||||
|
|
@ -150,7 +152,7 @@ function listModes() {
|
|||
loop.run();
|
||||
}
|
||||
|
||||
var SessionMode = class extends Signals.EventEmitter {
|
||||
export class SessionMode extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -208,4 +210,4 @@ var SessionMode = class extends Signals.EventEmitter {
|
|||
|
||||
this.emit('updated');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,24 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported GnomeShell, ScreenSaverDBus */
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
|
||||
const Config = imports.misc.config;
|
||||
const ExtensionDownloader = imports.ui.extensionDownloader;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const Main = imports.ui.main;
|
||||
const Screenshot = imports.ui.screenshot;
|
||||
import * as ExtensionDownloader from './extensionDownloader.js';
|
||||
import * as ExtensionUtils from '../misc/extensionUtils.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Screenshot from './screenshot.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
const { DBusSenderChecker } = imports.misc.util;
|
||||
const { ControlsState } = imports.ui.overviewControls;
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
import {DBusSenderChecker} from '../misc/util.js';
|
||||
import {ControlsState} from './overviewControls.js';
|
||||
|
||||
const GnomeShellIface = loadInterfaceXML('org.gnome.Shell');
|
||||
const ScreenSaverIface = loadInterfaceXML('org.gnome.ScreenSaver');
|
||||
|
||||
var GnomeShell = class {
|
||||
export class GnomeShell {
|
||||
constructor() {
|
||||
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellIface, this);
|
||||
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell');
|
||||
|
|
@ -390,11 +389,11 @@ var GnomeShell = class {
|
|||
get ShellVersion() {
|
||||
return Config.PACKAGE_VERSION;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const GnomeShellExtensionsIface = loadInterfaceXML('org.gnome.Shell.Extensions');
|
||||
|
||||
var GnomeShellExtensions = class {
|
||||
class GnomeShellExtensions {
|
||||
constructor() {
|
||||
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellExtensionsIface, this);
|
||||
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell');
|
||||
|
|
@ -493,9 +492,9 @@ var GnomeShellExtensions = class {
|
|||
this._dbusImpl.emit_signal('ExtensionStatusChanged',
|
||||
GLib.Variant.new('(sis)', [newState.uuid, newState.state, newState.error]));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var ScreenSaverDBus = class {
|
||||
export class ScreenSaverDBus {
|
||||
constructor(screenShield) {
|
||||
this._screenShield = screenShield;
|
||||
screenShield.connect('active-changed', shield => {
|
||||
|
|
@ -540,4 +539,4 @@ var ScreenSaverDBus = class {
|
|||
else
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported addContextMenu CapsLockWarning */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Pango from 'gi://Pango';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const BoxPointer = imports.ui.boxpointer;
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
import * as BoxPointer from './boxpointer.js';
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as PopupMenu from './popupMenu.js';
|
||||
|
||||
var EntryMenu = class extends PopupMenu.PopupMenu {
|
||||
export class EntryMenu extends PopupMenu.PopupMenu {
|
||||
constructor(entry) {
|
||||
super(entry, 0, St.Side.TOP);
|
||||
|
||||
|
|
@ -102,7 +101,7 @@ var EntryMenu = class extends PopupMenu.PopupMenu {
|
|||
_onPasswordActivated() {
|
||||
this._entry.password_visible = !this._entry.password_visible;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function _setMenuAlignment(entry, stageX) {
|
||||
let [success, entryX] = entry.transform_stage_point(stageX, 0);
|
||||
|
|
@ -135,7 +134,7 @@ function _onPopup(actor, entry) {
|
|||
* @param {St.Entry} entry
|
||||
* @param {*} params
|
||||
*/
|
||||
function addContextMenu(entry, params) {
|
||||
export function addContextMenu(entry, params) {
|
||||
if (entry.menu)
|
||||
return;
|
||||
|
||||
|
|
@ -165,7 +164,7 @@ function addContextMenu(entry, params) {
|
|||
});
|
||||
}
|
||||
|
||||
var CapsLockWarning = GObject.registerClass(
|
||||
export const CapsLockWarning = GObject.registerClass(
|
||||
class CapsLockWarning extends St.Label {
|
||||
_init(params) {
|
||||
let defaultParams = { style_class: 'caps-lock-warning-label' };
|
||||
|
|
|
|||
|
|
@ -1,28 +1,27 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported ShellMountOperation, GnomeShellMountOpHandler */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Pango from 'gi://Pango';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Animation = imports.ui.animation;
|
||||
const CheckBox = imports.ui.checkBox;
|
||||
const Dialog = imports.ui.dialog;
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const Params = imports.misc.params;
|
||||
const ShellEntry = imports.ui.shellEntry;
|
||||
import * as Animation from './animation.js';
|
||||
import * as CheckBox from './checkBox.js';
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as Main from './main.js';
|
||||
import * as MessageTray from './messageTray.js';
|
||||
import * as ModalDialog from './modalDialog.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
import * as ShellEntry from './shellEntry.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
const {wiggle} = imports.misc.animationUtils;
|
||||
import {loadInterfaceXML} from '../misc/fileUtils.js';
|
||||
import {wiggle} from '../misc/animationUtils.js';
|
||||
|
||||
var LIST_ITEM_ICON_SIZE = 48;
|
||||
var WORK_SPINNER_ICON_SIZE = 16;
|
||||
const LIST_ITEM_ICON_SIZE = 48;
|
||||
const WORK_SPINNER_ICON_SIZE = 16;
|
||||
|
||||
const REMEMBER_MOUNT_PASSWORD_KEY = 'remember-mount-password';
|
||||
|
||||
|
|
@ -55,7 +54,7 @@ function _setLabelsForMessage(content, message) {
|
|||
|
||||
/* -------------------------------------------------------- */
|
||||
|
||||
var ShellMountOperation = class {
|
||||
export class ShellMountOperation {
|
||||
constructor(source, params) {
|
||||
params = Params.parse(params, { existingDialog: null });
|
||||
|
||||
|
|
@ -186,9 +185,9 @@ var ShellMountOperation = class {
|
|||
this._dialog?.disconnectObject(this);
|
||||
return this._dialog;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var ShellUnmountNotifier = GObject.registerClass(
|
||||
const ShellUnmountNotifier = GObject.registerClass(
|
||||
class ShellUnmountNotifier extends MessageTray.Source {
|
||||
_init() {
|
||||
super._init('', 'media-removable');
|
||||
|
|
@ -226,7 +225,7 @@ class ShellUnmountNotifier extends MessageTray.Source {
|
|||
}
|
||||
});
|
||||
|
||||
var ShellMountQuestionDialog = GObject.registerClass({
|
||||
const ShellMountQuestionDialog = GObject.registerClass({
|
||||
Signals: { 'response': { param_types: [GObject.TYPE_INT] } },
|
||||
}, class ShellMountQuestionDialog extends ModalDialog.ModalDialog {
|
||||
_init() {
|
||||
|
|
@ -254,7 +253,7 @@ var ShellMountQuestionDialog = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ShellMountPasswordDialog = GObject.registerClass({
|
||||
const ShellMountPasswordDialog = GObject.registerClass({
|
||||
Signals: {
|
||||
'response': {
|
||||
param_types: [
|
||||
|
|
@ -475,7 +474,7 @@ var ShellMountPasswordDialog = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ShellProcessesDialog = GObject.registerClass({
|
||||
const ShellProcessesDialog = GObject.registerClass({
|
||||
Signals: { 'response': { param_types: [GObject.TYPE_INT] } },
|
||||
}, class ShellProcessesDialog extends ModalDialog.ModalDialog {
|
||||
_init() {
|
||||
|
|
@ -533,14 +532,14 @@ var ShellProcessesDialog = GObject.registerClass({
|
|||
const GnomeShellMountOpIface = loadInterfaceXML('org.Gtk.MountOperationHandler');
|
||||
|
||||
/** @enum {number} */
|
||||
var ShellMountOperationType = {
|
||||
const ShellMountOperationType = {
|
||||
NONE: 0,
|
||||
ASK_PASSWORD: 1,
|
||||
ASK_QUESTION: 2,
|
||||
SHOW_PROCESSES: 3,
|
||||
};
|
||||
|
||||
var GnomeShellMountOpHandler = class {
|
||||
export class GnomeShellMountOpHandler {
|
||||
constructor() {
|
||||
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellMountOpIface, this);
|
||||
this._dbusImpl.export(Gio.DBus.session, '/org/gtk/MountOperationHandler');
|
||||
|
|
@ -754,4 +753,4 @@ var GnomeShellMountOpHandler = class {
|
|||
this._clearCurrentRequest(Gio.MountOperationResult.UNHANDLED, {});
|
||||
this._closeDialog();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
/* exported Slider */
|
||||
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
const BarLevel = imports.ui.barLevel;
|
||||
import * as BarLevel from './barLevel.js';
|
||||
|
||||
var SLIDER_SCROLL_STEP = 0.02; /* Slider scrolling step in % */
|
||||
const SLIDER_SCROLL_STEP = 0.02; /* Slider scrolling step in % */
|
||||
|
||||
var Slider = GObject.registerClass({
|
||||
export const Slider = GObject.registerClass({
|
||||
Signals: {
|
||||
'drag-begin': {},
|
||||
'drag-end': {},
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported ATIndicator */
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const St = imports.gi.St;
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
import * as PanelMenu from '../panelMenu.js';
|
||||
import * as PopupMenu from '../popupMenu.js';
|
||||
|
||||
const A11Y_SCHEMA = 'org.gnome.desktop.a11y';
|
||||
const KEY_ALWAYS_SHOW = 'always-show-universal-access-status';
|
||||
|
|
@ -20,7 +19,7 @@ const KEY_MOUSE_KEYS_ENABLED = 'mousekeys-enable';
|
|||
|
||||
const APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
|
||||
|
||||
var DPI_FACTOR_LARGE = 1.25;
|
||||
const DPI_FACTOR_LARGE = 1.25;
|
||||
|
||||
const WM_SCHEMA = 'org.gnome.desktop.wm.preferences';
|
||||
const KEY_VISUAL_BELL = 'visual-bell';
|
||||
|
|
@ -31,7 +30,7 @@ const KEY_TEXT_SCALING_FACTOR = 'text-scaling-factor';
|
|||
const A11Y_INTERFACE_SCHEMA = 'org.gnome.desktop.a11y.interface';
|
||||
const KEY_HIGH_CONTRAST = 'high-contrast';
|
||||
|
||||
var ATIndicator = GObject.registerClass(
|
||||
export const ATIndicator = GObject.registerClass(
|
||||
class ATIndicator extends PanelMenu.Button {
|
||||
_init() {
|
||||
super._init(0.5, _("Accessibility"));
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
/* exported Indicator */
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
import * as SystemActions from '../../misc/systemActions.js';
|
||||
|
||||
const SystemActions = imports.misc.systemActions;
|
||||
|
||||
const {QuickToggle, SystemIndicator} = imports.ui.quickSettings;
|
||||
import {QuickToggle, SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const RotationToggle = GObject.registerClass(
|
||||
class RotationToggle extends QuickToggle {
|
||||
|
|
@ -37,7 +35,7 @@ class RotationToggle extends QuickToggle {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
/* exported Indicator */
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const Util = imports.misc.util;
|
||||
import * as Main from '../main.js';
|
||||
import * as PopupMenu from '../popupMenu.js';
|
||||
import * as Util from '../../misc/util.js';
|
||||
|
||||
const {Spinner} = imports.ui.animation;
|
||||
const {QuickToggle, SystemIndicator} = imports.ui.quickSettings;
|
||||
import {Spinner} from '../animation.js';
|
||||
import {QuickToggle, SystemIndicator} from '../quickSettings.js';
|
||||
const {loadInterfaceXML} = imports.misc.dbusUtils;
|
||||
|
||||
const DBUS_NAME = 'org.freedesktop.background.Monitor';
|
||||
|
|
@ -24,7 +23,7 @@ const BackgroundMonitorProxy = Gio.DBusProxy.makeProxyWrapper(BackgroundMonitorI
|
|||
|
||||
Gio._promisify(Gio.DBusConnection.prototype, 'call');
|
||||
|
||||
var BackgroundAppMenuItem = GObject.registerClass({
|
||||
const BackgroundAppMenuItem = GObject.registerClass({
|
||||
Properties: {
|
||||
'app': GObject.ParamSpec.object('app', '', '',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
|
|
@ -255,7 +254,7 @@ class BackgroundAppsToggle extends QuickToggle {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
|
||||
const {Clutter, Gio, GObject, St} = imports.gi;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
const {QuickMenuToggle, SystemIndicator} = imports.ui.quickSettings;
|
||||
import {QuickMenuToggle, SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const {Slider} = imports.ui.slider;
|
||||
import * as PopupMenu from '../popupMenu.js';
|
||||
import {Slider} from '../slider.js';
|
||||
|
||||
const {loadInterfaceXML} = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
|
||||
const BUS_NAME = 'org.gnome.SettingsDaemon.Power';
|
||||
const OBJECT_PATH = '/org/gnome/SettingsDaemon/Power';
|
||||
|
|
@ -201,7 +204,7 @@ class KeyboardBrightnessToggle extends QuickMenuToggle {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
import 'gi://GnomeBluetooth?version=3.0';
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GnomeBluetooth = imports.gi.GnomeBluetooth;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Pango = imports.gi.Pango;
|
||||
const St = imports.gi.St;
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GnomeBluetooth from 'gi://GnomeBluetooth';
|
||||
import GObject from 'gi://GObject';
|
||||
import Pango from 'gi://Pango';
|
||||
import St from 'gi://St';
|
||||
|
||||
const {Spinner} = imports.ui.animation;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const {QuickMenuToggle, SystemIndicator} = imports.ui.quickSettings;
|
||||
import {Spinner} from '../animation.js';
|
||||
import * as PopupMenu from '../popupMenu.js';
|
||||
import {QuickMenuToggle, SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const {loadInterfaceXML} = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
|
||||
const {AdapterState} = GnomeBluetooth;
|
||||
|
||||
|
|
@ -394,7 +394,7 @@ class BluetoothToggle extends QuickMenuToggle {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
import {QuickSlider, SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const {QuickSlider, SystemIndicator} = imports.ui.quickSettings;
|
||||
|
||||
const {loadInterfaceXML} = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
|
||||
const BUS_NAME = 'org.gnome.SettingsDaemon.Power';
|
||||
const OBJECT_PATH = '/org/gnome/SettingsDaemon/Power';
|
||||
|
|
@ -56,7 +54,7 @@ class BrightnessItem extends QuickSlider {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
import {SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const {SystemIndicator} = imports.ui.quickSettings;
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
constructor() {
|
||||
super();
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
/* exported Indicator */
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
import * as Main from '../main.js';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const {QuickToggle, SystemIndicator} = imports.ui.quickSettings;
|
||||
import {QuickToggle, SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const DarkModeToggle = GObject.registerClass(
|
||||
class DarkModeToggle extends QuickToggle {
|
||||
|
|
@ -41,7 +40,7 @@ class DarkModeToggle extends QuickToggle {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
/* exported DwellClickIndicator */
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
import * as PanelMenu from '../panelMenu.js';
|
||||
|
||||
const MOUSE_A11Y_SCHEMA = 'org.gnome.desktop.a11y.mouse';
|
||||
const KEY_DWELL_CLICK_ENABLED = 'dwell-click-enabled';
|
||||
|
|
@ -34,7 +33,7 @@ const DWELL_CLICK_MODES = {
|
|||
},
|
||||
};
|
||||
|
||||
var DwellClickIndicator = GObject.registerClass(
|
||||
export const DwellClickIndicator = GObject.registerClass(
|
||||
class DwellClickIndicator extends PanelMenu.Button {
|
||||
_init() {
|
||||
super._init(0.5, _("Dwell Click"));
|
||||
|
|
|
|||
|
|
@ -1,29 +1,28 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported InputSourceIndicator */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const IBus = imports.gi.IBus;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Gettext = imports.gettext;
|
||||
const Signals = imports.misc.signals;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import IBus from 'gi://IBus';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Gettext from 'gettext';
|
||||
import * as Signals from '../../misc/signals.js';
|
||||
|
||||
const IBusManager = imports.misc.ibusManager;
|
||||
const KeyboardManager = imports.misc.keyboardManager;
|
||||
const Main = imports.ui.main;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const SwitcherPopup = imports.ui.switcherPopup;
|
||||
const Util = imports.misc.util;
|
||||
import * as IBusManager from '../../misc/ibusManager.js';
|
||||
import * as KeyboardManager from '../../misc/keyboardManager.js';
|
||||
import * as Main from '../main.js';
|
||||
import * as PopupMenu from '../popupMenu.js';
|
||||
import * as PanelMenu from '../panelMenu.js';
|
||||
import * as SwitcherPopup from '../switcherPopup.js';
|
||||
import * as Util from '../../misc/util.js';
|
||||
|
||||
var INPUT_SOURCE_TYPE_XKB = 'xkb';
|
||||
var INPUT_SOURCE_TYPE_IBUS = 'ibus';
|
||||
export const INPUT_SOURCE_TYPE_XKB = 'xkb';
|
||||
export const INPUT_SOURCE_TYPE_IBUS = 'ibus';
|
||||
|
||||
var LayoutMenuItem = GObject.registerClass(
|
||||
export const LayoutMenuItem = GObject.registerClass(
|
||||
class LayoutMenuItem extends PopupMenu.PopupBaseMenuItem {
|
||||
_init(displayName, shortName) {
|
||||
super._init();
|
||||
|
|
@ -41,7 +40,7 @@ class LayoutMenuItem extends PopupMenu.PopupBaseMenuItem {
|
|||
}
|
||||
});
|
||||
|
||||
var InputSource = class extends Signals.EventEmitter {
|
||||
export class InputSource extends Signals.EventEmitter {
|
||||
constructor(type, id, displayName, shortName, index) {
|
||||
super();
|
||||
|
||||
|
|
@ -79,9 +78,9 @@ var InputSource = class extends Signals.EventEmitter {
|
|||
else
|
||||
return engineDesc.layout;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var InputSourcePopup = GObject.registerClass(
|
||||
export const InputSourcePopup = GObject.registerClass(
|
||||
class InputSourcePopup extends SwitcherPopup.SwitcherPopup {
|
||||
_init(items, action, actionBackward) {
|
||||
super._init(items);
|
||||
|
|
@ -114,7 +113,7 @@ class InputSourcePopup extends SwitcherPopup.SwitcherPopup {
|
|||
}
|
||||
});
|
||||
|
||||
var InputSourceSwitcher = GObject.registerClass(
|
||||
const InputSourceSwitcher = GObject.registerClass(
|
||||
class InputSourceSwitcher extends SwitcherPopup.SwitcherList {
|
||||
_init(items) {
|
||||
super._init(true);
|
||||
|
|
@ -145,7 +144,7 @@ class InputSourceSwitcher extends SwitcherPopup.SwitcherList {
|
|||
}
|
||||
});
|
||||
|
||||
var InputSourceSettings = class extends Signals.EventEmitter {
|
||||
class InputSourceSettings extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -184,9 +183,9 @@ var InputSourceSettings = class extends Signals.EventEmitter {
|
|||
get perWindow() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var InputSourceSystemSettings = class extends InputSourceSettings {
|
||||
class InputSourceSystemSettings extends InputSourceSettings {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -259,9 +258,9 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
|
|||
get keyboardOptions() {
|
||||
return this._options.split(',');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var InputSourceSessionSettings = class extends InputSourceSettings {
|
||||
class InputSourceSessionSettings extends InputSourceSettings {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -309,9 +308,9 @@ var InputSourceSessionSettings = class extends InputSourceSettings {
|
|||
get perWindow() {
|
||||
return this._settings.get_boolean(this._KEY_PER_WINDOW);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var InputSourceManager = class extends Signals.EventEmitter {
|
||||
export class InputSourceManager extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -795,20 +794,20 @@ var InputSourceManager = class extends Signals.EventEmitter {
|
|||
get keyboardManager() {
|
||||
return this._keyboardManager;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let _inputSourceManager = null;
|
||||
|
||||
/**
|
||||
* @returns {InputSourceManager}
|
||||
*/
|
||||
function getInputSourceManager() {
|
||||
export function getInputSourceManager() {
|
||||
if (_inputSourceManager == null)
|
||||
_inputSourceManager = new InputSourceManager();
|
||||
return _inputSourceManager;
|
||||
}
|
||||
|
||||
var InputSourceIndicatorContainer = GObject.registerClass(
|
||||
const InputSourceIndicatorContainer = GObject.registerClass(
|
||||
class InputSourceIndicatorContainer extends St.Widget {
|
||||
vfunc_get_preferred_width(forHeight) {
|
||||
// Here, and in vfunc_get_preferred_height, we need to query
|
||||
|
|
@ -848,7 +847,7 @@ class InputSourceIndicatorContainer extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var InputSourceIndicator = GObject.registerClass(
|
||||
export const InputSourceIndicator = GObject.registerClass(
|
||||
class InputSourceIndicator extends PanelMenu.Button {
|
||||
_init() {
|
||||
super._init(0.5, _("Keyboard"));
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Dialog = imports.ui.dialog;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const PermissionStore = imports.misc.permissionStore;
|
||||
const {SystemIndicator} = imports.ui.quickSettings;
|
||||
import * as Dialog from '../dialog.js';
|
||||
import * as ModalDialog from '../modalDialog.js';
|
||||
import * as PermissionStore from '../../misc/permissionStore.js';
|
||||
import {SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
|
||||
const LOCATION_SCHEMA = 'org.gnome.system.location';
|
||||
const MAX_ACCURACY_LEVEL = 'max-accuracy-level';
|
||||
|
|
@ -23,7 +22,7 @@ const APP_PERMISSIONS_TABLE = 'location';
|
|||
const APP_PERMISSIONS_ID = 'location';
|
||||
|
||||
/** @enum {number} */
|
||||
var GeoclueAccuracyLevel = {
|
||||
const GeoclueAccuracyLevel = {
|
||||
NONE: 0,
|
||||
COUNTRY: 1,
|
||||
CITY: 4,
|
||||
|
|
@ -41,19 +40,23 @@ function accuracyLevelToString(accuracyLevel) {
|
|||
return 'NONE';
|
||||
}
|
||||
|
||||
var GeoclueIface = loadInterfaceXML('org.freedesktop.GeoClue2.Manager');
|
||||
const GeoclueIface = loadInterfaceXML('org.freedesktop.GeoClue2.Manager');
|
||||
const GeoclueManager = Gio.DBusProxy.makeProxyWrapper(GeoclueIface);
|
||||
|
||||
var AgentIface = loadInterfaceXML('org.freedesktop.GeoClue2.Agent');
|
||||
const AgentIface = loadInterfaceXML('org.freedesktop.GeoClue2.Agent');
|
||||
|
||||
let _geoclueAgent = null;
|
||||
function _getGeoclueAgent() {
|
||||
|
||||
/**
|
||||
* @returns {GeoclueAgent} - the GeoclueAgent singleton
|
||||
*/
|
||||
export function getGeoclueAgent() {
|
||||
if (_geoclueAgent === null)
|
||||
_geoclueAgent = new GeoclueAgent();
|
||||
return _geoclueAgent;
|
||||
}
|
||||
|
||||
var GeoclueAgent = GObject.registerClass({
|
||||
const GeoclueAgent = GObject.registerClass({
|
||||
Properties: {
|
||||
'enabled': GObject.ParamSpec.boolean(
|
||||
'enabled', 'Enabled', 'Enabled',
|
||||
|
|
@ -207,12 +210,12 @@ var GeoclueAgent = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
||||
this._agent = _getGeoclueAgent();
|
||||
this._agent = getGeoclueAgent();
|
||||
|
||||
this._indicator = this._addIndicator();
|
||||
this._indicator.icon_name = 'location-services-active-symbolic';
|
||||
|
|
@ -223,7 +226,7 @@ class Indicator extends SystemIndicator {
|
|||
}
|
||||
});
|
||||
|
||||
var AppAuthorizer = class {
|
||||
class AppAuthorizer {
|
||||
constructor(desktopId, reqAccuracyLevel, permStoreProxy, maxAccuracyLevel) {
|
||||
this.desktopId = desktopId;
|
||||
this.reqAccuracyLevel = reqAccuracyLevel;
|
||||
|
|
@ -323,9 +326,9 @@ var AppAuthorizer = class {
|
|||
log(error.message);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var GeolocationDialog = GObject.registerClass({
|
||||
export const GeolocationDialog = GObject.registerClass({
|
||||
Signals: { 'response': { param_types: [GObject.TYPE_UINT] } },
|
||||
}, class GeolocationDialog extends ModalDialog.ModalDialog {
|
||||
_init(name, reason, reqAccuracyLevel) {
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const NM = imports.gi.NM;
|
||||
const Polkit = imports.gi.Polkit;
|
||||
const St = imports.gi.St;
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const ModemManager = imports.misc.modemManager;
|
||||
const Util = imports.misc.util;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import NM from 'gi://NM';
|
||||
import Polkit from 'gi://Polkit';
|
||||
import St from 'gi://St';
|
||||
|
||||
const {Spinner} = imports.ui.animation;
|
||||
const {QuickMenuToggle, SystemIndicator} = imports.ui.quickSettings;
|
||||
import * as Main from '../main.js';
|
||||
import * as PopupMenu from '../popupMenu.js';
|
||||
import * as MessageTray from '../messageTray.js';
|
||||
import * as ModemManager from '../../misc/modemManager.js';
|
||||
import * as Util from '../../misc/util.js';
|
||||
|
||||
const {loadInterfaceXML} = imports.misc.fileUtils;
|
||||
const {registerDestroyableType} = imports.misc.signalTracker;
|
||||
import {Spinner} from '../animation.js';
|
||||
import {QuickMenuToggle, SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
import {registerDestroyableType} from '../../misc/signalTracker.js';
|
||||
|
||||
Gio._promisify(Gio.DBusConnection.prototype, 'call');
|
||||
Gio._promisify(NM.Client, 'new_async');
|
||||
|
|
@ -33,7 +33,7 @@ const MAX_VISIBLE_NETWORKS = 8;
|
|||
const NM80211Mode = NM['80211Mode'];
|
||||
|
||||
/** @enum {number} */
|
||||
var PortalHelperResult = {
|
||||
const PortalHelperResult = {
|
||||
CANCELLED: 0,
|
||||
COMPLETED: 1,
|
||||
RECHECK: 2,
|
||||
|
|
@ -1935,7 +1935,7 @@ class NMModemToggle extends NMDeviceToggle {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
const {QuickToggle, SystemIndicator} = imports.ui.quickSettings;
|
||||
import {QuickToggle, SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const {loadInterfaceXML} = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
|
||||
const BUS_NAME = 'org.gnome.SettingsDaemon.Color';
|
||||
const OBJECT_PATH = '/org/gnome/SettingsDaemon/Color';
|
||||
|
|
@ -38,7 +37,7 @@ class NightLightToggle extends QuickToggle {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
|
||||
const {QuickMenuToggle, SystemIndicator} = imports.ui.quickSettings;
|
||||
import {QuickMenuToggle, SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
import * as PopupMenu from '../popupMenu.js';
|
||||
|
||||
const {loadInterfaceXML} = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
|
||||
const BUS_NAME = 'net.hadess.PowerProfiles';
|
||||
const OBJECT_PATH = '/net/hadess/PowerProfiles';
|
||||
|
|
@ -123,7 +122,7 @@ class PowerProfilesToggle extends QuickMenuToggle {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported RemoteAccessApplet, ScreenRecordingIndicator, ScreenSharingIndicator */
|
||||
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const St = imports.gi.St;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const {SystemIndicator} = imports.ui.quickSettings;
|
||||
import * as Main from '../main.js';
|
||||
import * as PanelMenu from '../panelMenu.js';
|
||||
import {SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
// Minimum amount of time the shared indicator is visible (in micro seconds)
|
||||
const MIN_SHARED_INDICATOR_VISIBLE_TIME_US = 5 * GLib.TIME_SPAN_SECOND;
|
||||
|
||||
var RemoteAccessApplet = GObject.registerClass(
|
||||
export const RemoteAccessApplet = GObject.registerClass(
|
||||
class RemoteAccessApplet extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
@ -66,7 +65,7 @@ class RemoteAccessApplet extends SystemIndicator {
|
|||
}
|
||||
});
|
||||
|
||||
var ScreenRecordingIndicator = GObject.registerClass({
|
||||
export const ScreenRecordingIndicator = GObject.registerClass({
|
||||
Signals: { 'menu-set': {} },
|
||||
}, class ScreenRecordingIndicator extends PanelMenu.ButtonBox {
|
||||
_init() {
|
||||
|
|
@ -136,7 +135,7 @@ var ScreenRecordingIndicator = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var ScreenSharingIndicator = GObject.registerClass({
|
||||
export const ScreenSharingIndicator = GObject.registerClass({
|
||||
Signals: {'menu-set': {}},
|
||||
}, class ScreenSharingIndicator extends PanelMenu.ButtonBox {
|
||||
_init() {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
const {QuickToggle, SystemIndicator} = imports.ui.quickSettings;
|
||||
import {QuickToggle, SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const {loadInterfaceXML} = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
|
||||
const BUS_NAME = 'org.gnome.SettingsDaemon.Rfkill';
|
||||
const OBJECT_PATH = '/org/gnome/SettingsDaemon/Rfkill';
|
||||
|
|
@ -87,7 +86,7 @@ let _manager;
|
|||
/**
|
||||
* @returns {RfkillManager}
|
||||
*/
|
||||
function getRfkillManager() {
|
||||
export function getRfkillManager() {
|
||||
if (_manager != null)
|
||||
return _manager;
|
||||
|
||||
|
|
@ -116,7 +115,7 @@ class RfkillToggle extends QuickToggle {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const UPower = imports.gi.UPowerGlib;
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import UPower from 'gi://UPowerGlib';
|
||||
|
||||
const SystemActions = imports.misc.systemActions;
|
||||
const Main = imports.ui.main;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const {PopupAnimation} = imports.ui.boxpointer;
|
||||
import * as SystemActions from '../../misc/systemActions.js';
|
||||
import * as Main from '../main.js';
|
||||
import * as PopupMenu from '../popupMenu.js';
|
||||
import {PopupAnimation} from '../boxpointer.js';
|
||||
|
||||
const {QuickSettingsItem, QuickToggle, SystemIndicator} = imports.ui.quickSettings;
|
||||
const {loadInterfaceXML} = imports.misc.fileUtils;
|
||||
import {QuickSettingsItem, QuickToggle, SystemIndicator} from '../quickSettings.js';
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
|
||||
const BUS_NAME = 'org.freedesktop.UPower';
|
||||
const OBJECT_PATH = '/org/freedesktop/UPower/devices/DisplayDevice';
|
||||
|
|
@ -301,7 +300,7 @@ class SystemItem extends QuickSettingsItem {
|
|||
}
|
||||
});
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,20 +1,19 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Indicator */
|
||||
|
||||
// the following is a modified version of bolt/contrib/js/client.js
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Polkit = imports.gi.Polkit;
|
||||
const Shell = imports.gi.Shell;
|
||||
const Signals = imports.misc.signals;
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Polkit from 'gi://Polkit';
|
||||
import Shell from 'gi://Shell';
|
||||
import * as Signals from '../../misc/signals.js';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const {SystemIndicator} = imports.ui.quickSettings;
|
||||
import * as Main from '../main.js';
|
||||
import * as MessageTray from '../messageTray.js';
|
||||
import {SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
import {loadInterfaceXML} from '../../misc/fileUtils.js';
|
||||
|
||||
/* Keep in sync with data/org.freedesktop.bolt.xml */
|
||||
|
||||
|
|
@ -24,7 +23,7 @@ const BoltDeviceInterface = loadInterfaceXML('org.freedesktop.bolt1.Device');
|
|||
const BoltDeviceProxy = Gio.DBusProxy.makeProxyWrapper(BoltDeviceInterface);
|
||||
|
||||
/** @enum {string} */
|
||||
var Status = {
|
||||
const Status = {
|
||||
DISCONNECTED: 'disconnected',
|
||||
CONNECTING: 'connecting',
|
||||
CONNECTED: 'connected',
|
||||
|
|
@ -34,19 +33,19 @@ var Status = {
|
|||
};
|
||||
|
||||
/** @enum {string} */
|
||||
var Policy = {
|
||||
const Policy = {
|
||||
DEFAULT: 'default',
|
||||
MANUAL: 'manual',
|
||||
AUTO: 'auto',
|
||||
};
|
||||
|
||||
/** @enum {string} */
|
||||
var AuthCtrl = {
|
||||
const AuthCtrl = {
|
||||
NONE: 'none',
|
||||
};
|
||||
|
||||
/** @enum {string} */
|
||||
var AuthMode = {
|
||||
const AuthMode = {
|
||||
DISABLED: 'disabled',
|
||||
ENABLED: 'enabled',
|
||||
};
|
||||
|
|
@ -55,7 +54,7 @@ const BOLT_DBUS_CLIENT_IFACE = 'org.freedesktop.bolt1.Manager';
|
|||
const BOLT_DBUS_NAME = 'org.freedesktop.bolt';
|
||||
const BOLT_DBUS_PATH = '/org/freedesktop/bolt';
|
||||
|
||||
var Client = class extends Signals.EventEmitter {
|
||||
class Client extends Signals.EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -128,10 +127,10 @@ var Client = class extends Signals.EventEmitter {
|
|||
get authMode() {
|
||||
return this._proxy.AuthMode;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* helper class to automatically authorize new devices */
|
||||
var AuthRobot = class extends Signals.EventEmitter {
|
||||
class AuthRobot extends Signals.EventEmitter {
|
||||
constructor(client) {
|
||||
super();
|
||||
|
||||
|
|
@ -216,11 +215,11 @@ var AuthRobot = class extends Signals.EventEmitter {
|
|||
}
|
||||
return GLib.SOURCE_REMOVE;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* eof client.js */
|
||||
|
||||
var Indicator = GObject.registerClass(
|
||||
export const Indicator = GObject.registerClass(
|
||||
class Indicator extends SystemIndicator {
|
||||
_init() {
|
||||
super._init();
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported OutputIndicator InputIndicator */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Gvc = imports.gi.Gvc;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Gvc from 'gi://Gvc';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
import * as Main from '../main.js';
|
||||
import * as PopupMenu from '../popupMenu.js';
|
||||
|
||||
const {QuickSlider, SystemIndicator} = imports.ui.quickSettings;
|
||||
import {QuickSlider, SystemIndicator} from '../quickSettings.js';
|
||||
|
||||
const ALLOW_AMPLIFIED_VOLUME_KEY = 'allow-volume-above-100-percent';
|
||||
const UNMUTE_DEFAULT_VOLUME = 0.25;
|
||||
|
|
@ -18,10 +17,11 @@ const UNMUTE_DEFAULT_VOLUME = 0.25;
|
|||
// Each Gvc.MixerControl is a connection to PulseAudio,
|
||||
// so it's better to make it a singleton
|
||||
let _mixerControl;
|
||||
|
||||
/**
|
||||
* @returns {Gvc.MixerControl} - the mixer control singleton
|
||||
*/
|
||||
function getMixerControl() {
|
||||
export function getMixerControl() {
|
||||
if (_mixerControl)
|
||||
return _mixerControl;
|
||||
|
||||
|
|
@ -429,7 +429,7 @@ class VolumeIndicator extends SystemIndicator {
|
|||
}
|
||||
});
|
||||
|
||||
var OutputIndicator = GObject.registerClass(
|
||||
export const OutputIndicator = GObject.registerClass(
|
||||
class OutputIndicator extends VolumeIndicator {
|
||||
constructor() {
|
||||
super();
|
||||
|
|
@ -469,7 +469,7 @@ class OutputIndicator extends VolumeIndicator {
|
|||
}
|
||||
});
|
||||
|
||||
var InputIndicator = GObject.registerClass(
|
||||
export const InputIndicator = GObject.registerClass(
|
||||
class InputIndicator extends VolumeIndicator {
|
||||
constructor() {
|
||||
super();
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported SwipeTracker */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
// FIXME: ideally these values matches physical touchpad size. We can get the
|
||||
// correct values for gnome-shell specifically, since mutter uses libinput
|
||||
|
|
@ -430,7 +429,7 @@ const ScrollGesture = GObject.registerClass({
|
|||
// instantly.
|
||||
|
||||
/** A class for handling swipe gestures */
|
||||
var SwipeTracker = GObject.registerClass({
|
||||
export const SwipeTracker = GObject.registerClass({
|
||||
Properties: {
|
||||
'enabled': GObject.ParamSpec.boolean(
|
||||
'enabled', 'enabled', 'enabled',
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported SwitchMonitorPopup */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Meta = imports.gi.Meta;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import St from 'gi://St';
|
||||
|
||||
const SwitcherPopup = imports.ui.switcherPopup;
|
||||
import * as SwitcherPopup from './switcherPopup.js';
|
||||
|
||||
var APP_ICON_SIZE = 96;
|
||||
const APP_ICON_SIZE = 96;
|
||||
|
||||
var SwitchMonitorPopup = GObject.registerClass(
|
||||
export const SwitchMonitorPopup = GObject.registerClass(
|
||||
class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
|
||||
_init() {
|
||||
let items = [];
|
||||
|
|
@ -93,7 +92,7 @@ class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
|
|||
}
|
||||
});
|
||||
|
||||
var SwitchMonitorSwitcher = GObject.registerClass(
|
||||
const SwitchMonitorSwitcher = GObject.registerClass(
|
||||
class SwitchMonitorSwitcher extends SwitcherPopup.SwitcherList {
|
||||
_init(items) {
|
||||
super._init(true);
|
||||
|
|
|
|||
|
|
@ -1,27 +1,26 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported SwitcherPopup, SwitcherList */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
import * as Main from './main.js';
|
||||
|
||||
var POPUP_DELAY_TIMEOUT = 150; // milliseconds
|
||||
const POPUP_DELAY_TIMEOUT = 150; // milliseconds
|
||||
|
||||
var POPUP_SCROLL_TIME = 100; // milliseconds
|
||||
var POPUP_FADE_OUT_TIME = 100; // milliseconds
|
||||
const POPUP_SCROLL_TIME = 100; // milliseconds
|
||||
const POPUP_FADE_OUT_TIME = 100; // milliseconds
|
||||
|
||||
var DISABLE_HOVER_TIMEOUT = 500; // milliseconds
|
||||
var NO_MODS_TIMEOUT = 1500; // milliseconds
|
||||
const DISABLE_HOVER_TIMEOUT = 500; // milliseconds
|
||||
const NO_MODS_TIMEOUT = 1500; // milliseconds
|
||||
|
||||
/**
|
||||
* @param {number} a
|
||||
* @param {number} b
|
||||
* @returns {number}
|
||||
*/
|
||||
function mod(a, b) {
|
||||
export function mod(a, b) {
|
||||
return (a + b) % b;
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +36,7 @@ function primaryModifier(mask) {
|
|||
return primary;
|
||||
}
|
||||
|
||||
var SwitcherPopup = GObject.registerClass({
|
||||
export const SwitcherPopup = GObject.registerClass({
|
||||
GTypeFlags: GObject.TypeFlags.ABSTRACT,
|
||||
}, class SwitcherPopup extends St.Widget {
|
||||
_init(items) {
|
||||
|
|
@ -364,7 +363,7 @@ var SwitcherPopup = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var SwitcherButton = GObject.registerClass(
|
||||
const SwitcherButton = GObject.registerClass(
|
||||
class SwitcherButton extends St.Button {
|
||||
_init(square) {
|
||||
super._init({
|
||||
|
|
@ -383,7 +382,7 @@ class SwitcherButton extends St.Button {
|
|||
}
|
||||
});
|
||||
|
||||
var SwitcherList = GObject.registerClass({
|
||||
export const SwitcherList = GObject.registerClass({
|
||||
Signals: {
|
||||
'item-activated': { param_types: [GObject.TYPE_INT] },
|
||||
'item-entered': { param_types: [GObject.TYPE_INT] },
|
||||
|
|
@ -654,7 +653,7 @@ var SwitcherList = GObject.registerClass({
|
|||
* @param {St.DrawingArrow} area
|
||||
* @param {St.Side} side
|
||||
*/
|
||||
function drawArrow(area, side) {
|
||||
export function drawArrow(area, side) {
|
||||
let themeNode = area.get_theme_node();
|
||||
let borderColor = themeNode.get_border_color(side);
|
||||
let bodyColor = themeNode.get_foreground_color();
|
||||
|
|
|
|||
|
|
@ -1,24 +1,23 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported UnlockDialog */
|
||||
|
||||
const AccountsService = imports.gi.AccountsService;
|
||||
const Atk = imports.gi.Atk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gdm = imports.gi.Gdm;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GnomeDesktop = imports.gi.GnomeDesktop;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import AccountsService from 'gi://AccountsService';
|
||||
import Atk from 'gi://Atk';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gdm from 'gi://Gdm';
|
||||
import Gio from 'gi://Gio';
|
||||
import GnomeDesktop from 'gi://GnomeDesktop';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Background = imports.ui.background;
|
||||
const Layout = imports.ui.layout;
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const SwipeTracker = imports.ui.swipeTracker;
|
||||
const {formatDateWithCFormatString} = imports.misc.dateUtils;
|
||||
const AuthPrompt = imports.gdm.authPrompt;
|
||||
import * as Background from './background.js';
|
||||
import * as Layout from './layout.js';
|
||||
import * as Main from './main.js';
|
||||
import * as MessageTray from './messageTray.js';
|
||||
import * as SwipeTracker from './swipeTracker.js';
|
||||
import {formatDateWithCFormatString} from '../misc/dateUtils.js';
|
||||
import * as AuthPrompt from '../gdm/authPrompt.js';
|
||||
|
||||
// The timeout before going back automatically to the lock screen (in seconds)
|
||||
const IDLE_TIMEOUT = 2 * 60;
|
||||
|
|
@ -35,7 +34,7 @@ const BLUR_SIGMA = 45;
|
|||
|
||||
const SUMMARY_ICON_SIZE = 32;
|
||||
|
||||
var NotificationsBox = GObject.registerClass({
|
||||
const NotificationsBox = GObject.registerClass({
|
||||
Signals: { 'wake-up-screen': {} },
|
||||
}, class NotificationsBox extends St.BoxLayout {
|
||||
_init() {
|
||||
|
|
@ -312,7 +311,7 @@ var NotificationsBox = GObject.registerClass({
|
|||
}
|
||||
});
|
||||
|
||||
var Clock = GObject.registerClass(
|
||||
const Clock = GObject.registerClass(
|
||||
class UnlockDialogClock extends St.BoxLayout {
|
||||
_init() {
|
||||
super._init({ style_class: 'unlock-dialog-clock', vertical: true });
|
||||
|
|
@ -383,7 +382,7 @@ class UnlockDialogClock extends St.BoxLayout {
|
|||
}
|
||||
});
|
||||
|
||||
var UnlockDialogLayout = GObject.registerClass(
|
||||
const UnlockDialogLayout = GObject.registerClass(
|
||||
class UnlockDialogLayout extends Clutter.LayoutManager {
|
||||
_init(stack, notifications, switchUserButton) {
|
||||
super._init();
|
||||
|
|
@ -462,7 +461,7 @@ class UnlockDialogLayout extends Clutter.LayoutManager {
|
|||
}
|
||||
});
|
||||
|
||||
var UnlockDialog = GObject.registerClass({
|
||||
export const UnlockDialog = GObject.registerClass({
|
||||
Signals: {
|
||||
'failed': {},
|
||||
'wake-up-screen': {},
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
//
|
||||
// A widget showing the user avatar and name
|
||||
/* exported UserWidget */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Params = imports.misc.params;
|
||||
import * as Params from '../misc/params.js';
|
||||
|
||||
var AVATAR_ICON_SIZE = 64;
|
||||
const AVATAR_ICON_SIZE = 64;
|
||||
|
||||
// Adapted from gdm/gui/user-switch-applet/applet.c
|
||||
//
|
||||
// Copyright (C) 2004-2005 James M. Cape <jcape@ignore-your.tv>.
|
||||
// Copyright (C) 2008,2009 Red Hat, Inc.
|
||||
|
||||
var Avatar = GObject.registerClass(
|
||||
export const Avatar = GObject.registerClass(
|
||||
class Avatar extends St.Bin {
|
||||
_init(user, params) {
|
||||
let themeContext = St.ThemeContext.get_for_stage(global.stage);
|
||||
|
|
@ -96,7 +95,7 @@ class Avatar extends St.Bin {
|
|||
}
|
||||
});
|
||||
|
||||
var UserWidgetLabel = GObject.registerClass(
|
||||
export const UserWidgetLabel = GObject.registerClass(
|
||||
class UserWidgetLabel extends St.Widget {
|
||||
_init(user) {
|
||||
super._init({ layout_manager: new Clutter.BinLayout() });
|
||||
|
|
@ -165,7 +164,7 @@ class UserWidgetLabel extends St.Widget {
|
|||
}
|
||||
});
|
||||
|
||||
var UserWidget = GObject.registerClass(
|
||||
export const UserWidget = GObject.registerClass(
|
||||
class UserWidget extends St.BoxLayout {
|
||||
_init(user, orientation = Clutter.Orientation.HORIZONTAL) {
|
||||
// If user is null, that implies a username-based login authorization.
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported WelcomeDialog */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
const Config = imports.misc.config;
|
||||
const Dialog = imports.ui.dialog;
|
||||
const Main = imports.ui.main;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
import * as Main from './main.js';
|
||||
import * as Dialog from './dialog.js';
|
||||
import * as ModalDialog from './modalDialog.js';
|
||||
|
||||
/** @enum {number} */
|
||||
var DialogResponse = {
|
||||
const DialogResponse = {
|
||||
NO_THANKS: 0,
|
||||
TAKE_TOUR: 1,
|
||||
};
|
||||
|
||||
var WelcomeDialog = GObject.registerClass(
|
||||
export const WelcomeDialog = GObject.registerClass(
|
||||
class WelcomeDialog extends ModalDialog.ModalDialog {
|
||||
_init() {
|
||||
super._init({ styleClass: 'welcome-dialog' });
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue