Om  1.0.0
A universal framework for multimedia simulation
Public Attributes | List of all members
om::gui::Application::Delegate Class Reference

A class that contains function objects that recieve application events. More...

#include <omGUIApplication.h>

Public Attributes

Function< Bool(Application &application)> start
 A function object that is called whenever an attached application is lauched. More...
 
Function< Bool(Application &application)> stop
 A function object that is called whenever an application receives an external signal to stop running. More...
 
Function< Bool(Application &application, const UTF8String *files, Size numFiles)> openFiles
 A function object that is called whenever files should be opened by an application. More...
 
Function< void(Application &application, Bool focus)> setFocus
 A function object that is called whenever the application gains or loses focus. More...
 
Function< void(Application &application, const input::TextEvent &event)> textEvent
 A function object called whenever the user enters text in the application (usually via keyboard). More...
 
Function< void(Application &application, const input::KeyEvent &event)> keyEvent
 A function object called whenever an attached application receives a keyboard event. More...
 
Function< void(Application &application, const input::MouseMotionEvent &event)> mouseMotionEvent
 A function object called whenever an attached application receives a mouse-motion event. More...
 
Function< void(Application &application, const input::MouseButtonEvent &event)> mouseButtonEvent
 A function object called whenever an attached application receives a mouse-button event. More...
 
Function< void(Application &application, const input::MouseWheelEvent &event)> mouseWheelEvent
 A function object called whenever an attached application receives a mouse-wheel event. More...
 
UserData data
 An object that stores an opaque pointer to delegate data. More...
 

Detailed Description

A class that contains function objects that recieve application events.

Any application-related event that might be processed has an appropriate callback function object. Each callback function is called by the GUI event thread whenever such an event is received. If a callback function in the delegate is not initialized, an application simply ignores it.

It must be noted that the callback functions are asynchronous and not thread-safe. Thus, it is necessary to perform any additional synchronization externally.

Member Data Documentation

Function<Bool ( Application& application )> om::gui::Application::Delegate::start

A function object that is called whenever an attached application is lauched.

This callback serves as the main entry point for the application's non-GUI code. It is called on its own thread and thus the function need not return until the application should close.

The return value indicates whether or not the application should stop the main event thread and exit.

Function<Bool ( Application& application )> om::gui::Application::Delegate::stop

A function object that is called whenever an application receives an external signal to stop running.

The return value indicates whether or not the application should stop the main event thread and exit.

Function<Bool ( Application& application, const UTF8String* files, Size numFiles )> om::gui::Application::Delegate::openFiles

A function object that is called whenever files should be opened by an application.

For instance, this method is invoked whenever files are dragged onto an application's icon, telling it to open the specified files. The method is given an array of strings which represent the paths to the files to be opened. The method should return TRUE if the files were opened successfully or FALSE if they were not.

Function<void ( Application& application, Bool focus )> om::gui::Application::Delegate::setFocus

A function object that is called whenever the application gains or loses focus.

The boolean parameter indicates whether or not the application now has focus. A value of TRUE indicates that the application just gained focus. A value of FALSE indicates that the application just lost focus.

Function<void ( Application& application, const input::TextEvent& event )> om::gui::Application::Delegate::textEvent

A function object called whenever the user enters text in the application (usually via keyboard).

Function<void ( Application& application, const input::KeyEvent& event )> om::gui::Application::Delegate::keyEvent

A function object called whenever an attached application receives a keyboard event.

Function<void ( Application& application, const input::MouseMotionEvent& event )> om::gui::Application::Delegate::mouseMotionEvent

A function object called whenever an attached application receives a mouse-motion event.

Function<void ( Application& application, const input::MouseButtonEvent& event )> om::gui::Application::Delegate::mouseButtonEvent

A function object called whenever an attached application receives a mouse-button event.

Function<void ( Application& application, const input::MouseWheelEvent& event )> om::gui::Application::Delegate::mouseWheelEvent

A function object called whenever an attached application receives a mouse-wheel event.

UserData om::gui::Application::Delegate::data

An object that stores an opaque pointer to delegate data.


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