effects: Remove Desktop Cube effect

With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
icc-effect-5.26.4
Vlad Zahorodnii 2021-05-31 13:48:20 +03:00
parent 3722c21660
commit 47ef0b5a3c
34 changed files with 0 additions and 3368 deletions

View File

@ -73,7 +73,6 @@ void TestBuiltInEffectLoader::testHasEffect_data()
QTest::newRow("case sensitive") << QStringLiteral("BlUR") << true;
QTest::newRow("Colorpicker") << QStringLiteral("colorpicker") << true;
QTest::newRow("Contrast") << QStringLiteral("contrast") << true;
QTest::newRow("Cube") << QStringLiteral("cube") << true;
QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << true;
QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << true;
QTest::newRow("DimInactive") << QStringLiteral("diminactive") << true;
@ -125,7 +124,6 @@ void TestBuiltInEffectLoader::testKnownEffects()
expectedEffects << QStringLiteral("blur")
<< QStringLiteral("colorpicker")
<< QStringLiteral("contrast")
<< QStringLiteral("cube")
<< QStringLiteral("cubeslide")
<< QStringLiteral("desktopgrid")
<< QStringLiteral("diminactive")
@ -185,8 +183,6 @@ void TestBuiltInEffectLoader::testSupported_data()
QTest::newRow("Contrast") << QStringLiteral("contrast") << false << xc << true;
// fails for GL as it does proper tests on what's supported and doesn't just check whether it's GL
QTest::newRow("Contrast-GL") << QStringLiteral("contrast") << false << oc << true;
QTest::newRow("Cube") << QStringLiteral("cube") << false << xc << true;
QTest::newRow("Cube-GL") << QStringLiteral("cube") << true << oc << true;
QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false << xc << true;
QTest::newRow("CubeSlide-GL") << QStringLiteral("cubeslide") << true << oc << true;
QTest::newRow("CubeSlide-GL-no-anim") << QStringLiteral("cubeslide") << false << oc << false;
@ -268,9 +264,6 @@ void TestBuiltInEffectLoader::testLoadEffect_data()
QTest::newRow("Contrast") << QStringLiteral("contrast") << false << xc;
// fails for GL as it does proper tests on what's supported and doesn't just check whether it's GL
QTest::newRow("Contrast-GL") << QStringLiteral("contrast") << false << oc;
QTest::newRow("Cube") << QStringLiteral("cube") << false << xc;
// TODO: needs GL mocking
// QTest::newRow("Cube-GL") << QStringLiteral("cube") << true << oc;
QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false << xc;
QTest::newRow("CubeSlide-GL") << QStringLiteral("cubeslide") << true << oc;
QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << true << xc;

View File

@ -64,7 +64,6 @@ void TestPluginEffectLoader::testHasEffect_data()
QTest::newRow("blur") << QStringLiteral("blur") << false;
QTest::newRow("ColorPicker") << QStringLiteral("colorpicker") << false;
QTest::newRow("Contrast") << QStringLiteral("contrast") << false;
QTest::newRow("Cube") << QStringLiteral("cube") << false;
QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false;
QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << false;
QTest::newRow("DimInactive") << QStringLiteral("diminactive") << false;

View File

@ -85,7 +85,6 @@ void TestScriptedEffectLoader::testHasEffect_data()
QTest::newRow("blur") << QStringLiteral("blur") << false;
QTest::newRow("Colorpicker") << QStringLiteral("colorpicker") << false;
QTest::newRow("Contrast") << QStringLiteral("contrast") << false;
QTest::newRow("Cube") << QStringLiteral("cube") << false;
QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false;
QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << false;
QTest::newRow("DimInactive") << QStringLiteral("diminactive") << false;

View File

