KWin
Loading...
Searching...
No Matches
Signals | Public Member Functions | Static Public Member Functions | Properties | Friends | List of all members
KWin::Display Class Reference

Class holding the Wayland server display loop. More...

#include <display.h>

Inheritance diagram for KWin::Display:
KWin::FilteredDisplay KWin::KWinDisplay TestDisplay

Signals

void socketNamesChanged ()
 
void runningChanged (bool)
 
void clientConnected (KWin::ClientConnection *)
 
void clientDisconnected (KWin::ClientConnection *)
 

Public Member Functions

 Display (QObject *parent=nullptr)
 
virtual ~Display ()
 
bool addSocketFileDescriptor (int fileDescriptor, const QString &socketName=QString())
 
bool addSocketName (const QString &name=QString())
 
QStringList socketNames () const
 
quint32 serial ()
 
quint32 nextSerial ()
 
bool start ()
 
void dispatchEvents ()
 
ClientConnectioncreateClient (int fd)
 
 operator wl_display * ()
 
 operator wl_display * () const
 
bool isRunning () const
 
void createShm ()
 
QList< SeatInterface * > seats () const
 
QList< OutputDeviceV2Interface * > outputDevices () const
 
QList< OutputInterface * > outputs () const
 
QList< OutputInterface * > outputsIntersecting (const QRect &rect) const
 
OutputInterfacelargestIntersectingOutput (const QRect &rect) const
 
ClientConnectiongetConnection (wl_client *client)
 
QList< ClientConnection * > connections () const
 

Static Public Member Functions

static GraphicsBufferbufferForResource (wl_resource *resource)
 

Properties

bool running
 

Friends

class DisplayPrivate
 

Detailed Description

Class holding the Wayland server display loop.

Todo
Improve documentation

Definition at line 33 of file display.h.

Constructor & Destructor Documentation

◆ Display()

KWin::Display::Display ( QObject * parent = nullptr)
explicit

Definition at line 42 of file display.cpp.

◆ ~Display()

KWin::Display::~Display ( )
virtual

Definition at line 50 of file display.cpp.

Member Function Documentation

◆ addSocketFileDescriptor()

bool KWin::Display::addSocketFileDescriptor ( int fileDescriptor,
const QString & socketName = QString() )

Adds a socket with the given fileDescriptor to the Wayland display. This function returns true if the socket has been added successfully; otherwise returns false.

The compositor can call this function even after the display has been started.

  • socketName can optionally be parsed to store the socket name represented by the given file-descriptor
See also
start()

Definition at line 56 of file display.cpp.

◆ addSocketName()

bool KWin::Display::addSocketName ( const QString & name = QString())

Adds a UNIX socket with the specified name to the Wayland display. This function returns true if the socket has been added successfully; otherwise returns false.

If the specified socket name name is empty, the display will pick a free socket with a filename "wayland-%d".

The compositor can call this function even after the display has been started.

See also
start()

Definition at line 68 of file display.cpp.

◆ bufferForResource()

GraphicsBuffer * KWin::Display::bufferForResource ( wl_resource * resource)
static

Returns the graphics buffer for the given resource, or null if there's no buffer.

Definition at line 239 of file display.cpp.

◆ clientConnected

void KWin::Display::clientConnected ( KWin::ClientConnection * )
signal

◆ clientDisconnected

void KWin::Display::clientDisconnected ( KWin::ClientConnection * )
signal

◆ connections()

QList< ClientConnection * > KWin::Display::connections ( ) const

Definition at line 223 of file display.cpp.

◆ createClient()

ClientConnection * KWin::Display::createClient ( int fd)

Create a client for the given file descriptor.

The client is created as if it connected through the normal server socket. This method can be used to create a connection bypassing the normal socket connection. It's recommended to use together with socketpair and pass the other side of the socket to the client.

Parameters
fdThe file descriptor for the socket to the client
Returns
The new ClientConnection or null on failure.

Definition at line 228 of file display.cpp.

◆ createShm()

void KWin::Display::createShm ( )

Definition at line 128 of file display.cpp.

◆ dispatchEvents()

void KWin::Display::dispatchEvents ( )

Definition at line 116 of file display.cpp.

◆ getConnection()

ClientConnection * KWin::Display::getConnection ( wl_client * client)

Gets the ClientConnection for the given client. If there is no ClientConnection yet for the given client, it will be created.

Parameters
clientThe native client for which the ClientConnection is retrieved
Returns
The ClientConnection for the given native client

Definition at line 200 of file display.cpp.

◆ isRunning()

bool KWin::Display::isRunning ( ) const

Definition at line 144 of file display.cpp.

◆ largestIntersectingOutput()

OutputInterface * KWin::Display::largestIntersectingOutput ( const QRect & rect) const

Definition at line 180 of file display.cpp.

◆ nextSerial()

quint32 KWin::Display::nextSerial ( )

Definition at line 134 of file display.cpp.

◆ operator wl_display *() [1/2]

KWin::Display::operator wl_display * ( )

Definition at line 149 of file display.cpp.

◆ operator wl_display *() [2/2]

KWin::Display::operator wl_display * ( ) const

Definition at line 154 of file display.cpp.

◆ outputDevices()

QList< OutputDeviceV2Interface * > KWin::Display::outputDevices ( ) const

Definition at line 164 of file display.cpp.

◆ outputs()

QList< OutputInterface * > KWin::Display::outputs ( ) const

Definition at line 159 of file display.cpp.

◆ outputsIntersecting()

QList< OutputInterface * > KWin::Display::outputsIntersecting ( const QRect & rect) const

Definition at line 169 of file display.cpp.

◆ runningChanged

void KWin::Display::runningChanged ( bool )
signal

◆ seats()

QList< SeatInterface * > KWin::Display::seats ( ) const
Returns
All SeatInterface currently managed on the Display.

Definition at line 195 of file display.cpp.

◆ serial()

quint32 KWin::Display::serial ( )

Definition at line 139 of file display.cpp.

◆ socketNames()

QStringList KWin::Display::socketNames ( ) const

Returns the list of socket names that the display listens for client connections.

Definition at line 87 of file display.cpp.

◆ socketNamesChanged

void KWin::Display::socketNamesChanged ( )
signal

◆ start()

bool KWin::Display::start ( )

Start accepting client connections. If the display has started successfully, this function returns true; otherwise false is returned.

Definition at line 92 of file display.cpp.

Friends And Related Symbol Documentation

◆ DisplayPrivate

friend class DisplayPrivate
friend

Definition at line 130 of file display.h.

Property Documentation

◆ running

bool KWin::Display::running
read

Definition at line 36 of file display.h.


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