YSTest: YStyle.cpp 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

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

- 文件列表
- 文件成员

YStyle.cpp
浏览该文件的文档.
1 /*
2 © 2010-2015 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 #include "YSLib/UI/YModules.h"
29 #include YFM_YSLib_UI_YStyle
30 #include YFM_YSLib_UI_YWindow
31 #include YFM_YSLib_UI_YGUI
32
33 using namespace ystdex;
34
35 namespace YSLib
36 {
37
38 namespace Drawing
39 {
40
41 void
42 DrawRectRoundCorner(const PaintContext& pc, const Size& s, Color c)
43 {
44 const auto& g(pc.Target);
45 const auto& pt(pc.Location);
46 const Rect& bounds(pc.ClipArea);
47 // XXX: Conversion to 'SPos' might be implementation-defined.
48 const SPos x1(pt.X + 1), y1(pt.Y + 1), x2(pt.X + SPos(s.Width) - 1),
49 y2(pt.Y + SPos(s.Height) - 1);
50
51 if(YB_LIKELY(x1 <= x2 && y1 <= y2))
52 {
53 DrawVLineSeg(g, bounds, x1 - 1, y1, y2, c),
54 DrawHLineSeg(g, bounds, y2, x1, x2, c),
55 DrawVLineSeg(g, bounds, x2, y1, y2, c),
56 DrawHLineSeg(g, bounds, y1 - 1, x1, x2, c);
57 if(YB_LIKELY(s.Width > 4 && s.Height > 4))
58 {
59 DrawPoint(g, bounds, x1, y1, c);
60 DrawPoint(g, bounds, x1, y2 - 1, c);
61 DrawPoint(g, bounds, x2 - 1, y2 - 1, c);
62 DrawPoint(g, bounds, x2 - 1, y1, c);
63 }
64 }
65 }
66
67
68 void
69 RectDrawArrow(const PaintContext& pc, SDst half_size, Rotation rot, Color c)
70 {
71 const auto& g(pc.Target);
72 const auto& pt(pc.Location);
73 const Rect& bounds(pc.ClipArea);
74 SPos x(pt.X), y(pt.Y);
75
76 switch(rot)
77 {
78 case RDeg0:
79 case RDeg180:
80 {
81 SPos t(pt.Y);
82
83 for(SDst i(0); i < half_size; ++i)
84 DrawVLineSeg(g, bounds, rot == 0 ? x-- : x++, y--, t++, c);
85 }
86 break;
87 case RDeg90:
88 case RDeg270:
89 {
90 SPos t(pt.X);
91
92 for(SDst i(0); i < half_size; ++i)
93 DrawHLineSeg(g, bounds, rot == RDeg90 ? y++ : y--, x--, t++, c);
94 }
95 break;
96 default:
97 YAssert(false, "Invalid rotation found.");
98 }
99 }
100
101 void
102 RectDrawArrowOutline(const PaintContext& pc, SDst half_size, Rotation rot,
103 Color c)
104 {
105 if(half_size < 1U)
106 return;
107
108 const auto& g(pc.Target);
109 const auto& pt(pc.Location);
110 const Rect& bounds(pc.ClipArea);
111 SPos x(pt.X), y(pt.Y);
112
113 switch(rot)
114 {
115 case RDeg0:
116 case RDeg180:
117 {
118 SPos t(pt.Y);
119
120 for(SDst i(0); i < half_size - 1; ++i)
121 {
122 DrawPoint(g, bounds, {x, y--}, c),
123 DrawPoint(g, bounds, {x, t++}, c);
124 rot == RDeg0 ? --x : ++x;
125 }
126 DrawVLineSeg(g, bounds, x, y, ++t, c);
127 }
128 break;
129 case RDeg90:
130 case RDeg270:
131 {
132 SPos t(pt.X);
133
134 for(SDst i(0); i < half_size - 1; ++i)
135 {
136 DrawPoint(g, bounds, {x--, y}, c),
137 DrawPoint(g, bounds, {t++, y}, c);
138 rot == RDeg90 ? ++y : --y;
139 }
140 DrawHLineSeg(g, bounds, y, x, ++t, c);
141 }
142 break;
143 default:
144 YAssert(false, "Invalid rotation found.");
145 }
146 }
147
148 void
149 RectDrawCornerArrow(const PaintContext& pc, SDst size, Rotation rot,
150 Color c)
151 {
152 const auto& g(pc.Target);
153 const auto& pt(pc.Location);
154 const Rect& bounds(pc.ClipArea);
155 const SPos x(pt.X);
156 SPos y(pt.Y);
157
158 switch(rot)
159 {
160 case RDeg0:
161 case RDeg270:
162 {
163 SPos t(x);
164
165 y -= SPos(size);
166 for(SDst i(0); i < size; ++i)
167 DrawHLineSeg(g, bounds, y++, rot == RDeg0 ? t-- : t++, x, c);
168 }
169 break;
170 case RDeg90:
171 case RDeg180:
172 {
173 // XXX: Conversion to 'SPos' might be implementation-defined.
174 SPos t(rot == RDeg90 ? x - SPos(size) : x + SPos(size));
175
176 for(SDst i(0); i < size; ++i)
177 DrawHLineSeg(g, bounds, y++, rot == RDeg90 ? t++ : t--, x, c);
178 }
179 break;
180 default:
181 YAssert(false, "Invalid rotation found.");
182 }
183 }
184
185 void
186 RectDrawCornerArrowOutline(const PaintContext& pc, SDst size, Rotation rot,
187 Color c)
188 {
189 const auto& g(pc.Target);
190 const auto& pt(pc.Location);
191 const Rect& bounds(pc.ClipArea);
192 const SPos x(pt.X), y(pt.Y),
193 inv_x(rot < RDeg180 ? x - SPos(size) : x + SPos(size)),
194 inv_y(rot == RDeg0 || rot == RDeg270 ? y - SPos(size) : y + SPos(size));
195
196 DrawVLineSeg(g, bounds, x, inv_y, y, c);
197 DrawHLineSeg(g, bounds, y, inv_x, x, c);
198 DrawLineSeg(g, bounds, x, inv_y, inv_x, y, c);
199 }
200
201 void
202 DrawArrow(const Graphics& g, const Rect& bounds, const Rect& r, SDst half_size,
203 Rotation rot, Color c, bool outline)
204 {
205 SPos x(r.X), y(r.Y);
206
207 switch(rot)
208 {
209 case RDeg0:
210 case RDeg180:
211 // XXX: Conversion to 'SPos' might be implementation-defined.
212 x += SPos(rot == RDeg180 ? (r.Width - half_size)
213 : (r.Width + half_size)) / 2;
214 y += SPos(r.Height + 1) / 2;
215 break;
216 case RDeg90:
217 case RDeg270:
218 // XXX: Conversion to 'SPos' might be implementation-defined.
219 y += SPos(rot == RDeg90 ? (r.Height - half_size)
220 : (r.Height + half_size)) / 2;
221 x += SPos(r.Width + 1) / 2;
222 default:
223 break;
224 }
225 (outline ? RectDrawArrowOutline : RectDrawArrow)({g, {x, y}, bounds},
226 half_size, rot, c);
227 }
228
229 void
230 DrawCornerArrow(const Graphics& g, const Rect& bounds, const Point& pt,
231 SDst size, Rotation rot, Color c, bool outline)
232 {
233 SPos x(pt.X), y(pt.Y);
234
235 if(rot < RDeg180)
236 x += SPos(size);
237 if(rot == RDeg0 || rot == RDeg270)
238 y += SPos(size);
239 (outline ? RectDrawCornerArrowOutline : RectDrawCornerArrow)(
240 {g, {x, y}, bounds}, size, rot, c);
241 }
242
243 void
244 DrawCross(const Graphics& g, const Rect& bounds, const Rect& r, Color c)
245 {
246 if(YB_LIKELY(r.Width > 8 && r.Height > 8))
247 {
248 const SPos xmin(r.X + 4), xmax(r.GetRight() - 4),
249 ymin(r.Y + 4), ymax(r.GetBottom() - 4);
250
251 DrawLineSeg(g, bounds, xmin, ymin, xmax, ymax, c),
252 DrawLineSeg(g, bounds, xmax - 1, ymin, xmin - 1, ymax, c);
253 }
254 }
255
256 void
257 DrawTick(const Graphics& g, const Rect& bounds, const Rect& r, Color c1,
258 Color c2)
259 {
260 if(YB_LIKELY(r.Width > 8 && r.Height > 8))
261 {
262 // XXX: Conversion to 'SPos' might be implementation-defined.
263 const Point p1(r.X + 2, r.Y + SPos(r.Height) / 2),
264 p3(r.X + SPos(r.Width) - 2, r.Y + 1);
265 Point p2(r.X + SPos(r.Width) / 2 - 1, r.Y + SPos(r.Height) - 3);
266
267 --p2.Y;
268 DrawLineSeg(g, bounds, p1 + Vec(1, 0), p2, c2);
269 DrawLineSeg(g, bounds, p2, p3 + Vec(-1, 0), c2);
270 p2.Y += 2;
271 DrawLineSeg(g, bounds, p1 + Vec(0, 1), p2, c2);
272 DrawLineSeg(g, bounds, p2, p3 + Vec(0, 1), c2);
273 --p2.Y;
274 DrawLineSeg(g, bounds, p1, p2, c1);
275 DrawLineSeg(g, bounds, p2, p3, c1);
276 }
277 }
278
279
280 void
281 HS::Roll(Hue delta) ynothrow
282 {
283 auto& hue(GetHRef());
284
285 YAssert(IsInInterval<Hue>(hue, 0, 360), "Invalid hue found.");
286 delta += hue;
287 hue = delta < Hue(360) ? delta : delta - Hue(360);
288 }
289
290
291 HSL::HSL(Color c) ynothrow
292 : HS(yimpl(0), 0)
293 {
294 auto& saturation(GetSRef());
295 const std::uint8_t r(c.GetR()), g(c.GetG()), b(c.GetB()),
296 min_color(min(min(r, g), b)), max_color(max(max(r, g), b));
297 float h(0); // 此处 h 的值每 0x6 对应一个圆周。
298
299 if(min_color == max_color)
300 lightness = decltype(lightness)(min_color) / 0x100;
301 else
302 {
303 const std::uint16_t p(max_color + min_color);
304 const float q(max_color - min_color);
305
306 lightness = decltype(lightness)(p) / 0x200;
307 /*
308 l = 0.2126 * r + 0.7152 * g + 0.0722 * b; // Rec. 601 luma;
309 l = 0.299 * r + 0.588 * g + 0.114 * b; // Rec. 709 luma;
310 */
311 saturation = q / (p < 0x100 ? p : 0x200 - p);
312 if(r == max_color)
313 h = (g - b) / q;
314 else if(g == max_color)
315 h = (b - r) / q + 0x2;
316 else if(b == max_color)
317 h = (r - g) / q + 0x4;
318 if(h < 0)
319 h += 0x6;
320 }
321 GetHRef() = Hue(h * 60);
322 }
323
324 HSL::operator Color() const ynothrow
325 {
326 YAssert(IsInInterval<Hue>(GetH(), 0, 360), "Invalid hue found."),
327 YAssert(IsInClosedInterval(GetS(), 0.F, 1.F),
328 "Invalid saturation found."),
329 YAssert(IsInClosedInterval(lightness, 0.F, 1.F), "Invalid light found.");
330 YAssert(std::isfinite(GetS()), "Abnormal saturation found.");
331 if(!std::isnormal(GetS()))
332 return MakeGray(lightness > 255.F / 0x100 ? 0xFF : lightness * 0x100);
333
334 float t2((lightness < 0.5F ? lightness * (1 + GetS())
335 : (lightness + GetS() - lightness * GetS())) * 0x100),
336 t1((lightness * 0x200) - t2);
337 // 每个元素对应一个 RGB 分量，值 360 对应一个圆周。
338 float tmp[3]{GetH() + Hue(120), GetH(), GetH() - Hue(120)};
339 float dc[3]; //对应 RGB 分量。
340
341 for(size_t i(0); i < 3; ++i)
342 {
343 if(tmp[i] < 0)
344 tmp[i] += 360;
345 else if(tmp[i] > 360)
346 tmp[i] -= 360;
347 if(tmp[i] < 60)
348 dc[i] = t1 + (t2 - t1) * tmp[i] / 60;
349 else if(tmp[i] < 180)
350 dc[i] = t2;
351 else if(tmp[i] < 240)
352 dc[i] = t1 + (t2 - t1) * (240 - tmp[i]) / 60;
353 else
354 dc[i] = t1;
355 if(dc[i] > 0xFF)
356 dc[i] = 0xFF;
357 }
358 return Color(dc[0], dc[1], dc[2]);
359 }
360
361
362 HSV::HSV(Color c) ynothrow
363 {
364 using int_type = ystdex::make_widen_int<MonoType, true>::type;
365 static_assert(std::is_signed<int_type>(), "Invalid type found.");
366 // TODO: Check range by constexpr 'std::numeric_limits' members.
367 const int_type r(c.GetR()), g(c.GetG()), b(c.GetB()),
368 max_color(max(r, max(g, b))),
369 delta(max_color - min(r, min(g, b)));
370
371 yunseq(GetSRef() = max_color == 0 ? 0.F : delta / float(max_color),
372 value = max_color / 255.F);
373 GetHRef() = Hue((max_color > 0 ? [=]{
374 int_type res(0);
375
376 if(r == max_color)
377 res = g - b;
378 else if(g == max_color)
379 res = delta * 2 + b - r;
380 else if(b == max_color)
381 res = delta * 4 + r - g;
382 if(res < 0)
383 res += delta * 6;
384 return res;
385 }() * 60.F / delta : -360.F));
386 }
387
388 HSV::operator Color() const ynothrow
389 {
390 static_assert(std::numeric_limits<MonoType>::max() == 255,
391 "Invalid mono type found.");
392 const auto v(value * 255);
393 const auto s(GetS());
394
395 YAssert(IsInInterval<float>(GetH(), 0, 360), "Invalid hue found."),
396 YAssert(IsInClosedInterval(s, 0.F, 1.F), "Invalid saturation found."),
397 YAssert(IsInClosedInterval(v, 0.F, 256.F), "Invalid value found.");
398
399 if(s > 0.F)
400 {
401 float h(GetH() / 60.F);
402 const unsigned k(std::floor(h));
403 const float f(GetH() / 60.F - k), aa(v * (1.F - s)),
404 bb(v * (1.F - s * f)), cc(v * (1.F - (s * (1.F - f))));
405
406 switch(k)
407 {
408 case 0U:
409 return {v, cc, aa};
410 case 1U:
411 return {bb, v, aa};
412 case 2U:
413 return {aa, v, cc};
414 case 3U:
415 return {aa, bb, v};
416 case 4U:
417 return {cc, aa, v};
418 case 5U:
419 return {v, aa, bb};
420 default:
421 break;
422 }
423 YAssert(false, "Invalid state found.");
424 }
425 return MakeGray(v);
426 }
427
428 } // namespace Drawing;
429
430 namespace UI
431 {
432
433 namespace Styles
434 {
435
436 Palette::Palette()
437 : colors{
438 {0, 0, 0}, // Null;
439 {10, 59, 118}, // Desktop;
440 {255, 255, 255}, // Window;
441 {240, 240, 240}, // Panel;
442 {237, 237, 237}, // Track;
443 {171, 171, 171}, // Workspace;
444 {160, 160, 160}, // Shadow;
445 {105, 105, 105}, // DockShadow;
446 {227, 227, 227}, // Light;
447 {100, 100, 100}, // Frame;
448 {51, 153, 255}, // Highlight;
449 {158, 62, 255}, // BorderFill;
450 {86, 157, 229}, // ActiveBorder;
451 {180, 180, 180}, // InactiveBorder;
452 {153, 180, 209}, // ActiveTitle;
453 {191, 205, 219}, // InactiveTitle;
454
455 {255, 255, 255}, // HighlightText;
456 {0, 0, 0}, // WindowText;
457 {0, 0, 0}, // PanelText;
458 {109, 109, 109}, // GrayText;
459 {0, 0, 0}, // TitleText;
460 {67, 78, 84}, // InactiveTitleText;
461 {0, 102, 204} // HotTracking;
462 }
463 {
464 // colors[ActiveBorder] = Color(180, 180, 180),
465 // colors[InactiveBorder] = Color(244, 247, 252);
466 //"GradientActiveTitle"="185 209 234"
467 //"GradientInactiveTitle"="215 228 242"
468 }
469
470 pair<Drawing::Color, Drawing::Color>
471 Palette::GetPair(Palette::ColorListType::size_type n1,
472 Palette::ColorListType::size_type n2) const
473 {
474 return {colors[n1], colors[n2]};
475 }
476
477
478 void
479 Painter::operator()(PaintEventArgs&& e) const
480 {
481 FetchGUIConfiguration().Styles.PaintAsStyle(key, std::move(e));
482 }
483
484
485 void
486 StyleMap::PaintAsStyle(const Key& key, PaintEventArgs&& e)
487 {
488 using ystdex::is_undereferenceable;
489
490 YAssert(!empty(), "No style found.");
491 YAssert(!is_undereferenceable(current), "Invalidate style state found.");
492
493 const auto& table(current->second);
494 auto i(table.find(key));
495
496 if(i == table.cend())
497 {
498 const auto& de_table(cbegin()->second);
499
500 i = de_table.find(key);
501 if(i == de_table.end())
502 return;
503 }
504 i->second(std::move(e));
505 }
506
507 void
508 StyleMap::Remove(const string& name)
509 {
510 if(!name.empty())
511 {
512 if(current->first == name)
513 current = cbegin();
514 erase(name);
515 }
516 }
517
518 void
519 StyleMap::Switch(const string& name)
520 {
521 YTraceDe(Notice, "Style '%s' requested to be switched.", name.c_str());
522
523 const auto i(find(name));
524 const bool exist(i != cend());
525
526 YTraceDe(Notice, "Style '%s'%s found in style map.", name.c_str(),
527 exist ? "" : " not");
528 current = exist ? i : cbegin();
529 }
530
531
532 HandlerTable&
533 FetchDefault()
534 {
535 return FetchGUIConfiguration().Styles.at({});
536 }
537
538 } // namespace Styles;
539
540 } // namespace UI;
541
542 } // namespace YSLib;
543
platform::p
while p p
Definition: YCLib/FileSystem.h:225
YSLib::Drawing::x
The boundary is out of the const Rect SDst SPos x
Definition: YDraw.h:127
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:740
YSLib::Drawing::DrawLineSeg
The boundary is out of the DrawLineSeg
Definition: YDraw.h:161
YSLib::Drawing::RectDrawCornerArrow
YF_API void RectDrawCornerArrow(const PaintContext &, SDst, Rotation=RDeg0, Color=ColorSpace::Black)
在指定上下文的矩形中描画腰和坐标轴共线的等腰直角三角形箭头。
Definition: YStyle.cpp:149
YSLib::Drawing::HS
按指定颜色或分量选取彩色或灰度色。
Definition: YStyle.h:176
v
byte v
Definition: CharRenderer.cpp:75
YSLib::Drawing::p1
The boundary is out of the const Graphics const Rect const Point & p1
Definition: YDraw.h:161
ystdex::cpp2014::cend
auto cend(const _tRange &c) -> decltype(std::end(c))
Definition: range.hpp:87
YSLib::Drawing::Rotation
Rotation
逆时针旋转角度指示输出指向。
Definition: YGDIBase.h:895
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:45
platform::Color
颜色。
Definition: Video.h:451
YSLib::Drawing::bounds
The boundary is out of the const Rect & bounds
Definition: YDraw.h:127
YSLib::Drawing::DrawRectRoundCorner
YF_API void DrawRectRoundCorner(const PaintContext &pc, const Size &s, Color)
绘制部件边框用空心标准矩形。
Definition: YStyle.cpp:42
YSLib::Drawing::GBinaryGroup::X
_type X
Definition: YGDIBase.h:63
YSLib::UI::Styles::StyleMap::current
const_iterator current
Definition: YStyle.h:487
YSLib::UI::FetchGUIConfiguration
GUIConfiguration & FetchGUIConfiguration()
Definition: YGUI.cpp:519
YSLib::Drawing::Size::Width
SDst Width
Definition: YGDIBase.h:302
YSLib::UI::Styles::Painter::operator()
key second key first void operator()(PaintEventArgs &&) const
Definition: YStyle.cpp:479
YSLib::Drawing::GBinaryGroup::Y
_type Y
分量。
Definition: YGDIBase.h:63
YAssert
#define YAssert(_expr, _msg)
Definition: cassert.h:105
Color
Pixel Color
Definition: CharRenderer.cpp:58
CHRLib::c
c
Definition: CharacterProcessing.h:81
yimpl
#define yimpl(...)
实现标签。
Definition: ydef.h:256
YTraceDe
#define YTraceDe(...)
YCLib 默认调试跟踪。
Definition: Debug.h:305
YSLib::Drawing::p2
The boundary is out of the const Graphics const Rect const Point const Point & p2
Definition: YDraw.h:161
YSLib::Drawing::RDeg180
Definition: YGDIBase.h:899
YSLib::IsInClosedInterval
YB_STATELESS bool IsInClosedInterval(_type i, _type b) ynothrow
判断 i 是否在闭区间 [_type(0), b] 中。
Definition: YCoreUtilities.h:110
YSLib::Drawing::RectDrawArrowOutline
YF_API void RectDrawArrowOutline(const PaintContext &, SDst, Rotation=RDeg0, Color=ColorSpace::Black)
在指定上下文的矩形中描画底边和坐标轴共线的等腰直角三角形箭头轮廓。
Definition: YStyle.cpp:102
platform::SPos
std::int16_t SPos
屏幕坐标度量。
Definition: Video.h:42
YSLib::Drawing::Vec
GBinaryGroup< SPos > Vec
屏幕二维向量（直角坐标表示）。
Definition: YGDIBase.h:285
YSLib::UI::Styles::Palette::colors
ColorListType colors
Definition: YStyle.h:351
YSLib::UI::Styles::StyleMap::Remove
void Remove(const string &)
Definition: YStyle.cpp:508
ystdex::size
auto size(const _tRange &c) -> decltype(c.size())
类容器访问。
Definition: range.hpp:233
YSLib::YAssert
YAssert(!(v< Deref(a)),"Value less than lower bound found.")
YSLib::Drawing::y2
The boundary is out of the const Rect SDst SPos SPos SPos y2
Definition: YDraw.h:127
yunseq
#define yunseq
无序列依赖表达式组求值。
Definition: ydef.h:996
YSLib::Drawing::Rect
屏幕标准矩形：表示屏幕矩形区域。
Definition: YGDIBase.h:540
ystdex
特性测试宏。
Definition: ydef.h:796
ystdex::max
const _type & max(const _type &a, const _type &b, _fComp comp=less< _type >())
取较大的元素。
Definition: algorithm.hpp:543
YSLib::Drawing::DrawCornerArrow
YF_API void DrawCornerArrow(const Graphics &, const Rect &, const Point &, SDst=4, Rotation=RDeg0, Color=ColorSpace::Black, bool={})
在指定图形接口上下文上描画腰和坐标轴共线的等腰直角三角形箭头。
Definition: YStyle.cpp:230
YSLib::Drawing::Size
屏幕区域大小。
Definition: YGDIBase.h:293
YSLib::UI::Styles::Painter::key
Key key
Definition: YStyle.h:450
YSLib::Drawing::x1
The boundary is out of the const Rect SDst SPos x1
Definition: YDraw.h:148
YSLib::Drawing::r
The boundary is out of the const Graphics const Rect const Point const Point Color c const Rect const Rect & r
Definition: YDraw.h:174
Drawing
YSLib::UI::Styles::Key
pair< std::type_index, StyleItem > Key
标识查找样式的键。
Definition: YStyle.h:377
ystdex::is_undereferenceable
bool is_undereferenceable(const _tIter &)
Definition: deref_op.hpp:45
UI
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
YSLib::UI::Styles::FetchDefault
YF_API HandlerTable & FetchDefault()
取默认样式处理器表。
Definition: YStyle.cpp:533
YSLib::i
return i
Definition: YCoreUtilities.h:176
YSLib::UI::Styles::StyleMap::Switch
PaintEventArgs &&void Switch(const string &)
Definition: YStyle.cpp:519
YSLib::UI::e
void e
Definition: YWidget.h:352
YModules.h
YB_LIKELY
#define YB_LIKELY(_expr)
Definition: ydef.h:437
YSLib::Drawing::Size::Height
SDst Height
宽和高。
Definition: YGDIBase.h:302
YSLib::Drawing::DrawTick
YF_API void DrawTick(const Graphics &, const Rect &, const Rect &, Color, Color)
Definition: YStyle.cpp:257
YSLib::UI::Styles::HandlerTable
unordered_map< Key, Handler, ystdex::combined_hash< Key >> HandlerTable
样式处理器表。
Definition: YStyle.h:383
ystdex::empty
auto empty(const _tRange &c) -> decltype(c.empty())
Definition: range.hpp:255
ystdex::make_widen_int::type
typename make_signed_c< typename make_width_int< integer_width< _type >::value<< 1 >::type, _bSigned >::type type
Definition: cstdint.hpp:206
YSLib::Drawing::DrawCross
YF_API void DrawCross(const Graphics &, const Rect &, const Rect &, Color)
在指定图形接口上下文中使用指定颜色描画交叉直线段（“×”）。
Definition: YStyle.cpp:244
YSLib::Drawing::DrawArrow
YF_API void DrawArrow(const Graphics &, const Rect &, const Rect &, SDst=4, Rotation=RDeg0, Color=ColorSpace::Black, bool={})
在指定图形接口上下文上描画底边和坐标轴共线的等腰直角三角形箭头。
Definition: YStyle.cpp:202
YSLib::Drawing::y1
The boundary is out of the const Rect SDst SPos SPos y1
Definition: YDraw.h:127
ystdex::min
const _type & min(const _type &a, const _type &b, _fComp comp=less< _type >())
取较小的元素。
Definition: algorithm.hpp:521
YSLib::UI::PaintEventArgs
部件绘制参数。
Definition: YWidgetEvent.h:323
YSLib::Drawing::RDeg0
Definition: YGDIBase.h:897
YSLib::Drawing::RDeg90
Definition: YGDIBase.h:898
YSLib::IO::f
const string &path const String &path _func f
Definition: YSLib/Service/FileSystem.h:430
YSLib::Drawing::RectDrawCornerArrowOutline
YF_API void RectDrawCornerArrowOutline(const PaintContext &, SDst, Rotation=RDeg0, Color=ColorSpace::Black)
在指定上下文的矩形中描画腰和坐标轴共线的等腰直角三角形箭头轮廓。
Definition: YStyle.cpp:186
ystdex::cpp2014::cbegin
auto cbegin(const _tRange &c) -> decltype(std::begin(c))
Definition: range.hpp:79
YSLib::UI::name
yconstfn const string & name
Definition: Loader.h:130
YSLib::Drawing::GGraphics
二维图形接口上下文模板。
Definition: YGraphics.h:62
YSLib::Drawing::g
The boundary is out of the const Graphics & g
Definition: YDraw.h:161
platform::Descriptions::Notice
Definition: YCommon.h:158
CHRLib::s
_tDst const _tSrc * s
Definition: CharacterProcessing.h:140
YSLib::Drawing::RDeg270
Definition: YGDIBase.h:900
YSLib::Drawing::x2
The boundary is out of the const Rect SDst SPos SPos SPos x2
Definition: YDraw.h:148
platform::SDst
std::uint16_t SDst
屏幕坐标距离。
Definition: Video.h:43
YSLib::Drawing::RectDrawArrow
YF_API void RectDrawArrow(const PaintContext &, SDst, Rotation=RDeg0, Color=ColorSpace::Black)
在指定上下文的矩形中描画底边和坐标轴共线的等腰直角三角形箭头。
Definition: YStyle.cpp:69
YSLib::Drawing::GBinaryGroup< SPos >