KWin
Loading...
Searching...
No Matches
Public Slots | Public Member Functions | Static Public Member Functions | List of all members
KWin::ContrastEffect Class Reference

#include <contrast.h>

Inheritance diagram for KWin::ContrastEffect:
KWin::Effect

Public Slots

void slotWindowAdded (KWin::EffectWindow *w)
 
void slotWindowDeleted (KWin::EffectWindow *w)
 
void slotPropertyNotify (KWin::EffectWindow *w, long atom)
 
void slotScreenGeometryChanged ()
 
- Public Slots inherited from KWin::Effect
virtual bool borderActivated (ElectricBorder border)
 

Public Member Functions

 ContrastEffect ()
 
 ~ContrastEffect () override
 
void drawWindow (const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *w, int mask, const QRegion &region, WindowPaintData &data) override
 
bool provides (Feature feature) override
 
bool isActive () const override
 
int requestedEffectChainPosition () const override
 
bool eventFilter (QObject *watched, QEvent *event) override
 
bool blocksDirectScanout () const override
 
- Public Member Functions inherited from KWin::Effect
 Effect (QObject *parent=nullptr)
 
 ~Effect () override
 
virtual void reconfigure (ReconfigureFlags flags)
 
virtual void prePaintScreen (ScreenPrePaintData &data, std::chrono::milliseconds presentTime)
 
virtual void paintScreen (const RenderTarget &renderTarget, const RenderViewport &viewport, int mask, const QRegion &region, Output *screen)
 
virtual void postPaintScreen ()
 
virtual void prePaintWindow (EffectWindow *w, WindowPrePaintData &data, std::chrono::milliseconds presentTime)
 
virtual void paintWindow (const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *w, int mask, QRegion region, WindowPaintData &data)
 
virtual void postPaintWindow (EffectWindow *w)
 
virtual bool perform (Feature feature, const QVariantList &arguments)
 
virtual void windowInputMouseEvent (QEvent *e)
 
virtual void grabbedKeyboardEvent (QKeyEvent *e)
 
virtual QString debug (const QString &parameter) const
 
virtual bool touchDown (qint32 id, const QPointF &pos, std::chrono::microseconds time)
 
virtual bool touchMotion (qint32 id, const QPointF &pos, std::chrono::microseconds time)
 
virtual bool touchUp (qint32 id, std::chrono::microseconds time)
 
virtual bool tabletToolEvent (QTabletEvent *event)
 
virtual bool tabletToolButtonEvent (uint button, bool pressed, quint64 tabletToolId)
 
virtual bool tabletPadButtonEvent (uint button, bool pressed, void *tabletPadId)
 
virtual bool tabletPadStripEvent (int number, int position, bool isFinger, void *tabletPadId)
 
virtual bool tabletPadRingEvent (int number, int position, bool isFinger, void *tabletPadId)
 
template<typename T >
int animationTime (int defaultDuration)
 

Static Public Member Functions

static bool supported ()
 
static bool enabledByDefault ()
 
static QMatrix4x4 colorMatrix (qreal contrast, qreal intensity, qreal saturation)
 
- Static Public Member Functions inherited from KWin::Effect
static QPointF cursorPos ()
 
static double animationTime (const KConfigGroup &cfg, const QString &key, int defaultTime)
 
static double animationTime (int defaultTime)
 
static double interpolate (double x, double y, double a)
 
static void setPositionTransformations (WindowPaintData &data, QRect &region, EffectWindow *w, const QRect &r, Qt::AspectRatioMode aspect)
 

Additional Inherited Members

- Public Types inherited from KWin::Effect
enum  {
  PAINT_WINDOW_OPAQUE = 1 << 0 , PAINT_WINDOW_TRANSLUCENT = 1 << 1 , PAINT_WINDOW_TRANSFORMED = 1 << 2 , PAINT_SCREEN_REGION = 1 << 3 ,
  PAINT_SCREEN_TRANSFORMED = 1 << 4 , PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS = 1 << 5 , PAINT_SCREEN_BACKGROUND_FIRST = 1 << 6
}
 
enum  Feature {
  Nothing = 0 , ScreenInversion , Blur , Contrast ,
  HighlightWindows
}
 
