/** ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** * Copyright 2014 Ben Vanik. All rights reserved. * * Released under the BSD license - see LICENSE in the root for more details. * ****************************************************************************** */ #ifndef XENIA_UI_LOOP_H_ #define XENIA_UI_LOOP_H_ #include #include #include "xenia/base/delegate.h" #include "xenia/ui/ui_event.h" namespace xe { namespace ui { class Loop { public: static std::unique_ptr Create(); Loop(); virtual ~Loop(); // Returns true if the currently executing code is within the loop thread. virtual bool is_on_loop_thread() = 0; virtual void Post(std::function fn) = 0; virtual void PostDelayed(std::function fn, uint64_t delay_millis) = 0; void PostSynchronous(std::function fn); virtual void Quit() = 0; virtual void AwaitQuit() = 0; Delegate on_quit; }; } // namespace ui } // namespace xe #endif // XENIA_UI_LOOP_H_