@ -83,8 +83,6 @@ set(kwin4_effect_builtins_sources
blur/blur.cpp
blur/blurshader.cpp
colorpicker/colorpicker.cpp
cube/cube.cpp
cube/cube_proxy.cpp
cubeslide/cubeslide.cpp
desktopgrid/desktopgrid.cpp
diminactive/diminactive.cpp
@ -123,7 +121,6 @@ qt5_add_resources(kwin4_effect_builtins_sources shaders.qrc)
kconfig_add_kcfg_files(kwin4_effect_builtins_sources
blur/blurconfig.kcfgc
cube/cubeconfig.kcfgc
cubeslide/cubeslideconfig.kcfgc
desktopgrid/desktopgridconfig.kcfgc
diminactive/diminactiveconfig.kcfgc
@ -196,7 +193,6 @@ add_subdirectory(zoom)
# OpenGL-specific effects
add_subdirectory(blur)
include(backgroundcontrast/CMakeLists.txt)
add_subdirectory(cube)
add_subdirectory(cubeslide)
add_subdirectory(glide)
add_subdirectory(invert)

View File

@ -1,32 +0,0 @@
#######################################
# Effect
# Data files
install(FILES data/cubecap.png DESTINATION ${KDE_INSTALL_DATADIR}/kwin)
#######################################
# Config
set(kwin_cube_config_SRCS cube_config.cpp)
ki18n_wrap_ui(kwin_cube_config_SRCS cube_config.ui)
kconfig_add_kcfg_files(kwin_cube_config_SRCS cubeconfig.kcfgc)
add_library(kwin_cube_config MODULE ${kwin_cube_config_SRCS})
target_link_libraries(kwin_cube_config
KF5::ConfigWidgets
KF5::GlobalAccel
KF5::I18n
KF5::XmlGui
KF5::KIOWidgets
KWinEffectsInterface
)
kcoreaddons_desktop_to_json(kwin_cube_config cube_config.desktop SERVICE_TYPES kcmodule.desktop)
install(
TARGETS
kwin_cube_config
DESTINATION
${KDE_INSTALL_PLUGINDIR}/kwin/effects/configs
)

File diff suppressed because it is too large Load Diff

View File

@ -1,253 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2008 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KWIN_CUBE_H
#define KWIN_CUBE_H
#include <kwineffects.h>
#include <kwinglutils.h>
#include <QObject>
#include <QQueue>
#include <QMatrix4x4>
#include <QFont>
#include "cube_inside.h"
#include "cube_proxy.h"
namespace KWin
{
class CubeEffect
: public Effect
{
Q_OBJECT
Q_PROPERTY(qreal cubeOpacity READ configuredCubeOpacity)
Q_PROPERTY(bool opacityDesktopOnly READ isOpacityDesktopOnly)
Q_PROPERTY(bool displayDesktopName READ isDisplayDesktopName)
Q_PROPERTY(bool reflection READ isReflection)
Q_PROPERTY(int rotationDuration READ configuredRotationDuration)
Q_PROPERTY(QColor backgroundColor READ configuredBackgroundColor)
Q_PROPERTY(QColor capColor READ configuredCapColor)
Q_PROPERTY(bool paintCaps READ isPaintCaps)
Q_PROPERTY(bool closeOnMouseRelease READ isCloseOnMouseRelease)
Q_PROPERTY(qreal zPosition READ configuredZPosition)
Q_PROPERTY(bool useForTabBox READ isUseForTabBox)
Q_PROPERTY(bool invertKeys READ isInvertKeys)
Q_PROPERTY(bool invertMouse READ isInvertMouse)
Q_PROPERTY(qreal capDeformationFactor READ configuredCapDeformationFactor)
Q_PROPERTY(bool useZOrdering READ isUseZOrdering)
Q_PROPERTY(bool texturedCaps READ isTexturedCaps)
// TODO: electric borders: not a registered type
public:
CubeEffect();
~CubeEffect() override;
void reconfigure(ReconfigureFlags) override;
void prePaintScreen(ScreenPrePaintData& data, std::chrono::milliseconds presentTime) override;
void paintScreen(int mask, const QRegion &region, ScreenPaintData& data) override;
void postPaintScreen() override;
void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, std::chrono::milliseconds presentTime) override;
void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) override;
bool borderActivated(ElectricBorder border) override;
void grabbedKeyboardEvent(QKeyEvent* e) override;
void windowInputMouseEvent(QEvent* e) override;
bool isActive() const override;
int requestedEffectChainPosition() const override {
return 50;
}
// proxy functions
void* proxy() override;
void registerCubeInsideEffect(CubeInsideEffect* effect);
void unregisterCubeInsideEffect(CubeInsideEffect* effect);
static bool supported();
// for properties
qreal configuredCubeOpacity() const {
return cubeOpacity;
}
bool isOpacityDesktopOnly() const {
return opacityDesktopOnly;
}
bool isDisplayDesktopName() const {
return displayDesktopName;
}
bool isReflection() const {
return reflection;
}
int configuredRotationDuration() const {
return rotationDuration.count();
}
QColor configuredBackgroundColor() const {
return backgroundColor;
}
QColor configuredCapColor() const {
return capColor;
}
bool isPaintCaps() const {
return paintCaps;
}
bool isCloseOnMouseRelease() const {
return closeOnMouseRelease;
}
qreal configuredZPosition() const {
return zPosition;
}
bool isUseForTabBox() const {
return useForTabBox;
}
bool isInvertKeys() const {
return invertKeys;
}
bool isInvertMouse() const {
return invertMouse;
}
qreal configuredCapDeformationFactor() const {
return capDeformationFactor;
}
bool isUseZOrdering() const {
return useZOrdering;
}
bool isTexturedCaps() const {
return texturedCaps;
}
private Q_SLOTS:
void toggleCube();
void toggleCylinder();
void toggleSphere();
// slots for global shortcut changed
// needed to toggle the effect
void globalShortcutChanged(QAction *action, const QKeySequence &seq);
void slotTabBoxAdded(int mode);
void slotTabBoxUpdated();
void slotTabBoxClosed();
void slotCubeCapLoaded();
void slotWallPaperLoaded();
private:
enum class AnimationState {
None,
Start,
Stop,
Left,
Right
};
enum class VerticalAnimationState {
None,
Upwards,
Downwards
};
enum CubeMode {
Cube,
Cylinder,
Sphere
};
void toggle(CubeMode newMode = Cube);
void paintCube(int mask, QRegion region, ScreenPaintData& data);
void paintCap(bool frontFirst, float zOffset, const QMatrix4x4 &projection);
void paintCubeCap();
void paintCylinderCap();
void paintSphereCap();
bool loadShader();
void rotateCube();
void rotateToDesktop(int desktop);
void setActive(bool active);
QImage loadCubeCap(const QString &capPath);
QImage loadWallPaper(const QString &file);
void startAnimation(AnimationState state);
void startVerticalAnimation(VerticalAnimationState state);
bool activated;
bool cube_painting;
bool keyboard_grab;
bool schedule_close;
QList<ElectricBorder> borderActivate;
QList<ElectricBorder> borderActivateCylinder;
QList<ElectricBorder> borderActivateSphere;
int painting_desktop;
int frontDesktop;
float cubeOpacity;
bool opacityDesktopOnly;
bool displayDesktopName;
EffectFrame* desktopNameFrame;
QFont desktopNameFont;
bool reflection;
bool rotating;
bool verticalRotating;
bool desktopChangedWhileRotating;
bool paintCaps;
QColor backgroundColor;
QColor capColor;
GLTexture* wallpaper;
bool texturedCaps;
GLTexture* capTexture;
// animations
// Horizontal/start/stop
float startAngle;
float currentAngle;
int startFrontDesktop;
AnimationState animationState;
TimeLine timeLine;
QQueue<AnimationState> animations;
// vertical
float verticalStartAngle;
float verticalCurrentAngle;
VerticalAnimationState verticalAnimationState;
TimeLine verticalTimeLine;
QQueue<VerticalAnimationState> verticalAnimations;
std::chrono::milliseconds lastPresentTime;
bool reflectionPainting;
std::chrono::milliseconds rotationDuration;
int activeScreen;
bool bottomCap;
bool closeOnMouseRelease;
float zoom;
float zPosition;
bool useForTabBox;
bool invertKeys;
bool invertMouse;
bool tabBoxMode;
bool shortcutsRegistered;
CubeMode mode;
bool useShaders;
GLShader* cylinderShader;
GLShader* sphereShader;
GLShader* m_reflectionShader;
GLShader* m_capShader;
float capDeformationFactor;
bool useZOrdering;
float zOrderingFactor;
bool useList;
// needed for reflection
float mAddedHeightCoeff1;
float mAddedHeightCoeff2;
QMatrix4x4 m_rotationMatrix;
QMatrix4x4 m_reflectionMatrix;
QMatrix4x4 m_textureMirrorMatrix;
QMatrix4x4 m_currentFaceMatrix;
GLVertexBuffer *m_cubeCapBuffer;
// Shortcuts - needed to toggle the effect
QList<QKeySequence> cubeShortcut;
QList<QKeySequence> cylinderShortcut;
QList<QKeySequence> sphereShortcut;
// proxy
CubeEffectProxy m_proxy;
QList< CubeInsideEffect* > m_cubeInsideEffects;
QAction *m_cubeAction;
QAction *m_cylinderAction;
QAction *m_sphereAction;
};
} // namespace
#endif

