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

Class representing a Window's Shadow to be rendered by the Compositor. More...

#include <shadow.h>

Inheritance diagram for KWin::Shadow:

Public Types

enum  ShadowElements {
  ShadowElementTop , ShadowElementTopRight , ShadowElementRight , ShadowElementBottomRight ,
  ShadowElementBottom , ShadowElementBottomLeft , ShadowElementLeft , ShadowElementTopLeft ,
  ShadowElementsCount
}
 

Public Slots

void geometryChanged ()
 

Signals

void offsetChanged ()
 
void rectChanged ()
 
void textureChanged ()
 

Public Member Functions

 Shadow (Window *window)
 
 ~Shadow () override
 
bool updateShadow ()
 
Windowwindow () const
 
bool hasDecorationShadow () const
 
QImage decorationShadowImage () const
 
std::weak_ptr< KDecoration2::DecorationShadow > decorationShadow () const
 
QSize elementSize (ShadowElements element) const
 
QRectF rect () const
 
QMargins offset () const
 
const QImage & shadowElement (ShadowElements element) const
 

Static Public Member Functions

static std::unique_ptr< ShadowcreateShadow (Window *window)
 

Detailed Description

Class representing a Window's Shadow to be rendered by the Compositor.

This class holds all information about the Shadow to be rendered together with the window during the Compositing stage. The Shadow consists of several pixmaps and offsets. For a complete description please refer to https://community.kde.org/KWin/Shadow

To create a Shadow instance use the static factory method createShadow which will create an instance for the currently used Compositing Backend. It will read the X11 Property and create the Shadow and all required data (such as WindowQuads). If there is no Shadow defined for the Window the factory method returns NULL.

Author
Martin Gräßlin mgrae.nosp@m.ssli.nosp@m.n@kde.nosp@m..org
Todo
React on Window size changes.

Definition at line 47 of file shadow.h.

Member Enumeration Documentation

◆ ShadowElements

Enumerator
ShadowElementTop 
ShadowElementTopRight 
ShadowElementRight 
ShadowElementBottomRight 
ShadowElementBottom 
ShadowElementBottomLeft 
ShadowElementLeft 
ShadowElementTopLeft 
ShadowElementsCount 

Definition at line 90 of file shadow.h.

Constructor & Destructor Documentation

◆ Shadow()

KWin::Shadow::Shadow ( Window * window)
explicit

Definition at line 30 of file shadow.cpp.

◆ ~Shadow()

KWin::Shadow::~Shadow ( )
override

Definition at line 38 of file shadow.cpp.

Member Function Documentation

◆ createShadow()

std::unique_ptr< Shadow > KWin::Shadow::createShadow ( Window * window)
static

Factory Method to create the shadow from the property. This method takes care of creating an instance of the Shadow class for the current Compositing Backend.

If there is no shadow defined for window this method will return NULL.

Parameters
windowThe Window for which the shadow should be created
Returns
Created Shadow or NULL in case there is no shadow defined.

Definition at line 42 of file shadow.cpp.

◆ decorationShadow()

std::weak_ptr< KDecoration2::DecorationShadow > KWin::Shadow::decorationShadow ( ) const
inline

Definition at line 85 of file shadow.h.

◆ decorationShadowImage()

QImage KWin::Shadow::decorationShadowImage ( ) const

Definition at line 323 of file shadow.cpp.

◆ elementSize()

QSize KWin::Shadow::elementSize ( Shadow::ShadowElements element) const

Definition at line 331 of file shadow.cpp.

◆ geometryChanged

void KWin::Shadow::geometryChanged ( )
slot

Definition at line 314 of file shadow.cpp.

◆ hasDecorationShadow()

bool KWin::Shadow::hasDecorationShadow ( ) const
inline

Definition at line 79 of file shadow.h.

◆ offset()

QMargins KWin::Shadow::offset ( ) const
inline

Definition at line 107 of file shadow.h.

◆ offsetChanged

void KWin::Shadow::offsetChanged ( )
signal

◆ rect()

QRectF KWin::Shadow::rect ( ) const
inline

Definition at line 103 of file shadow.h.

◆ rectChanged

void KWin::Shadow::rectChanged ( )
signal

◆ shadowElement()

const QImage & KWin::Shadow::shadowElement ( ShadowElements element) const
inline

Definition at line 111 of file shadow.h.

◆ textureChanged

void KWin::Shadow::textureChanged ( )
signal

◆ updateShadow()

bool KWin::Shadow::updateShadow ( )

This method updates the Shadow when the property has been changed. It is the responsibility of the owner of the Shadow to call this method whenever the owner receives a PropertyNotify event. This method will invoke a re-read of the Property. In case the Property has been withdrawn the method returns false. In that case the owner should delete the Shadow.

Returns
true when the shadow has been updated, false if the property is not set anymore.

Definition at line 265 of file shadow.cpp.

◆ window()

Window * KWin::Shadow::window ( ) const

Definition at line 309 of file shadow.cpp.


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