Commit Graph

22 Commits (master)

Author SHA1 Message Date
Vlad Zahorodnii 4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00
Vlad Zahorodnii 69a3517e02 Merge branch 'Plasma/5.17' 2019-10-25 17:50:13 +03:00
Vlad Zahorodnii a738ecce85 [scripting] Provide conversion functions for AbstractClient
Summary:
If no conversion functions are provided for a QObject-subclass, then
QScriptEngine will use QScriptEngine::newQObject() method without any
special options to convert an instance of that QObject-subclass to a
QScriptValue. However, it's very important that every client object is
wrapped with PreferExistingWrapperObject option. We need that option
because a script may set a property on a client object and that property
must remain until it's deleted by the script.

BUG: 413044
FIXED-IN: 5.17.2

Test Plan: New test.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24944
2019-10-25 17:39:45 +03:00
Vlad Zahorodnii ffcbe24e2b Rename Client to X11Client
Summary:
Currently each managed X11 client is represented with an instance of
Client class, however the name of that class is very generic and the
only reason why it's called that way is because historically kwin
was created as an x11 window manager, so "Client" was a sensible choice.

With introduction of wayland support, things had changed and therefore
Client needs to be renamed to X11Client in order to better reflect what
that class stands for.

Renaming of Client to X11Client was agreed upon during the last KWin
sprint.

Test Plan: Compiles, the test suite is still green.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24184
2019-09-25 21:11:37 +03:00
Vlad Zagorodniy 684b4b635e Use more traditional doxygen style
Summary:
So far we were following a bit unique and rare doxygen comment style:

    /**
     * Contents of the comment.
     **/

Doxygen comments with this style look balanced and neat, but many people
that contribute to KWin don't follow this style. Instead, they prefer
more traditional doxygen comment style, i.e.

    /**
     * Contents of the comment.
     */

Reviewing such changes has been a bit frustrating for me (so selfish!)
and for other contributors.

This change switches doxygen comment style in KWin to a more traditional
style. The main reason for doing this is to make code review process easier
for new contributors as well us.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22812
2019-07-29 22:06:19 +03:00
Vlad Zagorodniy 689d89ae4e [scripting] Port the remaining bits of API to AbstractClient
Currently, clientArea(ClientAreaOption, const Client *) and clientList()
are quite X11-specific, which results in having some tiling scripts not
working with Wayland clients. This change is the first step towards working
tiling scripts in the Wayland session.
2019-05-24 00:27:11 +03:00
Martin Gräßlin 330d40f425 Fix no cast to/from ASCII intrduced issues
* "" needs to be wrapped in QStringLiteral
* QString::fromUtf8 needed for const char* and QByteArray
* QByteArray::constData() needed to get to the const char*
2013-07-24 09:58:33 +02:00
Martin Gräßlin 8205adcac3 Export Toplevel to KWin::Scripts
Without the scripting system is not able to handle signals defined on
Toplevel instead of Client.

REVIEW: 108807
2013-02-14 08:16:19 +01:00
Mathias Gottschlag 1d2e3aa327 Let kwin scripts add dynamic properties to client objects.
This enables the script wrapper objects to automatically create new
dynamic properties for Client objects so that scripts can register custom
properties.

REVIEW: 104697
2012-04-24 17:42:16 +02:00
Martin Gräßlin 175668f2b3 Unexport TabGroup property on Client for scripts
TabGroup is not (and should not be) a QObject which
makes it rather useless in scripting. In order to use
window tabs in KWin scripts the methods to interact
with tabs from Client should be used.

REVIEW: 104685
2012-04-21 12:19:52 +02:00
Thomas Lübking 85635dd485 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:30:22 +01:00
Thomas Lübking bf88ec09ac Revert "fix tabbing"
pushed out of branch, not master - leading to absent revision, found hash collision??

This reverts commit 94b2ad7b85801e37e2df4671cdc4f26b6d7e5506.
2012-02-11 16:29:14 +01:00
Thomas Lübking d245035a17 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:01:41 +01:00
Martin Gräßlin 197658475b Make List of Clients in ClientGroup accessable in scripts
For that ClientList is exported as a sequence meta type and
property is added to ClientGroup.
2012-01-01 15:01:54 +01:00
Martin Gräßlin 698eb631cd ClientGroup becomes scriptable (again)
For this properties are defined in ClientGroup and several methods
are changed to be slots (to be invokable from scripts). On Client
the clientGroup is exported as a property.

The existing wrapper around ClientGroup is dropped as it is no
longer needed. Interestingly it was wrong anyway as it allowed to
construct a new ClientGroup, which has to be done internally.

At the same time the meta declarations get cleaned up a little bit.
2012-01-01 14:43:32 +01:00
Martin Gräßlin 1953deab15 Drop "Chelate"
Whatever it was, we cannot need a "Lazy Logic (TM)" which is not
documented. And even if it were useful, KWin is not the right place
to develop language extensions to ECMAScript.
2011-12-31 14:22:22 +01:00
Martin Gräßlin 716a38cdb4 Making the geometry mapping work 2011-12-31 08:58:43 +01:00
Martin Gräßlin f47e7bb5ef KWin scripting goes properties
Dropping the wrapper around Client and just exporting the Client's
properties. This breaks all existing scripts as it's now e.g.:
client.caption
instead of
client.caption()

But the first one is the more natural one for JavaScript and also
for everyone writing QML as well.

Setters and signals are mostly still missing in client. Other parts
like ClientGroup must be converted to properties, too.
2011-12-31 08:58:40 +01:00
Martin Gräßlin 0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Martin Gräßlin fd09961b8e Fix Krazy issues in scripting.
Let's start the new year with some good deeds and improve the code quality.
SVN_SILENT

svn path=/trunk/KDE/kdebase/workspace/; revision=1210594
2011-01-01 09:37:08 +00:00
Rohan Ramdas Prabhu 2aec750ebf Trembles the weave as the clock ticks, attain another microstate.
Every disorder causes every duration, which ensures the one that stays.
reality is relative. natural is disorder.
[R]obinhood[P]andey

Merging scripting from
^/branches/work/kwin_scripting TO
^/trunk

svn path=/trunk/KDE/kdebase/workspace/; revision=1177865
2010-09-21 14:31:40 +00:00