View File

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile arg="true"/>
<group name="Effect-Cube">
<entry name="BorderActivate" type="IntList" />
<entry name="BorderActivateCylinder" type="IntList" />
<entry name="BorderActivateSphere" type="IntList" />
<entry name="TouchBorderActivate" type="IntList" />
<entry name="TouchBorderActivateCylinder" type="IntList" />
<entry name="TouchBorderActivateSphere" type="IntList" />
<entry name="RotationDuration" type="Int">
<default>0</default>
</entry>
<entry name="Opacity" type="Int">
<default>80</default>
</entry>
<entry name="OpacityDesktopOnly" type="Bool">
<default>false</default>
</entry>
<entry name="DisplayDesktopName" type="Bool">
<default>true</default>
</entry>
<entry name="Reflection" type="Bool">
<default>true</default>
</entry>
<entry name="BackgroundColor" type="Color">
<default code="true">QColor(Qt::black)</default>
</entry>
<entry name="CapColor" type="Color">
<default code="true">QColor(KColorScheme(QPalette::Active, KColorScheme::Window).background().color())</default>
</entry>
<entry name="CapPath" type="String">
<default code="true">QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral(&quot;cubecap.png&quot;))</default>
</entry>
<entry name="TexturedCaps" type="Bool">
<default>true</default>
</entry>
<entry name="Caps" type="Bool">
<default>true</default>
</entry>
<entry name="CloseOnMouseRelease" type="Bool">
<default>false</default>
</entry>
<entry name="TabBox" type="Bool">
<default>false</default>
</entry>
<entry name="ZPosition" type="Int">
<default>100</default>
</entry>
<entry name="Wallpaper" type="Url"/>
<entry name="CapDeformation" type="Int">
<default>0</default>
</entry>
<entry name="InvertKeys" type="Bool">
<default>false</default>
</entry>
<entry name="InvertMouse" type="Bool">
<default>false</default>
</entry>
<entry name="ZOrdering" type="Bool">
<default>false</default>
</entry>
</group>
</kcfg>

View File

@ -1,110 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2008 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "cube_config.h"
// KConfigSkeleton
#include "cubeconfig.h"
#include <config-kwin.h>
#include <kwineffects_interface.h>
#include <QAction>
#include <kconfiggroup.h>
#include <kcolorscheme.h>
#include <KActionCollection>
#include <KAboutData>
#include <KGlobalAccel>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QVBoxLayout>
#include <QColor>
K_PLUGIN_FACTORY_WITH_JSON(CubeEffectConfigFactory,
"cube_config.json",
registerPlugin<KWin::CubeEffectConfig>();)
namespace KWin
{
CubeEffectConfigForm::CubeEffectConfigForm(QWidget* parent) : QWidget(parent)
{
setupUi(this);
}
CubeEffectConfig::CubeEffectConfig(QWidget* parent, const QVariantList& args) :
KCModule(parent, args)
{
m_ui = new CubeEffectConfigForm(this);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(m_ui);
m_ui->tabWidget->setTabText(0, i18nc("@title:tab Basic Settings", "Basic"));
m_ui->tabWidget->setTabText(1, i18nc("@title:tab Advanced Settings", "Advanced"));
// Shortcut config. The shortcut belongs to the component "kwin"!
m_actionCollection = new KActionCollection(this, QStringLiteral("kwin"));
m_actionCollection->setComponentDisplayName(i18n("KWin"));
m_actionCollection->setConfigGroup(QStringLiteral("Cube"));
m_actionCollection->setConfigGlobal(true);
QAction* cubeAction = m_actionCollection->addAction(QStringLiteral("Cube"));
cubeAction->setText(i18n("Desktop Cube"));
cubeAction->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setDefaultShortcut(cubeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F11);
KGlobalAccel::self()->setShortcut(cubeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F11);
QAction* cylinderAction = m_actionCollection->addAction(QStringLiteral("Cylinder"));
cylinderAction->setText(i18n("Desktop Cylinder"));
cylinderAction->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setShortcut(cylinderAction, QList<QKeySequence>());
QAction* sphereAction = m_actionCollection->addAction(QStringLiteral("Sphere"));
sphereAction->setText(i18n("Desktop Sphere"));
sphereAction->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setShortcut(sphereAction, QList<QKeySequence>());
m_ui->editor->addCollection(m_actionCollection);
capsSelectionChanged();
connect(m_ui->kcfg_Caps, &QCheckBox::stateChanged, this, &CubeEffectConfig::capsSelectionChanged);
m_ui->kcfg_Wallpaper->setFilter(QStringLiteral("*.png *.jpeg *.jpg "));
CubeConfig::instance(KWIN_CONFIG);
addConfig(CubeConfig::self(), m_ui);
load();
}
void CubeEffectConfig::save()
{
KCModule::save();
m_ui->editor->save();
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"),
QStringLiteral("/Effects"),
QDBusConnection::sessionBus());
interface.reconfigureEffect(QStringLiteral("cube"));
}
void CubeEffectConfig::capsSelectionChanged()
{
if (m_ui->kcfg_Caps->checkState() == Qt::Checked) {
// activate cap color
m_ui->kcfg_CapColor->setEnabled(true);
m_ui->capColorLabel->setEnabled(true);
m_ui->kcfg_TexturedCaps->setEnabled(true);
} else {
// deactivate cap color
m_ui->kcfg_CapColor->setEnabled(false);
m_ui->capColorLabel->setEnabled(false);
m_ui->kcfg_TexturedCaps->setEnabled(false);
}
}
} // namespace
#include "cube_config.moc"

View File

