9 Commits (master)

Author SHA1 Message Date
Vlad Zahorodnii 4148be0d27 Port to versionless QML module imports
It's more convenient and Qt upstream seems to encourage to use it too,
e.g. example import statements have no version.
2 years ago
Vlad Zahorodnii 70a063a34c scripting: Rename ScreenEdgeItem to ScreenEdgeHandler
ScreenEdgeItem is not an item, so rename it to something else. "Handler"
is inspired by QtQuick, e.g. TapHandler.
2 years ago
Vlad Zahorodnii 271de0ccc6 scripts: Port some scripts to org.kde.kwin v3 qml api 2 years ago
David Edmundson ae6e6dc63c [scripting] Port ScriptedEffects to QJSEngine
Summary:
QScriptEngine is deprecated for years and suffers bitrot.
Plasma hit one super major bug with it in 5.11.0 and has now ported
away.

Main porting notes:
- creating low level functions no longer exists
The old global functions are exposed on the ScriptedEffect instance
and then the QJSValue wrappers of the globalObject are modified to
trampoline the methods at a wrapper level.

- We can then use QJSEngine to automatically do argument error checking
rather than unmarshalling a QJSValue manually which significantly
reduces a lot of code.

- We can't make FPX2 a native type, so these are QJSValue args and
unboxed there.

Long term I want overloads for animate that take int/QSize/QPoint which
are native JS types, but that might be an API break.

Test Plan:
Hopefully comprehensive unit test which passes
Tested fade/fadeDesktop manually.

It's a very invasive change, so I expect some things will be broke
please help test any JS effects.

Reviewers: #kwin, mart, fvogt

Subscribers: fvogt, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14536
4 years ago
Vlad Zahorodnii 566d4aa27b scripting: Port Script to QJSEngine
QtScript is not well maintained and deprecated in favor of QJSEngine.
4 years ago
Martin Gräßlin 2be1625822 Add support for new touch screen callbacks to KWin scripts and scripted effects
Summary:
Exposes two new global JS functions to register and unregister touch
screen edges.

Test Plan: Added test case

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5277
8 years ago
Martin Gräßlin 63b1138307 Add support for new touch screen edge actions to declarative KWin scripts
Summary:
This change introduces a new property mode in ScreenEdgeItem to switch
between Pointer and Touch mode. The touch mode interacts with the new
touch screen edge gestures through a QAction.

Test Plan: New test case added

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5272
8 years ago
David Edmundson b32cdc5653 Add method unregisterScreenEdge to scripting
Test Plan: Used in a script. Works.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2261
8 years ago
Martin Gräßlin 17abac9db3 [autotest/integration] Add a test case for screenedge usage in Scripts
A new sub-directory scripting is added in autotests/integration to
gather all test cases related to scripting.

The first added test case verifies the activation of screen edges. For
that it loads a helper script, which reserves an edge based on config.
When the edge is triggered showing desktop is activated.
8 years ago