Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
X11Screen Class Reference

Screen in an X11 window. More...

Inheritance diagram for X11Screen:
Inheritance graph

Public Member Functions

 X11Screen ()=delete
 X11Screen (Application &app, const Size &size=Size(800, 480), const std::string &name={}, bool borderless=false)
 X11Screen (const X11Screen &)=delete
 X11Screen (X11Screen &&)=delete
 ~X11Screen () noexcept override
void disable_window_decorations ()
 Disable window decorations. More...
void flip (const DamageArray &damage) override
 Perform a flip of the buffers. More...
X11Screenoperator= (const X11Screen &)=delete
X11Screenoperator= (X11Screen &&)=delete
void schedule_flip () override
 Schedule a flip to occur later. More...
- Public Member Functions inherited from Screen
 Screen () noexcept
 Screen (const Screen &)=default
 Screen (Screen &&) noexcept=default
virtual ~Screen () noexcept=default
void async_flip (bool async)
 Set if asynchronous buffer flips are used. More...
EGT_NODISCARD Rect box () const
 Bounding box for the screen. More...
virtual EGT_NODISCARD size_t brightness () const
 Get the current brightness of the screen. More...
virtual void brightness (size_t brightness)
 Set the brightness of the screen. More...
EGT_NODISCARD shared_cairo_t context () const
 Get the context for the screen. More...
EGT_NODISCARD PixelFormat format () const
 Get the format of the screen. More...
virtual EGT_NODISCARD bool have_planes () const
 Returns true if the screen supports planes. More...
virtual void high_fidelity ()
 Configure high fidelity options. More...
virtual uint32_t index ()
 If the screen implementation manages multiple buffers, this will return the index of the current buffer. More...
virtual EGT_NODISCARD bool is_composer () const
 Returns true if this is a screen used with the Microchip Graphic Composer. More...
virtual void low_fidelity ()
 Configure low fidelity options. More...
virtual EGT_NODISCARD size_t max_brightness () const
 Get the max brightness of the screen. More...
Screenoperator= (const Screen &)=default
Screenoperator= (Screen &&) noexcept=default
EGT_NODISCARD Size size () const
 Size of the screen. More...

Protected Member Functions

void copy_to_buffer (ScreenBuffer &buffer) override
 Copy the framebuffer to the current composition buffer. More...
void handle_read (const asio::error_code &error)
 Callback for X11 server data. More...
- Protected Member Functions inherited from Screen
void copy_to_buffer_software (ScreenBuffer &buffer)
 Copy the framebuffer to the current composition buffer. More...
void init (const Size &size, PixelFormat format=PixelFormat::argb8888)
void init (void **ptr, uint32_t count, const Size &size, PixelFormat format=PixelFormat::argb8888)

Protected Attributes

 Application reference. More...
X11Input m_in
 Custom input for dispatching events. More...
asio::posix::stream_descriptor m_input
 Input stream for handling X11 server events. More...
- Protected Attributes inherited from Screen
bool m_async {false}
 Perform flips asynchronously if supported. More...
BufferArray m_buffers
 Screen buffer array. More...
shared_cairo_t m_cr
 Composition surface context. More...
PixelFormat m_format {}
 Format of the screen. More...
Size m_size
 Size of the screen. More...
shared_cairo_surface_t m_surface
 Composition surface. More...

Additional Inherited Members

- Public Types inherited from Screen
using DamageArray = std::vector< Rect >
 Type used for damage arrays. More...
- Static Public Member Functions inherited from Screen
static void damage_algorithm (Screen::DamageArray &damage, Rect rect)
 This function implements the algorithm for adding damage rectangles to a list. More...
- Protected Types inherited from Screen
using BufferArray = std::vector< ScreenBuffer >
 Type used for an array of ScreenBuffer objects. More...

Detailed Description

Screen in an X11 window.

Constructor & Destructor Documentation

◆ X11Screen() [1/4]

X11Screen ( )

◆ X11Screen() [2/4]

X11Screen ( Application app,
const Size size = Size(800, 480),
const std::string &  name = {},
bool  borderless = false 
appApplication instance this screen is associated with.
sizeSize of the screen.
borderlessCreate the X11 window without a border.

◆ X11Screen() [3/4]

X11Screen ( const X11Screen )

◆ X11Screen() [4/4]

X11Screen ( X11Screen &&  )

◆ ~X11Screen()

~X11Screen ( )

Member Function Documentation

◆ copy_to_buffer()

void copy_to_buffer ( ScreenBuffer &  buffer)

Copy the framebuffer to the current composition buffer.

Reimplemented from Screen.

◆ disable_window_decorations()

void disable_window_decorations ( )

Disable window decorations.

◆ flip()

void flip ( const DamageArray damage)

Perform a flip of the buffers.

This iterates the buffers and puts the composition buffer into the screen buffers.

This will call schedule_flip() automatically.

Reimplemented from Screen.

◆ handle_read()

void handle_read ( const asio::error_code &  error)

Callback for X11 server data.

◆ operator=() [1/2]

X11Screen& operator= ( const X11Screen )

◆ operator=() [2/2]

X11Screen& operator= ( X11Screen &&  )

◆ schedule_flip()

void schedule_flip ( )

Schedule a flip to occur later.

This is needed if a flip should occur sometime in the future to the hardware.

Implements Screen.

Member Data Documentation

◆ m_app

Application& m_app

Application reference.

◆ m_in

X11Input m_in

Custom input for dispatching events.

◆ m_input

asio::posix::stream_descriptor m_input

Input stream for handling X11 server events.