29 #include YFM_Helper_Host
30 #include YFM_Helper_GUIApplication // for FetchEnvironent;
31 #include YFM_YCLib_Input // for platform::ClearKeyStates;
36 using namespace Drawing;
44 :
Window(h, FetchEnvironment())
47 : HostWindow(h), env(e)
50 e.AddMappedItem(h,
this);
51 MessageMap[WM_KILLFOCUS] += []{
58 env.get().RemoveMappedItem(GetNativeHandle());
62 Window::GetInputBounds() const
ynothrow
67 if(
YB_UNLIKELY(!::GetClientRect(GetNativeHandle(), &rect)))
69 YAssert(rect.right - rect.left >= 0 && rect.bottom - rect.top >= 0,
70 "Invalid boundary found.");
71 return {
Point(rect.left, rect.top),
Point(rect.right, rect.bottom)};
80 const auto h_wnd(GetNativeHandle());
85 rbuf.Premultiply(buf);
86 rbuf.UpdatePremultipliedTo(h_wnd, Opacity);
Window(const Rect &={}, unique_ptr< Renderer >=make_unique< BufferedRenderer >())
构造:使用指定边界并设置渲染器。
#define YB_UNLIKELY(expr)
分支预测提示。
GBinaryGroup< SPos > Point
屏幕二维点(直角坐标表示)。
DefGetter(ynothrow, ScreenBuffer &, ScreenBufferRef,*this) using ScreenBuffer voi UpdateFrom)(YSLib::Drawing::BitmapPtr) ynothrow
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
::ANativeWindow * NativeWindowHandle
YF_API void ClearKeyStates()
清除按键缓冲。
ScreenRegionBuffer(const YSLib::Drawing::Size &, YSLib::SDst)
构造:使用指定的缓冲区大小和像素跨距。 像素跨距小于缓冲区大小。
#define YAssert(_expr, _msg)