HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Static Public Attributes
tt::application Class Referenceabstract

#include <ttauri/application.hpp>

Inheritance diagram for tt::application:
tt::Application_macos tt::application_win32

Public Member Functions

 application (std::weak_ptr< application_delegate > const &delegate, int argc, char *argv[], os_handle instance)
 This function will take ownership of the delegate and delete it during destruction.
 
virtual int main ()
 Start the application.
 
 application (const application &)=delete
 
applicationoperator= (const application &)=delete
 
 application (application &&)=delete
 
applicationoperator= (application &&)=delete
 
virtual void run_from_main_loop (std::function< void()> function)=0
 
virtual void exit (int exit_code=0)=0
 Exit the main loop and exit the application.
 

Data Fields

std::weak_ptr< application_delegatedelegate
 
int argc
 
char ** argv
 
os_handle instance
 Handle to the operating system's application-instance.
 
gui_window_size initial_window_size = gui_window_size::normal
 The initial window size for the first application window.
 
datum configuration
 The global configuration.
 
thread_id main_thread_id
 Thread id of the main thread.
 
std::atomic< bool > inLoop
 

Static Public Attributes

static applicationglobal
 

Detailed Description

A singleton that represents the application. An application should be instantiated in a local variable in main. This will allow the application to destruct application systems in the correct order when main() goes out of scope and before the global variables are destructed.

Constructor & Destructor Documentation

◆ application()

tt::application::application ( std::weak_ptr< application_delegate > const & delegate,
int argc,
char * argv[],
os_handle instance )

This function will take ownership of the delegate and delete it during destruction.

Parameters
delegateA pointer to an application delegate.
argumentsA list of command line arguments. On posix this is simply each argument, for win32 it needs to be processed to process quotes and escaping correctly..

Member Function Documentation

◆ exit()

virtual void tt::application::exit ( int exit_code = 0)
pure virtual

Exit the main loop and exit the application.

Implemented in tt::application_win32.

◆ main()

virtual int tt::application::main ( )
virtual

Start the application.

◆ run_from_main_loop()

virtual void tt::application::run_from_main_loop ( std::function< void()> function)
pure virtual

Run the given function on the main thread.

Implemented in tt::application_win32.

Field Documentation

◆ argc

int tt::application::argc

Command line arguments.

◆ configuration

datum tt::application::configuration

The global configuration.

◆ delegate

std::weak_ptr<application_delegate> tt::application::delegate

application delegate

◆ initial_window_size

gui_window_size tt::application::initial_window_size = gui_window_size::normal

The initial window size for the first application window.

◆ instance

os_handle tt::application::instance

Handle to the operating system's application-instance.

◆ main_thread_id

thread_id tt::application::main_thread_id

Thread id of the main thread.


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