@ -1,83 +0,0 @@
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kwin_cube_config
X-KDE-ParentComponents=cube
Name=Desktop Cube
Name[ar]=سطح مكتب مكعّب
Name[az]=İş Masası kubu
Name[be@latin]=Rabočy kub
Name[bg]=Кубичен работен плот
Name[bn]=ডেস্কটপ কিউব
Name[bs]=Kocka površi
Name[ca]=Cub de l'escriptori
Name[ca@valencia]=Cub d'escriptori
Name[cs]=Plochy na kostce
Name[csb]=Szescan pùltu
Name[da]=Skrivebordsterning
Name[de]=Arbeitsflächen-Würfel
Name[el]=Κύβος επιφάνειας εργασίας
Name[en_GB]=Desktop Cube
Name[eo]=Labortabla Kubo
Name[es]=Cubo de escritorio
Name[et]=Töölauakuubik
Name[eu]=Mahaigain kuboa
Name[fi]=Työpöytäkuutio
Name[fr]=Bureau en cube
Name[fy]=Buroblêdkubus
Name[ga]=Ciúb Deisce
Name[gl]=Cubo do escritorio
Name[gu]=ડેસ્કટોપ ટ્યુબ
Name[he]=שולחן עבודה בקובייה
Name[hi]=डेस्कटॉप घन
Name[hne]=डेस्कटाप घन
Name[hr]=Radna površina na kocki
Name[hsb]=Kóstka
Name[hu]=Asztalkocka
Name[ia]=Cubo de scriptorio
Name[id]=Kubus Desktop
Name[is]=Skjáborðskubbur
Name[it]=Cubo dei desktop
Name[ja]=デスクトップキューブ
Name[kk]=Үстел текшесі
Name[km]=គូប​ផ្ទៃតុ​
Name[kn]=ಗಣಕತೆರೆ ಘನಾಕೃತಿ
Name[ko]=데스크톱 큐브
Name[ku]=Sermaseya Mîkap
Name[lt]=Darbalaukio kubas
Name[lv]=Darbvirsmas kubs
Name[mai]=डेस्कटाप घन
Name[mk]=Работна коцка
Name[ml]=പണിയിടം ക്യൂബ്
Name[mr]=डेस्कटॉप क्यूब
Name[nb]=Skrivebordsterning
Name[nds]=Wörpel-Schriefdisch
Name[nl]=Bureaubladkubus
Name[nn]=Skrivebordskube
Name[pa]=ਡੈਸਕਟਾਪ ਘਣ
Name[pl]=Sześcian pulpitu
Name[pt]=Cubo de Ecrãs
Name[pt_BR]=Cubo de áreas de trabalho
Name[ro]=Cub de birou
Name[ru]=Куб рабочих столов
Name[si]=වැඩතල ඝනකය
Name[sk]=Plochy na kocke
Name[sl]=Kocka z namizji
Name[sr]=Коцка површи
Name[sr@ijekavian]=Коцка површи
Name[sr@ijekavianlatin]=Kocka površi
Name[sr@latin]=Kocka površi
Name[sv]=Skrivbordskub
Name[ta]=பணிமேசை க்யூப்
Name[te]=‍డెస్‍క్ టాప్ క్యూబ్
Name[th]=พื้นที่ทำงานทรงลูกบาศก์
Name[tr]=Masaüstü Küpü
Name[ug]=ئۈستەلئۈستى كۈپى
Name[uk]=Куб стільниць
Name[vi]=Khối vuông màn hình
Name[wa]=Cube di scribannes
Name[x-test]=xxDesktop Cubexx
Name[zh_CN]=3D 虚拟桌面切换
Name[zh_TW]=桌面立方體

View File

@ -1,46 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2008 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KWIN_CUBE_CONFIG_H
#define KWIN_CUBE_CONFIG_H
#include <kcmodule.h>
#include "ui_cube_config.h"
namespace KWin
{
class CubeEffectConfigForm : public QWidget, public Ui::CubeEffectConfigForm
{
Q_OBJECT
public:
explicit CubeEffectConfigForm(QWidget* parent);
};
class CubeEffectConfig : public KCModule
{
Q_OBJECT
public:
explicit CubeEffectConfig(QWidget* parent = nullptr, const QVariantList& args = QVariantList());
public Q_SLOTS:
void save() override;
private Q_SLOTS:
void capsSelectionChanged();
private:
CubeEffectConfigForm* m_ui;
KActionCollection* m_actionCollection;
};
} // namespace
#endif

View File