enum  ReconfigureFlag { ReconfigureAll = 1 << 0 }
 

Detailed Description

Definition at line 24 of file contrast.h.

Constructor & Destructor Documentation

◆ ContrastEffect()

KWin::ContrastEffect::ContrastEffect ( )

Definition at line 35 of file contrast.cpp.

◆ ~ContrastEffect()

KWin::ContrastEffect::~ContrastEffect ( )
override

Definition at line 79 of file contrast.cpp.

Member Function Documentation

◆ blocksDirectScanout()

bool KWin::ContrastEffect::blocksDirectScanout ( ) const
overridevirtual

overwrite this method to return false if your effect does not need to be drawn over opaque fullscreen windows

Reimplemented from KWin::Effect.

Definition at line 509 of file contrast.cpp.

◆ colorMatrix()

QMatrix4x4 KWin::ContrastEffect::colorMatrix ( qreal contrast,
qreal intensity,
qreal saturation )
static

Definition at line 227 of file contrast.cpp.

◆ drawWindow()

void KWin::ContrastEffect::drawWindow ( const RenderTarget & renderTarget,
const RenderViewport & viewport,
EffectWindow * w,
int mask,
const QRegion & region,
WindowPaintData & data )
overridevirtual

Can be called to draw multiple copies (e.g. thumbnails) of a window. You can change window's opacity/brightness/etc here, but you can't do any transformations.

In OpenGL based compositing, the frameworks ensures that the context is current when this method is invoked.

Reimplemented from KWin::Effect.

Definition at line 397 of file contrast.cpp.

◆ enabledByDefault()

bool KWin::ContrastEffect::enabledByDefault ( )
static

Definition at line 266 of file contrast.cpp.

◆ eventFilter()

bool KWin::ContrastEffect::eventFilter ( QObject * watched,
QEvent * event )
override

Definition at line 194 of file contrast.cpp.

◆ isActive()

bool KWin::ContrastEffect::isActive ( ) const
overridevirtual

Overwrite this method to indicate whether your effect will be doing something in the next frame to be rendered. If the method returns false the effect will be excluded from the chained methods in the next rendered frame.

This method is called always directly before the paint loop begins. So it is totally fine to e.g. react on a window event, issue a repaint to trigger an animation and change a flag to indicate that this method returns true.

As the method is called each frame, you should not perform complex calculations. Best use just a boolean flag.

The default implementation of this method returns true.

Since
4.8

Reimplemented from KWin::Effect.

Definition at line 504 of file contrast.cpp.

◆ provides()

bool KWin::ContrastEffect::provides ( Effect::Feature )
inlineoverridevirtual

Called on Transparent resizes. return true if your effect substitutes questioned feature

Reimplemented from KWin::Effect.

Definition at line 79 of file contrast.h.

◆ requestedEffectChainPosition()

int KWin::ContrastEffect::requestedEffectChainPosition ( ) const
inlineoverridevirtual

Reimplement this method to indicate where in the Effect chain the Effect should be placed.

A low number indicates early chain position, thus before other Effects got called, a high number indicates a late position. The returned number should be in the interval [0, 100]. The default value is 0.

In KWin4 this information was provided in the Effect's desktop file as property X-KDE-Ordering. In the case of Scripted Effects this property is still used.

Since
5.0

Reimplemented from KWin::Effect.

Definition at line 40 of file contrast.h.

◆ slotPropertyNotify

void KWin::ContrastEffect::slotPropertyNotify ( KWin::EffectWindow * w,
long atom )
slot

Definition at line 220 of file contrast.cpp.

◆ slotScreenGeometryChanged

void KWin::ContrastEffect::slotScreenGeometryChanged ( )
slot

Definition at line 87 of file contrast.cpp.

◆ slotWindowAdded

void KWin::ContrastEffect::slotWindowAdded ( KWin::EffectWindow * w)
slot

Definition at line 175 of file contrast.cpp.

◆ slotWindowDeleted

void KWin::ContrastEffect::slotWindowDeleted ( KWin::EffectWindow * w)
slot

Definition at line 208 of file contrast.cpp.

◆ supported()

bool KWin::ContrastEffect::supported ( )
static

Definition at line 286 of file contrast.cpp.


The documentation for this class was generated from the following files: