YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
GUIApplication.h
浏览该文件的文档.
1 /*
2  © 2013-2014 FrankHB.
3 
4  This file is part of the YSLib project, and may only be used,
5  modified, and distributed under the terms of the YSLib project
6  license, LICENSE.TXT. By continuing to use, modify, or distribute
7  this file you indicate that you have read the license and
8  understand and accept it fully.
9 */
10 
28 #ifndef INC_Helper_GUIApplication_h_
29 #define INC_Helper_GUIApplication_h_ 1
30 
31 #include "YModules.h"
32 #include YFM_Helper_YGlobal
33 #include YFM_YCLib_NativeAPI
34 #include YFM_YSLib_Core_YApplication
35 #include <ystdex/cast.hpp>
36 #include YFM_Helper_GUIShell
37 #if YCL_Win32
38 # include YFM_MinGW32_YCLib_Win32GUI
39 #elif YCL_Android
40 # include YFM_Android_YCLib_Android
41 #endif
42 
43 namespace YSLib
44 {
45 
52 {
53 #if YF_Hosted
54 private:
58  unique_ptr<Host::Environment> p_hosted;
59 #endif
60 
61 public:
68  Messaging::Priority UIResponseLimit = 0x40;
69 
78  ~GUIApplication() override;
79 
80 #if YF_Hosted
81  Host::Environment&
82  GetHost();
83 #endif
84 
95  bool
96  DealMessage();
97 };
98 
99 
109 template<class _tApp>
110 inline _tApp&
112 {
113  return ystdex::polymorphic_downcast<_tApp&>(FetchGlobalInstance());
114 }
116 
117 #if YF_Hosted
118 namespace Host
119 {
120 
122 inline Environment&
123 FetchEnvironment() ynothrow
124 {
125  return FetchGlobalInstance().GetHost();
126 }
127 
128 } // namespace Host;
129 #endif
130 
136 YF_API void
137 Execute(GUIApplication&, shared_ptr<Shell> = make_shared<Shells::GUIShell>());
138 
139 } // namespace YSLib;
140 
141 #endif
142 
#define YF_API
Definition: Platform.h:64
_tApp & FetchGlobalInstance() ynothrow
YF_API void Execute(GUIApplication &, shared_ptr< Shell >=make_shared< Shells::GUIShell >())
执行程序主消息循环。
C++ 转换模板。
程序实例。
Definition: yapp.h:46
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
平台相关的应用程序类。
YF_API yimpl(GUIApplication &) FetchGlobalInstance() ynothrow
取全局应用程序实例。
u8 Priority
消息优先级。
Definition: ymsg.h:52