Click Tween: bron overgenomen van lokale map (kwin-click-tween-6.8)
@@ -0,0 +1,6 @@
1
build/
2
*.so
3
*.moc
4
*.o
5
*.bak*
6
dist/
@@ -0,0 +1,6 @@1
build/2
*.so3
*.moc4
*.o5
*.bak*6
dist/@@ -0,0 +1,338 @@
1
GNU GENERAL PUBLIC LICENSE
2
Version 2, June 1991
3
4
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
<https://fsf.org/>
6
Everyone is permitted to copy and distribute verbatim copies
7
of this license document, but changing it is not allowed.
8
9
Preamble
10
11
The licenses for most software are designed to take away your
12
freedom to share and change it. By contrast, the GNU General Public
13
License is intended to guarantee your freedom to share and change free
14
software--to make sure the software is free for all its users. This
15
General Public License applies to most of the Free Software
16
Foundation's software and to any other program whose authors commit to
17
using it. (Some other Free Software Foundation software is covered by
18
the GNU Lesser General Public License instead.) You can apply it to
19
your programs, too.
20
21
When we speak of free software, we are referring to freedom, not
22
price. Our General Public Licenses are designed to make sure that you
23
have the freedom to distribute copies of free software (and charge for
24
this service if you wish), that you receive source code or can get it
25
if you want it, that you can change the software or use pieces of it
26
in new free programs; and that you know you can do these things.
27
28
To protect your rights, we need to make restrictions that forbid
29
anyone to deny you these rights or to ask you to surrender the rights.
30
These restrictions translate to certain responsibilities for you if you
31
distribute copies of the software, or if you modify it.
32
33
For example, if you distribute copies of such a program, whether
34
gratis or for a fee, you must give the recipients all the rights that
35
you have. You must make sure that they, too, receive or can get the
36
source code. And you must show them these terms so they know their
37
rights.
38
39
We protect your rights with two steps: (1) copyright the software, and
40
(2) offer you this license which gives you legal permission to copy,
41
distribute and/or modify the software.
42
43
Also, for each author's protection and ours, we want to make certain
44
that everyone understands that there is no warranty for this free
45
software. If the software is modified by someone else and passed on, we
46
want its recipients to know that what they have is not the original, so
47
that any problems introduced by others will not reflect on the original
48
authors' reputations.
49
50
Finally, any free program is threatened constantly by software
51
patents. We wish to avoid the danger that redistributors of a free
52
program will individually obtain patent licenses, in effect making the
53
program proprietary. To prevent this, we have made it clear that any
54
patent must be licensed for everyone's free use or not licensed at all.
55
56
The precise terms and conditions for copying, distribution and
57
modification follow.
58
59
GNU GENERAL PUBLIC LICENSE
60
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
62
0. This License applies to any program or other work which contains
63
a notice placed by the copyright holder saying it may be distributed
64
under the terms of this General Public License. The "Program", below,
65
refers to any such program or work, and a "work based on the Program"
66
means either the Program or any derivative work under copyright law:
67
that is to say, a work containing the Program or a portion of it,
68
either verbatim or with modifications and/or translated into another
69
language. (Hereinafter, translation is included without limitation in
70
the term "modification".) Each licensee is addressed as "you".
71
72
Activities other than copying, distribution and modification are not
73
covered by this License; they are outside its scope. The act of
74
running the Program is not restricted, and the output from the Program
75
is covered only if its contents constitute a work based on the
76
Program (independent of having been made by running the Program).
77
Whether that is true depends on what the Program does.
78
79
1. You may copy and distribute verbatim copies of the Program's
80
source code as you receive it, in any medium, provided that you
81
conspicuously and appropriately publish on each copy an appropriate
82
copyright notice and disclaimer of warranty; keep intact all the
83
notices that refer to this License and to the absence of any warranty;
84
and give any other recipients of the Program a copy of this License
85
along with the Program.
86
87
You may charge a fee for the physical act of transferring a copy, and
88
you may at your option offer warranty protection in exchange for a fee.
89
90
2. You may modify your copy or copies of the Program or any portion
91
of it, thus forming a work based on the Program, and copy and
92
distribute such modifications or work under the terms of Section 1
93
above, provided that you also meet all of these conditions:
94
95
a) You must cause the modified files to carry prominent notices
96
stating that you changed the files and the date of any change.
97
98
b) You must cause any work that you distribute or publish, that in
99
whole or in part contains or is derived from the Program or any
100
part thereof, to be licensed as a whole at no charge to all third
101
parties under the terms of this License.
102
103
c) If the modified program normally reads commands interactively
104
when run, you must cause it, when started running for such
105
interactive use in the most ordinary way, to print or display an
106
announcement including an appropriate copyright notice and a
107
notice that there is no warranty (or else, saying that you provide
108
a warranty) and that users may redistribute the program under
109
these conditions, and telling the user how to view a copy of this
110
License. (Exception: if the Program itself is interactive but
111
does not normally print such an announcement, your work based on
112
the Program is not required to print an announcement.)
113
114
These requirements apply to the modified work as a whole. If
115
identifiable sections of that work are not derived from the Program,
116
and can be reasonably considered independent and separate works in
117
themselves, then this License, and its terms, do not apply to those
118
sections when you distribute them as separate works. But when you
119
distribute the same sections as part of a whole which is a work based
120
on the Program, the distribution of the whole must be on the terms of
121
this License, whose permissions for other licensees extend to the
122
entire whole, and thus to each and every part regardless of who wrote it.
123
124
Thus, it is not the intent of this section to claim rights or contest
125
your rights to work written entirely by you; rather, the intent is to
126
exercise the right to control the distribution of derivative or
127
collective works based on the Program.
128
129
In addition, mere aggregation of another work not based on the Program
130
with the Program (or with a work based on the Program) on a volume of
131
a storage or distribution medium does not bring the other work under
132
the scope of this License.
133
134
3. You may copy and distribute the Program (or a work based on it,
135
under Section 2) in object code or executable form under the terms of
136
Sections 1 and 2 above provided that you also do one of the following:
137
138
a) Accompany it with the complete corresponding machine-readable
139
source code, which must be distributed under the terms of Sections
140
1 and 2 above on a medium customarily used for software interchange; or,
141
142
b) Accompany it with a written offer, valid for at least three
143
years, to give any third party, for a charge no more than your
144
cost of physically performing source distribution, a complete
145
machine-readable copy of the corresponding source code, to be
146
distributed under the terms of Sections 1 and 2 above on a medium
147
customarily used for software interchange; or,
148
149
c) Accompany it with the information you received as to the offer
150
to distribute corresponding source code. (This alternative is
151
allowed only for noncommercial distribution and only if you
152
received the program in object code or executable form with such
153
an offer, in accord with Subsection b above.)
154
155
The source code for a work means the preferred form of the work for
156
making modifications to it. For an executable work, complete source
157
code means all the source code for all modules it contains, plus any
158
associated interface definition files, plus the scripts used to
159
control compilation and installation of the executable. However, as a
160
special exception, the source code distributed need not include
161
anything that is normally distributed (in either source or binary
162
form) with the major components (compiler, kernel, and so on) of the
163
operating system on which the executable runs, unless that component
164
itself accompanies the executable.
165
166
If distribution of executable or object code is made by offering
167
access to copy from a designated place, then offering equivalent
168
access to copy the source code from the same place counts as
169
distribution of the source code, even though third parties are not
170
compelled to copy the source along with the object code.
171
172
4. You may not copy, modify, sublicense, or distribute the Program
173
except as expressly provided under this License. Any attempt
174
otherwise to copy, modify, sublicense or distribute the Program is
175
void, and will automatically terminate your rights under this License.
176
However, parties who have received copies, or rights, from you under
177
this License will not have their licenses terminated so long as such
178
parties remain in full compliance.
179
180
5. You are not required to accept this License, since you have not
181
signed it. However, nothing else grants you permission to modify or
182
distribute the Program or its derivative works. These actions are
183
prohibited by law if you do not accept this License. Therefore, by
184
modifying or distributing the Program (or any work based on the
185
Program), you indicate your acceptance of this License to do so, and
186
all its terms and conditions for copying, distributing or modifying
187
the Program or works based on it.
188
189
6. Each time you redistribute the Program (or any work based on the
190
Program), the recipient automatically receives a license from the
191
original licensor to copy, distribute or modify the Program subject to
192
these terms and conditions. You may not impose any further
193
restrictions on the recipients' exercise of the rights granted herein.
194
You are not responsible for enforcing compliance by third parties to
195
this License.
196
197
7. If, as a consequence of a court judgment or allegation of patent
198
infringement or for any other reason (not limited to patent issues),
199
conditions are imposed on you (whether by court order, agreement or
200
otherwise) that contradict the conditions of this License, they do not
201
excuse you from the conditions of this License. If you cannot
202
distribute so as to satisfy simultaneously your obligations under this
203
License and any other pertinent obligations, then as a consequence you
204
may not distribute the Program at all. For example, if a patent
205
license would not permit royalty-free redistribution of the Program by
206
all those who receive copies directly or indirectly through you, then
207
the only way you could satisfy both it and this License would be to
208
refrain entirely from distribution of the Program.
209
210
If any portion of this section is held invalid or unenforceable under
211
any particular circumstance, the balance of the section is intended to
212
apply and the section as a whole is intended to apply in other
213
circumstances.
214
215
It is not the purpose of this section to induce you to infringe any
216
patents or other property right claims or to contest validity of any
217
such claims; this section has the sole purpose of protecting the
218
integrity of the free software distribution system, which is
219
implemented by public license practices. Many people have made
220
generous contributions to the wide range of software distributed
221
through that system in reliance on consistent application of that
222
system; it is up to the author/donor to decide if he or she is willing
223
to distribute software through any other system and a licensee cannot
224
impose that choice.
225
226
This section is intended to make thoroughly clear what is believed to
227
be a consequence of the rest of this License.
228
229
8. If the distribution and/or use of the Program is restricted in
230
certain countries either by patents or by copyrighted interfaces, the
231
original copyright holder who places the Program under this License
232
may add an explicit geographical distribution limitation excluding
233
those countries, so that distribution is permitted only in or among
234
countries not thus excluded. In such case, this License incorporates
235
the limitation as if written in the body of this License.
236
237
9. The Free Software Foundation may publish revised and/or new versions
238
of the General Public License from time to time. Such new versions will
239
be similar in spirit to the present version, but may differ in detail to
240
address new problems or concerns.
241
242
Each version is given a distinguishing version number. If the Program
243
specifies a version number of this License which applies to it and "any
244
later version", you have the option of following the terms and conditions
245
either of that version or of any later version published by the Free
246
Software Foundation. If the Program does not specify a version number of
247
this License, you may choose any version ever published by the Free Software
248
Foundation.
249
250
10. If you wish to incorporate parts of the Program into other free
251
programs whose distribution conditions are different, write to the author
252
to ask for permission. For software which is copyrighted by the Free
253
Software Foundation, write to the Free Software Foundation; we sometimes
254
make exceptions for this. Our decision will be guided by the two goals
255
of preserving the free status of all derivatives of our free software and
256
of promoting the sharing and reuse of software generally.
257
258
NO WARRANTY
259
260
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
REPAIR OR CORRECTION.
269
270
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
POSSIBILITY OF SUCH DAMAGES.
279
280
END OF TERMS AND CONDITIONS
281
282
How to Apply These Terms to Your New Programs
283
284
If you develop a new program, and you want it to be of the greatest
285
possible use to the public, the best way to achieve this is to make it
286
free software which everyone can redistribute and change under these terms.
287
288
To do so, attach the following notices to the program. It is safest
289
to attach them to the start of each source file to most effectively
290
convey the exclusion of warranty; and each file should have at least
291
the "copyright" line and a pointer to where the full notice is found.
292
293
<one line to give the program's name and a brief idea of what it does.>
294
Copyright (C) <year> <name of author>
295
296
This program is free software; you can redistribute it and/or modify
297
it under the terms of the GNU General Public License as published by
298
the Free Software Foundation; either version 2 of the License, or
299
(at your option) any later version.
300
301
This program is distributed in the hope that it will be useful,
302
but WITHOUT ANY WARRANTY; without even the implied warranty of
303
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
GNU General Public License for more details.
305
306
You should have received a copy of the GNU General Public License along
307
with this program; if not, see <https://www.gnu.org/licenses/>.
308
309
Also add information on how to contact you by electronic and paper mail.
310
311
If the program is interactive, make it output a short notice like this
312
when it starts in an interactive mode:
313
314
Gnomovision version 69, Copyright (C) year name of author
315
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
316
This is free software, and you are welcome to redistribute it
317
under certain conditions; type `show c' for details.
318
319
The hypothetical commands `show w' and `show c' should show the appropriate
320
parts of the General Public License. Of course, the commands you use may
321
be called something other than `show w' and `show c'; they could even be
322
mouse-clicks or menu items--whatever suits your program.
323
324
You should also get your employer (if you work as a programmer) or your
325
school, if any, to sign a "copyright disclaimer" for the program, if
326
necessary. Here is a sample; alter the names:
327
328
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
329
`Gnomovision' (which makes passes at compilers) written by James Hacker.
330
331
<signature of Moe Ghoul>, 1 April 1989
332
Moe Ghoul, President of Vice
333
334
This General Public License does not permit incorporating your program into
335
proprietary programs. If your program is a subroutine library, you may
336
consider it more useful to permit linking proprietary applications with the
337
library. If this is what you want to do, use the GNU Lesser General
338
Public License instead of this License.
@@ -0,0 +1,338 @@1
GNU GENERAL PUBLIC LICENSE2
Version 2, June 19913
4
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,5
<https://fsf.org/>6
Everyone is permitted to copy and distribute verbatim copies7
of this license document, but changing it is not allowed.8
9
Preamble10
11
The licenses for most software are designed to take away your12
freedom to share and change it. By contrast, the GNU General Public13
License is intended to guarantee your freedom to share and change free14
software--to make sure the software is free for all its users. This15
General Public License applies to most of the Free Software16
Foundation's software and to any other program whose authors commit to17
using it. (Some other Free Software Foundation software is covered by18
the GNU Lesser General Public License instead.) You can apply it to19
your programs, too.20
21
When we speak of free software, we are referring to freedom, not22
price. Our General Public Licenses are designed to make sure that you23
have the freedom to distribute copies of free software (and charge for24
this service if you wish), that you receive source code or can get it25
if you want it, that you can change the software or use pieces of it26
in new free programs; and that you know you can do these things.27
28
To protect your rights, we need to make restrictions that forbid29
anyone to deny you these rights or to ask you to surrender the rights.30
These restrictions translate to certain responsibilities for you if you31
distribute copies of the software, or if you modify it.32
33
For example, if you distribute copies of such a program, whether34
gratis or for a fee, you must give the recipients all the rights that35
you have. You must make sure that they, too, receive or can get the36
source code. And you must show them these terms so they know their37
rights.38
39
We protect your rights with two steps: (1) copyright the software, and40
(2) offer you this license which gives you legal permission to copy,41
distribute and/or modify the software.42
43
Also, for each author's protection and ours, we want to make certain44
that everyone understands that there is no warranty for this free45
software. If the software is modified by someone else and passed on, we46
want its recipients to know that what they have is not the original, so47
that any problems introduced by others will not reflect on the original48
authors' reputations.49
50
Finally, any free program is threatened constantly by software51
patents. We wish to avoid the danger that redistributors of a free52
program will individually obtain patent licenses, in effect making the53
program proprietary. To prevent this, we have made it clear that any54
patent must be licensed for everyone's free use or not licensed at all.55
56
The precise terms and conditions for copying, distribution and57
modification follow.58
59
GNU GENERAL PUBLIC LICENSE60
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION61
62
0. This License applies to any program or other work which contains63
a notice placed by the copyright holder saying it may be distributed64
under the terms of this General Public License. The "Program", below,65
refers to any such program or work, and a "work based on the Program"66
means either the Program or any derivative work under copyright law:67
that is to say, a work containing the Program or a portion of it,68
either verbatim or with modifications and/or translated into another69
language. (Hereinafter, translation is included without limitation in70
the term "modification".) Each licensee is addressed as "you".71
72
Activities other than copying, distribution and modification are not73
covered by this License; they are outside its scope. The act of74
running the Program is not restricted, and the output from the Program75
is covered only if its contents constitute a work based on the76
Program (independent of having been made by running the Program).77
Whether that is true depends on what the Program does.78
79
1. You may copy and distribute verbatim copies of the Program's80
source code as you receive it, in any medium, provided that you81
conspicuously and appropriately publish on each copy an appropriate82
copyright notice and disclaimer of warranty; keep intact all the83
notices that refer to this License and to the absence of any warranty;84
and give any other recipients of the Program a copy of this License85
along with the Program.86
87
You may charge a fee for the physical act of transferring a copy, and88
you may at your option offer warranty protection in exchange for a fee.89
90
2. You may modify your copy or copies of the Program or any portion91
of it, thus forming a work based on the Program, and copy and92
distribute such modifications or work under the terms of Section 193
above, provided that you also meet all of these conditions:94
95
a) You must cause the modified files to carry prominent notices96
stating that you changed the files and the date of any change.97
98
b) You must cause any work that you distribute or publish, that in99
whole or in part contains or is derived from the Program or any100
part thereof, to be licensed as a whole at no charge to all third101
parties under the terms of this License.102
103
c) If the modified program normally reads commands interactively104
when run, you must cause it, when started running for such105
interactive use in the most ordinary way, to print or display an106
announcement including an appropriate copyright notice and a107
notice that there is no warranty (or else, saying that you provide108
a warranty) and that users may redistribute the program under109
these conditions, and telling the user how to view a copy of this110
License. (Exception: if the Program itself is interactive but111
does not normally print such an announcement, your work based on112
the Program is not required to print an announcement.)113
114
These requirements apply to the modified work as a whole. If115
identifiable sections of that work are not derived from the Program,116
and can be reasonably considered independent and separate works in117
themselves, then this License, and its terms, do not apply to those118
sections when you distribute them as separate works. But when you119
distribute the same sections as part of a whole which is a work based120
on the Program, the distribution of the whole must be on the terms of121
this License, whose permissions for other licensees extend to the122
entire whole, and thus to each and every part regardless of who wrote it.123
124
Thus, it is not the intent of this section to claim rights or contest125
your rights to work written entirely by you; rather, the intent is to126
exercise the right to control the distribution of derivative or127
collective works based on the Program.128
129
In addition, mere aggregation of another work not based on the Program130
with the Program (or with a work based on the Program) on a volume of131
a storage or distribution medium does not bring the other work under132
the scope of this License.133
134
3. You may copy and distribute the Program (or a work based on it,135
under Section 2) in object code or executable form under the terms of136
Sections 1 and 2 above provided that you also do one of the following:137
138
a) Accompany it with the complete corresponding machine-readable139
source code, which must be distributed under the terms of Sections140
1 and 2 above on a medium customarily used for software interchange; or,141
142
b) Accompany it with a written offer, valid for at least three143
years, to give any third party, for a charge no more than your144
cost of physically performing source distribution, a complete145
machine-readable copy of the corresponding source code, to be146
distributed under the terms of Sections 1 and 2 above on a medium147
customarily used for software interchange; or,148
149
c) Accompany it with the information you received as to the offer150
to distribute corresponding source code. (This alternative is151
allowed only for noncommercial distribution and only if you152
received the program in object code or executable form with such153
an offer, in accord with Subsection b above.)154
155
The source code for a work means the preferred form of the work for156
making modifications to it. For an executable work, complete source157
code means all the source code for all modules it contains, plus any158
associated interface definition files, plus the scripts used to159
control compilation and installation of the executable. However, as a160
special exception, the source code distributed need not include161
anything that is normally distributed (in either source or binary162
form) with the major components (compiler, kernel, and so on) of the163
operating system on which the executable runs, unless that component164
itself accompanies the executable.165
166
If distribution of executable or object code is made by offering167
access to copy from a designated place, then offering equivalent168
access to copy the source code from the same place counts as169
distribution of the source code, even though third parties are not170
compelled to copy the source along with the object code.171
172
4. You may not copy, modify, sublicense, or distribute the Program173
except as expressly provided under this License. Any attempt174
otherwise to copy, modify, sublicense or distribute the Program is175
void, and will automatically terminate your rights under this License.176
However, parties who have received copies, or rights, from you under177
this License will not have their licenses terminated so long as such178
parties remain in full compliance.179
180
5. You are not required to accept this License, since you have not181
signed it. However, nothing else grants you permission to modify or182
distribute the Program or its derivative works. These actions are183
prohibited by law if you do not accept this License. Therefore, by184
modifying or distributing the Program (or any work based on the185
Program), you indicate your acceptance of this License to do so, and186
all its terms and conditions for copying, distributing or modifying187
the Program or works based on it.188
189
6. Each time you redistribute the Program (or any work based on the190
Program), the recipient automatically receives a license from the191
original licensor to copy, distribute or modify the Program subject to192
these terms and conditions. You may not impose any further193
restrictions on the recipients' exercise of the rights granted herein.194
You are not responsible for enforcing compliance by third parties to195
this License.196
197
7. If, as a consequence of a court judgment or allegation of patent198
infringement or for any other reason (not limited to patent issues),199
conditions are imposed on you (whether by court order, agreement or200
otherwise) that contradict the conditions of this License, they do not201
excuse you from the conditions of this License. If you cannot202
distribute so as to satisfy simultaneously your obligations under this203
License and any other pertinent obligations, then as a consequence you204
may not distribute the Program at all. For example, if a patent205
license would not permit royalty-free redistribution of the Program by206
all those who receive copies directly or indirectly through you, then207
the only way you could satisfy both it and this License would be to208
refrain entirely from distribution of the Program.209
210
If any portion of this section is held invalid or unenforceable under211
any particular circumstance, the balance of the section is intended to212
apply and the section as a whole is intended to apply in other213
circumstances.214
215
It is not the purpose of this section to induce you to infringe any216
patents or other property right claims or to contest validity of any217
such claims; this section has the sole purpose of protecting the218
integrity of the free software distribution system, which is219
implemented by public license practices. Many people have made220
generous contributions to the wide range of software distributed221
through that system in reliance on consistent application of that222
system; it is up to the author/donor to decide if he or she is willing223
to distribute software through any other system and a licensee cannot224
impose that choice.225
226
This section is intended to make thoroughly clear what is believed to227
be a consequence of the rest of this License.228
229
8. If the distribution and/or use of the Program is restricted in230
certain countries either by patents or by copyrighted interfaces, the231
original copyright holder who places the Program under this License232
may add an explicit geographical distribution limitation excluding233
those countries, so that distribution is permitted only in or among234
countries not thus excluded. In such case, this License incorporates235
the limitation as if written in the body of this License.236
237
9. The Free Software Foundation may publish revised and/or new versions238
of the General Public License from time to time. Such new versions will239
be similar in spirit to the present version, but may differ in detail to240
address new problems or concerns.241
242
Each version is given a distinguishing version number. If the Program243
specifies a version number of this License which applies to it and "any244
later version", you have the option of following the terms and conditions245
either of that version or of any later version published by the Free246
Software Foundation. If the Program does not specify a version number of247
this License, you may choose any version ever published by the Free Software248
Foundation.249
250
10. If you wish to incorporate parts of the Program into other free251
programs whose distribution conditions are different, write to the author252
to ask for permission. For software which is copyrighted by the Free253
Software Foundation, write to the Free Software Foundation; we sometimes254
make exceptions for this. Our decision will be guided by the two goals255
of preserving the free status of all derivatives of our free software and256
of promoting the sharing and reuse of software generally.257
258
NO WARRANTY259
260
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY261
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN262
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES263
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED264
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF265
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS266
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE267
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,268
REPAIR OR CORRECTION.269
270
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING271
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR272
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,273
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING274
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED275
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY276
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER277
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE278
POSSIBILITY OF SUCH DAMAGES.279
280
END OF TERMS AND CONDITIONS281
282
How to Apply These Terms to Your New Programs283
284
If you develop a new program, and you want it to be of the greatest285
possible use to the public, the best way to achieve this is to make it286
free software which everyone can redistribute and change under these terms.287
288
To do so, attach the following notices to the program. It is safest289
to attach them to the start of each source file to most effectively290
convey the exclusion of warranty; and each file should have at least291
the "copyright" line and a pointer to where the full notice is found.292
293
<one line to give the program's name and a brief idea of what it does.>294
Copyright (C) <year> <name of author>295
296
This program is free software; you can redistribute it and/or modify297
it under the terms of the GNU General Public License as published by298
the Free Software Foundation; either version 2 of the License, or299
(at your option) any later version.300
301
This program is distributed in the hope that it will be useful,302
but WITHOUT ANY WARRANTY; without even the implied warranty of303
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the304
GNU General Public License for more details.305
306
You should have received a copy of the GNU General Public License along307
with this program; if not, see <https://www.gnu.org/licenses/>.308
309
Also add information on how to contact you by electronic and paper mail.310
311
If the program is interactive, make it output a short notice like this312
when it starts in an interactive mode:313
314
Gnomovision version 69, Copyright (C) year name of author315
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.316
This is free software, and you are welcome to redistribute it317
under certain conditions; type `show c' for details.318
319
The hypothetical commands `show w' and `show c' should show the appropriate320
parts of the General Public License. Of course, the commands you use may321
be called something other than `show w' and `show c'; they could even be322
mouse-clicks or menu items--whatever suits your program.323
324
You should also get your employer (if you work as a programmer) or your325
school, if any, to sign a "copyright disclaimer" for the program, if326
necessary. Here is a sample; alter the names:327
328
Yoyodyne, Inc., hereby disclaims all copyright interest in the program329
`Gnomovision' (which makes passes at compilers) written by James Hacker.330
331
<signature of Moe Ghoul>, 1 April 1989332
Moe Ghoul, President of Vice333
334
This General Public License does not permit incorporating your program into335
proprietary programs. If your program is a subroutine library, you may336
consider it more useful to permit linking proprietary applications with the337
library. If this is what you want to do, use the GNU Lesser General338
Public License instead of this License.@@ -0,0 +1,95 @@
1
# Click Tween voor KDE Plasma 6.7 / Wayland
2
3
De muisaanwijzer krimpt naar 80% in 150 ms wanneer links of rechts wordt
4
ingedrukt. Hij blijft klein tijdens vasthouden en slepen en groeit in 720 ms
5
terug na loslaten. Bij beide knoppen tegelijk blijft hij klein totdat beide
6
los zijn. De middelste knop verandert de animatie niet.
7
8
Het effect schaalt KWin's bestaande cursor rond zijn hotspot. Cursorvorm,
9
zichtbaarheid en positie blijven door KWin beheerd. Het onderschept geen
10
klikken. Bij uitschakelen en schermvergrendeling wordt de schaal hersteld.
11
12
## Instellingen
13
14
Open Systeeminstellingen → Bureaubladeffecten → Click Tween en klik op de
15
instellingenknop. Meld na een plugin-update één keer af en opnieuw aan.
16
KWin/Qt houdt native plugincode in het geheugen; uit-/aanvinken of alleen
17
Systeeminstellingen heropenen laadt een vervangen bibliotheek niet opnieuw.
18
Daarna werken gewone instellingenwijzigingen direct via Toepassen, zonder afmelden.
19
20
- Klik-tween-tijd: 0–5000 ms, standaard 150 ms.
21
- Release-tween-tijd: 0–5000 ms, standaard 720 ms.
22
- Afzonderlijke easing: standaard easeOutBack voor klik en easeOutElastic voor release.
23
- 31 keuzes: Linear plus In, Out en InOut voor Sine, Quad, Cubic, Quart,
24
Quint, Expo, Circ, Back, Elastic en Bounce, zoals op https://easings.net/.
25
De implementatie gebruikt Qt QEasingCurve; curveparameters zijn Qt-standaardwaarden.
26
27
0 ms betekent direct. Back en Elastic kunnen voorbij de eindgrootte veren.
28
Toepassen bewaart de instellingen in `~/.config/kwinrc`, groep
29
`Effect-clicktween`, en werkt direct voor de volgende animatie.
30
Standaardinstellingen herstelt de oorspronkelijke tijden en curves.
31
De klik wordt niet vertraagd: de animatie begint bij het indrukken.
32
33
## Installeren
34
35
Voor jouw Arch-gebaseerde systeem met KWin 6.7.x:
36
37
```bash
38
cd ~/kwin-click-tween
39
./install.sh
40
```
41
42
Het script bouwt lokaal, vraagt sudo voor de plugin in de systeemmap,
43
en schakelt hem voor de huidige gebruiker direct en blijvend in, ook bij
44
een herinstallatie. Bestaande animatie-instellingen blijven behouden; zonder
45
opgeslagen instellingen gelden de bovenstaande standaardwaarden.
46
Bij een update blijft af- en aanmelden nodig om de nieuwe plugincode te laden. Start het script als je eigen
47
gebruiker, niet met `sudo ./install.sh`. Bouwvereisten: `gcc`, `pkgconf`,
48
`kwin`, `qt6-base`, `qt6-declarative`, `kcoreaddons`, `kconfig`,
49
`kcmutils`, `kwindowsystem`, `wayland`, `libepoxy` en `libdrm`.
50
De meeste zijn al onderdeel van jouw Plasma-installatie.
51
52
Alleen bouwen zonder installeren of instellingen wijzigen:
53
54
```bash
55
./install.sh --build-only
56
```
57
58
## Uitschakelen of verwijderen
59
60
Uitschakelen kan via Systeeminstellingen → Bureaubladeffecten → Click Tween,
61
of via:
62
63
```bash
64
kwriteconfig6 --file kwinrc --group Plugins --key kwin_effect_clicktweenEnabled false
65
qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.unloadEffect kwin_effect_clicktween
66
```
67
68
Volledig verwijderen:
69
70
```bash
71
./install.sh --uninstall
72
```
73
74
## Compatibiliteit en controle
75
76
Dit is een experimentele native plugin voor de interne KWin 6.7 API.
77
Na een KWin-update voer je het installatiescript opnieuw uit. Andere
78
KWin-minorversies worden geweigerd totdat de code daarvoor is gecontroleerd.
79
De plugin draait in KWin zelf; bewaar open werk voordat je de eerste keer
80
installeert. Gelijktijdige cursor-effecten zoals Shake Cursor of Zoom kunnen
81
hun eigen cursor tekenen en moeten apart worden gecontroleerd.
82
83
Handmatig controleren na installatie:
84
85
- Links en rechts: korte klik, vasthouden, slepen en snel herhaald klikken.
86
- Beide knoppen indrukken; één loslaten mag de cursor niet herstellen.
87
- Test pijl, tekstcursor en handje, ook in XWayland-apps.
88
- Controleer op meerdere schermen met verschillende schaalfactoren.
89
- Uitschakelen tijdens vasthouden moet de oorspronkelijke grootte herstellen.
90
91
De buildcontrole controleert compileren, linken, metadata en het laden van
92
de pluginfactory tegen de lokale KWin-versie. Visueel gedrag moet nog in een
93
actieve sessie worden getest.
94
95
Licentie: GPL-2.0-or-later.
@@ -0,0 +1,95 @@1
# Click Tween voor KDE Plasma 6.7 / Wayland2
3
De muisaanwijzer krimpt naar 80% in 150 ms wanneer links of rechts wordt4
ingedrukt. Hij blijft klein tijdens vasthouden en slepen en groeit in 720 ms5
terug na loslaten. Bij beide knoppen tegelijk blijft hij klein totdat beide6
los zijn. De middelste knop verandert de animatie niet.7
8
Het effect schaalt KWin's bestaande cursor rond zijn hotspot. Cursorvorm,9
zichtbaarheid en positie blijven door KWin beheerd. Het onderschept geen10
klikken. Bij uitschakelen en schermvergrendeling wordt de schaal hersteld.11
12
## Instellingen13
14
Open Systeeminstellingen → Bureaubladeffecten → Click Tween en klik op de15
instellingenknop. Meld na een plugin-update één keer af en opnieuw aan.16
KWin/Qt houdt native plugincode in het geheugen; uit-/aanvinken of alleen17
Systeeminstellingen heropenen laadt een vervangen bibliotheek niet opnieuw.18
Daarna werken gewone instellingenwijzigingen direct via Toepassen, zonder afmelden.19
20
- Klik-tween-tijd: 0–5000 ms, standaard 150 ms.21
- Release-tween-tijd: 0–5000 ms, standaard 720 ms.22
- Afzonderlijke easing: standaard easeOutBack voor klik en easeOutElastic voor release.23
- 31 keuzes: Linear plus In, Out en InOut voor Sine, Quad, Cubic, Quart,24
Quint, Expo, Circ, Back, Elastic en Bounce, zoals op https://easings.net/.25
De implementatie gebruikt Qt QEasingCurve; curveparameters zijn Qt-standaardwaarden.26
27
0 ms betekent direct. Back en Elastic kunnen voorbij de eindgrootte veren.28
Toepassen bewaart de instellingen in `~/.config/kwinrc`, groep29
`Effect-clicktween`, en werkt direct voor de volgende animatie.30
Standaardinstellingen herstelt de oorspronkelijke tijden en curves.31
De klik wordt niet vertraagd: de animatie begint bij het indrukken.32
33
## Installeren34
35
Voor jouw Arch-gebaseerde systeem met KWin 6.7.x:36
37
```bash38
cd ~/kwin-click-tween39
./install.sh40
```41
42
Het script bouwt lokaal, vraagt sudo voor de plugin in de systeemmap,43
en schakelt hem voor de huidige gebruiker direct en blijvend in, ook bij44
een herinstallatie. Bestaande animatie-instellingen blijven behouden; zonder45
opgeslagen instellingen gelden de bovenstaande standaardwaarden.46
Bij een update blijft af- en aanmelden nodig om de nieuwe plugincode te laden. Start het script als je eigen47
gebruiker, niet met `sudo ./install.sh`. Bouwvereisten: `gcc`, `pkgconf`,48
`kwin`, `qt6-base`, `qt6-declarative`, `kcoreaddons`, `kconfig`,49
`kcmutils`, `kwindowsystem`, `wayland`, `libepoxy` en `libdrm`.50
De meeste zijn al onderdeel van jouw Plasma-installatie.51
52
Alleen bouwen zonder installeren of instellingen wijzigen:53
54
```bash55
./install.sh --build-only56
```57
58
## Uitschakelen of verwijderen59
60
Uitschakelen kan via Systeeminstellingen → Bureaubladeffecten → Click Tween,61
of via:62
63
```bash64
kwriteconfig6 --file kwinrc --group Plugins --key kwin_effect_clicktweenEnabled false65
qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.unloadEffect kwin_effect_clicktween66
```67
68
Volledig verwijderen:69
70
```bash71
./install.sh --uninstall72
```73
74
## Compatibiliteit en controle75
76
Dit is een experimentele native plugin voor de interne KWin 6.7 API.77
Na een KWin-update voer je het installatiescript opnieuw uit. Andere78
KWin-minorversies worden geweigerd totdat de code daarvoor is gecontroleerd.79
De plugin draait in KWin zelf; bewaar open werk voordat je de eerste keer80
installeert. Gelijktijdige cursor-effecten zoals Shake Cursor of Zoom kunnen81
hun eigen cursor tekenen en moeten apart worden gecontroleerd.82
83
Handmatig controleren na installatie:84
85
- Links en rechts: korte klik, vasthouden, slepen en snel herhaald klikken.86
- Beide knoppen indrukken; één loslaten mag de cursor niet herstellen.87
- Test pijl, tekstcursor en handje, ook in XWayland-apps.88
- Controleer op meerdere schermen met verschillende schaalfactoren.89
- Uitschakelen tijdens vasthouden moet de oorspronkelijke grootte herstellen.90
91
De buildcontrole controleert compileren, linken, metadata en het laden van92
de pluginfactory tegen de lokale KWin-versie. Visueel gedrag moet nog in een93
actieve sessie worden getest.94
95
Licentie: GPL-2.0-or-later.@@ -0,0 +1,67 @@
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
#include "settings.h"
3
#include <QApplication>
4
#include <QPluginLoader>
5
#include <KPluginFactory>
6
#include <KCModule>
7
#include <QComboBox>
8
#include <QSpinBox>
9
#include <cmath>
10
#include <QDBusConnection>
11
#include <QElapsedTimer>
12
#include <QThread>
13
class EffectReceiver : public QObject {
14
Q_OBJECT
15
Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.Effects")
16
public:
17
QString received;
18
public slots:
19
void reconfigureEffect(const QString &name) { received = name; }
20
};
21
int main(int argc, char **argv) {
22
QApplication app(argc, argv);
23
EffectReceiver receiver;
24
auto bus = QDBusConnection::sessionBus();
25
if (!bus.registerService(QStringLiteral("org.kde.KWin")) ||
26
!bus.registerObject(QStringLiteral("/Effects"), &receiver, QDBusConnection::ExportAllSlots)) return 9;
27
QPluginLoader loader(QString::fromLocal8Bit(argv[1]));
28
auto *factory = qobject_cast<KPluginFactory *>(loader.instance());
29
if (!factory) return 1;
30
auto *module = factory->create<KCModule>();
31
if (!module) return 2;
32
const auto combos = module->widget()->findChildren<QComboBox *>();
33
const auto spins = module->widget()->findChildren<QSpinBox *>();
34
if (combos.size() != 2 || spins.size() != 2) return 3;
35
for (auto *combo : combos) if (combo->count() != 31) return 4;
36
auto hasDefaults = [&] {
37
return spins[0]->value() == 150 && spins[1]->value() == 720
38
&& combos[0]->currentText() == QLatin1String("easeOutBack")
39
&& combos[1]->currentText() == QLatin1String("easeOutElastic");
40
};
41
if (!hasDefaults()) return 5;
42
spins[0]->setValue(42);
43
combos[0]->setCurrentText(QStringLiteral("Linear"));
44
module->defaults();
45
if (!hasDefaults()) return 5;
46
spins[0]->setValue(333);
47
combos[1]->setCurrentText(QStringLiteral("easeOutElastic"));
48
module->save();
49
QElapsedTimer timer;
50
timer.start();
51
while (receiver.received.isEmpty() && timer.elapsed() < 2000) {
52
app.processEvents();
53
QThread::msleep(1);
54
}
55
if (receiver.received != QLatin1String("kwin_effect_clicktween")) return 10;
56
module->load();
57
if (spins[0]->value() != 333 || combos[1]->currentText() != QLatin1String("easeOutElastic")) return 6;
58
for (const auto &entry : ClickTween::curves) {
59
QEasingCurve curve(ClickTween::curveType(QString::fromLatin1(entry.name)));
60
if (std::abs(curve.valueForProgress(0)) > 1e-6 || std::abs(curve.valueForProgress(1) - 1) > 1e-6) return 7;
61
for (int i = 0; i <= 100; ++i) if (!std::isfinite(curve.valueForProgress(i / 100.0))) return 8;
62
}
63
delete module;
64
return 0;
65
}
66
67
#include "check-config.moc"
@@ -0,0 +1,67 @@1
// SPDX-License-Identifier: GPL-2.0-or-later2
#include "settings.h"3
#include <QApplication>4
#include <QPluginLoader>5
#include <KPluginFactory>6
#include <KCModule>7
#include <QComboBox>8
#include <QSpinBox>9
#include <cmath>10
#include <QDBusConnection>11
#include <QElapsedTimer>12
#include <QThread>13
class EffectReceiver : public QObject {14
Q_OBJECT15
Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.Effects")16
public:17
QString received;18
public slots:19
void reconfigureEffect(const QString &name) { received = name; }20
};21
int main(int argc, char **argv) {22
QApplication app(argc, argv);23
EffectReceiver receiver;24
auto bus = QDBusConnection::sessionBus();25
if (!bus.registerService(QStringLiteral("org.kde.KWin")) ||26
!bus.registerObject(QStringLiteral("/Effects"), &receiver, QDBusConnection::ExportAllSlots)) return 9;27
QPluginLoader loader(QString::fromLocal8Bit(argv[1]));28
auto *factory = qobject_cast<KPluginFactory *>(loader.instance());29
if (!factory) return 1;30
auto *module = factory->create<KCModule>();31
if (!module) return 2;32
const auto combos = module->widget()->findChildren<QComboBox *>();33
const auto spins = module->widget()->findChildren<QSpinBox *>();34
if (combos.size() != 2 || spins.size() != 2) return 3;35
for (auto *combo : combos) if (combo->count() != 31) return 4;36
auto hasDefaults = [&] {37
return spins[0]->value() == 150 && spins[1]->value() == 72038
&& combos[0]->currentText() == QLatin1String("easeOutBack")39
&& combos[1]->currentText() == QLatin1String("easeOutElastic");40
};41
if (!hasDefaults()) return 5;42
spins[0]->setValue(42);43
combos[0]->setCurrentText(QStringLiteral("Linear"));44
module->defaults();45
if (!hasDefaults()) return 5;46
spins[0]->setValue(333);47
combos[1]->setCurrentText(QStringLiteral("easeOutElastic"));48
module->save();49
QElapsedTimer timer;50
timer.start();51
while (receiver.received.isEmpty() && timer.elapsed() < 2000) {52
app.processEvents();53
QThread::msleep(1);54
}55
if (receiver.received != QLatin1String("kwin_effect_clicktween")) return 10;56
module->load();57
if (spins[0]->value() != 333 || combos[1]->currentText() != QLatin1String("easeOutElastic")) return 6;58
for (const auto &entry : ClickTween::curves) {59
QEasingCurve curve(ClickTween::curveType(QString::fromLatin1(entry.name)));60
if (std::abs(curve.valueForProgress(0)) > 1e-6 || std::abs(curve.valueForProgress(1) - 1) > 1e-6) return 7;61
for (int i = 0; i <= 100; ++i) if (!std::isfinite(curve.valueForProgress(i / 100.0))) return 8;62
}63
delete module;64
return 0;65
}66
67
#include "check-config.moc"@@ -0,0 +1,22 @@
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
// Validate the factory without constructing an effect or touching the desktop.
3
#include <QCoreApplication>
4
#include <QJsonObject>
5
#include <QPluginLoader>
6
#include <QDebug>
7
8
int main(int argc, char **argv)
9
{
10
QCoreApplication app(argc, argv);
11
if (argc != 2) {
12
return 2;
13
}
14
QPluginLoader loader(QString::fromLocal8Bit(argv[1]));
15
const auto metadata = loader.metaData().value("MetaData").toObject().value("KPlugin").toObject();
16
if (metadata.value("Id").toString() != "clicktween" || !loader.instance()) {
17
qCritical() << "Plugin check failed:" << loader.errorString();
18
return 1;
19
}
20
qInfo() << "Plugin metadata and factory loading: OK";
21
return 0;
22
}
@@ -0,0 +1,22 @@1
// SPDX-License-Identifier: GPL-2.0-or-later2
// Validate the factory without constructing an effect or touching the desktop.3
#include <QCoreApplication>4
#include <QJsonObject>5
#include <QPluginLoader>6
#include <QDebug>7
8
int main(int argc, char **argv)9
{10
QCoreApplication app(argc, argv);11
if (argc != 2) {12
return 2;13
}14
QPluginLoader loader(QString::fromLocal8Bit(argv[1]));15
const auto metadata = loader.metaData().value("MetaData").toObject().value("KPlugin").toObject();16
if (metadata.value("Id").toString() != "clicktween" || !loader.instance()) {17
qCritical() << "Plugin check failed:" << loader.errorString();18
return 1;19
}20
qInfo() << "Plugin metadata and factory loading: OK";21
return 0;22
}@@ -0,0 +1,99 @@
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
#include <effect/effect.h>
3
#include <effect/effecthandler.h>
4
#include <input.h>
5
#include <input_event.h>
6
#include <input_event_spy.h>
7
#include <scene/item.h>
8
#include <scene/workspacescene.h>
9
10
#include "settings.h"
11
#include <QPointer>
12
#include <QVariantAnimation>
13
14
namespace KWin {
15
16
class ClickTweenEffect final : public Effect, public InputEventSpy
17
{
18
Q_OBJECT
19
public:
20
ClickTweenEffect()
21
: m_cursor(effects->scene()->cursorItem())
22
, m_original(m_cursor->transform())
23
{
24
reconfigure(ReconfigureAll);
25
connect(&m_animation, &QVariantAnimation::valueChanged, this, [this](const QVariant &value) {
26
m_scale = value.toReal();
27
if (m_cursor) {
28
// CursorItem's origin is the hotspot, not the image corner.
29
m_cursor->setTransform(QTransform::fromScale(m_scale, m_scale) * m_original);
30
}
31
});
32
connect(effects, &EffectsHandler::screenLockingChanged, this, [this](bool) { reset(); });
33
input()->installInputEventSpy(this);
34
}
35
36
~ClickTweenEffect() override { reset(); }
37
38
void reconfigure(ReconfigureFlags) override
39
{
40
m_settings.read(KConfigGroup(effects->config(), QStringLiteral("Effect-clicktween")));
41
}
42
43
bool isActive() const override { return m_scale != 1.0; }
44
45
void pointerButton(PointerButtonEvent *event) override
46
{
47
updateButtons(event->buttons);
48
}
49
50
void pointerMotion(PointerMotionEvent *event) override
51
{
52
// Reconcile state after device removal or other changes between clicks.
53
updateButtons(event->buttons);
54
}
55
56
private:
57
void updateButtons(Qt::MouseButtons buttons)
58
{
59
if (effects->isScreenLocked()) {
60
reset();
61
return;
62
}
63
const bool pressed = bool(buttons & (Qt::LeftButton | Qt::RightButton));
64
if (pressed == m_pressed) {
65
return;
66
}
67
m_pressed = pressed;
68
m_animation.stop();
69
m_animation.setStartValue(m_scale);
70
m_animation.setEndValue(pressed ? 0.8 : 1.0);
71
m_animation.setDuration(pressed ? m_settings.clickTime : m_settings.releaseTime);
72
m_animation.setEasingCurve(ClickTween::curveType(pressed ? m_settings.clickEasing : m_settings.releaseEasing));
73
m_animation.start();
74
}
75
76
void reset()
77
{
78
m_animation.stop();
79
m_pressed = false;
80
m_scale = 1.0;
81
if (m_cursor) {
82
m_cursor->setTransform(m_original);
83
}
84
}
85
86
QPointer<Item> m_cursor;
87
QTransform m_original;
88
QVariantAnimation m_animation;
89
ClickTween::Settings m_settings;
90
qreal m_scale = 1.0;
91
bool m_pressed = false;
92
};
93
94
KWIN_EFFECT_FACTORY_SUPPORTED(ClickTweenEffect, "metadata.json",
95
return effects->scene() && effects->scene()->cursorItem();)
96
97
} // namespace KWin
98
99
#include "clicktween.moc"
@@ -0,0 +1,99 @@1
// SPDX-License-Identifier: GPL-2.0-or-later2
#include <effect/effect.h>3
#include <effect/effecthandler.h>4
#include <input.h>5
#include <input_event.h>6
#include <input_event_spy.h>7
#include <scene/item.h>8
#include <scene/workspacescene.h>9
10
#include "settings.h"11
#include <QPointer>12
#include <QVariantAnimation>13
14
namespace KWin {15
16
class ClickTweenEffect final : public Effect, public InputEventSpy17
{18
Q_OBJECT19
public:20
ClickTweenEffect()21
: m_cursor(effects->scene()->cursorItem())22
, m_original(m_cursor->transform())23
{24
reconfigure(ReconfigureAll);25
connect(&m_animation, &QVariantAnimation::valueChanged, this, [this](const QVariant &value) {26
m_scale = value.toReal();27
if (m_cursor) {28
// CursorItem's origin is the hotspot, not the image corner.29
m_cursor->setTransform(QTransform::fromScale(m_scale, m_scale) * m_original);30
}31
});32
connect(effects, &EffectsHandler::screenLockingChanged, this, [this](bool) { reset(); });33
input()->installInputEventSpy(this);34
}35
36
~ClickTweenEffect() override { reset(); }37
38
void reconfigure(ReconfigureFlags) override39
{40
m_settings.read(KConfigGroup(effects->config(), QStringLiteral("Effect-clicktween")));41
}42
43
bool isActive() const override { return m_scale != 1.0; }44
45
void pointerButton(PointerButtonEvent *event) override46
{47
updateButtons(event->buttons);48
}49
50
void pointerMotion(PointerMotionEvent *event) override51
{52
// Reconcile state after device removal or other changes between clicks.53
updateButtons(event->buttons);54
}55
56
private:57
void updateButtons(Qt::MouseButtons buttons)58
{59
if (effects->isScreenLocked()) {60
reset();61
return;62
}63
const bool pressed = bool(buttons & (Qt::LeftButton | Qt::RightButton));64
if (pressed == m_pressed) {65
return;66
}67
m_pressed = pressed;68
m_animation.stop();69
m_animation.setStartValue(m_scale);70
m_animation.setEndValue(pressed ? 0.8 : 1.0);71
m_animation.setDuration(pressed ? m_settings.clickTime : m_settings.releaseTime);72
m_animation.setEasingCurve(ClickTween::curveType(pressed ? m_settings.clickEasing : m_settings.releaseEasing));73
m_animation.start();74
}75
76
void reset()77
{78
m_animation.stop();79
m_pressed = false;80
m_scale = 1.0;81
if (m_cursor) {82
m_cursor->setTransform(m_original);83
}84
}85
86
QPointer<Item> m_cursor;87
QTransform m_original;88
QVariantAnimation m_animation;89
ClickTween::Settings m_settings;90
qreal m_scale = 1.0;91
bool m_pressed = false;92
};93
94
KWIN_EFFECT_FACTORY_SUPPORTED(ClickTweenEffect, "metadata.json",95
return effects->scene() && effects->scene()->cursorItem();)96
97
} // namespace KWin98
99
#include "clicktween.moc"@@ -0,0 +1,86 @@
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
#include "settings.h"
3
#include <KCModule>
4
#include <KPluginFactory>
5
#include <KSharedConfig>
6
#include <QComboBox>
7
#include <QDBusConnection>
8
#include <QDBusMessage>
9
#include <QDBusPendingCall>
10
#include <QFormLayout>
11
#include <QLabel>
12
#include <QSpinBox>
13
14
class ClickTweenConfig final : public KCModule
15
{
16
Q_OBJECT
17
public:
18
ClickTweenConfig(QObject *parent, const KPluginMetaData &data) : KCModule(parent, data) {
19
auto *layout = new QFormLayout(widget());
20
clickTime = new QSpinBox(widget());
21
releaseTime = new QSpinBox(widget());
22
clickEasing = new QComboBox(widget());
23
releaseEasing = new QComboBox(widget());
24
for (auto *spin : {clickTime, releaseTime}) {
25
spin->setRange(0, 5000);
26
spin->setSuffix(QStringLiteral(" ms"));
27
spin->setToolTip(QStringLiteral("0 ms = direct; maximaal 5000 ms."));
28
connect(spin, &QSpinBox::valueChanged, this, &ClickTweenConfig::changed);
29
}
30
for (auto *combo : {clickEasing, releaseEasing}) {
31
for (const auto &curve : ClickTween::curves) combo->addItem(QString::fromLatin1(curve.name));
32
combo->setMaxVisibleItems(16);
33
connect(combo, &QComboBox::currentIndexChanged, this, &ClickTweenConfig::changed);
34
}
35
layout->addRow(QStringLiteral("Klik-tween-tijd (krimpen):"), clickTime);
36
layout->addRow(QStringLiteral("Klik-easing:"), clickEasing);
37
layout->addRow(QStringLiteral("Release-tween-tijd (teruggroeien):"), releaseTime);
38
layout->addRow(QStringLiteral("Release-easing:"), releaseEasing);
39
auto *help = new QLabel(QStringLiteral("De cursor krimpt bij indrukken naar 80% en groeit bij loslaten terug.\nBack en Elastic kunnen voorbij de eindgrootte veren.\nIn versnelt, Out remt af, InOut doet beide.\nWijzigingen gelden na Toepassen voor de volgende animatie."), widget());
40
help->setWordWrap(true);
41
layout->addRow(help);
42
load();
43
}
44
void load() override {
45
auto config = KSharedConfig::openConfig(QStringLiteral("kwinrc"));
46
config->reparseConfiguration();
47
saved.read(KConfigGroup(config, QStringLiteral("Effect-clicktween")));
48
showSettings(saved);
49
}
50
void save() override {
51
KConfigGroup group(KSharedConfig::openConfig(QStringLiteral("kwinrc")), QStringLiteral("Effect-clicktween"));
52
group.writeEntry("ClickTweenTime", clickTime->value());
53
group.writeEntry("ReleaseTweenTime", releaseTime->value());
54
group.writeEntry("ClickEasing", clickEasing->currentText());
55
group.writeEntry("ReleaseEasing", releaseEasing->currentText());
56
group.sync();
57
saved.read(group);
58
changed();
59
auto message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KWin"), QStringLiteral("/Effects"), QStringLiteral("org.kde.kwin.Effects"), QStringLiteral("reconfigureEffect"));
60
message << QStringLiteral("kwin_effect_clicktween");
61
QDBusConnection::sessionBus().asyncCall(message);
62
}
63
void defaults() override { showSettings(ClickTween::Settings{}); }
64
private:
65
void showSettings(const ClickTween::Settings &s) {
66
clickTime->setValue(s.clickTime);
67
releaseTime->setValue(s.releaseTime);
68
clickEasing->setCurrentText(s.clickEasing);
69
releaseEasing->setCurrentText(s.releaseEasing);
70
changed();
71
}
72
void changed() {
73
setNeedsSave(clickTime->value() != saved.clickTime || releaseTime->value() != saved.releaseTime
74
|| clickEasing->currentText() != saved.clickEasing || releaseEasing->currentText() != saved.releaseEasing);
75
const ClickTween::Settings defaults;
76
setRepresentsDefaults(clickTime->value() == defaults.clickTime && releaseTime->value() == defaults.releaseTime
77
&& clickEasing->currentText() == defaults.clickEasing && releaseEasing->currentText() == defaults.releaseEasing);
78
}
79
QSpinBox *clickTime;
80
QSpinBox *releaseTime;
81
QComboBox *clickEasing;
82
QComboBox *releaseEasing;
83
ClickTween::Settings saved;
84
};
85
K_PLUGIN_CLASS_WITH_JSON(ClickTweenConfig, "config-metadata.json")
86
#include "clicktween_config.moc"
@@ -0,0 +1,86 @@1
// SPDX-License-Identifier: GPL-2.0-or-later2
#include "settings.h"3
#include <KCModule>4
#include <KPluginFactory>5
#include <KSharedConfig>6
#include <QComboBox>7
#include <QDBusConnection>8
#include <QDBusMessage>9
#include <QDBusPendingCall>10
#include <QFormLayout>11
#include <QLabel>12
#include <QSpinBox>13
14
class ClickTweenConfig final : public KCModule15
{16
Q_OBJECT17
public:18
ClickTweenConfig(QObject *parent, const KPluginMetaData &data) : KCModule(parent, data) {19
auto *layout = new QFormLayout(widget());20
clickTime = new QSpinBox(widget());21
releaseTime = new QSpinBox(widget());22
clickEasing = new QComboBox(widget());23
releaseEasing = new QComboBox(widget());24
for (auto *spin : {clickTime, releaseTime}) {25
spin->setRange(0, 5000);26
spin->setSuffix(QStringLiteral(" ms"));27
spin->setToolTip(QStringLiteral("0 ms = direct; maximaal 5000 ms."));28
connect(spin, &QSpinBox::valueChanged, this, &ClickTweenConfig::changed);29
}30
for (auto *combo : {clickEasing, releaseEasing}) {31
for (const auto &curve : ClickTween::curves) combo->addItem(QString::fromLatin1(curve.name));32
combo->setMaxVisibleItems(16);33
connect(combo, &QComboBox::currentIndexChanged, this, &ClickTweenConfig::changed);34
}35
layout->addRow(QStringLiteral("Klik-tween-tijd (krimpen):"), clickTime);36
layout->addRow(QStringLiteral("Klik-easing:"), clickEasing);37
layout->addRow(QStringLiteral("Release-tween-tijd (teruggroeien):"), releaseTime);38
layout->addRow(QStringLiteral("Release-easing:"), releaseEasing);39
auto *help = new QLabel(QStringLiteral("De cursor krimpt bij indrukken naar 80% en groeit bij loslaten terug.\nBack en Elastic kunnen voorbij de eindgrootte veren.\nIn versnelt, Out remt af, InOut doet beide.\nWijzigingen gelden na Toepassen voor de volgende animatie."), widget());40
help->setWordWrap(true);41
layout->addRow(help);42
load();43
}44
void load() override {45
auto config = KSharedConfig::openConfig(QStringLiteral("kwinrc"));46
config->reparseConfiguration();47
saved.read(KConfigGroup(config, QStringLiteral("Effect-clicktween")));48
showSettings(saved);49
}50
void save() override {51
KConfigGroup group(KSharedConfig::openConfig(QStringLiteral("kwinrc")), QStringLiteral("Effect-clicktween"));52
group.writeEntry("ClickTweenTime", clickTime->value());53
group.writeEntry("ReleaseTweenTime", releaseTime->value());54
group.writeEntry("ClickEasing", clickEasing->currentText());55
group.writeEntry("ReleaseEasing", releaseEasing->currentText());56
group.sync();57
saved.read(group);58
changed();59
auto message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KWin"), QStringLiteral("/Effects"), QStringLiteral("org.kde.kwin.Effects"), QStringLiteral("reconfigureEffect"));60
message << QStringLiteral("kwin_effect_clicktween");61
QDBusConnection::sessionBus().asyncCall(message);62
}63
void defaults() override { showSettings(ClickTween::Settings{}); }64
private:65
void showSettings(const ClickTween::Settings &s) {66
clickTime->setValue(s.clickTime);67
releaseTime->setValue(s.releaseTime);68
clickEasing->setCurrentText(s.clickEasing);69
releaseEasing->setCurrentText(s.releaseEasing);70
changed();71
}72
void changed() {73
setNeedsSave(clickTime->value() != saved.clickTime || releaseTime->value() != saved.releaseTime74
|| clickEasing->currentText() != saved.clickEasing || releaseEasing->currentText() != saved.releaseEasing);75
const ClickTween::Settings defaults;76
setRepresentsDefaults(clickTime->value() == defaults.clickTime && releaseTime->value() == defaults.releaseTime77
&& clickEasing->currentText() == defaults.clickEasing && releaseEasing->currentText() == defaults.releaseEasing);78
}79
QSpinBox *clickTime;80
QSpinBox *releaseTime;81
QComboBox *clickEasing;82
QComboBox *releaseEasing;83
ClickTween::Settings saved;84
};85
K_PLUGIN_CLASS_WITH_JSON(ClickTweenConfig, "config-metadata.json")86
#include "clicktween_config.moc"@@ -0,0 +1 @@
1
{"KPlugin":{"Id":"kwin_clicktween_config","Name":"Click Tween","License":"GPL-2.0-or-later"}}
@@ -0,0 +1 @@1
{"KPlugin":{"Id":"kwin_clicktween_config","Name":"Click Tween","License":"GPL-2.0-or-later"}}@@ -0,0 +1,12 @@
1
[Trigger]
2
Operation = Install
3
Operation = Upgrade
4
Type = Package
5
Target = kwin
6
7
[Action]
8
Description = Click Tween KWin-effect opnieuw bouwen...
9
When = PostTransaction
10
Depends = gcc
11
Depends = pkgconf
12
Exec = /usr/local/bin/rebuild-clicktween
@@ -0,0 +1,12 @@1
[Trigger]2
Operation = Install3
Operation = Upgrade4
Type = Package5
Target = kwin6
7
[Action]8
Description = Click Tween KWin-effect opnieuw bouwen...9
When = PostTransaction10
Depends = gcc11
Depends = pkgconf12
Exec = /usr/local/bin/rebuild-clicktween@@ -0,0 +1,25 @@
1
#!/usr/bin/env bash
2
# Herbouwt kwin_effect_clicktween na een kwin-upgrade. Laat pacman nooit falen.
3
LOG=/var/log/clicktween-rebuild.log
4
SRC=/home/timfa/Projecten/kwin-click-tween-6.8
5
USER_NAME=timfa
6
PLUGIN=/usr/lib/qt6/plugins/kwin/effects/plugins/kwin_effect_clicktween.so
7
CONFIG=/usr/lib/qt6/plugins/kwin/effects/configs/kwin_clicktween_config.so
8
{
9
echo "=== $(date '+%F %T') rebuild clicktween (kwin $(pacman -Q kwin 2>/dev/null)) ==="
10
if ! runuser -u "$USER_NAME" -- bash -c "cd '$SRC' && rm -rf build && ./install.sh --build-only"; then
11
echo "FOUT: bouwen mislukt; oud effect blijft staan."; exit 0
12
fi
13
install -Dm755 "$SRC/build/kwin_effect_clicktween.so" "$PLUGIN.new" && mv -f "$PLUGIN.new" "$PLUGIN" &&
14
install -Dm755 "$SRC/build/kwin_clicktween_config.so" "$CONFIG.new" && mv -f "$CONFIG.new" "$CONFIG" ||
15
{ echo "FOUT: installeren mislukt."; exit 0; }
16
echo "Geïnstalleerd. Meld af en opnieuw aan (KWin laadt nieuwe plugincode pas in een nieuwe sessie)."
17
uid=$(id -u "$USER_NAME")
18
if [[ -S /run/user/$uid/bus ]]; then
19
r=$(runuser -u "$USER_NAME" -- env XDG_RUNTIME_DIR=/run/user/$uid DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus \
20
qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.loadEffect kwin_effect_clicktween 2>&1)
21
echo "loadEffect: $r"
22
fi
23
} >>"$LOG" 2>&1
24
echo "clicktween: zie $LOG (opnieuw aanmelden kan nodig zijn)"
25
exit 0
@@ -0,0 +1,25 @@1
#!/usr/bin/env bash2
# Herbouwt kwin_effect_clicktween na een kwin-upgrade. Laat pacman nooit falen.3
LOG=/var/log/clicktween-rebuild.log4
SRC=/home/timfa/Projecten/kwin-click-tween-6.85
USER_NAME=timfa6
PLUGIN=/usr/lib/qt6/plugins/kwin/effects/plugins/kwin_effect_clicktween.so7
CONFIG=/usr/lib/qt6/plugins/kwin/effects/configs/kwin_clicktween_config.so8
{9
echo "=== $(date '+%F %T') rebuild clicktween (kwin $(pacman -Q kwin 2>/dev/null)) ==="10
if ! runuser -u "$USER_NAME" -- bash -c "cd '$SRC' && rm -rf build && ./install.sh --build-only"; then11
echo "FOUT: bouwen mislukt; oud effect blijft staan."; exit 012
fi13
install -Dm755 "$SRC/build/kwin_effect_clicktween.so" "$PLUGIN.new" && mv -f "$PLUGIN.new" "$PLUGIN" &&14
install -Dm755 "$SRC/build/kwin_clicktween_config.so" "$CONFIG.new" && mv -f "$CONFIG.new" "$CONFIG" ||15
{ echo "FOUT: installeren mislukt."; exit 0; }16
echo "Geïnstalleerd. Meld af en opnieuw aan (KWin laadt nieuwe plugincode pas in een nieuwe sessie)."17
uid=$(id -u "$USER_NAME")18
if [[ -S /run/user/$uid/bus ]]; then19
r=$(runuser -u "$USER_NAME" -- env XDG_RUNTIME_DIR=/run/user/$uid DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus \20
qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.loadEffect kwin_effect_clicktween 2>&1)21
echo "loadEffect: $r"22
fi23
} >>"$LOG" 2>&124
echo "clicktween: zie $LOG (opnieuw aanmelden kan nodig zijn)"25
exit 0@@ -0,0 +1,8 @@
1
#!/usr/bin/env bash
2
set -euo pipefail
3
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
4
sudo install -Dm755 rebuild-clicktween /usr/local/bin/rebuild-clicktween
5
sudo install -Dm644 kwin-clicktween.hook /etc/pacman.d/hooks/kwin-clicktween.hook
6
sudo /usr/local/bin/rebuild-clicktween
7
tail -n 8 /var/log/clicktween-rebuild.log
8
echo "Klaar. Meld af en opnieuw aan om het nieuwe effect te laden."
@@ -0,0 +1,8 @@1
#!/usr/bin/env bash2
set -euo pipefail3
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"4
sudo install -Dm755 rebuild-clicktween /usr/local/bin/rebuild-clicktween5
sudo install -Dm644 kwin-clicktween.hook /etc/pacman.d/hooks/kwin-clicktween.hook6
sudo /usr/local/bin/rebuild-clicktween7
tail -n 8 /var/log/clicktween-rebuild.log8
echo "Klaar. Meld af en opnieuw aan om het nieuwe effect te laden."@@ -0,0 +1,89 @@
1
#!/usr/bin/env bash
2
set -euo pipefail
3
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
4
5
mode=${1:-install}
6
case "$mode" in
7
install|--build-only|--uninstall) ;;
8
*) echo "Gebruik: $0 [--build-only|--uninstall]" >&2; exit 2 ;;
9
esac
10
if [[ $mode != --build-only ]]; then
11
[[ $EUID -ne 0 ]] || { echo 'Start dit script als gewone gebruiker, zonder sudo ervoor.' >&2; exit 1; }
12
for tool in sudo kwriteconfig6 qdbus6; do
13
command -v "$tool" >/dev/null || { echo "Ontbreekt: $tool" >&2; exit 1; }
14
done
15
fi
16
17
# This build intentionally targets Arch's Plasma 6.7 layout and private API.
18
plugin_dir=/usr/lib/qt6/plugins/kwin/effects/plugins
19
plugin_file=$plugin_dir/kwin_effect_clicktween.so
20
config_file=/usr/lib/qt6/plugins/kwin/effects/configs/kwin_clicktween_config.so
21
if [[ $mode == --uninstall ]]; then
22
kwriteconfig6 --file kwinrc --group Plugins --key kwin_effect_clicktweenEnabled false
23
qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.unloadEffect kwin_effect_clicktween || true
24
sudo rm -f -- "$plugin_file" "$config_file"
25
echo 'Click Tween verwijderd. Bij een D-Bus-fout: meld opnieuw aan.'
26
exit 0
27
fi
28
29
for tool in g++ pkg-config; do
30
command -v "$tool" >/dev/null || { echo "Ontbreekt: $tool. Installeer: sudo pacman -S --needed gcc pkgconf" >&2; exit 1; }
31
done
32
[[ -x /usr/lib/qt6/moc && -f /usr/include/kwin/config-kwin.h ]] || {
33
echo 'KWin/Qt-ontwikkelbestanden ontbreken. Nodig op Arch: kwin qt6-base qt6-declarative.' >&2
34
exit 1
35
}
36
version=$(sed -n 's/^#define KWIN_PLUGIN_VERSION_STRING "\([^"]*\)"/\1/p' /usr/include/kwin/config-kwin.h)
37
[[ $version == 6.[78].* ]] || { echo "Deze versie ondersteunt KWin 6.7.x en 6.8.x; gevonden: $version" >&2; exit 1; }
38
mkdir -p build
39
read -r -a qt_flags <<< "$(pkg-config --cflags Qt6Core Qt6Gui Qt6Quick Qt6DBus Qt6Widgets wayland-server epoxy libdrm)"
40
read -r -a qt_libs <<< "$(pkg-config --libs Qt6Core Qt6Gui Qt6Quick Qt6DBus Qt6Widgets wayland-server epoxy libdrm)"
41
includes=(-I/usr/include/kwin -I/usr/include/KF6/KCoreAddons -I/usr/include/KF6/KConfig -I/usr/include/KF6/KConfigCore -I/usr/include/KF6/KCMUtils -I/usr/include/KF6/KCMUtilsCore -I/usr/include/KF6/KWindowSystem -I. -Ibuild)
42
/usr/lib/qt6/moc "${qt_flags[@]}" "${includes[@]}" clicktween.cpp -o build/clicktween.moc
43
g++ -std=c++23 -O2 -Wall -Wextra -fPIC -shared -Wl,-z,defs \
44
"${qt_flags[@]}" "${includes[@]}" clicktween.cpp -o build/kwin_effect_clicktween.so \
45
-lkwin -lKF6CoreAddons -lKF6ConfigCore "${qt_libs[@]}"
46
/usr/lib/qt6/moc "${qt_flags[@]}" "${includes[@]}" clicktween_config.cpp -o build/clicktween_config.moc
47
g++ -std=c++23 -O2 -Wall -Wextra -fPIC -shared -Wl,-z,defs \
48
"${qt_flags[@]}" "${includes[@]}" clicktween_config.cpp -o build/kwin_clicktween_config.so \
49
-lKF6KCMUtils -lKF6KCMUtilsCore -lKF6CoreAddons -lKF6ConfigCore "${qt_libs[@]}"
50
g++ -std=c++17 -fPIC "${qt_flags[@]}" check-plugin.cpp -o build/check-plugin "${qt_libs[@]}"
51
build/check-plugin "$PWD/build/kwin_effect_clicktween.so"
52
/usr/lib/qt6/moc "${qt_flags[@]}" check-config.cpp -o build/check-config.moc
53
g++ -std=c++23 -fPIC "${qt_flags[@]}" "${includes[@]}" check-config.cpp -o build/check-config \
54
-lKF6KCMUtils -lKF6KCMUtilsCore -lKF6CoreAddons -lKF6ConfigCore "${qt_libs[@]}"
55
# Isolate configuration and D-Bus so the check cannot change the live desktop.
56
test_config=$(mktemp -d)
57
QT_QPA_PLATFORM=offscreen XDG_CONFIG_HOME="$test_config" \
58
dbus-run-session -- build/check-config "$PWD/build/kwin_clicktween_config.so"
59
rm -rf -- "$test_config"
60
echo "Gebouwd voor KWin $version; instellingenmodule en 31 curves gecontroleerd."
61
[[ $mode != --build-only ]] || exit 0
62
63
# Obtain credentials before touching the running effect.
64
sudo -v
65
66
# Qt keeps native plugin libraries resident (PreventUnloadHint). Recreating
67
# the effect does not reload updated machine code. Leave the running effect
68
# alone and replace files atomically; an upgrade requires a new KWin session.
69
upgrading=false
70
[[ ! -f "$plugin_file" ]] || upgrading=true
71
sudo install -Dm755 build/kwin_effect_clicktween.so "$plugin_file.new"
72
sudo mv -f -- "$plugin_file.new" "$plugin_file"
73
sudo install -Dm755 build/kwin_clicktween_config.so "$config_file.new"
74
sudo mv -f -- "$config_file.new" "$config_file"
75
# Animation defaults are compiled from settings.h (150 ms / easeOutBack,
76
# 720 ms / easeOutElastic). Existing user settings take precedence.
77
kwriteconfig6 --file kwinrc --group Plugins --key kwin_effect_clicktweenEnabled true
78
# Also activate on reinstall, but never unload an already running instance.
79
if result=$(qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.isEffectLoaded kwin_effect_clicktween 2>/dev/null) && [[ $result == true ]]; then
80
echo 'Click Tween is geïnstalleerd en actief.'
81
elif result=$(qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.loadEffect kwin_effect_clicktween 2>/dev/null) && [[ $result == true ]]; then
82
echo 'Click Tween is geïnstalleerd en actief.'
83
else
84
echo 'Geïnstalleerd en ingeschakeld. Meld af en opnieuw aan om het effect te laden.'
85
fi
86
if [[ $upgrading == true ]]; then
87
echo 'Update geïnstalleerd. Meld één keer af en opnieuw aan om de nieuwe plugincode te laden.'
88
echo 'Uit-/aanvinken of Systeeminstellingen heropenen vervangt de code in KWin niet.'
89
fi
@@ -0,0 +1,89 @@1
#!/usr/bin/env bash2
set -euo pipefail3
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"4
5
mode=${1:-install}6
case "$mode" in7
install|--build-only|--uninstall) ;;8
*) echo "Gebruik: $0 [--build-only|--uninstall]" >&2; exit 2 ;;9
esac10
if [[ $mode != --build-only ]]; then11
[[ $EUID -ne 0 ]] || { echo 'Start dit script als gewone gebruiker, zonder sudo ervoor.' >&2; exit 1; }12
for tool in sudo kwriteconfig6 qdbus6; do13
command -v "$tool" >/dev/null || { echo "Ontbreekt: $tool" >&2; exit 1; }14
done15
fi16
17
# This build intentionally targets Arch's Plasma 6.7 layout and private API.18
plugin_dir=/usr/lib/qt6/plugins/kwin/effects/plugins19
plugin_file=$plugin_dir/kwin_effect_clicktween.so20
config_file=/usr/lib/qt6/plugins/kwin/effects/configs/kwin_clicktween_config.so21
if [[ $mode == --uninstall ]]; then22
kwriteconfig6 --file kwinrc --group Plugins --key kwin_effect_clicktweenEnabled false23
qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.unloadEffect kwin_effect_clicktween || true24
sudo rm -f -- "$plugin_file" "$config_file"25
echo 'Click Tween verwijderd. Bij een D-Bus-fout: meld opnieuw aan.'26
exit 027
fi28
29
for tool in g++ pkg-config; do30
command -v "$tool" >/dev/null || { echo "Ontbreekt: $tool. Installeer: sudo pacman -S --needed gcc pkgconf" >&2; exit 1; }31
done32
[[ -x /usr/lib/qt6/moc && -f /usr/include/kwin/config-kwin.h ]] || {33
echo 'KWin/Qt-ontwikkelbestanden ontbreken. Nodig op Arch: kwin qt6-base qt6-declarative.' >&234
exit 135
}36
version=$(sed -n 's/^#define KWIN_PLUGIN_VERSION_STRING "\([^"]*\)"/\1/p' /usr/include/kwin/config-kwin.h)37
[[ $version == 6.[78].* ]] || { echo "Deze versie ondersteunt KWin 6.7.x en 6.8.x; gevonden: $version" >&2; exit 1; }38
mkdir -p build39
read -r -a qt_flags <<< "$(pkg-config --cflags Qt6Core Qt6Gui Qt6Quick Qt6DBus Qt6Widgets wayland-server epoxy libdrm)"40
read -r -a qt_libs <<< "$(pkg-config --libs Qt6Core Qt6Gui Qt6Quick Qt6DBus Qt6Widgets wayland-server epoxy libdrm)"41
includes=(-I/usr/include/kwin -I/usr/include/KF6/KCoreAddons -I/usr/include/KF6/KConfig -I/usr/include/KF6/KConfigCore -I/usr/include/KF6/KCMUtils -I/usr/include/KF6/KCMUtilsCore -I/usr/include/KF6/KWindowSystem -I. -Ibuild)42
/usr/lib/qt6/moc "${qt_flags[@]}" "${includes[@]}" clicktween.cpp -o build/clicktween.moc43
g++ -std=c++23 -O2 -Wall -Wextra -fPIC -shared -Wl,-z,defs \44
"${qt_flags[@]}" "${includes[@]}" clicktween.cpp -o build/kwin_effect_clicktween.so \45
-lkwin -lKF6CoreAddons -lKF6ConfigCore "${qt_libs[@]}"46
/usr/lib/qt6/moc "${qt_flags[@]}" "${includes[@]}" clicktween_config.cpp -o build/clicktween_config.moc47
g++ -std=c++23 -O2 -Wall -Wextra -fPIC -shared -Wl,-z,defs \48
"${qt_flags[@]}" "${includes[@]}" clicktween_config.cpp -o build/kwin_clicktween_config.so \49
-lKF6KCMUtils -lKF6KCMUtilsCore -lKF6CoreAddons -lKF6ConfigCore "${qt_libs[@]}"50
g++ -std=c++17 -fPIC "${qt_flags[@]}" check-plugin.cpp -o build/check-plugin "${qt_libs[@]}"51
build/check-plugin "$PWD/build/kwin_effect_clicktween.so"52
/usr/lib/qt6/moc "${qt_flags[@]}" check-config.cpp -o build/check-config.moc53
g++ -std=c++23 -fPIC "${qt_flags[@]}" "${includes[@]}" check-config.cpp -o build/check-config \54
-lKF6KCMUtils -lKF6KCMUtilsCore -lKF6CoreAddons -lKF6ConfigCore "${qt_libs[@]}"55
# Isolate configuration and D-Bus so the check cannot change the live desktop.56
test_config=$(mktemp -d)57
QT_QPA_PLATFORM=offscreen XDG_CONFIG_HOME="$test_config" \58
dbus-run-session -- build/check-config "$PWD/build/kwin_clicktween_config.so"59
rm -rf -- "$test_config"60
echo "Gebouwd voor KWin $version; instellingenmodule en 31 curves gecontroleerd."61
[[ $mode != --build-only ]] || exit 062
63
# Obtain credentials before touching the running effect.64
sudo -v65
66
# Qt keeps native plugin libraries resident (PreventUnloadHint). Recreating67
# the effect does not reload updated machine code. Leave the running effect68
# alone and replace files atomically; an upgrade requires a new KWin session.69
upgrading=false70
[[ ! -f "$plugin_file" ]] || upgrading=true71
sudo install -Dm755 build/kwin_effect_clicktween.so "$plugin_file.new"72
sudo mv -f -- "$plugin_file.new" "$plugin_file"73
sudo install -Dm755 build/kwin_clicktween_config.so "$config_file.new"74
sudo mv -f -- "$config_file.new" "$config_file"75
# Animation defaults are compiled from settings.h (150 ms / easeOutBack,76
# 720 ms / easeOutElastic). Existing user settings take precedence.77
kwriteconfig6 --file kwinrc --group Plugins --key kwin_effect_clicktweenEnabled true78
# Also activate on reinstall, but never unload an already running instance.79
if result=$(qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.isEffectLoaded kwin_effect_clicktween 2>/dev/null) && [[ $result == true ]]; then80
echo 'Click Tween is geïnstalleerd en actief.'81
elif result=$(qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.loadEffect kwin_effect_clicktween 2>/dev/null) && [[ $result == true ]]; then82
echo 'Click Tween is geïnstalleerd en actief.'83
else84
echo 'Geïnstalleerd en ingeschakeld. Meld af en opnieuw aan om het effect te laden.'85
fi86
if [[ $upgrading == true ]]; then87
echo 'Update geïnstalleerd. Meld één keer af en opnieuw aan om de nieuwe plugincode te laden.'88
echo 'Uit-/aanvinken of Systeeminstellingen heropenen vervangt de code in KWin niet.'89
fi@@ -0,0 +1,11 @@
1
{
2
"KPlugin": {
3
"Id": "clicktween",
4
"Name": "Click Tween",
5
"Description": "Shrink the pointer while holding the left or right mouse button",
6
"Category": "Appearance",
7
"License": "GPL-2.0-or-later",
8
"EnabledByDefault": false
9
},
10
"X-KDE-ConfigModule": "kwin_clicktween_config"
11
}
@@ -0,0 +1,11 @@1
{2
"KPlugin": {3
"Id": "clicktween",4
"Name": "Click Tween",5
"Description": "Shrink the pointer while holding the left or right mouse button",6
"Category": "Appearance",7
"License": "GPL-2.0-or-later",8
"EnabledByDefault": false9
},10
"X-KDE-ConfigModule": "kwin_clicktween_config"11
}@@ -0,0 +1,42 @@
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
#pragma once
3
#include <QEasingCurve>
4
#include <KConfigGroup>
5
#include <QString>
6
#include <algorithm>
7
8
namespace ClickTween {
9
struct Curve { const char *name; QEasingCurve::Type type; };
10
inline constexpr Curve curves[] = {
11
{"Linear", QEasingCurve::Linear},
12
#define FAMILY(name) {"easeIn" #name, QEasingCurve::In##name}, {"easeOut" #name, QEasingCurve::Out##name}, {"easeInOut" #name, QEasingCurve::InOut##name},
13
FAMILY(Sine) FAMILY(Quad) FAMILY(Cubic) FAMILY(Quart) FAMILY(Quint)
14
FAMILY(Expo) FAMILY(Circ) FAMILY(Back) FAMILY(Elastic) FAMILY(Bounce)
15
#undef FAMILY
16
};
17
inline QEasingCurve::Type curveType(const QString &name) {
18
for (const auto &curve : curves) {
19
if (name == QLatin1String(curve.name)) return curve.type;
20
}
21
return QEasingCurve::OutCubic;
22
}
23
inline QString curveName(const QString &name) {
24
for (const auto &curve : curves) {
25
if (name == QLatin1String(curve.name)) return name;
26
}
27
return QStringLiteral("easeOutCubic");
28
}
29
struct Settings {
30
int clickTime = 150;
31
int releaseTime = 720;
32
QString clickEasing = QStringLiteral("easeOutBack");
33
QString releaseEasing = QStringLiteral("easeOutElastic");
34
void read(const KConfigGroup &group) {
35
const Settings defaults;
36
clickTime = std::clamp(group.readEntry("ClickTweenTime", defaults.clickTime), 0, 5000);
37
releaseTime = std::clamp(group.readEntry("ReleaseTweenTime", defaults.releaseTime), 0, 5000);
38
clickEasing = curveName(group.readEntry("ClickEasing", defaults.clickEasing));
39
releaseEasing = curveName(group.readEntry("ReleaseEasing", defaults.releaseEasing));
40
}
41
};
42
}
@@ -0,0 +1,42 @@1
// SPDX-License-Identifier: GPL-2.0-or-later2
#pragma once3
#include <QEasingCurve>4
#include <KConfigGroup>5
#include <QString>6
#include <algorithm>7
8
namespace ClickTween {9
struct Curve { const char *name; QEasingCurve::Type type; };10
inline constexpr Curve curves[] = {11
{"Linear", QEasingCurve::Linear},12
#define FAMILY(name) {"easeIn" #name, QEasingCurve::In##name}, {"easeOut" #name, QEasingCurve::Out##name}, {"easeInOut" #name, QEasingCurve::InOut##name},13
FAMILY(Sine) FAMILY(Quad) FAMILY(Cubic) FAMILY(Quart) FAMILY(Quint)14
FAMILY(Expo) FAMILY(Circ) FAMILY(Back) FAMILY(Elastic) FAMILY(Bounce)15
#undef FAMILY16
};17
inline QEasingCurve::Type curveType(const QString &name) {18
for (const auto &curve : curves) {19
if (name == QLatin1String(curve.name)) return curve.type;20
}21
return QEasingCurve::OutCubic;22
}23
inline QString curveName(const QString &name) {24
for (const auto &curve : curves) {25
if (name == QLatin1String(curve.name)) return name;26
}27
return QStringLiteral("easeOutCubic");28
}29
struct Settings {30
int clickTime = 150;31
int releaseTime = 720;32
QString clickEasing = QStringLiteral("easeOutBack");33
QString releaseEasing = QStringLiteral("easeOutElastic");34
void read(const KConfigGroup &group) {35
const Settings defaults;36
clickTime = std::clamp(group.readEntry("ClickTweenTime", defaults.clickTime), 0, 5000);37
releaseTime = std::clamp(group.readEntry("ReleaseTweenTime", defaults.releaseTime), 0, 5000);38
clickEasing = curveName(group.readEntry("ClickEasing", defaults.clickEasing));39
releaseEasing = curveName(group.readEntry("ReleaseEasing", defaults.releaseEasing));40
}41
};42
}