Effects can provide support information through properties
The supportInformation is extended to also read the properties on all effects. In addition each effect can be queried just for itself through D-Bus, e.g.: qdbus org.kde.kwin /KWin supportInformationForEffect kwin4_effect_blur All effects are extended to provide their configured and read settings through properties. In some cases also important runtime information is exposed. REVIEW: 105977 BUG: 305338 FIXED-IN: 4.9.1
This commit is contained in:
parent
83b9cb6697
commit
23f2de009b
35 changed files with 652 additions and 3 deletions
26
effects.cpp
26
effects.cpp
|
@ -1325,9 +1325,9 @@ void EffectsHandlerImpl::reconfigureEffect(const QString& name)
|
|||
}
|
||||
}
|
||||
|
||||
bool EffectsHandlerImpl::isEffectLoaded(const QString& name)
|
||||
bool EffectsHandlerImpl::isEffectLoaded(const QString& name) const
|
||||
{
|
||||
for (QVector< EffectPair >::iterator it = loaded_effects.begin(); it != loaded_effects.end(); ++it)
|
||||
for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it)
|
||||
if ((*it).first == name)
|
||||
return true;
|
||||
|
||||
|
@ -1396,6 +1396,28 @@ void EffectsHandlerImpl::slotHideOutline()
|
|||
emit hideOutline();
|
||||
}
|
||||
|
||||
QString EffectsHandlerImpl::supportInformation(const QString &name) const
|
||||
{
|
||||
if (!isEffectLoaded(name)) {
|
||||
return QString();
|
||||
}
|
||||
for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) {
|
||||
if ((*it).first == name) {
|
||||
QString support((*it).first + ":\n");
|
||||
const QMetaObject *metaOptions = (*it).second->metaObject();
|
||||
for (int i=0; i<metaOptions->propertyCount(); ++i) {
|
||||
const QMetaProperty property = metaOptions->property(i);
|
||||
if (QLatin1String(property.name()) == "objectName") {
|
||||
continue;
|
||||
}
|
||||
support.append(QLatin1String(property.name()) % ": " % (*it).second->property(property.name()).toString() % '\n');
|
||||
}
|
||||
return support;
|
||||
}
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
//****************************************
|
||||
// EffectWindowImpl
|
||||
//****************************************
|
||||
|
|
|
@ -167,7 +167,8 @@ public:
|
|||
void toggleEffect(const QString& name);
|
||||
void unloadEffect(const QString& name);
|
||||
void reconfigureEffect(const QString& name);
|
||||
bool isEffectLoaded(const QString& name);
|
||||
bool isEffectLoaded(const QString& name) const;
|
||||
QString supportInformation(const QString& name) const;
|
||||
QStringList loadedEffects() const;
|
||||
QStringList listOfEffects() const;
|
||||
|
||||
|
|
|
@ -672,5 +672,10 @@ void BlurEffect::doCachedBlur(EffectWindow *w, const QRegion& region, const floa
|
|||
shader->unbind();
|
||||
}
|
||||
|
||||
int BlurEffect::blurRadius() const
|
||||
{
|
||||
return shader->radius();
|
||||
}
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
|
|
|
@ -35,6 +35,8 @@ class BlurShader;
|
|||
class BlurEffect : public KWin::Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int blurRadius READ blurRadius)
|
||||
Q_PROPERTY(bool cacheTexture READ isCacheTexture)
|
||||
public:
|
||||
BlurEffect();
|
||||
~BlurEffect();
|
||||
|
@ -48,6 +50,12 @@ public:
|
|||
void drawWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data);
|
||||
void paintEffectFrame(EffectFrame *frame, QRegion region, double opacity, double frameOpacity);
|
||||
|
||||
// for dynamic setting extraction
|
||||
int blurRadius() const;
|
||||
bool isCacheTexture() const {
|
||||
return m_shouldCache;
|
||||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow *w);
|
||||
void slotWindowDeleted(KWin::EffectWindow *w);
|
||||
|
|
|
@ -38,6 +38,18 @@ class CoverSwitchEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int animationDuration READ configuredAnimationDuration)
|
||||
Q_PROPERTY(bool animateSwitch READ isAnimateSwitch)
|
||||
Q_PROPERTY(bool animateStart READ isAnimateStart)
|
||||
Q_PROPERTY(bool animateStop READ isAnimateStop)
|
||||
Q_PROPERTY(bool reflection READ isReflection)
|
||||
Q_PROPERTY(bool windowTitle READ isWindowTitle)
|
||||
Q_PROPERTY(qreal zPosition READ windowZPosition)
|
||||
Q_PROPERTY(bool dynamicThumbnails READ isDynamicThumbnails)
|
||||
Q_PROPERTY(int thumbnailWindows READ configurredThumbnailWindows)
|
||||
Q_PROPERTY(bool primaryTabBox READ isPrimaryTabBox)
|
||||
Q_PROPERTY(bool secondaryTabBox READ isSecondaryTabBox)
|
||||
// TODO: mirror colors
|
||||
public:
|
||||
CoverSwitchEffect();
|
||||
~CoverSwitchEffect();
|
||||
|
@ -52,6 +64,41 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int configuredAnimationDuration() const {
|
||||
return animationDuration;
|
||||
}
|
||||
bool isAnimateSwitch() const {
|
||||
return animateSwitch;
|
||||
}
|
||||
bool isAnimateStart() const {
|
||||
return animateStart;
|
||||
}
|
||||
bool isAnimateStop() const {
|
||||
return animateStop;
|
||||
}
|
||||
bool isReflection() const {
|
||||
return reflection;
|
||||
}
|
||||
bool isWindowTitle() const {
|
||||
return windowTitle;
|
||||
}
|
||||
qreal windowZPosition() const {
|
||||
return zPosition;
|
||||
}
|
||||
bool isDynamicThumbnails() const {
|
||||
return dynamicThumbnails;
|
||||
}
|
||||
int configurredThumbnailWindows() const {
|
||||
return thumbnailWindows;
|
||||
}
|
||||
bool isPrimaryTabBox() const {
|
||||
return primaryTabBox;
|
||||
}
|
||||
bool isSecondaryTabBox() const {
|
||||
return secondaryTabBox;
|
||||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
void slotTabBoxAdded(int mode);
|
||||
|
|
|
@ -38,6 +38,23 @@ class CubeEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal cubeOpacity READ configuredCubeOpacity)
|
||||
Q_PROPERTY(bool opacityDesktopOnly READ isOpacityDesktopOnly)
|
||||
Q_PROPERTY(bool displayDesktopName READ isDisplayDesktopName)
|
||||
Q_PROPERTY(bool reflection READ isReflection)
|
||||
Q_PROPERTY(int rotationDuration READ configuredRotationDuration)
|
||||
Q_PROPERTY(QColor backgroundColor READ configuredBackgroundColor)
|
||||
Q_PROPERTY(QColor capColor READ configuredCapColor)
|
||||
Q_PROPERTY(bool paintCaps READ isPaintCaps)
|
||||
Q_PROPERTY(bool closeOnMouseRelease READ isCloseOnMouseRelease)
|
||||
Q_PROPERTY(qreal zPosition READ configuredZPosition)
|
||||
Q_PROPERTY(bool useForTabBox READ isUseForTabBox)
|
||||
Q_PROPERTY(bool invertKeys READ isInvertKeys)
|
||||
Q_PROPERTY(bool invertMouse READ isInvertMouse)
|
||||
Q_PROPERTY(qreal capDeformationFactor READ configuredCapDeformationFactor)
|
||||
Q_PROPERTY(bool useZOrdering READ isUseZOrdering)
|
||||
Q_PROPERTY(bool texturedCaps READ isTexturedCaps)
|
||||
// TODO: electric borders: not a registered type
|
||||
public:
|
||||
CubeEffect();
|
||||
~CubeEffect();
|
||||
|
@ -58,6 +75,56 @@ public:
|
|||
void unregisterCubeInsideEffect(CubeInsideEffect* effect);
|
||||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
qreal configuredCubeOpacity() const {
|
||||
return cubeOpacity;
|
||||
}
|
||||
bool isOpacityDesktopOnly() const {
|
||||
return opacityDesktopOnly;
|
||||
}
|
||||
bool isDisplayDesktopName() const {
|
||||
return displayDesktopName;
|
||||
}
|
||||
bool isReflection() const {
|
||||
return reflection;
|
||||
}
|
||||
int configuredRotationDuration() const {
|
||||
return rotationDuration;
|
||||
}
|
||||
QColor configuredBackgroundColor() const {
|
||||
return backgroundColor;
|
||||
}
|
||||
QColor configuredCapColor() const {
|
||||
return capColor;
|
||||
}
|
||||
bool isPaintCaps() const {
|
||||
return paintCaps;
|
||||
}
|
||||
bool isCloseOnMouseRelease() const {
|
||||
return closeOnMouseRelease;
|
||||
}
|
||||
qreal configuredZPosition() const {
|
||||
return zPosition;
|
||||
}
|
||||
bool isUseForTabBox() const {
|
||||
return useForTabBox;
|
||||
}
|
||||
bool isInvertKeys() const {
|
||||
return invertKeys;
|
||||
}
|
||||
bool isInvertMouse() const {
|
||||
return invertMouse;
|
||||
}
|
||||
qreal configuredCapDeformationFactor() const {
|
||||
return capDeformationFactor;
|
||||
}
|
||||
bool isUseZOrdering() const {
|
||||
return useZOrdering;
|
||||
}
|
||||
bool isTexturedCaps() const {
|
||||
return texturedCaps;
|
||||
}
|
||||
private slots:
|
||||
void toggleCube();
|
||||
void toggleCylinder();
|
||||
|
|
|
@ -33,6 +33,11 @@ class CubeSlideEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int rotationDuration READ configuredRotationDuration)
|
||||
Q_PROPERTY(bool dontSlidePanels READ isDontSlidePanels)
|
||||
Q_PROPERTY(bool dontSlideStickyWindows READ isDontSlideStickyWindows)
|
||||
Q_PROPERTY(bool usePagerLayout READ isUsePagerLayout)
|
||||
Q_PROPERTY(bool useWindowMoving READ isUseWindowMoving)
|
||||
public:
|
||||
CubeSlideEffect();
|
||||
~CubeSlideEffect();
|
||||
|
@ -46,6 +51,22 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int configuredRotationDuration() const {
|
||||
return rotationDuration;
|
||||
}
|
||||
bool isDontSlidePanels() const {
|
||||
return dontSlidePanels;
|
||||
}
|
||||
bool isDontSlideStickyWindows() const {
|
||||
return dontSlideStickyWindows;
|
||||
}
|
||||
bool isUsePagerLayout() const {
|
||||
return usePagerLayout;
|
||||
}
|
||||
bool isUseWindowMoving() const {
|
||||
return useWindowMoving;
|
||||
}
|
||||
private Q_SLOTS:
|
||||
void slotDesktopChanged(int old, int current);
|
||||
void slotWindowStepUserMovedResized(KWin::EffectWindow *w);
|
||||
|
|
|
@ -34,6 +34,9 @@ namespace KWin
|
|||
class DashboardEffect : public KWin::Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal brightness READ configuredBrightness)
|
||||
Q_PROPERTY(qreal saturation READ configuredSaturation)
|
||||
Q_PROPERTY(bool blur READ isBlur)
|
||||
public:
|
||||
DashboardEffect();
|
||||
~DashboardEffect();
|
||||
|
@ -45,6 +48,16 @@ public:
|
|||
virtual void unpropagate();
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
qreal configuredBrightness() const {
|
||||
return brightness;
|
||||
}
|
||||
qreal configuredSaturation() const {
|
||||
return saturation;
|
||||
}
|
||||
bool isBlur() const {
|
||||
return blur;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow* c);
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
|
|
|
@ -63,6 +63,13 @@ class DesktopGridEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int zoomDuration READ configuredZoomDuration)
|
||||
Q_PROPERTY(int border READ configuredBorder)
|
||||
Q_PROPERTY(Qt::Alignment desktopNameAlignment READ configuredDesktopNameAlignment)
|
||||
Q_PROPERTY(int layoutMode READ configuredLayoutMode)
|
||||
Q_PROPERTY(int customLayoutRows READ configuredCustomLayoutRows)
|
||||
Q_PROPERTY(bool usePresentWindows READ isUsePresentWindows)
|
||||
// TODO: electric borders
|
||||
public:
|
||||
DesktopGridEffect();
|
||||
~DesktopGridEffect();
|
||||
|
@ -79,6 +86,25 @@ public:
|
|||
|
||||
enum { LayoutPager, LayoutAutomatic, LayoutCustom }; // Layout modes
|
||||
|
||||
// for properties
|
||||
int configuredZoomDuration() const {
|
||||
return zoomDuration;
|
||||
}
|
||||
int configuredBorder() const {
|
||||
return border;
|
||||
}
|
||||
Qt::Alignment configuredDesktopNameAlignment() const {
|
||||
return desktopNameAlignment;
|
||||
}
|
||||
int configuredLayoutMode() const {
|
||||
return layoutMode;
|
||||
}
|
||||
int configuredCustomLayoutRows() const {
|
||||
return customLayoutRows;
|
||||
}
|
||||
bool isUsePresentWindows() const {
|
||||
return m_usePresentWindows;
|
||||
}
|
||||
private slots:
|
||||
void toggle();
|
||||
// slots for global shortcut changed
|
||||
|
|
|
@ -38,6 +38,7 @@ class DialogParentEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int changeTime READ configuredChangeTime)
|
||||
public:
|
||||
DialogParentEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -48,6 +49,10 @@ public:
|
|||
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
int configuredChangeTime() const {
|
||||
return changeTime;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
void slotWindowActivated(KWin::EffectWindow *c);
|
||||
|
|
|
@ -34,12 +34,33 @@ class DimInactiveEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool dimPanels READ isDimPanels)
|
||||
Q_PROPERTY(bool dimDesktop READ isDimDesktop)
|
||||
Q_PROPERTY(bool dimKeepAbove READ isDimKeepAbove)
|
||||
Q_PROPERTY(bool dimByGroup READ isDimByGroup)
|
||||
Q_PROPERTY(int dimStrength READ configuredDimStrength)
|
||||
public:
|
||||
DimInactiveEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual void prePaintScreen(ScreenPrePaintData& data, int time);
|
||||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
|
||||
// for properties
|
||||
bool isDimPanels() const {
|
||||
return dim_panels;
|
||||
}
|
||||
bool isDimDesktop() const {
|
||||
return dim_desktop;
|
||||
}
|
||||
bool isDimKeepAbove() const {
|
||||
return dim_keepabove;
|
||||
}
|
||||
bool isDimByGroup() const {
|
||||
return dim_by_group;
|
||||
}
|
||||
int configuredDimStrength() const {
|
||||
return dim_strength;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowActivated(KWin::EffectWindow* c);
|
||||
void slotWindowDeleted(KWin::EffectWindow *w);
|
||||
|
|
|
@ -30,6 +30,7 @@ class FallApartEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int blockSize READ configuredBlockSize)
|
||||
public:
|
||||
FallApartEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -39,6 +40,10 @@ public:
|
|||
virtual void postPaintScreen();
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
int configuredBlockSize() const {
|
||||
return blockSize;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
void slotWindowDeleted(KWin::EffectWindow *w);
|
||||
|
|
|
@ -35,6 +35,14 @@ class FlipSwitchEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool tabBox READ isTabBox)
|
||||
Q_PROPERTY(bool tabBoxAlternative READ isTabBoxAlternative)
|
||||
Q_PROPERTY(int duration READ duration)
|
||||
Q_PROPERTY(int angle READ angle)
|
||||
Q_PROPERTY(qreal xPosition READ xPosition)
|
||||
Q_PROPERTY(qreal yPosition READ yPosition)
|
||||
Q_PROPERTY(bool windowTitle READ isWindowTitle)
|
||||
// TODO: electric borders
|
||||
public:
|
||||
FlipSwitchEffect();
|
||||
~FlipSwitchEffect();
|
||||
|
@ -50,6 +58,29 @@ public:
|
|||
virtual bool isActive() const;
|
||||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
bool isTabBox() const {
|
||||
return m_tabbox;
|
||||
}
|
||||
bool isTabBoxAlternative() const {
|
||||
return m_tabboxAlternative;
|
||||
}
|
||||
int duration() const {
|
||||
return m_timeLine.duration();
|
||||
}
|
||||
int angle() const {
|
||||
return m_angle;
|
||||
}
|
||||
qreal xPosition() const {
|
||||
return m_xPosition;
|
||||
}
|
||||
qreal yPosition() const {
|
||||
return m_yPosition;
|
||||
}
|
||||
bool isWindowTitle() const {
|
||||
return m_windowTitle;
|
||||
}
|
||||
private Q_SLOTS:
|
||||
void toggleActiveCurrent();
|
||||
void toggleActiveAllDesktops();
|
||||
|
|
|
@ -34,6 +34,9 @@ class GlideEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int duration READ configuredDuration)
|
||||
Q_PROPERTY(int effect READ configuredEffect)
|
||||
Q_PROPERTY(int angle READ configuredAngle)
|
||||
public:
|
||||
GlideEffect();
|
||||
~GlideEffect();
|
||||
|
@ -45,6 +48,17 @@ public:
|
|||
virtual bool isActive() const;
|
||||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int configuredDuration() const {
|
||||
return duration;
|
||||
}
|
||||
int configuredEffect() const {
|
||||
return effect;
|
||||
}
|
||||
int configuredAngle() const {
|
||||
return angle;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow* c);
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
|
|
|
@ -31,6 +31,7 @@ class LoginEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool fadeToBlack READ isFadeToBlack)
|
||||
public:
|
||||
LoginEffect();
|
||||
virtual void prePaintScreen(ScreenPrePaintData& data, int time);
|
||||
|
@ -40,6 +41,10 @@ public:
|
|||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
bool isFadeToBlack() const {
|
||||
return m_fadeToBlack;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ class LogoutEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool useBlur READ isUseBlur)
|
||||
public:
|
||||
LogoutEffect();
|
||||
~LogoutEffect();
|
||||
|
@ -45,6 +46,11 @@ public:
|
|||
virtual void postPaintScreen();
|
||||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
bool isUseBlur() const {
|
||||
return useBlur;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow* w);
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
|
|
|
@ -40,6 +40,7 @@ class GLVertexBuffer;
|
|||
class LookingGlassEffect : public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int initialRadius READ initialRadius)
|
||||
public:
|
||||
LookingGlassEffect();
|
||||
virtual ~LookingGlassEffect();
|
||||
|
@ -52,6 +53,10 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int initialRadius() const {
|
||||
return initialradius;
|
||||
}
|
||||
public slots:
|
||||
void toggle();
|
||||
void zoomIn();
|
||||
|
|
|
@ -32,6 +32,7 @@ class MagicLampEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int animationDuration READ animationDuration)
|
||||
public:
|
||||
MagicLampEffect();
|
||||
|
||||
|
@ -44,6 +45,10 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int animationDuration() const {
|
||||
return mAnimationDuration;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowDeleted(KWin::EffectWindow *w);
|
||||
void slotWindowMinimized(KWin::EffectWindow *w);
|
||||
|
|
|
@ -34,6 +34,8 @@ class MagnifierEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QSize magnifierSize READ magnifierSize)
|
||||
Q_PROPERTY(qreal targetZoom READ targetZoom)
|
||||
public:
|
||||
MagnifierEffect();
|
||||
virtual ~MagnifierEffect();
|
||||
|
@ -43,6 +45,14 @@ public:
|
|||
virtual void postPaintScreen();
|
||||
virtual bool isActive() const;
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
QSize magnifierSize() const {
|
||||
return magnifier_size;
|
||||
}
|
||||
qreal targetZoom() const {
|
||||
return target_zoom;
|
||||
}
|
||||
private slots:
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
|
|
|
@ -32,12 +32,22 @@ class MouseMarkEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int width READ configuredWidth)
|
||||
Q_PROPERTY(QColor color READ configuredColor)
|
||||
public:
|
||||
MouseMarkEffect();
|
||||
~MouseMarkEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
int configuredWidth() const {
|
||||
return width;
|
||||
}
|
||||
QColor configuredColor() const {
|
||||
return color;
|
||||
}
|
||||
private slots:
|
||||
void clear();
|
||||
void clearLast();
|
||||
|
|
|
@ -67,6 +67,23 @@ class PresentWindowsEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int layoutMode READ layoutMode)
|
||||
Q_PROPERTY(bool showCaptions READ isShowCaptions)
|
||||
Q_PROPERTY(bool showIcons READ isShowIcons)
|
||||
Q_PROPERTY(bool doNotCloseWindows READ isDoNotCloseWindows)
|
||||
Q_PROPERTY(bool ignoreMinimized READ isIgnoreMinimized)
|
||||
Q_PROPERTY(int accuracy READ accuracy)
|
||||
Q_PROPERTY(bool fillGaps READ isFillGaps)
|
||||
Q_PROPERTY(int fadeDuration READ fadeDuration)
|
||||
Q_PROPERTY(bool showPanel READ isShowPanel)
|
||||
Q_PROPERTY(int leftButtonWindow READ leftButtonWindow)
|
||||
Q_PROPERTY(int rightButtonWindow READ rightButtonWindow)
|
||||
Q_PROPERTY(int middleButtonWindow READ middleButtonWindow)
|
||||
Q_PROPERTY(int leftButtonDesktop READ leftButtonDesktop)
|
||||
Q_PROPERTY(int middleButtonDesktop READ middleButtonDesktop)
|
||||
Q_PROPERTY(int rightButtonDesktop READ rightButtonDesktop)
|
||||
Q_PROPERTY(bool dragToClose READ isDragToClose)
|
||||
// TODO: electric borders
|
||||
private:
|
||||
// Structures
|
||||
struct WindowData {
|
||||
|
@ -130,6 +147,55 @@ public:
|
|||
DesktopShowDesktopAction = 3 // Minimizes all windows
|
||||
};
|
||||
|
||||
// for properties
|
||||
int layoutMode() const {
|
||||
return m_layoutMode;
|
||||
}
|
||||
bool isShowCaptions() const {
|
||||
return m_showCaptions;
|
||||
}
|
||||
bool isShowIcons() const {
|
||||
return m_showIcons;
|
||||
}
|
||||
bool isDoNotCloseWindows() const {
|
||||
return m_doNotCloseWindows;
|
||||
}
|
||||
bool isIgnoreMinimized() const {
|
||||
return m_ignoreMinimized;
|
||||
}
|
||||
int accuracy() const {
|
||||
return m_accuracy;
|
||||
}
|
||||
bool isFillGaps() const {
|
||||
return m_fillGaps;
|
||||
}
|
||||
int fadeDuration() const {
|
||||
return m_fadeDuration;
|
||||
}
|
||||
bool isShowPanel() const {
|
||||
return m_showPanel;
|
||||
}
|
||||
int leftButtonWindow() const {
|
||||
return m_leftButtonWindow;
|
||||
}
|
||||
int rightButtonWindow() const {
|
||||
return m_rightButtonWindow;
|
||||
}
|
||||
int middleButtonWindow() const {
|
||||
return m_middleButtonWindow;
|
||||
}
|
||||
int leftButtonDesktop() const {
|
||||
return m_leftButtonDesktop;
|
||||
}
|
||||
int middleButtonDesktop() const {
|
||||
return m_middleButtonDesktop;
|
||||
}
|
||||
int rightButtonDesktop() const {
|
||||
return m_rightButtonDesktop;
|
||||
}
|
||||
bool isDragToClose() const {
|
||||
return m_dragToClose;
|
||||
}
|
||||
public slots:
|
||||
void setActive(bool active);
|
||||
void toggleActive() {
|
||||
|
|
|
@ -30,6 +30,8 @@ class ResizeEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool textureScale READ isTextureScale)
|
||||
Q_PROPERTY(bool outline READ isOutline)
|
||||
public:
|
||||
ResizeEffect();
|
||||
~ResizeEffect();
|
||||
|
@ -42,6 +44,13 @@ public:
|
|||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
||||
bool isTextureScale() const {
|
||||
return m_features & TextureScale;
|
||||
}
|
||||
bool isOutline() const {
|
||||
return m_features & Outline;
|
||||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowStartUserMovedResized(KWin::EffectWindow *w);
|
||||
void slotWindowStepUserMovedResized(KWin::EffectWindow *w, const QRect &geometry);
|
||||
|
|
|
@ -33,6 +33,7 @@ class SheetEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int duration READ configuredDuration)
|
||||
public:
|
||||
SheetEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -44,6 +45,10 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int configuredDuration() const {
|
||||
return duration;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow* c);
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
|
|
|
@ -33,6 +33,14 @@ class GLTexture;
|
|||
class ShowFpsEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal alpha READ configuredAlpha)
|
||||
Q_PROPERTY(int x READ configuredX)
|
||||
Q_PROPERTY(int y READ configuredY)
|
||||
Q_PROPERTY(QRect fpsTextRect READ configuredFpsTextRect)
|
||||
Q_PROPERTY(int textAlign READ configuredTextAlign)
|
||||
Q_PROPERTY(QFont textFont READ configuredTextFont)
|
||||
Q_PROPERTY(QColor textColor READ configuredTextColor)
|
||||
public:
|
||||
ShowFpsEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -41,6 +49,29 @@ public:
|
|||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void postPaintScreen();
|
||||
enum { INSIDE_GRAPH, NOWHERE, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT }; // fps text position
|
||||
|
||||
// for properties
|
||||
qreal configuredAlpha() const {
|
||||
return alpha;
|
||||
}
|
||||
int configuredX() const {
|
||||
return x;
|
||||
}
|
||||
int configuredY() const {
|
||||
return y;
|
||||
}
|
||||
QRect configuredFpsTextRect() const {
|
||||
return fpsTextRect;
|
||||
}
|
||||
int configuredTextAlign() const {
|
||||
return textAlign;
|
||||
}
|
||||
QFont configuredTextFont() const {
|
||||
return textFont;
|
||||
}
|
||||
QColor configuredTextColor() const {
|
||||
return textColor;
|
||||
}
|
||||
private:
|
||||
void paintGL(int fps);
|
||||
#ifdef KWIN_HAVE_XRENDER_COMPOSITING
|
||||
|
|
|
@ -33,6 +33,8 @@ class SlidingPopupsEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int fadeInTime READ fadeInTime)
|
||||
Q_PROPERTY(int fadeOutTime READ fadeOutTime)
|
||||
public:
|
||||
SlidingPopupsEffect();
|
||||
~SlidingPopupsEffect();
|
||||
|
@ -44,6 +46,13 @@ public:
|
|||
virtual bool isActive() const;
|
||||
// TODO react also on virtual desktop changes
|
||||
|
||||
// for properties
|
||||
int fadeInTime() const {
|
||||
return mFadeInTime;
|
||||
}
|
||||
int fadeOutTime() const {
|
||||
return mFadeOutTime;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow *c);
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
|
|
|
@ -39,10 +39,28 @@ class ThumbnailAsideEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int maxWidth READ configuredMaxWidth)
|
||||
Q_PROPERTY(int spacing READ configuredSpacing)
|
||||
Q_PROPERTY(qreal opacity READ configuredOpacity)
|
||||
Q_PROPERTY(int screen READ configuredScreen)
|
||||
public:
|
||||
ThumbnailAsideEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
|
||||
|
||||
// for properties
|
||||
int configuredMaxWidth() const {
|
||||
return maxwidth;
|
||||
}
|
||||
int configuredSpacing() const {
|
||||
return spacing;
|
||||
}
|
||||
qreal configuredOpacity() const {
|
||||
return opacity;
|
||||
}
|
||||
int configuredScreen() const {
|
||||
return screen;
|
||||
}
|
||||
private slots:
|
||||
void toggleCurrentThumbnail();
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
|
|
|
@ -34,6 +34,8 @@ class TrackMouseEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(Qt::KeyboardModifiers modifiers READ modifiers)
|
||||
Q_PROPERTY(bool mousePolling READ isMousePolling)
|
||||
public:
|
||||
TrackMouseEffect();
|
||||
virtual ~TrackMouseEffect();
|
||||
|
@ -42,6 +44,14 @@ public:
|
|||
virtual void postPaintScreen();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
Qt::KeyboardModifiers modifiers() const {
|
||||
return m_modifiers;
|
||||
}
|
||||
bool isMousePolling() const {
|
||||
return m_mousePolling;
|
||||
}
|
||||
private slots:
|
||||
void toggle();
|
||||
void slotMouseChanged(const QPoint& pos, const QPoint& old,
|
||||
|
|
|
@ -31,12 +31,61 @@ class TranslucencyEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal decoration READ configuredDecoration)
|
||||
Q_PROPERTY(qreal moveResize READ configuredMoveResize)
|
||||
Q_PROPERTY(qreal dialogs READ configuredDialogs)
|
||||
Q_PROPERTY(qreal inactive READ configuredInactive)
|
||||
Q_PROPERTY(qreal comboboxPopups READ configuredComboboxPopups)
|
||||
Q_PROPERTY(qreal menus READ configuredMenus)
|
||||
Q_PROPERTY(bool individualMenuConfig READ isIndividualMenuConfig)
|
||||
Q_PROPERTY(qreal dropDownMenus READ configuredDropDownMenus)
|
||||
Q_PROPERTY(qreal popupMenus READ configuredPopupMenus)
|
||||
Q_PROPERTY(qreal tornOffMenus READ configuredTornOffMenus)
|
||||
Q_PROPERTY(int moveResizeDuration READ configuredMoveResizeDuration)
|
||||
Q_PROPERTY(int activeInactiveDuration READ configuredActiveInactiveDuration)
|
||||
public:
|
||||
TranslucencyEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
|
||||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
|
||||
// for properties
|
||||
qreal configuredDecoration() const {
|
||||
return decoration;
|
||||
}
|
||||
qreal configuredMoveResize() const {
|
||||
return moveresize;
|
||||
}
|
||||
qreal configuredDialogs() const {
|
||||
return dialogs;
|
||||
}
|
||||
qreal configuredInactive() const {
|
||||
return inactive;
|
||||
}
|
||||
qreal configuredComboboxPopups() const {
|
||||
return comboboxpopups;
|
||||
}
|
||||
qreal configuredMenus() const {
|
||||
return menus;
|
||||
}
|
||||
bool isIndividualMenuConfig() const {
|
||||
return individualmenuconfig;
|
||||
}
|
||||
qreal configuredDropDownMenus() const {
|
||||
return dropdownmenus;
|
||||
}
|
||||
qreal configuredPopupMenus() const {
|
||||
return popupmenus;
|
||||
}
|
||||
qreal configuredTornOffMenus() const {
|
||||
return tornoffmenus;
|
||||
}
|
||||
int configuredMoveResizeDuration() const {
|
||||
return moveresize_timeline.duration();
|
||||
}
|
||||
int configuredActiveInactiveDuration() const {
|
||||
return activeinactive_timeline.duration();
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowActivated(KWin::EffectWindow* w);
|
||||
void slotWindowStartStopUserMovedResized(KWin::EffectWindow *w);
|
||||
|
|
|
@ -29,6 +29,8 @@ namespace KWin
|
|||
class WindowGeometry : public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool handlesMoves READ isHandlesMoves)
|
||||
Q_PROPERTY(bool handlesResizes READ isHandlesResizes)
|
||||
public:
|
||||
WindowGeometry();
|
||||
~WindowGeometry();
|
||||
|
@ -40,6 +42,13 @@ public:
|
|||
void paintScreen(int mask, QRegion region, ScreenPaintData &data);
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
bool isHandlesMoves() const {
|
||||
return iHandleMoves;
|
||||
}
|
||||
bool isHandlesResizes() const {
|
||||
return iHandleResizes;
|
||||
}
|
||||
private slots:
|
||||
void toggle();
|
||||
void slotWindowStartUserMovedResized(KWin::EffectWindow *w);
|
||||
|
|
|
@ -25,6 +25,22 @@ struct ParameterSet;
|
|||
class WobblyWindowsEffect : public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal stiffness READ stiffness)
|
||||
Q_PROPERTY(qreal drag READ drag)
|
||||
Q_PROPERTY(qreal moveFactor READ moveFactor)
|
||||
Q_PROPERTY(qreal xTesselation READ xTesselation)
|
||||
Q_PROPERTY(qreal yTesselation READ yTesselation)
|
||||
Q_PROPERTY(qreal minVelocity READ minVelocity)
|
||||
Q_PROPERTY(qreal maxVelocity READ maxVelocity)
|
||||
Q_PROPERTY(qreal stopVelocity READ stopVelocity)
|
||||
Q_PROPERTY(qreal minAcceleration READ minAcceleration)
|
||||
Q_PROPERTY(qreal maxAcceleration READ maxAcceleration)
|
||||
Q_PROPERTY(qreal stopAcceleration READ stopAcceleration)
|
||||
Q_PROPERTY(bool moveEffectEnabled READ isMoveEffectEnabled)
|
||||
Q_PROPERTY(bool openEffectEnabled READ isOpenEffectEnabled)
|
||||
Q_PROPERTY(bool closeEffectEnabled READ isCloseEffectEnabled)
|
||||
Q_PROPERTY(bool moveWobble READ isMoveWobble)
|
||||
Q_PROPERTY(bool resizeWobble READ isResizeWobble)
|
||||
public:
|
||||
|
||||
WobblyWindowsEffect();
|
||||
|
@ -57,6 +73,55 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
qreal stiffness() const {
|
||||
return m_stiffness;
|
||||
}
|
||||
qreal drag() const {
|
||||
return m_drag;
|
||||
}
|
||||
qreal moveFactor() const {
|
||||
return m_move_factor;
|
||||
}
|
||||
qreal xTesselation() const {
|
||||
return m_xTesselation;
|
||||
}
|
||||
qreal yTesselation() const {
|
||||
return m_yTesselation;
|
||||
}
|
||||
qreal minVelocity() const {
|
||||
return m_minVelocity;
|
||||
}
|
||||
qreal maxVelocity() const {
|
||||
return m_maxVelocity;
|
||||
}
|
||||
qreal stopVelocity() const {
|
||||
return m_stopVelocity;
|
||||
}
|
||||
qreal minAcceleration() const {
|
||||
return m_minAcceleration;
|
||||
}
|
||||
qreal maxAcceleration() const {
|
||||
return m_maxAcceleration;
|
||||
}
|
||||
qreal stopAcceleration() const {
|
||||
return m_stopAcceleration;
|
||||
}
|
||||
bool isMoveEffectEnabled() const {
|
||||
return m_moveEffectEnabled;
|
||||
}
|
||||
bool isOpenEffectEnabled() const {
|
||||
return m_openEffectEnabled;
|
||||
}
|
||||
bool isCloseEffectEnabled() const {
|
||||
return m_closeEffectEnabled;
|
||||
}
|
||||
bool isMoveWobble() const {
|
||||
return m_moveWobble;
|
||||
}
|
||||
bool isResizeWobble() const {
|
||||
return m_resizeWobble;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow *w);
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
|
|
|
@ -36,6 +36,14 @@ class ZoomEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal zoomFactor READ configuredZoomFactor)
|
||||
Q_PROPERTY(int mousePointer READ configuredMousePointer)
|
||||
Q_PROPERTY(int mouseTracking READ configuredMouseTracking)
|
||||
Q_PROPERTY(bool enableFocusTracking READ isEnableFocusTracking)
|
||||
Q_PROPERTY(bool followFocus READ isFollowFocus)
|
||||
Q_PROPERTY(int focusDelay READ configuredFocusDelay)
|
||||
Q_PROPERTY(qreal moveFactor READ configuredMoveFactor)
|
||||
Q_PROPERTY(qreal targetZoom READ targetZoom)
|
||||
public:
|
||||
ZoomEffect();
|
||||
virtual ~ZoomEffect();
|
||||
|
@ -44,6 +52,31 @@ public:
|
|||
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
|
||||
virtual void postPaintScreen();
|
||||
virtual bool isActive() const;
|
||||
// for properties
|
||||
qreal configuredZoomFactor() const {
|
||||
return zoomFactor;
|
||||
}
|
||||
int configuredMousePointer() const {
|
||||
return mousePointer;
|
||||
}
|
||||
int configuredMouseTracking() const {
|
||||
return mouseTracking;
|
||||
}
|
||||
bool isEnableFocusTracking() const {
|
||||
return enableFocusTracking;
|
||||
}
|
||||
bool isFollowFocus() const {
|
||||
return followFocus;
|
||||
}
|
||||
int configuredFocusDelay() const {
|
||||
return focusDelay;
|
||||
}
|
||||
qreal configuredMoveFactor() const {
|
||||
return moveFactor;
|
||||
}
|
||||
qreal targetZoom() const {
|
||||
return target_zoom;
|
||||
}
|
||||
private slots:
|
||||
inline void zoomIn() { zoomIn(-1.0); };
|
||||
void zoomIn(double to);
|
||||
|
|
|
@ -58,6 +58,10 @@
|
|||
<method name="listOfEffects">
|
||||
<arg type="as" direction="out"/>
|
||||
</method>
|
||||
<method name="supportInformationForEffect">
|
||||
<arg name="name" type="s" direction="in"/>
|
||||
<arg type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="compositingActive">
|
||||
<arg type="b" direction="out"/>
|
||||
</method>
|
||||
|
|
|
@ -1052,6 +1052,13 @@ QStringList Workspace::listOfEffects() const
|
|||
return listModules;
|
||||
}
|
||||
|
||||
QString Workspace::supportInformationForEffect(const QString& name) const
|
||||
{
|
||||
if (effects)
|
||||
return static_cast<EffectsHandlerImpl*>(effects)->supportInformation(name);
|
||||
return QString();
|
||||
}
|
||||
|
||||
void Workspace::slotActivateAttentionWindow()
|
||||
{
|
||||
if (attention_chain.count() > 0)
|
||||
|
|
|
@ -2439,6 +2439,12 @@ QString Workspace::supportInformation() const
|
|||
foreach (const QString &effect, activeEffects()) {
|
||||
support.append(effect % '\n');
|
||||
}
|
||||
support.append("\nEffect Settings:\n");
|
||||
support.append( "----------------\n");
|
||||
foreach (const QString &effect, loadedEffects()) {
|
||||
support.append(supportInformationForEffect(effect));
|
||||
support.append('\n');
|
||||
}
|
||||
} else {
|
||||
support.append("Compositing is not active\n");
|
||||
}
|
||||
|
|
|
@ -392,6 +392,7 @@ public:
|
|||
void toggleEffect(const QString& name);
|
||||
void reconfigureEffect(const QString& name);
|
||||
void unloadEffect(const QString& name);
|
||||
QString supportInformationForEffect(const QString& name) const;
|
||||
void updateCompositeBlocking(Client* c = NULL);
|
||||
|
||||
QStringList loadedEffects() const;
|
||||
|
|
Loading…
Reference in a new issue