29 #include YFM_Helper_GUIApplication
30 #include YFM_Helper_Host
31 #include YFM_Helper_Initialization
32 #if YF_Multithread == 1
39 using namespace Drawing;
45 GUIApplication* ApplicationPtr;
79 YAssert(!ApplicationPtr,
"Duplicate instance found.");
80 ApplicationPtr =
this;
83 p_hosted = make_unique<Host::Environment>();
95 GUIApplication::GetHost()
105 return AccessQueue([
this](MessageQueue& mq){
106 using namespace Shells;
113 const auto i(mq.cbegin());
131 return *ApplicationPtr;
145 Host::FetchEnvironment().ExitOnAllWindowThreadCompleted =
true;
148 throw LoggedEvent(
"Failed activating the main shell.");
YF_API Application & FetchAppInstance() ynothrow
取应用程序实例。
YF_API void PostMessage(const Message &, Messaging::Priority) ynothrow
全局默认队列消息发送函数。
Messaging::Priority UIResponseLimit
用户界面输入响应阈值。
_tApp & FetchGlobalInstance() ynothrow
~GUIApplication() override
析构:释放资源。
YF_API void Execute(GUIApplication &, shared_ptr< Shell >=make_shared< Shells::GUIShell >())
执行程序主消息循环。
#define YB_UNLIKELY(expr)
分支预测提示。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
bool Activate(const shared_ptr< Shell > &hShl)
激活 Shell 对象:控制权转移给此对象以维持单线程运行。
#define YAssertNonnull(_expr)
if(YB_LIKELY(!error)) if(YB_LIKELY(!(error
YF_API void Uninitialize() ynothrow
反初始化。
YF_API void InitializeEnviornment()
初始化环境。
void OnGotMessage(const Message &) override
处理消息:分发消息。
bool DealMessage()
处理当前消息。
GUIApplication()
private 构造函数:非内联。
#define YAssert(_expr, _msg)