YSTest: HostedGUI.h 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

HostedGUI.h
浏览该文件的文档.
1 /*
2 © 2013-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 YCL_INC_HostedGUI_h_
30 #define YCL_INC_HostedGUI_h_ 1
31
32 #include "YCLib/YModules.h"
33 #include YFM_YCLib_Host // for nptr, map, unique_ptr, ystdex::aligned_storage_t,
34 // ystdex::pun_ref, wstring, wstring_view, string_view, YSLib::recursive_mutex,
35 // YSLib::lock_guard, YSLib::function, u16string_view;
36 #include YFM_YSLib_Core_YEvent // for YSLib::GEvent,
37 // YSLib::string;
38 #include YFM_YSLib_Core_YGraphics // for YSLib::Drawing::Rect,
39 // YSLib::Drawing::Point, YSLib::Drawing::Size;
40 #include YFM_YSLib_Core_YString // for YSLib::String;
41 #if YCL_HostedUI_XCB
42 # include YFM_YCLib_XCB
43 #elif YCL_Win32
44 # include <atomic> // for std::atomic;
45 #elif YCL_Android
46 #elif YF_Hosted
47 # error "Unknown platform without XCB support found."
48 #endif
49
50 #if YF_Hosted && YCL_HostedUI
51 # if YCL_Win32
52
54 struct HBITMAP__;
55 struct HBRUSH__;
56 struct HDC__;
57 struct HINSTANCE__;
58 struct HWND__;
59 using HBITMAP = ::HBITMAP__*;
60 using HBRUSH = ::HBRUSH__*;
61 using HDC = ::HDC__*;
62 using HINSTANCE = ::HINSTANCE__*;
63 using HWND = ::HWND__*;
64 # if YCL_Win64
65 using LPARAM = long long;
66 # else
67 using LPARAM = long;
68 # endif
69 using LRESULT = ::LPARAM;
70 using WPARAM = std::uintptr_t;
71 using WNDPROC = ::LRESULT(__stdcall*)(::HWND, unsigned, ::WPARAM, ::LPARAM);
73
75 struct tagWNDCLASSW;
76 struct tagWNDCLASSEXW;
77 using WNDCLASSW = ::tagWNDCLASSW;
78 using WNDCLASSEXW = ::tagWNDCLASSEXW;
80 # elif YCL_Android
81 struct ANativeWindow;
82 # endif
83
84 namespace platform_ex
85 {
86
87 # if YCL_HostedUI_XCB
88 using NativeWindowHandle = XCB::WindowData*;
90 # elif YCL_Win32
91 using NativeWindowHandle = ::HWND;
94 using WindowStyle = unsigned long;
95 # elif YCL_Android
96 using NativeWindowHandle = ::ANativeWindow*;
98 # endif
99
100
102
103 class YF_API HostWindowDelete
105 {
106 public:
107 using pointer = NativeWindowHandle;
108
109 void
110 operator()(pointer) const ynothrow;
111 };
112
113
114 # if YCL_Win32
115
116 struct YF_API GDIObjectDelete
118 {
119 using pointer = void*;
120
122 void
123 operator()(pointer) const ynothrow;
124 };
126 # endif
127
128
129
131
132
142 # if YCL_HostedUI_XCB
143 using MessageID = std::uint8_t;
144 using MessageHandler = void(void*);
145 # elif YCL_Win32
146 using MessageID = unsigned;
147 using MessageHandler = void(::WPARAM, ::LPARAM, ::LRESULT&);
148 # endif
149
150
151 # if YCL_HostedUI_XCB || YCL_Win32
152
156 using MessageMap = map<MessageID, YSLib::GEvent<MessageHandler>>;
157 # endif
158
159 # if YCL_Win32
160
166 YF_API void
167 BindDefaultWindowProc(NativeWindowHandle, MessageMap&, unsigned,
168 YSLib::EventPriority = 0);
169 # endif
170
171
178 class YF_API WindowReference : private nptr<NativeWindowHandle>
179 {
180 public:
182 DefDeCtor(WindowReference)
184 using nptr::nptr;
186 DefDeCopyMoveCtorAssignment(WindowReference)
187
188 # if YCL_Win32
189 bool
191 IsMaximized() const ynothrow;
193 bool
194 IsMinimized() const ynothrow;
196 bool
197 IsVisible() const ynothrow;
198 # endif
199
200 # if YCL_HostedUI_XCB
201
203 DefGetterMem(const, YSLib::Drawing::Rect, Bounds, Deref())
204 DefGetterMem(const, YSLib::Drawing::Point, Location, Deref())
205 DefGetterMem(const, YSLib::Drawing::Size, Size, Deref())
207 # elif YCL_Win32
208
212 YSLib::Drawing::Rect
213 GetBounds() const;
215
216 YSLib::Drawing::Rect
217 GetClientBounds() const;
218 YSLib::Drawing::Point
219 GetClientLocation() const;
220 YSLib::Drawing::Size
221 GetClientSize() const;
223 YSLib::Drawing::Point
225 GetCursorLocation() const;
226 YSLib::Drawing::Point
227 GetLocation() const;
228 # elif YCL_Android
229 YSLib::SDst
231 GetHeight() const;
232 # endif
233 DefGetter(const ynothrow, NativeWindowHandle, NativeHandle, get())
234 # if YCL_Win32
235
241 YSLib::Drawing::AlphaType
242 GetOpacity() const;
244 yimpl(YB_NORETURN) WindowReference
245 GetParent() const;
247 YSLib::Drawing::Size
248 GetSize() const;
249 # elif YCL_Android
250 DefGetter(const, YSLib::Drawing::Size, Size, {GetWidth(), GetHeight()})
252 YSLib::SDst
253 GetWidth() const;
254 # endif
255
256 # if YCL_HostedUI_XCB
257
259 DefSetterMem(, const YSLib::Drawing::Rect&, Bounds, Deref())
260
261 PDefH(void, Close, )
262 ImplRet(Deref().Close())
263
268 XCB::WindowData&
269 Deref() const;
270
272 PDefH(void, Hide, )
273 ImplRet(Deref().Hide())
274
275 PDefH(void, Invalidate, )
276 ImplRet(Deref().Invalidate())
277
278 PDefH(void, Move, const YSLib::Drawing::Point& pt)
279 ImplRet(Deref().Move(pt))
280
281 PDefH(void, Resize, const YSLib::Drawing::Size& s)
282 ImplRet(Deref().Resize(s))
284
286 PDefH(void, Show, )
287 ImplRet(Deref().Show())
288 # elif YCL_Win32
289
294 void
295 SetBounds(const YSLib::Drawing::Rect&);
301 void
302 SetClientBounds(const YSLib::Drawing::Rect&);
308 void
309 SetOpacity(YSLib::Drawing::AlphaType);
314 void
315 SetText(const wchar_t*);
316
318 void
319 Close();
320
325 void
326 Invalidate();
327
332 void
333 Move(const YSLib::Drawing::Point&);
338 void
339 MoveClient(const YSLib::Drawing::Point&);
340
345 void
346 Resize(const YSLib::Drawing::Size&);
347
353 void
354 ResizeClient(const YSLib::Drawing::Size&);
355
363 bool
364 Show(int = 1) ynothrow;
365 # endif
366
367 protected:
369 using nptr::get_ref;
370 };
371
372
373 # if YCL_HostedUI_XCB || YCL_Android
374
379 YF_API void
380 UpdateContentTo(NativeWindowHandle, const YSLib::Drawing::Rect&,
381 const YSLib::Drawing::ConstGraphics&);
382 # elif YCL_Win32
383
394 YF_API ::HBITMAP
395 CreateCompatibleDIBSection(const YSLib::Drawing::Size&,
396 YSLib::Drawing::BitmapPtr&);
397
404 YF_API NativeWindowHandle
405 CreateNativeWindow(const wchar_t*, const YSLib::Drawing::Size&, const wchar_t*
406 = L"", WindowStyle = 0x80000000L, WindowStyle = 0x00000000L);
407 # endif
408
409
410 # if YCL_HostedUI_XCB || YCL_Android
411
416 class ScreenBufferData;
417 # endif
418
419
430 class YF_API ScreenBuffer
431 {
432 private:
433 # if YCL_HostedUI_XCB || YCL_Android
434
438 unique_ptr<ScreenBufferData> p_impl{};
443 YSLib::SDst width = 0;
444 # elif YCL_Win32
445 YSLib::Drawing::Size size{};
448 YSLib::Drawing::BitmapPtr p_buffer = {};
450 unique_ptr_from<GDIObjectDelete> p_bitmap{};
451 # endif
452
453 public:
458 DefDeCtor(ScreenBuffer)
460 ScreenBuffer(const YSLib::Drawing::Size&);
461 # if YCL_HostedUI_XCB || YCL_Android
462
467 ScreenBuffer(const YSLib::Drawing::Size&, YSLib::SDst);
468 # endif
469
473 ScreenBuffer(ScreenBuffer&&) ynothrow;
474 ~ScreenBuffer();
475
480 PDefHOp(ScreenBuffer&, =, ScreenBuffer&& sbuf) ynothrow
481 ImplRet(swap(sbuf, *this), *this)
482
483 # if YCL_HostedUI_XCB || YCL_Android
484 YB_PURE YSLib::Drawing::BitmapPtr
486 GetBufferPtr() const ynothrow;
488 YSLib::Drawing::Graphics
489 GetContext() const ynothrow;
491 YSLib::Drawing::Size
492 GetSize() const ynothrow;
494 YB_PURE YSLib::SDst
495 GetStride() const ynothrow;
496 # elif YCL_Win32
497
499 DefGetter(const ynothrow, YSLib::Drawing::BitmapPtr, BufferPtr, p_buffer)
500 DefGetter(const ynothrow, ::HBITMAP, NativeHandle,
501 ::HBITMAP(p_bitmap.get()))
502 DefGetter(const ynothrow, const YSLib::Drawing::Size&, Size, size)
503
511 YB_NONNULL(2) void
512 Premultiply(YSLib::Drawing::ConstBitmapPtr) ynothrow;
513 # endif
514
520 void
521 Resize(const YSLib::Drawing::Size&);
522
533 YB_NONNULL(2) void
534 UpdateFrom(YSLib::Drawing::ConstBitmapPtr) ynothrow;
536
537 # if YCL_Win32
538
546 YB_NONNULL(2) void
547 UpdateFromBounds(YSLib::Drawing::ConstBitmapPtr,
548 const YSLib::Drawing::Rect&) ynothrow;
549
554 void
555 UpdatePremultipliedTo(NativeWindowHandle, YSLib::Drawing::AlphaType = 0xFF,
556 const YSLib::Drawing::Point& = {});
557 # endif
558
563 void
564 UpdateTo(NativeWindowHandle, const YSLib::Drawing::Point& = {}) ynothrow;
565
566 # if YCL_Win32
567
571 void
572 UpdateToBounds(NativeWindowHandle, const YSLib::Drawing::Rect&,
573 const YSLib::Drawing::Point& = {}) ynothrow;
574 # endif
575
580 YF_API friend void
581 swap(ScreenBuffer&, ScreenBuffer&) ynothrow;
582 };
583
584
589 class YF_API ScreenRegionBuffer : private ScreenBuffer
590 {
591 private:
593 YSLib::mutex mtx{};
594
595 public:
597 using ScreenBuffer::ScreenBuffer;
602 ScreenRegionBuffer(ScreenRegionBuffer&& rbuf)
603 : ScreenBuffer(std::move(rbuf))
604 {}
605
607 PDefHOp(ScreenRegionBuffer&, =, ScreenRegionBuffer&& rbuf) ynothrow
608 ImplRet(swap(*this, rbuf), *this)
609
610 DefGetter(ynothrow, ScreenBuffer&, ScreenBufferRef, *this)
611
613 PDefH(YSLib::locked_ptr<ScreenBuffer>, Lock, )
614 ImplRet({&GetScreenBufferRef(), mtx})
615
620 friend DefSwap(ynothrow, ScreenRegionBuffer,
621 swap(static_cast<ScreenBuffer&>(_x), static_cast<ScreenBuffer&>(_y)))
622 };
624
625
626 # if YCL_Win32
627
629
633 class YF_API WindowMemorySurface
634 {
635 private:
636 ::HDC h_owner_dc, h_mem_dc;
637
638 public:
639 WindowMemorySurface(::HDC);
640 ~WindowMemorySurface();
641
642 DefGetter(const ynothrow, ::HDC, OwnerHandle, h_owner_dc)
643 DefGetter(const ynothrow, ::HDC, NativeHandle, h_mem_dc)
644
645
650 void
651 UpdateBounds(ScreenBuffer&, const YSLib::Drawing::Rect&,
652 const YSLib::Drawing::Point& = {}) ynothrow;
653
654 void
655 UpdatePremultiplied(ScreenBuffer&, NativeWindowHandle,
656 YSLib::Drawing::AlphaType = 0xFF, const YSLib::Drawing::Point& = {})
657 ynothrow;
659 };
660
661
662 class YF_API WindowDeviceContextBase
663 {
664 protected:
665 NativeWindowHandle hWindow;
666 ::HDC hDC;
667
669 WindowDeviceContextBase(NativeWindowHandle h_wnd, ::HDC h_dc) ynothrow
670 : hWindow(h_wnd), hDC(h_dc)
671 {}
672 DefDeDtor(WindowDeviceContextBase)
673
674 public:
675 DefGetter(const ynothrow, ::HDC, DeviceContextHandle, hDC)
676 DefGetter(const ynothrow, NativeWindowHandle, WindowHandle, hWindow)
677 };
678
679
684 class YF_API WindowDeviceContext : public WindowDeviceContextBase
685 {
686 protected:
691 WindowDeviceContext(NativeWindowHandle);
692 ~WindowDeviceContext();
693 };
694
695
701 class PaintStructData
702 {
703 public:
704 struct Data;
705
706 private:
708 #if YCL_Win64
709 ystdex::aligned_storage_t<72, 8> ps;
710 #else
711 ystdex::aligned_storage_t<64, 4> ps;
712 #endif
713 ystdex::pun_ref<Data> pun;
715
716 public:
717 PaintStructData();
718 ~PaintStructData();
719
720 DefGetter(const ynothrow, Data&, , pun.get())
721 };
722
723
728 class YF_API WindowRegionDeviceContext : protected PaintStructData,
729 public WindowDeviceContextBase, private YSLib::noncopyable
730 {
731 protected:
736 WindowRegionDeviceContext(NativeWindowHandle);
737 ~WindowRegionDeviceContext();
738
739 public:
744 YB_PURE bool
745 IsBackgroundValid() const ynothrow;
746
751 YSLib::Drawing::Rect
752 GetInvalidatedArea() const;
753 };
755
756
762 template<typename _type = WindowDeviceContext>
763 class GSurface : public _type, public WindowMemorySurface
764 {
765 public:
770 GSurface(NativeWindowHandle h_wnd)
771 : _type(YSLib::Nonnull(h_wnd)),
772 WindowMemorySurface(_type::GetDeviceContextHandle())
773 {}
774 };
775
776
781 class YF_API WindowClass final : private YSLib::noncopyable
782 {
783 private:
785 wstring name;
787 unsigned short atom;
788 ::HINSTANCE h_instance;
789
790 public:
795
797
805 YB_NONNULL(2)
806 WindowClass(const wchar_t*, ::WNDPROC = {}, unsigned = 0,
807 ::HBRUSH = ::HBRUSH(4 + 1), ::HINSTANCE = {});
808 WindowClass(const ::WNDCLASSW&);
809 WindowClass(const ::WNDCLASSEXW&);
811
819 WindowClass(wstring_view, unsigned short, ::HINSTANCE);
821 ~WindowClass();
822
824
825 DefGetter(const ynothrow, unsigned short, Atom, atom)
826 DefGetter(const ynothrow, ::HINSTANCE, InstanceHandle, h_instance)
828 DefGetter(const ynothrow, const wstring&, Name, name)
830 };
831
832
834 yconstexpr const wchar_t WindowClassName[]{L"YFramework Window"};
835 # endif
836
837
844 class YF_API HostWindow : private WindowReference, private YSLib::noncopyable
845 {
846 public:
847 # if YCL_HostedUI_XCB
848 const XCB::Atom::NativeType WM_PROTOCOLS, WM_DELETE_WINDOW;
850 # endif
851 # if YCL_HostedUI_XCB || YCL_Win32
852
856 platform_ex::MessageMap MessageMap;
857 # endif
858
873 HostWindow(NativeWindowHandle);
874 DefDelMoveCtor(HostWindow)
875 virtual
876 ~HostWindow();
877
878 # if YCL_Win32
879 using WindowReference::IsMaximized;
882 using WindowReference::IsMinimized;
884 using WindowReference::IsVisible;
885 # endif
886
887 # if YCL_HostedUI_XCB
888
890 using WindowReference::GetBounds;
891 using WindowReference::GetLocation;
892
893 using WindowReference::SetBounds;
895 # elif YCL_Win32
896 using WindowReference::GetBounds;
899
900 using WindowReference::GetClientBounds;
901 using WindowReference::GetClientLocation;
902 using WindowReference::GetClientSize;
904 using WindowReference::GetCursorLocation;
907 using WindowReference::GetLocation;
908 # elif YCL_Android
909 using WindowReference::GetHeight;
911 # endif
912
914 using WindowReference::GetNativeHandle;
915 # if YCL_Win32
916 using WindowReference::GetOpacity;
919 using WindowReference::GetParent;
920 # endif
921 using WindowReference::GetSize;
922 # if YCL_Android
923 using WindowReference::GetWidth;
925 # endif
926
927 # if YCL_Win32
928 using WindowReference::SetBounds;
931 using WindowReference::SetClientBounds;
933 using WindowReference::SetOpacity;
935 using WindowReference::SetText;
936 # endif
937
938 # if YCL_HostedUI_XCB || YCL_Win32
939 using WindowReference::Close;
941
943 using WindowReference::Invalidate;
944
945 # if YCL_Win32
946
953 YB_PURE virtual YSLib::Drawing::Point
954 MapPoint(const YSLib::Drawing::Point&) const;
955 # endif
956
958
959 using WindowReference::Move;
960
961 # if YCL_Win32
962 using WindowReference::MoveClient;
964
965 using WindowReference::Resize;
966
967 using WindowReference::ResizeClient;
968 # endif
969
970 using WindowReference::Show;
972 # if YCL_Win32
973
983 static ::LRESULT __stdcall
984 WindowProcedure(::HWND, unsigned, ::WPARAM, ::LPARAM) ynothrowv;
985 # endif
986 # endif
987 };
988
989
995 class YF_API WindowInputHost
996 {
997 public:
998 HostWindow& Window;
999
1000 # if YCL_Win32
1001 public:
1003 std::atomic<short> RawMouseButton{0};
1004
1005 private:
1011 bool has_hosted_caret;
1013 YSLib::recursive_mutex input_mutex{};
1015 YSLib::String comp_str{};
1017 YSLib::Drawing::Point caret_location{YSLib::Drawing::Point::Invalid};
1018 # endif
1019 public:
1021 WindowInputHost(HostWindow&);
1022 ~WindowInputHost();
1023
1024 #if YCL_Win32
1025
1029 template<typename _func>
1030 auto
1031 AccessInputString(_func f) -> decltype(f(comp_str))
1032 {
1033 using namespace YSLib;
1034 lock_guard<recursive_mutex> lck(input_mutex);
1035
1036 return f(comp_str);
1037 }
1038
1046
1048 void
1050 UpdateCandidateWindowLocation();
1052 void
1053 UpdateCandidateWindowLocation(const YSLib::Drawing::Point&);
1055
1057 void
1058 UpdateCandidateWindowLocationUnlocked();
1060 #endif
1061 };
1062
1063
1064 # if YCL_Win32
1065
1070 class YF_API Clipboard : private YSLib::noncopyable, private YSLib::nonmovable
1071 {
1072 private:
1074 class Data;
1075
1076 public:
1078 using FormatType = unsigned;
1079
1080 Clipboard(NativeWindowHandle);
1081 ~Clipboard();
1082
1087 static bool
1088 IsAvailable(FormatType) ynothrow;
1089
1095 static void
1096 CheckAvailable(FormatType);
1097
1099 void
1100 Clear() ynothrow;
1101
1103 static NativeWindowHandle
1104 GetOpenWindow() ynothrow;
1105
1106 bool
1107 Receive(YSLib::string&);
1108 bool
1109 Receive(YSLib::String&);
1110
1111 private:
1113 bool
1114 ReceiveRaw(FormatType, YSLib::function<void(const Data&)>);
1115
1116 public:
1122 void
1123 Send(string_view);
1124 void
1125 Send(u16string_view);
1127
1133 void
1135 Send(YSLib::Drawing::ConstBitmapPtr, const YSLib::Drawing::Size&);
1136 PDefH(void, Send, const YSLib::Drawing::ConstGraphics& g)
1137 ImplRet(Send(g.GetBufferPtr(), g.GetSize()))
1139
1140 private:
1141 void
1142 SendRaw(FormatType, void*);
1143 };
1144
1145
1174 YF_API YB_NONNULL(1) void
1175 ExecuteShellCommand(const wchar_t*, const wchar_t* = {}, bool = {},
1176 const wchar_t* = {}, int = 1, NativeWindowHandle = {});
1177 # endif
1178
1179 } // namespace platform_ex;
1180
1181 #endif
1182
1183 #endif
1184
DefDeCtor
#define DefDeCtor(_t)
简单通用成员函数定义。
Definition: YBaseMacro.h:157
DefGetterMem
#define DefGetterMem(_q, _t, _n, _m)
Definition: YBaseMacro.h:247
platform::Nonnull
YB_PURE _type && Nonnull(_type &&p) ynothrowv
断言并返回非空参数。
Definition: Debug.h:518
size
size_t size
Definition: memory_resource.cpp:295
ystdex::cpp2017::swap
void swap(optional< _type > &x, optional< _type > &y)
Definition: optional.h:888
ystdex::single_thread::mutex
Definition: pseudo_mutex.h:747
YSLib::Drawing::Size
屏幕区域大小。
Definition: YGDIBase.h:536
YSLib::UI::Hide
YF_API void Hide(IWidget &)
隐藏部件。
Definition: YWidget.cpp:100
yconstexpr
#define yconstexpr
指定编译时常量表达式。
Definition: ydef.h:1072
platform_ex::Windows::PDefH
YB_ATTR_nodiscard YB_STATELESS yconstfn PDefH(bool, IsDirectory, FileAttributes attr) ynothrow ImplRet(attr &Directory) YB_ATTR_nodiscard YB_STATELESS inline PDefH(bool
判断 FileAttributes 是否指定目录。
YB_PURE
#define YB_PURE
指示函数或函数模板实例为纯函数。
Definition: ydef.h:919
YSLib::Drawing::Graphics
GGraphics< BitmapPtr > Graphics
Definition: YGraphics.h:163
YSLib::UI::Styles::Window
@ Window
窗口背景。
Definition: YStyle.h:311
platform_ex
平台扩展命名空间。
Definition: Android.h:46
ystdex::nptr::nptr
nptr()=default
ystdex::cpp2017::string_view
basic_string_view< char > string_view
Definition: string_view.hpp:437
ystdex::cpp2017::wstring_view
basic_string_view< wchar_t > wstring_view
Definition: string_view.hpp:440
ystdex::cpp2014::aligned_storage_t
typename aligned_storage< _vLen, _vAlign >::type aligned_storage_t
Definition: meta.hpp:187
platform_ex::YB_NONNULL
YB_ATTR_nodiscard YB_NONNULL(1) inline PDefH(u16string
构造适合表示路径的 char16_t 字符串。
YSLib::Drawing::GBinaryGroup< SPos >::Invalid
static const GBinaryGroup Invalid
无效（不在屏幕坐标系中）对象。
Definition: YGDIBase.h:298
ystdex::nptr::get_ref
pointer & get_ref()
Definition: pointer.hpp:230
YF_API
#define YF_API
Definition: Platform.h:56
YSLib::UI::Move
@ Move
移动：位置调整。
Definition: YWidgetEvent.h:381
CHRLib::f
f(d, s)
DefDelMoveCtor
#define DefDelMoveCtor(_t)
Definition: YBaseMacro.h:169
platform_ex::Windows::unsigned
YF_API unsigned
Definition: NLS.h:52
YSLib::Drawing::g
The boundary is out of the const Graphics & g
Definition: YDraw.h:161
platform::KeyCategory::Lock
@ Lock
表示锁定键。
Definition: Keys.h:115
NPL::LexemeCategory::Data
@ Data
数据字面量。
YSLib::UI::Invalidate
YF_API void Invalidate(IWidget &, const Rect &)
无效化：使相对部件的指定区域在直接和间接的窗口缓冲区中无效。
Definition: YWidget.cpp:108
ystdex::bases::nonmovable
不可转移对象：禁止继承此类的对象调用默认原型的转移构造函数和转移赋值操作符。
Definition: base.h:90
YSLib::EventPriority
std::uint8_t EventPriority
事件优先级。
Definition: YEvent.hpp:396
DefDeDtor
#define DefDeDtor(_t)
Definition: YBaseMacro.h:177
YSLib::UI::Show
YF_API void Show(IWidget &)
显示部件。
Definition: YWidget.cpp:202
DefDeCopyMoveCtorAssignment
#define DefDeCopyMoveCtorAssignment(_t)
Definition: YBaseMacro.h:202
YSLib::Drawing::ConstGraphics
GGraphics< ConstBitmapPtr > ConstGraphics
Definition: YGraphics.h:160
YSLib::Drawing::GGraphics
二维图形接口上下文模板。
Definition: YGraphics.h:63
YB_NORETURN
#define YB_NORETURN
指定无返回值函数。
Definition: ydef.h:877
YSLib::Drawing::Point
GBinaryGroup< SPos > Point
屏幕二维点（直角坐标表示）。
Definition: YGDIBase.h:520
DefSwap
#define DefSwap(_q, _t,...)
定义交换函数。
Definition: YBaseMacro.h:302
YSLib::Text::String
YSLib 标准字符串（使用 UCS-2 作为内部编码）。
Definition: YString.h:47
std
Definition: optional.h:982
YSLib::Drawing::GBinaryGroup< SPos >
YSLib::Drawing::GetSize
dst GetSize()
ystdex::single_thread::recursive_mutex
Definition: pseudo_mutex.h:773
platform::SDst
std::uint16_t SDst
屏幕坐标距离。
Definition: Video.h:44
YSLib::UI::Close
void Close(IWidget &wgt)
Definition: YWidget.cpp:92
YSLib::UI::Resize
@ Resize
大小调整。
Definition: YWidgetEvent.h:383
platform::KeyCodes::DS::L
@ L
Definition: Keys.h:228
YSLib::Drawing::AlphaType
octet AlphaType
Alpha 分量类型。
Definition: YGDIBase.h:49
ystdex::cpp2017::wstring
basic_string< wchar_t > wstring
Definition: string.hpp:775
YSLib::Drawing::Rect
屏幕标准矩形：表示屏幕矩形区域。
Definition: YGDIBase.h:788
ystdex::cpp2017::u16string_view
basic_string_view< char16_t > u16string_view
Definition: string_view.hpp:438
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:46
CHRLib::s
_tDst const _tSrc * s
Definition: CharacterProcessing.h:143
NPL::A1::name
const char * name
Definition: NPLA1.h:1876
ystdex::locked_ptr
threading::locked_ptr< _type, _tMutex, _tLock > locked_ptr
独占所有权的锁定指针：默认使用标准库互斥量和锁。
Definition: concurrency.h:61
platform::Deref
YB_PURE yconstfn auto Deref(_type &&p) -> decltype(*p)
断言并解引用非空指针。
Definition: Debug.h:547
ynothrowv
#define ynothrowv
YSLib 无异常抛出保证验证：有条件地使用无异常抛出规范。
Definition: ydef.h:1219
YModules.h
YCLib 库模块配置文件。
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:241
YSLib::Drawing::ConstBitmapPtr
const Pixel * ConstBitmapPtr
Definition: YGraphics.h:44
ystdex::pun_ref< Data >
ystdex::function
function_base< function_traits< _fSig, empty_function_policy::throwing >, _fSig > function
函数包装类模板。
Definition: function.hpp:900
const
const Decapsulate const Decapsulate &y ynothrow ContextNode &ctx const
Definition: NPLA1Forms.cpp:1629
yimpl
#define yimpl(...)
实现标签。
Definition: ydef.h:413
YSLib::Drawing::BitmapPtr
Pixel * BitmapPtr
Definition: YGraphics.h:42
YSLib::Drawing::GetHeight
YB_ATTR_nodiscard YB_PURE tr GetHeight())) inline PDefH(void
按字体高度和行距调整文本区域的底边距。
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:1199
ystdex::bases::noncopyable
不可复制对象：禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
Definition: base.h:50
platform_ex::ImplRet
YB_ATTR_nodiscard const char16_t *s ImplRet(platform::Nonnull(s)) YB_ATTR_nodiscard inline PDefH(const u16string &
YSLib::UI::IsVisible
IsVisible
Definition: YWidget.h:101
ystdex::pun_ref::get
_type & get() const
Definition: type_pun.hpp:261
YSLib::Messaging::MessageID
enum MessageSpace { Null=0x0000, Set=0x0003, Quit=0x0012, Bound=0x0014, Task=0x0016, Paint=0x00AF, Input=0x00FF } MessageID
Definition: YMessageDefinition.h:53
NPL::get
PDefH(void, LiftTermRef, TermNode &term, const TermNode &tm) ImplExpr(NPL ref get()
Definition: NPLA.h:1737
DefSetterMem
#define DefSetterMem(_q, _t, _n, _m)
Definition: YBaseMacro.h:268