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

#include <blur.h>

Inheritance diagram for KWin::BlurEffect:
KWin::Effect

Public Slots

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

Public Member Functions

 BlurEffect ()
 
 ~BlurEffect () override
 
void reconfigure (ReconfigureFlags flags) override
 
void prePaintScreen (ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override
 
void prePaintWindow (EffectWindow *w, WindowPrePaintData &data, std::chrono::milliseconds presentTime) 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 paintScreen (const RenderTarget &renderTarget, const RenderViewport &viewport, int mask, const QRegion &region, Output *screen)
 
virtual void postPaintScreen ()
 
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 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 42 of file blur.h.

Constructor & Destructor Documentation

◆ BlurEffect()

KWin::BlurEffect::BlurEffect ( )

Definition at line 53 of file blur.cpp.

◆ ~BlurEffect()

KWin::BlurEffect::~BlurEffect ( )
override

Definition at line 133 of file blur.cpp.

Member Function Documentation

◆ blocksDirectScanout()

bool KWin::BlurEffect::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 851 of file blur.cpp.

◆ drawWindow()

void KWin::BlurEffect::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 482 of file blur.cpp.

◆ enabledByDefault()

bool KWin::BlurEffect::enabledByDefault ( )
static

Definition at line 340 of file blur.cpp.

◆ eventFilter()

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

Definition at line 326 of file blur.cpp.

◆ isActive()

bool KWin::BlurEffect::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 846 of file blur.cpp.

◆ prePaintScreen()

void KWin::BlurEffect::prePaintScreen ( ScreenPrePaintData & data,
std::chrono::milliseconds presentTime )
overridevirtual

Called before starting to paint the screen. In this method you can:

  • set whether the windows or the entire screen will be transformed
  • change the region of the screen that will be painted
  • do various housekeeping tasks such as initing your effect's variables for the upcoming paint pass or updating animation's progress

presentTime specifies the expected monotonic time when the rendered frame will be displayed on the screen.

Reimplemented from KWin::Effect.

Definition at line 408 of file blur.cpp.

◆ prePaintWindow()

void KWin::BlurEffect::prePaintWindow ( EffectWindow * w,
WindowPrePaintData & data,
std::chrono::milliseconds presentTime )
overridevirtual

Called for every window before the actual paint pass In this method you can:

  • enable or disable painting of the window (e.g. enable paiting of minimized window)
  • set window to be painted with translucency
  • set window to be transformed
  • request the window to be divided into multiple parts

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

presentTime specifies the expected monotonic time when the rendered frame will be displayed on the screen.

Reimplemented from KWin::Effect.

Definition at line 417 of file blur.cpp.

◆ provides()

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

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

Reimplemented from KWin::Effect.

Definition at line 151 of file blur.h.

◆ reconfigure()

void KWin::BlurEffect::reconfigure ( ReconfigureFlags flags)
overridevirtual

Called when configuration changes (either the effect's or KWin's global).

In OpenGL based compositing, the frameworks ensures that the context is current when the Effect is reconfigured. If this method is called from within the Effect it is required to ensure that the context is current if the implementation does OpenGL calls.

Reimplemented from KWin::Effect.

Definition at line 199 of file blur.cpp.

◆ requestedEffectChainPosition()

int KWin::BlurEffect::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 61 of file blur.h.

◆ setupDecorationConnections

void KWin::BlurEffect::setupDecorationConnections ( EffectWindow * w)
slot

Definition at line 315 of file blur.cpp.

◆ slotPropertyNotify

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

Definition at line 308 of file blur.cpp.

◆ slotScreenRemoved

void KWin::BlurEffect::slotScreenRemoved ( KWin::Output * screen)
slot

Definition at line 298 of file blur.cpp.

◆ slotWindowAdded

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

Definition at line 265 of file blur.cpp.

◆ slotWindowDeleted

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

Definition at line 286 of file blur.cpp.

◆ supported()

bool KWin::BlurEffect::supported ( )
static

Definition at line 361 of file blur.cpp.

Member Data Documentation

◆ halfpixelLocation

int KWin::BlurEffect::halfpixelLocation

Definition at line 93 of file blur.h.

◆ mvpMatrixLocation

int KWin::BlurEffect::mvpMatrixLocation

Definition at line 91 of file blur.h.

◆ noiseTexture

std::unique_ptr<GLTexture> KWin::BlurEffect::noiseTexture

Definition at line 111 of file blur.h.

◆ noiseTextureScale

qreal KWin::BlurEffect::noiseTextureScale = 1.0

Definition at line 112 of file blur.h.

◆ noiseTextureSizeLocation

int KWin::BlurEffect::noiseTextureSizeLocation

Definition at line 108 of file blur.h.

◆ noiseTextureStength

int KWin::BlurEffect::noiseTextureStength = 0

Definition at line 113 of file blur.h.

◆ offsetLocation

int KWin::BlurEffect::offsetLocation

Definition at line 92 of file blur.h.

◆ shader

std::unique_ptr<GLShader> KWin::BlurEffect::shader

Definition at line 90 of file blur.h.

◆ texStartPosLocation

int KWin::BlurEffect::texStartPosLocation

Definition at line 109 of file blur.h.


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