25#include <boost/pool/pool_alloc.hpp>
39#pragma comment(linker, "/include:nrc_neogfx_icons")
40#pragma comment(linker, "/include:nrc_neogfx_resources")
56 struct invalid_options : std::runtime_error { invalid_options(std::string
const& aReason) : std::runtime_error(
"Invalid program options: " + aReason) {} };
60 const boost::program_options::variables_map&
options() const final;
88 typedef std::map<std::string, style> style_list;
90 typedef std::vector<i_mnemonic*> mnemonic_list;
98 template <
typename... Args>
99 app(Args&&... aArgs) :
100 app{ static_cast<const
neolib::i_application_info&>(
neolib::application_info{
std::forward<Args>(aArgs)... }) } {}
108 std::
string const& name() const noexcept override;
109 void set_name(
std::
string const& aName) override;
110 int exec(
bool aQuitWhenLastWindowClosed = true) override;
111 bool in_exec() const override;
112 void quit(
int aResultCode = 0) override;
118 void set_default_window_icon(const
i_texture& aIcon) override;
119 void set_default_window_icon(const
i_image& aIcon) override;
120 const
i_style& current_style() const override;
122 i_style& change_style(
std::
string const& aStyleName) override;
125 void clear_translations();
126 void load_translations();
127 void load_translations(
std::filesystem::
path const& aTranslationFile);
165 bool do_process_events();
169 bool text_input(
i_string const& aText)
override;
170 bool sys_text_input(
i_string const& aText)
override;
172 std::unique_ptr<app_thread> iThread;
174 std::unique_ptr<loader> iLoader;
176 bool iQuitWhenLastWindowClosed;
178 std::optional<int> iQuitResultCode;
181 style_list::iterator iCurrentStyle;
184 mnemonic_list iMnemonics;
186 std::vector<std::pair<key_code_e, key_modifiers_e>> iKeySequence;
187 mutable std::unique_ptr<i_help> iHelp;
188 std::map<std::string, std::map<std::string, std::map<std::pair<std::int64_t, std::int64_t>,
string>>> iTranslations;
i_action & add_action(i_action &aAction) override
void remove_mnemonic(i_mnemonic &aMnemonic) override
i_action & action_cut() override
i_action & add_action(i_string const &aText) override
i_action & find_action(i_string const &aText) override
i_action & action_paste() override
i_action & action_select_all() override
bool process_events() override
i_action & add_action(i_string const &aText, const i_image &aImage) override
bool process_events(i_event_processing_context &aContext) override
i_help & help() const override
i_action & action_file_close() override
i_action & action_delete() override
i_action & action_file_exit() override
void add_mnemonic(i_mnemonic &aMnemonic) override
i_action & action_file_save_all() override
i_action & add_action(i_string const &aText, i_string const &aImageUri, dimension aDpiScaleFactor=1.0, texture_sampling aSampling=texture_sampling::Normal) override
bool discover(const uuid &aId, void *&aObject) override
i_menu & add_standard_menu(i_menu &aParentMenu, standard_menu aStandardMenu) override
i_action & action_redo() override
i_action & action_file_save() override
i_action & action_undo() override
void remove_action(i_action &aAction) override
app(const neolib::i_application_info &aAppInfo)
i_action & action_file_close_all() override
i_action & add_action(i_string const &aText, const i_texture &aImage) override
app_thread & thread() const noexcept
action actionFileCloseAll
i_action & add_action(i_ref_ptr< i_action > const &aAction) override
i_action & action_copy() override
i_action & action_file_new() override
i_event_processing_context & event_processing_context() override
i_action & action_file_open() override
bool console() const final
const boost::program_options::variables_map & options() const final
program_options(int argc, char *argv[])
std::optional< size_u32 > full_screen() const final
std::optional< size_u32 > dpi_override() const final
friend class async_thread
bool do_work(yield_type aYieldType=yield_type::NoYield) override
default_geometry_value_type dimension
translatable_string translate(string const &aTranslatableString)
basic_size< uint32_t > size_u32
dimension x2_dpi_scale_factor(dimension aPpi)
dimension xn_dpi_scale_factor(dimension aPpi)
#define define_declared_event(name, declName,...)