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 
47 {
48 public:
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 
95 {
96 protected:
97  mutable Rect rInvalidated; \
99 
103  unique_ptr<Drawing::IImage> pImageBuffer;
104 
105 public:
111 
117  BufferedRenderer(bool = {}, unique_ptr<Drawing::IImage> = {});
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 
virtual DefClone(const, Renderer) virtual Rect CommitInvalidation(const Rect &r)
提交无效区域。
Definition: yrender.h:63
#define DefDeDtor(_t)
定义默认析构函数。
Definition: YBaseMacro.h:146
部件渲染器。
Definition: yrender.h:46
#define DefDeCopyCtor(_t)
Definition: YBaseMacro.h:136
部件绘制参数。
Definition: ywgtevt.h:276
YF_API TLCIter Validate(TLCIter b, TLCIter e)
遍历记号列表,验证基本合法性:圆括号是否对应。
Definition: SContext.cpp:60
#define YF_API
Definition: Platform.h:64
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:180
bool IgnoreBackground
指定验证时忽略上层缓冲区背景。
Definition: yrender.h:110
sizeof(AlphaType)*GetAreaOf(GetSize())) using CompactPixmap void SetSize(const Size &) override
重新设置缓冲区大小。
DefDeCtor(Renderer) DefDeCopyCtor(Renderer) DefDeMoveCtor(Renderer) virtual DefDeDtor(Renderer) virtual void SetSize(const Size &)
设置缓冲区大小。
Definition: yrender.h:49
_tWidget & wgt
Definition: ywgtevt.h:596
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
Rect rInvalidated
无效区域:包含所有新绘制请求的区域(不一定是最小的)。
Definition: yrender.h:97
屏幕标准矩形:表示屏幕矩形区域。
Definition: ygdibase.h:416
二维图形接口上下文。
Definition: ygdibase.h:721
unique_ptr< Drawing::IImage > pImageBuffer
显示图像缓冲区指针。
Definition: yrender.h:103
#define DefClone(_q, _t)
动态复制。
Definition: YBaseMacro.h:221
void UpdateTo(NativeWindowHandle, const YSLib::Drawing::Point &={}) ynothrow
DefGetterMem(const ynothrow, ListType::size_type, SelectedIndex, viewer) SDst GetFullViewHeight() const
取完整视图高。
Selected const shared_ptr< ListType > const pair< Color, Color > & DefDeMoveCtor(TextList) DefPredMem(const ynothrow
bounds & r
Definition: ydraw.h:220
带缓冲的部件渲染器。
Definition: yrender.h:94
屏幕区域大小。
Definition: ygdibase.h:249