KWin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
KWin::Xcb::Window Class Reference

#include <xcbutils.h>

Public Member Functions

 Window (xcb_window_t window=XCB_WINDOW_NONE, bool destroy=true)
 
 Window (const QRectF &geometry, uint32_t mask=0, const uint32_t *values=nullptr, xcb_window_t parent=rootWindow())
 
 Window (const QRectF &geometry, uint16_t windowClass, uint32_t mask=0, const uint32_t *values=nullptr, xcb_window_t parent=rootWindow())
 
 Window (const Window &other)=delete
 
 ~Window ()
 
void create (const QRectF &geometry, uint32_t mask=0, const uint32_t *values=nullptr, xcb_window_t parent=rootWindow())
 
void create (const QRectF &geometry, uint16_t windowClass, uint32_t mask=0, const uint32_t *values=nullptr, xcb_window_t parent=rootWindow())
 
void reset (xcb_window_t window=XCB_WINDOW_NONE, bool destroy=true)
 
bool isValid () const
 
const QRectF & geometry () const
 
void setGeometry (const QRectF &geometry)
 
void setGeometry (qreal x, qreal y, qreal width, qreal height)
 
void move (const QPointF &pos)
 
void move (qreal x, qreal y)
 
void resize (const QSizeF &size)
 
void resize (qreal width, qreal height)
 
void raise ()
 
void lower ()
 
void map ()
 
void unmap ()
 
void reparent (xcb_window_t parent, qreal x=0, qreal y=0)
 
void changeProperty (xcb_atom_t property, xcb_atom_t type, uint8_t format, uint32_t length, const void *data, uint8_t mode=XCB_PROP_MODE_REPLACE)
 
void deleteProperty (xcb_atom_t property)
 
void setBorderWidth (uint32_t width)
 
void grabButton (uint8_t pointerMode, uint8_t keyboardmode, uint16_t modifiers=XCB_MOD_MASK_ANY, uint8_t button=XCB_BUTTON_INDEX_ANY, uint16_t eventMask=XCB_EVENT_MASK_BUTTON_PRESS, xcb_window_t confineTo=XCB_WINDOW_NONE, xcb_cursor_t cursor=XCB_CURSOR_NONE, bool ownerEvents=false)
 
void ungrabButton (uint16_t modifiers=XCB_MOD_MASK_ANY, uint8_t button=XCB_BUTTON_INDEX_ANY)
 
void clear ()
 
void setBackgroundPixmap (xcb_pixmap_t pixmap)
 
void defineCursor (xcb_cursor_t cursor)
 
void focus (uint8_t revertTo=XCB_INPUT_FOCUS_POINTER_ROOT, xcb_timestamp_t time=XCB_TIME_CURRENT_TIME)
 
void selectInput (uint32_t events)
 
void kill ()
 
 operator xcb_window_t () const
 

Detailed Description

This class is an RAII wrapper for an xcb_window_t. An xcb_window_t hold by an instance of this class will be freed when the instance gets destroyed.

Furthermore the class provides wrappers around some xcb methods operating on an xcb_window_t.

For the cases that one is more interested in wrapping the xcb methods the constructor which takes an existing window and the reset method allow to disable the RAII functionality.

Definition at line 1556 of file xcbutils.h.

Constructor & Destructor Documentation

◆ Window() [1/4]

Window::Window ( xcb_window_t window = XCB_WINDOW_NONE,
bool destroy = true )
inline

Takes over responsibility of window. If window is not provided an invalid Window is created. Use create to set an xcb_window_t later on.

If destroy is true the window will be destroyed together with this object, if false the window will be kept around. This is useful if you are not interested in the RAII capabilities but still want to use a window like an object.

Parameters
windowThe window to manage.
destroyWhether the window should be destroyed together with the object.
See also
reset

Definition at line 1678 of file xcbutils.h.

◆ Window() [2/4]

Window::Window ( const QRectF & geometry,
uint32_t mask = 0,
const uint32_t * values = nullptr,
xcb_window_t parent = rootWindow() )
inline

Creates an xcb_window_t and manages it. It's a convenient method to create a window with depth, class and visual being copied from parent and border being 0.

Parameters
geometryThe geometry for the window to be created
maskThe mask for the values
valuesThe values to be passed to xcb_create_window
parentThe parent window

Definition at line 1684 of file xcbutils.h.

◆ Window() [3/4]

Window::Window ( const QRectF & geometry,
uint16_t windowClass,
uint32_t mask = 0,
const uint32_t * values = nullptr,
xcb_window_t parent = rootWindow() )
inline

Creates an xcb_window_t and manages it. It's a convenient method to create a window with depth and visual being copied from parent and border being 0.

Parameters
geometryThe geometry for the window to be created
windowClassThe window class
maskThe mask for the values
valuesThe values to be passed to xcb_create_window
parentThe parent window

Definition at line 1690 of file xcbutils.h.

◆ Window() [4/4]

KWin::Xcb::Window::Window ( const Window & other)
delete

◆ ~Window()

Window::~Window ( )
inline

Definition at line 1696 of file xcbutils.h.

Member Function Documentation

◆ changeProperty()

void Window::changeProperty ( xcb_atom_t property,
xcb_atom_t type,
uint8_t format,
uint32_t length,
const void * data,
uint8_t mode = XCB_PROP_MODE_REPLACE )
inline

Definition at line 1829 of file xcbutils.h.

◆ clear()

void Window::clear ( )
inline

