Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwineffects.cpp
Show First 20 Lines • Show All 797 Lines • ▼ Show 20 Line(s) | 796 | { | |||
---|---|---|---|---|---|
798 | return _activities.isEmpty() || _activities.contains(activity); | 798 | return _activities.isEmpty() || _activities.contains(activity); | ||
799 | } | 799 | } | ||
800 | 800 | | |||
801 | bool EffectWindow::isOnAllActivities() const | 801 | bool EffectWindow::isOnAllActivities() const | ||
802 | { | 802 | { | ||
803 | return activities().isEmpty(); | 803 | return activities().isEmpty(); | ||
804 | } | 804 | } | ||
805 | 805 | | |||
806 | #define WINDOW_HELPER_SETTER( prototype, propertyname, args, value ) \ | | |||
807 | void EffectWindow::prototype ( args ) \ | | |||
808 | {\ | | |||
809 | const QVariant variant = parent()->property( propertyname ); \ | | |||
810 | if (variant.isValid()) { \ | | |||
811 | parent()->setProperty( propertyname, value ); \ | | |||
812 | } \ | | |||
813 | } | | |||
814 | | ||||
815 | WINDOW_HELPER_SETTER(minimize, "minimized",,true) | | |||
816 | WINDOW_HELPER_SETTER(unminimize, "minimized",,false) | | |||
817 | | ||||
818 | #undef WINDOW_HELPER_SETTER | | |||
819 | | ||||
820 | void EffectWindow::setMinimized(bool min) | 806 | void EffectWindow::setMinimized(bool min) | ||
821 | { | 807 | { | ||
822 | if (min) { | 808 | if (min) { | ||
823 | minimize(); | 809 | minimize(); | ||
824 | } else { | 810 | } else { | ||
825 | unminimize(); | 811 | unminimize(); | ||
826 | } | 812 | } | ||
827 | } | 813 | } | ||
828 | 814 | | |||
829 | void EffectWindow::closeWindow() const | | |||
830 | { | | |||
831 | QMetaObject::invokeMethod(parent(), "closeWindow"); | | |||
832 | } | | |||
833 | | ||||
834 | void EffectWindow::addRepaint(int x, int y, int w, int h) | | |||
835 | { | | |||
836 | QMetaObject::invokeMethod(parent(), "addRepaint", Q_ARG(int, x), Q_ARG(int, y), Q_ARG(int, w), Q_ARG(int, h)); | | |||
837 | } | | |||
838 | | ||||
839 | void EffectWindow::addRepaint(const QRect &r) | | |||
840 | { | | |||
841 | QMetaObject::invokeMethod(parent(), "addRepaint", Q_ARG(const QRect&, r)); | | |||
842 | } | | |||
843 | | ||||
844 | void EffectWindow::addRepaintFull() | | |||
845 | { | | |||
846 | QMetaObject::invokeMethod(parent(), "addRepaintFull"); | | |||
847 | } | | |||
848 | | ||||
849 | void EffectWindow::addLayerRepaint(int x, int y, int w, int h) | | |||
850 | { | | |||
851 | QMetaObject::invokeMethod(parent(), "addLayerRepaint", Q_ARG(int, x), Q_ARG(int, y), Q_ARG(int, w), Q_ARG(int, h)); | | |||
852 | } | | |||
853 | | ||||
854 | void EffectWindow::addLayerRepaint(const QRect &r) | | |||
855 | { | | |||
856 | QMetaObject::invokeMethod(parent(), "addLayerRepaint", Q_ARG(const QRect&, r)); | | |||
857 | } | | |||
858 | | ||||
859 | bool EffectWindow::isOnCurrentActivity() const | 815 | bool EffectWindow::isOnCurrentActivity() const | ||
860 | { | 816 | { | ||
861 | return isOnActivity(effects->currentActivity()); | 817 | return isOnActivity(effects->currentActivity()); | ||
862 | } | 818 | } | ||
863 | 819 | | |||
864 | bool EffectWindow::isOnCurrentDesktop() const | 820 | bool EffectWindow::isOnCurrentDesktop() const | ||
865 | { | 821 | { | ||
866 | return isOnDesktop(effects->currentDesktop()); | 822 | return isOnDesktop(effects->currentDesktop()); | ||
▲ Show 20 Lines • Show All 1135 Lines • Show Last 20 Lines |