|
|
| Application (int argc=0, char **argv=0) |
| | Creates the Forms runtime and its primary screen.
|
|
virtual | ~Application () |
| | Destroys the Forms runtime and the services it owns.
|
| ApplicationImpl * | impl () |
| | Returns the platform-specific Forms implementation.
|
| GraphicsBackend & | graphicsBackend () |
| | Returns the graphics backend used by Forms.
|
| const GraphicsBackend & | graphicsBackend () const |
| | Returns the graphics backend used by Forms.
|
| const Screen & | screen () const |
| | Returns the primary screen.
|
| Screen & | screen () |
| | Returns the primary screen.
|
|
Pt::Timespan | inactivityTime () const |
| | Returns the time since the last platform user activity.
|
| void | setCursor (const Cursor *cursor=0) |
| | Sets the platform cursor.
|
|
const Style & | style () const |
| | Returns the current style.
|
| void | setStyle (const Style &s) |
| | Sets the global style for all widgets.
|
|
const StyleOptions & | styleOptions () const |
| | Returns the current style options.
|
| void | setStyleOptions (const StyleOptions &options) |
| | Replaces the style options for all widgets.
|
| void | loadImage (const System::Path &path, Gfx::Image &image) |
| | Loads a PNG file into image.
|
| void | setScaleFactor (double scale) |
| | Sets the Forms scaling factor.
|
|
double | scaleFactor () const |
| | Returns the current Forms scaling factor.
|
| InputMethod & | inputMethod () |
| | Returns the active input method.
|
| void | setInputMethod (InputMethod &im) |
| | Installs im as the active input method.
|
| void | removeInputMethod (InputMethod &im) |
| | Removes im when it is the active input method.
|
| Pt::uint64_t | makeId () |
| | Creates an ID for an internal Forms widget.
|
| Widget * | findWidget (Pt::uint64_t id) |
| | Finds the live widget with id.
|
| void | nextEvent () |
| | Processes the next platform event.
|
|
void | commitEvent (const Event &ev) |
| | Queues ev on the application event loop.
|
| void | processEvent (const Event &ev) |
| | Processes ev immediately through Forms event dispatch.
|
|
Pt::Signal< const Pt::Event & > & | eventReceived () |
| | Notifies of events passed to processEvent().
|
| void | invalidate () |
| | Invalidates every registered widget.
|
| void | sendKeyEvent (const KeyEvent &ev) |
| | Emulates a platform key event.
|
| void | sendMouseEvent (const MouseEvent &ev) |
| | Emulates a platform mouse event.
|
| Widget * | capture () const |
| | Returns the active pointer-capture target.
|
|
void | addFonts (const Pt::System::Path &dir) |
| | Adds the font files found in dir.
|
| bool | addFont (const Pt::System::Path &path) |
| | Adds the font at path.
|
| bool | removeFont (const Pt::System::Path &path) |
| | Removes the font at path.
|
| const std::vector< Pt::System::Path > & | fontFiles () const |
| | Returns the paths of the registered font files.
|
|
std::string | defaultFont () const |
| | Returns the default font family used by the graphics backend.
|
|
void | setDefaultFont (const std::string &family) |
| | Sets the default font family used by the graphics backend.
|
|
std::vector< std::string > | fontFamilies () const |
| | Returns the available font family names.
|
|
std::vector< Gfx::FontFace > | fontFaces (const std::string &family) const |
| | Returns the available faces in family.
|
|
EventLoop & | loop () |
| | Returns the event loop.
|
|
void | run () |
| | Starts the contained event loop.
|
|
void | exit () |
| | Exits from the contained event loop.
|
|
bool | ignoreSystemSignal (int sig) |
| | Ignores a system signal.
|
|
bool | catchSystemSignal (int sig) |
| | Catch a system signal.
|
|
bool | raiseSystemSignal (int sig) |
| | Raise a system signal.
|
|
Signal< int > & | systemSignal () |
| | Notifies when a system signal was caught.
|
|
int & | argc () const |
| | Number of command line arguments.
|
|
char ** | argv () const |
| | Command line arguments.
|
|
void | setArgs (int &argc, char **argv) |
| | Set command line arguments.
|
|
template<typename T> |
| Arg< T > | getArg (const char *name) |
| | Returns the value of a long option.
|
|
template<typename T> |
| Arg< T > | getArg (const char *name, const T &def) |
| | Returns the value of a long option.
|
|
template<typename T> |
| Arg< T > | getArg (const char name) |
| | Returns the value of a short option.
|
|
template<typename T> |
| Arg< T > | getArg (const char name, const T &def) |
| | Returns the value of a short option.
|
Application provides the Forms runtime. It is not a Widget. Construct one before any widget, show the visual hierarchy, then enter the inherited event loop with Pt::System::Application::run().
The application owns its platform implementation, graphics backend, and primary Screen. It does not own the windows or controls that use those services. Widgets remove themselves from their visual parent when they are destroyed. Each widget receives an ID while the application exists; findWidget() resolves that ID only while the widget remains alive.
Platform events enter the inherited event loop and are routed through the Forms event dispatcher to their target widget or the primary screen. The same dispatcher handles layout, invalidation, repainting, scaling, and window changes. It permits the visual hierarchy to coalesce deferred work. Applications normally request changes through widget APIs. Use processEvent() only when deliberately supplying Forms events.
The application provides shared styles, style options, input methods, fonts, and scaling. Use setStyle() and setStyleOptions() to change the global theme. Those methods reset shared renderer facets and invalidate registered widgets. Widgets rebuild in onInvalidate(). setScaleFactor() sends a rescale event through the primary screen. Configure shared services before showing the user interface when possible. impl() and graphicsBackend() support Forms backend implementations; ordinary applications use the higher-level Forms APIs.