opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
osc::App Class Reference

#include <app.h>

Inheritance diagram for osc::App:
[legend]

Public Member Functions

 App ()
 
 App (const AppMetadata &)
 
 App (const App &)=delete
 
 App (App &&) noexcept=delete
 
Appoperator= (const App &)=delete
 
Appoperator= (App &&) noexcept=delete
 
 ~App () noexcept
 
const AppMetadatametadata () const
 
std::string human_readable_name () const
 
std::string application_name_with_version_and_buildid () const
 
std::optional< std::filesystem::path > executable_directory () const
 
const std::filesystem::path & user_data_directory () const
 
void setup_main_loop (std::unique_ptr< Widget >)
 
template<std::derived_from< Widget > TWidget, typename... Args>
requires std::constructible_from<TWidget, Args&&...>
void setup_main_loop (Args &&... args)
 
AppMainLoopStatus do_main_loop_step ()
 
void teardown_main_loop ()
 
void show (std::unique_ptr< Widget >)
 
template<std::derived_from< Widget > TWidget, typename... Args>
requires std::constructible_from<TWidget, Args&&...>
void show (Args &&... args)
 
void request_transition (std::unique_ptr< Widget >)
 
template<std::derived_from< Widget > TWidget, typename... Args>
requires std::constructible_from<TWidget, Args&&...>
void request_transition (Args &&... args)
 
void request_quit ()
 
void request_invoke_on_main_thread (std::function< void()>)
 
std::optional< std::filesystem::path > prompt_initial_directory_to_show_fallback ()
 
void set_prompt_initial_directory_to_show_fallback (std::optional< std::filesystem::path >)
 
void prompt_user_to_select_file_async (std::function< void(FileDialogResponse &&)> callback, std::span< const FileDialogFilter > filters={}, std::optional< std::filesystem::path > initial_directory_to_show=std::nullopt, bool allow_many=false)
 
void prompt_user_to_select_file_async (std::function< void(FileDialogResponse &&)> callback, std::initializer_list< const FileDialogFilter > filters={}, std::optional< std::filesystem::path > initial_directory_to_show=std::nullopt, bool allow_many=false)
 
void prompt_user_to_select_directory_async (std::function< void(FileDialogResponse &&)> callback, std::optional< std::filesystem::path > initial_directory_to_show=std::nullopt, bool allow_many=false)
 
void prompt_user_to_save_file_async (std::function< void(FileDialogResponse &&)> callback, std::span< const FileDialogFilter > filters={}, std::optional< std::filesystem::path > initial_directory_to_show=std::nullopt)
 
void prompt_user_to_save_file_async (std::function< void(FileDialogResponse &&)> callback, std::initializer_list< const FileDialogFilter > filters={}, std::optional< std::filesystem::path > initial_directory_to_show=std::nullopt)
 
void prompt_user_to_save_file_with_extension_async (std::function< void(std::optional< std::filesystem::path >)> callback, std::optional< std::string_view > maybe_extension=std::nullopt, std::optional< std::filesystem::path > initial_directory_to_show=std::nullopt)
 
void push_cursor_override (const Cursor &)
 
void pop_cursor_override ()
 
WindowID main_window_id () const
 
Vector2 main_window_dimensions () const
 
void set_main_window_dimensions (Vector2)
 
Vector2i main_window_pixel_dimensions () const
 
float main_window_device_pixel_ratio () const
 
bool is_main_window_minimized () const
 
bool main_window_grabbing () const
 
void set_main_window_grabbing (bool)
 
bool main_window_relative_mouse_mode () const
 
void set_main_window_relative_mouse_mode (bool)
 
std::optional< Rectmain_window_mouse_confinement () const
 
void set_main_window_mouse_confinement (std::optional< Rect > confinement_rect)
 
void set_main_window_mouse_confinement (std::optional< Vector2 > confinement_point)
 
void set_main_window_mouse_confinement (std::nullopt_t)
 
std::optional< Vector2main_window_mouse_position () const
 
bool main_window_showing () const
 
void set_main_window_showing (bool)
 
void focus_main_window ()
 
void set_main_window_unicode_input_rect (const Rect &screen_rect)
 
void make_main_window_fullscreen ()
 
void make_main_window_windowed ()
 
void set_main_window_subtitle (std::optional< std::string_view >)
 
void main_window_add_frame_annotation (std::string_view label, const Rect &screen_rect)
 
std::future< Screenshotmain_window_request_screenshot ()
 
void main_window_clear (const Color &=Color::clear())
 
bool has_input_focus (WindowID) const
 
WindowID get_keyboard_focus () const
 
void start_text_input (WindowID)
 
void stop_text_input (WindowID)
 
float highest_device_pixel_ratio () const
 
