29 #ifndef YCL_MinGW32_INC_Win32GUI_h_
30 #define YCL_MinGW32_INC_Win32GUI_h_ 1
33 #include YFM_MinGW32_YCLib_MinGW32
34 #include YFM_YSLib_Core_YGDIBase
35 #include YFM_YSLib_Core_YEvent
45 inline namespace Windows
75 GetClientBounds()
const;
77 GetClientLocation()
const;
79 GetClientSize()
const;
97 SetClientBounds(const YSLib::Drawing::Rect&);
110 SetText(const
wchar_t*);
128 Move(const YSLib::Drawing::
Point&);
135 Resize(const YSLib::Drawing::Size&);
142 ResizeClient(const YSLib::Drawing::Size&);
159 const
wchar_t* = L"", ::DWORD = WS_POPUP, ::DWORD = WS_EX_LTRREADING);
182 ScreenBuffer(ScreenBuffer&&) ynothrow;
187 operator=(ScreenBuffer&&);
192 DefGetter(const ynothrow, ::HBITMAP, NativeHandle, hBitmap)
193 DefGetter(const ynothrow, const YSLib::Drawing::Size&, Size, size)
202 Premultiply(YSLib::Drawing::BitmapPtr) ynothrow;
210 Resize(const YSLib::Drawing::Size&);
219 UpdateFrom(YSLib::Drawing::BitmapPtr) ynothrow;
227 swap(ScreenBuffer&) ynothrow;
234 inline DefSwap(ynothrow, ScreenBuffer)
249 : ScreenBuffer(s), mtx()
252 using ScreenBuffer::GetBufferPtr;
253 using ScreenBuffer::GetNativeHandle;
254 using ScreenBuffer::GetSize;
255 DefGetter(ynothrow, ScreenBuffer&, ScreenBufferRef, *
this)
258 using ScreenBuffer::Premultiply;
260 using ScreenBuffer::Resize;
264 UpdateFrom(YSLib::Drawing::BitmapPtr) ynothrow;
269 const YSLib::Drawing::Point& = {}) ynothrow;
290 : h_owner_dc(h_dc), h_mem_dc(::CreateCompatibleDC(h_dc))
294 ::DeleteDC(h_mem_dc);
297 DefGetter(
const ynothrow, ::HDC, OwnerHandle, h_owner_dc)
298 DefGetter(const ynothrow, ::HDC, NativeHandle, h_mem_dc)
302 Update(ScreenBuffer&, const YSLib::Drawing::Point& = {}) ynothrow;
306 ImplExpr(Update(rbuf.GetScreenBufferRef(), pt))
311 YSLib::Drawing::AlphaType = 0xFF, const YSLib::Drawing::Point& = {})
319 UpdatePremultiplied(rbuf.GetScreenBufferRef(), h_wnd, a, pt);
331 : hWindow(h_wnd), hDC(h_dc)
336 DefGetter(const ynothrow, ::HDC, DeviceContextHandle, hDC)
349 : WindowDeviceContextBase(h_wnd, ::GetDC(h_wnd))
353 ::ReleaseDC(hWindow, hDC);
373 ::EndPaint(hWindow, &ps);
384 template<
typename _type = WindowDeviceContext>
406 ::HBRUSH = ::HBRUSH(COLOR_MENU + 1));
426 std::atomic<bool> BoundsLimited{
false};
432 std::map<::UINT, YSLib::GEvent<void(::WPARAM, ::LPARAM)>>
MessageMap;
NativeWindowHandle hWindow
yconstexpr wchar_t WindowClassName[]
#define DefDeDtor(_t)
定义默认析构函数。
WindowReference(NativeWindowHandle h={})
WindowMemorySurface(::HDC h_dc)
~WindowRegionDeviceContext()
YF_API void Invalidate(IWidget &, const Rect &)
无效化:使相对于部件的指定区域在直接和间接的窗口缓冲区中无效。
std::map<::UINT, YSLib::GEvent< void(::WPARAM,::LPARAM)> > MessageMap
窗口消息转发事件映射。
DefGetter(const ynothrow,::HKEY, Key, h_key)}
void UpdateFrom(YSLib::Drawing::BitmapPtr) ynothrow
YSLib::Drawing::BitmapPtr pBuffer
DefDeCopyCtor(WindowReference) WindowReference(WindowReference &&r) ynothrow
YF_API void Show(IWidget &)
显示部件。
NativeWindowHandle hWindow
YF_API NativeWindowHandle CreateNativeWindow(const wchar_t *, const YSLib::Drawing::Size &, const wchar_t *=L"",::DWORD=WS_POPUP,::DWORD=WS_EX_LTRREADING)
按指定窗口类名、客户区大小、标题文本、样式和附加样式创建本机顶层窗口。
void UpdatePremultiplied(ScreenRegionBuffer &rbuf, NativeWindowHandle h_wnd, YSLib::Drawing::AlphaType a=0xFF, const YSLib::Drawing::Point &pt={}) ynothrow
void swap(any &x, any &y)
交换对象。
不可复制对象:禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
GSurface(NativeWindowHandle h_wnd)
GBinaryGroup< SPos > Point
屏幕二维点(直角坐标表示)。
WindowDeviceContextBase(NativeWindowHandle h_wnd,::HDC h_dc)
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
void UpdateTo(NativeWindowHandle, const YSLib::Drawing::Point &={}) ynothrow
ScreenRegionBuffer(const YSLib::Drawing::Size &s)
虚拟屏幕区域缓存。
ScreenRegionBuffer(const YSLib::Drawing::Size &s)
虚拟屏幕区域缓存。
void UpdatePremultipliedTo(NativeWindowHandle, YSLib::Drawing::AlphaType=0xFF, const YSLib::Drawing::Point &={}) ynothrow
::ANativeWindow * NativeWindowHandle
#define yconstexpr
指定编译时常量表达式。
WindowRegionDeviceContext(NativeWindowHandle h_wnd)
WindowDeviceContext(NativeWindowHandle h_wnd)
#define DefDelMoveCtor(_t)
YSLib::Drawing::Size size