@ -1,569 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KWin::CubeEffectConfigForm</class>
<widget class="QWidget" name="KWin::CubeEffectConfigForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>747</width>
<height>566</height>
</rect>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Tab 1</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="1">
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>Background</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Background color:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_BackgroundColor</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KColorButton" name="kcfg_BackgroundColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Wallpaper:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_Wallpaper</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KUrlRequester" name="kcfg_Wallpaper">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_8">
<property name="title">
<string>Activation</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="2">
<widget class="KShortcutsEditor" name="editor" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>200</height>
</size>
</property>
<property name="actionTypes">
<enum>KShortcutsEditor::GlobalAction</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0" rowspan="2">
<widget class="QGroupBox" name="groupBox_7">
<property name="title">
<string>Appearance</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_DisplayDesktopName">
<property name="text">
<string>Display desktop name</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_Reflection">
<property name="text">
<string>Reflection</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Rotation duration:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_RotationDuration</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="kcfg_RotationDuration">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="specialValueText">
<string comment="Duration of rotation">Default</string>
</property>
<property name="maximum">
<number>5000</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_ZOrdering">
<property name="text">
<string>Windows hover above cube</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Opacity</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="1" column="0" colspan="2">
<widget class="QSlider" name="kcfg_Opacity">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>10</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="kcfg_OpacitySpin">
<property name="minimumSize">
<size>
<width>75</width>
<height>0</height>
</size>
</property>
<property name="suffix">
<string> %</string>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Transparent</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Opaque</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_OpacityDesktopOnly">
<property name="text">
<string>Do not change opacity of windows</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Tab 2</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0" rowspan="2">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Caps</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_Caps">
<property name="text">
<string>Show caps</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="capColorLabel">
<property name="text">
<string>Cap color:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_CapColor</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KColorButton" name="kcfg_CapColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_TexturedCaps">
<property name="text">
<string>Display image on caps</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Zoom</string>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Near</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Far</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QSlider" name="kcfg_ZPosition">
<property name="toolTip">
<string>Define how far away the object should appear</string>
</property>
<property name="maximum">
<number>3000</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="pageStep">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>100</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" rowspan="2">
<widget class="QGroupBox" name="groupBox_9">
<property name="title">
<string>Additional Options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="kcfg_CloseOnMouseRelease">
<property name="toolTip">
<string>If enabled the effect will be deactivated after rotating the cube with the mouse,
otherwise it will remain active</string>
</property>
<property name="text">
<string>Close after mouse dragging</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_TabBox">
<property name="text">
<string>Use this effect for walking through the desktops</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_InvertKeys">
<property name="text">
<string>Invert cursor keys</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_InvertMouse">
<property name="text">
<string>Invert mouse</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="capDeformationGroupBox">
<property name="title">
<string>Sphere Cap Deformation</string>
</property>
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="0" colspan="2">
<widget class="QSlider" name="kcfg_CapDeformation">
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>25</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="capDeformationSphereLabel">
<property name="text">
<string>Sphere</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="capDeformationPlaneLabel">
<property name="text">
<string>Plane</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KColorButton</class>
<extends>QPushButton</extends>
<header>kcolorbutton.h</header>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QFrame</extends>
<header>kurlrequester.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KShortcutsEditor</class>
<extends>QWidget</extends>
<header location="global">KShortcutsEditor</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>kcfg_DisplayDesktopName</tabstop>
<tabstop>kcfg_Reflection</tabstop>
<tabstop>kcfg_ZOrdering</tabstop>
<tabstop>kcfg_RotationDuration</tabstop>
<tabstop>kcfg_Opacity</tabstop>
<tabstop>kcfg_OpacitySpin</tabstop>
<tabstop>kcfg_OpacityDesktopOnly</tabstop>
<tabstop>kcfg_BackgroundColor</tabstop>
<tabstop>kcfg_Wallpaper</tabstop>
<tabstop>kcfg_Caps</tabstop>
<tabstop>kcfg_CapColor</tabstop>
<tabstop>kcfg_TexturedCaps</tabstop>
<tabstop>kcfg_CloseOnMouseRelease</tabstop>
<tabstop>kcfg_TabBox</tabstop>
<tabstop>kcfg_InvertKeys</tabstop>
<tabstop>kcfg_InvertMouse</tabstop>
<tabstop>kcfg_ZPosition</tabstop>
<tabstop>kcfg_CapDeformation</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>kcfg_OpacitySpin</sender>
<signal>valueChanged(int)</signal>
<receiver>kcfg_Opacity</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>727</x>
<y>85</y>
</hint>
<hint type="destinationlabel">
<x>611</x>
<y>88</y>
</hint>
</hints>
</connection>
<connection>
<sender>kcfg_Opacity</sender>
<signal>valueChanged(int)</signal>
<receiver>kcfg_OpacitySpin</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>611</x>
<y>88</y>
</hint>
<hint type="destinationlabel">
<x>727</x>
<y>85</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -1,29 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2009 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KWIN_CUBE_INSIDE_H
#define KWIN_CUBE_INSIDE_H
#include <kwineffects.h>
namespace KWin
{
class CubeInsideEffect : public Effect
{
public:
CubeInsideEffect() {}
~CubeInsideEffect() override {}
virtual void paint() = 0;
virtual void setActive(bool active) = 0;
};
} // namespace
#endif // KWIN_CUBE_INSIDE_H

View File

@ -1,36 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2009 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "cube_proxy.h"
#include "cube.h"
#include "cube_inside.h"
namespace KWin
{
CubeEffectProxy::CubeEffectProxy(CubeEffect* effect)
: m_effect(effect)
{
}
CubeEffectProxy::~CubeEffectProxy()
{
}
void CubeEffectProxy::registerCubeInsideEffect(CubeInsideEffect* effect)
{
m_effect->registerCubeInsideEffect(effect);
}
void CubeEffectProxy::unregisterCubeInsideEffect(CubeInsideEffect* effect)
{
m_effect->unregisterCubeInsideEffect(effect);
}
} // namespace

View File

@ -1,34 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2009 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KWIN_CUBE_PROXY_H
#define KWIN_CUBE_PROXY_H
namespace KWin
{
class CubeEffect;
class CubeInsideEffect;
class CubeEffectProxy
{
public:
explicit CubeEffectProxy(CubeEffect* effect);
~CubeEffectProxy();
void registerCubeInsideEffect(CubeInsideEffect* effect);
void unregisterCubeInsideEffect(CubeInsideEffect* effect);
private:
CubeEffect* m_effect;
};
} // namespace
#endif // KWIN_CUBE_PROXY_H

View File

@ -1,6 +0,0 @@
File=cube.kcfg
ClassName=CubeConfig
NameSpace=KWin
Singleton=true
Mutators=true
IncludeFiles=kcolorscheme.h

View File

@ -1,29 +0,0 @@
uniform sampler2D sampler;
uniform vec4 geometryColor;
uniform float u_opacity;
uniform int u_mirror;
uniform int u_untextured;
varying vec2 texcoord0;
vec2 mirrorTex(vec2 coords) {
vec2 mirrored = coords;
if (u_mirror != 0) {
mirrored.t = mirrored.t * (-1.0) + 1.0;
}
return mirrored;
}
void main() {
vec4 color = geometryColor;
vec2 texCoord = mirrorTex(texcoord0);
vec4 tex = texture2D(sampler, texCoord);
if (texCoord.s < 0.0 || texCoord.s > 1.0 ||
texCoord.t < 0.0 || texCoord.t > 1.0 || u_untextured != 0) {
tex = geometryColor;
}
color.rgb = tex.rgb*tex.a + color.rgb*(1.0-tex.a);
color.a = u_opacity;
gl_FragColor = color;
}

View File

@ -1,8 +0,0 @@
uniform float u_alpha;
varying vec2 texcoord0;
void main()
{
gl_FragColor = vec4(0.0, 0.0, 0.0, u_alpha*texcoord0.s);
}

View File

