2014-01-17 12:46:04 +00:00
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project .
Copyright ( C ) 2014 Martin Gräßlin < mgraesslin @ kde . org >
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program . If not , see < http : //www.gnu.org/licenses/>.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
# include "effect_builtins.h"
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-01-17 12:46:04 +00:00
// common effects
# include "backgroundcontrast/contrast.h"
# include "blur/blur.h"
2016-11-24 07:07:51 +00:00
# include "colorpicker/colorpicker.h"
2014-01-17 12:46:04 +00:00
# include "kscreen/kscreen.h"
# include "presentwindows/presentwindows.h"
# include "screenedge/screenedgeeffect.h"
# include "screenshot/screenshot.h"
# include "slidingpopups/slidingpopups.h"
// Common effects only relevant to desktop
# include "desktopgrid/desktopgrid.h"
# include "diminactive/diminactive.h"
# include "dimscreen/dimscreen.h"
# include "fallapart/fallapart.h"
# include "highlightwindow/highlightwindow.h"
# include "magiclamp/magiclamp.h"
# include "minimizeanimation/minimizeanimation.h"
# include "resize/resize.h"
[effects] Add Scale effect
Summary:
The new effect scales windows as they appear and disappear.
As the the most of window animation effects, it is a monolithic effect,
i.e., if you enable scale effect, it will animate *both* the appearing and
disappearing.
The main difference between the Scale effect and the Scale in effect is
that the Scale in effect only animates windows as they appear. There is
no corresponding "the Scale out" effect, which is odd. Other points that
differentiate the Scale effect from the Scale in effect:
* it is more subtle;
* it doesn't animate the log out screen;
* it doesn't conflict with the Fade effect, etc.
... and overall, the Scale effect supersedes the Scale in effect.
{F5904947}
//Window open animation.//
{F5904948}
//Window close animation.//
{F5905283, layout=center, size=full}
//KCM.//
Test Plan:
* Enabled this effect
* Opened/closed System Settings
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: ngraham, davidedmundson, fvogt, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13461
2018-06-10 11:02:46 +00:00
# include "scale/scale.h"
2014-01-17 12:46:04 +00:00
# include "showfps/showfps.h"
# include "showpaint/showpaint.h"
# include "slide/slide.h"
# include "slideback/slideback.h"
# include "thumbnailaside/thumbnailaside.h"
2016-08-16 18:16:41 +00:00
# include "touchpoints/touchpoints.h"
2014-01-17 12:46:04 +00:00
# include "windowgeometry/windowgeometry.h"
# include "zoom/zoom.h"
// OpenGL-specific effects for desktop
# include "coverswitch/coverswitch.h"
# include "cube/cube.h"
2014-03-11 08:53:19 +00:00
# include "cube/cubeslide.h"
2014-01-17 12:46:04 +00:00
# include "flipswitch/flipswitch.h"
# include "glide/glide.h"
# include "invert/invert.h"
# include "lookingglass/lookingglass.h"
# include "magnifier/magnifier.h"
# include "mouseclick/mouseclick.h"
# include "mousemark/mousemark.h"
# include "sheet/sheet.h"
# include "snaphelper/snaphelper.h"
# include "startupfeedback/startupfeedback.h"
# include "trackmouse/trackmouse.h"
# include "wobblywindows/wobblywindows.h"
2015-01-28 08:46:31 +00:00
# endif
# include <KLocalizedString>
# include <kwineffects.h>
# ifndef EFFECT_BUILTINS
# define EFFECT_FALLBACK nullptr, nullptr, nullptr
# else
# define EFFECT_FALLBACK
# endif
2014-01-17 12:46:04 +00:00
namespace KWin
{
2014-04-03 08:43:23 +00:00
namespace BuiltInEffects
{
2014-01-17 12:46:04 +00:00
template < class T >
inline Effect * createHelper ( )
{
return new T ( ) ;
}
2018-08-30 11:01:43 +00:00
static const QVector < EffectData > & effectData ( )
{
static const QVector < EffectData > s_effectData = {
2014-04-03 08:43:23 +00:00
{
QString ( ) ,
2014-04-03 14:20:26 +00:00
QString ( ) ,
QString ( ) ,
QString ( ) ,
QString ( ) ,
QUrl ( ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
nullptr ,
nullptr ,
nullptr
} , {
QStringLiteral ( " blur " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Blur " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Blurs the background behind semi-transparent windows " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
2014-04-03 08:43:23 +00:00
true ,
2014-04-03 14:20:26 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < BlurEffect > ,
& BlurEffect : : supported ,
& BlurEffect : : enabledByDefault
2015-01-28 08:46:31 +00:00
# endif
2016-11-24 07:07:51 +00:00
EFFECT_FALLBACK
} , {
QStringLiteral ( " colorpicker " ) ,
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Color Picker " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Supports picking a color " ) ,
QStringLiteral ( " Accessibility " ) ,
QString ( ) ,
QUrl ( ) ,
true ,
true ,
# ifdef EFFECT_BUILTINS
& createHelper < ColorPickerEffect > ,
& ColorPickerEffect : : supported ,
nullptr
# endif
2015-01-28 08:46:31 +00:00
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " contrast " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Background contrast " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Improve contrast and readability behind semi-transparent windows " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
2014-04-03 08:43:23 +00:00
true ,
2014-04-03 14:20:26 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < ContrastEffect > ,
& ContrastEffect : : supported ,
& ContrastEffect : : enabledByDefault
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " coverswitch " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Cover Switch " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Display a Cover Flow effect for the alt+tab window switcher " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Window Management " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/cover_switch.mp4 " ) ) ,
2014-04-03 08:43:23 +00:00
false ,
2014-04-03 14:20:26 +00:00
true ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < CoverSwitchEffect > ,
& CoverSwitchEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " cube " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Desktop Cube " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Display each virtual desktop on a side of a cube " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Window Management " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/desktop_cube.ogv " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < CubeEffect > ,
& CubeEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " cubeslide " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Desktop Cube Animation " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Animate desktop switching with a cube " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Virtual Desktop Switching Animation " ) ,
QStringLiteral ( " desktop-animations " ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/desktop_cube_animation.ogv " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < CubeSlideEffect > ,
& CubeSlideEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " desktopgrid " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Desktop Grid " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Zoom out so all desktops are displayed side-by-side in a grid " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Window Management " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/desktop_grid.mp4 " ) ) ,
2014-04-03 08:43:23 +00:00
true ,
2014-04-03 14:20:26 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < DesktopGridEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " diminactive " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Dim Inactive " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Darken inactive windows " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Focus " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/dim_inactive.mp4 " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < DimInactiveEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " dimscreen " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Dim Screen for Administrator Mode " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Darkens the entire screen when requesting root privileges " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Focus " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/dim_administration.mp4 " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < DimScreenEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " fallapart " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Fall Apart " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Closed windows fall into pieces " ) ,
[effects] Move Fall Apart and Sheet to the Candy category
Summary:
The Fall Apart effect and the Sheet effect look like "candies" so
let's move them to corresponding category.
Test Plan: {F6167489, layout=center, size=full}
Reviewers: #kwin, #plasma, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, ngraham, davidedmundson
Subscribers: ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14517
2018-07-31 16:19:12 +00:00
QStringLiteral ( " Candy " ) ,
2014-04-03 14:20:26 +00:00
QString ( ) ,
QUrl ( ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < FallApartEffect > ,
& FallApartEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " flipswitch " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Flip Switch " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Flip through windows that are in a stack for the alt+tab window switcher " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Window Management " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/flip_switch.mp4 " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < FlipSwitchEffect > ,
& FlipSwitchEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " glide " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Glide " ) ,
2018-07-29 15:12:04 +00:00
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Glide windows as they appear or disappear " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < GlideEffect > ,
& GlideEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " highlightwindow " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Highlight Window " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Highlight the appropriate window when hovering over taskbar entries " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
true ,
2014-04-03 08:43:23 +00:00
true ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < HighlightWindowEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " invert " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Invert " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Inverts the color of the desktop and windows " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Accessibility " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/invert.mp4 " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < InvertEffect > ,
& InvertEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " kscreen " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Kscreen " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Helper Effect for KScreen " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
true ,
2014-04-03 08:43:23 +00:00
true ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < KscreenEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " lookingglass " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Looking Glass " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " A screen magnifier that looks like a fisheye lens " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Accessibility " ) ,
QStringLiteral ( " magnifiers " ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/looking_glass.ogv " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < LookingGlassEffect > ,
& LookingGlassEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " magiclamp " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Magic Lamp " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Simulate a magic lamp when minimizing windows " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QStringLiteral ( " minimize " ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/magic_lamp.ogv " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < MagicLampEffect > ,
& MagicLampEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " magnifier " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Magnifier " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Magnify the section of the screen that is near the mouse cursor " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Accessibility " ) ,
QStringLiteral ( " magnifiers " ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/magnifier.ogv " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < MagnifierEffect > ,
& MagnifierEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " minimizeanimation " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Minimize Animation " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Animate the minimizing of windows " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QStringLiteral ( " minimize " ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/minimize.ogv " ) ) ,
2014-04-03 08:43:23 +00:00
true ,
2014-04-03 14:20:26 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < MinimizeAnimationEffect > ,
2017-11-23 09:34:06 +00:00
& MinimizeAnimationEffect : : supported ,
2014-04-03 08:43:23 +00:00
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " mouseclick " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Mouse Click Animation " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Creates an animation whenever a mouse button is clicked. This is useful for screenrecordings/presentations " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Accessibility " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/mouse_click.mp4 " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < MouseClickEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " mousemark " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Mouse Mark " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Allows you to draw lines on the desktop " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < MouseMarkEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " presentwindows " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Present Windows " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Zoom out until all opened windows can be displayed side-by-side " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Window Management " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/present_windows.mp4 " ) ) ,
2014-04-03 08:43:23 +00:00
true ,
2014-04-03 14:20:26 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < PresentWindowsEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " resize " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Resize Window " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Resizes windows with a fast texture scale instead of updating contents " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Window Management " ) ,
QString ( ) ,
QUrl ( ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < ResizeEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
[effects] Add Scale effect
Summary:
The new effect scales windows as they appear and disappear.
As the the most of window animation effects, it is a monolithic effect,
i.e., if you enable scale effect, it will animate *both* the appearing and
disappearing.
The main difference between the Scale effect and the Scale in effect is
that the Scale in effect only animates windows as they appear. There is
no corresponding "the Scale out" effect, which is odd. Other points that
differentiate the Scale effect from the Scale in effect:
* it is more subtle;
* it doesn't animate the log out screen;
* it doesn't conflict with the Fade effect, etc.
... and overall, the Scale effect supersedes the Scale in effect.
{F5904947}
//Window open animation.//
{F5904948}
//Window close animation.//
{F5905283, layout=center, size=full}
//KCM.//
Test Plan:
* Enabled this effect
* Opened/closed System Settings
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: ngraham, davidedmundson, fvogt, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13461
2018-06-10 11:02:46 +00:00
EFFECT_FALLBACK
} , {
QStringLiteral ( " scale " ) ,
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Scale " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Make windows smoothly scale in and out when they are shown or hidden " ) ,
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
false ,
false ,
# ifdef EFFECT_BUILTINS
& createHelper < ScaleEffect > ,
& ScaleEffect : : supported ,
nullptr
# endif
2015-01-28 08:46:31 +00:00
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " screenedge " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Screen Edge " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Highlights a screen edge when approaching " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
2014-04-03 08:43:23 +00:00
true ,
2014-04-03 14:20:26 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < ScreenEdgeEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " screenshot " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Screenshot " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Helper effect for KSnapshot " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
true ,
2014-04-03 08:43:23 +00:00
true ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < ScreenShotEffect > ,
& ScreenShotEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " sheet " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Sheet " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Make modal dialogs smoothly fly in and out when they are shown or hidden " ) ,
[effects] Move Fall Apart and Sheet to the Candy category
Summary:
The Fall Apart effect and the Sheet effect look like "candies" so
let's move them to corresponding category.
Test Plan: {F6167489, layout=center, size=full}
Reviewers: #kwin, #plasma, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, ngraham, davidedmundson
Subscribers: ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14517
2018-07-31 16:19:12 +00:00
QStringLiteral ( " Candy " ) ,
2014-04-03 14:20:26 +00:00
QString ( ) ,
QUrl ( ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < SheetEffect > ,
& SheetEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " showfps " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Show FPS " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Display KWin's performance in the corner of the screen " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Tools " ) ,
QString ( ) ,
QUrl ( ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < ShowFpsEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " showpaint " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Show Paint " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Highlight areas of the desktop that have been recently updated " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Tools " ) ,
QString ( ) ,
QUrl ( ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < ShowPaintEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " slide " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Slide " ) ,
[effects] replace old slide effect with a new one
Summary:
The new slide effect tries to separate each virtual desktop
as much as possible. This separation makes the new slide
effect more intuitive than the old one.
Test Plan:
* switch between virtual desktops
* or, move a window to another virtual desktop
Reviewers: #vdg, #kwin, #plasma, graesslin, ngraham
Reviewed By: #kwin, #plasma, graesslin
Subscribers: mart, graesslin, abetts, ngraham, plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D9638
2018-02-14 21:36:47 +00:00
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Slide desktops when switching virtual desktops " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Virtual Desktop Switching Animation " ) ,
QStringLiteral ( " desktop-animations " ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/slide.ogv " ) ) ,
2014-04-03 08:43:23 +00:00
true ,
2014-04-03 14:20:26 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < SlideEffect > ,
2017-11-23 09:34:06 +00:00
& SlideEffect : : supported ,
2014-04-03 08:43:23 +00:00
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " slideback " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Slide Back " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Slide back windows when another window is raised " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Focus " ) ,
QString ( ) ,
QUrl ( ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < SlideBackEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " slidingpopups " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Sliding popups " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Sliding animation for Plasma popups " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/sliding_popups.mp4 " ) ) ,
2014-04-03 08:43:23 +00:00
true ,
2014-04-03 14:20:26 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < SlidingPopupsEffect > ,
2017-11-23 09:34:06 +00:00
& SlidingPopupsEffect : : supported ,
2014-04-03 08:43:23 +00:00
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " snaphelper " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Snap Helper " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Help you locate the center of the screen when moving a window " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Accessibility " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/snap_helper.mp4 " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < SnapHelperEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " startupfeedback " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Startup Feedback " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Helper effect for startup feedback " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Candy " ) ,
QString ( ) ,
QUrl ( ) ,
true ,
2014-04-03 08:43:23 +00:00
true ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < StartupFeedbackEffect > ,
& StartupFeedbackEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " thumbnailaside " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Thumbnail Aside " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Display window thumbnails on the edge of the screen " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < ThumbnailAsideEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
2016-08-16 18:16:41 +00:00
EFFECT_FALLBACK
} , {
QStringLiteral ( " touchpoints " ) ,
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Touch Points " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Visualize touch points " ) ,
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
false ,
false ,
# ifdef EFFECT_BUILTINS
& createHelper < TouchPointsEffect > ,
nullptr ,
nullptr
# endif
2015-01-28 08:46:31 +00:00
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " trackmouse " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Track Mouse " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Display a mouse cursor locating effect when activated " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Accessibility " ) ,
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/track_mouse.mp4 " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < TrackMouseEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " windowgeometry " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Window Geometry " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Display window geometries on move/resize " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Appearance " ) ,
QString ( ) ,
QUrl ( ) ,
2014-04-03 08:43:23 +00:00
false ,
2014-04-03 14:20:26 +00:00
true ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < WindowGeometry > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " wobblywindows " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Wobbly Windows " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Deform windows while they are moving " ) ,
[effects] Move the Wobby Windows effect to the Candy category
Summary:
The Wobby Windows effect is more a "candy" rather than a standard effect,
so it makes more sense to move it to the Candy category.
Test Plan:
Opened the Desktop Effects KCM, the Wobby Windows effect is in the Candy
category:
{F6160383, layout=center, size=full}
Reviewers: #kwin, #plasma, #vdg, ngraham, broulik
Reviewed By: #plasma, #vdg, ngraham, broulik
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14455
2018-07-29 12:34:09 +00:00
QStringLiteral ( " Candy " ) ,
2014-04-03 14:20:26 +00:00
QString ( ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/wobbly_windows.ogv " ) ) ,
false ,
2014-04-03 08:43:23 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < WobblyWindowsEffect > ,
& WobblyWindowsEffect : : supported ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
} , {
QStringLiteral ( " zoom " ) ,
2015-01-28 08:46:31 +00:00
i18ndc ( " kwin_effects " , " Name of a KWin Effect " , " Zoom " ) ,
i18ndc ( " kwin_effects " , " Comment describing the KWin Effect " , " Magnify the entire desktop " ) ,
2014-04-03 14:20:26 +00:00
QStringLiteral ( " Accessibility " ) ,
QStringLiteral ( " magnifiers " ) ,
QUrl ( QStringLiteral ( " http://files.kde.org/plasma/kwin/effect-videos/zoom.ogv " ) ) ,
2014-04-03 08:43:23 +00:00
true ,
2014-04-03 14:20:26 +00:00
false ,
2015-01-28 08:46:31 +00:00
# ifdef EFFECT_BUILTINS
2014-04-03 08:43:23 +00:00
& createHelper < ZoomEffect > ,
nullptr ,
nullptr
2015-01-28 08:46:31 +00:00
# endif
EFFECT_FALLBACK
2014-04-03 08:43:23 +00:00
}
2018-08-30 11:01:43 +00:00
} ;
return s_effectData ;
}
2014-01-17 12:46:04 +00:00
2014-04-03 08:43:23 +00:00
static inline int index ( BuiltInEffect effect )
2014-01-17 12:46:04 +00:00
{
2014-04-03 08:43:23 +00:00
return static_cast < int > ( effect ) ;
2014-03-21 10:40:16 +00:00
}
2014-04-03 08:43:23 +00:00
Effect * create ( BuiltInEffect effect )
2014-03-21 10:40:16 +00:00
{
2018-06-18 12:25:58 +00:00
const EffectData & data = effectData ( effect ) ;
if ( data . createFunction = = nullptr ) {
2014-01-17 12:46:04 +00:00
return nullptr ;
}
2018-06-18 12:25:58 +00:00
return data . createFunction ( ) ;
2014-01-17 12:46:04 +00:00
}
2014-04-03 08:43:23 +00:00
bool available ( const QString & name )
2014-01-17 12:46:04 +00:00
{
2018-08-30 11:01:43 +00:00
auto it = std : : find_if ( effectData ( ) . begin ( ) , effectData ( ) . end ( ) ,
2014-04-03 08:43:23 +00:00
[ name ] ( const EffectData & data ) {
return data . name = = name ;
}
) ;
2018-08-30 11:01:43 +00:00
return it ! = effectData ( ) . end ( ) ;
2014-01-17 12:46:04 +00:00
}
2014-04-03 08:43:23 +00:00
bool supported ( BuiltInEffect effect )
2014-03-21 10:40:16 +00:00
{
if ( effect = = BuiltInEffect : : Invalid ) {
return false ;
}
2018-06-18 12:25:58 +00:00
const EffectData & data = effectData ( effect ) ;
if ( data . supportedFunction = = nullptr ) {
2014-04-03 08:43:23 +00:00
return true ;
2014-01-17 12:46:04 +00:00
}
2018-06-18 12:25:58 +00:00
return data . supportedFunction ( ) ;
2014-01-17 12:46:04 +00:00
}
2014-04-03 08:43:23 +00:00
bool checkEnabledByDefault ( BuiltInEffect effect )
2014-03-21 11:09:13 +00:00
{
2014-04-03 08:43:23 +00:00
if ( effect = = BuiltInEffect : : Invalid ) {
return false ;
2014-03-21 11:09:13 +00:00
}
2018-06-18 12:25:58 +00:00
const EffectData & data = effectData ( effect ) ;
if ( data . enabledFunction = = nullptr ) {
2014-04-03 08:43:23 +00:00
return true ;
2014-03-21 10:40:16 +00:00
}
2018-06-18 12:25:58 +00:00
return data . enabledFunction ( ) ;
2014-03-21 10:40:16 +00:00
}
2014-03-21 11:09:13 +00:00
bool enabledByDefault ( BuiltInEffect effect )
{
2018-06-18 12:25:58 +00:00
return effectData ( effect ) . enabled ;
2014-03-21 11:09:13 +00:00
}
2014-04-03 08:43:23 +00:00
QStringList availableEffectNames ( )
2014-03-21 10:40:16 +00:00
{
2014-04-03 08:43:23 +00:00
QStringList result ;
2018-08-30 11:01:43 +00:00
for ( const EffectData & data : effectData ( ) ) {
2014-04-03 08:43:23 +00:00
if ( data . name . isEmpty ( ) ) {
continue ;
}
result < < data . name ;
}
return result ;
2014-03-21 10:40:16 +00:00
}
QList < BuiltInEffect > availableEffects ( )
{
2014-04-03 08:43:23 +00:00
QList < BuiltInEffect > result ;
for ( int i = index ( BuiltInEffect : : Invalid ) + 1 ; i < = index ( BuiltInEffect : : Zoom ) ; + + i ) {
result < < BuiltInEffect ( i ) ;
}
return result ;
2014-03-21 10:40:16 +00:00
}
2014-04-03 08:43:23 +00:00
BuiltInEffect builtInForName ( const QString & name )
2014-03-21 10:40:16 +00:00
{
2018-08-30 11:01:43 +00:00
auto it = std : : find_if ( effectData ( ) . begin ( ) , effectData ( ) . end ( ) ,
2014-04-03 08:43:23 +00:00
[ name ] ( const EffectData & data ) {
return data . name = = name ;
}
) ;
2018-08-30 11:01:43 +00:00
if ( it = = effectData ( ) . end ( ) ) {
2014-04-03 08:43:23 +00:00
return BuiltInEffect : : Invalid ;
}
2018-08-30 11:01:43 +00:00
return BuiltInEffect ( std : : distance ( effectData ( ) . begin ( ) , it ) ) ;
2014-03-21 10:40:16 +00:00
}
2014-04-03 08:43:23 +00:00
QString nameForEffect ( BuiltInEffect effect )
2014-03-21 10:40:16 +00:00
{
2018-06-18 12:25:58 +00:00
return effectData ( effect ) . name ;
2014-03-21 10:40:16 +00:00
}
2014-04-03 14:20:26 +00:00
const EffectData & effectData ( BuiltInEffect effect )
{
2018-08-30 11:01:43 +00:00
return effectData ( ) . at ( index ( effect ) ) ;
2014-04-03 14:20:26 +00:00
}
2014-01-17 12:46:04 +00:00
} // BuiltInEffects
} // namespace