♻️ Use more dynamic imports
This commit is contained in:
@@ -169,6 +169,9 @@ const _ = imports.gettext.domain("burn-my-windows").gettext;
|
|||||||
|
|
||||||
import * as utils from "../utils.js";
|
import * as utils from "../utils.js";
|
||||||
|
|
||||||
|
// We import the ShaderFactory only in the Shell process as it is not required in the
|
||||||
|
// preferences process. The preferences process does not create any shader instances, it
|
||||||
|
// only uses the static metadata of the effect.
|
||||||
const ShaderFactory = await utils.importInShellOnly("./ShaderFactory.js");
|
const ShaderFactory = await utils.importInShellOnly("./ShaderFactory.js");
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import the ShaderFactory only in the Shell process as it is not required in the
|
||||||
|
// preferences process. The preferences process does not create any shader instances, it
|
||||||
|
// only uses the static metadata of the effect.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -18,7 +18,13 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
|
||||||
|
const Cogl = await utils.importInShellOnly('gi://Cogl');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// 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 //
|
||||||
@@ -47,10 +53,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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.
|
|
||||||
const {Clutter, GdkPixbuf, Cogl} = imports.gi;
|
|
||||||
|
|
||||||
// Create the texture in the first call.
|
// Create the texture in the first call.
|
||||||
if (!this._shardTexture) {
|
if (!this._shardTexture) {
|
||||||
const shardData = GdkPixbuf.Pixbuf.new_from_resource('/img/shards.png');
|
const shardData = GdkPixbuf.Pixbuf.new_from_resource('/img/shards.png');
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import the ShaderFactory only in the Shell process as it is not required in the
|
||||||
|
// preferences process. The preferences process does not create any shader instances, it
|
||||||
|
// only uses the static metadata of the effect.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// This effect looks a bit like the transporter effect from TOS. //
|
// This effect looks a bit like the transporter effect from TOS. //
|
||||||
@@ -35,11 +39,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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
|
|
||||||
// Shell's process.
|
|
||||||
const Clutter = imports.gi.Clutter;
|
|
||||||
|
|
||||||
// Store uniform locations of newly created shaders.
|
// Store uniform locations of newly created shaders.
|
||||||
shader._uColor = shader.get_uniform_location('uColor');
|
shader._uColor = shader.get_uniform_location('uColor');
|
||||||
shader._uScale = shader.get_uniform_location('uScale');
|
shader._uScale = shader.get_uniform_location('uScale');
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// This effect looks a bit like the transporter effect from TNG. //
|
// This effect looks a bit like the transporter effect from TNG. //
|
||||||
@@ -35,11 +39,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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
|
|
||||||
// Shell's process.
|
|
||||||
const Clutter = imports.gi.Clutter;
|
|
||||||
|
|
||||||
// Store uniform locations of newly created shaders.
|
// Store uniform locations of newly created shaders.
|
||||||
shader._uColor = shader.get_uniform_location('uColor');
|
shader._uColor = shader.get_uniform_location('uColor');
|
||||||
shader._uScale = shader.get_uniform_location('uScale');
|
shader._uScale = shader.get_uniform_location('uScale');
|
||||||
|
|||||||
+4
-5
@@ -20,7 +20,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// 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 //
|
||||||
@@ -41,11 +45,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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
|
|
||||||
// Shell's process.
|
|
||||||
const Clutter = imports.gi.Clutter;
|
|
||||||
|
|
||||||
// Store all uniform locations.
|
// Store all uniform locations.
|
||||||
shader._uGradient = [
|
shader._uGradient = [
|
||||||
shader.get_uniform_location('uGradient1'),
|
shader.get_uniform_location('uGradient1'),
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import the ShaderFactory only in the Shell process as it is not required in the
|
||||||
|
// preferences process. The preferences process does not create any shader instances, it
|
||||||
|
// only uses the static metadata of the effect.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// This effect applies some intentional graphics issues to your windows. //
|
// This effect applies some intentional graphics issues to your windows. //
|
||||||
@@ -35,11 +39,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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
|
|
||||||
// Shell's process.
|
|
||||||
const Clutter = imports.gi.Clutter;
|
|
||||||
|
|
||||||
// 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._uColor = shader.get_uniform_location('uColor');
|
shader._uColor = shader.get_uniform_location('uColor');
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// 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 //
|
||||||
@@ -36,11 +40,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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
|
|
||||||
// Shell's process.
|
|
||||||
const Clutter = imports.gi.Clutter;
|
|
||||||
|
|
||||||
// Store uniform locations of newly created shaders.
|
// Store uniform locations of newly created shaders.
|
||||||
shader._uAdditiveBlending = shader.get_uniform_location('uAdditiveBlending');
|
shader._uAdditiveBlending = shader.get_uniform_location('uAdditiveBlending');
|
||||||
shader._uSeed = shader.get_uniform_location('uSeed');
|
shader._uSeed = shader.get_uniform_location('uSeed');
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// 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 //
|
||||||
@@ -36,10 +40,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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.
|
|
||||||
const {Clutter} = imports.gi;
|
|
||||||
|
|
||||||
// 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._uColor = shader.get_uniform_location('uColor');
|
shader._uColor = shader.get_uniform_location('uColor');
|
||||||
|
|||||||
@@ -18,7 +18,13 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
|
||||||
|
const Cogl = await utils.importInShellOnly('gi://Cogl');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// 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 //
|
||||||
@@ -39,10 +45,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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.
|
|
||||||
const {Clutter, GdkPixbuf, Cogl} = imports.gi;
|
|
||||||
|
|
||||||
// Create the texture in the first call.
|
// Create the texture in the first call.
|
||||||
if (!this._fontTexture) {
|
if (!this._fontTexture) {
|
||||||
const fontData = GdkPixbuf.Pixbuf.new_from_resource('/img/matrixFont.png');
|
const fontData = GdkPixbuf.Pixbuf.new_from_resource('/img/matrixFont.png');
|
||||||
|
|||||||
@@ -18,7 +18,13 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
|
||||||
|
const Cogl = await utils.importInShellOnly('gi://Cogl');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// This effect paints your windows with a thick paint brush. //
|
// This effect paints your windows with a thick paint brush. //
|
||||||
@@ -37,10 +43,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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.
|
|
||||||
const {Clutter, GdkPixbuf, Cogl} = imports.gi;
|
|
||||||
|
|
||||||
// Create the texture in the first call.
|
// Create the texture in the first call.
|
||||||
if (!this._brushTexture) {
|
if (!this._brushTexture) {
|
||||||
const brushData = GdkPixbuf.Pixbuf.new_from_resource('/img/brush.png');
|
const brushData = GdkPixbuf.Pixbuf.new_from_resource('/img/brush.png');
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import the ShaderFactory only in the Shell process as it is not required in the
|
||||||
|
// preferences process. The preferences process does not create any shader instances, it
|
||||||
|
// only uses the static metadata of the effect.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import the ShaderFactory only in the Shell process as it is not required in the
|
||||||
|
// preferences process. The preferences process does not create any shader instances, it
|
||||||
|
// only uses the static metadata of the effect.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import the ShaderFactory only in the Shell process as it is not required in the
|
||||||
|
// preferences process. The preferences process does not create any shader instances, it
|
||||||
|
// only uses the static metadata of the effect.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// This ridiculous effect teleports your windows from and to alternative dimensions. //
|
// This ridiculous effect teleports your windows from and to alternative dimensions. //
|
||||||
@@ -36,11 +40,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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
|
|
||||||
// Shell's process.
|
|
||||||
const Clutter = imports.gi.Clutter;
|
|
||||||
|
|
||||||
// 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._uColor = shader.get_uniform_location('uColor');
|
shader._uColor = shader.get_uniform_location('uColor');
|
||||||
|
|||||||
@@ -18,7 +18,13 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
|
||||||
|
const Cogl = await utils.importInShellOnly('gi://Cogl');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// 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 //
|
||||||
@@ -41,10 +47,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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.
|
|
||||||
const {Clutter, GdkPixbuf, Cogl} = imports.gi;
|
|
||||||
|
|
||||||
// Create the texture in the first call.
|
// Create the texture in the first call.
|
||||||
if (!this._dustTexture) {
|
if (!this._dustTexture) {
|
||||||
const dustData = GdkPixbuf.Pixbuf.new_from_resource('/img/dust.png');
|
const dustData = GdkPixbuf.Pixbuf.new_from_resource('/img/dust.png');
|
||||||
|
|||||||
@@ -18,7 +18,13 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
|
||||||
|
const Cogl = await utils.importInShellOnly('gi://Cogl');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// This effect tears your windows apart with a series of violent scratches! //
|
// This effect tears your windows apart with a series of violent scratches! //
|
||||||
@@ -37,10 +43,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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.
|
|
||||||
const {Clutter, GdkPixbuf, Cogl} = imports.gi;
|
|
||||||
|
|
||||||
// Create the texture in the first call.
|
// Create the texture in the first call.
|
||||||
if (!this._clawTexture) {
|
if (!this._clawTexture) {
|
||||||
const clawData = GdkPixbuf.Pixbuf.new_from_resource('/img/claws.png');
|
const clawData = GdkPixbuf.Pixbuf.new_from_resource('/img/claws.png');
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// 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 //
|
||||||
@@ -37,11 +41,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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
|
|
||||||
// Shell's process.
|
|
||||||
const Clutter = imports.gi.Clutter;
|
|
||||||
|
|
||||||
// Store uniform locations of newly created shaders.
|
// Store uniform locations of newly created shaders.
|
||||||
shader._uColor = shader.get_uniform_location('uColor');
|
shader._uColor = shader.get_uniform_location('uColor');
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// 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 //
|
||||||
@@ -36,11 +40,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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
|
|
||||||
// Shell's process.
|
|
||||||
const Clutter = imports.gi.Clutter;
|
|
||||||
|
|
||||||
// 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._uColor = shader.get_uniform_location('uColor');
|
shader._uColor = shader.get_uniform_location('uColor');
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext;
|
|||||||
|
|
||||||
import * as utils from '../utils.js';
|
import * as utils from '../utils.js';
|
||||||
|
|
||||||
|
// We import some modules only in the Shell process as they are not available in the
|
||||||
|
// preferences process. They are used only in the creator function of the ShaderFactory
|
||||||
|
// which is only called within GNOME Shell's process.
|
||||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||||
|
const Clutter = await utils.importInShellOnly('gi://Clutter');
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// 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 //
|
||||||
@@ -36,11 +40,6 @@ export default class Effect {
|
|||||||
// newly created shader instance.
|
// newly created shader instance.
|
||||||
constructor() {
|
constructor() {
|
||||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||||
// 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
|
|
||||||
// Shell's process.
|
|
||||||
const Clutter = imports.gi.Clutter;
|
|
||||||
|
|
||||||
// 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._uScale = shader.get_uniform_location('uScale');
|
shader._uScale = shader.get_uniform_location('uScale');
|
||||||
|
|||||||
Reference in New Issue
Block a user