KWin
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KWin::Session Class Referenceabstract

#include <session.h>

Inheritance diagram for KWin::Session:
KWin::ConsoleKitSession KWin::LogindSession KWin::NoopSession

Public Types

enum class  Type { Noop , ConsoleKit , Logind }
 
enum class  Capability : uint { SwitchTerminal = 0x1 }
 

Signals

void awoke ()
 
void activeChanged (bool active)
 
void deviceResumed (dev_t deviceId)
 
void devicePaused (dev_t deviceId)
 

Public Member Functions

virtual bool isActive () const =0
 
virtual Capabilities capabilities () const =0
 
virtual QString seat () const =0
 
virtual uint terminal () const =0
 
virtual int openRestricted (const QString &fileName)=0
 
virtual void closeRestricted (int fileDescriptor)=0
 
virtual void switchTo (uint terminal)=0
 

Static Public Member Functions

static std::unique_ptr< Sessioncreate ()
 
static std::unique_ptr< Sessioncreate (Type type)
 

Protected Member Functions

 Session ()=default
 

Detailed Description

The Session class represents the session controlled by the compositor.

The Session class provides information about the virtual terminal where the compositor is running and a way to open files that require special privileges, e.g. DRM devices or input devices.

Definition at line 27 of file session.h.

Member Enumeration Documentation

◆ Capability

enum class KWin::Session::Capability : uint
strong

This enum type is used to specify optional capabilities of the session.

Enumerator
SwitchTerminal 

Definition at line 44 of file session.h.

◆ Type

enum class KWin::Session::Type
strong

This enum type is used to specify the type of the session.

Enumerator
Noop 
ConsoleKit 
Logind 

Definition at line 35 of file session.h.

Constructor & Destructor Documentation

◆ Session()

KWin::Session::Session ( )
explicitprotecteddefault

Member Function Documentation

◆ activeChanged

void KWin::Session::activeChanged ( bool active)
signal

This signal is emitted when the active state of the session has changed.

◆ awoke

void KWin::Session::awoke ( )
signal

This signal is emitted when the session is resuming from suspend.

◆ capabilities()

virtual Capabilities KWin::Session::capabilities ( ) const
pure virtual

Returns the capabilities supported by the session.

Implemented in KWin::ConsoleKitSession, KWin::LogindSession, and KWin::NoopSession.

◆ closeRestricted()

virtual void KWin::Session::closeRestricted ( int fileDescriptor)
pure virtual

Closes a file that has been opened using the openRestricted() function.

Implemented in KWin::ConsoleKitSession, KWin::LogindSession, and KWin::NoopSession.

◆ create() [1/2]

std::unique_ptr< Session > KWin::Session::create ( )
static

Definition at line 25 of file session.cpp.

◆ create() [2/2]

std::unique_ptr< Session > KWin::Session::create ( Type type)
static

Definition at line 36 of file session.cpp.

◆ devicePaused

void KWin::Session::devicePaused ( dev_t deviceId)
signal

This signal is emitted when the given device cannot be used by the compositor anymore. For example, this normally occurs when switching between VTs.

Note that when this signal is emitted for a DRM device, master permissions can be already revoked.

◆ deviceResumed

void KWin::Session::deviceResumed ( dev_t deviceId)
signal

This signal is emitted when the specified device can be used again.

◆ isActive()

virtual bool KWin::Session::isActive ( ) const
pure virtual

Returns true if the session is active; otherwise returns false.

Implemented in KWin::ConsoleKitSession, KWin::LogindSession, and KWin::NoopSession.

◆ openRestricted()

virtual int KWin::Session::openRestricted ( const QString & fileName)
pure virtual

Opens the file with the specified fileName. Returns the file descriptor of the file or -1 if an error has occurred.

Implemented in KWin::ConsoleKitSession, KWin::LogindSession, and KWin::NoopSession.

◆ seat()

virtual QString KWin::Session::seat ( ) const
pure virtual

Returns the seat name for the Session.

Implemented in KWin::ConsoleKitSession, KWin::LogindSession, and KWin::NoopSession.

◆ switchTo()

virtual void KWin::Session::switchTo ( uint terminal)
pure virtual

Switches to the specified virtual terminal. This function does nothing if the Capability::SwitchTerminal capability is unsupported.

Implemented in KWin::ConsoleKitSession, KWin::LogindSession, and KWin::NoopSession.

◆ terminal()

virtual uint KWin::Session::terminal ( ) const
pure virtual

Returns the terminal controlled by the Session.

Implemented in KWin::ConsoleKitSession, KWin::LogindSession, and KWin::NoopSession.


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