YSTest: yrender.h 源文件

YSTest PreAlpha_b500_20140530 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
yrender.h
浏览该文件的文档.
1 /*
2 © 2011-2014 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
28 #ifndef YSL_INC_UI_yrender_h_
29 #define YSL_INC_UI_yrender_h_ 1
30
31 #include "YModules.h"
32 #include YFM_YSLib_UI_YComponent
33
34 namespace YSLib
35 {
36
37 namespace UI
38 {
39
46 class YF_API Renderer
47 {
48 public:
49 DefDeCtor(Renderer)
50 DefDeCopyCtor(Renderer)
51 DefDeMoveCtor(Renderer)
52 virtual DefDeDtor(Renderer)
53
58 virtual void
59 SetSize(const Size&)
60 {}
61
63 virtual DefClone(const, Renderer)
64
65
68 virtual Rect
69 CommitInvalidation(const Rect& r)
70 {
71 return r;
72 }
73
82 virtual Rect
83 Paint(IWidget& wgt, PaintEventArgs&&);
84 };
85
86
94 class YF_API BufferedRenderer : public Renderer
95 {
96 protected:
97 mutable Rect rInvalidated; \
99
103 unique_ptr<Drawing::IImage> pImageBuffer;
104
105 public:
110 bool IgnoreBackground;
111
117 BufferedRenderer(bool = {}, unique_ptr<Drawing::IImage> = {});
118 BufferedRenderer(const BufferedRenderer&);
119 DefDeMoveCtor(BufferedRenderer)
120
121
125 bool
126 RequiresRefresh() const;
127
129 DefGetter(const ynothrow, Drawing::IImage&, ImageBuffer, *pImageBuffer)
133 DefGetter(const ynothrow, const Rect&, InvalidatedArea, rInvalidated)
138 DefGetterMem(const ynothrow, const Graphics&, Context, GetImageBuffer())
139
144 void
145 SetSize(const Size&) override;
147 void
148 SetImageBuffer(unique_ptr<Drawing::IImage>);
149
151 DefClone(const override, BufferedRenderer)
152
158 Rect
159 CommitInvalidation(const Rect&) override;
160
168 Rect
169 Paint(IWidget& wgt, PaintEventArgs&&) override;
170
175 void
176 UpdateTo(const PaintContext&) const;
177
186 Rect
187 Validate(IWidget& wgt, IWidget& sender, const PaintContext&);
188 };
189
190 } // namespace UI;
191
192 } // namespace YSLib;
193
194 #endif
195
YSLib::UI::Renderer::DefClone
virtual DefClone(const, Renderer) virtual Rect CommitInvalidation(const Rect &r)
提交无效区域。
Definition: yrender.h:63
YModules.h
DefDeDtor
#define DefDeDtor(_t)
定义默认析构函数。
Definition: YBaseMacro.h:146
YSLib::UI::Renderer
部件渲染器。
Definition: yrender.h:46
DefDeCopyCtor
#define DefDeCopyCtor(_t)
Definition: YBaseMacro.h:136
YSLib::UI::PaintEventArgs
部件绘制参数。
Definition: ywgtevt.h:276
NPL::SContext::Validate
YF_API TLCIter Validate(TLCIter b, TLCIter e)
遍历记号列表，验证基本合法性：圆括号是否对应。
Definition: SContext.cpp:60
YF_API
#define YF_API
Definition: Platform.h:64
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:180
YSLib::UI::BufferedRenderer::IgnoreBackground
bool IgnoreBackground
指定验证时忽略上层缓冲区背景。
Definition: yrender.h:110
YSLib::Drawing::SetSize
sizeof(AlphaType)*GetAreaOf(GetSize())) using CompactPixmap void SetSize(const Size &) override
重新设置缓冲区大小。
YSLib::UI::Renderer::DefDeCtor
DefDeCtor(Renderer) DefDeCopyCtor(Renderer) DefDeMoveCtor(Renderer) virtual DefDeDtor(Renderer) virtual void SetSize(const Size &)
设置缓冲区大小。
Definition: yrender.h:49
YSLib::UI::wgt
_tWidget & wgt
Definition: ywgtevt.h:596
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
YSLib::UI::BufferedRenderer::rInvalidated
Rect rInvalidated
无效区域：包含所有新绘制请求的区域（不一定是最小的）。
Definition: yrender.h:97
YSLib::Drawing::Rect
屏幕标准矩形：表示屏幕矩形区域。
Definition: ygdibase.h:416
YSLib::Drawing::Graphics
二维图形接口上下文。
Definition: ygdibase.h:721
YSLib::UI::BufferedRenderer::pImageBuffer
unique_ptr< Drawing::IImage > pImageBuffer
显示图像缓冲区指针。
Definition: yrender.h:103
DefClone
#define DefClone(_q, _t)
动态复制。
Definition: YBaseMacro.h:221
platform_ex::Android::UpdateTo
void UpdateTo(NativeWindowHandle, const YSLib::Drawing::Point &={}) ynothrow
YSLib::UI::DefGetterMem
DefGetterMem(const ynothrow, ListType::size_type, SelectedIndex, viewer) SDst GetFullViewHeight() const
取完整视图高。
YSLib::UI::DefDeMoveCtor
Selected const shared_ptr< ListType > const pair< Color, Color > & DefDeMoveCtor(TextList) DefPredMem(const ynothrow
YSLib::Drawing::r
bounds & r
Definition: ydraw.h:220
YSLib::UI::BufferedRenderer
带缓冲的部件渲染器。
Definition: yrender.h:94
YSLib::Drawing::Size
屏幕区域大小。
Definition: ygdibase.h:249