AntiAliasingLevel anti_aliasing_level () const
 
void set_anti_aliasing_level (AntiAliasingLevel)
 
AntiAliasingLevel max_anti_aliasing_level () const
 
bool debug_mode () const
 
void set_debug_mode (bool)
 
bool vsync_enabled () const
 
void set_vsync_enabled (bool)
 
std::string graphics_backend_vendor_string () const
 
std::string graphics_backend_renderer_string () const
 
std::string graphics_backend_version_string () const
 
std::string graphics_backend_shading_language_version_string () const
 
size_t num_frames_drawn () const
 
AppClock::time_point startup_time () const
 
AppClock::duration frame_delta_since_startup () const
 
AppClock::time_point frame_start_time () const
 
AppClock::duration frame_delta_since_last_frame () const
 
bool is_main_loop_waiting () const
 
void set_main_loop_waiting (bool)
 
void make_main_loop_waiting ()
 
void make_main_loop_polling ()
 
void request_redraw ()
 
void process_events ()
 

Static Public Member Functions

template<std::destructible T, typename... Args>
requires std::constructible_from<T, Args&&...>
static std::shared_ptr< Tsingleton (Args &&... args)
 
static Appupd ()
 
static const Appget ()
 
static Apptry_upd ()
 
static const Apptry_get ()
 
static const AppSettingssettings ()
 
static AppSettingsupd_settings ()
 
static std::optional< std::filesystem::path > resource_filepath (const ResourcePath &)
 
static std::string slurp (const ResourcePath &)
 
static ResourceStream open_resource (const ResourcePath &)
 
static ResourceLoaderresource_loader ()
 
template<std::derived_from< Widget > TWidget, typename... Args>
requires std::constructible_from<TWidget, Args&&...>
static int main (const AppMetadata &metadata, Args &&... args)
 
static void post_event (Widget &receiver, std::unique_ptr< Event > event)
 
template<std::derived_from< Event > TEvent, typename... Args>
requires std::constructible_from<TEvent, Args&&...>
static void post_event (Widget &receiver, Args &&... args)
 
static bool notify (Widget &receiver, Event &event)
 
template<std::derived_from< Event > TEvent, typename... Args>
requires std::constructible_from<TEvent, Args&&...>
static bool notify (Widget &receiver, Args &&... args)
 

Constructor & Destructor Documentation

◆ App() [1/4]

osc::App::App ( )

◆ App() [2/4]

osc::App::App ( const AppMetadata )
explicit

◆ App() [3/4]

osc::App::App ( const App )
delete

◆ App() [4/4]

osc::App::App ( App &&  )
deletenoexcept

◆ ~App()

osc::App::~App ( )
noexcept

Member Function Documentation

◆ anti_aliasing_level()

AntiAliasingLevel osc::App::anti_aliasing_level ( ) const

◆ application_name_with_version_and_buildid()

std::string osc::App::application_name_with_version_and_buildid ( ) const

◆ debug_mode()

bool osc::App::debug_mode ( ) const

◆ do_main_loop_step()

AppMainLoopStatus osc::App::do_main_loop_step ( )

◆ executable_directory()

std::optional< std::filesystem::path > osc::App::executable_directory ( ) const

◆ focus_main_window()

void osc::App::focus_main_window ( )

◆ frame_delta_since_last_frame()

AppClock::duration osc::App::frame_delta_since_last_frame ( ) const

◆ frame_delta_since_startup()

AppClock::duration osc::App::frame_delta_since_startup ( ) const

◆ frame_start_time()

AppClock::time_point osc::App::frame_start_time ( ) const

◆ get()

static const App & osc::App::get ( )
static

◆ get_keyboard_focus()

WindowID osc::App::get_keyboard_focus ( ) const

◆ graphics_backend_renderer_string()

std::string osc::App::graphics_backend_renderer_string ( ) const

◆ graphics_backend_shading_language_version_string()

std::string osc::App::graphics_backend_shading_language_version_string ( ) const

◆ graphics_backend_vendor_string()

std::string osc::App::graphics_backend_vendor_string ( ) const

◆ graphics_backend_version_string()

std::string osc::App::graphics_backend_version_string ( ) const

◆ has_input_focus()

bool osc::App::has_input_focus ( WindowID  ) const

◆ highest_device_pixel_ratio()

float osc::App::highest_device_pixel_ratio ( ) const

◆ human_readable_name()

std::string osc::App::human_readable_name ( ) const

◆ is_main_loop_waiting()

bool osc::App::is_main_loop_waiting ( ) const

◆ is_main_window_minimized()

bool osc::App::is_main_window_minimized ( ) const

◆ main()

