xbmc
Classes | Public Member Functions | List of all members
KODI::WINDOWING::WAYLAND::CWindowDecorator Class Referencefinal

Paint decorations around windows with subcompositing. More...

#include <WindowDecorator.h>

Inheritance diagram for KODI::WINDOWING::WAYLAND::CWindowDecorator:
Inheritance graph
[legend]
Collaboration diagram for KODI::WINDOWING::WAYLAND::CWindowDecorator:
Collaboration graph
[legend]

Classes

struct  Buffer
 
struct  Surface
 

Public Member Functions

 CWindowDecorator (IWindowDecorationHandler &handler, CConnection &connection, wayland::surface_t const &mainSurface)
 Construct window decorator. More...
 
void SetState (CSizeInt size, int scale, IShellSurface::StateBitset state)
 Set decoration state and size by providing full surface size including decorations. More...
 
CSizeInt GetMainSurfaceSize () const
 Get calculated size of main surface.
 
CRectInt GetWindowGeometry () const
 Get full geometry of the window, including decorations if active.
 
CSizeInt CalculateMainSurfaceSize (CSizeInt size, IShellSurface::StateBitset state) const
 Calculate size of main surface given the size of the full area including decorations and a state.
 
CSizeInt CalculateFullSurfaceSize (CSizeInt mainSurfaceSize, IShellSurface::StateBitset state) const
 Calculate size of full surface including decorations given the size of the main surface and a state.
 
bool IsDecorationActive () const
 
void AddSeat (CSeat *seat)
 
void RemoveSeat (CSeat *seat)
 

Detailed Description

Paint decorations around windows with subcompositing.

With Wayland, applications are responsible for drawing borders on their windows themselves (client-side decorations). To keep the impact on the overall architecture low, the Wayland platform implementation uses this very simple renderer to build ugly but fully functional decorations around the Kodi window. Since Kodi as a media center is usually not used in windowed mode anyway (except maybe for development), the impact of the visually not-so-pleasing decorations should be limited. Nice decorations would require more effort and external libraries for proper 2D drawing.

If more platforms decide that client-side decorations would be a good idea to implement, the decorations could also be integrated with the Kodi skin system. Then this class could be removed.

The decorations are positioned around the main surface automatically.

Constructor & Destructor Documentation

◆ CWindowDecorator()

CWindowDecorator::CWindowDecorator ( IWindowDecorationHandler handler,
CConnection connection,
wayland::surface_t const &  mainSurface 
)

Construct window decorator.

Parameters
handlerhandler for window decoration events
connectionconnection to get Wayland globals
mainSurfacemain surface that decorations are constructed around
windowSizefull size of the window including decorations
scalescale to use for buffers
statesurface state for adjusting decoration appearance

Member Function Documentation

◆ SetState()

void CWindowDecorator::SetState ( CSizeInt  size,
int  scale,
IShellSurface::StateBitset  state 
)

Set decoration state and size by providing full surface size including decorations.

Calculates size of the main surface from size of all surfaces combined (including window decorations) by subtracting the decoration size

Decorations will be disabled if state includes STATE_FULLSCREEN

Call only from main thread


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