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

#include <application.hpp>

Public Member Functions

 Application (std::string name)
 
virtual ~Application ()
 
void AddWindow (BaseWindow *window)
 
void Run (int mode=LGI_DISPATCH_EVENTS_FULL)
 

Static Public Member Functions

static void Set (Application *app)
 
static void Quit ()
 
static ApplicationGet ()
 

Protected Member Functions

virtual void OnMessage (BaseWindow *window, Layer *layer, Widget *widget, MessageEvent *event)
 
virtual int CustomEventsDispatch ()
 

Protected Attributes

std::string name
 
std::vector< BaseWindow * > windows
 
bool quit_request
 

Static Protected Attributes

static Applicationinstance
 

Constructor & Destructor Documentation

net::lliurex::lgi::Application::Application ( std::string  name)

Constructor

Parameters
nameApplication name, ie: com.domain.application
virtual net::lliurex::lgi::Application::~Application ( )
virtual

Destructor

Member Function Documentation

void net::lliurex::lgi::Application::AddWindow ( BaseWindow window)

Adds a window to the event loop

Parameters
windowAdds a window to the event loop
virtual int net::lliurex::lgi::Application::CustomEventsDispatch ( )
protectedvirtual

Dispatch custom events, ex: Gtk This method is call at each loop iteration in order to allow antoher ui toolkits to share the same event loop.

It should return the number of processed events.

static Application* net::lliurex::lgi::Application::Get ( )
static

Gets the application instance, if exists, else it returns nullptr

virtual void net::lliurex::lgi::Application::OnMessage ( BaseWindow window,
Layer layer,
Widget widget,
MessageEvent event 
)
protectedvirtual

Message event hook

Parameters
windowTarget Window
layerTarget Layer, can be nullptr if the message is broadcasted to all layers
widgetTarget Widget, can be nullptr if the message is either broadcasted to all layers or to all layer widgets
eventMessage event
static void net::lliurex::lgi::Application::Quit ( )
static

Exits from the event loop, causes Run to stop

void net::lliurex::lgi::Application::Run ( int  mode = LGI_DISPATCH_EVENTS_FULL)

Run the event loop. This is a blocking method

Parameters
modeDispatch method, valid values are LGI_DISPATCH_EVENTS_FULL and LGI_DISPATCH_EVENTS_WAIT
static void net::lliurex::lgi::Application::Set ( Application app)
static

Sets the Application instance. This method should be call before calling Run

Parameters
appPointer to an application instance

Member Data Documentation

Application* net::lliurex::lgi::Application::instance
staticprotected
std::string net::lliurex::lgi::Application::name
protected
bool net::lliurex::lgi::Application::quit_request
protected
std::vector<BaseWindow *> net::lliurex::lgi::Application::windows
protected

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