LGI  1.0
Lliurex Graphic Interface
Public Member Functions | Public Attributes | List of all members
net::lliurex::lgi::X11Window Class Reference

#include <x11window.hpp>

Inheritance diagram for net::lliurex::lgi::X11Window:
net::lliurex::lgi::BaseWindow

Public Member Functions

 X11Window (int w, int h, int flags=0)
 
unsigned long GetXWindow ()
 
void Destroy ()
 
void SetTitle (const char *title)
 
void GetEvent ()
 
void DispatchEvents (int mode)
 
void PushEvent (RawEvent *raw_event)
 
RawEventPopEvent ()
 
void ProcessEvent (RawEvent *raw_event)
 
void Flip ()
 
int GetWidth ()
 
int GetHeight ()
 
void SetSize (int width, int height)
 
void AddLayer (Layer *layer)
 
void RemoveLayer (Layer *layer)
 
void ShowLayer (Layer *layer)
 
void HideLayer (Layer *layer)
 
void SetCursor (int type)
 
void SetCursorMode (int mode)
 
void SetCustomCursor (BaseCursor *cursor)
 
void SetDoubleClickTime (int ms)
 
void SendMessage (Layer *layer, Widget *widget, Message *msg)
 
int GetTicks ()
 
virtual ~X11Window ()
 
cairo_t * GetCairo ()
 
void GetScreenSize (int *width, int *height)
 
void FullScreen ()
 
bool GetCollision (int x, int y, Widget **widget, Layer **layer)
 
void SetDndTargets (std::vector< std::string > targets)
 
WidgetGetFocus ()
 
void NextFocus (Layer *layer=nullptr)
 
- Public Member Functions inherited from net::lliurex::lgi::BaseWindow
virtual ~BaseWindow ()
 

Public Attributes

uint8_t * framebuffer
 
cairo_t * cairo
 
cairo_surface_t * cairo_surface
 

Constructor & Destructor Documentation

◆ X11Window()

net::lliurex::lgi::X11Window::X11Window ( int  w,
int  h,
int  flags = 0 
)

Creates the window with specified size and flags

Parameters
wwidth
hheight
flagsAny combination of window flag constants

◆ ~X11Window()

virtual net::lliurex::lgi::X11Window::~X11Window ( )
virtual

Member Function Documentation

◆ AddLayer()

void net::lliurex::lgi::X11Window::AddLayer ( Layer layer)
virtual

◆ Destroy()

void net::lliurex::lgi::X11Window::Destroy ( )
virtual

Destroys the window Trying to draw or process events before destroying the window may crash the application.

Implements net::lliurex::lgi::BaseWindow.

◆ DispatchEvents()

void net::lliurex::lgi::X11Window::DispatchEvents ( int  mode)
virtual

Dispatch events from stack

Parameters
modeDispatch method, valid values are LGI_DISPATCH_EVENTS_FULL and LGI_DISPATCH_EVENTS_WAIT

Implements net::lliurex::lgi::BaseWindow.

◆ Flip()

void net::lliurex::lgi::X11Window::Flip ( )
virtual

Renders current frame and clean the screen Should be call at each iteration

Implements net::lliurex::lgi::BaseWindow.

◆ FullScreen()

void net::lliurex::lgi::X11Window::FullScreen ( )

◆ GetCairo()

cairo_t* net::lliurex::lgi::X11Window::GetCairo ( )

◆ GetCollision()

bool net::lliurex::lgi::X11Window::GetCollision ( int  x,
int  y,
Widget **  widget,
Layer **  layer 
)

◆ GetEvent()

void net::lliurex::lgi::X11Window::GetEvent ( )
virtual

Pulls an event from underlaying event stack and pushes it into lgi stack. Typically, each call pushes one event, but two, three or none it is also possible

Implements net::lliurex::lgi::BaseWindow.

◆ GetFocus()

Widget* net::lliurex::lgi::X11Window::GetFocus ( )
virtual

Get current focused widget or nullptr if none

Implements net::lliurex::lgi::BaseWindow.

◆ GetHeight()

int net::lliurex::lgi::X11Window::GetHeight ( )
virtual

◆ GetScreenSize()

void net::lliurex::lgi::X11Window::GetScreenSize ( int *  width,
int *  height 
)

◆ GetTicks()

int net::lliurex::lgi::X11Window::GetTicks ( )

◆ GetWidth()

int net::lliurex::lgi::X11Window::GetWidth ( )
virtual

◆ GetXWindow()

unsigned long net::lliurex::lgi::X11Window::GetXWindow ( )

Gets X11 Window xid

◆ HideLayer()

void net::lliurex::lgi::X11Window::HideLayer ( Layer layer)
virtual

◆ NextFocus()

void net::lliurex::lgi::X11Window::NextFocus ( Layer layer = nullptr)
virtual

Cycle focus to the next Widget

Parameters
layerCycle focus at given layer

Implements net::lliurex::lgi::BaseWindow.

◆ PopEvent()

RawEvent* net::lliurex::lgi::X11Window::PopEvent ( )
virtual

Pops and event from the stack This method should be thread safe

Implements net::lliurex::lgi::BaseWindow.

◆ ProcessEvent()

void net::lliurex::lgi::X11Window::ProcessEvent ( RawEvent raw_event)
virtual

Process and event, this means, calling those layers and widgets hooks

Implements net::lliurex::lgi::BaseWindow.

◆ PushEvent()

void net::lliurex::lgi::X11Window::PushEvent ( RawEvent raw_event)
virtual

Push an event into the stack

Parameters
raw_eventSource event, will be freed by DispatchEvents This method is thread safe

Implements net::lliurex::lgi::BaseWindow.

◆ RemoveLayer()

void net::lliurex::lgi::X11Window::RemoveLayer ( Layer layer)
virtual

◆ SendMessage()

void net::lliurex::lgi::X11Window::SendMessage ( Layer layer,
Widget widget,
Message msg 
)
virtual

Push a message into event stack

Implements net::lliurex::lgi::BaseWindow.

◆ SetCursor()

void net::lliurex::lgi::X11Window::SetCursor ( int  type)
virtual

◆ SetCursorMode()

void net::lliurex::lgi::X11Window::SetCursorMode ( int  mode)
virtual

◆ SetCustomCursor()

void net::lliurex::lgi::X11Window::SetCustomCursor ( BaseCursor cursor)
virtual

◆ SetDndTargets()

void net::lliurex::lgi::X11Window::SetDndTargets ( std::vector< std::string >  targets)

◆ SetDoubleClickTime()

void net::lliurex::lgi::X11Window::SetDoubleClickTime ( int  ms)
virtual

◆ SetSize()

void net::lliurex::lgi::X11Window::SetSize ( int  width,
int  height 
)
virtual

◆ SetTitle()

void net::lliurex::lgi::X11Window::SetTitle ( const char *  title)
virtual

Sets windows title

Implements net::lliurex::lgi::BaseWindow.

◆ ShowLayer()

void net::lliurex::lgi::X11Window::ShowLayer ( Layer layer)
virtual

Member Data Documentation

◆ cairo

cairo_t* net::lliurex::lgi::X11Window::cairo

◆ cairo_surface

cairo_surface_t* net::lliurex::lgi::X11Window::cairo_surface

◆ framebuffer

uint8_t* net::lliurex::lgi::X11Window::framebuffer

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