Clears the window area. Same as xcb_clear_area with x, y, width, height being 0.

Definition at line 1873 of file xcbutils.h.

◆ create() [1/2]

void Window::create ( const QRectF & geometry,
uint16_t windowClass,
uint32_t mask = 0,
const uint32_t * values = nullptr,
xcb_window_t parent = rootWindow() )
inline

Creates a new window for which the responsibility is taken over. If a window had been managed before it is freed.

Depth and visual are being copied from parent and border is 0.

Parameters
geometryThe geometry for the window to be created
windowClassThe window class
maskThe mask for the values
valuesThe values to be passed to xcb_create_window
parentThe parent window

Definition at line 1720 of file xcbutils.h.

◆ create() [2/2]

void Window::create ( const QRectF & geometry,
uint32_t mask = 0,
const uint32_t * values = nullptr,
xcb_window_t parent = rootWindow() )
inline

Creates a new window for which the responsibility is taken over. If a window had been managed before it is freed.

Depth, class and visual are being copied from parent and border is 0.

Parameters
geometryThe geometry for the window to be created
maskThe mask for the values
valuesThe values to be passed to xcb_create_window
parentThe parent window

Definition at line 1726 of file xcbutils.h.

◆ defineCursor()

void Window::defineCursor ( xcb_cursor_t cursor)
inline

Definition at line 1890 of file xcbutils.h.

◆ deleteProperty()

void Window::deleteProperty ( xcb_atom_t property)
inline

Definition at line 1837 of file xcbutils.h.

◆ focus()

void Window::focus ( uint8_t revertTo = XCB_INPUT_FOCUS_POINTER_ROOT,
xcb_timestamp_t time = XCB_TIME_CURRENT_TIME )
inline

Definition at line 1895 of file xcbutils.h.

◆ geometry()

const QRectF & KWin::Xcb::Window::geometry ( ) const
inline

Definition at line 1628 of file xcbutils.h.

◆ grabButton()

void Window::grabButton ( uint8_t pointerMode,
uint8_t keyboardmode,
uint16_t modifiers = XCB_MOD_MASK_ANY,
uint8_t button = XCB_BUTTON_INDEX_ANY,
uint16_t eventMask = XCB_EVENT_MASK_BUTTON_PRESS,
xcb_window_t confineTo = XCB_WINDOW_NONE,
xcb_cursor_t cursor = XCB_CURSOR_NONE,
bool ownerEvents = false )
inline

Definition at line 1854 of file xcbutils.h.

◆ isValid()

bool Window::isValid ( ) const
inline
Returns
true if a window is managed, false otherwise.

Definition at line 1710 of file xcbutils.h.

◆ kill()

void Window::kill ( )
inline

Definition at line 1905 of file xcbutils.h.

◆ lower()

void Window::lower ( )
inline

Definition at line 1800 of file xcbutils.h.

◆ map()

void Window::map ( )
inline

Definition at line 1805 of file xcbutils.h.

◆ move() [1/2]

void Window::move ( const QPointF & pos)
inline

Definition at line 1764 of file xcbutils.h.

◆ move() [2/2]

void Window::move ( qreal x,
qreal y )
inline

Definition at line 1769 of file xcbutils.h.

◆ operator xcb_window_t()

Window::operator xcb_window_t ( ) const
inline

Definition at line 1715 of file xcbutils.h.

◆ raise()

void Window::raise ( )
inline

Definition at line 1794 of file xcbutils.h.

◆ reparent()

void Window::reparent ( xcb_window_t parent,
qreal x = 0,
qreal y = 0 )
inline

Definition at line 1821 of file xcbutils.h.

◆ reset()

void Window::reset ( xcb_window_t window = XCB_WINDOW_NONE,
bool destroy = true )
inline

Frees the existing window and starts to manage the new window. If destroy is true the new managed window will be destroyed together with this object or when reset is called again. If destroy is false the window will not be destroyed. It is then the responsibility of the caller to destroy the window.

Definition at line 1741 of file xcbutils.h.

◆ resize() [1/2]

void Window::resize ( const QSizeF & size)
inline

Definition at line 1778 of file xcbutils.h.

◆ resize() [2/2]

void Window::resize ( qreal width,
qreal height )
inline

Definition at line 1783 of file xcbutils.h.

◆ selectInput()

void Window::selectInput ( uint32_t events)
inline

Definition at line 1900 of file xcbutils.h.

◆ setBackgroundPixmap()

void Window::setBackgroundPixmap ( xcb_pixmap_t pixmap)
inline

Definition at line 1881 of file xcbutils.h.

◆ setBorderWidth()

void Window::setBorderWidth ( uint32_t width)
inline

Definition at line 1845 of file xcbutils.h.

◆ setGeometry() [1/2]

void Window::setGeometry ( const QRectF & geometry)
inline

Configures the window with a new geometry.

Parameters
geometryThe new window geometry to be used

Definition at line 1748 of file xcbutils.h.

◆ setGeometry() [2/2]

void Window::setGeometry ( qreal x,
qreal y,
qreal width,
qreal height )
inline

Definition at line 1753 of file xcbutils.h.

◆ ungrabButton()

void Window::ungrabButton ( uint16_t modifiers = XCB_MOD_MASK_ANY,
uint8_t button = XCB_BUTTON_INDEX_ANY )
inline

Definition at line 1865 of file xcbutils.h.

◆ unmap()

void Window::unmap ( )
inline

Definition at line 1813 of file xcbutils.h.


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