template<std::derived_from< Widget > TWidget, typename... Args>
requires std::constructible_from<TWidget, Args&&...>
static int osc::App::main ( const AppMetadata metadata,
Args &&...  args 
)
inlinestatic

◆ main_window_add_frame_annotation()

void osc::App::main_window_add_frame_annotation ( std::string_view  label,
const Rect screen_rect 
)

◆ main_window_clear()

void osc::App::main_window_clear ( const Color = Color::clear())

◆ main_window_device_pixel_ratio()

float osc::App::main_window_device_pixel_ratio ( ) const

◆ main_window_dimensions()

Vector2 osc::App::main_window_dimensions ( ) const

◆ main_window_grabbing()

bool osc::App::main_window_grabbing ( ) const

◆ main_window_id()

WindowID osc::App::main_window_id ( ) const

◆ main_window_mouse_confinement()

std::optional< Rect > osc::App::main_window_mouse_confinement ( ) const

◆ main_window_mouse_position()

std::optional< Vector2 > osc::App::main_window_mouse_position ( ) const

◆ main_window_pixel_dimensions()

Vector2i osc::App::main_window_pixel_dimensions ( ) const

◆ main_window_relative_mouse_mode()

bool osc::App::main_window_relative_mouse_mode ( ) const

◆ main_window_request_screenshot()

std::future< Screenshot > osc::App::main_window_request_screenshot ( )

◆ main_window_showing()

bool osc::App::main_window_showing ( ) const

◆ make_main_loop_polling()

void osc::App::make_main_loop_polling ( )

◆ make_main_loop_waiting()

void osc::App::make_main_loop_waiting ( )

◆ make_main_window_fullscreen()

void osc::App::make_main_window_fullscreen ( )

◆ make_main_window_windowed()

void osc::App::make_main_window_windowed ( )

◆ max_anti_aliasing_level()

AntiAliasingLevel osc::App::max_anti_aliasing_level ( ) const

◆ metadata()

const AppMetadata & osc::App::metadata ( ) const

◆ notify() [1/2]

template<std::derived_from< Event > TEvent, typename... Args>
requires std::constructible_from<TEvent, Args&&...>
static bool osc::App::notify ( Widget receiver,
Args &&...  args 
)
inlinestatic

◆ notify() [2/2]

static bool osc::App::notify ( Widget receiver,
Event event 
)
static

◆ num_frames_drawn()

size_t osc::App::num_frames_drawn ( ) const

◆ open_resource()

static ResourceStream osc::App::open_resource ( const ResourcePath )
static

◆ operator=() [1/2]

App & osc::App::operator= ( App &&  )
deletenoexcept

◆ operator=() [2/2]

App & osc::App::operator= ( const App )
delete

◆ pop_cursor_override()

void osc::App::pop_cursor_override ( )

◆ post_event() [1/2]

template<std::derived_from< Event > TEvent, typename... Args>
requires std::constructible_from<TEvent, Args&&...>
static void osc::App::post_event ( Widget receiver,
Args &&...  args 
)
inlinestatic

◆ post_event() [2/2]

static void osc::App::post_event ( Widget receiver,
std::unique_ptr< Event event 
)
static

◆ process_events()

void osc::App::process_events ( )

◆ prompt_initial_directory_to_show_fallback()

std::optional< std::filesystem::path > osc::App::prompt_initial_directory_to_show_fallback ( )

◆ prompt_user_to_save_file_async() [1/2]

void osc::App::prompt_user_to_save_file_async ( std::function< void(FileDialogResponse &&)>  callback,
std::initializer_list< const FileDialogFilter filters = {},
std::optional< std::filesystem::path >  initial_directory_to_show = std::nullopt 
)
inline

◆ prompt_user_to_save_file_async() [2/2]

void osc::App::prompt_user_to_save_file_async ( std::function< void(FileDialogResponse &&)>  callback,
std::span< const FileDialogFilter filters = {},
std::optional< std::filesystem::path >  initial_directory_to_show = std::nullopt 
)

◆ prompt_user_to_save_file_with_extension_async()

void osc::App::prompt_user_to_save_file_with_extension_async ( std::function< void(std::optional< std::filesystem::path >)>  callback,
std::optional< std::string_view >  maybe_extension = std::nullopt,
std::optional< std::filesystem::path >  initial_directory_to_show = std::nullopt 
)

◆ prompt_user_to_select_directory_async()

void osc::App::prompt_user_to_select_directory_async ( std::function< void(FileDialogResponse &&)>  callback,
std::optional< std::filesystem::path >  initial_directory_to_show = std::nullopt,
bool  allow_many = false 
)

◆ prompt_user_to_select_file_async() [1/2]

void osc::App::prompt_user_to_select_file_async ( std::function< void(FileDialogResponse &&)>  callback,
std::initializer_list< const FileDialogFilter filters = {},
std::optional< std::filesystem::path >  initial_directory_to_show = std::nullopt,
bool  allow_many = false 
)
inline

