Base class for writing new applications. More...
#include <MultiWidgets/Application.hpp>
Public Types | |
| enum | VersionType { FULL, VERSION_ONLY, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_GIT_HASH } |
| Version string type. More... | |
Public Types inherited from Valuable::Node | |
| typedef container::const_iterator | const_iterator |
|
typedef Radiant::ArrayMap < QByteArray, Attribute * > | container |
| Container for attributes, key is the attribute name. | |
| typedef container::iterator | iterator |
| Iterator for the container. | |
| typedef std::function< void(Radiant::BinaryData &)> | ListenerFuncBd |
| Listener function type that takes a BinaryData reference as a parameter, similar to eventProcess. | |
| typedef std::function< void()> | ListenerFuncVoid |
| Default listener function type. | |
| enum | ListenerType { DIRECT =1, AFTER_UPDATE =2, AFTER_UPDATE_ONCE =4 } |
| Types of event listeners. More... | |
| typedef int64_t | Uuid |
| Unique identifier type. | |
Public Types inherited from Valuable::Attribute | |
| enum | Layer { DEFAULT = 0, STYLE, USER, STYLE_IMPORTANT, LAYER_COUNT, LAYER_CURRENT } |
| Attribute has multiple independent attribute values on LAYER_COUNT different layers. More... | |
| typedef std::function< void()> | ListenerFunc |
| Callback function type in the listener API. | |
| enum | ListenerRole { DELETE_ROLE = 1 << 0, CHANGE_ROLE = 1 << 1, ALL_ROLES = (CHANGE_ROLE << 1) -1 } |
| Different listener roles, used when adding a new listener. | |
| enum | ValueUnit { VU_UNKNOWN, VU_PXS, VU_PERCENTAGE, VU_EMS, VU_EXS } |
| Units of a value. More... | |
Valuable Attributes | |
| QString | audio-config = QString () |
| Path to the audio configuration file. More... | |
| QString | audio-devices = QString () |
| Path to the audio devices file which is fed to Resonant::AudioLoop::setDevicesFile. More... | |
| QString | background = "" |
| If set the background for the whole application is loaded from this path. More... | |
| QString | config = "" |
| Input configuration file loaded in the initialization of application. More... | |
| QString | console = "" |
| If set, opens javascript-terminal accessed by telnet to the designated location. More... | |
| QStringList | css = QStringList () |
| Paths to CSS files to be used for the application. More... | |
| bool | dev = true |
| Is the application using developer mode? In non-developer mode the only keyboard shortcuts are Ctrl+Q for exiting the application, Ctrl+M for minimizing all application windows and Ctrl+F12 for toggling this developer mode. More... | |
| bool | dummy = false |
| If enabled the application does not try to use real touchscreen. More... | |
| bool | enable-site-manager = false |
| Is the application MultiTaction Site Manager enabled?. More... | |
| QString | fonts-dir = "" |
| If value provided, loads every otf- and ttf- file inside the given directory. More... | |
| float | fps = std::numeric_limits<float>::quiet_NaN() |
| If using ImageMovieWidget as background this is the fps used in that. More... | |
| int | input-timeout = 15 |
| How many milliseconds the updates of the touchscreen is waited. More... | |
| QString | license = "" |
| Path to the license file. More... | |
| bool | minimize = false |
| Is the application minimized? More... | |
| int | minimum-update-frequency = 4 |
| This attribute acts as a minimum frame rate of the application. More... | |
| float | rotation = 0.F |
| Rotation for the root of the whole widget hierarchy. More... | |
| float | scale = 1.F |
| Scale for the root of the whole widget hierarchy. More... | |
| QString | screen = "" |
| Name of the screen configuration file loaded in initialization. More... | |
| bool | simultaneous-virtual -input = false |
| Whether the virtual input is allowed to be fed simultaneously with the real input to the application. More... | |
| QString | trace-file = QString () |
| All of the output of Radiant is directed to the file defined by this path. More... | |
| Nimble::Vector2f | translation = Nimble::Vector2(0.F, 0.F) |
| Location for the root of the whole widget hierarchy. More... | |
| int | update-frequency = 59 |
| This attribute controls the frame rate of the application. More... | |
| bool | verbose = false |
| If enabled the application will be more verbose. More... | |
| QString | verbose-modules = QString () |
| List of verbose modules separated with comma (,). More... | |
| bool | with-input-visualizer = false |
| If enabled MultiWidgets::InputVisualizerWidget is created to overlay layer. More... | |
| bool | with-ripple = false |
| If enabled the application has ripple-effect as its overlay. More... | |
Valuable Attributes inherited from Valuable::Node | |
| Node::Uuid | id = generateId() |
| Returns the unique id. More... | |
Node Events | |
| [OUT] | after-update |
| Sent from main thread after the widgets has been updated and AFTER_UPDATE-callbacks are called. | |
| [OUT] | before-input (int32_t begin, int32_t end) |
| Sent from main thread before samples at interval [begin, end] (inclusively) are handled. | |
| [OUT] | before-sample-input (int32_t frame, float dt) |
| Sent from main thread before single sample is processed. dt is the absolute time from the previous sample. | |
| [OUT] | before-update |
| Sent from main thread after input is handled before updating widgets. | |
| [IN] | css-changed |
| Makes the application to reload its style by reading its stylesheet files. | |
| [OUT] | frame |
| Sent from main thread in the beginning of each frame (before input-update-render -loop is started). | |
| [IN] | gfx-driver-init |
| Initializes the graphics subsystem related to the application. | |
| [OUT] | gfx-driver-inited |
| Sent from main thread after the graphics subsystem is initialized. | |
| [IN] | gfx-driver-stop |
| Shuts down the graphics subsystem related to the application. | |
| [OUT] | gfx-driver-stopped |
| Sent from main thread after the graphics subsystem is shut down. | |
| [OUT] | initialized |
| Sent from main thread after the application is succesfully initialized. | |
| [IN] | reload-signal-handlers |
| Called if someone messes with breakpad signal handlers and they need to be reapplied. | |
| [OUT] | render-complete (Luminous::RenderContext *r, int32_t w) |
| Sent after window w in render context r is rendered. | |
| [OUT] | shutdown |
| Called from main thread when the application is about to be destructed (in the beginning of destructor). | |
Public Member Functions | |
| int | addFont (const QString &filename) |
| Loads the specified font and makes it available to the application. More... | |
| template<class Filter > | |
| void | addPostProcessFilter () |
| Adds a post process filter to the rendering pipeline. More... | |
| void | addPostProcessFilter (std::shared_ptr< Luminous::PostProcessFilter > filter) |
| Adds a post process filter to the rendering pipeline. More... | |
| void | addStyleFilename (const QString &filename) |
| Adds new CSS file to application. More... | |
| Application () | |
| Creates an application object. | |
| const QStringList & | arguments () const |
| Returns the list of extra command line arguments that weren't processed by command line parser. More... | |
| const QString & | audioConfig () const |
| Path to the audio configuration file. More... | |
| const QString & | audioDevices () const |
| Path to the audio devices file which is fed to Resonant::AudioLoop::setDevicesFile. More... | |
| const QString & | background () const |
| If set the background for the whole application is loaded from this path. More... | |
| float | backgroundFps () const |
| If using ImageMovieWidget as background this is the fps used in that. More... | |
| const MultiWidgets::WidgetPtr & | backgroundLayer () |
| Get the background layer widget. More... | |
| const MultiWidgets::WidgetPtr & | base () |
| The base widget for the application. More... | |
| virtual bool | dropEvent (const Radiant::DropEvent &event) |
| Used to handle drop events. More... | |
| std::shared_ptr < Resonant::DSPNetwork > | dspNetwork () |
| Get a pointer to the DSP network used by the application. More... | |
|
const std::shared_ptr < Resonant::DSPNetwork > | dspNetwork () const |
| void | enableInputVisualization (bool enable) |
| Setter for attribute with-input-visualizer. More... | |
| void | enableRipple (bool enable) |
| Setter for attribute with-ripple. More... | |
| virtual void | eventProcess (const QByteArray &type, Radiant::BinaryData &data) |
| An entry point for processing a message to the Application. More... | |
| QStringList | fontFamilies (int fontId) |
| Get a list of font families for the specified font. More... | |
| const QString & | fontsDir () const |
| If value provided, loads every otf- and ttf- file inside the given directory. More... | |
| const MultiWidgets::FrameInfo & | frameInfo () const |
| FrameInfo in the current frame. | |
| int | framesPerSecond () const |
| This attribute controls the frame rate of the application. More... | |
| const QString & | getCSSMedia () const |
| Returns the CSS media (file contents). More... | |
| std::unique_ptr< GfxDriver > & | gfxDriver () |
| Get the graphics driver used to by the application. More... | |
| GrabManager & | grabManager () |
| Gets the grab manager used by this application. More... | |
| const GrabManager & | grabManager () const |
| virtual void | handleWindowCloseEvent () |
| virtual void | handleWindowIconifyEvent () |
| Handle the event where a window is iconified If the function is overridden, the default implementation should also be called. More... | |
| virtual void | handleWindowRestoreEvent () |
| Handle the case where a window is restored If the function is overridden, the default implementation should also be called. More... | |
| virtual bool | init (int &argc, char **argv, std::unique_ptr< MultiWidgets::GfxDriver > gfxDriver=std::unique_ptr< MultiWidgets::GfxDriver >(), bool qtGui=false) |
| Initialize the application object, and set up the touch-screen interface and graphics environment. More... | |
| virtual bool | initGfxContext (Luminous::RenderContext &context) |
| Initialize a render context. More... | |
| const QString & | initialInputConfig () const |
| Input configuration file loaded in the initialization of application. More... | |
| Radiant::Config & | inputConfig () |
| Returns the input configuration in the form of a Radiant::Config object. More... | |
| QString & | inputConfigFilename () |
| Returns the name of the tracking configuration file used by the application. More... | |
| int | inputTimeout () const |
| How many milliseconds the updates of the touchscreen is waited. More... | |
| bool | isDeveloperMode () const |
| Is the application using developer mode? In non-developer mode the only keyboard shortcuts are Ctrl+Q for exiting the application, Ctrl+M for minimizing all application windows and Ctrl+F12 for toggling this developer mode. More... | |
| bool | isDummyTrackerInUse () const |
| If enabled the application does not try to use real touchscreen. More... | |
| bool | isInputVisualized () const |
| If enabled MultiWidgets::InputVisualizerWidget is created to overlay layer. More... | |
| bool | isMinimized () const |
| Is the application minimized? More... | |
| bool | isRippleEnabled () const |
| If enabled the application has ripple-effect as its overlay. More... | |
| bool | isSimultaneousVirtualInputEnabled () const |
| Whether the virtual input is allowed to be fed simultaneously with the real input to the application. More... | |
| bool | isSiteManagerEnabled () const |
| Is the application MultiTaction Site Manager enabled?. More... | |
| bool | isVerbose () const |
| If enabled the application will be more verbose. More... | |
| const QString & | jsConsoleConfig () const |
| If set, opens javascript-terminal accessed by telnet to the designated location. More... | |
| Scripting::JSContext & | jsContext () |
| Returns the Javascript context object. | |
| virtual bool | keyPressEvent (const Radiant::KeyEvent &event) |
| Used to handle key-press events. More... | |
| virtual bool | keyReleaseEvent (const Radiant::KeyEvent &event) |
| Used to handle key-release events. More... | |
| const QString & | licenseFile () const |
| Path to the license file. More... | |
| Nimble::Vector2f | location () const |
| Location for the root of the whole widget hierarchy. More... | |
| const MultiWidgets::WidgetPtr & | mainLayer () |
| Get the main layer widget. More... | |
| int | minFramesPerSecond () const |
| This attribute acts as a minimum frame rate of the application. More... | |
| void | minimize () |
| Minimize the application. More... | |
| virtual bool | mouseMoveEvent (const Radiant::MouseEvent &event) |
| Used to handle mouse move events. More... | |
| virtual bool | mousePressEvent (const Radiant::MouseEvent &event) |
| Used to handle mouse button press events. More... | |
| virtual bool | mouseReleaseEvent (const Radiant::MouseEvent &event) |
| Used to handle mouse button release events. More... | |
| virtual bool | mouseWheelEvent (const Radiant::MouseEvent &event) |
| Used to handle mouse wheel events. More... | |
| const MultiWidgets::WidgetPtr & | overlayLayer () |
| Get the overlay layer widget. More... | |
| PerformanceData & | performanceData () |
| Get the performance counter of the application. More... | |
| const PerformanceData & | performanceData () const |
| void | processEvents () |
| Processes pending events for the application sent by OS. More... | |
| void | reloadInputConfiguration () |
| Request the application to reload the input configuration. | |
| bool | removeFont (int fontId) |
| Removes the previously loaded font from the application. More... | |
| void | removeStyleFilename (const QString &filename) |
| Remove one CSS file from the application. More... | |
| virtual void | render (Luminous::RenderContext &r, const Nimble::Rectf &bounds, int index=0) |
| Renders the application, using the given RenderContext object. More... | |
| virtual void | renderComplete (Luminous::RenderContext &r, const Luminous::MultiHead::Window &window) |
| This function gets called by each rendering thread after all rendering is done for one frame. More... | |
| void | restore () |
| Restore the application. More... | |
| float | rotation () const |
| Rotation for the root of the whole widget hierarchy. More... | |
| virtual int | run () |
| Runs the application. More... | |
| bool | saveInputConfigToFile () |
| Saves the current input configuration to the current inputConfigFilename. More... | |
| bool | saveScreenConfigToFile () |
| Saves the current screen configuration to the current screenConfigFilename. More... | |
| float | scale () const |
| Scale for the root of the whole widget hierarchy. More... | |
| const QString & | screenConfigFilename () const |
| Name of the screen configuration file loaded in initialization. More... | |
| void | setArguments (const QStringList &arguments) |
| Set the command line arguments for the application. More... | |
| void | setAudioConfig (const QString &conf) |
| Setter for attribute audio-config. More... | |
| void | setAudioDevices (const QString &conf) |
| Setter for attribute audio-devices. More... | |
| void | setBackground (const QString &bg) |
| Setter for attribute background. More... | |
| void | setBackgroundFps (float fps) |
| Setter for attribute fps. More... | |
| void | setCSSMedia (const QString &media) |
| Sets the CSS media (CSS file contents) More... | |
| void | setDeveloperMode (bool developerMode) |
| Setter for attribute dev. More... | |
| void | setFontsDir (const QString &fontsDir) |
| Setter for attribute fonts-dir. More... | |
| void | setFramesPerSecond (int fps) |
| Setter for attribute update-frequency. More... | |
| void | setInputTimeout (int timeout) |
| Setter for attribute input-timeout. More... | |
| void | setIsSiteManagerEnabled (bool enabled) |
| Setter for attribute enable-site-manager. More... | |
| void | setJsConsoleConfig (const QString &conf) |
| Setter for attribute console. More... | |
| void | setLicenseFile (const QString &licenseFile) |
| Setter for attribute license. More... | |
| void | setLocation (const Nimble::Vector2f &loc) |
| Setter for attribute translation. More... | |
| void | setMinFramesPerSecond (int minFps) |
| Setter for attribute minimum-update-frequency. More... | |
| void | setMinimized (bool isMinimized) |
| Setter for attribute minimize. More... | |
| void | setRotation (float rotation) |
| Setter for attribute rotation. More... | |
| void | setScale (float scale) |
| Setter for attribute scale. More... | |
| void | setSimultaneousVirtualInputEnabled (bool enable) |
| Setter for attribute simultaneous-virtual-input. More... | |
| void | setStyleFilenames (const QStringList &filenames) |
| Setter for attribute CSS. More... | |
| void | setTraceFile (const QString &traceFile) |
| Setter for attribute trace-file. More... | |
| void | setVerbose (bool enable) |
| Setter for attribute verbose. More... | |
| void | setVerboseModules (const QString &modules) |
| Setter for attribute verbose-modules. More... | |
| std::shared_ptr < Stylish::StyleSheet > | style () const |
| Returns the current style sheet object. More... | |
| const QStringList & | styleFilenames () const |
| Paths to CSS files to be used for the application. More... | |
| virtual bool | tabletMoveEvent (const Radiant::TabletEvent &event) |
| Used to handle tablet move events. More... | |
| virtual bool | tabletPressEvent (const Radiant::TabletEvent &event) |
| Used to handle tablet press events. More... | |
| virtual bool | tabletReleaseEvent (const Radiant::TabletEvent &event) |
| Used to handle tablet release events. More... | |
| virtual bool | touchEvent (const Radiant::TouchEvent &event) |
| Used to handle window system touch events. More... | |
| MultiTouch::Screen & | touchScreen () |
| Get the multi-touch tracker API object. More... | |
| const MultiTouch::Screen & | touchScreen () const |
| const QString & | traceFile () const |
| All of the output of Radiant is directed to the file defined by this path. More... | |
| void | updateCmdArguments () |
| Reload any unused command line arguments. | |
| const QString & | verboseModules () const |
| List of verbose modules separated with comma (,). More... | |
| virtual | ~Application () |
| Deletes the application object. | |
Public Member Functions inherited from Valuable::Node | |
| bool | acceptsEvent (const QByteArray &messageId) const |
| Returns true if this object accepts event 'id' in eventProcess. | |
| bool | addAttribute (Attribute *const attribute) |
| Adds a new Attribute to the list of attribute objects. More... | |
| bool | addAttribute (const QByteArray &name, Attribute *const attribute) |
| Adds a new Attribute to the list of attribute objects. | |
| template<typename Widget > | |
| bool | addAttribute (const QByteArray &name, const Radiant::IntrusivePtr< Widget > &attribute) |
| Adds a new Attribute to the list of attribute objects. More... | |
| long | addListener (const QByteArray &attribute, v8::Persistent< v8::Function > func, int role=Attribute::CHANGE_ROLE) |
| Add a JavaScript attribute listener to attribute belonging this Node. More... | |
| virtual Attribute * | attribute (const QByteArray &name) const |
| Gets an Attribute with the given name. More... | |
| template<typename T > | |
| AttributeT< T > * | attribute (const QByteArray &name) const |
| Gets an Attribute with the given name. More... | |
| const container & | attributes () const |
| void | clearValues (Layer layer) |
| Clears all Attribute values of the given layer. More... | |
| void | debugDump () |
| Prints the contents of this Attribute to the terminal. | |
| virtual bool | deserialize (const ArchiveElement &element) |
| De-serializes this object (and its children) from a DOM node. | |
| void | eventAddDeprecated (const QByteArray &deprecatedId, const QByteArray &newId) |
| Register a deprecated event that is automatically converted to new event id and a warning is issued when it is used. More... | |
| void | eventAddIn (const QByteArray &messageId) |
| Registers a new event that this class handles in eventProcess. | |
| template<typename Widget > | |
| long | eventAddListener (const QByteArray &eventId, const QByteArray &messageId, Radiant::IntrusivePtr< Widget > &listener, ListenerType listenerType=DIRECT, const Radiant::BinaryData *defaultData=0) |
| Add an event listener to this object. More... | |
| long | eventAddListener (const QByteArray &eventId, const QByteArray &messageId, Valuable::Node *listener, ListenerType listenerType=DIRECT, const Radiant::BinaryData *defaultData=0) |
| Add an event listener to this object. More... | |
| long | eventAddListener (const QByteArray &eventId, ListenerFuncVoid func, ListenerType listenerType=DIRECT) |
| Add an event listener to this object. More... | |
| long | eventAddListener (const QByteArray &eventId, Node *dstNode, ListenerFuncVoid func, ListenerType listenerType=DIRECT) |
| long | eventAddListenerBd (const QByteArray &eventId, Node *dstNode, ListenerFuncBd func, ListenerType listenerType=DIRECT) |
| long | eventAddListenerBd (const QByteArray &eventId, ListenerFuncBd func, ListenerType listenerType=DIRECT) |
| Add an event listener to this object. More... | |
| void | eventAddOut (const QByteArray &eventId) |
| Registers a new event this class can send with eventSend. | |
| const QSet< QByteArray > & | eventInNames () const |
| Returns set of all registered IN events. | |
| unsigned | eventListenerCount () const |
| Returns the number of event listeners. | |
| const QSet< QByteArray > & | eventOutNames () const |
| Returns set of all registered OUT events. | |
| void | eventPassingEnable (bool enable) |
| Control whether events are passed. | |
| template<typename Widget > | |
| int | eventRemoveListener (Radiant::IntrusivePtr< Widget > &listener) |
| Removes all events from this object to given listener. More... | |
| template<typename Widget > | |
| int | eventRemoveListener (const QByteArray &eventId=QByteArray(), const QByteArray &messageId=QByteArray(), Radiant::IntrusivePtr< Widget > &listener=Radiant::IntrusivePtr< Widget >()) |
| Removes events from this object that match the parameters. More... | |
| int | eventRemoveListener (const QByteArray &eventId=QByteArray(), const QByteArray &messageId=QByteArray(), Valuable::Node *listener=0) |
| Removes event listeners from this object. More... | |
| int | eventRemoveListener (Valuable::Node *listener) |
| Removes all events from this object to given listener. More... | |
| bool | eventRemoveListener (long listenerId) |
| Removes event listener with given id. More... | |
| void | eventSend (const QByteArray &eventId, Radiant::BinaryData &bd) |
| Sends an event and bd to all listeners on this eventId. | |
| void | eventSend (const QByteArray &eventId) |
| Sends an event to all listeners on this eventId. | |
| template<typename P1 > | |
| void | eventSend (const QByteArray &eventId, const P1 &p1) |
| Sends an event to all listeners on this eventId. More... | |
| template<typename P1 , typename P2 > | |
| void | eventSend (const QByteArray &eventId, const P1 &p1, const P2 &p2) |
| Sends an event to all listeners on this eventId. More... | |
| template<typename P1 , typename P2 , typename P3 > | |
| void | eventSend (const QByteArray &eventId, const P1 &p1, const P2 &p2, const P3 &p3) |
| Sends an event to all listeners on this eventId. More... | |
| template<typename P1 , typename P2 , typename P3 , typename P4 > | |
| void | eventSend (const QByteArray &eventId, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4) |
| Sends an event to all listeners on this eventId. More... | |
| template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 > | |
| void | eventSend (const QByteArray &eventId, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5) |
| Sends an event to all listeners on this eventId. More... | |
| unsigned | eventSourceCount () const |
| Returns the number of event sources. | |
| Uuid | id () const |
| Returns the unique id. | |
| bool | isBeingDestroyed () const |
| Returns true if we are about to delete this object. More... | |
| bool | loadFromFileXML (const QString &filename) |
| Reads this object (and its children) from an XML file. | |
| bool | loadFromMemoryXML (const QByteArray &buffer) |
| Reads this object (and its children) from a memory buffer. | |
| Node (Node *host, const QByteArray &name="", bool transit=false) | |
| Constructs a new Node and adds it under the given host. More... | |
| Node (Node &&node) | |
| Moves a node, including all its attributes, events etc. More... | |
| Node & | operator= (Node &&node) |
| Moves a node, replacing this. More... | |
| virtual bool | readElement (const ArchiveElement &element) |
| Handles a serialization element that lacks automatic handlers. More... | |
| void | removeAttribute (Attribute *const attribute) |
| Removes an Attribute from the list of attribute objects. | |
| bool | saveToFileXML (const QString &filename, unsigned int opts=SerializationOptions::DEFAULTS) const |
| Saves this object (and its children) to an XML file. | |
| bool | saveToMemoryXML (QByteArray &buffer, unsigned int opts=SerializationOptions::DEFAULTS) const |
| Saves this object (and its children) to binary data buffer. | |
| virtual ArchiveElement | serialize (Archive &doc) const |
| Serializes this object (and its children) to a DOM node. | |
| virtual void | setAsDefaults () |
| Sets the current USER attribute value as the default value and clears the USER value. More... | |
| void | setId (Uuid newId) |
| Sets the unique id. More... | |
| template<class T > | |
| bool | setValue (const QByteArray &name, const T &v) |
| Uses a query string to find a Attribute, and sets a new value to that if found. More... | |
| bool | setValue (const QByteArray &name, v8::Handle< v8::Value > v) |
| Set attribute value from JavaScript. More... | |
Public Member Functions inherited from Valuable::Attribute | |
| long | addListener (ListenerFunc func, int role=CHANGE_ROLE) |
| Adds a listener that is invoked whenever the value is changed. More... | |
| long | addListener (Node *listener, ListenerFunc func, int role=CHANGE_ROLE) |
| Adds a listener that is invoked whenever the value is changed. More... | |
| long | addListener (v8::Persistent< v8::Function > func, int role=CHANGE_ROLE) |
| Adds a JavaScript listener that is invoked whenever the value is changed. More... | |
| virtual float | asFloat (bool *const ok=0, Layer layer=LAYER_CURRENT) const |
| Converts the value object in a floating point number. More... | |
| virtual int | asInt (bool *const ok=0, Layer layer=LAYER_CURRENT) const |
| Converts the value object in an integer. More... | |
| virtual QString | asString (bool *const ok=0, Layer layer=LAYER_CURRENT) const |
| Converts the value object to a string. More... | |
| Attribute (const Attribute &o) | |
| Create a copy of the given Attribute WITHOUT the link to host, listeners, or the attribute name. More... | |
| Attribute (Node *host, const QByteArray &name, bool transit=false) | |
| Constructs a new value object and attaches it to its host. More... | |
| virtual void | clearValue (Layer layer) |
| Unsets the value from a specific layer. More... | |
| virtual void | emitChange () |
| Invokes the change valueChanged function of all listeners. | |
| void | eventProcessFloat (const char *id, float v) |
| Utility function for sending a float message to the object. | |
| void | eventProcessInt (const char *id, int v) |
| Utility function for sending an int message to the object. | |
| void | eventProcessString (const char *id, const QString &str) |
| Utility function for sending string message to the object. | |
| void | eventProcessString (const char *id, const char *str) |
| Utility function for sending string message to the object. | |
| void | eventProcessVector2 (const char *id, Nimble::Vector2) |
| Utility function for sending a Nimble::Vector2f message to the object. | |
| void | eventProcessVector3 (const char *id, Nimble::Vector3) |
| Utility function for sending a Vector3 message to the object. | |
| void | eventProcessVector4 (const char *id, Nimble::Vector4) |
| Utility function for sending a Vector4 message to the object. | |
| virtual bool | handleShorthand (const Valuable::StyleValue &value, Radiant::ArrayMap< Valuable::Attribute *, Valuable::StyleValue > &expanded) |
| If attribute supports shorthand properties, this should be used to parse those. More... | |
| Node * | host () const |
| The host object of the value object (is any). More... | |
| virtual bool | isChanged () const |
| virtual bool | isValueDefinedOnLayer (Layer layer) const |
| Check if the given layer defines a value. More... | |
| bool | layerForSerialization (SerializationOptions flags, Layer &layer) const |
| const QByteArray & | name () const |
| Returns the name of the object. | |
| const Attribute & | operator= (const Attribute &) |
| Create a copy of the given Attribute WITHOUT the link to host, listeners, or the attribute name. More... | |
| Attribute * | ownerShorthand () const |
| QByteArray | path () const |
| Returns the path (separated by '/'s) from the root. | |
| void | removeHost () |
| Sets the host pointer to zero and removes this object from the host. More... | |
| bool | removeListener (Node *listener, int role=ALL_ROLES) |
| Removes a listener from the listener list. More... | |
| bool | removeListener (long id) |
| Removes a listener from the listener list. More... | |
| void | removeListeners (int role=ALL_ROLES) |
| Removes listeners from the listener list. | |
| virtual bool | set (float v, Layer layer=USER, ValueUnit unit=VU_UNKNOWN) |
| Sets the value of the object. | |
| virtual bool | set (int v, Layer layer=USER, ValueUnit unit=VU_UNKNOWN) |
| Sets the value of the object. | |
| virtual bool | set (const QString &v, Layer layer=USER, ValueUnit unit=VU_UNKNOWN) |
| Sets the value of the object. | |
| virtual bool | set (const Nimble::Vector2f &v, Layer layer=USER, QList< ValueUnit > units=QList< ValueUnit >()) |
| Sets the value of the object. | |
| virtual bool | set (const Nimble::Vector3f &v, Layer layer=USER, QList< ValueUnit > units=QList< ValueUnit >()) |
| Sets the value of the object. | |
| virtual bool | set (const Nimble::Vector4f &v, Layer layer=USER, QList< ValueUnit > units=QList< ValueUnit >()) |
| Sets the value of the object. | |
| virtual bool | set (const StyleValue &value, Layer layer=USER) |
| Sets the value of the object. | |
| void | setName (const QByteArray &s) |
| Sets the name of the object. | |
| void | setOwnerShorthand (Attribute *owner) |
| virtual QByteArray | type () const |
| Get the type id of the attribute. More... | |
Public Member Functions inherited from Valuable::Serializable | |
| virtual bool | deserializeXML (const DOMElement &element) |
| Deserializes (reads) this object from an XML element. More... | |
| bool | isSerializable () const |
| void | setSerializable (bool v) |
Static Public Member Functions | |
| static void | addInitCallback (std::function< bool(Application &app)> func) |
| Add a callback function to be run in Application::init. More... | |
| static Application & | instance () |
| Returns a reference to the global application instance. | |
| static Application * | instancePtr () |
| Returns a pointer to the global application instance. | |
| static bool | isTimeToQuit () |
| Returns true if the application should quit. | |
| static void | quit () |
| Instructs the application to quit. | |
| static QString | versionString (VersionType type=FULL) |
| Get the Cornerstone version string. More... | |
Static Public Member Functions inherited from Valuable::Node | |
| static bool | copyValues (const Node &from, Node &to) |
| Copies attribute values from one node to another. More... | |
| static void | disableQueue () |
| Disables all AFTER_UPDATE event processing, no new events will be accepted and the current queue will be cleared. More... | |
| static Uuid | generateId () |
| Generates a unique identifier. More... | |
| static void | invokeAfterUpdate (ListenerFuncVoid function) |
| Queue function to be called in the main thread after the next update() More... | |
| static int | processQueue () |
| Triggers any pending AFTER_UPDATE-events. More... | |
| static void | reEnableQueue () |
| Enables queue after calling disableQueue. More... | |
| static void | setFatalOnEventMismatch (bool haltApplication) |
| Controls what to do when an event mismatch is detected The default behavior is to output a warning to the terminal (haltApplication = false). More... | |
Protected Member Functions | |
| virtual void | input (float dt) |
| Runs the input logic for a single input sample. | |
| void | processInput () |
| Fetches the samples from touch screens and processes them. More... | |
| virtual void | update (const MultiWidgets::FrameInfo &frameInfo) |
| Update the application state. More... | |
Protected Member Functions inherited from Valuable::Node | |
| virtual void | attributeAdded (Attribute *attribute) |
| This is called when new attribute is added to Node. More... | |
| virtual void | attributeRemoved (Attribute *attribute) |
| This is called when attribute is removed from Node. More... | |
| Node * | sender () |
| Get the sender of the event, only valid in DIRECT events. More... | |
| void | setBeingDestroyed () |
| Sets 'isBeginDestroyed' flag to true and removes all event listeners to this object. More... | |
Protected Member Functions inherited from Valuable::Attribute | |
| virtual void | emitDelete () |
| Invokes the change valueDeleted function of all listeners. | |
Friends | |
| class | Application::D |
| class | CaptureQtApplicationCloseEvents |
| class | RenderThread |
| class | ThreadedGfxDriver |
Base class for writing new applications.
Application can be used as such, by adding proper widgets to it, or by extending it via inheritance. To use the application, you need create one application object - either a Application object directly, or some class derived from it. Application has an internal pointer to the application instance which is used by the other run-time components for the input-, update-, and rendering callbacks.
Application is a platform-independent class, that manages touchscreen and OpenGL resources. These resources are handled by Driver classes, that are platform-specific, and internal to the MultiWidgets library.
It should be noted that in general one does not need to create a custom application class. It is recommended to write all the functionality into widget plugins. With that approach it is easier to mix widgets from different projects and create new applications with fast prototyping approach.
See application attributes for command line arguments
| int MultiWidgets::Application::addFont | ( | const QString & | filename | ) |
Loads the specified font and makes it available to the application.
| filename | filename of the font to load |
|
static |
Add a callback function to be run in Application::init.
This function can be used to add custom initialization functions to be called from Application::init
| func | callback function to call |
|
inline |
Adds a post process filter to the rendering pipeline.
Filters can be added at any time outside the render thread and the filter will be active beginning from the next frame. Filters are applied based on their order attribute. Two filters with the same order attribute are applied in the order they are inserted.
| Filter | Type of the filter to add |
| void MultiWidgets::Application::addPostProcessFilter | ( | std::shared_ptr< Luminous::PostProcessFilter > | filter | ) |
Adds a post process filter to the rendering pipeline.
Filters can be added at any time outside the render thread and the filter will be active beginning from the next frame. Filters are applied based on their order attribute. Two filters with the same order attribute are applied in the order they are inserted.
| Filter | Type of the filter to add |
| void MultiWidgets::Application::addStyleFilename | ( | const QString & | filename | ) |
Adds new CSS file to application.
| filename | path to CSS file |
| const QStringList& MultiWidgets::Application::arguments | ( | ) | const |
Returns the list of extra command line arguments that weren't processed by command line parser.
| const QString & MultiWidgets::Application::audioConfig | ( | ) | const |
Path to the audio configuration file.
| const QString & MultiWidgets::Application::audioDevices | ( | ) | const |
Path to the audio devices file which is fed to Resonant::AudioLoop::setDevicesFile.
| const QString& MultiWidgets::Application::background | ( | ) | const |
If set the background for the whole application is loaded from this path.
If This points to the file it is loaded with Mime-class. If this points to the directory the images of the directory are cycled with ImageMovieWidget using fps as frame rate. Plugins can be loaded as the background by having prefix "plugin:" in the string. For example:
| float MultiWidgets::Application::backgroundFps | ( | ) | const |
If using ImageMovieWidget as background this is the fps used in that.
| const MultiWidgets::WidgetPtr& MultiWidgets::Application::backgroundLayer | ( | ) |
Get the background layer widget.
The background layer is placed behind the main layer in the widget hierarchy. Typically it acts as a container for different backgrounds effects, animations, etc.
| const MultiWidgets::WidgetPtr& MultiWidgets::Application::base | ( | ) |
The base widget for the application.
The base widget is the root of the widget hiearchy. Typically you do not add widgets to the base widget directly, but to the various layer widgets that are children of the base widget.
|
virtual |
Used to handle drop events.
| event | Event to be handled |
| std::shared_ptr<Resonant::DSPNetwork> MultiWidgets::Application::dspNetwork | ( | ) |
Get a pointer to the DSP network used by the application.
This allows access to the audio system.
| void MultiWidgets::Application::enableInputVisualization | ( | bool | enable | ) |
Setter for attribute with-input-visualizer.
| enable | new attribute value |
| void MultiWidgets::Application::enableRipple | ( | bool | enable | ) |
|
virtual |
An entry point for processing a message to the Application.
| type | Name of the event |
| data | Data associated to the event |
Reimplemented from Valuable::Attribute.
| QStringList MultiWidgets::Application::fontFamilies | ( | int | fontId | ) |
Get a list of font families for the specified font.
| fontId | font id to list families for |
| const QString & MultiWidgets::Application::fontsDir | ( | ) | const |
If value provided, loads every otf- and ttf- file inside the given directory.
| int MultiWidgets::Application::framesPerSecond | ( | ) | const |
This attribute controls the frame rate of the application.
| const QString& MultiWidgets::Application::getCSSMedia | ( | ) | const |
Returns the CSS media (file contents).
| std::unique_ptr<GfxDriver>& MultiWidgets::Application::gfxDriver | ( | ) |
Get the graphics driver used to by the application.
| GrabManager& MultiWidgets::Application::grabManager | ( | ) |
Gets the grab manager used by this application.
|
virtual |
Handle the event where a window is iconified If the function is overridden, the default implementation should also be called.
|
virtual |
Handle the case where a window is restored If the function is overridden, the default implementation should also be called.
|
virtual |
Initialize the application object, and set up the touch-screen interface and graphics environment.
| argc | Number of command line arguments. |
| argv | Values of command line arguments. |
| gfxDriver | Graphics driver for the cornerstone rendering. |
| qtGui | Do we initialize QT GUI. It is initialized if this is true or graphics driver needs GUI. |
|
virtual |
Initialize a render context.
This function gets called by every rendering thread when the rendering thread is initialized. It allows you to perform any custom initialization that might depend on a valid OpenGL context. Note that if you override this function you must call the base implementation and your function must be thread-safe!
| context | render context associated with the rendering thread |
| const QString & MultiWidgets::Application::initialInputConfig | ( | ) | const |
Input configuration file loaded in the initialization of application.
By default this is config.txt which is located in Windows in "%APPDATA%\MultiTouch" -directory and in Unix in "~/.MultiTouch" -directory.
| Radiant::Config& MultiWidgets::Application::inputConfig | ( | ) |
Returns the input configuration in the form of a Radiant::Config object.
| QString& MultiWidgets::Application::inputConfigFilename | ( | ) |
Returns the name of the tracking configuration file used by the application.
| int MultiWidgets::Application::inputTimeout | ( | ) | const |
How many milliseconds the updates of the touchscreen is waited.
If touchscreen uses NetBridge the default waiting time is 0 milliseconds.
| bool MultiWidgets::Application::isDeveloperMode | ( | ) | const |
Is the application using developer mode? In non-developer mode the only keyboard shortcuts are Ctrl+Q for exiting the application, Ctrl+M for minimizing all application windows and Ctrl+F12 for toggling this developer mode.
This is the same as –dev command line argument.
| bool MultiWidgets::Application::isDummyTrackerInUse | ( | ) | const |
If enabled the application does not try to use real touchscreen.
| bool MultiWidgets::Application::isInputVisualized | ( | ) | const |
If enabled MultiWidgets::InputVisualizerWidget is created to overlay layer.
| bool MultiWidgets::Application::isMinimized | ( | ) | const |
Is the application minimized?
| bool MultiWidgets::Application::isRippleEnabled | ( | ) | const |
If enabled the application has ripple-effect as its overlay.
| bool MultiWidgets::Application::isSimultaneousVirtualInputEnabled | ( | ) | const |
Whether the virtual input is allowed to be fed simultaneously with the real input to the application.
This is needed for avoiding the duplication of the input when using native touch capabilites of some platforms, since the touch is usually forwarded as mouse clicks to the applications.
| bool MultiWidgets::Application::isSiteManagerEnabled | ( | ) | const |
Is the application MultiTaction Site Manager enabled?.
If true, the application can be monitored and managed using MultiTaction Site Manager software.
| bool MultiWidgets::Application::isVerbose | ( | ) | const |
If enabled the application will be more verbose.
| const QString & MultiWidgets::Application::jsConsoleConfig | ( | ) | const |
If set, opens javascript-terminal accessed by telnet to the designated location.
The format of this string is [hostname:]port
|
virtual |
Used to handle key-press events.
| event | Event to be handled |
|
virtual |
Used to handle key-release events.
| event | Event to be handled |
| const QString & MultiWidgets::Application::licenseFile | ( | ) | const |
Path to the license file.
| Nimble::Vector2f MultiWidgets::Application::location | ( | ) | const |
Location for the root of the whole widget hierarchy.
| const MultiWidgets::WidgetPtr& MultiWidgets::Application::mainLayer | ( | ) |
Get the main layer widget.
Typically the main layer is where most application-specific widgets are placed under as children.
| int MultiWidgets::Application::minFramesPerSecond | ( | ) | const |
This attribute acts as a minimum frame rate of the application.
If the actual frame rate drops below the updates are calculated pretending this to be the actual frame rate.
| void MultiWidgets::Application::minimize | ( | ) |
Minimize the application.
|
virtual |
Used to handle mouse move events.
| event | Event to be handled |
|
virtual |
Used to handle mouse button press events.
| event | Event to be handled |
|
virtual |
Used to handle mouse button release events.
| event | Event to be handled |
|
virtual |
Used to handle mouse wheel events.
| event | Event to be handled |
| const MultiWidgets::WidgetPtr& MultiWidgets::Application::overlayLayer | ( | ) |
Get the overlay layer widget.
The overlay layer is placed in front of the main layer. It can be used to overlay effects on top of the application, like debugging visualizations.
| PerformanceData& MultiWidgets::Application::performanceData | ( | ) |
Get the performance counter of the application.
| void MultiWidgets::Application::processEvents | ( | ) |
Processes pending events for the application sent by OS.
This is not required to be called unless Application is not run is run is not called but application is executed manually. Processes Qt events for the application.
|
protected |
Fetches the samples from touch screens and processes them.
Practically handles the connections to the touchscreens and calls of Application::input .
| bool MultiWidgets::Application::removeFont | ( | int | fontId | ) |
Removes the previously loaded font from the application.
| fontId | font id to remove |
| void MultiWidgets::Application::removeStyleFilename | ( | const QString & | filename | ) |
Remove one CSS file from the application.
| filename | path to CSS file |
|
virtual |
Renders the application, using the given RenderContext object.
This function must be thread-safe, to support multi-threaded rendering.
| r | active render context |
| bounds | bounding box of the drawn area in graphics coordinates |
| index | index of the calling rendering thread |
|
virtual |
This function gets called by each rendering thread after all rendering is done for one frame.
| r | active render context |
| window | window configuration associated with the calling rendering thread |
| void MultiWidgets::Application::restore | ( | ) |
Restore the application.
| float MultiWidgets::Application::rotation | ( | ) | const |
Rotation for the root of the whole widget hierarchy.
|
virtual |
Runs the application.
This function will block until the application quits.
| bool MultiWidgets::Application::saveInputConfigToFile | ( | ) |
Saves the current input configuration to the current inputConfigFilename.
| bool MultiWidgets::Application::saveScreenConfigToFile | ( | ) |
Saves the current screen configuration to the current screenConfigFilename.
| float MultiWidgets::Application::scale | ( | ) | const |
Scale for the root of the whole widget hierarchy.
| const QString & MultiWidgets::Application::screenConfigFilename | ( | ) | const |
Name of the screen configuration file loaded in initialization.
By default this is screen.xml which is located in Windows in "%APPDATA%\MultiTouch" -directory and in Unix in "~/.MultiTouch" -directory.
| void MultiWidgets::Application::setArguments | ( | const QStringList & | arguments | ) |
Set the command line arguments for the application.
Typically these are handled automatically by Application::init. This function can be used to override the arguments.
| arguments | command line arguments |
| void MultiWidgets::Application::setAudioConfig | ( | const QString & | conf | ) |
| void MultiWidgets::Application::setAudioDevices | ( | const QString & | conf | ) |
| void MultiWidgets::Application::setBackground | ( | const QString & | bg | ) |
Setter for attribute background.
| bg | new attribute value |
| void MultiWidgets::Application::setBackgroundFps | ( | float | fps | ) |
| void MultiWidgets::Application::setCSSMedia | ( | const QString & | media | ) |
Sets the CSS media (CSS file contents)
| media | CSS media used in parsing the style |
| void MultiWidgets::Application::setDeveloperMode | ( | bool | developerMode | ) |
Setter for attribute dev.
| developerMode | new attribute value |
| void MultiWidgets::Application::setFontsDir | ( | const QString & | fontsDir | ) |
| void MultiWidgets::Application::setFramesPerSecond | ( | int | fps | ) |
| void MultiWidgets::Application::setInputTimeout | ( | int | timeout | ) |
| void MultiWidgets::Application::setIsSiteManagerEnabled | ( | bool | enabled | ) |
Setter for attribute enable-site-manager.
| enabled | new attribute value |
| void MultiWidgets::Application::setJsConsoleConfig | ( | const QString & | conf | ) |
| void MultiWidgets::Application::setLicenseFile | ( | const QString & | licenseFile | ) |
Setter for attribute license.
| licenseFile | new attribute value |
| void MultiWidgets::Application::setLocation | ( | const Nimble::Vector2f & | loc | ) |
| void MultiWidgets::Application::setMinFramesPerSecond | ( | int | minFps | ) |
Setter for attribute minimum-update-frequency.
| minFps | new attribute value |
| void MultiWidgets::Application::setMinimized | ( | bool | isMinimized | ) |
Setter for attribute minimize.
| isMinimized | new attribute value |
| void MultiWidgets::Application::setRotation | ( | float | rotation | ) |
| void MultiWidgets::Application::setScale | ( | float | scale | ) |
| void MultiWidgets::Application::setSimultaneousVirtualInputEnabled | ( | bool | enable | ) |
Setter for attribute simultaneous-virtual-input.
| enable | new attribute value |
| void MultiWidgets::Application::setStyleFilenames | ( | const QStringList & | filenames | ) |
| void MultiWidgets::Application::setTraceFile | ( | const QString & | traceFile | ) |
| void MultiWidgets::Application::setVerbose | ( | bool | enable | ) |
| void MultiWidgets::Application::setVerboseModules | ( | const QString & | modules | ) |
| std::shared_ptr<Stylish::StyleSheet> MultiWidgets::Application::style | ( | ) | const |
Returns the current style sheet object.
| const QStringList & MultiWidgets::Application::styleFilenames | ( | ) | const |
Paths to CSS files to be used for the application.
|
virtual |
Used to handle tablet move events.
| event | Event to be handled |
|
virtual |
Used to handle tablet press events.
| event | Event to be handled |
|
virtual |
Used to handle tablet release events.
| event | Event to be handled |
|
virtual |
Used to handle window system touch events.
| event | Event to be handled |
| MultiTouch::Screen& MultiWidgets::Application::touchScreen | ( | ) |
Get the multi-touch tracker API object.
This function returns the tracker object used by the application.
| const QString & MultiWidgets::Application::traceFile | ( | ) | const |
All of the output of Radiant is directed to the file defined by this path.
|
protectedvirtual |
Update the application state.
This function gets called periodically to update the application state. The default implementation propagates the update call to the widget hierarchy.
| frameInfo | frame information about elapsed time |
| const QString & MultiWidgets::Application::verboseModules | ( | ) | const |
List of verbose modules separated with comma (,).
|
static |
Get the Cornerstone version string.
| type | version string type to get |