@ -1,35 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2008, 2011 Martin Gräßlin <kde@martin-graesslin.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
uniform mat4 modelViewProjectionMatrix;
uniform float width;
uniform float cubeAngle;
uniform float xCoord;
uniform float timeLine;
attribute vec4 position;
attribute vec4 texcoord;
varying vec2 texcoord0;
void main()
{
texcoord0 = texcoord.st;
vec4 transformedVertex = vec4(position.x - ( width - xCoord ), position.yzw);
float radian = radians(cubeAngle);
float radius = (width)*tan(radian);
float azimuthAngle = radians(transformedVertex.x/(width)*(90.0 - cubeAngle));
transformedVertex.x = width - xCoord + radius * sin( azimuthAngle );
transformedVertex.z = position.z + radius * cos( azimuthAngle ) - radius;
vec3 diff = (position.xyz - transformedVertex.xyz)*timeLine;
transformedVertex.xyz += diff;
gl_Position = modelViewProjectionMatrix*transformedVertex;
}

View File

@ -1,41 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2008, 2011 Martin Gräßlin <kde@martin-graesslin.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
uniform mat4 modelViewProjectionMatrix;
uniform float width;
uniform float height;
uniform float cubeAngle;
uniform vec2 u_offset;
uniform float timeLine;
attribute vec4 position;
attribute vec4 texcoord;
varying vec2 texcoord0;
void main()
{
texcoord0 = texcoord.st;
vec4 transformedVertex = position;
transformedVertex.x = transformedVertex.x - width;
transformedVertex.y = transformedVertex.y - height;
transformedVertex.xy = transformedVertex.xy + u_offset;
float radian = radians(cubeAngle);
float radius = (width)/cos(radian);
float zenithAngle = acos(transformedVertex.y/radius);
float azimuthAngle = asin(transformedVertex.x/radius);
transformedVertex.z = radius * sin( zenithAngle ) * cos( azimuthAngle ) - radius*cos( radians( 90.0 - cubeAngle ) );
transformedVertex.x = radius * sin( zenithAngle ) * sin( azimuthAngle );
transformedVertex.xy += vec2( width - u_offset.x, height - u_offset.y );
vec3 diff = (position.xyz - transformedVertex.xyz)*timeLine;
transformedVertex.xyz += diff;
gl_Position = modelViewProjectionMatrix*transformedVertex;
}

View File

@ -1,32 +0,0 @@
#version 140
uniform sampler2D sampler;
uniform vec4 geometryColor;
uniform float u_opacity;
uniform int u_mirror;
uniform int u_untextured;
in vec2 texcoord0;
out vec4 fragColor;
vec2 mirrorTex(vec2 coords) {
vec2 mirrored = coords;
if (u_mirror != 0) {
mirrored.t = mirrored.t * (-1.0) + 1.0;
}
return mirrored;
}
void main() {
vec4 color = geometryColor;
vec2 texCoord = mirrorTex(texcoord0);
vec4 tex = texture(sampler, texCoord);
if (texCoord.s < 0.0 || texCoord.s > 1.0 ||
texCoord.t < 0.0 || texCoord.t > 1.0 || u_untextured != 0) {
tex = geometryColor;
}
color.rgb = tex.rgb*tex.a + color.rgb*(1.0-tex.a);
color.a = u_opacity;
fragColor = color;
}

View File

@ -1,11 +0,0 @@
#version 140
uniform float u_alpha;
in vec2 texcoord0;
out vec4 fragColor;
void main()
{
fragColor = vec4(0.0, 0.0, 0.0, u_alpha*texcoord0.s);
}

View File

@ -1,36 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2008, 2011 Martin Gräßlin <kde@martin-graesslin.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#version 140
uniform mat4 modelViewProjectionMatrix;
uniform float width;
uniform float cubeAngle;
uniform float xCoord;
uniform float timeLine;
in vec4 position;
in vec4 texcoord;
out vec2 texcoord0;
void main()
{
texcoord0 = texcoord.st;
vec4 transformedVertex = vec4(position.x - ( width - xCoord ), position.yzw);
float radian = radians(cubeAngle);
float radius = (width)*tan(radian);
float azimuthAngle = radians(transformedVertex.x/(width)*(90.0 - cubeAngle));
transformedVertex.x = width - xCoord + radius * sin( azimuthAngle );
transformedVertex.z = position.z + radius * cos( azimuthAngle ) - radius;
vec3 diff = (position.xyz - transformedVertex.xyz)*timeLine;
transformedVertex.xyz += diff;
gl_Position = modelViewProjectionMatrix*transformedVertex;
}

View File