◆ prompt_user_to_select_file_async() [2/2]

void osc::App::prompt_user_to_select_file_async ( std::function< void(FileDialogResponse &&)>  callback,
std::span< const FileDialogFilter filters = {},
std::optional< std::filesystem::path >  initial_directory_to_show = std::nullopt,
bool  allow_many = false 
)

◆ push_cursor_override()

void osc::App::push_cursor_override ( const Cursor )

◆ request_invoke_on_main_thread()

void osc::App::request_invoke_on_main_thread ( std::function< void()>  )

◆ request_quit()

void osc::App::request_quit ( )

◆ request_redraw()

void osc::App::request_redraw ( )

◆ request_transition() [1/2]

template<std::derived_from< Widget > TWidget, typename... Args>
requires std::constructible_from<TWidget, Args&&...>
void osc::App::request_transition ( Args &&...  args)
inline

◆ request_transition() [2/2]

void osc::App::request_transition ( std::unique_ptr< Widget )

◆ resource_filepath()

static std::optional< std::filesystem::path > osc::App::resource_filepath ( const ResourcePath )
static

◆ resource_loader()

static ResourceLoader & osc::App::resource_loader ( )
static

◆ set_anti_aliasing_level()

void osc::App::set_anti_aliasing_level ( AntiAliasingLevel  )

◆ set_debug_mode()

void osc::App::set_debug_mode ( bool  )

◆ set_main_loop_waiting()

void osc::App::set_main_loop_waiting ( bool  )

◆ set_main_window_dimensions()

void osc::App::set_main_window_dimensions ( Vector2  )

◆ set_main_window_grabbing()

void osc::App::set_main_window_grabbing ( bool  )

◆ set_main_window_mouse_confinement() [1/3]

void osc::App::set_main_window_mouse_confinement ( std::nullopt_t  )

◆ set_main_window_mouse_confinement() [2/3]

void osc::App::set_main_window_mouse_confinement ( std::optional< Rect confinement_rect)

◆ set_main_window_mouse_confinement() [3/3]

void osc::App::set_main_window_mouse_confinement ( std::optional< Vector2 confinement_point)

◆ set_main_window_relative_mouse_mode()

void osc::App::set_main_window_relative_mouse_mode ( bool  )

◆ set_main_window_showing()

void osc::App::set_main_window_showing ( bool  )

◆ set_main_window_subtitle()

void osc::App::set_main_window_subtitle ( std::optional< std::string_view >  )

◆ set_main_window_unicode_input_rect()

void osc::App::set_main_window_unicode_input_rect ( const Rect screen_rect)

◆ set_prompt_initial_directory_to_show_fallback()

void osc::App::set_prompt_initial_directory_to_show_fallback ( std::optional< std::filesystem::path >  )

◆ set_vsync_enabled()

void osc::App::set_vsync_enabled ( bool  )

◆ settings()

static const AppSettings & osc::App::settings ( )
static

◆ setup_main_loop() [1/2]

template<std::derived_from< Widget > TWidget, typename... Args>
requires std::constructible_from<TWidget, Args&&...>
void osc::App::setup_main_loop ( Args &&...  args)
inline

◆ setup_main_loop() [2/2]

void osc::App::setup_main_loop ( std::unique_ptr< Widget )

◆ show() [1/2]

template<std::derived_from< Widget > TWidget, typename... Args>
requires std::constructible_from<TWidget, Args&&...>
void osc::App::show ( Args &&...  args)
inline

◆ show() [2/2]

void osc::App::show ( std::unique_ptr< Widget )

◆ singleton()

template<std::destructible T, typename... Args>
requires std::constructible_from<T, Args&&...>
static std::shared_ptr< T > osc::App::singleton ( Args &&...  args)
inlinestatic

◆ slurp()

static std::string osc::App::slurp ( const ResourcePath )
static

◆ start_text_input()

void osc::App::start_text_input ( WindowID  )

◆ startup_time()

AppClock::time_point osc::App::startup_time ( ) const

◆ stop_text_input()

void osc::App::stop_text_input ( WindowID  )

◆ teardown_main_loop()

void osc::App::teardown_main_loop ( )

◆ try_get()

static const App * osc::App::try_get ( )
static

◆ try_upd()

static App * osc::App::try_upd ( )
static

◆ upd()

static App & osc::App::upd ( )
static

◆ upd_settings()

static AppSettings & osc::App::upd_settings ( )
static

◆ user_data_directory()

const std::filesystem::path & osc::App::user_data_directory ( ) const

◆ vsync_enabled()

bool osc::App::vsync_enabled ( ) const

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