37 using namespace ystdex;
56 using namespace YReader;
60 template<
typename _tTarget>
64 if(!GlobalResourceMap[idx])
66 return GlobalResourceMap[GR_BGs].GetObject<_tTarget>();
70 FetchGlobalImage(
size_t idx)
72 auto& spi(FetchGlobalResource<array<shared_ptr<Image>, 10>>(GR_BGs));
80 using namespace Shells;
81 using namespace Drawing::ColorSpace;
86 for(
size_t i(0); i !=
Image_N; ++i)
87 FetchGlobalImage(i).reset();
88 GlobalResourceMap.clear();
89 ReleaseStored<ShlReader>();
90 ReleaseStored<ShlExplorer>();
98 return {~(x * y) >> 2, x | y | 128, 240 - ((x & y) >> 1)};
101 return {(x << 4) / (y | 1), (x | y << 1) % (y + 2),
102 (~y | x << 1) % 27 + 3};
105 return {~(x * y) >> 2, x | y | 128, 240 - ((x & y) >> 1)};
109 if(!FetchGlobalImage(i) && p_bg[i])
111 auto& h(FetchGlobalImage(i));
114 h = make_shared<Image>(
nullptr, MainScreenWidth, MainScreenHeight);
119 return FetchGlobalImage(i);
125 return gfx_init_time;
140 "Window",
"Label",
"Button",
"CheckButton",
"RadioButton",
141 "DropDownList",
"FileBox",
"TextBox",
"TabBar",
"TabControl"}),
142 wgt_ldr.
Bounds.Register<
Widget, Control, Panel, Window, Label,
143 Button, CheckButton, RadioButton, DropDownList, FileBox,
144 TextBox, TabBar,
TabControl>({
"Widget",
"Control",
"Panel",
145 "Window",
"Label",
"Button",
"CheckButton",
"RadioButton",
146 "DropDownList",
"FileBox",
"TextBox",
"TabBar",
"TabControl"}),
148 "TabBar",
"TabControl"}),
159 const String& text,
SDst w)
162 auto p_tab(make_shared<Button>(
Rect(0, 0, w, tc.
BarHeight)));
167 node += {0,
name, std::move(p_tab)};
GWidgetInserterRegister< IWidget & > Insert
const vector< Panel * > tab_pages void Attach(Control &)
附加:添加 TouchDown 事件处理器。
GWidgetInserterRegister< IWidget &, const ZOrderType & > InsertZOrdered
GetTabBarRef().GetCount()) DefGetter(const ynothrow
#define yunused(...)
标记未使用的表达式。
std::uint16_t SDst
屏幕坐标距离。
#define DeclResource(_name)
auto once(_fNow now, _fCallable &&f, _tParams &&...args) -> decltype(now()-now())
测试指定函数执行一次的时间。
void Register(const _tKey &key)
yconstfn const string & name
map< ResourceIndex, ValueObject > ResourceMap
WidgetLoader & FetchWidgetLoader()
void ScrDraw(_tOut buf, _tGen &&f)
全屏幕描点。
GWidgetRegister< const Rect & > Bounds
shared_ptr< Image > & FetchImage(size_t)
void AddButtonToTabBar(TabControl &, const ValueNode &, const string &, const String &, SDst=64)
向标签栏和节点添加按钮。
decltype(__LINE__) ResourceIndex
bool IsInInterval(_type i, _type b) ynothrow
判断 i 是否在左闭右开区间 [FetchZero<_type>(), b) 中。
double FetchImageLoadTime()
yconstexpr size_t Image_N(3)
#define YAssert(_expr, _msg)