@ -1,42 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2008, 2011 Martin Gräßlin <kde@martin-graesslin.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#version 140
uniform mat4 modelViewProjectionMatrix;
uniform float width;
uniform float height;
uniform float cubeAngle;
uniform vec2 u_offset;
uniform float timeLine;
in vec4 position;
in vec4 texcoord;
out vec2 texcoord0;
void main()
{
texcoord0 = texcoord.st;
vec4 transformedVertex = position;
transformedVertex.x = transformedVertex.x - width;
transformedVertex.y = transformedVertex.y - height;
transformedVertex.xy = transformedVertex.xy + u_offset;
float radian = radians(cubeAngle);
float radius = (width)/cos(radian);
float zenithAngle = acos(transformedVertex.y/radius);
float azimuthAngle = asin(transformedVertex.x/radius);
transformedVertex.z = radius * sin( zenithAngle ) * cos( azimuthAngle ) - radius*cos( radians( 90.0 - cubeAngle ) );
transformedVertex.x = radius * sin( zenithAngle ) * sin( azimuthAngle );
transformedVertex.xy += vec2( width - u_offset.x, height - u_offset.y );
vec3 diff = (position.xyz - transformedVertex.xyz)*timeLine;
transformedVertex.xyz += diff;
gl_Position = modelViewProjectionMatrix*transformedVertex;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

View File

@ -33,7 +33,6 @@
#include "windowgeometry/windowgeometry.h"
#include "zoom/zoom.h"
// OpenGL-specific effects for desktop
#include "cube/cube.h"
#include "cubeslide/cubeslide.h"
#include "glide/glide.h"
#include "invert/invert.h"
@ -133,22 +132,6 @@ EFFECT_FALLBACK
#endif
EFFECT_FALLBACK
QString()
}, {
QStringLiteral("cube"),
i18ndc("kwin_effects", "Name of a KWin Effect", "Desktop Cube"),
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Display each virtual desktop on a side of a cube"),
QStringLiteral("Window Management"),
QString(),
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/desktop_cube.ogv")),
false,
false,
#ifdef EFFECT_BUILTINS
&createHelper<CubeEffect>,
&CubeEffect::supported,
nullptr,
#endif
EFFECT_FALLBACK
QStringLiteral("kwin_cube_config")
}, {
QStringLiteral("cubeslide"),
i18ndc("kwin_effects", "Name of a KWin Effect", "Desktop Cube Animation"),

View File

@ -26,7 +26,6 @@ enum class BuiltInEffect
Blur,
ColorPicker,
Contrast,
Cube,
CubeSlide,
DesktopGrid,
DimInactive,

View File

@ -1,18 +1,10 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/effect-shaders-1.10">
<file alias="cube-cap.glsl">cube/data/1.10/cube-cap.glsl</file>
<file alias="cube-reflection.glsl">cube/data/1.10/cube-reflection.glsl</file>
<file alias="cylinder.vert">cube/data/1.10/cylinder.vert</file>
<file alias="sphere.vert">cube/data/1.10/sphere.vert</file>
<file alias="invert.frag">invert/data/1.10/invert.frag</file>
<file alias="lookingglass.frag">lookingglass/data/1.10/lookingglass.frag</file>
<file alias="blinking-startup-fragment.glsl">startupfeedback/data/1.10/blinking-startup-fragment.glsl</file>
</qresource>
<qresource prefix="/effect-shaders-1.40">
<file alias="cube-cap.glsl">cube/data/1.40/cube-cap.glsl</file>
<file alias="cube-reflection.glsl">cube/data/1.40/cube-reflection.glsl</file>
<file alias="cylinder.vert">cube/data/1.40/cylinder.vert</file>
<file alias="sphere.vert">cube/data/1.40/sphere.vert</file>
<file alias="invert.frag">invert/data/1.40/invert.frag</file>
<file alias="lookingglass.frag">lookingglass/data/1.40/lookingglass.frag</file>
<file alias="blinking-startup-fragment.glsl">startupfeedback/data/1.40/blinking-startup-fragment.glsl</file>

View File

@ -66,17 +66,6 @@
<default>ElectricNone</default>
</entry>
</group>
<group name="Effect-Cube">
<entry name="BorderActivateCube" key="BorderActivate" type="IntList">
<default>ElectricNone</default>
</entry>
<entry key="BorderActivateCylinder" type="IntList">
<default>ElectricNone</default>
</entry>
<entry key="BorderActivateSphere" type="IntList">
<default>ElectricNone</default>
</entry>
</group>
<group name="TabBox">
<entry name="BorderActivateTabBox" key="BorderActivate" type="IntList">
<default>ElectricLeft</default>

View File

@ -34,17 +34,6 @@
<default>ElectricNone</default>
</entry>
</group>
<group name="Effect-Cube">
<entry name="TouchBorderActivateCube" key="TouchBorderActivate" type="IntList">
<default>ElectricNone</default>
</entry>
<entry key="TouchBorderActivateCylinder" type="IntList">
<default>ElectricNone</default>
</entry>
<entry key="TouchBorderActivateSphere" type="IntList">
<default>ElectricNone</default>
</entry>
</group>
<group name="TabBox">
<entry name="TouchBorderActivateTabBox" key="TouchBorderActivate" type="IntList">
<default>ElectricNone</default>

View File

@ -92,7 +92,6 @@ void KWinScreenEdgesConfig::save()
QDBusConnection::sessionBus());
interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::PresentWindows));
interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::DesktopGrid));
interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::Cube));
KCModule::save();
}
@ -135,10 +134,6 @@ void KWinScreenEdgesConfig::monitorInit()
m_form->monitorAddItem(i18n("%1 - Current Desktop", presentWindowsName));
m_form->monitorAddItem(i18n("%1 - Current Application", presentWindowsName));
m_form->monitorAddItem(BuiltInEffects::effectData(BuiltInEffect::DesktopGrid).displayName);
const QString cubeName = BuiltInEffects::effectData(BuiltInEffect::Cube).displayName;
m_form->monitorAddItem(i18n("%1 - Cube", cubeName));
m_form->monitorAddItem(i18n("%1 - Cylinder", cubeName));
m_form->monitorAddItem(i18n("%1 - Sphere", cubeName));
m_form->monitorAddItem(i18n("Toggle window switching"));
m_form->monitorAddItem(i18n("Toggle alternative window switching"));
@ -189,11 +184,6 @@ void KWinScreenEdgesConfig::monitorLoadSettings()
// Desktop Grid
m_form->monitorChangeEdge(m_data->settings()->borderActivateDesktopGrid(), DesktopGrid);
// Desktop Cube
m_form->monitorChangeEdge(m_data->settings()->borderActivateCube(), Cube);
m_form->monitorChangeEdge(m_data->settings()->borderActivateCylinder(), Cylinder);
m_form->monitorChangeEdge(m_data->settings()->borderActivateSphere(), Sphere);
// TabBox
m_form->monitorChangeEdge(m_data->settings()->borderActivateTabBox(), TabBox);
// Alternative TabBox
@ -232,11 +222,6 @@ void KWinScreenEdgesConfig::monitorLoadDefaultSettings()
// Desktop Grid
m_form->monitorChangeDefaultEdge(m_data->settings()->defaultBorderActivateDesktopGridValue(), DesktopGrid);
// Desktop Cube
m_form->monitorChangeDefaultEdge(m_data->settings()->defaultBorderActivateCubeValue(), Cube);
m_form->monitorChangeDefaultEdge(m_data->settings()->defaultBorderActivateCylinderValue(), Cylinder);
m_form->monitorChangeDefaultEdge(m_data->settings()->defaultBorderActivateSphereValue(), Sphere);
// TabBox
m_form->monitorChangeDefaultEdge(m_data->settings()->defaultBorderActivateTabBoxValue(), TabBox);
// Alternative TabBox
@ -265,11 +250,6 @@ void KWinScreenEdgesConfig::monitorSaveSettings()
// Desktop Grid
m_data->settings()->setBorderActivateDesktopGrid(m_form->monitorCheckEffectHasEdge(DesktopGrid));
// Desktop Cube
m_data->settings()->setBorderActivateCube(m_form->monitorCheckEffectHasEdge(Cube));
m_data->settings()->setBorderActivateCylinder(m_form->monitorCheckEffectHasEdge(Cylinder));
m_data->settings()->setBorderActivateSphere(m_form->monitorCheckEffectHasEdge(Sphere));
// TabBox
m_data->settings()->setBorderActivateTabBox(m_form->monitorCheckEffectHasEdge(TabBox));
m_data->settings()->setBorderAlternativeActivate(m_form->monitorCheckEffectHasEdge(TabBoxAlternative));
@ -295,11 +275,6 @@ void KWinScreenEdgesConfig::monitorShowEvent()
enabled = effectEnabled(BuiltInEffect::DesktopGrid, config);
m_form->monitorItemSetEnabled(DesktopGrid, enabled);
// Desktop Cube
enabled = effectEnabled(BuiltInEffect::Cube, config);
m_form->monitorItemSetEnabled(Cube, enabled);
m_form->monitorItemSetEnabled(Cylinder, enabled);
m_form->monitorItemSetEnabled(Sphere, enabled);
// tabbox, depends on reasonable focus policy.
KConfigGroup config2(m_config, "Windows");
QString focusPolicy = config2.readEntry("FocusPolicy", QString());

