YSTest: yrender.h 源文件

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
34 YSL_BEGIN
35
36 YSL_BEGIN_NAMESPACE(UI)
37
38
44 class YF_API Renderer
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
90 class YF_API BufferedRenderer : public Renderer
91 {
92 protected:
93 mutable Rect rInvalidated; \
95
96 public:
97 Drawing::BitmapBuffer Buffer;
98
102 bool IgnoreBackground;
103
108 BufferedRenderer(bool b = false)
109 : rInvalidated(), Buffer(), IgnoreBackground(b)
110 {}
111 DefDeCopyCtor(BufferedRenderer)
112 DefDeMoveCtor(BufferedRenderer)
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
176 YSL_END_NAMESPACE(UI)
177
178 YSL_END
179
180 #endif
181