🔧 Do not import the ShaderFactory in the preferences process

This commit is contained in:
Simon Schneegans
2023-09-08 20:45:58 +02:00
parent 3f05c946ec
commit 14cd1db7e9
25 changed files with 205 additions and 180 deletions
+7 -7
View File
@@ -185,7 +185,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// Store uniform locations of newly created shaders. // Store uniform locations of newly created shaders.
shader._uFadeWidth = shader.get_uniform_location("uFadeWidth"); shader._uFadeWidth = shader.get_uniform_location("uFadeWidth");
@@ -201,7 +201,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -210,13 +210,13 @@ export default class Effect {
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). Also, the shader file and the settings UI files should be // (e.g. '*-animation-time'). Also, the shader file and the settings UI files should be
// named likes this. // named likes this.
getNick() { static getNick() {
return "simple-fade"; return "simple-fade";
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _("Simple Fade Effect"); return _("Simple Fade Effect");
} }
@@ -224,7 +224,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
// Empty for now... Code is added here later in the tutorial! // Empty for now... Code is added here later in the tutorial!
} }
@@ -233,7 +233,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return { x: 1.0, y: 1.0 }; return { x: 1.0, y: 1.0 };
} }
} }
@@ -370,7 +370,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
In order to load the above `*.ui` file, add the following code to your effect's `bindPreferences()` method. In order to load the above `*.ui` file, add the following code to your effect's `bindPreferences()` method.
```javascript ```javascript
bindPreferences(dialog) { static bindPreferences(dialog) {
// These connect the settings to the UI elements. Have a look at prefs.js // These connect the settings to the UI elements. Have a look at prefs.js
// on how to bind other types of UI elements. // on how to bind other types of UI elements.
dialog.bindAdjustment('simple-fade-animation-time'); dialog.bindAdjustment('simple-fade-animation-time');
+9 -5
View File
@@ -437,7 +437,8 @@ export default class BurnMyWindows extends Extension {
if (previewNick != '') { if (previewNick != '') {
const activeProfile = this._settings.get_string('active-profile'); const activeProfile = this._settings.get_string('active-profile');
effect = this._ALL_EFFECTS.find(effect => effect.getNick() == previewNick); effect =
this._ALL_EFFECTS.find(effect => effect.constructor.getNick() == previewNick);
profile = this._profiles.find(p => p.path == activeProfile); profile = this._profiles.find(p => p.path == activeProfile);
// Only preview the effect until the preview window is closed. // Only preview the effect until the preview window is closed.
@@ -520,7 +521,8 @@ export default class BurnMyWindows extends Extension {
// Create a list of all enabled effects of this profile. // Create a list of all enabled effects of this profile.
const enabled = this._ALL_EFFECTS.filter(effect => { const enabled = this._ALL_EFFECTS.filter(effect => {
return profile.settings.get_boolean(`${effect.getNick()}-enable-effect`); return profile.settings.get_boolean(
`${effect.constructor.getNick()}-enable-effect`);
}); });
// And then choose a random effect. // And then choose a random effect.
@@ -558,7 +560,8 @@ export default class BurnMyWindows extends Extension {
// windows are faded in / out scaled up / down slightly by GNOME Shell. Here, we tweak // windows are faded in / out scaled up / down slightly by GNOME Shell. Here, we tweak
// the transitions so that nothing changes. The window stays opaque and is scaled to // the transitions so that nothing changes. The window stays opaque and is scaled to
// actorScale. // actorScale.
const actorScale = effect.getActorScale(profile.settings, forOpening, actor); const actorScale =
effect.constructor.getActorScale(profile.settings, forOpening, actor);
// All scaling is relative to the window's center. // All scaling is relative to the window's center.
actor.set_pivot_point(0.5, 0.5); actor.set_pivot_point(0.5, 0.5);
@@ -609,8 +612,9 @@ export default class BurnMyWindows extends Extension {
// To make things deterministic during testing, we set the effect duration to 5 // To make things deterministic during testing, we set the effect duration to 5
// seconds. // seconds.
const duration = const duration = testMode ?
testMode ? 5000 : profile.settings.get_int(effect.getNick() + '-animation-time'); 5000 :
profile.settings.get_int(effect.constructor.getNick() + '-animation-time');
// Finally start the animation! // Finally start the animation!
shader.beginAnimation(profile.settings, forOpening, testMode, duration, actor); shader.beginAnimation(profile.settings, forOpening, testMode, duration, actor);
+21 -21
View File
@@ -101,27 +101,27 @@ export default class BurnMyWindowsPreferences extends ExtensionPreferences {
// New effects must be registered here and in extension.js. // New effects must be registered here and in extension.js.
this._ALL_EFFECTS = [ this._ALL_EFFECTS = [
new Apparition(), Apparition,
new BrokenGlass(), BrokenGlass,
new Doom(), Doom,
new EnergizeA(), EnergizeA,
new EnergizeB(), EnergizeB,
new Fire(), Fire,
new Glide(), Glide,
new Glitch(), Glitch,
new Hexagon(), Hexagon,
new Incinerate(), Incinerate,
new Matrix(), Matrix,
new PaintBrush(), PaintBrush,
new Pixelate(), Pixelate,
new PixelWheel(), PixelWheel,
new PixelWipe(), PixelWipe,
new Portal(), Portal,
new SnapOfDisintegration(), SnapOfDisintegration,
new TRexAttack(), TRexAttack,
new TVEffect(), TVEffect,
new TVGlitch(), TVGlitch,
new Wisps(), Wisps,
]; ];
// Load all of our resources. // Load all of our resources.
+1 -1
View File
@@ -24,7 +24,7 @@ import {Shader} from './Shader.js';
// possible in order to avoid memory leaks. // // possible in order to avoid memory leaks. //
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
export class ShaderFactory { export default class ShaderFactory {
// Creates a new ShaderFactory. Requires the nick of the effect and a callback function // Creates a new ShaderFactory. Requires the nick of the effect and a callback function
// which will be called whenever a new shader is created. // which will be called whenever a new shader is created.
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect hides the actor by violently sucking it into the void of magic. // // This effect hides the actor by violently sucking it into the void of magic. //
@@ -32,7 +33,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// Store uniform locations of newly created shaders. // Store uniform locations of newly created shaders.
shader._uSeed = shader.get_uniform_location('uSeed'); shader._uSeed = shader.get_uniform_location('uSeed');
shader._uShake = shader.get_uniform_location('uShake'); shader._uShake = shader.get_uniform_location('uShake');
@@ -57,7 +58,7 @@ export default class Effect {
// The effect is not available on GNOME Shell 3.36 as it requires scaling of the window // The effect is not available on GNOME Shell 3.36 as it requires scaling of the window
// actor. // actor.
getMinShellVersion() { static getMinShellVersion() {
return [3, 38]; return [3, 38];
} }
@@ -65,13 +66,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'apparition'; return 'apparition';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Apparition'); return _('Apparition');
} }
@@ -79,7 +80,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('apparition-randomness'); dialog.bindAdjustment('apparition-randomness');
dialog.bindAdjustment('apparition-animation-time'); dialog.bindAdjustment('apparition-animation-time');
dialog.bindAdjustment('apparition-twirl-intensity'); dialog.bindAdjustment('apparition-twirl-intensity');
@@ -92,7 +93,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 2.0, y: 2.0}; return {x: 2.0, y: 2.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect shatters the window into pieces. For an explanation how this works, look // // This effect shatters the window into pieces. For an explanation how this works, look //
@@ -44,7 +45,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import these modules in this function as they are not available in the // We import these modules in this function as they are not available in the
// preferences process. This callback is only called within GNOME Shell's process. // preferences process. This callback is only called within GNOME Shell's process.
const {Clutter, GdkPixbuf, Cogl} = imports.gi; const {Clutter, GdkPixbuf, Cogl} = imports.gi;
@@ -115,7 +116,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// This effect is only available on GNOME Shell 40+. // This effect is only available on GNOME Shell 40+.
getMinShellVersion() { static getMinShellVersion() {
return [40, 0]; return [40, 0];
} }
@@ -124,13 +125,13 @@ export default class Effect {
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). Also, the shader file and the settings UI files should be // (e.g. '*-animation-time'). Also, the shader file and the settings UI files should be
// named likes this. // named likes this.
getNick() { static getNick() {
return 'broken-glass'; return 'broken-glass';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Broken Glass'); return _('Broken Glass');
} }
@@ -138,7 +139,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('broken-glass-animation-time'); dialog.bindAdjustment('broken-glass-animation-time');
dialog.bindAdjustment('broken-glass-scale'); dialog.bindAdjustment('broken-glass-scale');
dialog.bindAdjustment('broken-glass-gravity'); dialog.bindAdjustment('broken-glass-gravity');
@@ -151,7 +152,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 2.0, y: 2.0}; return {x: 2.0, y: 2.0};
} }
} }
+7 -6
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect melts your windows. Inspired by the legendary screen transitions of the // // This effect melts your windows. Inspired by the legendary screen transitions of the //
@@ -33,7 +34,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// Store uniform locations of newly created shaders. // Store uniform locations of newly created shaders.
shader._uActorScale = shader.get_uniform_location('uActorScale'); shader._uActorScale = shader.get_uniform_location('uActorScale');
shader._uHorizontalScale = shader.get_uniform_location('uHorizontalScale'); shader._uHorizontalScale = shader.get_uniform_location('uHorizontalScale');
@@ -65,7 +66,7 @@ export default class Effect {
// The effect is not available on GNOME Shell 3.36 as it requires scaling of the window // The effect is not available on GNOME Shell 3.36 as it requires scaling of the window
// actor. // actor.
getMinShellVersion() { static getMinShellVersion() {
return [3, 38]; return [3, 38];
} }
@@ -73,13 +74,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'doom'; return 'doom';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Doom'); return _('Doom');
} }
@@ -87,7 +88,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('doom-animation-time'); dialog.bindAdjustment('doom-animation-time');
dialog.bindAdjustment('doom-horizontal-scale'); dialog.bindAdjustment('doom-horizontal-scale');
dialog.bindAdjustment('doom-vertical-scale'); dialog.bindAdjustment('doom-vertical-scale');
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect looks a bit like the transporter effect from TOS. // // This effect looks a bit like the transporter effect from TOS. //
@@ -32,7 +33,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import Clutter in this function as it is not available in the preferences // We import Clutter in this function as it is not available in the preferences
// process. This creator function of the ShaderFactory is only called within GNOME // process. This creator function of the ShaderFactory is only called within GNOME
// Shell's process. // Shell's process.
@@ -57,7 +58,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -65,13 +66,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'energize-a'; return 'energize-a';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Energize A'); return _('Energize A');
} }
@@ -79,7 +80,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('energize-a-animation-time'); dialog.bindAdjustment('energize-a-animation-time');
dialog.bindAdjustment('energize-a-scale'); dialog.bindAdjustment('energize-a-scale');
dialog.bindColorButton('energize-a-color'); dialog.bindColorButton('energize-a-color');
@@ -90,7 +91,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect looks a bit like the transporter effect from TNG. // // This effect looks a bit like the transporter effect from TNG. //
@@ -32,7 +33,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import Clutter in this function as it is not available in the preferences // We import Clutter in this function as it is not available in the preferences
// process. This creator function of the ShaderFactory is only called within GNOME // process. This creator function of the ShaderFactory is only called within GNOME
// Shell's process. // Shell's process.
@@ -58,7 +59,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -66,13 +67,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'energize-b'; return 'energize-b';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Energize B'); return _('Energize B');
} }
@@ -80,7 +81,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('energize-b-animation-time'); dialog.bindAdjustment('energize-b-animation-time');
dialog.bindAdjustment('energize-b-scale'); dialog.bindAdjustment('energize-b-scale');
dialog.bindColorButton('energize-b-color'); dialog.bindColorButton('energize-b-color');
@@ -91,7 +92,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -18,7 +18,8 @@ import Gio from 'gi://Gio';
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect is a homage to the good old Compiz days. However, it is implemented // // This effect is a homage to the good old Compiz days. However, it is implemented //
@@ -38,7 +39,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import Clutter in this function as it is not available in the preferences // We import Clutter in this function as it is not available in the preferences
// process. This creator function of the ShaderFactory is only called within GNOME // process. This creator function of the ShaderFactory is only called within GNOME
// Shell's process. // Shell's process.
@@ -78,7 +79,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -86,13 +87,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'fire'; return 'fire';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Fire'); return _('Fire');
} }
@@ -100,7 +101,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
// Bind all properties. // Bind all properties.
dialog.bindAdjustment('fire-animation-time'); dialog.bindAdjustment('fire-animation-time');
@@ -136,7 +137,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This very simple effect fades the window to transparency with subtle 3D effects. // // This very simple effect fades the window to transparency with subtle 3D effects. //
@@ -32,7 +33,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// Store uniform locations of newly created shaders. // Store uniform locations of newly created shaders.
shader._uScale = shader.get_uniform_location('uScale'); shader._uScale = shader.get_uniform_location('uScale');
shader._uSquish = shader.get_uniform_location('uSquish'); shader._uSquish = shader.get_uniform_location('uSquish');
@@ -55,7 +56,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -63,13 +64,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'glide'; return 'glide';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Glide'); return _('Glide');
} }
@@ -77,7 +78,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('glide-animation-time'); dialog.bindAdjustment('glide-animation-time');
dialog.bindAdjustment('glide-scale'); dialog.bindAdjustment('glide-scale');
dialog.bindAdjustment('glide-squish'); dialog.bindAdjustment('glide-squish');
@@ -90,7 +91,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect applies some intentional graphics issues to your windows. // // This effect applies some intentional graphics issues to your windows. //
@@ -32,7 +33,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import Clutter in this function as it is not available in the preferences // We import Clutter in this function as it is not available in the preferences
// process. This creator function of the ShaderFactory is only called within GNOME // process. This creator function of the ShaderFactory is only called within GNOME
// Shell's process. // Shell's process.
@@ -63,7 +64,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -71,13 +72,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'glitch'; return 'glitch';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Glitch'); return _('Glitch');
} }
@@ -85,7 +86,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('glitch-animation-time'); dialog.bindAdjustment('glitch-animation-time');
dialog.bindAdjustment('glitch-scale'); dialog.bindAdjustment('glitch-scale');
dialog.bindAdjustment('glitch-speed'); dialog.bindAdjustment('glitch-speed');
@@ -98,7 +99,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect overlays a glowing hexagonal grid over the window. The grid cells then // // This effect overlays a glowing hexagonal grid over the window. The grid cells then //
@@ -33,7 +34,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import Clutter in this function as it is not available in the preferences // We import Clutter in this function as it is not available in the preferences
// process. This creator function of the ShaderFactory is only called within GNOME // process. This creator function of the ShaderFactory is only called within GNOME
// Shell's process. // Shell's process.
@@ -71,7 +72,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -79,13 +80,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'hexagon'; return 'hexagon';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Hexagon'); return _('Hexagon');
} }
@@ -93,7 +94,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('hexagon-animation-time'); dialog.bindAdjustment('hexagon-animation-time');
dialog.bindAdjustment('hexagon-scale'); dialog.bindAdjustment('hexagon-scale');
dialog.bindAdjustment('hexagon-line-width'); dialog.bindAdjustment('hexagon-line-width');
@@ -107,7 +108,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect burns windows to ashes. The fire starts at a random position at the // // This effect burns windows to ashes. The fire starts at a random position at the //
@@ -33,7 +34,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import these modules in this function as they are not available in the // We import these modules in this function as they are not available in the
// preferences process. This callback is only called within GNOME Shell's process. // preferences process. This callback is only called within GNOME Shell's process.
const {Clutter} = imports.gi; const {Clutter} = imports.gi;
@@ -108,7 +109,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// This effect is available on all supported GNOME Shell versions. // This effect is available on all supported GNOME Shell versions.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -116,13 +117,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'incinerate'; return 'incinerate';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Incinerate'); return _('Incinerate');
} }
@@ -130,7 +131,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('incinerate-animation-time'); dialog.bindAdjustment('incinerate-animation-time');
dialog.bindAdjustment('incinerate-scale'); dialog.bindAdjustment('incinerate-scale');
dialog.bindAdjustment('incinerate-turbulence'); dialog.bindAdjustment('incinerate-turbulence');
@@ -143,7 +144,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// The Matrix shader multiplies a grid of random letters with some gradients which are // // The Matrix shader multiplies a grid of random letters with some gradients which are //
@@ -36,7 +37,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import these modules in this function as they are not available in the // We import these modules in this function as they are not available in the
// preferences process. This callback is only called within GNOME Shell's process. // preferences process. This callback is only called within GNOME Shell's process.
const {Clutter, GdkPixbuf, Cogl} = imports.gi; const {Clutter, GdkPixbuf, Cogl} = imports.gi;
@@ -91,7 +92,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// This effect is only available on GNOME Shell 40+. // This effect is only available on GNOME Shell 40+.
getMinShellVersion() { static getMinShellVersion() {
return [40, 0]; return [40, 0];
} }
@@ -99,13 +100,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'matrix'; return 'matrix';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Matrix'); return _('Matrix');
} }
@@ -113,7 +114,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('matrix-animation-time'); dialog.bindAdjustment('matrix-animation-time');
dialog.bindAdjustment('matrix-scale'); dialog.bindAdjustment('matrix-scale');
dialog.bindAdjustment('matrix-randomness'); dialog.bindAdjustment('matrix-randomness');
@@ -127,7 +128,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0 + settings.get_double('matrix-overshoot')}; return {x: 1.0, y: 1.0 + settings.get_double('matrix-overshoot')};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect paints your windows with a thick paint brush. // // This effect paints your windows with a thick paint brush. //
@@ -34,7 +35,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import these modules in this function as they are not available in the // We import these modules in this function as they are not available in the
// preferences process. This callback is only called within GNOME Shell's process. // preferences process. This callback is only called within GNOME Shell's process.
const {Clutter, GdkPixbuf, Cogl} = imports.gi; const {Clutter, GdkPixbuf, Cogl} = imports.gi;
@@ -79,7 +80,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// This effect is only available on GNOME Shell 40+. // This effect is only available on GNOME Shell 40+.
getMinShellVersion() { static getMinShellVersion() {
return [40, 0]; return [40, 0];
} }
@@ -87,13 +88,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'paint-brush'; return 'paint-brush';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Paint Brush'); return _('Paint Brush');
} }
@@ -101,7 +102,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('paint-brush-animation-time'); dialog.bindAdjustment('paint-brush-animation-time');
dialog.bindAdjustment('paint-brush-size'); dialog.bindAdjustment('paint-brush-size');
} }
@@ -111,7 +112,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This simple effect pixelates the window texture and hides the pixels in a wheel-like // // This simple effect pixelates the window texture and hides the pixels in a wheel-like //
@@ -33,7 +34,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// Store uniform locations of newly created shaders. // Store uniform locations of newly created shaders.
shader._uPixelSize = shader.get_uniform_location('uPixelSize'); shader._uPixelSize = shader.get_uniform_location('uPixelSize');
shader._uSpokeCount = shader.get_uniform_location('uSpokeCount'); shader._uSpokeCount = shader.get_uniform_location('uSpokeCount');
@@ -51,7 +52,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -59,13 +60,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'pixel-wheel'; return 'pixel-wheel';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Pixel Wheel'); return _('Pixel Wheel');
} }
@@ -73,7 +74,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('pixel-wheel-animation-time'); dialog.bindAdjustment('pixel-wheel-animation-time');
dialog.bindAdjustment('pixel-wheel-pixel-size'); dialog.bindAdjustment('pixel-wheel-pixel-size');
dialog.bindAdjustment('pixel-wheel-spoke-count'); dialog.bindAdjustment('pixel-wheel-spoke-count');
@@ -84,7 +85,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect pixelates the window texture and hides the pixels radially, starting // // This effect pixelates the window texture and hides the pixels radially, starting //
@@ -33,7 +34,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// Store uniform locations of newly created shaders. // Store uniform locations of newly created shaders.
shader._uPixelSize = shader.get_uniform_location('uPixelSize'); shader._uPixelSize = shader.get_uniform_location('uPixelSize');
shader._uStartPos = shader.get_uniform_location('uStartPos'); shader._uStartPos = shader.get_uniform_location('uStartPos');
@@ -78,7 +79,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -86,13 +87,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'pixel-wipe'; return 'pixel-wipe';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Pixel Wipe'); return _('Pixel Wipe');
} }
@@ -100,7 +101,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('pixel-wipe-animation-time'); dialog.bindAdjustment('pixel-wipe-animation-time');
dialog.bindAdjustment('pixel-wipe-pixel-size'); dialog.bindAdjustment('pixel-wipe-pixel-size');
} }
@@ -110,7 +111,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This very simple effect pixelates the window texture and randomly hides pixels until // // This very simple effect pixelates the window texture and randomly hides pixels until //
@@ -33,7 +34,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// Store uniform locations of newly created shaders. // Store uniform locations of newly created shaders.
shader._uNoise = shader.get_uniform_location('uNoise'); shader._uNoise = shader.get_uniform_location('uNoise');
shader._uPixelSize = shader.get_uniform_location('uPixelSize'); shader._uPixelSize = shader.get_uniform_location('uPixelSize');
@@ -51,7 +52,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -59,13 +60,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'pixelate'; return 'pixelate';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Pixelate'); return _('Pixelate');
} }
@@ -73,7 +74,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('pixelate-animation-time'); dialog.bindAdjustment('pixelate-animation-time');
dialog.bindAdjustment('pixelate-noise'); dialog.bindAdjustment('pixelate-noise');
dialog.bindAdjustment('pixelate-pixel-size'); dialog.bindAdjustment('pixelate-pixel-size');
@@ -84,7 +85,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This ridiculous effect teleports your windows from and to alternative dimensions. // // This ridiculous effect teleports your windows from and to alternative dimensions. //
@@ -33,7 +34,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import Clutter in this function as it is not available in the preferences // We import Clutter in this function as it is not available in the preferences
// process. This creator function of the ShaderFactory is only called within GNOME // process. This creator function of the ShaderFactory is only called within GNOME
// Shell's process. // Shell's process.
@@ -65,7 +66,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -73,13 +74,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'portal'; return 'portal';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Portal'); return _('Portal');
} }
@@ -87,7 +88,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('portal-animation-time'); dialog.bindAdjustment('portal-animation-time');
dialog.bindAdjustment('portal-rotation-speed'); dialog.bindAdjustment('portal-rotation-speed');
dialog.bindAdjustment('portal-whirling'); dialog.bindAdjustment('portal-whirling');
@@ -100,7 +101,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effects dissolves your windows into a cloud of dust. For this, it uses an // // This effects dissolves your windows into a cloud of dust. For this, it uses an //
@@ -38,7 +39,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import these modules in this function as they are not available in the // We import these modules in this function as they are not available in the
// preferences process. This callback is only called within GNOME Shell's process. // preferences process. This callback is only called within GNOME Shell's process.
const {Clutter, GdkPixbuf, Cogl} = imports.gi; const {Clutter, GdkPixbuf, Cogl} = imports.gi;
@@ -91,7 +92,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// This effect is only available on GNOME Shell 40+. // This effect is only available on GNOME Shell 40+.
getMinShellVersion() { static getMinShellVersion() {
return [40, 0]; return [40, 0];
} }
@@ -99,13 +100,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'snap'; return 'snap';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Snap of Disintegration'); return _('Snap of Disintegration');
} }
@@ -113,7 +114,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('snap-animation-time'); dialog.bindAdjustment('snap-animation-time');
dialog.bindAdjustment('snap-scale'); dialog.bindAdjustment('snap-scale');
dialog.bindColorButton('snap-color'); dialog.bindColorButton('snap-color');
@@ -124,7 +125,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.2, y: 1.2}; return {x: 1.2, y: 1.2};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect tears your windows apart with a series of violent scratches! // // This effect tears your windows apart with a series of violent scratches! //
@@ -34,7 +35,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import these modules in this function as they are not available in the // We import these modules in this function as they are not available in the
// preferences process. This callback is only called within GNOME Shell's process. // preferences process. This callback is only called within GNOME Shell's process.
const {Clutter, GdkPixbuf, Cogl} = imports.gi; const {Clutter, GdkPixbuf, Cogl} = imports.gi;
@@ -89,7 +90,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// This effect is only available on GNOME Shell 40+. // This effect is only available on GNOME Shell 40+.
getMinShellVersion() { static getMinShellVersion() {
return [40, 0]; return [40, 0];
} }
@@ -97,13 +98,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'trex'; return 'trex';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('T-Rex Attack'); return _('T-Rex Attack');
} }
@@ -111,7 +112,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('trex-animation-time'); dialog.bindAdjustment('trex-animation-time');
dialog.bindColorButton('trex-scratch-color'); dialog.bindColorButton('trex-scratch-color');
dialog.bindAdjustment('trex-scratch-scale'); dialog.bindAdjustment('trex-scratch-scale');
@@ -124,7 +125,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
const scale = 1.0 + 0.5 * settings.get_double('trex-scratch-warp'); const scale = 1.0 + 0.5 * settings.get_double('trex-scratch-warp');
return {x: scale, y: scale}; return {x: scale, y: scale};
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect hides the actor by making it first transparent from top and bottom // // This effect hides the actor by making it first transparent from top and bottom //
@@ -34,7 +35,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import Clutter in this function as it is not available in the preferences // We import Clutter in this function as it is not available in the preferences
// process. This creator function of the ShaderFactory is only called within GNOME // process. This creator function of the ShaderFactory is only called within GNOME
// Shell's process. // Shell's process.
@@ -55,7 +56,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -63,13 +64,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time // effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'tv'; return 'tv';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('TV Effect'); return _('TV Effect');
} }
@@ -77,7 +78,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('tv-animation-time'); dialog.bindAdjustment('tv-animation-time');
dialog.bindColorButton('tv-effect-color'); dialog.bindColorButton('tv-effect-color');
} }
@@ -87,7 +88,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect combines the Glitch and the TV Effect. Credits go to Kurt Wilson // // This effect combines the Glitch and the TV Effect. Credits go to Kurt Wilson //
@@ -33,7 +34,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import Clutter in this function as it is not available in the preferences // We import Clutter in this function as it is not available in the preferences
// process. This creator function of the ShaderFactory is only called within GNOME // process. This creator function of the ShaderFactory is only called within GNOME
// Shell's process. // Shell's process.
@@ -64,7 +65,7 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
@@ -72,13 +73,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-close-effect'), and its animation time // effect is enabled currently (e.g. '*-close-effect'), and its animation time
// (e.g. '*-animation-time'). // (e.g. '*-animation-time').
getNick() { static getNick() {
return 'tv-glitch'; return 'tv-glitch';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('TV Glitch'); return _('TV Glitch');
} }
@@ -86,7 +87,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('tv-glitch-animation-time'); dialog.bindAdjustment('tv-glitch-animation-time');
dialog.bindAdjustment('tv-glitch-scale'); dialog.bindAdjustment('tv-glitch-scale');
dialog.bindAdjustment('tv-glitch-speed'); dialog.bindAdjustment('tv-glitch-speed');
@@ -99,7 +100,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }
+8 -7
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext; const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js'; const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This effect lets your windows be carried to the realm of dreams by some little // // This effect lets your windows be carried to the realm of dreams by some little //
@@ -33,7 +34,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each // GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance. // newly created shader instance.
constructor() { constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// We import Clutter in this function as it is not available in the preferences // We import Clutter in this function as it is not available in the preferences
// process. This creator function of the ShaderFactory is only called within GNOME // process. This creator function of the ShaderFactory is only called within GNOME
// Shell's process. // Shell's process.
@@ -67,20 +68,20 @@ export default class Effect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension. // The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() { static getMinShellVersion() {
return [3, 36]; return [3, 36];
} }
// This will be called in various places where a unique identifier for this effect is // This will be called in various places where a unique identifier for this effect is
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. the '*-enable-effect'). // effect is enabled currently (e.g. the '*-enable-effect').
getNick() { static getNick() {
return 'wisps'; return 'wisps';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect. // drop-down menus where the user can choose the effect.
getLabel() { static getLabel() {
return _('Wisps'); return _('Wisps');
} }
@@ -88,7 +89,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It // This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile. // binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) { static bindPreferences(dialog) {
dialog.bindAdjustment('wisps-animation-time'); dialog.bindAdjustment('wisps-animation-time');
dialog.bindAdjustment('wisps-scale'); dialog.bindAdjustment('wisps-scale');
dialog.bindColorButton('wisps-color-1'); dialog.bindColorButton('wisps-color-1');
@@ -113,7 +114,7 @@ export default class Effect {
// The getActorScale() is called from extension.js to adjust the actor's size during the // The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual // animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+. // bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) { static getActorScale(settings) {
return {x: 1.0, y: 1.0}; return {x: 1.0, y: 1.0};
} }
} }