View File

@ -53,9 +53,6 @@ private:
PresentWindowsCurrent,
PresentWindowsClass,
DesktopGrid,
Cube,
Cylinder,
Sphere,
TabBox,
TabBoxAlternative,
EffectCount

View File

@ -85,7 +85,6 @@ void KWinScreenEdgesConfig::save()
QDBusConnection::sessionBus());
interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::PresentWindows));
interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::DesktopGrid));
interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::Cube));
KCModule::save();
}
@ -133,10 +132,6 @@ void KWinScreenEdgesConfig::monitorInit()
m_form->monitorAddItem(i18n("%1 - Current Desktop", presentWindowsName));
m_form->monitorAddItem(i18n("%1 - Current Application", presentWindowsName));
m_form->monitorAddItem(BuiltInEffects::effectData(BuiltInEffect::DesktopGrid).displayName);
const QString cubeName = BuiltInEffects::effectData(BuiltInEffect::Cube).displayName;
m_form->monitorAddItem(i18n("%1 - Cube", cubeName));
m_form->monitorAddItem(i18n("%1 - Cylinder", cubeName));
m_form->monitorAddItem(i18n("%1 - Sphere", cubeName));
m_form->monitorAddItem(i18n("Toggle window switching"));
m_form->monitorAddItem(i18n("Toggle alternative window switching"));
@ -181,13 +176,6 @@ void KWinScreenEdgesConfig::monitorLoadSettings()
// Desktop Grid BorderActivate
m_form->monitorChangeEdge(m_data->settings()->touchBorderActivateDesktopGrid(), DesktopGrid);
// Desktop Cube BorderActivate
m_form->monitorChangeEdge(m_data->settings()->touchBorderActivateCube(), Cube);
// Desktop Cube BorderActivateCylinder
m_form->monitorChangeEdge(m_data->settings()->touchBorderActivateCylinder(), Cylinder);
// Desktop Cube BorderActivateSphere
m_form->monitorChangeEdge(m_data->settings()->touchBorderActivateSphere(), Sphere);
// TabBox BorderActivate
m_form->monitorChangeEdge(m_data->settings()->touchBorderActivateTabBox(), TabBox);
// Alternative TabBox
@ -217,13 +205,6 @@ void KWinScreenEdgesConfig::monitorLoadDefaultSettings()
// Desktop Grid BorderActivate
m_form->monitorChangeDefaultEdge(m_data->settings()->defaultTouchBorderActivateDesktopGridValue(), DesktopGrid);
// Desktop Cube BorderActivate
m_form->monitorChangeDefaultEdge(m_data->settings()->defaultTouchBorderActivateCubeValue(), Cube);
// Desktop Cube BorderActivateCylinder
m_form->monitorChangeDefaultEdge(m_data->settings()->defaultTouchBorderActivateCylinderValue(), Cylinder);
// Desktop Cube BorderActivateSphere
m_form->monitorChangeDefaultEdge(m_data->settings()->defaultTouchBorderActivateSphereValue(), Sphere);
// TabBox BorderActivate
m_form->monitorChangeDefaultEdge(m_data->settings()->defaultTouchBorderActivateTabBoxValue(), TabBox);
// Alternative TabBox
@ -248,11 +229,6 @@ void KWinScreenEdgesConfig::monitorSaveSettings()
// Desktop Grid
m_data->settings()->setTouchBorderActivateDesktopGrid(m_form->monitorCheckEffectHasEdge(DesktopGrid));
// Desktop Cube
m_data->settings()->setTouchBorderActivateCube(m_form->monitorCheckEffectHasEdge(Cube));
m_data->settings()->setTouchBorderActivateCylinder(m_form->monitorCheckEffectHasEdge(Cylinder));
m_data->settings()->setTouchBorderActivateSphere(m_form->monitorCheckEffectHasEdge(Sphere));
// TabBox
m_data->settings()->setTouchBorderActivateTabBox(m_form->monitorCheckEffectHasEdge(TabBox));
m_data->settings()->setTouchBorderAlternativeActivate(m_form->monitorCheckEffectHasEdge(TabBoxAlternative));
@ -278,11 +254,6 @@ void KWinScreenEdgesConfig::monitorShowEvent()
enabled = effectEnabled(BuiltInEffect::DesktopGrid, config);
m_form->monitorItemSetEnabled(DesktopGrid, enabled);
// Desktop Cube
enabled = effectEnabled(BuiltInEffect::Cube, config);
m_form->monitorItemSetEnabled(Cube, enabled);
m_form->monitorItemSetEnabled(Cylinder, enabled);
m_form->monitorItemSetEnabled(Sphere, enabled);
// tabbox, depends on reasonable focus policy.
KConfigGroup config2(m_config, "Windows");
QString focusPolicy = config2.readEntry("FocusPolicy", QString());

View File

@ -53,9 +53,6 @@ private:
PresentWindowsCurrent,
PresentWindowsClass,
DesktopGrid,
Cube,
Cylinder,
Sphere,
TabBox,
TabBoxAlternative,
EffectCount