YSTest: DSMain.h 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

DSMain.h
浏览该文件的文档.
1 /*
2 © 2010-2015, 2019-2020 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
29 #ifndef INC_Helper_DSMain_h_
30 #define INC_Helper_DSMain_h_ 1
31
32 #include "Helper/YModules.h"
33 #include YFM_Helper_GUIApplication
34 #include YFM_DS_YCLib_DSVideo // for platform_ex::DSVideoState;
35 #include YFM_YSLib_Service_YResource // for YSLib::Drawing::Image;
36
37 namespace YSLib
38 {
39
40 #if YCL_DS || YF_Hosted
41
51 yconstexpr const SDst MainScreenWidth(256), MainScreenHeight(192);
53
54
55 namespace Devices
56 {
57 class DSScreen;
58 } // namespace Devices;
59
60
66 class YF_API DSApplication : public GUIApplication,
67 private platform_ex::DSVideoState
68 {
69 private:
74 array<unique_ptr<Devices::DSScreen>, 2> scrs;
75
76 # if YCL_Win32
77
81 unique_ptr<Host::WindowThread> p_wnd_thrd;
82 # endif
83
84 public:
89 DSApplication();
90
95 ~DSApplication() override;
96
98 using DSVideoState::IsLCDMainOnTop;
100 DefPred(const ynothrow, ScreenReady, bool(scrs[0]) && bool(scrs[1]))
101
102
107 YB_ATTR_nodiscard YB_PURE Devices::DSScreen&
108 GetDSScreenUp() const ynothrow;
114 YB_ATTR_nodiscard YB_PURE Devices::DSScreen&
115 GetDSScreenDown() const ynothrow;
121 YB_ATTR_nodiscard YB_PURE Devices::Screen&
122 GetScreenUp() const ynothrow;
128 YB_ATTR_nodiscard YB_PURE Devices::Screen&
129 GetScreenDown() const ynothrow;
130
135 void
136 SwapScreens();
137 };
138
139
140 # if YCL_Win32
141 namespace Windows
142 {
143
144 using namespace platform_ex;
145
146 YF_API void
147 TestFramework(size_t);
148
149 } // namespace Windows;
150 # endif
151 #else
152 # error "Only DS and hosted platform supported."
153 #endif
154
155 } // namespace YSLib;
156
157 #endif
158
YB_ATTR_nodiscard
#define YB_ATTR_nodiscard
标记返回值不被忽略的属性。
Definition: ydef.h:715
DefPred
#define DefPred(_q, _n,...)
Definition: YBaseMacro.h:232
yconstexpr
#define yconstexpr
指定编译时常量表达式。
Definition: ydef.h:1072
YB_PURE
#define YB_PURE
指示函数或函数模板实例为纯函数。
Definition: ydef.h:919
platform_ex
平台扩展命名空间。
Definition: Android.h:46
YF_API
#define YF_API
Definition: Platform.h:56
YModules.h
Helper 库模块配置文件。
platform::SDst
std::uint16_t SDst
屏幕坐标距离。
Definition: Video.h:44
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:46
YSLib::ynothrow
YB_PURE const _type size_t n ynothrow
Definition: YCoreUtilities.h:169
const
const Decapsulate const Decapsulate &y ynothrow ContextNode &ctx const
Definition: NPLA1Forms.cpp:1629