From 87281c89df2f25122f522ec83ff39984e3d1e09d Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Thu, 22 Dec 2022 20:33:27 +0100 Subject: [PATCH] :tada: Add initial KWin version of the portal effect --- kwin/build.sh | 1 + kwin/portal/config.ui | 77 ++++++++++++++++++++++++++++++++ kwin/portal/main.xml | 29 ++++++++++++ kwin/portal/onAnimationBegin.js | 7 +++ kwin/portal/onSettingsChanged.js | 12 +++++ 5 files changed, 126 insertions(+) create mode 100755 kwin/portal/config.ui create mode 100755 kwin/portal/main.xml create mode 100644 kwin/portal/onAnimationBegin.js create mode 100644 kwin/portal/onSettingsChanged.js diff --git a/kwin/build.sh b/kwin/build.sh index e6b37d5..1916e8b 100755 --- a/kwin/build.sh +++ b/kwin/build.sh @@ -138,6 +138,7 @@ generate "incinerate" "Incinerate [Burn-My-Windows]" "A less snappy but defini generate "pixelate" "Pixelate [Burn-My-Windows]" "Pixelate the window and randomly hide the pixels" generate "pixel-wheel" "Pixel Wheel [Burn-My-Windows]" "Pixelate the window and hide the pixels in a wheel-like fashion" generate "pixel-wipe" "Pixel Wipe [Burn-My-Windows]" "Pixelate the window and hide the pixels radially, starting from the pointer position" +generate "portal" "Portal [Burn-My-Windows]" "Transfer your windows to other locations in space and time" generate "tv" "TV Effect [Burn-My-Windows]" "Make windows close like turning off a TV" generate "wisps" "Wisps [Burn-My-Windows]" "Let your windows be carried away to the realm of dreams by these little fairies" diff --git a/kwin/portal/config.ui b/kwin/portal/config.ui new file mode 100755 index 0000000..f1e7281 --- /dev/null +++ b/kwin/portal/config.ui @@ -0,0 +1,77 @@ + + + + + + BMWConfigForm + + + + 0 + 0 + 562 + 365 + + + + + + + Duration: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Color: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + kcfg_Color + + + + + + + true + + + + + + + milliseconds + + + 100 + + + 9999 + + + 100 + + + + + + + + KColorButton + QPushButton +
kcolorbutton.h
+
+
+ + +
\ No newline at end of file diff --git a/kwin/portal/main.xml b/kwin/portal/main.xml new file mode 100755 index 0000000..6704128 --- /dev/null +++ b/kwin/portal/main.xml @@ -0,0 +1,29 @@ + + + + + + + + + 1500 + + + #79E918 + + + 15.0 + + + 0.3 + + + 1.0 + + + \ No newline at end of file diff --git a/kwin/portal/onAnimationBegin.js b/kwin/portal/onAnimationBegin.js new file mode 100644 index 0000000..dd56436 --- /dev/null +++ b/kwin/portal/onAnimationBegin.js @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: Simon Schneegans +// SPDX-License-Identifier: GPL-3.0-or-later + +// This part is automatically included in the effect's source during the build process. +// The code below is called whenever a window is closed or opened. + +effect.setUniform(this.shader, 'uSeed', [Math.random(), Math.random()]); diff --git a/kwin/portal/onSettingsChanged.js b/kwin/portal/onSettingsChanged.js new file mode 100644 index 0000000..bcfb6be --- /dev/null +++ b/kwin/portal/onSettingsChanged.js @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: Simon Schneegans +// SPDX-License-Identifier: GPL-3.0-or-later + +// This part is automatically included in the effect's source during the build process. +// The code below is called whenever the user changes something in the configuration of +// the effect. + +effect.setUniform(this.shader, 'uDuration', this.duration * 0.001); +effect.setUniform(this.shader, 'uColor', this.readRGBConfig('Color')); +effect.setUniform(this.shader, 'uDetails', this.readConfig('Details', 1.0)); +effect.setUniform(this.shader, 'uRotationSpeed', this.readConfig('RotationSpeed', 1.0)); +effect.setUniform(this.shader, 'uWhirl', this.readConfig('Whirl', 1.0)); \ No newline at end of file