Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwineffects.h
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Line(s) | 195 | enum WindowQuadType { | |||
---|---|---|---|---|---|
207 | WindowQuadShadowLeft, | 207 | WindowQuadShadowLeft, | ||
208 | WindowQuadShadowTopLeft, | 208 | WindowQuadShadowTopLeft, | ||
209 | EFFECT_QUAD_TYPE_START = 100 ///< @internal | 209 | EFFECT_QUAD_TYPE_START = 100 ///< @internal | ||
210 | }; | 210 | }; | ||
211 | 211 | | |||
212 | /** | 212 | /** | ||
213 | * EffectWindow::setData() and EffectWindow::data() global roles. | 213 | * EffectWindow::setData() and EffectWindow::data() global roles. | ||
214 | * All values between 0 and 999 are reserved for global roles. | 214 | * All values between 0 and 999 are reserved for global roles. | ||
215 | */ | 215 | **/ | ||
216 | enum DataRole { | 216 | enum DataRole { | ||
217 | // Grab roles are used to force all other animations to ignore the window. | 217 | // Grab roles are used to force all other animations to ignore the window. | ||
218 | // The value of the data is set to the Effect's `this` value. | 218 | // The value of the data is set to the Effect's `this` value. | ||
219 | WindowAddedGrabRole = 1, | 219 | WindowAddedGrabRole = 1, | ||
220 | WindowClosedGrabRole, | 220 | WindowClosedGrabRole, | ||
221 | WindowMinimizedGrabRole, | 221 | WindowMinimizedGrabRole, | ||
222 | WindowUnminimizedGrabRole, | 222 | WindowUnminimizedGrabRole, | ||
223 | WindowForceBlurRole, ///< For fullscreen effects to enforce blurring of windows, | 223 | WindowForceBlurRole, ///< For fullscreen effects to enforce blurring of windows, | ||
224 | WindowBlurBehindRole, ///< For single windows to blur behind | 224 | WindowBlurBehindRole, ///< For single windows to blur behind | ||
225 | WindowForceBackgroundContrastRole, ///< For fullscreen effects to enforce the background contrast, | 225 | WindowForceBackgroundContrastRole, ///< For fullscreen effects to enforce the background contrast, | ||
226 | WindowBackgroundContrastRole, ///< For single windows to enable Background contrast | 226 | WindowBackgroundContrastRole, ///< For single windows to enable Background contrast | ||
227 | LanczosCacheRole | 227 | LanczosCacheRole | ||
228 | }; | 228 | }; | ||
229 | 229 | | |||
230 | /** | 230 | /** | ||
231 | * Style types used by @ref EffectFrame. | 231 | * Style types used by @ref EffectFrame. | ||
232 | * @since 4.6 | 232 | * @since 4.6 | ||
233 | */ | 233 | **/ | ||
234 | enum EffectFrameStyle { | 234 | enum EffectFrameStyle { | ||
235 | EffectFrameNone, ///< Displays no frame around the contents. | 235 | EffectFrameNone, ///< Displays no frame around the contents. | ||
236 | EffectFrameUnstyled, ///< Displays a basic box around the contents. | 236 | EffectFrameUnstyled, ///< Displays a basic box around the contents. | ||
237 | EffectFrameStyled ///< Displays a Plasma-styled frame around the contents. | 237 | EffectFrameStyled ///< Displays a Plasma-styled frame around the contents. | ||
238 | }; | 238 | }; | ||
239 | 239 | | |||
240 | /** | 240 | /** | ||
241 | * Infinite region (i.e. a special region type saying that everything needs to be painted). | 241 | * Infinite region (i.e. a special region type saying that everything needs to be painted). | ||
242 | */ | 242 | **/ | ||
243 | KWINEFFECTS_EXPORT inline | 243 | KWINEFFECTS_EXPORT inline | ||
244 | QRect infiniteRegion() | 244 | QRect infiniteRegion() | ||
245 | { | 245 | { | ||
246 | // INT_MIN / 2 because width/height is used (INT_MIN+INT_MAX==-1) | 246 | // INT_MIN / 2 because width/height is used (INT_MIN+INT_MAX==-1) | ||
247 | return QRect(INT_MIN / 2, INT_MIN / 2, INT_MAX, INT_MAX); | 247 | return QRect(INT_MIN / 2, INT_MIN / 2, INT_MAX, INT_MAX); | ||
248 | } | 248 | } | ||
249 | 249 | | |||
250 | /** | 250 | /** | ||
▲ Show 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 318 | public: | |||
381 | * | 381 | * | ||
382 | * In OpenGL based compositing, the frameworks ensures that the context is current | 382 | * In OpenGL based compositing, the frameworks ensures that the context is current | ||
383 | * when the Effect is destroyed. | 383 | * when the Effect is destroyed. | ||
384 | **/ | 384 | **/ | ||
385 | virtual ~Effect(); | 385 | virtual ~Effect(); | ||
386 | 386 | | |||
387 | /** | 387 | /** | ||
388 | * Flags describing which parts of configuration have changed. | 388 | * Flags describing which parts of configuration have changed. | ||
389 | */ | 389 | **/ | ||
390 | enum ReconfigureFlag { | 390 | enum ReconfigureFlag { | ||
391 | ReconfigureAll = 1 << 0 /// Everything needs to be reconfigured. | 391 | ReconfigureAll = 1 << 0 /// Everything needs to be reconfigured. | ||
392 | }; | 392 | }; | ||
393 | Q_DECLARE_FLAGS(ReconfigureFlags, ReconfigureFlag) | 393 | Q_DECLARE_FLAGS(ReconfigureFlags, ReconfigureFlag) | ||
394 | 394 | | |||
395 | /** | 395 | /** | ||
396 | * Called when configuration changes (either the effect's or KWin's global). | 396 | * Called when configuration changes (either the effect's or KWin's global). | ||
397 | * | 397 | * | ||
398 | * In OpenGL based compositing, the frameworks ensures that the context is current | 398 | * In OpenGL based compositing, the frameworks ensures that the context is current | ||
399 | * when the Effect is reconfigured. If this method is called from within the Effect it is | 399 | * when the Effect is reconfigured. If this method is called from within the Effect it is | ||
400 | * required to ensure that the context is current if the implementation does OpenGL calls. | 400 | * required to ensure that the context is current if the implementation does OpenGL calls. | ||
401 | */ | 401 | **/ | ||
402 | virtual void reconfigure(ReconfigureFlags flags); | 402 | virtual void reconfigure(ReconfigureFlags flags); | ||
403 | 403 | | |||
404 | /** | 404 | /** | ||
405 | * Called when another effect requests the proxy for this effect. | 405 | * Called when another effect requests the proxy for this effect. | ||
406 | */ | 406 | **/ | ||
407 | virtual void* proxy(); | 407 | virtual void* proxy(); | ||
408 | 408 | | |||
409 | /** | 409 | /** | ||
410 | * Called before starting to paint the screen. | 410 | * Called before starting to paint the screen. | ||
411 | * In this method you can: | 411 | * In this method you can: | ||
412 | * @li set whether the windows or the entire screen will be transformed | 412 | * @li set whether the windows or the entire screen will be transformed | ||
413 | * @li change the region of the screen that will be painted | 413 | * @li change the region of the screen that will be painted | ||
414 | * @li do various housekeeping tasks such as initing your effect's variables | 414 | * @li do various housekeeping tasks such as initing your effect's variables | ||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | |||||
487 | * In OpenGL based compositing, the frameworks ensures that the context is current | 487 | * In OpenGL based compositing, the frameworks ensures that the context is current | ||
488 | * when this method is invoked. | 488 | * when this method is invoked. | ||
489 | **/ | 489 | **/ | ||
490 | virtual void paintEffectFrame(EffectFrame* frame, QRegion region, double opacity, double frameOpacity); | 490 | virtual void paintEffectFrame(EffectFrame* frame, QRegion region, double opacity, double frameOpacity); | ||
491 | 491 | | |||
492 | /** | 492 | /** | ||
493 | * Called on Transparent resizes. | 493 | * Called on Transparent resizes. | ||
494 | * return true if your effect substitutes questioned feature | 494 | * return true if your effect substitutes questioned feature | ||
495 | */ | 495 | **/ | ||
496 | virtual bool provides(Feature); | 496 | virtual bool provides(Feature); | ||
497 | 497 | | |||
498 | /** | 498 | /** | ||
499 | * Performs the @p feature with the @p arguments. | 499 | * Performs the @p feature with the @p arguments. | ||
500 | * | 500 | * | ||
501 | * This allows to have specific protocols between KWin core and an Effect. | 501 | * This allows to have specific protocols between KWin core and an Effect. | ||
502 | * | 502 | * | ||
503 | * The method is supposed to return @c true if it performed the features, | 503 | * The method is supposed to return @c true if it performed the features, | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
549 | * This could be as trivial as printing specific detail information about the effect state | 549 | * This could be as trivial as printing specific detail information about the effect state | ||
550 | * but could also be used to move the effect in and out of a special debug modes, clear bogus | 550 | * but could also be used to move the effect in and out of a special debug modes, clear bogus | ||
551 | * data, etc. | 551 | * data, etc. | ||
552 | * Notice that the functions is const by intent! Whenever you alter the state of the object | 552 | * Notice that the functions is const by intent! Whenever you alter the state of the object | ||
553 | * due to random user input, you should do so with greatest care, hence const_cast<> your | 553 | * due to random user input, you should do so with greatest care, hence const_cast<> your | ||
554 | * object - signalling "let me alone, i know what i'm doing" | 554 | * object - signalling "let me alone, i know what i'm doing" | ||
555 | * @param parameter A freeform string user input for your effect to interpret. | 555 | * @param parameter A freeform string user input for your effect to interpret. | ||
556 | * @since 4.11 | 556 | * @since 4.11 | ||
557 | */ | 557 | **/ | ||
558 | virtual QString debug(const QString ¶meter) const; | 558 | virtual QString debug(const QString ¶meter) const; | ||
559 | 559 | | |||
560 | /** | 560 | /** | ||
561 | * Reimplement this method to indicate where in the Effect chain the Effect should be placed. | 561 | * Reimplement this method to indicate where in the Effect chain the Effect should be placed. | ||
562 | * | 562 | * | ||
563 | * A low number indicates early chain position, thus before other Effects got called, a high | 563 | * A low number indicates early chain position, thus before other Effects got called, a high | ||
564 | * number indicates a late position. The returned number should be in the interval [0, 100]. | 564 | * number indicates a late position. The returned number should be in the interval [0, 100]. | ||
565 | * The default value is 0. | 565 | * The default value is 0. | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | |||||
637 | /** | 637 | /** | ||
638 | * Read animation time from the configuration and possibly adjust using animationTimeFactor(). | 638 | * Read animation time from the configuration and possibly adjust using animationTimeFactor(). | ||
639 | * The configuration value in the effect should also have special value 'default' (set using | 639 | * The configuration value in the effect should also have special value 'default' (set using | ||
640 | * QSpinBox::setSpecialValueText()) with the value 0. This special value is adjusted | 640 | * QSpinBox::setSpecialValueText()) with the value 0. This special value is adjusted | ||
641 | * using the global animation speed, otherwise the exact time configured is returned. | 641 | * using the global animation speed, otherwise the exact time configured is returned. | ||
642 | * @param cfg configuration group to read value from | 642 | * @param cfg configuration group to read value from | ||
643 | * @param key configuration key to read value from | 643 | * @param key configuration key to read value from | ||
644 | * @param defaultTime default animation time in milliseconds | 644 | * @param defaultTime default animation time in milliseconds | ||
645 | */ | 645 | **/ | ||
646 | // return type is intentionally double so that one can divide using it without losing data | 646 | // return type is intentionally double so that one can divide using it without losing data | ||
647 | static double animationTime(const KConfigGroup& cfg, const QString& key, int defaultTime); | 647 | static double animationTime(const KConfigGroup& cfg, const QString& key, int defaultTime); | ||
648 | /** | 648 | /** | ||
649 | * @overload Use this variant if the animation time is hardcoded and not configurable | 649 | * @overload Use this variant if the animation time is hardcoded and not configurable | ||
650 | * in the effect itself. | 650 | * in the effect itself. | ||
651 | */ | 651 | **/ | ||
652 | static double animationTime(int defaultTime); | 652 | static double animationTime(int defaultTime); | ||
653 | /** | 653 | /** | ||
654 | * @overload Use this variant if animation time is provided through a KConfigXT generated class | 654 | * @overload Use this variant if animation time is provided through a KConfigXT generated class | ||
655 | * having a property called "duration". | 655 | * having a property called "duration". | ||
656 | **/ | 656 | **/ | ||
657 | template <typename T> | 657 | template <typename T> | ||
658 | int animationTime(int defaultDuration); | 658 | int animationTime(int defaultDuration); | ||
659 | /** | 659 | /** | ||
Show All 24 Lines | 676 | protected: | |||
684 | **/ | 684 | **/ | ||
685 | template <typename T> | 685 | template <typename T> | ||
686 | void initConfig(); | 686 | void initConfig(); | ||
687 | }; | 687 | }; | ||
688 | 688 | | |||
689 | 689 | | |||
690 | /** | 690 | /** | ||
691 | * Prefer the KWIN_EFFECT_FACTORY macros. | 691 | * Prefer the KWIN_EFFECT_FACTORY macros. | ||
692 | */ | 692 | **/ | ||
693 | class KWINEFFECTS_EXPORT EffectPluginFactory : public KPluginFactory | 693 | class KWINEFFECTS_EXPORT EffectPluginFactory : public KPluginFactory | ||
694 | { | 694 | { | ||
695 | Q_OBJECT | 695 | Q_OBJECT | ||
696 | public: | 696 | public: | ||
697 | EffectPluginFactory(); | 697 | EffectPluginFactory(); | ||
698 | virtual ~EffectPluginFactory(); | 698 | virtual ~EffectPluginFactory(); | ||
699 | /** | 699 | /** | ||
700 | * Returns whether the Effect is supported. | 700 | * Returns whether the Effect is supported. | ||
701 | * | 701 | * | ||
702 | * An Effect can implement this method to determine at runtime whether the Effect is supported. | 702 | * An Effect can implement this method to determine at runtime whether the Effect is supported. | ||
703 | * | 703 | * | ||
704 | * If the current compositing backend is not supported it should return @c false. | 704 | * If the current compositing backend is not supported it should return @c false. | ||
705 | * | 705 | * | ||
706 | * This method is optional, by default @c true is returned. | 706 | * This method is optional, by default @c true is returned. | ||
707 | */ | 707 | **/ | ||
708 | virtual bool isSupported() const; | 708 | virtual bool isSupported() const; | ||
709 | /** | 709 | /** | ||
710 | * Returns whether the Effect should get enabled by default. | 710 | * Returns whether the Effect should get enabled by default. | ||
711 | * | 711 | * | ||
712 | * This function provides a way for an effect to override the default at runtime, | 712 | * This function provides a way for an effect to override the default at runtime, | ||
713 | * e.g. based on the capabilities of the hardware. | 713 | * e.g. based on the capabilities of the hardware. | ||
714 | * | 714 | * | ||
715 | * This method is optional; the effect doesn't have to provide it. | 715 | * This method is optional; the effect doesn't have to provide it. | ||
716 | * | 716 | * | ||
717 | * Note that this function is only called if the supported() function returns true, | 717 | * Note that this function is only called if the supported() function returns true, | ||
718 | * and if X-KDE-PluginInfo-EnabledByDefault is set to true in the .desktop file. | 718 | * and if X-KDE-PluginInfo-EnabledByDefault is set to true in the .desktop file. | ||
719 | * | 719 | * | ||
720 | * This method is optional, by default @c true is returned. | 720 | * This method is optional, by default @c true is returned. | ||
721 | */ | 721 | **/ | ||
722 | virtual bool enabledByDefault() const; | 722 | virtual bool enabledByDefault() const; | ||
723 | /** | 723 | /** | ||
724 | * This method returns the created Effect. | 724 | * This method returns the created Effect. | ||
725 | */ | 725 | **/ | ||
726 | virtual KWin::Effect *createEffect() const = 0; | 726 | virtual KWin::Effect *createEffect() const = 0; | ||
727 | }; | 727 | }; | ||
728 | 728 | | |||
729 | /** | 729 | /** | ||
730 | * Defines an EffectPluginFactory sub class with customized isSupported and enabledByDefault methods. | 730 | * Defines an EffectPluginFactory sub class with customized isSupported and enabledByDefault methods. | ||
731 | * | 731 | * | ||
732 | * If the Effect to be created does not need the isSupported or enabledByDefault methods prefer | 732 | * If the Effect to be created does not need the isSupported or enabledByDefault methods prefer | ||
733 | * the simplified KWIN_EFFECT_FACTORY, KWIN_EFFECT_FACTORY_SUPPORTED or KWIN_EFFECT_FACTORY_ENABLED | 733 | * the simplified KWIN_EFFECT_FACTORY, KWIN_EFFECT_FACTORY_SUPPORTED or KWIN_EFFECT_FACTORY_ENABLED | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 790 | { | |||
805 | Q_PROPERTY(int activeScreen READ activeScreen) | 805 | Q_PROPERTY(int activeScreen READ activeScreen) | ||
806 | Q_PROPERTY(int numScreens READ numScreens NOTIFY numberScreensChanged) | 806 | Q_PROPERTY(int numScreens READ numScreens NOTIFY numberScreensChanged) | ||
807 | /** | 807 | /** | ||
808 | * Factor by which animation speed in the effect should be modified (multiplied). | 808 | * Factor by which animation speed in the effect should be modified (multiplied). | ||
809 | * If configurable in the effect itself, the option should have also 'default' | 809 | * If configurable in the effect itself, the option should have also 'default' | ||
810 | * animation speed. The actual value should be determined using animationTime(). | 810 | * animation speed. The actual value should be determined using animationTime(). | ||
811 | * Note: The factor can be also 0, so make sure your code can cope with 0ms time | 811 | * Note: The factor can be also 0, so make sure your code can cope with 0ms time | ||
812 | * if used manually. | 812 | * if used manually. | ||
813 | */ | 813 | **/ | ||
814 | Q_PROPERTY(qreal animationTimeFactor READ animationTimeFactor) | 814 | Q_PROPERTY(qreal animationTimeFactor READ animationTimeFactor) | ||
815 | Q_PROPERTY(QList< KWin::EffectWindow* > stackingOrder READ stackingOrder) | 815 | Q_PROPERTY(QList< KWin::EffectWindow* > stackingOrder READ stackingOrder) | ||
816 | /** | 816 | /** | ||
817 | * Whether window decorations use the alpha channel. | 817 | * Whether window decorations use the alpha channel. | ||
818 | **/ | 818 | **/ | ||
819 | Q_PROPERTY(bool decorationsHaveAlpha READ decorationsHaveAlpha) | 819 | Q_PROPERTY(bool decorationsHaveAlpha READ decorationsHaveAlpha) | ||
820 | /** | 820 | /** | ||
821 | * Whether the window decorations support blurring behind the decoration. | 821 | * Whether the window decorations support blurring behind the decoration. | ||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 830 | public: | |||
872 | **/ | 872 | **/ | ||
873 | virtual void stopMouseInterception(Effect *effect) = 0; | 873 | virtual void stopMouseInterception(Effect *effect) = 0; | ||
874 | 874 | | |||
875 | /** | 875 | /** | ||
876 | * @brief Registers a global shortcut with the provided @p action. | 876 | * @brief Registers a global shortcut with the provided @p action. | ||
877 | * | 877 | * | ||
878 | * @param shortcut The global shortcut which should trigger the action | 878 | * @param shortcut The global shortcut which should trigger the action | ||
879 | * @param action The action which gets triggered when the shortcut matches | 879 | * @param action The action which gets triggered when the shortcut matches | ||
880 | */ | 880 | **/ | ||
881 | virtual void registerGlobalShortcut(const QKeySequence &shortcut, QAction *action) = 0; | 881 | virtual void registerGlobalShortcut(const QKeySequence &shortcut, QAction *action) = 0; | ||
882 | /** | 882 | /** | ||
883 | * @brief Registers a global pointer shortcut with the provided @p action. | 883 | * @brief Registers a global pointer shortcut with the provided @p action. | ||
884 | * | 884 | * | ||
885 | * @param modifiers The keyboard modifiers which need to be holded | 885 | * @param modifiers The keyboard modifiers which need to be holded | ||
886 | * @param pointerButtons The pointer buttons which need to be pressed | 886 | * @param pointerButtons The pointer buttons which need to be pressed | ||
887 | * @param action The action which gets triggered when the shortcut matches | 887 | * @param action The action which gets triggered when the shortcut matches | ||
888 | **/ | 888 | **/ | ||
Show All 14 Lines | |||||
903 | * @param action The action which gets triggered when the gesture triggers | 903 | * @param action The action which gets triggered when the gesture triggers | ||
904 | * @since 5.10 | 904 | * @since 5.10 | ||
905 | **/ | 905 | **/ | ||
906 | virtual void registerTouchpadSwipeShortcut(SwipeDirection direction, QAction *action) = 0; | 906 | virtual void registerTouchpadSwipeShortcut(SwipeDirection direction, QAction *action) = 0; | ||
907 | 907 | | |||
908 | /** | 908 | /** | ||
909 | * Retrieve the proxy class for an effect if it has one. Will return NULL if | 909 | * Retrieve the proxy class for an effect if it has one. Will return NULL if | ||
910 | * the effect isn't loaded or doesn't have a proxy class. | 910 | * the effect isn't loaded or doesn't have a proxy class. | ||
911 | */ | 911 | **/ | ||
912 | virtual void* getProxy(QString name) = 0; | 912 | virtual void* getProxy(QString name) = 0; | ||
913 | 913 | | |||
914 | // Mouse polling | 914 | // Mouse polling | ||
915 | virtual void startMousePolling() = 0; | 915 | virtual void startMousePolling() = 0; | ||
916 | virtual void stopMousePolling() = 0; | 916 | virtual void stopMousePolling() = 0; | ||
917 | 917 | | |||
918 | virtual void reserveElectricBorder(ElectricBorder border, Effect *effect) = 0; | 918 | virtual void reserveElectricBorder(ElectricBorder border, Effect *effect) = 0; | ||
919 | virtual void unreserveElectricBorder(ElectricBorder border, Effect *effect) = 0; | 919 | virtual void unreserveElectricBorder(ElectricBorder border, Effect *effect) = 0; | ||
Show All 23 Lines | |||||
943 | // functions that allow controlling windows/desktop | 943 | // functions that allow controlling windows/desktop | ||
944 | virtual void activateWindow(KWin::EffectWindow* c) = 0; | 944 | virtual void activateWindow(KWin::EffectWindow* c) = 0; | ||
945 | virtual KWin::EffectWindow* activeWindow() const = 0 ; | 945 | virtual KWin::EffectWindow* activeWindow() const = 0 ; | ||
946 | Q_SCRIPTABLE virtual void moveWindow(KWin::EffectWindow* w, const QPoint& pos, bool snap = false, double snapAdjust = 1.0) = 0; | 946 | Q_SCRIPTABLE virtual void moveWindow(KWin::EffectWindow* w, const QPoint& pos, bool snap = false, double snapAdjust = 1.0) = 0; | ||
947 | 947 | | |||
948 | /** | 948 | /** | ||
949 | * Moves the window to the specific desktop | 949 | * Moves the window to the specific desktop | ||
950 | * Setting desktop to NET::OnAllDesktops will set the window on all desktops | 950 | * Setting desktop to NET::OnAllDesktops will set the window on all desktops | ||
951 | */ | 951 | **/ | ||
952 | Q_SCRIPTABLE virtual void windowToDesktop(KWin::EffectWindow* w, int desktop) = 0; | 952 | Q_SCRIPTABLE virtual void windowToDesktop(KWin::EffectWindow* w, int desktop) = 0; | ||
953 | 953 | | |||
954 | /** | 954 | /** | ||
955 | * Moves a window to the given desktops | 955 | * Moves a window to the given desktops | ||
956 | * On X11, the window will end up on the last window in the list | 956 | * On X11, the window will end up on the last window in the list | ||
957 | * Setting this to an empty list will set the window on all desktops | 957 | * Setting this to an empty list will set the window on all desktops | ||
958 | * | 958 | * | ||
959 | * @arg desktopIds a list of desktops the window should be placed on. NET::OnAllDesktops is not a valid desktop X11Id | 959 | * @arg desktopIds a list of desktops the window should be placed on. NET::OnAllDesktops is not a valid desktop X11Id | ||
960 | */ | 960 | **/ | ||
961 | Q_SCRIPTABLE virtual void windowToDesktops(KWin::EffectWindow* w, const QVector<uint> &desktopIds) = 0; | 961 | Q_SCRIPTABLE virtual void windowToDesktops(KWin::EffectWindow* w, const QVector<uint> &desktopIds) = 0; | ||
962 | 962 | | |||
963 | Q_SCRIPTABLE virtual void windowToScreen(KWin::EffectWindow* w, int screen) = 0; | 963 | Q_SCRIPTABLE virtual void windowToScreen(KWin::EffectWindow* w, int screen) = 0; | ||
964 | virtual void setShowingDesktop(bool showing) = 0; | 964 | virtual void setShowingDesktop(bool showing) = 0; | ||
965 | 965 | | |||
966 | // Activities | 966 | // Activities | ||
967 | /** | 967 | /** | ||
968 | * @returns The ID of the current activity. | 968 | * @returns The ID of the current activity. | ||
969 | */ | 969 | **/ | ||
970 | virtual QString currentActivity() const = 0; | 970 | virtual QString currentActivity() const = 0; | ||
971 | // Desktops | 971 | // Desktops | ||
972 | /** | 972 | /** | ||
973 | * @returns The ID of the current desktop. | 973 | * @returns The ID of the current desktop. | ||
974 | */ | 974 | **/ | ||
975 | virtual int currentDesktop() const = 0; | 975 | virtual int currentDesktop() const = 0; | ||
976 | /** | 976 | /** | ||
977 | * @returns Total number of desktops currently in existence. | 977 | * @returns Total number of desktops currently in existence. | ||
978 | */ | 978 | **/ | ||
979 | virtual int numberOfDesktops() const = 0; | 979 | virtual int numberOfDesktops() const = 0; | ||
980 | /** | 980 | /** | ||
981 | * Set the current desktop to @a desktop. | 981 | * Set the current desktop to @a desktop. | ||
982 | */ | 982 | **/ | ||
983 | virtual void setCurrentDesktop(int desktop) = 0; | 983 | virtual void setCurrentDesktop(int desktop) = 0; | ||
984 | /** | 984 | /** | ||
985 | * Sets the total number of desktops to @a desktops. | 985 | * Sets the total number of desktops to @a desktops. | ||
986 | */ | 986 | **/ | ||
987 | virtual void setNumberOfDesktops(int desktops) = 0; | 987 | virtual void setNumberOfDesktops(int desktops) = 0; | ||
988 | /** | 988 | /** | ||
989 | * @returns The size of desktop layout in grid units. | 989 | * @returns The size of desktop layout in grid units. | ||
990 | */ | 990 | **/ | ||
991 | virtual QSize desktopGridSize() const = 0; | 991 | virtual QSize desktopGridSize() const = 0; | ||
992 | /** | 992 | /** | ||
993 | * @returns The width of desktop layout in grid units. | 993 | * @returns The width of desktop layout in grid units. | ||
994 | */ | 994 | **/ | ||
995 | virtual int desktopGridWidth() const = 0; | 995 | virtual int desktopGridWidth() const = 0; | ||
996 | /** | 996 | /** | ||
997 | * @returns The height of desktop layout in grid units. | 997 | * @returns The height of desktop layout in grid units. | ||
998 | */ | 998 | **/ | ||
999 | virtual int desktopGridHeight() const = 0; | 999 | virtual int desktopGridHeight() const = 0; | ||
1000 | /** | 1000 | /** | ||
1001 | * @returns The width of desktop layout in pixels. | 1001 | * @returns The width of desktop layout in pixels. | ||
1002 | */ | 1002 | **/ | ||
1003 | virtual int workspaceWidth() const = 0; | 1003 | virtual int workspaceWidth() const = 0; | ||
1004 | /** | 1004 | /** | ||
1005 | * @returns The height of desktop layout in pixels. | 1005 | * @returns The height of desktop layout in pixels. | ||
1006 | */ | 1006 | **/ | ||
1007 | virtual int workspaceHeight() const = 0; | 1007 | virtual int workspaceHeight() const = 0; | ||
1008 | /** | 1008 | /** | ||
1009 | * @returns The ID of the desktop at the point @a coords or 0 if no desktop exists at that | 1009 | * @returns The ID of the desktop at the point @a coords or 0 if no desktop exists at that | ||
1010 | * point. @a coords is to be in grid units. | 1010 | * point. @a coords is to be in grid units. | ||
1011 | */ | 1011 | **/ | ||
1012 | virtual int desktopAtCoords(QPoint coords) const = 0; | 1012 | virtual int desktopAtCoords(QPoint coords) const = 0; | ||
1013 | /** | 1013 | /** | ||
1014 | * @returns The coords of desktop @a id in grid units. | 1014 | * @returns The coords of desktop @a id in grid units. | ||
1015 | */ | 1015 | **/ | ||
1016 | virtual QPoint desktopGridCoords(int id) const = 0; | 1016 | virtual QPoint desktopGridCoords(int id) const = 0; | ||
1017 | /** | 1017 | /** | ||
1018 | * @returns The coords of the top-left corner of desktop @a id in pixels. | 1018 | * @returns The coords of the top-left corner of desktop @a id in pixels. | ||
1019 | */ | 1019 | **/ | ||
1020 | virtual QPoint desktopCoords(int id) const = 0; | 1020 | virtual QPoint desktopCoords(int id) const = 0; | ||
1021 | /** | 1021 | /** | ||
1022 | * @returns The ID of the desktop above desktop @a id. Wraps around to the bottom of | 1022 | * @returns The ID of the desktop above desktop @a id. Wraps around to the bottom of | ||
1023 | * the layout if @a wrap is set. If @a id is not set use the current one. | 1023 | * the layout if @a wrap is set. If @a id is not set use the current one. | ||
1024 | */ | 1024 | **/ | ||
1025 | Q_SCRIPTABLE virtual int desktopAbove(int desktop = 0, bool wrap = true) const = 0; | 1025 | Q_SCRIPTABLE virtual int desktopAbove(int desktop = 0, bool wrap = true) const = 0; | ||
1026 | /** | 1026 | /** | ||
1027 | * @returns The ID of the desktop to the right of desktop @a id. Wraps around to the | 1027 | * @returns The ID of the desktop to the right of desktop @a id. Wraps around to the | ||
1028 | * left of the layout if @a wrap is set. If @a id is not set use the current one. | 1028 | * left of the layout if @a wrap is set. If @a id is not set use the current one. | ||
1029 | */ | 1029 | **/ | ||
1030 | Q_SCRIPTABLE virtual int desktopToRight(int desktop = 0, bool wrap = true) const = 0; | 1030 | Q_SCRIPTABLE virtual int desktopToRight(int desktop = 0, bool wrap = true) const = 0; | ||
1031 | /** | 1031 | /** | ||
1032 | * @returns The ID of the desktop below desktop @a id. Wraps around to the top of the | 1032 | * @returns The ID of the desktop below desktop @a id. Wraps around to the top of the | ||
1033 | * layout if @a wrap is set. If @a id is not set use the current one. | 1033 | * layout if @a wrap is set. If @a id is not set use the current one. | ||
1034 | */ | 1034 | **/ | ||
1035 | Q_SCRIPTABLE virtual int desktopBelow(int desktop = 0, bool wrap = true) const = 0; | 1035 | Q_SCRIPTABLE virtual int desktopBelow(int desktop = 0, bool wrap = true) const = 0; | ||
1036 | /** | 1036 | /** | ||
1037 | * @returns The ID of the desktop to the left of desktop @a id. Wraps around to the | 1037 | * @returns The ID of the desktop to the left of desktop @a id. Wraps around to the | ||
1038 | * right of the layout if @a wrap is set. If @a id is not set use the current one. | 1038 | * right of the layout if @a wrap is set. If @a id is not set use the current one. | ||
1039 | */ | 1039 | **/ | ||
1040 | Q_SCRIPTABLE virtual int desktopToLeft(int desktop = 0, bool wrap = true) const = 0; | 1040 | Q_SCRIPTABLE virtual int desktopToLeft(int desktop = 0, bool wrap = true) const = 0; | ||
1041 | Q_SCRIPTABLE virtual QString desktopName(int desktop) const = 0; | 1041 | Q_SCRIPTABLE virtual QString desktopName(int desktop) const = 0; | ||
1042 | virtual bool optionRollOverDesktops() const = 0; | 1042 | virtual bool optionRollOverDesktops() const = 0; | ||
1043 | 1043 | | |||
1044 | virtual int activeScreen() const = 0; // Xinerama | 1044 | virtual int activeScreen() const = 0; // Xinerama | ||
1045 | virtual int numScreens() const = 0; // Xinerama | 1045 | virtual int numScreens() const = 0; // Xinerama | ||
1046 | Q_SCRIPTABLE virtual int screenNumber(const QPoint& pos) const = 0; // Xinerama | 1046 | Q_SCRIPTABLE virtual int screenNumber(const QPoint& pos) const = 0; // Xinerama | ||
1047 | virtual QRect clientArea(clientAreaOption, int screen, int desktop) const = 0; | 1047 | virtual QRect clientArea(clientAreaOption, int screen, int desktop) const = 0; | ||
Show All 19 Lines | |||||
1067 | **/ | 1067 | **/ | ||
1068 | virtual QRect virtualScreenGeometry() const = 0; | 1068 | virtual QRect virtualScreenGeometry() const = 0; | ||
1069 | /** | 1069 | /** | ||
1070 | * Factor by which animation speed in the effect should be modified (multiplied). | 1070 | * Factor by which animation speed in the effect should be modified (multiplied). | ||
1071 | * If configurable in the effect itself, the option should have also 'default' | 1071 | * If configurable in the effect itself, the option should have also 'default' | ||
1072 | * animation speed. The actual value should be determined using animationTime(). | 1072 | * animation speed. The actual value should be determined using animationTime(). | ||
1073 | * Note: The factor can be also 0, so make sure your code can cope with 0ms time | 1073 | * Note: The factor can be also 0, so make sure your code can cope with 0ms time | ||
1074 | * if used manually. | 1074 | * if used manually. | ||
1075 | */ | 1075 | **/ | ||
1076 | virtual double animationTimeFactor() const = 0; | 1076 | virtual double animationTimeFactor() const = 0; | ||
1077 | virtual WindowQuadType newWindowQuadType() = 0; | 1077 | virtual WindowQuadType newWindowQuadType() = 0; | ||
1078 | 1078 | | |||
1079 | Q_SCRIPTABLE virtual KWin::EffectWindow* findWindow(WId id) const = 0; | 1079 | Q_SCRIPTABLE virtual KWin::EffectWindow* findWindow(WId id) const = 0; | ||
1080 | Q_SCRIPTABLE virtual KWin::EffectWindow* findWindow(KWayland::Server::SurfaceInterface *surf) const = 0; | 1080 | Q_SCRIPTABLE virtual KWin::EffectWindow* findWindow(KWayland::Server::SurfaceInterface *surf) const = 0; | ||
1081 | /** | 1081 | /** | ||
1082 | * Finds the EffectWindow for the internal window @p w. | 1082 | * Finds the EffectWindow for the internal window @p w. | ||
1083 | * If there is no such window @c null is returned. | 1083 | * If there is no such window @c null is returned. | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
1132 | virtual unsigned long xrenderBufferPicture() = 0; | 1132 | virtual unsigned long xrenderBufferPicture() = 0; | ||
1133 | /** | 1133 | /** | ||
1134 | * @brief Provides access to the QPainter which is rendering to the back buffer. | 1134 | * @brief Provides access to the QPainter which is rendering to the back buffer. | ||
1135 | * | 1135 | * | ||
1136 | * Only relevant for CompositingType QPainterCompositing. For all other compositing types | 1136 | * Only relevant for CompositingType QPainterCompositing. For all other compositing types | ||
1137 | * @c null is returned. | 1137 | * @c null is returned. | ||
1138 | * | 1138 | * | ||
1139 | * @return QPainter* The Scene's QPainter or @c null. | 1139 | * @return QPainter* The Scene's QPainter or @c null. | ||
1140 | */ | 1140 | **/ | ||
1141 | virtual QPainter *scenePainter() = 0; | 1141 | virtual QPainter *scenePainter() = 0; | ||
1142 | virtual void reconfigure() = 0; | 1142 | virtual void reconfigure() = 0; | ||
1143 | 1143 | | |||
1144 | virtual QByteArray readRootProperty(long atom, long type, int format) const = 0; | 1144 | virtual QByteArray readRootProperty(long atom, long type, int format) const = 0; | ||
1145 | /** | 1145 | /** | ||
1146 | * @brief Announces support for the feature with the given name. If no other Effect | 1146 | * @brief Announces support for the feature with the given name. If no other Effect | ||
1147 | * has announced support for this feature yet, an X11 property will be installed on | 1147 | * has announced support for this feature yet, an X11 property will be installed on | ||
1148 | * the root window. | 1148 | * the root window. | ||
Show All 22 Lines | |||||
1171 | * @param effect The effect which had registered the property. | 1171 | * @param effect The effect which had registered the property. | ||
1172 | * @see announceSupportProperty | 1172 | * @see announceSupportProperty | ||
1173 | * @since 4.11 | 1173 | * @since 4.11 | ||
1174 | **/ | 1174 | **/ | ||
1175 | virtual void removeSupportProperty(const QByteArray &propertyName, Effect *effect) = 0; | 1175 | virtual void removeSupportProperty(const QByteArray &propertyName, Effect *effect) = 0; | ||
1176 | 1176 | | |||
1177 | /** | 1177 | /** | ||
1178 | * Returns @a true if the active window decoration has shadow API hooks. | 1178 | * Returns @a true if the active window decoration has shadow API hooks. | ||
1179 | */ | 1179 | **/ | ||
1180 | virtual bool hasDecorationShadows() const = 0; | 1180 | virtual bool hasDecorationShadows() const = 0; | ||
1181 | 1181 | | |||
1182 | /** | 1182 | /** | ||
1183 | * Returns @a true if the window decorations use the alpha channel, and @a false otherwise. | 1183 | * Returns @a true if the window decorations use the alpha channel, and @a false otherwise. | ||
1184 | * @since 4.5 | 1184 | * @since 4.5 | ||
1185 | */ | 1185 | **/ | ||
1186 | virtual bool decorationsHaveAlpha() const = 0; | 1186 | virtual bool decorationsHaveAlpha() const = 0; | ||
1187 | 1187 | | |||
1188 | /** | 1188 | /** | ||
1189 | * Returns @a true if the window decorations support blurring behind the decoration, and @a false otherwise | 1189 | * Returns @a true if the window decorations support blurring behind the decoration, and @a false otherwise | ||
1190 | * @since 4.6 | 1190 | * @since 4.6 | ||
1191 | */ | 1191 | **/ | ||
1192 | virtual bool decorationSupportsBlurBehind() const = 0; | 1192 | virtual bool decorationSupportsBlurBehind() const = 0; | ||
1193 | 1193 | | |||
1194 | /** | 1194 | /** | ||
1195 | * Creates a new frame object. If the frame does not have a static size | 1195 | * Creates a new frame object. If the frame does not have a static size | ||
1196 | * then it will be located at @a position with @a alignment. A | 1196 | * then it will be located at @a position with @a alignment. A | ||
1197 | * non-static frame will automatically adjust its size to fit the contents. | 1197 | * non-static frame will automatically adjust its size to fit the contents. | ||
1198 | * @returns A new @ref EffectFrame. It is the responsibility of the caller to delete the | 1198 | * @returns A new @ref EffectFrame. It is the responsibility of the caller to delete the | ||
1199 | * EffectFrame. | 1199 | * EffectFrame. | ||
1200 | * @since 4.6 | 1200 | * @since 4.6 | ||
1201 | */ | 1201 | **/ | ||
1202 | virtual EffectFrame* effectFrame(EffectFrameStyle style, bool staticSize = true, | 1202 | virtual EffectFrame* effectFrame(EffectFrameStyle style, bool staticSize = true, | ||
1203 | const QPoint& position = QPoint(-1, -1), Qt::Alignment alignment = Qt::AlignCenter) const = 0; | 1203 | const QPoint& position = QPoint(-1, -1), Qt::Alignment alignment = Qt::AlignCenter) const = 0; | ||
1204 | 1204 | | |||
1205 | /** | 1205 | /** | ||
1206 | * Allows an effect to trigger a reload of itself. | 1206 | * Allows an effect to trigger a reload of itself. | ||
1207 | * This can be used by an effect which needs to be reloaded when screen geometry changes. | 1207 | * This can be used by an effect which needs to be reloaded when screen geometry changes. | ||
1208 | * It is possible that the effect cannot be loaded again as it's supported method does no longer | 1208 | * It is possible that the effect cannot be loaded again as it's supported method does no longer | ||
1209 | * hold. | 1209 | * hold. | ||
Show All 15 Lines | |||||
1225 | virtual bool isScreenLocked() const = 0; | 1225 | virtual bool isScreenLocked() const = 0; | ||
1226 | 1226 | | |||
1227 | /** | 1227 | /** | ||
1228 | * @brief Makes the OpenGL compositing context current. | 1228 | * @brief Makes the OpenGL compositing context current. | ||
1229 | * | 1229 | * | ||
1230 | * If the compositing backend is not using OpenGL, this method returns @c false. | 1230 | * If the compositing backend is not using OpenGL, this method returns @c false. | ||
1231 | * | 1231 | * | ||
1232 | * @return bool @c true if the context became current, @c false otherwise. | 1232 | * @return bool @c true if the context became current, @c false otherwise. | ||
1233 | */ | 1233 | **/ | ||
1234 | virtual bool makeOpenGLContextCurrent() = 0; | 1234 | virtual bool makeOpenGLContextCurrent() = 0; | ||
1235 | /** | 1235 | /** | ||
1236 | * @brief Makes a null OpenGL context current resulting in no context | 1236 | * @brief Makes a null OpenGL context current resulting in no context | ||
1237 | * being current. | 1237 | * being current. | ||
1238 | * | 1238 | * | ||
1239 | * If the compositing backend is not OpenGL based, this method is a noop. | 1239 | * If the compositing backend is not OpenGL based, this method is a noop. | ||
1240 | * | 1240 | * | ||
1241 | * There is normally no reason for an Effect to call this method. | 1241 | * There is normally no reason for an Effect to call this method. | ||
1242 | */ | 1242 | **/ | ||
1243 | virtual void doneOpenGLContextCurrent() = 0; | 1243 | virtual void doneOpenGLContextCurrent() = 0; | ||
1244 | 1244 | | |||
1245 | virtual xcb_connection_t *xcbConnection() const = 0; | 1245 | virtual xcb_connection_t *xcbConnection() const = 0; | ||
1246 | virtual xcb_window_t x11RootWindow() const = 0; | 1246 | virtual xcb_window_t x11RootWindow() const = 0; | ||
1247 | 1247 | | |||
1248 | /** | 1248 | /** | ||
1249 | * Interface to the Wayland display: this is relevant only | 1249 | * Interface to the Wayland display: this is relevant only | ||
1250 | * on Wayland, on X11 it will be nullptr | 1250 | * on Wayland, on X11 it will be nullptr | ||
1251 | * @since 5.5 | 1251 | * @since 5.5 | ||
1252 | */ | 1252 | **/ | ||
1253 | virtual KWayland::Server::Display *waylandDisplay() const = 0; | 1253 | virtual KWayland::Server::Display *waylandDisplay() const = 0; | ||
1254 | 1254 | | |||
1255 | /** | 1255 | /** | ||
1256 | * Whether animations are supported by the Scene. | 1256 | * Whether animations are supported by the Scene. | ||
1257 | * If this method returns @c false Effects are supposed to not | 1257 | * If this method returns @c false Effects are supposed to not | ||
1258 | * animate transitions. | 1258 | * animate transitions. | ||
1259 | * | 1259 | * | ||
1260 | * @returns Whether the Scene can drive animations | 1260 | * @returns Whether the Scene can drive animations | ||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | |||||
1352 | /** | 1352 | /** | ||
1353 | * @returns The global input configuration (kcminputrc) | 1353 | * @returns The global input configuration (kcminputrc) | ||
1354 | * @since 5.10 | 1354 | * @since 5.10 | ||
1355 | **/ | 1355 | **/ | ||
1356 | virtual KSharedConfigPtr inputConfig() const = 0; | 1356 | virtual KSharedConfigPtr inputConfig() const = 0; | ||
1357 | 1357 | | |||
1358 | /** | 1358 | /** | ||
1359 | * Returns if activeFullScreenEffect is set | 1359 | * Returns if activeFullScreenEffect is set | ||
1360 | */ | 1360 | **/ | ||
1361 | virtual bool hasActiveFullScreenEffect() const = 0; | 1361 | virtual bool hasActiveFullScreenEffect() const = 0; | ||
1362 | 1362 | | |||
1363 | Q_SIGNALS: | 1363 | Q_SIGNALS: | ||
1364 | /** | 1364 | /** | ||
1365 | * Signal emitted when the current desktop changed. | 1365 | * Signal emitted when the current desktop changed. | ||
1366 | * @param oldDesktop The previously current desktop | 1366 | * @param oldDesktop The previously current desktop | ||
1367 | * @param newDesktop The new current desktop | 1367 | * @param newDesktop The new current desktop | ||
1368 | * @param with The window which is taken over to the new desktop, can be NULL | 1368 | * @param with The window which is taken over to the new desktop, can be NULL | ||
1369 | * @since 4.9 | 1369 | * @since 4.9 | ||
1370 | */ | 1370 | **/ | ||
1371 | void desktopChanged(int oldDesktop, int newDesktop, KWin::EffectWindow *with); | 1371 | void desktopChanged(int oldDesktop, int newDesktop, KWin::EffectWindow *with); | ||
1372 | /** | 1372 | /** | ||
1373 | * @since 4.7 | 1373 | * @since 4.7 | ||
1374 | * @deprecated | 1374 | * @deprecated | ||
1375 | */ | 1375 | **/ | ||
1376 | void desktopChanged(int oldDesktop, int newDesktop); | 1376 | void desktopChanged(int oldDesktop, int newDesktop); | ||
1377 | /** | 1377 | /** | ||
1378 | * Signal emitted when a window moved to another desktop | 1378 | * Signal emitted when a window moved to another desktop | ||
1379 | * NOTICE that this does NOT imply that the desktop has changed | 1379 | * NOTICE that this does NOT imply that the desktop has changed | ||
1380 | * The @param window which is moved to the new desktop | 1380 | * The @param window which is moved to the new desktop | ||
1381 | * @param oldDesktop The previous desktop of the window | 1381 | * @param oldDesktop The previous desktop of the window | ||
1382 | * @param newDesktop The new desktop of the window | 1382 | * @param newDesktop The new desktop of the window | ||
1383 | * @since 4.11.4 | 1383 | * @since 4.11.4 | ||
1384 | */ | 1384 | **/ | ||
1385 | void desktopPresenceChanged(KWin::EffectWindow *window, int oldDesktop, int newDesktop); | 1385 | void desktopPresenceChanged(KWin::EffectWindow *window, int oldDesktop, int newDesktop); | ||
1386 | /** | 1386 | /** | ||
1387 | * Signal emitted when the number of currently existing desktops is changed. | 1387 | * Signal emitted when the number of currently existing desktops is changed. | ||
1388 | * @param old The previous number of desktops in used. | 1388 | * @param old The previous number of desktops in used. | ||
1389 | * @see EffectsHandler::numberOfDesktops. | 1389 | * @see EffectsHandler::numberOfDesktops. | ||
1390 | * @since 4.7 | 1390 | * @since 4.7 | ||
1391 | */ | 1391 | **/ | ||
1392 | void numberDesktopsChanged(uint old); | 1392 | void numberDesktopsChanged(uint old); | ||
1393 | /** | 1393 | /** | ||
1394 | * Signal emitted when the number of screens changed. | 1394 | * Signal emitted when the number of screens changed. | ||
1395 | * @since 5.0 | 1395 | * @since 5.0 | ||
1396 | **/ | 1396 | **/ | ||
1397 | void numberScreensChanged(); | 1397 | void numberScreensChanged(); | ||
1398 | /** | 1398 | /** | ||
1399 | * Signal emitted when the desktop showing ("dashboard") state changed | 1399 | * Signal emitted when the desktop showing ("dashboard") state changed | ||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Line(s) | |||||
1534 | **/ | 1534 | **/ | ||
1535 | void windowModalityChanged(KWin::EffectWindow *w); | 1535 | void windowModalityChanged(KWin::EffectWindow *w); | ||
1536 | /** | 1536 | /** | ||
1537 | * Signal emitted when a window either became unresponsive (eg. app froze or crashed) | 1537 | * Signal emitted when a window either became unresponsive (eg. app froze or crashed) | ||
1538 | * or respoonsive | 1538 | * or respoonsive | ||
1539 | * @param w The window that became (un)responsive | 1539 | * @param w The window that became (un)responsive | ||
1540 | * @param unresponsive Whether the window is responsive or unresponsive | 1540 | * @param unresponsive Whether the window is responsive or unresponsive | ||
1541 | * @since 5.10 | 1541 | * @since 5.10 | ||
1542 | */ | 1542 | **/ | ||
1543 | void windowUnresponsiveChanged(KWin::EffectWindow *w, bool unresponsive); | 1543 | void windowUnresponsiveChanged(KWin::EffectWindow *w, bool unresponsive); | ||
1544 | /** | 1544 | /** | ||
1545 | * Signal emitted when an area of a window is scheduled for repainting. | 1545 | * Signal emitted when an area of a window is scheduled for repainting. | ||
1546 | * Use this signal in an effect if another area needs to be synced as well. | 1546 | * Use this signal in an effect if another area needs to be synced as well. | ||
1547 | * @param w The window which is scheduled for repainting | 1547 | * @param w The window which is scheduled for repainting | ||
1548 | * @param r Always empty. | 1548 | * @param r Always empty. | ||
1549 | * @since 4.7 | 1549 | * @since 4.7 | ||
1550 | **/ | 1550 | **/ | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | |||||
1606 | **/ | 1606 | **/ | ||
1607 | void mouseChanged(const QPoint& pos, const QPoint& oldpos, | 1607 | void mouseChanged(const QPoint& pos, const QPoint& oldpos, | ||
1608 | Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons, | 1608 | Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons, | ||
1609 | Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers); | 1609 | Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers); | ||
1610 | /** | 1610 | /** | ||
1611 | * Signal emitted when the cursor shape changed. | 1611 | * Signal emitted when the cursor shape changed. | ||
1612 | * You'll likely want to query the current cursor as reaction: xcb_xfixes_get_cursor_image_unchecked | 1612 | * You'll likely want to query the current cursor as reaction: xcb_xfixes_get_cursor_image_unchecked | ||
1613 | * Connection to this signal is tracked, so if you don't need it anymore, disconnect from it to stop cursor event filtering | 1613 | * Connection to this signal is tracked, so if you don't need it anymore, disconnect from it to stop cursor event filtering | ||
1614 | */ | 1614 | **/ | ||
1615 | void cursorShapeChanged(); | 1615 | void cursorShapeChanged(); | ||
1616 | /** | 1616 | /** | ||
1617 | * Receives events registered for using registerPropertyType. | 1617 | * Receives events registered for using registerPropertyType. | ||
1618 | * Use readProperty() to get the property data. | 1618 | * Use readProperty() to get the property data. | ||
1619 | * Note that the property may be already set on the window, so doing the same | 1619 | * Note that the property may be already set on the window, so doing the same | ||
1620 | * processing from windowAdded() (e.g. simply calling propertyNotify() from it) | 1620 | * processing from windowAdded() (e.g. simply calling propertyNotify() from it) | ||
1621 | * is usually needed. | 1621 | * is usually needed. | ||
1622 | * @param w The window whose property changed, is @c null if it is a root window property | 1622 | * @param w The window whose property changed, is @c null if it is a root window property | ||
1623 | * @param atom The property | 1623 | * @param atom The property | ||
1624 | * @since 4.7 | 1624 | * @since 4.7 | ||
1625 | */ | 1625 | **/ | ||
1626 | void propertyNotify(KWin::EffectWindow* w, long atom); | 1626 | void propertyNotify(KWin::EffectWindow* w, long atom); | ||
1627 | 1627 | | |||
1628 | /** | 1628 | /** | ||
1629 | * Signal emitted after the screen geometry changed (e.g. add of a monitor). | 1629 | * Signal emitted after the screen geometry changed (e.g. add of a monitor). | ||
1630 | * Effects using displayWidth()/displayHeight() to cache information should | 1630 | * Effects using displayWidth()/displayHeight() to cache information should | ||
1631 | * react on this signal and update the caches. | 1631 | * react on this signal and update the caches. | ||
1632 | * @param size The new screen size | 1632 | * @param size The new screen size | ||
1633 | * @since 4.8 | 1633 | * @since 4.8 | ||
1634 | **/ | 1634 | **/ | ||
1635 | void screenGeometryChanged(const QSize &size); | 1635 | void screenGeometryChanged(const QSize &size); | ||
1636 | 1636 | | |||
1637 | /** | 1637 | /** | ||
1638 | * This signal is emitted when the global | 1638 | * This signal is emitted when the global | ||
1639 | * activity is changed | 1639 | * activity is changed | ||
1640 | * @param id id of the new current activity | 1640 | * @param id id of the new current activity | ||
1641 | * @since 4.9 | 1641 | * @since 4.9 | ||
1642 | **/ | 1642 | **/ | ||
1643 | void currentActivityChanged(const QString &id); | 1643 | void currentActivityChanged(const QString &id); | ||
1644 | /** | 1644 | /** | ||
1645 | * This signal is emitted when a new activity is added | 1645 | * This signal is emitted when a new activity is added | ||
1646 | * @param id id of the new activity | 1646 | * @param id id of the new activity | ||
1647 | * @since 4.9 | 1647 | * @since 4.9 | ||
1648 | */ | 1648 | **/ | ||
1649 | void activityAdded(const QString &id); | 1649 | void activityAdded(const QString &id); | ||
1650 | /** | 1650 | /** | ||
1651 | * This signal is emitted when the activity | 1651 | * This signal is emitted when the activity | ||
1652 | * is removed | 1652 | * is removed | ||
1653 | * @param id id of the removed activity | 1653 | * @param id id of the removed activity | ||
1654 | * @since 4.9 | 1654 | * @since 4.9 | ||
1655 | */ | 1655 | **/ | ||
1656 | void activityRemoved(const QString &id); | 1656 | void activityRemoved(const QString &id); | ||
1657 | /** | 1657 | /** | ||
1658 | * This signal is emitted when the screen got locked or unlocked. | 1658 | * This signal is emitted when the screen got locked or unlocked. | ||
1659 | * @param locked @c true if the screen is now locked, @c false if it is now unlocked | 1659 | * @param locked @c true if the screen is now locked, @c false if it is now unlocked | ||
1660 | * @since 4.11 | 1660 | * @since 4.11 | ||
1661 | **/ | 1661 | **/ | ||
1662 | void screenLockingChanged(bool locked); | 1662 | void screenLockingChanged(bool locked); | ||
1663 | 1663 | | |||
1664 | /** | 1664 | /** | ||
1665 | * This signels is emitted when ever the stacking order is change, ie. a window is risen | 1665 | * This signels is emitted when ever the stacking order is change, ie. a window is risen | ||
1666 | * or lowered | 1666 | * or lowered | ||
1667 | * @since 4.10 | 1667 | * @since 4.10 | ||
1668 | */ | 1668 | **/ | ||
1669 | void stackingOrderChanged(); | 1669 | void stackingOrderChanged(); | ||
1670 | /** | 1670 | /** | ||
1671 | * This signal is emitted when the user starts to approach the @p border with the mouse. | 1671 | * This signal is emitted when the user starts to approach the @p border with the mouse. | ||
1672 | * The @p factor describes how far away the mouse is in a relative mean. The values are in | 1672 | * The @p factor describes how far away the mouse is in a relative mean. The values are in | ||
1673 | * [0.0, 1.0] with 0.0 being emitted when first entered and on leaving. The value 1.0 means that | 1673 | * [0.0, 1.0] with 0.0 being emitted when first entered and on leaving. The value 1.0 means that | ||
1674 | * the @p border is reached with the mouse. So the values are well suited for animations. | 1674 | * the @p border is reached with the mouse. So the values are well suited for animations. | ||
1675 | * The signal is always emitted when the mouse cursor position changes. | 1675 | * The signal is always emitted when the mouse cursor position changes. | ||
1676 | * @param border The screen edge which is being approached | 1676 | * @param border The screen edge which is being approached | ||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Line(s) | 1802 | { | |||
1816 | Q_PROPERTY(bool onAllDesktops READ isOnAllDesktops) | 1816 | Q_PROPERTY(bool onAllDesktops READ isOnAllDesktops) | ||
1817 | Q_PROPERTY(bool onCurrentDesktop READ isOnCurrentDesktop) | 1817 | Q_PROPERTY(bool onCurrentDesktop READ isOnCurrentDesktop) | ||
1818 | Q_PROPERTY(QRect rect READ rect) | 1818 | Q_PROPERTY(QRect rect READ rect) | ||
1819 | Q_PROPERTY(QString windowClass READ windowClass) | 1819 | Q_PROPERTY(QString windowClass READ windowClass) | ||
1820 | Q_PROPERTY(QString windowRole READ windowRole) | 1820 | Q_PROPERTY(QString windowRole READ windowRole) | ||
1821 | /** | 1821 | /** | ||
1822 | * Returns whether the window is a desktop background window (the one with wallpaper). | 1822 | * Returns whether the window is a desktop background window (the one with wallpaper). | ||
1823 | * See _NET_WM_WINDOW_TYPE_DESKTOP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1823 | * See _NET_WM_WINDOW_TYPE_DESKTOP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1824 | */ | 1824 | **/ | ||
1825 | Q_PROPERTY(bool desktopWindow READ isDesktop) | 1825 | Q_PROPERTY(bool desktopWindow READ isDesktop) | ||
1826 | /** | 1826 | /** | ||
1827 | * Returns whether the window is a dock (i.e. a panel). | 1827 | * Returns whether the window is a dock (i.e. a panel). | ||
1828 | * See _NET_WM_WINDOW_TYPE_DOCK at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1828 | * See _NET_WM_WINDOW_TYPE_DOCK at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1829 | */ | 1829 | **/ | ||
1830 | Q_PROPERTY(bool dock READ isDock) | 1830 | Q_PROPERTY(bool dock READ isDock) | ||
1831 | /** | 1831 | /** | ||
1832 | * Returns whether the window is a standalone (detached) toolbar window. | 1832 | * Returns whether the window is a standalone (detached) toolbar window. | ||
1833 | * See _NET_WM_WINDOW_TYPE_TOOLBAR at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1833 | * See _NET_WM_WINDOW_TYPE_TOOLBAR at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1834 | */ | 1834 | **/ | ||
1835 | Q_PROPERTY(bool toolbar READ isToolbar) | 1835 | Q_PROPERTY(bool toolbar READ isToolbar) | ||
1836 | /** | 1836 | /** | ||
1837 | * Returns whether the window is a torn-off menu. | 1837 | * Returns whether the window is a torn-off menu. | ||
1838 | * See _NET_WM_WINDOW_TYPE_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1838 | * See _NET_WM_WINDOW_TYPE_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1839 | */ | 1839 | **/ | ||
1840 | Q_PROPERTY(bool menu READ isMenu) | 1840 | Q_PROPERTY(bool menu READ isMenu) | ||
1841 | /** | 1841 | /** | ||
1842 | * Returns whether the window is a "normal" window, i.e. an application or any other window | 1842 | * Returns whether the window is a "normal" window, i.e. an application or any other window | ||
1843 | * for which none of the specialized window types fit. | 1843 | * for which none of the specialized window types fit. | ||
1844 | * See _NET_WM_WINDOW_TYPE_NORMAL at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1844 | * See _NET_WM_WINDOW_TYPE_NORMAL at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1845 | */ | 1845 | **/ | ||
1846 | Q_PROPERTY(bool normalWindow READ isNormalWindow) | 1846 | Q_PROPERTY(bool normalWindow READ isNormalWindow) | ||
1847 | /** | 1847 | /** | ||
1848 | * Returns whether the window is a dialog window. | 1848 | * Returns whether the window is a dialog window. | ||
1849 | * See _NET_WM_WINDOW_TYPE_DIALOG at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1849 | * See _NET_WM_WINDOW_TYPE_DIALOG at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1850 | */ | 1850 | **/ | ||
1851 | Q_PROPERTY(bool dialog READ isDialog) | 1851 | Q_PROPERTY(bool dialog READ isDialog) | ||
1852 | /** | 1852 | /** | ||
1853 | * Returns whether the window is a splashscreen. Note that many (especially older) applications | 1853 | * Returns whether the window is a splashscreen. Note that many (especially older) applications | ||
1854 | * do not support marking their splash windows with this type. | 1854 | * do not support marking their splash windows with this type. | ||
1855 | * See _NET_WM_WINDOW_TYPE_SPLASH at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1855 | * See _NET_WM_WINDOW_TYPE_SPLASH at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1856 | */ | 1856 | **/ | ||
1857 | Q_PROPERTY(bool splash READ isSplash) | 1857 | Q_PROPERTY(bool splash READ isSplash) | ||
1858 | /** | 1858 | /** | ||
1859 | * Returns whether the window is a utility window, such as a tool window. | 1859 | * Returns whether the window is a utility window, such as a tool window. | ||
1860 | * See _NET_WM_WINDOW_TYPE_UTILITY at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1860 | * See _NET_WM_WINDOW_TYPE_UTILITY at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1861 | */ | 1861 | **/ | ||
1862 | Q_PROPERTY(bool utility READ isUtility) | 1862 | Q_PROPERTY(bool utility READ isUtility) | ||
1863 | /** | 1863 | /** | ||
1864 | * Returns whether the window is a dropdown menu (i.e. a popup directly or indirectly open | 1864 | * Returns whether the window is a dropdown menu (i.e. a popup directly or indirectly open | ||
1865 | * from the applications menubar). | 1865 | * from the applications menubar). | ||
1866 | * See _NET_WM_WINDOW_TYPE_DROPDOWN_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1866 | * See _NET_WM_WINDOW_TYPE_DROPDOWN_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1867 | */ | 1867 | **/ | ||
1868 | Q_PROPERTY(bool dropdownMenu READ isDropdownMenu) | 1868 | Q_PROPERTY(bool dropdownMenu READ isDropdownMenu) | ||
1869 | /** | 1869 | /** | ||
1870 | * Returns whether the window is a popup menu (that is not a torn-off or dropdown menu). | 1870 | * Returns whether the window is a popup menu (that is not a torn-off or dropdown menu). | ||
1871 | * See _NET_WM_WINDOW_TYPE_POPUP_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1871 | * See _NET_WM_WINDOW_TYPE_POPUP_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1872 | */ | 1872 | **/ | ||
1873 | Q_PROPERTY(bool popupMenu READ isPopupMenu) | 1873 | Q_PROPERTY(bool popupMenu READ isPopupMenu) | ||
1874 | /** | 1874 | /** | ||
1875 | * Returns whether the window is a tooltip. | 1875 | * Returns whether the window is a tooltip. | ||
1876 | * See _NET_WM_WINDOW_TYPE_TOOLTIP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1876 | * See _NET_WM_WINDOW_TYPE_TOOLTIP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1877 | */ | 1877 | **/ | ||
1878 | Q_PROPERTY(bool tooltip READ isTooltip) | 1878 | Q_PROPERTY(bool tooltip READ isTooltip) | ||
1879 | /** | 1879 | /** | ||
1880 | * Returns whether the window is a window with a notification. | 1880 | * Returns whether the window is a window with a notification. | ||
1881 | * See _NET_WM_WINDOW_TYPE_NOTIFICATION at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1881 | * See _NET_WM_WINDOW_TYPE_NOTIFICATION at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1882 | */ | 1882 | **/ | ||
1883 | Q_PROPERTY(bool notification READ isNotification) | 1883 | Q_PROPERTY(bool notification READ isNotification) | ||
1884 | /** | 1884 | /** | ||
1885 | * Returns whether the window is an on screen display window | 1885 | * Returns whether the window is an on screen display window | ||
1886 | * using the non-standard _KDE_NET_WM_WINDOW_TYPE_ON_SCREEN_DISPLAY | 1886 | * using the non-standard _KDE_NET_WM_WINDOW_TYPE_ON_SCREEN_DISPLAY | ||
1887 | */ | 1887 | **/ | ||
1888 | Q_PROPERTY(bool onScreenDisplay READ isOnScreenDisplay) | 1888 | Q_PROPERTY(bool onScreenDisplay READ isOnScreenDisplay) | ||
1889 | /** | 1889 | /** | ||
1890 | * Returns whether the window is a combobox popup. | 1890 | * Returns whether the window is a combobox popup. | ||
1891 | * See _NET_WM_WINDOW_TYPE_COMBO at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1891 | * See _NET_WM_WINDOW_TYPE_COMBO at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1892 | */ | 1892 | **/ | ||
1893 | Q_PROPERTY(bool comboBox READ isComboBox) | 1893 | Q_PROPERTY(bool comboBox READ isComboBox) | ||
1894 | /** | 1894 | /** | ||
1895 | * Returns whether the window is a Drag&Drop icon. | 1895 | * Returns whether the window is a Drag&Drop icon. | ||
1896 | * See _NET_WM_WINDOW_TYPE_DND at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1896 | * See _NET_WM_WINDOW_TYPE_DND at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1897 | */ | 1897 | **/ | ||
1898 | Q_PROPERTY(bool dndIcon READ isDNDIcon) | 1898 | Q_PROPERTY(bool dndIcon READ isDNDIcon) | ||
1899 | /** | 1899 | /** | ||
1900 | * Returns the NETWM window type | 1900 | * Returns the NETWM window type | ||
1901 | * See http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 1901 | * See http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
1902 | */ | 1902 | **/ | ||
1903 | Q_PROPERTY(int windowType READ windowType) | 1903 | Q_PROPERTY(int windowType READ windowType) | ||
1904 | /** | 1904 | /** | ||
1905 | * Whether this EffectWindow is managed by KWin (it has control over its placement and other | 1905 | * Whether this EffectWindow is managed by KWin (it has control over its placement and other | ||
1906 | * aspects, as opposed to override-redirect windows that are entirely handled by the application). | 1906 | * aspects, as opposed to override-redirect windows that are entirely handled by the application). | ||
1907 | **/ | 1907 | **/ | ||
1908 | Q_PROPERTY(bool managed READ isManaged) | 1908 | Q_PROPERTY(bool managed READ isManaged) | ||
1909 | /** | 1909 | /** | ||
1910 | * Whether this EffectWindow represents an already deleted window and only kept for the compositor for animations. | 1910 | * Whether this EffectWindow represents an already deleted window and only kept for the compositor for animations. | ||
Show All 36 Lines | |||||
1947 | /** | 1947 | /** | ||
1948 | * Whether the window can be moved to another screen. | 1948 | * Whether the window can be moved to another screen. | ||
1949 | * @see moveable | 1949 | * @see moveable | ||
1950 | **/ | 1950 | **/ | ||
1951 | Q_PROPERTY(bool moveableAcrossScreens READ isMovableAcrossScreens) | 1951 | Q_PROPERTY(bool moveableAcrossScreens READ isMovableAcrossScreens) | ||
1952 | /** | 1952 | /** | ||
1953 | * By how much the window wishes to grow/shrink at least. Usually QSize(1,1). | 1953 | * By how much the window wishes to grow/shrink at least. Usually QSize(1,1). | ||
1954 | * MAY BE DISOBEYED BY THE WM! It's only for information, do NOT rely on it at all. | 1954 | * MAY BE DISOBEYED BY THE WM! It's only for information, do NOT rely on it at all. | ||
1955 | */ | 1955 | **/ | ||
1956 | Q_PROPERTY(QSize basicUnit READ basicUnit) | 1956 | Q_PROPERTY(QSize basicUnit READ basicUnit) | ||
1957 | /** | 1957 | /** | ||
1958 | * Whether the window is currently being moved by the user. | 1958 | * Whether the window is currently being moved by the user. | ||
1959 | **/ | 1959 | **/ | ||
1960 | Q_PROPERTY(bool move READ isUserMove) | 1960 | Q_PROPERTY(bool move READ isUserMove) | ||
1961 | /** | 1961 | /** | ||
1962 | * Whether the window is currently being resized by the user. | 1962 | * Whether the window is currently being resized by the user. | ||
1963 | **/ | 1963 | **/ | ||
Show All 11 Lines | |||||
1975 | Q_PROPERTY(bool specialWindow READ isSpecialWindow) | 1975 | Q_PROPERTY(bool specialWindow READ isSpecialWindow) | ||
1976 | Q_PROPERTY(QIcon icon READ icon) | 1976 | Q_PROPERTY(QIcon icon READ icon) | ||
1977 | /** | 1977 | /** | ||
1978 | * Whether the window should be excluded from window switching effects. | 1978 | * Whether the window should be excluded from window switching effects. | ||
1979 | **/ | 1979 | **/ | ||
1980 | Q_PROPERTY(bool skipSwitcher READ isSkipSwitcher) | 1980 | Q_PROPERTY(bool skipSwitcher READ isSkipSwitcher) | ||
1981 | /** | 1981 | /** | ||
1982 | * Geometry of the actual window contents inside the whole (including decorations) window. | 1982 | * Geometry of the actual window contents inside the whole (including decorations) window. | ||
1983 | */ | 1983 | **/ | ||
1984 | Q_PROPERTY(QRect contentsRect READ contentsRect) | 1984 | Q_PROPERTY(QRect contentsRect READ contentsRect) | ||
1985 | /** | 1985 | /** | ||
1986 | * Geometry of the transparent rect in the decoration. | 1986 | * Geometry of the transparent rect in the decoration. | ||
1987 | * May be different from contentsRect if the decoration is extended into the client area. | 1987 | * May be different from contentsRect if the decoration is extended into the client area. | ||
1988 | */ | 1988 | **/ | ||
1989 | Q_PROPERTY(QRect decorationInnerRect READ decorationInnerRect) | 1989 | Q_PROPERTY(QRect decorationInnerRect READ decorationInnerRect) | ||
1990 | Q_PROPERTY(bool hasDecoration READ hasDecoration) | 1990 | Q_PROPERTY(bool hasDecoration READ hasDecoration) | ||
1991 | Q_PROPERTY(QStringList activities READ activities) | 1991 | Q_PROPERTY(QStringList activities READ activities) | ||
1992 | Q_PROPERTY(bool onCurrentActivity READ isOnCurrentActivity) | 1992 | Q_PROPERTY(bool onCurrentActivity READ isOnCurrentActivity) | ||
1993 | Q_PROPERTY(bool onAllActivities READ isOnAllActivities) | 1993 | Q_PROPERTY(bool onAllActivities READ isOnAllActivities) | ||
1994 | /** | 1994 | /** | ||
1995 | * Whether the decoration currently uses an alpha channel. | 1995 | * Whether the decoration currently uses an alpha channel. | ||
1996 | * @since 4.10 | 1996 | * @since 4.10 | ||
Show All 15 Lines | |||||
2012 | * The window will not be visible, but the animation hooks are executed. | 2012 | * The window will not be visible, but the animation hooks are executed. | ||
2013 | * @since 5.0 | 2013 | * @since 5.0 | ||
2014 | **/ | 2014 | **/ | ||
2015 | Q_PROPERTY(bool skipsCloseAnimation READ skipsCloseAnimation) | 2015 | Q_PROPERTY(bool skipsCloseAnimation READ skipsCloseAnimation) | ||
2016 | 2016 | | |||
2017 | /** | 2017 | /** | ||
2018 | * Interface to the corresponding wayland surface. | 2018 | * Interface to the corresponding wayland surface. | ||
2019 | * relevant only in Wayland, on X11 it will be nullptr | 2019 | * relevant only in Wayland, on X11 it will be nullptr | ||
2020 | */ | 2020 | **/ | ||
2021 | Q_PROPERTY(KWayland::Server::SurfaceInterface *surface READ surface) | 2021 | Q_PROPERTY(KWayland::Server::SurfaceInterface *surface READ surface) | ||
2022 | 2022 | | |||
2023 | /** | 2023 | /** | ||
2024 | * Whether the window is fullscreen. | 2024 | * Whether the window is fullscreen. | ||
2025 | * @since 5.6 | 2025 | * @since 5.6 | ||
2026 | **/ | 2026 | **/ | ||
2027 | Q_PROPERTY(bool fullScreen READ isFullScreen) | 2027 | Q_PROPERTY(bool fullScreen READ isFullScreen) | ||
2028 | 2028 | | |||
2029 | /** | 2029 | /** | ||
2030 | * Whether this client is unresponsive. | 2030 | * Whether this client is unresponsive. | ||
2031 | * | 2031 | * | ||
2032 | * When an application failed to react on a ping request in time, it is | 2032 | * When an application failed to react on a ping request in time, it is | ||
2033 | * considered unresponsive. This usually indicates that the application froze or crashed. | 2033 | * considered unresponsive. This usually indicates that the application froze or crashed. | ||
2034 | * | 2034 | * | ||
2035 | * @since 5.10 | 2035 | * @since 5.10 | ||
2036 | */ | 2036 | **/ | ||
2037 | Q_PROPERTY(bool unresponsive READ isUnresponsive) | 2037 | Q_PROPERTY(bool unresponsive READ isUnresponsive) | ||
2038 | 2038 | | |||
2039 | /** | 2039 | /** | ||
2040 | * Whether this is a Wayland client. | 2040 | * Whether this is a Wayland client. | ||
2041 | * @since 5.15 | 2041 | * @since 5.15 | ||
2042 | **/ | 2042 | **/ | ||
2043 | Q_PROPERTY(bool waylandClient READ isWaylandClient CONSTANT) | 2043 | Q_PROPERTY(bool waylandClient READ isWaylandClient CONSTANT) | ||
2044 | 2044 | | |||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 2069 | public: | |||
2114 | bool isOnAllDesktops() const; | 2114 | bool isOnAllDesktops() const; | ||
2115 | /** | 2115 | /** | ||
2116 | * The desktop this window is in. This mkaes sense only on X11 | 2116 | * The desktop this window is in. This mkaes sense only on X11 | ||
2117 | * where desktops are mutually exclusive, on Wayland it's the last | 2117 | * where desktops are mutually exclusive, on Wayland it's the last | ||
2118 | * desktop the window has been added to. | 2118 | * desktop the window has been added to. | ||
2119 | * use desktops() instead. | 2119 | * use desktops() instead. | ||
2120 | * @see desktops() | 2120 | * @see desktops() | ||
2121 | * @deprecated | 2121 | * @deprecated | ||
2122 | */ | 2122 | **/ | ||
2123 | #ifndef KWIN_NO_DEPRECATED | 2123 | #ifndef KWIN_NO_DEPRECATED | ||
2124 | virtual int KWIN_DEPRECATED desktop() const = 0; // prefer isOnXXX() | 2124 | virtual int KWIN_DEPRECATED desktop() const = 0; // prefer isOnXXX() | ||
2125 | #endif | 2125 | #endif | ||
2126 | /** | 2126 | /** | ||
2127 | * All the desktops by number that the window is in. On X11 this list will always have | 2127 | * All the desktops by number that the window is in. On X11 this list will always have | ||
2128 | * a length of 1, on Wayland can be any subset. | 2128 | * a length of 1, on Wayland can be any subset. | ||
2129 | * If the list is empty it means the window is on all desktops | 2129 | * If the list is empty it means the window is on all desktops | ||
2130 | */ | 2130 | **/ | ||
2131 | virtual QVector<uint> desktops() const = 0; | 2131 | virtual QVector<uint> desktops() const = 0; | ||
2132 | 2132 | | |||
2133 | virtual int x() const = 0; | 2133 | virtual int x() const = 0; | ||
2134 | virtual int y() const = 0; | 2134 | virtual int y() const = 0; | ||
2135 | virtual int width() const = 0; | 2135 | virtual int width() const = 0; | ||
2136 | virtual int height() const = 0; | 2136 | virtual int height() const = 0; | ||
2137 | /** | 2137 | /** | ||
2138 | * By how much the window wishes to grow/shrink at least. Usually QSize(1,1). | 2138 | * By how much the window wishes to grow/shrink at least. Usually QSize(1,1). | ||
2139 | * MAY BE DISOBEYED BY THE WM! It's only for information, do NOT rely on it at all. | 2139 | * MAY BE DISOBEYED BY THE WM! It's only for information, do NOT rely on it at all. | ||
2140 | */ | 2140 | **/ | ||
2141 | virtual QSize basicUnit() const = 0; | 2141 | virtual QSize basicUnit() const = 0; | ||
2142 | virtual QRect geometry() const = 0; | 2142 | virtual QRect geometry() const = 0; | ||
2143 | /** | 2143 | /** | ||
2144 | * Geometry of the window including decoration and potentially shadows. | 2144 | * Geometry of the window including decoration and potentially shadows. | ||
2145 | * May be different from geometry() if the window has a shadow. | 2145 | * May be different from geometry() if the window has a shadow. | ||
2146 | * @since 4.9 | 2146 | * @since 4.9 | ||
2147 | */ | 2147 | **/ | ||
2148 | virtual QRect expandedGeometry() const = 0; | 2148 | virtual QRect expandedGeometry() const = 0; | ||
2149 | virtual QRegion shape() const = 0; | 2149 | virtual QRegion shape() const = 0; | ||
2150 | virtual int screen() const = 0; | 2150 | virtual int screen() const = 0; | ||
2151 | /** @internal Do not use */ | 2151 | /** @internal Do not use */ | ||
2152 | virtual bool hasOwnShape() const = 0; // only for shadow effect, for now | 2152 | virtual bool hasOwnShape() const = 0; // only for shadow effect, for now | ||
2153 | virtual QPoint pos() const = 0; | 2153 | virtual QPoint pos() const = 0; | ||
2154 | virtual QSize size() const = 0; | 2154 | virtual QSize size() const = 0; | ||
2155 | virtual QRect rect() const = 0; | 2155 | virtual QRect rect() const = 0; | ||
2156 | virtual bool isMovable() const = 0; | 2156 | virtual bool isMovable() const = 0; | ||
2157 | virtual bool isMovableAcrossScreens() const = 0; | 2157 | virtual bool isMovableAcrossScreens() const = 0; | ||
2158 | virtual bool isUserMove() const = 0; | 2158 | virtual bool isUserMove() const = 0; | ||
2159 | virtual bool isUserResize() const = 0; | 2159 | virtual bool isUserResize() const = 0; | ||
2160 | virtual QRect iconGeometry() const = 0; | 2160 | virtual QRect iconGeometry() const = 0; | ||
2161 | 2161 | | |||
2162 | /** | 2162 | /** | ||
2163 | * Geometry of the actual window contents inside the whole (including decorations) window. | 2163 | * Geometry of the actual window contents inside the whole (including decorations) window. | ||
2164 | */ | 2164 | **/ | ||
2165 | virtual QRect contentsRect() const = 0; | 2165 | virtual QRect contentsRect() const = 0; | ||
2166 | /** | 2166 | /** | ||
2167 | * Geometry of the transparent rect in the decoration. | 2167 | * Geometry of the transparent rect in the decoration. | ||
2168 | * May be different from contentsRect() if the decoration is extended into the client area. | 2168 | * May be different from contentsRect() if the decoration is extended into the client area. | ||
2169 | * @since 4.5 | 2169 | * @since 4.5 | ||
2170 | */ | 2170 | **/ | ||
2171 | virtual QRect decorationInnerRect() const = 0; | 2171 | virtual QRect decorationInnerRect() const = 0; | ||
2172 | bool hasDecoration() const; | 2172 | bool hasDecoration() const; | ||
2173 | virtual bool decorationHasAlpha() const = 0; | 2173 | virtual bool decorationHasAlpha() const = 0; | ||
2174 | virtual QByteArray readProperty(long atom, long type, int format) const = 0; | 2174 | virtual QByteArray readProperty(long atom, long type, int format) const = 0; | ||
2175 | virtual void deleteProperty(long atom) const = 0; | 2175 | virtual void deleteProperty(long atom) const = 0; | ||
2176 | 2176 | | |||
2177 | virtual QString caption() const = 0; | 2177 | virtual QString caption() const = 0; | ||
2178 | virtual QIcon icon() const = 0; | 2178 | virtual QIcon icon() const = 0; | ||
2179 | virtual QString windowClass() const = 0; | 2179 | virtual QString windowClass() const = 0; | ||
2180 | virtual QString windowRole() const = 0; | 2180 | virtual QString windowRole() const = 0; | ||
2181 | virtual const EffectWindowGroup* group() const = 0; | 2181 | virtual const EffectWindowGroup* group() const = 0; | ||
2182 | 2182 | | |||
2183 | /** | 2183 | /** | ||
2184 | * Returns whether the window is a desktop background window (the one with wallpaper). | 2184 | * Returns whether the window is a desktop background window (the one with wallpaper). | ||
2185 | * See _NET_WM_WINDOW_TYPE_DESKTOP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2185 | * See _NET_WM_WINDOW_TYPE_DESKTOP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2186 | */ | 2186 | **/ | ||
2187 | virtual bool isDesktop() const = 0; | 2187 | virtual bool isDesktop() const = 0; | ||
2188 | /** | 2188 | /** | ||
2189 | * Returns whether the window is a dock (i.e. a panel). | 2189 | * Returns whether the window is a dock (i.e. a panel). | ||
2190 | * See _NET_WM_WINDOW_TYPE_DOCK at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2190 | * See _NET_WM_WINDOW_TYPE_DOCK at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2191 | */ | 2191 | **/ | ||
2192 | virtual bool isDock() const = 0; | 2192 | virtual bool isDock() const = 0; | ||
2193 | /** | 2193 | /** | ||
2194 | * Returns whether the window is a standalone (detached) toolbar window. | 2194 | * Returns whether the window is a standalone (detached) toolbar window. | ||
2195 | * See _NET_WM_WINDOW_TYPE_TOOLBAR at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2195 | * See _NET_WM_WINDOW_TYPE_TOOLBAR at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2196 | */ | 2196 | **/ | ||
2197 | virtual bool isToolbar() const = 0; | 2197 | virtual bool isToolbar() const = 0; | ||
2198 | /** | 2198 | /** | ||
2199 | * Returns whether the window is a torn-off menu. | 2199 | * Returns whether the window is a torn-off menu. | ||
2200 | * See _NET_WM_WINDOW_TYPE_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2200 | * See _NET_WM_WINDOW_TYPE_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2201 | */ | 2201 | **/ | ||
2202 | virtual bool isMenu() const = 0; | 2202 | virtual bool isMenu() const = 0; | ||
2203 | /** | 2203 | /** | ||
2204 | * Returns whether the window is a "normal" window, i.e. an application or any other window | 2204 | * Returns whether the window is a "normal" window, i.e. an application or any other window | ||
2205 | * for which none of the specialized window types fit. | 2205 | * for which none of the specialized window types fit. | ||
2206 | * See _NET_WM_WINDOW_TYPE_NORMAL at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2206 | * See _NET_WM_WINDOW_TYPE_NORMAL at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2207 | */ | 2207 | **/ | ||
2208 | virtual bool isNormalWindow() const = 0; // normal as in 'NET::Normal or NET::Unknown non-transient' | 2208 | virtual bool isNormalWindow() const = 0; // normal as in 'NET::Normal or NET::Unknown non-transient' | ||
2209 | /** | 2209 | /** | ||
2210 | * Returns whether the window is any of special windows types (desktop, dock, splash, ...), | 2210 | * Returns whether the window is any of special windows types (desktop, dock, splash, ...), | ||
2211 | * i.e. window types that usually don't have a window frame and the user does not use window | 2211 | * i.e. window types that usually don't have a window frame and the user does not use window | ||
2212 | * management (moving, raising,...) on them. | 2212 | * management (moving, raising,...) on them. | ||
2213 | */ | 2213 | **/ | ||
2214 | virtual bool isSpecialWindow() const = 0; | 2214 | virtual bool isSpecialWindow() const = 0; | ||
2215 | /** | 2215 | /** | ||
2216 | * Returns whether the window is a dialog window. | 2216 | * Returns whether the window is a dialog window. | ||
2217 | * See _NET_WM_WINDOW_TYPE_DIALOG at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2217 | * See _NET_WM_WINDOW_TYPE_DIALOG at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2218 | */ | 2218 | **/ | ||
2219 | virtual bool isDialog() const = 0; | 2219 | virtual bool isDialog() const = 0; | ||
2220 | /** | 2220 | /** | ||
2221 | * Returns whether the window is a splashscreen. Note that many (especially older) applications | 2221 | * Returns whether the window is a splashscreen. Note that many (especially older) applications | ||
2222 | * do not support marking their splash windows with this type. | 2222 | * do not support marking their splash windows with this type. | ||
2223 | * See _NET_WM_WINDOW_TYPE_SPLASH at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2223 | * See _NET_WM_WINDOW_TYPE_SPLASH at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2224 | */ | 2224 | **/ | ||
2225 | virtual bool isSplash() const = 0; | 2225 | virtual bool isSplash() const = 0; | ||
2226 | /** | 2226 | /** | ||
2227 | * Returns whether the window is a utility window, such as a tool window. | 2227 | * Returns whether the window is a utility window, such as a tool window. | ||
2228 | * See _NET_WM_WINDOW_TYPE_UTILITY at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2228 | * See _NET_WM_WINDOW_TYPE_UTILITY at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2229 | */ | 2229 | **/ | ||
2230 | virtual bool isUtility() const = 0; | 2230 | virtual bool isUtility() const = 0; | ||
2231 | /** | 2231 | /** | ||
2232 | * Returns whether the window is a dropdown menu (i.e. a popup directly or indirectly open | 2232 | * Returns whether the window is a dropdown menu (i.e. a popup directly or indirectly open | ||
2233 | * from the applications menubar). | 2233 | * from the applications menubar). | ||
2234 | * See _NET_WM_WINDOW_TYPE_DROPDOWN_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2234 | * See _NET_WM_WINDOW_TYPE_DROPDOWN_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2235 | */ | 2235 | **/ | ||
2236 | virtual bool isDropdownMenu() const = 0; | 2236 | virtual bool isDropdownMenu() const = 0; | ||
2237 | /** | 2237 | /** | ||
2238 | * Returns whether the window is a popup menu (that is not a torn-off or dropdown menu). | 2238 | * Returns whether the window is a popup menu (that is not a torn-off or dropdown menu). | ||
2239 | * See _NET_WM_WINDOW_TYPE_POPUP_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2239 | * See _NET_WM_WINDOW_TYPE_POPUP_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2240 | */ | 2240 | **/ | ||
2241 | virtual bool isPopupMenu() const = 0; // a context popup, not dropdown, not torn-off | 2241 | virtual bool isPopupMenu() const = 0; // a context popup, not dropdown, not torn-off | ||
2242 | /** | 2242 | /** | ||
2243 | * Returns whether the window is a tooltip. | 2243 | * Returns whether the window is a tooltip. | ||
2244 | * See _NET_WM_WINDOW_TYPE_TOOLTIP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2244 | * See _NET_WM_WINDOW_TYPE_TOOLTIP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2245 | */ | 2245 | **/ | ||
2246 | virtual bool isTooltip() const = 0; | 2246 | virtual bool isTooltip() const = 0; | ||
2247 | /** | 2247 | /** | ||
2248 | * Returns whether the window is a window with a notification. | 2248 | * Returns whether the window is a window with a notification. | ||
2249 | * See _NET_WM_WINDOW_TYPE_NOTIFICATION at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2249 | * See _NET_WM_WINDOW_TYPE_NOTIFICATION at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2250 | */ | 2250 | **/ | ||
2251 | virtual bool isNotification() const = 0; | 2251 | virtual bool isNotification() const = 0; | ||
2252 | /** | 2252 | /** | ||
2253 | * Returns whether the window is an on screen display window | 2253 | * Returns whether the window is an on screen display window | ||
2254 | * using the non-standard _KDE_NET_WM_WINDOW_TYPE_ON_SCREEN_DISPLAY | 2254 | * using the non-standard _KDE_NET_WM_WINDOW_TYPE_ON_SCREEN_DISPLAY | ||
2255 | */ | 2255 | **/ | ||
2256 | virtual bool isOnScreenDisplay() const = 0; | 2256 | virtual bool isOnScreenDisplay() const = 0; | ||
2257 | /** | 2257 | /** | ||
2258 | * Returns whether the window is a combobox popup. | 2258 | * Returns whether the window is a combobox popup. | ||
2259 | * See _NET_WM_WINDOW_TYPE_COMBO at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2259 | * See _NET_WM_WINDOW_TYPE_COMBO at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2260 | */ | 2260 | **/ | ||
2261 | virtual bool isComboBox() const = 0; | 2261 | virtual bool isComboBox() const = 0; | ||
2262 | /** | 2262 | /** | ||
2263 | * Returns whether the window is a Drag&Drop icon. | 2263 | * Returns whether the window is a Drag&Drop icon. | ||
2264 | * See _NET_WM_WINDOW_TYPE_DND at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2264 | * See _NET_WM_WINDOW_TYPE_DND at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2265 | */ | 2265 | **/ | ||
2266 | virtual bool isDNDIcon() const = 0; | 2266 | virtual bool isDNDIcon() const = 0; | ||
2267 | /** | 2267 | /** | ||
2268 | * Returns the NETWM window type | 2268 | * Returns the NETWM window type | ||
2269 | * See http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | 2269 | * See http://standards.freedesktop.org/wm-spec/wm-spec-latest.html . | ||
2270 | */ | 2270 | **/ | ||
2271 | virtual NET::WindowType windowType() const = 0; | 2271 | virtual NET::WindowType windowType() const = 0; | ||
2272 | /** | 2272 | /** | ||
2273 | * Returns whether the window is managed by KWin (it has control over its placement and other | 2273 | * Returns whether the window is managed by KWin (it has control over its placement and other | ||
2274 | * aspects, as opposed to override-redirect windows that are entirely handled by the application). | 2274 | * aspects, as opposed to override-redirect windows that are entirely handled by the application). | ||
2275 | */ | 2275 | **/ | ||
2276 | virtual bool isManaged() const = 0; // whether it's managed or override-redirect | 2276 | virtual bool isManaged() const = 0; // whether it's managed or override-redirect | ||
2277 | /** | 2277 | /** | ||
2278 | * Returns whether or not the window can accept keyboard focus. | 2278 | * Returns whether or not the window can accept keyboard focus. | ||
2279 | */ | 2279 | **/ | ||
2280 | virtual bool acceptsFocus() const = 0; | 2280 | virtual bool acceptsFocus() const = 0; | ||
2281 | /** | 2281 | /** | ||
2282 | * Returns whether or not the window is kept above all other windows. | 2282 | * Returns whether or not the window is kept above all other windows. | ||
2283 | */ | 2283 | **/ | ||
2284 | virtual bool keepAbove() const = 0; | 2284 | virtual bool keepAbove() const = 0; | ||
2285 | /** | 2285 | /** | ||
2286 | * Returns whether the window is kept below all other windows. | 2286 | * Returns whether the window is kept below all other windows. | ||
2287 | */ | 2287 | **/ | ||
2288 | virtual bool keepBelow() const = 0; | 2288 | virtual bool keepBelow() const = 0; | ||
2289 | 2289 | | |||
2290 | virtual bool isModal() const = 0; | 2290 | virtual bool isModal() const = 0; | ||
2291 | Q_SCRIPTABLE virtual KWin::EffectWindow* findModal() = 0; | 2291 | Q_SCRIPTABLE virtual KWin::EffectWindow* findModal() = 0; | ||
2292 | Q_SCRIPTABLE virtual QList<KWin::EffectWindow*> mainWindows() const = 0; | 2292 | Q_SCRIPTABLE virtual QList<KWin::EffectWindow*> mainWindows() const = 0; | ||
2293 | 2293 | | |||
2294 | /** | 2294 | /** | ||
2295 | * Returns whether the window should be excluded from window switching effects. | 2295 | * Returns whether the window should be excluded from window switching effects. | ||
2296 | * @since 4.5 | 2296 | * @since 4.5 | ||
2297 | */ | 2297 | **/ | ||
2298 | virtual bool isSkipSwitcher() const = 0; | 2298 | virtual bool isSkipSwitcher() const = 0; | ||
2299 | 2299 | | |||
2300 | /** | 2300 | /** | ||
2301 | * Returns the unmodified window quad list. Can also be used to force rebuilding. | 2301 | * Returns the unmodified window quad list. Can also be used to force rebuilding. | ||
2302 | */ | 2302 | **/ | ||
2303 | virtual WindowQuadList buildQuads(bool force = false) const = 0; | 2303 | virtual WindowQuadList buildQuads(bool force = false) const = 0; | ||
2304 | 2304 | | |||
2305 | void setMinimized(bool minimize); | 2305 | void setMinimized(bool minimize); | ||
2306 | virtual void minimize() = 0; | 2306 | virtual void minimize() = 0; | ||
2307 | virtual void unminimize() = 0; | 2307 | virtual void unminimize() = 0; | ||
2308 | Q_SCRIPTABLE virtual void closeWindow() = 0; | 2308 | Q_SCRIPTABLE virtual void closeWindow() = 0; | ||
2309 | 2309 | | |||
2310 | virtual bool isCurrentTab() const = 0; | 2310 | virtual bool isCurrentTab() const = 0; | ||
2311 | 2311 | | |||
2312 | /** | 2312 | /** | ||
2313 | * @since 4.11 | 2313 | * @since 4.11 | ||
2314 | **/ | 2314 | **/ | ||
2315 | bool isVisible() const; | 2315 | bool isVisible() const; | ||
2316 | 2316 | | |||
2317 | /** | 2317 | /** | ||
2318 | * @since 5.0 | 2318 | * @since 5.0 | ||
2319 | **/ | 2319 | **/ | ||
2320 | virtual bool skipsCloseAnimation() const = 0; | 2320 | virtual bool skipsCloseAnimation() const = 0; | ||
2321 | 2321 | | |||
2322 | /** | 2322 | /** | ||
2323 | * @since 5.5 | 2323 | * @since 5.5 | ||
2324 | */ | 2324 | **/ | ||
2325 | virtual KWayland::Server::SurfaceInterface *surface() const = 0; | 2325 | virtual KWayland::Server::SurfaceInterface *surface() const = 0; | ||
2326 | 2326 | | |||
2327 | /** | 2327 | /** | ||
2328 | * @since 5.6 | 2328 | * @since 5.6 | ||
2329 | **/ | 2329 | **/ | ||
2330 | virtual bool isFullScreen() const = 0; | 2330 | virtual bool isFullScreen() const = 0; | ||
2331 | 2331 | | |||
2332 | /** | 2332 | /** | ||
2333 | * @since 5.10 | 2333 | * @since 5.10 | ||
2334 | */ | 2334 | **/ | ||
2335 | virtual bool isUnresponsive() const = 0; | 2335 | virtual bool isUnresponsive() const = 0; | ||
2336 | 2336 | | |||
2337 | /** | 2337 | /** | ||
2338 | * @since 5.15 | 2338 | * @since 5.15 | ||
2339 | **/ | 2339 | **/ | ||
2340 | virtual bool isWaylandClient() const = 0; | 2340 | virtual bool isWaylandClient() const = 0; | ||
2341 | 2341 | | |||
2342 | /** | 2342 | /** | ||
Show All 11 Lines | |||||
2354 | **/ | 2354 | **/ | ||
2355 | virtual QWindow *internalWindow() const = 0; | 2355 | virtual QWindow *internalWindow() const = 0; | ||
2356 | 2356 | | |||
2357 | /** | 2357 | /** | ||
2358 | * Can be used to by effects to store arbitrary data in the EffectWindow. | 2358 | * Can be used to by effects to store arbitrary data in the EffectWindow. | ||
2359 | * | 2359 | * | ||
2360 | * Invoking this method will emit the signal EffectsHandler::windowDataChanged. | 2360 | * Invoking this method will emit the signal EffectsHandler::windowDataChanged. | ||
2361 | * @see EffectsHandler::windowDataChanged | 2361 | * @see EffectsHandler::windowDataChanged | ||
2362 | */ | 2362 | **/ | ||
2363 | Q_SCRIPTABLE virtual void setData(int role, const QVariant &data) = 0; | 2363 | Q_SCRIPTABLE virtual void setData(int role, const QVariant &data) = 0; | ||
2364 | Q_SCRIPTABLE virtual QVariant data(int role) const = 0; | 2364 | Q_SCRIPTABLE virtual QVariant data(int role) const = 0; | ||
2365 | 2365 | | |||
2366 | /** | 2366 | /** | ||
2367 | * @brief References the previous window pixmap to prevent discarding. | 2367 | * @brief References the previous window pixmap to prevent discarding. | ||
2368 | * | 2368 | * | ||
2369 | * This method allows to reference the previous window pixmap in case that a window changed | 2369 | * This method allows to reference the previous window pixmap in case that a window changed | ||
2370 | * its size, which requires a new window pixmap. By referencing the previous (and then outdated) | 2370 | * its size, which requires a new window pixmap. By referencing the previous (and then outdated) | ||
2371 | * window pixmap an effect can for example cross fade the current window pixmap with the previous | 2371 | * window pixmap an effect can for example cross fade the current window pixmap with the previous | ||
2372 | * one. This allows for smoother transitions for window geometry changes. | 2372 | * one. This allows for smoother transitions for window geometry changes. | ||
2373 | * | 2373 | * | ||
2374 | * If an effect calls this method on a window it also needs to call unreferencePreviousWindowPixmap | 2374 | * If an effect calls this method on a window it also needs to call unreferencePreviousWindowPixmap | ||
2375 | * once it does no longer need the previous window pixmap. | 2375 | * once it does no longer need the previous window pixmap. | ||
2376 | * | 2376 | * | ||
2377 | * Note: the window pixmap is not kept forever even when referenced. If the geometry changes again, so that | 2377 | * Note: the window pixmap is not kept forever even when referenced. If the geometry changes again, so that | ||
2378 | * a new window pixmap is created, the previous window pixmap will be exchanged with the current one. This | 2378 | * a new window pixmap is created, the previous window pixmap will be exchanged with the current one. This | ||
2379 | * means it's still possible to have rendering glitches. An effect is supposed to track for itself the changes | 2379 | * means it's still possible to have rendering glitches. An effect is supposed to track for itself the changes | ||
2380 | * to the window's geometry and decide how the transition should continue in such a situation. | 2380 | * to the window's geometry and decide how the transition should continue in such a situation. | ||
2381 | * | 2381 | * | ||
2382 | * @see unreferencePreviousWindowPixmap | 2382 | * @see unreferencePreviousWindowPixmap | ||
2383 | * @since 4.11 | 2383 | * @since 4.11 | ||
2384 | */ | 2384 | **/ | ||
2385 | virtual void referencePreviousWindowPixmap() = 0; | 2385 | virtual void referencePreviousWindowPixmap() = 0; | ||
2386 | /** | 2386 | /** | ||
2387 | * @brief Unreferences the previous window pixmap. Only relevant after referencePreviousWindowPixmap had | 2387 | * @brief Unreferences the previous window pixmap. Only relevant after referencePreviousWindowPixmap had | ||
2388 | * been called. | 2388 | * been called. | ||
2389 | * | 2389 | * | ||
2390 | * @see referencePreviousWindowPixmap | 2390 | * @see referencePreviousWindowPixmap | ||
2391 | * @since 4.11 | 2391 | * @since 4.11 | ||
2392 | */ | 2392 | **/ | ||
2393 | virtual void unreferencePreviousWindowPixmap() = 0; | 2393 | virtual void unreferencePreviousWindowPixmap() = 0; | ||
2394 | 2394 | | |||
2395 | private: | 2395 | private: | ||
2396 | class Private; | 2396 | class Private; | ||
2397 | QScopedPointer<Private> d; | 2397 | QScopedPointer<Private> d; | ||
2398 | }; | 2398 | }; | ||
2399 | 2399 | | |||
2400 | class KWINEFFECTS_EXPORT EffectWindowGroup | 2400 | class KWINEFFECTS_EXPORT EffectWindowGroup | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 2446 | private: | |||
2450 | double ox, oy; // origional position | 2450 | double ox, oy; // origional position | ||
2451 | double tx, ty; // texture coords | 2451 | double tx, ty; // texture coords | ||
2452 | }; | 2452 | }; | ||
2453 | 2453 | | |||
2454 | /** | 2454 | /** | ||
2455 | * @short Class representing one area of a window. | 2455 | * @short Class representing one area of a window. | ||
2456 | * | 2456 | * | ||
2457 | * WindowQuads consists of four WindowVertex objects and represents one part of a window. | 2457 | * WindowQuads consists of four WindowVertex objects and represents one part of a window. | ||
2458 | */ | 2458 | **/ | ||
2459 | // NOTE: This class expects the (original) vertices to be in the clockwise order starting from topleft. | 2459 | // NOTE: This class expects the (original) vertices to be in the clockwise order starting from topleft. | ||
2460 | class KWINEFFECTS_EXPORT WindowQuad | 2460 | class KWINEFFECTS_EXPORT WindowQuad | ||
2461 | { | 2461 | { | ||
2462 | public: | 2462 | public: | ||
2463 | explicit WindowQuad(WindowQuadType type, int id = -1); | 2463 | explicit WindowQuad(WindowQuadType type, int id = -1); | ||
2464 | WindowQuad makeSubQuad(double x1, double y1, double x2, double y2) const; | 2464 | WindowQuad makeSubQuad(double x1, double y1, double x2, double y2) const; | ||
2465 | WindowVertex& operator[](int index); | 2465 | WindowVertex& operator[](int index); | ||
2466 | const WindowVertex& operator[](int index) const; | 2466 | const WindowVertex& operator[](int index) const; | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 2509 | public: | |||
2516 | * The clip region will be subtracted from paint region of following windows. | 2516 | * The clip region will be subtracted from paint region of following windows. | ||
2517 | * I.e. window will definitely cover it's clip region | 2517 | * I.e. window will definitely cover it's clip region | ||
2518 | **/ | 2518 | **/ | ||
2519 | QRegion clip; | 2519 | QRegion clip; | ||
2520 | WindowQuadList quads; | 2520 | WindowQuadList quads; | ||
2521 | /** | 2521 | /** | ||
2522 | * Simple helper that sets data to say the window will be painted as non-opaque. | 2522 | * Simple helper that sets data to say the window will be painted as non-opaque. | ||
2523 | * Takes also care of changing the regions. | 2523 | * Takes also care of changing the regions. | ||
2524 | */ | 2524 | **/ | ||
2525 | void setTranslucent(); | 2525 | void setTranslucent(); | ||
2526 | /** | 2526 | /** | ||
2527 | * Helper to mark that this window will be transformed | 2527 | * Helper to mark that this window will be transformed | ||
2528 | **/ | 2528 | **/ | ||
2529 | void setTransformed(); | 2529 | void setTransformed(); | ||
2530 | }; | 2530 | }; | ||
2531 | 2531 | | |||
2532 | class KWINEFFECTS_EXPORT PaintData | 2532 | class KWINEFFECTS_EXPORT PaintData | ||
▲ Show 20 Lines • Show All 204 Lines • ▼ Show 20 Line(s) | 2695 | public: | |||
2737 | * Overloaded method for convenience. | 2737 | * Overloaded method for convenience. | ||
2738 | * @since 4.10 | 2738 | * @since 4.10 | ||
2739 | **/ | 2739 | **/ | ||
2740 | WindowPaintData& operator+=(const QVector3D &translation); | 2740 | WindowPaintData& operator+=(const QVector3D &translation); | ||
2741 | /** | 2741 | /** | ||
2742 | * Window opacity, in range 0 = transparent to 1 = fully opaque | 2742 | * Window opacity, in range 0 = transparent to 1 = fully opaque | ||
2743 | * @see setOpacity | 2743 | * @see setOpacity | ||
2744 | * @since 4.10 | 2744 | * @since 4.10 | ||
2745 | */ | 2745 | **/ | ||
2746 | qreal opacity() const; | 2746 | qreal opacity() const; | ||
2747 | /** | 2747 | /** | ||
2748 | * Sets the window opacity to the new @p opacity. | 2748 | * Sets the window opacity to the new @p opacity. | ||
2749 | * If you want to modify the existing opacity level consider using multiplyOpacity. | 2749 | * If you want to modify the existing opacity level consider using multiplyOpacity. | ||
2750 | * @param opacity The new opacity level | 2750 | * @param opacity The new opacity level | ||
2751 | * @since 4.10 | 2751 | * @since 4.10 | ||
2752 | **/ | 2752 | **/ | ||
2753 | void setOpacity(qreal opacity); | 2753 | void setOpacity(qreal opacity); | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | |||||
2803 | * @since 4.10 | 2803 | * @since 4.10 | ||
2804 | **/ | 2804 | **/ | ||
2805 | qreal multiplyBrightness(qreal factor); | 2805 | qreal multiplyBrightness(qreal factor); | ||
2806 | /** | 2806 | /** | ||
2807 | * The screen number for which the painting should be done. | 2807 | * The screen number for which the painting should be done. | ||
2808 | * This affects color correction (different screens may need different | 2808 | * This affects color correction (different screens may need different | ||
2809 | * color correction lookup tables because they have different ICC profiles). | 2809 | * color correction lookup tables because they have different ICC profiles). | ||
2810 | * @return screen for which painting should be done | 2810 | * @return screen for which painting should be done | ||
2811 | */ | 2811 | **/ | ||
2812 | int screen() const; | 2812 | int screen() const; | ||
2813 | /** | 2813 | /** | ||
2814 | * @param screen New screen number | 2814 | * @param screen New screen number | ||
2815 | * A value less than 0 will indicate that a default profile should be done. | 2815 | * A value less than 0 will indicate that a default profile should be done. | ||
2816 | */ | 2816 | **/ | ||
2817 | void setScreen(int screen) const; | 2817 | void setScreen(int screen) const; | ||
2818 | /** | 2818 | /** | ||
2819 | * @brief Sets the cross fading @p factor to fade over with previously sized window. | 2819 | * @brief Sets the cross fading @p factor to fade over with previously sized window. | ||
2820 | * If @c 1.0 only the current window is used, if @c 0.0 only the previous window is used. | 2820 | * If @c 1.0 only the current window is used, if @c 0.0 only the previous window is used. | ||
2821 | * | 2821 | * | ||
2822 | * By default only the current window is used. This factor can only make any visual difference | 2822 | * By default only the current window is used. This factor can only make any visual difference | ||
2823 | * if the previous window get referenced. | 2823 | * if the previous window get referenced. | ||
2824 | * | 2824 | * | ||
2825 | * @param factor The cross fade factor between @c 0.0 (previous window) and @c 1.0 (current window) | 2825 | * @param factor The cross fade factor between @c 0.0 (previous window) and @c 1.0 (current window) | ||
2826 | * @see crossFadeProgress | 2826 | * @see crossFadeProgress | ||
2827 | */ | 2827 | **/ | ||
2828 | void setCrossFadeProgress(qreal factor); | 2828 | void setCrossFadeProgress(qreal factor); | ||
2829 | /** | 2829 | /** | ||
2830 | * @see setCrossFadeProgress | 2830 | * @see setCrossFadeProgress | ||
2831 | */ | 2831 | **/ | ||
2832 | qreal crossFadeProgress() const; | 2832 | qreal crossFadeProgress() const; | ||
2833 | 2833 | | |||
2834 | /** | 2834 | /** | ||
2835 | * Sets the projection matrix that will be used when painting the window. | 2835 | * Sets the projection matrix that will be used when painting the window. | ||
2836 | * | 2836 | * | ||
2837 | * The default projection matrix can be overridden by setting this matrix | 2837 | * The default projection matrix can be overridden by setting this matrix | ||
2838 | * to a non-identity matrix. | 2838 | * to a non-identity matrix. | ||
2839 | */ | 2839 | **/ | ||
2840 | void setProjectionMatrix(const QMatrix4x4 &matrix); | 2840 | void setProjectionMatrix(const QMatrix4x4 &matrix); | ||
2841 | 2841 | | |||
2842 | /** | 2842 | /** | ||
2843 | * Returns the current projection matrix. | 2843 | * Returns the current projection matrix. | ||
2844 | * | 2844 | * | ||
2845 | * The default value for this matrix is the identity matrix. | 2845 | * The default value for this matrix is the identity matrix. | ||
2846 | */ | 2846 | **/ | ||
2847 | QMatrix4x4 projectionMatrix() const; | 2847 | QMatrix4x4 projectionMatrix() const; | ||
2848 | 2848 | | |||
2849 | /** | 2849 | /** | ||
2850 | * Returns a reference to the projection matrix. | 2850 | * Returns a reference to the projection matrix. | ||
2851 | */ | 2851 | **/ | ||
2852 | QMatrix4x4 &rprojectionMatrix(); | 2852 | QMatrix4x4 &rprojectionMatrix(); | ||
2853 | 2853 | | |||
2854 | /** | 2854 | /** | ||
2855 | * Sets the model-view matrix that will be used when painting the window. | 2855 | * Sets the model-view matrix that will be used when painting the window. | ||
2856 | * | 2856 | * | ||
2857 | * The default model-view matrix can be overridden by setting this matrix | 2857 | * The default model-view matrix can be overridden by setting this matrix | ||
2858 | * to a non-identity matrix. | 2858 | * to a non-identity matrix. | ||
2859 | */ | 2859 | **/ | ||
2860 | void setModelViewMatrix(const QMatrix4x4 &matrix); | 2860 | void setModelViewMatrix(const QMatrix4x4 &matrix); | ||
2861 | 2861 | | |||
2862 | /** | 2862 | /** | ||
2863 | * Returns the current model-view matrix. | 2863 | * Returns the current model-view matrix. | ||
2864 | * | 2864 | * | ||
2865 | * The default value for this matrix is the identity matrix. | 2865 | * The default value for this matrix is the identity matrix. | ||
2866 | */ | 2866 | **/ | ||
2867 | QMatrix4x4 modelViewMatrix() const; | 2867 | QMatrix4x4 modelViewMatrix() const; | ||
2868 | 2868 | | |||
2869 | /** | 2869 | /** | ||
2870 | * Returns a reference to the model-view matrix. | 2870 | * Returns a reference to the model-view matrix. | ||
2871 | */ | 2871 | **/ | ||
2872 | QMatrix4x4 &rmodelViewMatrix(); | 2872 | QMatrix4x4 &rmodelViewMatrix(); | ||
2873 | 2873 | | |||
2874 | /** | 2874 | /** | ||
2875 | * Returns The projection matrix as used by the current screen painting pass | 2875 | * Returns The projection matrix as used by the current screen painting pass | ||
2876 | * including screen transformations. | 2876 | * including screen transformations. | ||
2877 | * | 2877 | * | ||
2878 | * @since 5.6 | 2878 | * @since 5.6 | ||
2879 | **/ | 2879 | **/ | ||
2880 | QMatrix4x4 screenProjectionMatrix() const; | 2880 | QMatrix4x4 screenProjectionMatrix() const; | ||
2881 | 2881 | | |||
2882 | WindowQuadList quads; | 2882 | WindowQuadList quads; | ||
2883 | 2883 | | |||
2884 | /** | 2884 | /** | ||
2885 | * Shader to be used for rendering, if any. | 2885 | * Shader to be used for rendering, if any. | ||
2886 | */ | 2886 | **/ | ||
2887 | GLShader* shader; | 2887 | GLShader* shader; | ||
2888 | 2888 | | |||
2889 | private: | 2889 | private: | ||
2890 | WindowPaintDataPrivate * const d; | 2890 | WindowPaintDataPrivate * const d; | ||
2891 | }; | 2891 | }; | ||
2892 | 2892 | | |||
2893 | class KWINEFFECTS_EXPORT ScreenPaintData : public PaintData | 2893 | class KWINEFFECTS_EXPORT ScreenPaintData : public PaintData | ||
2894 | { | 2894 | { | ||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | |||||
2971 | /** | 2971 | /** | ||
2972 | * @short Helper class for restricting painting area only to allowed area. | 2972 | * @short Helper class for restricting painting area only to allowed area. | ||
2973 | * | 2973 | * | ||
2974 | * This helper class helps specifying areas that should be painted, clipping | 2974 | * This helper class helps specifying areas that should be painted, clipping | ||
2975 | * out the rest. The simplest usage is creating an object on the stack | 2975 | * out the rest. The simplest usage is creating an object on the stack | ||
2976 | * and giving it the area that is allowed to be painted to. When the object | 2976 | * and giving it the area that is allowed to be painted to. When the object | ||
2977 | * is destroyed, the restriction will be removed. | 2977 | * is destroyed, the restriction will be removed. | ||
2978 | * Note that all painting code must use paintArea() to actually perform the clipping. | 2978 | * Note that all painting code must use paintArea() to actually perform the clipping. | ||
2979 | */ | 2979 | **/ | ||
2980 | class KWINEFFECTS_EXPORT PaintClipper | 2980 | class KWINEFFECTS_EXPORT PaintClipper | ||
2981 | { | 2981 | { | ||
2982 | public: | 2982 | public: | ||
2983 | /** | 2983 | /** | ||
2984 | * Calls push(). | 2984 | * Calls push(). | ||
2985 | */ | 2985 | **/ | ||
2986 | explicit PaintClipper(const QRegion& allowed_area); | 2986 | explicit PaintClipper(const QRegion& allowed_area); | ||
2987 | /** | 2987 | /** | ||
2988 | * Calls pop(). | 2988 | * Calls pop(). | ||
2989 | */ | 2989 | **/ | ||
2990 | ~PaintClipper(); | 2990 | ~PaintClipper(); | ||
2991 | /** | 2991 | /** | ||
2992 | * Allows painting only in the given area. When areas have been already | 2992 | * Allows painting only in the given area. When areas have been already | ||
2993 | * specified, painting is allowed only in the intersection of all areas. | 2993 | * specified, painting is allowed only in the intersection of all areas. | ||
2994 | */ | 2994 | **/ | ||
2995 | static void push(const QRegion& allowed_area); | 2995 | static void push(const QRegion& allowed_area); | ||
2996 | /** | 2996 | /** | ||
2997 | * Removes the given area. It must match the top item in the stack. | 2997 | * Removes the given area. It must match the top item in the stack. | ||
2998 | */ | 2998 | **/ | ||
2999 | static void pop(const QRegion& allowed_area); | 2999 | static void pop(const QRegion& allowed_area); | ||
3000 | /** | 3000 | /** | ||
3001 | * Returns true if any clipping should be performed. | 3001 | * Returns true if any clipping should be performed. | ||
3002 | */ | 3002 | **/ | ||
3003 | static bool clip(); | 3003 | static bool clip(); | ||
3004 | /** | 3004 | /** | ||
3005 | * If clip() returns true, this function gives the resulting area in which | 3005 | * If clip() returns true, this function gives the resulting area in which | ||
3006 | * painting is allowed. It is usually simpler to use the helper Iterator class. | 3006 | * painting is allowed. It is usually simpler to use the helper Iterator class. | ||
3007 | */ | 3007 | **/ | ||
3008 | static QRegion paintArea(); | 3008 | static QRegion paintArea(); | ||
3009 | /** | 3009 | /** | ||
3010 | * Helper class to perform the clipped painting. The usage is: | 3010 | * Helper class to perform the clipped painting. The usage is: | ||
3011 | * @code | 3011 | * @code | ||
3012 | * for ( PaintClipper::Iterator iterator; | 3012 | * for ( PaintClipper::Iterator iterator; | ||
3013 | * !iterator.isDone(); | 3013 | * !iterator.isDone(); | ||
3014 | * iterator.next()) | 3014 | * iterator.next()) | ||
3015 | * { // do the painting, possibly use iterator.boundingRect() | 3015 | * { // do the painting, possibly use iterator.boundingRect() | ||
3016 | * } | 3016 | * } | ||
3017 | * @endcode | 3017 | * @endcode | ||
3018 | */ | 3018 | **/ | ||
3019 | class KWINEFFECTS_EXPORT Iterator | 3019 | class KWINEFFECTS_EXPORT Iterator | ||
3020 | { | 3020 | { | ||
3021 | public: | 3021 | public: | ||
3022 | Iterator(); | 3022 | Iterator(); | ||
3023 | ~Iterator(); | 3023 | ~Iterator(); | ||
3024 | bool isDone(); | 3024 | bool isDone(); | ||
3025 | void next(); | 3025 | void next(); | ||
3026 | QRect boundingRect() const; | 3026 | QRect boundingRect() const; | ||
3027 | private: | 3027 | private: | ||
3028 | struct Data; | 3028 | struct Data; | ||
3029 | Data* data; | 3029 | Data* data; | ||
3030 | }; | 3030 | }; | ||
3031 | private: | 3031 | private: | ||
3032 | QRegion area; | 3032 | QRegion area; | ||
3033 | static QStack< QRegion >* areas; | 3033 | static QStack< QRegion >* areas; | ||
3034 | }; | 3034 | }; | ||
3035 | 3035 | | |||
3036 | /** | 3036 | /** | ||
3037 | * @internal | 3037 | * @internal | ||
3038 | */ | 3038 | **/ | ||
3039 | template <typename T> | 3039 | template <typename T> | ||
3040 | class KWINEFFECTS_EXPORT Motion | 3040 | class KWINEFFECTS_EXPORT Motion | ||
3041 | { | 3041 | { | ||
3042 | public: | 3042 | public: | ||
3043 | /** | 3043 | /** | ||
3044 | * Creates a new motion object. "Strength" is the amount of | 3044 | * Creates a new motion object. "Strength" is the amount of | ||
3045 | * acceleration that is applied to the object when the target | 3045 | * acceleration that is applied to the object when the target | ||
3046 | * changes and "smoothness" relates to how fast the object | 3046 | * changes and "smoothness" relates to how fast the object | ||
3047 | * can change its direction and speed. | 3047 | * can change its direction and speed. | ||
3048 | */ | 3048 | **/ | ||
3049 | explicit Motion(T initial, double strength, double smoothness); | 3049 | explicit Motion(T initial, double strength, double smoothness); | ||
3050 | /** | 3050 | /** | ||
3051 | * Creates an exact copy of another motion object, including | 3051 | * Creates an exact copy of another motion object, including | ||
3052 | * position, target and velocity. | 3052 | * position, target and velocity. | ||
3053 | */ | 3053 | **/ | ||
3054 | Motion(const Motion<T> &other); | 3054 | Motion(const Motion<T> &other); | ||
3055 | ~Motion(); | 3055 | ~Motion(); | ||
3056 | 3056 | | |||
3057 | inline T value() const { | 3057 | inline T value() const { | ||
3058 | return m_value; | 3058 | return m_value; | ||
3059 | } | 3059 | } | ||
3060 | inline void setValue(const T value) { | 3060 | inline void setValue(const T value) { | ||
3061 | m_value = value; | 3061 | m_value = value; | ||
Show All 25 Lines | 3086 | inline void setSmoothness(const double smoothness) { | |||
3087 | m_smoothness = smoothness; | 3087 | m_smoothness = smoothness; | ||
3088 | } | 3088 | } | ||
3089 | inline T startValue() { | 3089 | inline T startValue() { | ||
3090 | return m_start; | 3090 | return m_start; | ||
3091 | } | 3091 | } | ||
3092 | 3092 | | |||
3093 | /** | 3093 | /** | ||
3094 | * The distance between the current position and the target. | 3094 | * The distance between the current position and the target. | ||
3095 | */ | 3095 | **/ | ||
3096 | inline T distance() const { | 3096 | inline T distance() const { | ||
3097 | return m_target - m_value; | 3097 | return m_target - m_value; | ||
3098 | } | 3098 | } | ||
3099 | 3099 | | |||
3100 | /** | 3100 | /** | ||
3101 | * Calculates the new position if not at the target. Called | 3101 | * Calculates the new position if not at the target. Called | ||
3102 | * once per frame only. | 3102 | * once per frame only. | ||
3103 | */ | 3103 | **/ | ||
3104 | void calculate(const int msec); | 3104 | void calculate(const int msec); | ||
3105 | /** | 3105 | /** | ||
3106 | * Place the object on top of the target immediately, | 3106 | * Place the object on top of the target immediately, | ||
3107 | * bypassing all movement calculation. | 3107 | * bypassing all movement calculation. | ||
3108 | */ | 3108 | **/ | ||
3109 | void finish(); | 3109 | void finish(); | ||
3110 | 3110 | | |||
3111 | private: | 3111 | private: | ||
3112 | T m_value; | 3112 | T m_value; | ||
3113 | T m_start; | 3113 | T m_start; | ||
3114 | T m_target; | 3114 | T m_target; | ||
3115 | T m_velocity; | 3115 | T m_velocity; | ||
3116 | double m_strength; | 3116 | double m_strength; | ||
3117 | double m_smoothness; | 3117 | double m_smoothness; | ||
3118 | }; | 3118 | }; | ||
3119 | 3119 | | |||
3120 | /** | 3120 | /** | ||
3121 | * @short A single 1D motion dynamics object. | 3121 | * @short A single 1D motion dynamics object. | ||
3122 | * | 3122 | * | ||
3123 | * This class represents a single object that can be moved around a | 3123 | * This class represents a single object that can be moved around a | ||
3124 | * 1D space. Although it can be used directly by itself it is | 3124 | * 1D space. Although it can be used directly by itself it is | ||
3125 | * recommended to use a motion manager instead. | 3125 | * recommended to use a motion manager instead. | ||
3126 | */ | 3126 | **/ | ||
3127 | class KWINEFFECTS_EXPORT Motion1D : public Motion<double> | 3127 | class KWINEFFECTS_EXPORT Motion1D : public Motion<double> | ||
3128 | { | 3128 | { | ||
3129 | public: | 3129 | public: | ||
3130 | explicit Motion1D(double initial = 0.0, double strength = 0.08, double smoothness = 4.0); | 3130 | explicit Motion1D(double initial = 0.0, double strength = 0.08, double smoothness = 4.0); | ||
3131 | Motion1D(const Motion1D &other); | 3131 | Motion1D(const Motion1D &other); | ||
3132 | ~Motion1D(); | 3132 | ~Motion1D(); | ||
3133 | }; | 3133 | }; | ||
3134 | 3134 | | |||
3135 | /** | 3135 | /** | ||
3136 | * @short A single 2D motion dynamics object. | 3136 | * @short A single 2D motion dynamics object. | ||
3137 | * | 3137 | * | ||
3138 | * This class represents a single object that can be moved around a | 3138 | * This class represents a single object that can be moved around a | ||
3139 | * 2D space. Although it can be used directly by itself it is | 3139 | * 2D space. Although it can be used directly by itself it is | ||
3140 | * recommended to use a motion manager instead. | 3140 | * recommended to use a motion manager instead. | ||
3141 | */ | 3141 | **/ | ||
3142 | class KWINEFFECTS_EXPORT Motion2D : public Motion<QPointF> | 3142 | class KWINEFFECTS_EXPORT Motion2D : public Motion<QPointF> | ||
3143 | { | 3143 | { | ||
3144 | public: | 3144 | public: | ||
3145 | explicit Motion2D(QPointF initial = QPointF(), double strength = 0.08, double smoothness = 4.0); | 3145 | explicit Motion2D(QPointF initial = QPointF(), double strength = 0.08, double smoothness = 4.0); | ||
3146 | Motion2D(const Motion2D &other); | 3146 | Motion2D(const Motion2D &other); | ||
3147 | ~Motion2D(); | 3147 | ~Motion2D(); | ||
3148 | }; | 3148 | }; | ||
3149 | 3149 | | |||
3150 | /** | 3150 | /** | ||
3151 | * @short Helper class for motion dynamics in KWin effects. | 3151 | * @short Helper class for motion dynamics in KWin effects. | ||
3152 | * | 3152 | * | ||
3153 | * This motion manager class is intended to help KWin effect authors | 3153 | * This motion manager class is intended to help KWin effect authors | ||
3154 | * move windows across the screen smoothly and naturally. Once | 3154 | * move windows across the screen smoothly and naturally. Once | ||
3155 | * windows are registered by the manager the effect can issue move | 3155 | * windows are registered by the manager the effect can issue move | ||
3156 | * commands with the moveWindow() methods. The position of any | 3156 | * commands with the moveWindow() methods. The position of any | ||
3157 | * managed window can be determined in realtime by the | 3157 | * managed window can be determined in realtime by the | ||
3158 | * transformedGeometry() method. As the manager knows if any windows | 3158 | * transformedGeometry() method. As the manager knows if any windows | ||
3159 | * are moving at any given time it can also be used as a notifier as | 3159 | * are moving at any given time it can also be used as a notifier as | ||
3160 | * to see whether the effect is active or not. | 3160 | * to see whether the effect is active or not. | ||
3161 | */ | 3161 | **/ | ||
3162 | class KWINEFFECTS_EXPORT WindowMotionManager | 3162 | class KWINEFFECTS_EXPORT WindowMotionManager | ||
3163 | { | 3163 | { | ||
3164 | public: | 3164 | public: | ||
3165 | /** | 3165 | /** | ||
3166 | * Creates a new window manager object. | 3166 | * Creates a new window manager object. | ||
3167 | */ | 3167 | **/ | ||
3168 | explicit WindowMotionManager(bool useGlobalAnimationModifier = true); | 3168 | explicit WindowMotionManager(bool useGlobalAnimationModifier = true); | ||
3169 | ~WindowMotionManager(); | 3169 | ~WindowMotionManager(); | ||
3170 | 3170 | | |||
3171 | /** | 3171 | /** | ||
3172 | * Register a window for managing. | 3172 | * Register a window for managing. | ||
3173 | */ | 3173 | **/ | ||
3174 | void manage(EffectWindow *w); | 3174 | void manage(EffectWindow *w); | ||
3175 | /** | 3175 | /** | ||
3176 | * Register a list of windows for managing. | 3176 | * Register a list of windows for managing. | ||
3177 | */ | 3177 | **/ | ||
3178 | inline void manage(EffectWindowList list) { | 3178 | inline void manage(EffectWindowList list) { | ||
3179 | for (int i = 0; i < list.size(); i++) | 3179 | for (int i = 0; i < list.size(); i++) | ||
3180 | manage(list.at(i)); | 3180 | manage(list.at(i)); | ||
3181 | } | 3181 | } | ||
3182 | /** | 3182 | /** | ||
3183 | * Deregister a window. All transformations applied to the | 3183 | * Deregister a window. All transformations applied to the | ||
3184 | * window will be permanently removed and cannot be recovered. | 3184 | * window will be permanently removed and cannot be recovered. | ||
3185 | */ | 3185 | **/ | ||
3186 | void unmanage(EffectWindow *w); | 3186 | void unmanage(EffectWindow *w); | ||
3187 | /** | 3187 | /** | ||
3188 | * Deregister all windows, returning the manager to its | 3188 | * Deregister all windows, returning the manager to its | ||
3189 | * originally initiated state. | 3189 | * originally initiated state. | ||
3190 | */ | 3190 | **/ | ||
3191 | void unmanageAll(); | 3191 | void unmanageAll(); | ||
3192 | /** | 3192 | /** | ||
3193 | * Determine the new positions for windows that have not | 3193 | * Determine the new positions for windows that have not | ||
3194 | * reached their target. Called once per frame, usually in | 3194 | * reached their target. Called once per frame, usually in | ||
3195 | * prePaintScreen(). Remember to set the | 3195 | * prePaintScreen(). Remember to set the | ||
3196 | * Effect::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS flag. | 3196 | * Effect::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS flag. | ||
3197 | */ | 3197 | **/ | ||
3198 | void calculate(int time); | 3198 | void calculate(int time); | ||
3199 | /** | 3199 | /** | ||
3200 | * Modify a registered window's paint data to make it appear | 3200 | * Modify a registered window's paint data to make it appear | ||
3201 | * at its real location on the screen. Usually called in | 3201 | * at its real location on the screen. Usually called in | ||
3202 | * paintWindow(). Remember to flag the window as having been | 3202 | * paintWindow(). Remember to flag the window as having been | ||
3203 | * transformed in prePaintWindow() by calling | 3203 | * transformed in prePaintWindow() by calling | ||
3204 | * WindowPrePaintData::setTransformed() | 3204 | * WindowPrePaintData::setTransformed() | ||
3205 | */ | 3205 | **/ | ||
3206 | void apply(EffectWindow *w, WindowPaintData &data); | 3206 | void apply(EffectWindow *w, WindowPaintData &data); | ||
3207 | /** | 3207 | /** | ||
3208 | * Set all motion targets and values back to where the | 3208 | * Set all motion targets and values back to where the | ||
3209 | * windows were before transformations. The same as | 3209 | * windows were before transformations. The same as | ||
3210 | * unmanaging then remanaging all windows. | 3210 | * unmanaging then remanaging all windows. | ||
3211 | */ | 3211 | **/ | ||
3212 | void reset(); | 3212 | void reset(); | ||
3213 | /** | 3213 | /** | ||
3214 | * Resets the motion target and current value of a single | 3214 | * Resets the motion target and current value of a single | ||
3215 | * window. | 3215 | * window. | ||
3216 | */ | 3216 | **/ | ||
3217 | void reset(EffectWindow *w); | 3217 | void reset(EffectWindow *w); | ||
3218 | 3218 | | |||
3219 | /** | 3219 | /** | ||
3220 | * Ask the manager to move the window to the target position | 3220 | * Ask the manager to move the window to the target position | ||
3221 | * with the specified scale. If `yScale` is not provided or | 3221 | * with the specified scale. If `yScale` is not provided or | ||
3222 | * set to 0.0, `scale` will be used as the scale in the | 3222 | * set to 0.0, `scale` will be used as the scale in the | ||
3223 | * vertical direction as well as in the horizontal direction. | 3223 | * vertical direction as well as in the horizontal direction. | ||
3224 | */ | 3224 | **/ | ||
3225 | void moveWindow(EffectWindow *w, QPoint target, double scale = 1.0, double yScale = 0.0); | 3225 | void moveWindow(EffectWindow *w, QPoint target, double scale = 1.0, double yScale = 0.0); | ||
3226 | /** | 3226 | /** | ||
3227 | * This is an overloaded method, provided for convenience. | 3227 | * This is an overloaded method, provided for convenience. | ||
3228 | * | 3228 | * | ||
3229 | * Ask the manager to move the window to the target rectangle. | 3229 | * Ask the manager to move the window to the target rectangle. | ||
3230 | * Automatically determines scale. | 3230 | * Automatically determines scale. | ||
3231 | */ | 3231 | **/ | ||
3232 | inline void moveWindow(EffectWindow *w, QRect target) { | 3232 | inline void moveWindow(EffectWindow *w, QRect target) { | ||
3233 | // TODO: Scale might be slightly different in the comparison due to rounding | 3233 | // TODO: Scale might be slightly different in the comparison due to rounding | ||
3234 | moveWindow(w, target.topLeft(), | 3234 | moveWindow(w, target.topLeft(), | ||
3235 | target.width() / double(w->width()), target.height() / double(w->height())); | 3235 | target.width() / double(w->width()), target.height() / double(w->height())); | ||
3236 | } | 3236 | } | ||
3237 | 3237 | | |||
3238 | /** | 3238 | /** | ||
3239 | * Retrieve the current tranformed geometry of a registered | 3239 | * Retrieve the current tranformed geometry of a registered | ||
3240 | * window. | 3240 | * window. | ||
3241 | */ | 3241 | **/ | ||
3242 | QRectF transformedGeometry(EffectWindow *w) const; | 3242 | QRectF transformedGeometry(EffectWindow *w) const; | ||
3243 | /** | 3243 | /** | ||
3244 | * Sets the current transformed geometry of a registered window to the given geometry. | 3244 | * Sets the current transformed geometry of a registered window to the given geometry. | ||
3245 | * @see transformedGeometry | 3245 | * @see transformedGeometry | ||
3246 | * @since 4.5 | 3246 | * @since 4.5 | ||
3247 | */ | 3247 | **/ | ||
3248 | void setTransformedGeometry(EffectWindow *w, const QRectF &geometry); | 3248 | void setTransformedGeometry(EffectWindow *w, const QRectF &geometry); | ||
3249 | /** | 3249 | /** | ||
3250 | * Retrieve the current target geometry of a registered | 3250 | * Retrieve the current target geometry of a registered | ||
3251 | * window. | 3251 | * window. | ||
3252 | */ | 3252 | **/ | ||
3253 | QRectF targetGeometry(EffectWindow *w) const; | 3253 | QRectF targetGeometry(EffectWindow *w) const; | ||
3254 | /** | 3254 | /** | ||
3255 | * Return the window that has its transformed geometry under | 3255 | * Return the window that has its transformed geometry under | ||
3256 | * the specified point. It is recommended to use the stacking | 3256 | * the specified point. It is recommended to use the stacking | ||
3257 | * order as it's what the user sees, but it is slightly | 3257 | * order as it's what the user sees, but it is slightly | ||
3258 | * slower to process. | 3258 | * slower to process. | ||
3259 | */ | 3259 | **/ | ||
3260 | EffectWindow* windowAtPoint(QPoint point, bool useStackingOrder = true) const; | 3260 | EffectWindow* windowAtPoint(QPoint point, bool useStackingOrder = true) const; | ||
3261 | 3261 | | |||
3262 | /** | 3262 | /** | ||
3263 | * Return a list of all currently registered windows. | 3263 | * Return a list of all currently registered windows. | ||
3264 | */ | 3264 | **/ | ||
3265 | inline EffectWindowList managedWindows() const { | 3265 | inline EffectWindowList managedWindows() const { | ||
3266 | return m_managedWindows.keys(); | 3266 | return m_managedWindows.keys(); | ||
3267 | } | 3267 | } | ||
3268 | /** | 3268 | /** | ||
3269 | * Returns whether or not a specified window is being managed | 3269 | * Returns whether or not a specified window is being managed | ||
3270 | * by this manager object. | 3270 | * by this manager object. | ||
3271 | */ | 3271 | **/ | ||
3272 | inline bool isManaging(EffectWindow *w) const { | 3272 | inline bool isManaging(EffectWindow *w) const { | ||
3273 | return m_managedWindows.contains(w); | 3273 | return m_managedWindows.contains(w); | ||
3274 | } | 3274 | } | ||
3275 | /** | 3275 | /** | ||
3276 | * Returns whether or not this manager object is actually | 3276 | * Returns whether or not this manager object is actually | ||
3277 | * managing any windows or not. | 3277 | * managing any windows or not. | ||
3278 | */ | 3278 | **/ | ||
3279 | inline bool managingWindows() const { | 3279 | inline bool managingWindows() const { | ||
3280 | return !m_managedWindows.empty(); | 3280 | return !m_managedWindows.empty(); | ||
3281 | } | 3281 | } | ||
3282 | /** | 3282 | /** | ||
3283 | * Returns whether all windows have reached their targets yet | 3283 | * Returns whether all windows have reached their targets yet | ||
3284 | * or not. Can be used to see if an effect should be | 3284 | * or not. Can be used to see if an effect should be | ||
3285 | * processed and displayed or not. | 3285 | * processed and displayed or not. | ||
3286 | */ | 3286 | **/ | ||
3287 | inline bool areWindowsMoving() const { | 3287 | inline bool areWindowsMoving() const { | ||
3288 | return !m_movingWindowsSet.isEmpty(); | 3288 | return !m_movingWindowsSet.isEmpty(); | ||
3289 | } | 3289 | } | ||
3290 | /** | 3290 | /** | ||
3291 | * Returns whether a window has reached its targets yet | 3291 | * Returns whether a window has reached its targets yet | ||
3292 | * or not. | 3292 | * or not. | ||
3293 | */ | 3293 | **/ | ||
3294 | inline bool isWindowMoving(EffectWindow *w) const { | 3294 | inline bool isWindowMoving(EffectWindow *w) const { | ||
3295 | return m_movingWindowsSet.contains(w); | 3295 | return m_movingWindowsSet.contains(w); | ||
3296 | } | 3296 | } | ||
3297 | 3297 | | |||
3298 | private: | 3298 | private: | ||
3299 | bool m_useGlobalAnimationModifier; | 3299 | bool m_useGlobalAnimationModifier; | ||
3300 | struct WindowMotion { | 3300 | struct WindowMotion { | ||
3301 | // TODO: Rotation, etc? | 3301 | // TODO: Rotation, etc? | ||
3302 | Motion2D translation; // Absolute position | 3302 | Motion2D translation; // Absolute position | ||
3303 | Motion2D scale; // xScale and yScale | 3303 | Motion2D scale; // xScale and yScale | ||
3304 | }; | 3304 | }; | ||
3305 | QHash<EffectWindow*, WindowMotion> m_managedWindows; | 3305 | QHash<EffectWindow*, WindowMotion> m_managedWindows; | ||
3306 | QSet<EffectWindow*> m_movingWindowsSet; | 3306 | QSet<EffectWindow*> m_movingWindowsSet; | ||
3307 | }; | 3307 | }; | ||
3308 | 3308 | | |||
3309 | /** | 3309 | /** | ||
3310 | * @short Helper class for displaying text and icons in frames. | 3310 | * @short Helper class for displaying text and icons in frames. | ||
3311 | * | 3311 | * | ||
3312 | * Paints text and/or and icon with an optional frame around them. The | 3312 | * Paints text and/or and icon with an optional frame around them. The | ||
3313 | * available frames includes one that follows the default Plasma theme and | 3313 | * available frames includes one that follows the default Plasma theme and | ||
3314 | * another that doesn't. | 3314 | * another that doesn't. | ||
3315 | * It is recommended to use this class whenever displaying text. | 3315 | * It is recommended to use this class whenever displaying text. | ||
3316 | */ | 3316 | **/ | ||
3317 | class KWINEFFECTS_EXPORT EffectFrame | 3317 | class KWINEFFECTS_EXPORT EffectFrame | ||
3318 | { | 3318 | { | ||
3319 | public: | 3319 | public: | ||
3320 | EffectFrame(); | 3320 | EffectFrame(); | ||
3321 | virtual ~EffectFrame(); | 3321 | virtual ~EffectFrame(); | ||
3322 | 3322 | | |||
3323 | /** | 3323 | /** | ||
3324 | * Delete any existing textures to free up graphics memory. They will | 3324 | * Delete any existing textures to free up graphics memory. They will | ||
3325 | * be automatically recreated the next time they are required. | 3325 | * be automatically recreated the next time they are required. | ||
3326 | */ | 3326 | **/ | ||
3327 | virtual void free() = 0; | 3327 | virtual void free() = 0; | ||
3328 | 3328 | | |||
3329 | /** | 3329 | /** | ||
3330 | * Render the frame. | 3330 | * Render the frame. | ||
3331 | */ | 3331 | **/ | ||
3332 | virtual void render(QRegion region = infiniteRegion(), double opacity = 1.0, double frameOpacity = 1.0) = 0; | 3332 | virtual void render(QRegion region = infiniteRegion(), double opacity = 1.0, double frameOpacity = 1.0) = 0; | ||
3333 | 3333 | | |||
3334 | virtual void setPosition(const QPoint& point) = 0; | 3334 | virtual void setPosition(const QPoint& point) = 0; | ||
3335 | /** | 3335 | /** | ||
3336 | * Set the text alignment for static frames and the position alignment | 3336 | * Set the text alignment for static frames and the position alignment | ||
3337 | * for non-static. | 3337 | * for non-static. | ||
3338 | */ | 3338 | **/ | ||
3339 | virtual void setAlignment(Qt::Alignment alignment) = 0; | 3339 | virtual void setAlignment(Qt::Alignment alignment) = 0; | ||
3340 | virtual Qt::Alignment alignment() const = 0; | 3340 | virtual Qt::Alignment alignment() const = 0; | ||
3341 | virtual void setGeometry(const QRect& geometry, bool force = false) = 0; | 3341 | virtual void setGeometry(const QRect& geometry, bool force = false) = 0; | ||
3342 | virtual const QRect& geometry() const = 0; | 3342 | virtual const QRect& geometry() const = 0; | ||
3343 | 3343 | | |||
3344 | virtual void setText(const QString& text) = 0; | 3344 | virtual void setText(const QString& text) = 0; | ||
3345 | virtual const QString& text() const = 0; | 3345 | virtual const QString& text() const = 0; | ||
3346 | virtual void setFont(const QFont& font) = 0; | 3346 | virtual void setFont(const QFont& font) = 0; | ||
3347 | virtual const QFont& font() const = 0; | 3347 | virtual const QFont& font() const = 0; | ||
3348 | /** | 3348 | /** | ||
3349 | * Set the icon that will appear on the left-hand size of the frame. | 3349 | * Set the icon that will appear on the left-hand size of the frame. | ||
3350 | */ | 3350 | **/ | ||
3351 | virtual void setIcon(const QIcon& icon) = 0; | 3351 | virtual void setIcon(const QIcon& icon) = 0; | ||
3352 | virtual const QIcon& icon() const = 0; | 3352 | virtual const QIcon& icon() const = 0; | ||
3353 | virtual void setIconSize(const QSize& size) = 0; | 3353 | virtual void setIconSize(const QSize& size) = 0; | ||
3354 | virtual const QSize& iconSize() const = 0; | 3354 | virtual const QSize& iconSize() const = 0; | ||
3355 | 3355 | | |||
3356 | /** | 3356 | /** | ||
3357 | * Sets the geometry of a selection. | 3357 | * Sets the geometry of a selection. | ||
3358 | * To remove the selection set a null rect. | 3358 | * To remove the selection set a null rect. | ||
▲ Show 20 Lines • Show All 564 Lines • Show Last 20 Lines |