10#include <egt/asio.hpp>
11#include <egt/detail/meta.h>
12#include <egt/eventloop.h>
13#include <egt/object.h>
59 const std::string& name = {},
bool primary =
true);
109 virtual void quit(
int exit_value = 0);
135 void set_modal_window(
Window* window)
137 m_modal_window = window;
143 EGT_NODISCARD
const std::vector<Window*>&
windows()
const {
return m_windows; }
158 void dump(std::ostream& out)
const;
179 EGT_NODISCARD
inline int argc()
const {
return m_argc; }
185 EGT_NODISCARD
inline const char**
argv()
const {
return const_cast<const char**
>(m_argv); }
192 static
void setup_info();
194 static
void setup_logging();
196 static
void setup_locale(const std::
string& name);
198 void setup_backend(
bool primary, const std::
string& name);
217 char** m_argv{
nullptr};
232 void signal_handler(
const asio::error_code& error,
int signum);
235 std::unique_ptr<Screen> m_screen;
238 std::vector<std::unique_ptr<Input>> m_inputs;
244 std::vector<Window*> m_windows;
247 Window* m_main_window{
nullptr};
250 Window* m_modal_window{
nullptr};
253 std::vector<Timer*> m_timers;
Application definition.
Definition app.h:49
Application(const Application &)=delete
EGT_NODISCARD int argc() const
Get the argc value passed in.
Definition app.h:179
virtual void quit(int exit_value=0)
Calls EventLoop::quit(exit_value) by default.
virtual ~Application() noexcept
void dump(std::ostream &out) const
Dump the widget hierarchy and properties to the specified std::ostream.
static bool check_instance()
Check if there is an available instance.
EGT_NODISCARD Screen * screen() const
Get a pointer to the Screen instance.
Definition app.h:119
EventLoop & event()
Get a reference to the application event loop instance.
Definition app.h:114
EGT_NODISCARD const char ** argv() const
Get the argv value passed in.
Definition app.h:185
const std::vector< std::pair< std::string, std::string > > & get_input_devices()
Get a list of input devices configured with the EGT_INPUT_DEVICES environment variable.
Application(Application &&)=delete
void paint_to_file(const std::string &filename={})
Paint the entire Screen to a file.
Application & operator=(Application &&)=delete
std::vector< std::pair< std::string, std::string > > m_input_devices
List of configured input devices.
Definition app.h:227
virtual int run()
Run the application.
Application & operator=(const Application &)=delete
EGT_NODISCARD bool is_composer() const
Check whether the application runs under the Microchip Graphic Composer.
EGT_NODISCARD Window * main_window() const
Get a pointer to the main Window.
Definition app.h:124
static Application & instance()
Reference to the main Application instance.
EGT_NODISCARD Window * modal_window() const
Get a pointer to the modal Window.
Definition app.h:132
asio::signal_set m_signals
Signal instance for registered signal handles by the Application.
Definition app.h:222
void dump_timers(std::ostream &out) const
Dump all allocated timers to the specified std::ostream.
static void setup_search_paths(const std::vector< std::string > &extra_paths={})
Reset the resources search paths optionally adding extra paths.
EGT_NODISCARD const std::vector< Window * > & windows() const
Get the list of all currently allocated Windows.
Definition app.h:143
Application(int argc=0, char **argv=nullptr, const std::string &name={}, bool primary=true)
Event loop interface.
Definition eventloop.h:39
uint64_t RegisterHandle
Handle type.
Definition object.h:61
Manages one of more buffers that make up a Screen.
Definition screen.h:34
Basic one shot timer.
Definition timer.h:70
A Window is a Widget that handles drawing to a Screen.
Definition window.h:47
EGT framework namespace.
Definition animation.h:24