shift-shell/kwin/mobiletaskswitcher/plugin/effecttouchborder.h
Devin Lin bbac7e98b4 taskswitcher: Switch to declarative effect
This switches the kwin effect to be a declarative effect. However, for
now I have retained much of the logic that exists in cpp as a QML
plugin.

Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/448

Also implements https://invent.kde.org/plasma/plasma-mobile/-/issues/408 now that we can access the QML api
2025-03-01 21:26:47 +00:00

55 lines
1 KiB
C++

// SPDX-FileCopyrightText: 2024 Luis Büchi <luis.buechi@server23.cc>
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QAction>
#include <effect/effect.h>
#include <effect/effecthandler.h>
namespace KWin
{
class EffectTouchBorderState : public QObject
{
Q_OBJECT
public:
EffectTouchBorderState(Effect *parent);
bool inProgress() const;
void setInProgress(bool inProgress);
QAction *activateAction() const
{
return m_activateAction.get();
}
Q_SIGNALS:
void inProgressChanged();
private:
bool m_inProgress = false;
std::unique_ptr<QAction> m_activateAction;
};
class EffectTouchBorder : public QObject
{
Q_OBJECT
public:
EffectTouchBorder(EffectTouchBorderState *state);
~EffectTouchBorder();
void setBorders(const QList<int> &borders);
Q_SIGNALS:
void touchPositionChanged(qreal primaryPosition, qreal orthogonalPosition);
private:
QList<ElectricBorder> m_touchBorderActivate;
EffectTouchBorderState *m_state;
};
}