YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
yrender.h
浏览该文件的文档.
1 /*
2  Copyright by FrankHB 2009 - 2013.
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 "ycomp.h"
32 #include "../Service/ygdi.h"
33 
35 
37 
38 
45 {
46 public:
47  inline DefDeCtor(Renderer)
48  inline DefDeCopyCtor(Renderer)
49  inline DefDeMoveCtor(Renderer)
50  virtual DefEmptyDtor(Renderer)
51 
56  virtual void
57  SetSize(const Size&)
58  {}
59 
60  virtual DefClone(const, Renderer, Clone)
61 
62 
65  virtual Rect
66  CommitInvalidation(const Rect& r)
67  {
68  return r;
69  }
70 
79  virtual Rect
80  Paint(IWidget& wgt, PaintEventArgs&&);
81 };
82 
83 
91 {
92 protected:
93  mutable Rect rInvalidated; \
95 
96 public:
98 
103 
108  BufferedRenderer(bool b = false)
109  : rInvalidated(), Buffer(), IgnoreBackground(b)
110  {}
113 
118  bool
119  RequiresRefresh() const;
120 
124  DefGetter(const ynothrow, const Rect&, InvalidatedArea, rInvalidated)
129  DefGetterMem(const ynothrow, const Graphics&, Context, Buffer)
130 
134  void
135  SetSize(const Size&) override;
136 
137  DefClone(const override, BufferedRenderer, Clone)
138 
144  Rect
145  CommitInvalidation(const Rect&) override;
146 
154  Rect
155  Paint(IWidget& wgt, PaintEventArgs&&) override;
156 
161  void
162  UpdateTo(const PaintContext&) const;
163 
172  Rect
173  Validate(IWidget& wgt, IWidget& sender, const PaintContext&);
174 };
175 
177 
178 YSL_END
179 
180 #endif
181