diff --git a/effects/CMakeLists.txt b/effects/CMakeLists.txt index 06445ccb5..85595eabf 100644 --- a/effects/CMakeLists.txt +++ b/effects/CMakeLists.txt @@ -1,194 +1,195 @@ # KI18N Translation Domain for this library add_definitions(-DTRANSLATION_DOMAIN=\"kwin_effects\" -DEFFECT_BUILTINS) include_directories(${KWIN_SOURCE_DIR}) # for xcbutils.h set(kwin_effect_OWN_LIBS kwineffects ) if( KWIN_HAVE_XRENDER_COMPOSITING ) set(kwin_effect_OWN_LIBS ${kwin_effect_OWN_LIBS} kwinxrenderutils) endif() set(kwin_effect_KDE_LIBS KF5::ConfigGui KF5::ConfigWidgets KF5::GlobalAccel KF5::I18n KF5::WindowSystem KF5::Plasma # screenedge effect KF5::IconThemes KF5::Service KF5::Notifications # screenshot effect ) set(kwin_effect_QT_LIBS Qt5::Concurrent Qt5::DBus Qt5::Quick Qt5::X11Extras ) set(kwin_effect_XLIB_LIBS ${X11_X11_LIB} ) set(kwin_effect_XCB_LIBS XCB::XCB XCB::IMAGE XCB::XFIXES ) if( KWIN_HAVE_XRENDER_COMPOSITING ) set(kwin_effect_XCB_LIBS ${kwin_effect_XCB_LIBS} XCB::RENDER) endif() set(kwin_effect_OWN_LIBS ${kwin_effect_OWN_LIBS} kwinglutils) macro( KWIN4_ADD_EFFECT_BACKEND name ) add_library( ${name} SHARED ${ARGN} ) target_link_libraries( ${name} PRIVATE ${kwin_effect_OWN_LIBS} ${kwin_effect_KDE_LIBS} ${kwin_effect_QT_LIBS} ${kwin_effect_XLIB_LIBS} ${kwin_effect_XCB_LIBS}) endmacro() # Adds effect plugin with given name. Sources are given after the name macro( KWIN4_ADD_EFFECT name ) kwin4_add_effect_backend(kwin4_effect_${name} ${ARGN}) set_target_properties(kwin4_effect_${name} PROPERTIES VERSION 1.0.0 SOVERSION 1 ) set_target_properties(kwin4_effect_${name} PROPERTIES OUTPUT_NAME ${KWIN_NAME}4_effect_${name}) install(TARGETS kwin4_effect_${name} ${INSTALL_TARGETS_DEFAULT_ARGS} ) endmacro() # Install the KWin/Effect service type install( FILES kwineffect.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) # Create initial variables set( kwin4_effect_include_directories ) set( kwin4_effect_builtins_sources logging.cpp effect_builtins.cpp blur/blur.cpp blur/blurshader.cpp colorpicker/colorpicker.cpp cube/cube.cpp cube/cube_proxy.cpp - cube/cubeslide.cpp + cubeslide/cubeslide.cpp coverswitch/coverswitch.cpp desktopgrid/desktopgrid.cpp diminactive/diminactive.cpp flipswitch/flipswitch.cpp glide/glide.cpp invert/invert.cpp lookingglass/lookingglass.cpp magiclamp/magiclamp.cpp magnifier/magnifier.cpp mouseclick/mouseclick.cpp mousemark/mousemark.cpp presentwindows/presentwindows.cpp presentwindows/presentwindows_proxy.cpp resize/resize.cpp scale/scale.cpp showfps/showfps.cpp slide/slide.cpp thumbnailaside/thumbnailaside.cpp touchpoints/touchpoints.cpp trackmouse/trackmouse.cpp windowgeometry/windowgeometry.cpp wobblywindows/wobblywindows.cpp zoom/zoom.cpp ) qt5_add_resources( kwin4_effect_builtins_sources shaders.qrc ) kconfig_add_kcfg_files(kwin4_effect_builtins_sources blur/blurconfig.kcfgc - cube/cubeslideconfig.kcfgc cube/cubeconfig.kcfgc + cubeslide/cubeslideconfig.kcfgc coverswitch/coverswitchconfig.kcfgc desktopgrid/desktopgridconfig.kcfgc diminactive/diminactiveconfig.kcfgc fallapart/fallapartconfig.kcfgc flipswitch/flipswitchconfig.kcfgc glide/glideconfig.kcfgc lookingglass/lookingglassconfig.kcfgc magiclamp/magiclampconfig.kcfgc magnifier/magnifierconfig.kcfgc mouseclick/mouseclickconfig.kcfgc mousemark/mousemarkconfig.kcfgc presentwindows/presentwindowsconfig.kcfgc resize/resizeconfig.kcfgc scale/scaleconfig.kcfgc showfps/showfpsconfig.kcfgc slide/slideconfig.kcfgc slidingpopups/slidingpopupsconfig.kcfgc thumbnailaside/thumbnailasideconfig.kcfgc trackmouse/trackmouseconfig.kcfgc windowgeometry/windowgeometryconfig.kcfgc wobblywindows/wobblywindowsconfig.kcfgc zoom/zoomconfig.kcfgc ) # scripted effects add_subdirectory( dialogparent ) add_subdirectory( eyeonscreen ) add_subdirectory( fade ) add_subdirectory( fadedesktop ) add_subdirectory( frozenapp ) add_subdirectory( login ) add_subdirectory( logout ) add_subdirectory( maximize ) add_subdirectory( morphingpopups ) add_subdirectory( translucency ) add_subdirectory( windowaperture ) ############################################################################### # Built-in effects go here # Common effects add_subdirectory( desktopgrid ) add_subdirectory( diminactive ) include( dimscreen/CMakeLists.txt ) include( fallapart/CMakeLists.txt ) include( highlightwindow/CMakeLists.txt ) include( kscreen/CMakeLists.txt ) add_subdirectory( magiclamp ) include( minimizeanimation/CMakeLists.txt ) add_subdirectory( presentwindows ) add_subdirectory( resize ) include( screenedge/CMakeLists.txt ) add_subdirectory( showfps ) include( showpaint/CMakeLists.txt ) add_subdirectory( slide ) include( slideback/CMakeLists.txt ) include( slidingpopups/CMakeLists.txt ) add_subdirectory( thumbnailaside ) add_subdirectory( windowgeometry ) add_subdirectory( zoom ) # OpenGL-specific effects add_subdirectory( blur ) include( backgroundcontrast/CMakeLists.txt ) add_subdirectory( coverswitch ) add_subdirectory( cube ) +add_subdirectory( cubeslide ) add_subdirectory( flipswitch ) add_subdirectory( glide ) add_subdirectory( invert ) add_subdirectory( lookingglass ) add_subdirectory( magnifier ) add_subdirectory( mouseclick ) add_subdirectory( mousemark ) add_subdirectory( scale ) include( screenshot/CMakeLists.txt ) include( sheet/CMakeLists.txt ) include( snaphelper/CMakeLists.txt ) include( startupfeedback/CMakeLists.txt ) add_subdirectory( trackmouse ) add_subdirectory( wobblywindows ) ############################################################################### # Add the builtins plugin kwin4_add_effect( builtins ${kwin4_effect_builtins_sources} ) diff --git a/effects/cube/CMakeLists.txt b/effects/cube/CMakeLists.txt index 91be75fe3..ee9e52c90 100644 --- a/effects/cube/CMakeLists.txt +++ b/effects/cube/CMakeLists.txt @@ -1,54 +1,35 @@ ####################################### # Effect # Data files install( FILES data/cubecap.png DESTINATION ${DATA_INSTALL_DIR}/kwin ) ####################################### # Config -# cube set(kwin_cube_config_SRCS cube_config.cpp) ki18n_wrap_ui(kwin_cube_config_SRCS cube_config.ui) qt5_add_dbus_interface(kwin_cube_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_cube_config_SRCS cubeconfig.kcfgc) add_library(kwin_cube_config MODULE ${kwin_cube_config_SRCS}) target_link_libraries(kwin_cube_config KF5::ConfigWidgets KF5::GlobalAccel KF5::I18n KF5::XmlGui KF5::KIOWidgets KF5::Service ) kcoreaddons_desktop_to_json(kwin_cube_config cube_config.desktop SERVICE_TYPES kcmodule.desktop) -# cube slide -set(kwin_cubeslide_config_SRCS cubeslide_config.cpp) -ki18n_wrap_ui(kwin_cubeslide_config_SRCS cubeslide_config.ui) -qt5_add_dbus_interface(kwin_cubeslide_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) -kconfig_add_kcfg_files(kwin_cubeslide_config_SRCS cubeslideconfig.kcfgc) - -add_library(kwin_cubeslide_config MODULE ${kwin_cubeslide_config_SRCS}) - -target_link_libraries(kwin_cubeslide_config - kwineffects - KF5::ConfigWidgets - KF5::I18n - KF5::Service -) - -kcoreaddons_desktop_to_json(kwin_cubeslide_config cubeslide_config.desktop SERVICE_TYPES kcmodule.desktop) - install( TARGETS kwin_cube_config - kwin_cubeslide_config DESTINATION ${PLUGIN_INSTALL_DIR}/kwin/effects/configs ) diff --git a/effects/cube/CMakeLists.txt b/effects/cubeslide/CMakeLists.txt similarity index 50% copy from effects/cube/CMakeLists.txt copy to effects/cubeslide/CMakeLists.txt index 91be75fe3..3d3a29fa7 100644 --- a/effects/cube/CMakeLists.txt +++ b/effects/cubeslide/CMakeLists.txt @@ -1,54 +1,25 @@ -####################################### -# Effect - -# Data files -install( FILES - data/cubecap.png - DESTINATION ${DATA_INSTALL_DIR}/kwin ) - ####################################### # Config -# cube -set(kwin_cube_config_SRCS cube_config.cpp) -ki18n_wrap_ui(kwin_cube_config_SRCS cube_config.ui) -qt5_add_dbus_interface(kwin_cube_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) -kconfig_add_kcfg_files(kwin_cube_config_SRCS cubeconfig.kcfgc) - -add_library(kwin_cube_config MODULE ${kwin_cube_config_SRCS}) - -target_link_libraries(kwin_cube_config - KF5::ConfigWidgets - KF5::GlobalAccel - KF5::I18n - KF5::XmlGui - KF5::KIOWidgets - KF5::Service -) - -kcoreaddons_desktop_to_json(kwin_cube_config cube_config.desktop SERVICE_TYPES kcmodule.desktop) - -# cube slide set(kwin_cubeslide_config_SRCS cubeslide_config.cpp) ki18n_wrap_ui(kwin_cubeslide_config_SRCS cubeslide_config.ui) qt5_add_dbus_interface(kwin_cubeslide_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_cubeslide_config_SRCS cubeslideconfig.kcfgc) add_library(kwin_cubeslide_config MODULE ${kwin_cubeslide_config_SRCS}) target_link_libraries(kwin_cubeslide_config kwineffects KF5::ConfigWidgets KF5::I18n KF5::Service ) kcoreaddons_desktop_to_json(kwin_cubeslide_config cubeslide_config.desktop SERVICE_TYPES kcmodule.desktop) install( TARGETS - kwin_cube_config kwin_cubeslide_config DESTINATION ${PLUGIN_INSTALL_DIR}/kwin/effects/configs ) diff --git a/effects/cube/cubeslide.cpp b/effects/cubeslide/cubeslide.cpp similarity index 100% rename from effects/cube/cubeslide.cpp rename to effects/cubeslide/cubeslide.cpp diff --git a/effects/cube/cubeslide.h b/effects/cubeslide/cubeslide.h similarity index 100% rename from effects/cube/cubeslide.h rename to effects/cubeslide/cubeslide.h diff --git a/effects/cube/cubeslide.kcfg b/effects/cubeslide/cubeslide.kcfg similarity index 100% rename from effects/cube/cubeslide.kcfg rename to effects/cubeslide/cubeslide.kcfg diff --git a/effects/cube/cubeslide_config.cpp b/effects/cubeslide/cubeslide_config.cpp similarity index 100% rename from effects/cube/cubeslide_config.cpp rename to effects/cubeslide/cubeslide_config.cpp diff --git a/effects/cube/cubeslide_config.desktop b/effects/cubeslide/cubeslide_config.desktop similarity index 100% rename from effects/cube/cubeslide_config.desktop rename to effects/cubeslide/cubeslide_config.desktop diff --git a/effects/cube/cubeslide_config.h b/effects/cubeslide/cubeslide_config.h similarity index 100% rename from effects/cube/cubeslide_config.h rename to effects/cubeslide/cubeslide_config.h diff --git a/effects/cube/cubeslide_config.ui b/effects/cubeslide/cubeslide_config.ui similarity index 100% rename from effects/cube/cubeslide_config.ui rename to effects/cubeslide/cubeslide_config.ui diff --git a/effects/cube/cubeslideconfig.kcfgc b/effects/cubeslide/cubeslideconfig.kcfgc similarity index 100% rename from effects/cube/cubeslideconfig.kcfgc rename to effects/cubeslide/cubeslideconfig.kcfgc diff --git a/effects/effect_builtins.cpp b/effects/effect_builtins.cpp index 7b4b7f782..92f64c87e 100644 --- a/effects/effect_builtins.cpp +++ b/effects/effect_builtins.cpp @@ -1,807 +1,807 @@ /******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2014 Martin Gräßlin 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 . *********************************************************************/ #include "effect_builtins.h" #ifdef EFFECT_BUILTINS // common effects #include "backgroundcontrast/contrast.h" #include "blur/blur.h" #include "colorpicker/colorpicker.h" #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" #include "scale/scale.h" #include "showfps/showfps.h" #include "showpaint/showpaint.h" #include "slide/slide.h" #include "slideback/slideback.h" #include "thumbnailaside/thumbnailaside.h" #include "touchpoints/touchpoints.h" #include "windowgeometry/windowgeometry.h" #include "zoom/zoom.h" // OpenGL-specific effects for desktop #include "coverswitch/coverswitch.h" #include "cube/cube.h" -#include "cube/cubeslide.h" +#include "cubeslide/cubeslide.h" #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" #endif #include #include #ifndef EFFECT_BUILTINS #define EFFECT_FALLBACK nullptr, nullptr, nullptr #else #define EFFECT_FALLBACK #endif namespace KWin { namespace BuiltInEffects { template inline Effect *createHelper() { return new T(); } static const QVector &effectData() { static const QVector s_effectData = { { QString(), QString(), QString(), QString(), QString(), QUrl(), false, false, nullptr, nullptr, nullptr }, { QStringLiteral("blur"), i18ndc("kwin_effects", "Name of a KWin Effect", "Blur"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Blurs the background behind semi-transparent windows"), QStringLiteral("Appearance"), QString(), QUrl(), true, false, #ifdef EFFECT_BUILTINS &createHelper, &BlurEffect::supported, &BlurEffect::enabledByDefault #endif 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::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("contrast"), 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"), QStringLiteral("Appearance"), QString(), QUrl(), true, false, #ifdef EFFECT_BUILTINS &createHelper, &ContrastEffect::supported, &ContrastEffect::enabledByDefault #endif EFFECT_FALLBACK }, { QStringLiteral("coverswitch"), 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"), QStringLiteral("Window Management"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/cover_switch.mp4")), false, true, #ifdef EFFECT_BUILTINS &createHelper, &CoverSwitchEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("cube"), 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"), QStringLiteral("Window Management"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/desktop_cube.ogv")), false, false, #ifdef EFFECT_BUILTINS &createHelper, &CubeEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("cubeslide"), 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"), QStringLiteral("Virtual Desktop Switching Animation"), QStringLiteral("desktop-animations"), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/desktop_cube_animation.ogv")), false, false, #ifdef EFFECT_BUILTINS &createHelper, &CubeSlideEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("desktopgrid"), 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"), QStringLiteral("Window Management"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/desktop_grid.mp4")), true, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("diminactive"), i18ndc("kwin_effects", "Name of a KWin Effect", "Dim Inactive"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Darken inactive windows"), QStringLiteral("Focus"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/dim_inactive.mp4")), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("dimscreen"), 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"), QStringLiteral("Focus"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/dim_administration.mp4")), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("fallapart"), i18ndc("kwin_effects", "Name of a KWin Effect", "Fall Apart"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Closed windows fall into pieces"), QStringLiteral("Candy"), QString(), QUrl(), false, false, #ifdef EFFECT_BUILTINS &createHelper, &FallApartEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("flipswitch"), 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"), QStringLiteral("Window Management"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/flip_switch.mp4")), false, false, #ifdef EFFECT_BUILTINS &createHelper, &FlipSwitchEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("glide"), i18ndc("kwin_effects", "Name of a KWin Effect", "Glide"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Glide windows as they appear or disappear"), QStringLiteral("Appearance"), QString(), QUrl(), false, false, #ifdef EFFECT_BUILTINS &createHelper, &GlideEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("highlightwindow"), 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"), QStringLiteral("Appearance"), QString(), QUrl(), true, true, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("invert"), 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"), QStringLiteral("Accessibility"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/invert.mp4")), false, false, #ifdef EFFECT_BUILTINS &createHelper, &InvertEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("kscreen"), i18ndc("kwin_effects", "Name of a KWin Effect", "Kscreen"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Helper Effect for KScreen"), QStringLiteral("Appearance"), QString(), QUrl(), true, true, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("lookingglass"), 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"), QStringLiteral("Accessibility"), QStringLiteral("magnifiers"), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/looking_glass.ogv")), false, false, #ifdef EFFECT_BUILTINS &createHelper, &LookingGlassEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("magiclamp"), 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"), QStringLiteral("Appearance"), QStringLiteral("minimize"), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/magic_lamp.ogv")), false, false, #ifdef EFFECT_BUILTINS &createHelper, &MagicLampEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("magnifier"), 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"), QStringLiteral("Accessibility"), QStringLiteral("magnifiers"), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/magnifier.ogv")), false, false, #ifdef EFFECT_BUILTINS &createHelper, &MagnifierEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("minimizeanimation"), i18ndc("kwin_effects", "Name of a KWin Effect", "Minimize Animation"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Animate the minimizing of windows"), QStringLiteral("Appearance"), QStringLiteral("minimize"), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/minimize.ogv")), true, false, #ifdef EFFECT_BUILTINS &createHelper, &MinimizeAnimationEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("mouseclick"), 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"), QStringLiteral("Accessibility"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/mouse_click.mp4")), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("mousemark"), 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"), QStringLiteral("Appearance"), QString(), QUrl(), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("presentwindows"), 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"), QStringLiteral("Window Management"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/present_windows.mp4")), true, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("resize"), 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"), QStringLiteral("Window Management"), QString(), QUrl(), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif 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::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("screenedge"), i18ndc("kwin_effects", "Name of a KWin Effect", "Screen Edge"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Highlights a screen edge when approaching"), QStringLiteral("Appearance"), QString(), QUrl(), true, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("screenshot"), i18ndc("kwin_effects", "Name of a KWin Effect", "Screenshot"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Helper effect for KSnapshot"), QStringLiteral("Appearance"), QString(), QUrl(), true, true, #ifdef EFFECT_BUILTINS &createHelper, &ScreenShotEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("sheet"), 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"), QStringLiteral("Candy"), QString(), QUrl(), false, false, #ifdef EFFECT_BUILTINS &createHelper, &SheetEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("showfps"), 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"), QStringLiteral("Tools"), QString(), QUrl(), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("showpaint"), 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"), QStringLiteral("Tools"), QString(), QUrl(), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("slide"), i18ndc("kwin_effects", "Name of a KWin Effect", "Slide"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Slide desktops when switching virtual desktops"), QStringLiteral("Virtual Desktop Switching Animation"), QStringLiteral("desktop-animations"), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/slide.ogv")), true, false, #ifdef EFFECT_BUILTINS &createHelper, &SlideEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("slideback"), 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"), QStringLiteral("Focus"), QString(), QUrl(), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("slidingpopups"), i18ndc("kwin_effects", "Name of a KWin Effect", "Sliding popups"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Sliding animation for Plasma popups"), QStringLiteral("Appearance"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/sliding_popups.mp4")), true, false, #ifdef EFFECT_BUILTINS &createHelper, &SlidingPopupsEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("snaphelper"), 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"), QStringLiteral("Accessibility"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/snap_helper.mp4")), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("startupfeedback"), i18ndc("kwin_effects", "Name of a KWin Effect", "Startup Feedback"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Helper effect for startup feedback"), QStringLiteral("Candy"), QString(), QUrl(), true, true, #ifdef EFFECT_BUILTINS &createHelper, &StartupFeedbackEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("thumbnailaside"), 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"), QStringLiteral("Appearance"), QString(), QUrl(), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif 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, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("trackmouse"), 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"), QStringLiteral("Accessibility"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/track_mouse.mp4")), false, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("windowgeometry"), i18ndc("kwin_effects", "Name of a KWin Effect", "Window Geometry"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Display window geometries on move/resize"), QStringLiteral("Appearance"), QString(), QUrl(), false, true, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("wobblywindows"), i18ndc("kwin_effects", "Name of a KWin Effect", "Wobbly Windows"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Deform windows while they are moving"), QStringLiteral("Candy"), QString(), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/wobbly_windows.ogv")), false, false, #ifdef EFFECT_BUILTINS &createHelper, &WobblyWindowsEffect::supported, nullptr #endif EFFECT_FALLBACK }, { QStringLiteral("zoom"), i18ndc("kwin_effects", "Name of a KWin Effect", "Zoom"), i18ndc("kwin_effects", "Comment describing the KWin Effect", "Magnify the entire desktop"), QStringLiteral("Accessibility"), QStringLiteral("magnifiers"), QUrl(QStringLiteral("http://files.kde.org/plasma/kwin/effect-videos/zoom.ogv")), true, false, #ifdef EFFECT_BUILTINS &createHelper, nullptr, nullptr #endif EFFECT_FALLBACK } }; return s_effectData; } static inline int index(BuiltInEffect effect) { return static_cast(effect); } Effect *create(BuiltInEffect effect) { const EffectData &data = effectData(effect); if (data.createFunction == nullptr) { return nullptr; } return data.createFunction(); } bool available(const QString &name) { auto it = std::find_if(effectData().begin(), effectData().end(), [name](const EffectData &data) { return data.name == name; } ); return it != effectData().end(); } bool supported(BuiltInEffect effect) { if (effect == BuiltInEffect::Invalid) { return false; } const EffectData &data = effectData(effect); if (data.supportedFunction == nullptr) { return true; } return data.supportedFunction(); } bool checkEnabledByDefault(BuiltInEffect effect) { if (effect == BuiltInEffect::Invalid) { return false; } const EffectData &data = effectData(effect); if (data.enabledFunction == nullptr) { return true; } return data.enabledFunction(); } bool enabledByDefault(BuiltInEffect effect) { return effectData(effect).enabled; } QStringList availableEffectNames() { QStringList result; for (const EffectData &data : effectData()) { if (data.name.isEmpty()) { continue; } result << data.name; } return result; } QList< BuiltInEffect > availableEffects() { QList result; for (int i = index(BuiltInEffect::Invalid) + 1; i <= index(BuiltInEffect::Zoom); ++i) { result << BuiltInEffect(i); } return result; } BuiltInEffect builtInForName(const QString &name) { auto it = std::find_if(effectData().begin(), effectData().end(), [name](const EffectData &data) { return data.name == name; } ); if (it == effectData().end()) { return BuiltInEffect::Invalid; } return BuiltInEffect(std::distance(effectData().begin(), it)); } QString nameForEffect(BuiltInEffect effect) { return effectData(effect).name; } const EffectData &effectData(BuiltInEffect effect) { return effectData().at(index(effect)); } } // BuiltInEffects } // namespace