Skip to content

Commit

Permalink
i had to install the clang-formatter tool
Browse files Browse the repository at this point in the history
hint: sudo apt install clang-format
-- for other people who might need the hint
  • Loading branch information
jgarza9788 committed Oct 26, 2024
1 parent b7434c0 commit 0aee70c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 58 deletions.
28 changes: 7 additions & 21 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,13 @@ export default class BurnMyWindows extends Extension {

// New effects must be registered here and in prefs.js.
this._ALL_EFFECTS = [
new Apparition(),
new BrokenGlass(),
new Doom(),
new EnergizeA(),
new EnergizeB(),
new Fire(),
new Focus(),
new Glide(),
new Glitch(),
new Hexagon(),
new Incinerate(),
new Matrix(),
new PaintBrush(),
new Pixelate(),
new PixelWheel(),
new PixelWipe(),
new Portal(),
new SnapOfDisintegration(),
new TRexAttack(),
new TVEffect(),
new TVGlitch(),
new Apparition(), new BrokenGlass(), new Doom(),
new EnergizeA(), new EnergizeB(), new Fire(),
new Focus(), new Glide(), new Glitch(),
new Hexagon(), new Incinerate(), new Matrix(),
new PaintBrush(), new Pixelate(), new PixelWheel(),
new PixelWipe(), new Portal(), new SnapOfDisintegration(),
new TRexAttack(), new TVEffect(), new TVGlitch(),
new Wisps(),
];

Expand Down
34 changes: 8 additions & 26 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,13 @@ export default class BurnMyWindowsPreferences extends ExtensionPreferences {

// New effects must be registered here and in extension.js.
this._ALL_EFFECTS = [
Apparition,
BrokenGlass,
Doom,
EnergizeA,
EnergizeB,
Fire,
Focus,
Glide,
Glitch,
Hexagon,
Incinerate,
Matrix,
PaintBrush,
Pixelate,
PixelWheel,
PixelWipe,
Portal,
SnapOfDisintegration,
TRexAttack,
TVEffect,
TVGlitch,
Wisps,
Apparition, BrokenGlass, Doom, EnergizeA, EnergizeB, Fire,
Focus, Glide, Glitch, Hexagon, Incinerate, Matrix,
PaintBrush, Pixelate, PixelWheel, PixelWipe, Portal, SnapOfDisintegration,
TRexAttack, TVEffect, TVGlitch, Wisps,
];


// Load all of our resources.
this._resources =
Gio.Resource.load(this.path + '/resources/burn-my-windows.gresource');
Expand Down Expand Up @@ -179,7 +161,7 @@ export default class BurnMyWindowsPreferences extends ExtensionPreferences {
}
});


// This is our top-level widget which we will return later.
this._widget = this._builder.get_object('general-prefs');

Expand Down Expand Up @@ -281,7 +263,7 @@ export default class BurnMyWindowsPreferences extends ExtensionPreferences {
}
});


// Some things can only be done once the widget is shown as we do not have access to
// the toplevel widget before.
this._widget.connect('realize', (widget) => {
Expand Down Expand Up @@ -429,7 +411,7 @@ GitHub: <a href='https://github.com/sponsors/schneegans'>https://github.com/spon
this._settings.set_int('last-prefs-version', this.metadata.version)
});
group.add_action(changelogAction);

// Add the about dialog.
const aboutAction = Gio.SimpleAction.new('about', null);
aboutAction.connect('activate', () => {
Expand Down
22 changes: 11 additions & 11 deletions src/effects/Focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// SPDX-FileCopyrightText: Justin Garza JGarza9788@gmail.com
// SPDX-License-Identifier: GPL-3.0-or-later

"use strict";
'use strict';

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');

const _ = await utils.importGettext();

Expand All @@ -39,17 +39,17 @@ export default class Effect {
constructor() {
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// Store uniform locations of newly created shaders.
shader._uBlurAmount = shader.get_uniform_location("uBlurAmount");
shader._uBlurQuality = shader.get_uniform_location("uBlurQuality");
shader._uBlurAmount = shader.get_uniform_location('uBlurAmount');
shader._uBlurQuality = shader.get_uniform_location('uBlurQuality');

// Write all uniform values at the start of each animation.
shader.connect("begin-animation", (shader, settings) => {
shader.connect('begin-animation', (shader, settings) => {
shader.set_uniform_float(shader._uBlurAmount, 1, [
settings.get_int("focus-blur-ammout"),
settings.get_int('focus-blur-ammout'),
]);

shader.set_uniform_float(shader._uBlurQuality, 1, [
settings.get_int("focus-blur-quality"),
settings.get_int('focus-blur-quality'),
]);
});
});
Expand All @@ -68,13 +68,13 @@ export default class Effect {
// (e.g. '*-animation-time'). Also, the shader file and the settings UI files should be
// named likes this.
static getNick() {
return "focus";
return 'focus';
}

// 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.
static getLabel() {
return _("Focus");
return _('Focus');
}

// -------------------------------------------------------------------- API for prefs.js
Expand All @@ -95,6 +95,6 @@ export default class Effect {
// animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+.
static getActorScale(settings, forOpening, actor) {
return { x: 1.0, y: 1.0 };
return {x: 1.0, y: 1.0};
}
}

0 comments on commit 0aee70c

Please sign in to comment.