YSTest: YStyle.cpp 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

YStyle.cpp
浏览该文件的文档.
1 /*
2 © 2010-2015, 2019 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 // for ystdex::min, ystdex::max;
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(ystdex::min(ystdex::min(r, g), b)),
297 max_color(ystdex::max(ystdex::max(r, g), b));
298 float h(0); // 此处 h 的值每 0x6 对应一个圆周。
299
300 if(min_color == max_color)
301 lightness = decltype(lightness)(min_color) / 0x100;
302 else
303 {
304 const std::uint16_t p(max_color + min_color);
305 const float q(std::uint16_t(max_color - min_color));
306
307 lightness = decltype(lightness)(p) / 0x200;
308 /*
309 l = 0.2126 * r + 0.7152 * g + 0.0722 * b; // Rec. 601 luma;
310 l = 0.299 * r + 0.588 * g + 0.114 * b; // Rec. 709 luma;
311 */
312 saturation = q / (p < 0x100 ? p : 0x200 - p);
313 if(r == max_color)
314 h = (g - b) / q;
315 else if(g == max_color)
316 h = (b - r) / q + 0x2;
317 else if(b == max_color)
318 h = (r - g) / q + 0x4;
319 if(h < 0)
320 h += 0x6;
321 }
322 GetHRef() = Hue(h * 60);
323 }
324
325 HSL::operator Color() const ynothrow
326 {
327 YAssert(IsInInterval<Hue>(GetH(), 0, 360), "Invalid hue found."),
328 YAssert(IsInClosedInterval(GetS(), 0.F, 1.F),
329 "Invalid saturation found."),
330 YAssert(IsInClosedInterval(lightness, 0.F, 1.F), "Invalid light found.");
331 YAssert(std::isfinite(GetS()), "Abnormal saturation found.");
332 if(!std::isnormal(GetS()))
333 // XXX: Truncated.
334 return MakeGray(
335 MonoType(lightness > 255.F / 0x100 ? 0xFF : lightness * 0x100));
336
337 float t2((lightness < 0.5F ? lightness * (1 + GetS())
338 : (lightness + GetS() - lightness * GetS())) * 0x100),
339 t1((lightness * 0x200) - t2);
340 // 每个元素对应一个 RGB 分量，值 360 对应一个圆周。
341 float tmp[3]{GetH() + Hue(120), GetH(), GetH() - Hue(120)};
342 float dc[3]; //对应 RGB 分量。
343
344 for(size_t i(0); i < 3; ++i)
345 {
346 if(tmp[i] < 0)
347 tmp[i] += 360;
348 else if(tmp[i] > 360)
349 tmp[i] -= 360;
350 if(tmp[i] < 60)
351 dc[i] = t1 + (t2 - t1) * tmp[i] / 60;
352 else if(tmp[i] < 180)
353 dc[i] = t2;
354 else if(tmp[i] < 240)
355 dc[i] = t1 + (t2 - t1) * (240 - tmp[i]) / 60;
356 else
357 dc[i] = t1;
358 if(dc[i] > 0xFF)
359 dc[i] = 0xFF;
360 }
361 return Color(dc[0], dc[1], dc[2]);
362 }
363
364
365 HSV::HSV(Color c) ynothrow
366 {
367 using int_type = ystdex::make_widen_int<MonoType, true>::type;
368 static_assert(std::is_signed<int_type>(), "Invalid type found.");
369 // TODO: Check range by constexpr 'std::numeric_limits' members.
370 const int_type r(c.GetR()), g(c.GetG()), b(c.GetB()),
371 max_color(ystdex::max(r, ystdex::max(g, b))),
372 delta(max_color - ystdex::min(r, ystdex::min(g, b)));
373
374 yunseq(GetSRef() = max_color == 0 ? 0.F : delta / float(max_color),
375 value = max_color / 255.F);
376 GetHRef() = Hue((max_color > 0 ? [=]{
377 int_type res(0);
378
379 if(r == max_color)
380 res = g - b;
381 else if(g == max_color)
382 res = delta * 2 + b - r;
383 else if(b == max_color)
384 res = delta * 4 + r - g;
385 if(res < 0)
386 res += delta * 6;
387 return res;
388 }() * 60.F / delta : -360.F));
389 }
390
391 HSV::operator Color() const ynothrow
392 {
393 static_assert(std::numeric_limits<MonoType>::max() == 255,
394 "Invalid mono type found.");
395 const auto v(value * 255);
396 const auto s(GetS());
397
398 YAssert(IsInInterval<float>(GetH(), 0, 360), "Invalid hue found."),
399 YAssert(IsInClosedInterval(s, 0.F, 1.F), "Invalid saturation found."),
400 YAssert(IsInClosedInterval(v, 0.F, 256.F), "Invalid value found.");
401
402 if(s > 0.F)
403 {
404 float h(GetH() / 60.F);
405 // XXX: Truncated.
406 const auto k(unsigned(std::floor(h)));
407 const float f(GetH() / 60.F - k), aa(v * (1.F - s)),
408 bb(v * (1.F - s * f)), cc(v * (1.F - (s * (1.F - f))));
409
410 switch(k)
411 {
412 case 0U:
413 return {v, cc, aa};
414 case 1U:
415 return {bb, v, aa};
416 case 2U:
417 return {aa, v, cc};
418 case 3U:
419 return {aa, bb, v};
420 case 4U:
421 return {cc, aa, v};
422 case 5U:
423 return {v, aa, bb};
424 default:
425 break;
426 }
427 YAssert(false, "Invalid state found.");
428 }
429 // XXX: Truncated.
430 return MakeGray(MonoType(v));
431 }
432
433 } // namespace Drawing;
434
435 namespace UI
436 {
437
438 namespace Styles
439 {
440
441 Palette::Palette()
442 : colors{
443 {0, 0, 0}, // Null;
444 {10, 59, 118}, // Desktop;
445 {255, 255, 255}, // Window;
446 {240, 240, 240}, // Panel;
447 {237, 237, 237}, // Track;
448 {171, 171, 171}, // Workspace;
449 {160, 160, 160}, // Shadow;
450 {105, 105, 105}, // DockShadow;
451 {227, 227, 227}, // Light;
452 {100, 100, 100}, // Frame;
453 {51, 153, 255}, // Highlight;
454 {158, 62, 255}, // BorderFill;
455 {86, 157, 229}, // ActiveBorder;
456 {180, 180, 180}, // InactiveBorder;
457 {153, 180, 209}, // ActiveTitle;
458 {191, 205, 219}, // InactiveTitle;
459
460 {255, 255, 255}, // HighlightText;
461 {0, 0, 0}, // WindowText;
462 {0, 0, 0}, // PanelText;
463 {109, 109, 109}, // GrayText;
464 {0, 0, 0}, // TitleText;
465 {67, 78, 84}, // InactiveTitleText;
466 {0, 102, 204} // HotTracking;
467 }
468 {
469 // colors[ActiveBorder] = Color(180, 180, 180),
470 // colors[InactiveBorder] = Color(244, 247, 252);
471 //"GradientActiveTitle"="185 209 234"
472 //"GradientInactiveTitle"="215 228 242"
473 }
474
475 pair<Drawing::Color, Drawing::Color>
476 Palette::GetPair(Palette::ColorListType::size_type n1,
477 Palette::ColorListType::size_type n2) const
478 {
479 return {colors[n1], colors[n2]};
480 }
481
482
483 void
484 Painter::operator()(PaintEventArgs&& e) const
485 {
486 FetchGUIConfiguration().Styles.PaintAsStyle(key, std::move(e));
487 }
488
489
490 void
491 StyleMap::PaintAsStyle(const Key& key, PaintEventArgs&& e)
492 {
493 using ystdex::is_undereferenceable;
494
495 YAssert(!empty(), "No style found.");
496 YAssert(!is_undereferenceable(current), "Invalidate style state found.");
497
498 const auto& table(current->second);
499 auto i(table.find(key));
500
501 if(i == table.cend())
502 {
503 const auto& de_table(cbegin()->second);
504
505 i = de_table.find(key);
506 if(i == de_table.end())
507 return;
508 }
509 i->second(std::move(e));
510 }
511
512 void
513 StyleMap::Remove(const string& name)
514 {
515 if(!name.empty())
516 {
517 if(current->first == name)
518 current = cbegin();
519 erase(name);
520 }
521 }
522
523 void
524 StyleMap::Switch(const string& name)
525 {
526 YTraceDe(Notice, "Style '%s' requested to be switched.", name.c_str());
527
528 const auto i(find(name));
529 const bool exist(i != cend());
530
531 YTraceDe(Notice, "Style '%s'%s found in style map.", name.c_str(),
532 exist ? "" : " not");
533 current = exist ? i : cbegin();
534 }
535
536
537 HandlerTable&
538 FetchDefault()
539 {
540 return FetchGUIConfiguration().Styles.at({});
541 }
542
543 } // namespace Styles;
544
545 } // namespace UI;
546
547 } // namespace YSLib;
548
YSLib::Drawing::DrawLineSeg
The boundary is out of the DrawLineSeg
Definition: YDraw.h:161
YSLib::Drawing::RDeg270
@ RDeg270
Definition: YGDIBase.h:1149
YSLib::Drawing::DrawTick
YF_API void DrawTick(const Graphics &, const Rect &, const Rect &, Color, Color)
在指定图形接口上下文中使用指定颜色描画对勾（“√”）。
Definition: YStyle.cpp:257
x
const EncapsulationBase & x
Definition: NPLA1Forms.cpp:1536
YSLib::Drawing::y2
The boundary is out of the const Rect SDst SPos SPos SPos y2
Definition: YDraw.h:128
YSLib::Drawing::Size
屏幕区域大小。
Definition: YGDIBase.h:536
ystdex::map::find
iterator find(const key_type &x)
Definition: map.hpp:619
CHRLib::c
c
Definition: CharacterProcessing.h:84
ystdex::cpp2014::min
const _type & min(const _type &a, const _type &b, _fComp comp=less< _type >())
取较小的元素。
Definition: algorithm.hpp:614
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
YSLib::Drawing::RectDrawArrowOutline
YF_API void RectDrawArrowOutline(const PaintContext &, SDst, Rotation=RDeg0, Color=ColorSpace::Black)
在指定上下文的矩形中描画底边和坐标轴共线的等腰直角三角形箭头轮廓。
Definition: YStyle.cpp:102
YSLib::Drawing::GGraphics::Height
const SizeType sGraphics Height
Definition: YGraphics.h:136
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
ystdex::make_widen_int::type
_t< make_signed_c< _t< make_width_int<(width::value<< 1)<=64 ? width::value<< 1 :width::value > >, _bSigned > > type
Definition: cstdint.hpp:209
ystdex::cpp2014::max
const _type & max(const _type &a, const _type &b, _fComp comp=less< _type >())
取较大的元素。
Definition: algorithm.hpp:635
ystdex::map::erase
iterator erase(iterator position)
Definition: map.hpp:563
YSLib::Drawing::x2
The boundary is out of the const Rect SDst SPos SPos SPos x2
Definition: YDraw.h:149
YSLib::UI::Styles::StyleMap::current
const_iterator current
Definition: YStyle.h:490
YSLib::Drawing::HS
按指定颜色或分量选取彩色或灰度色。
Definition: YStyle.h:177
YSLib::Drawing::p2
The boundary is out of the const Graphics const Rect const Point const Point & p2
Definition: YDraw.h:162
YSLib::Drawing::RDeg180
@ RDeg180
Definition: YGDIBase.h:1148
YSLib::Drawing::RectDrawArrow
YF_API void RectDrawArrow(const PaintContext &, SDst, Rotation=RDeg0, Color=ColorSpace::Black)
在指定上下文的矩形中描画底边和坐标轴共线的等腰直角三角形箭头。
Definition: YStyle.cpp:69
CHRLib::f
f(d, s)
YAssert
#define YAssert(_expr, _msg)
Definition: cassert.h:154
YSLib::Drawing::DrawCross
YF_API void DrawCross(const Graphics &, const Rect &, const Rect &, Color)
在指定图形接口上下文中使用指定颜色描画交叉直线段（“×”）。
Definition: YStyle.cpp:244
YSLib::UI::Styles::StyleMap::Switch
PaintEventArgs &&void Switch(const string &)
Definition: YStyle.cpp:524
YSLib::Drawing::g
The boundary is out of the const Graphics & g
Definition: YDraw.h:161
YSLib::Drawing::MonoType
octet MonoType
单色分量类型。
Definition: YGDIBase.h:47
YSLib::UI::Styles::Key
pair< std::type_index, StyleItem > Key
标识查找样式的键。
Definition: YStyle.h:380
YSLib::YAssert
YAssert(!(v< Deref(a)), "Value less than lower bound found.")
YSLib::Drawing::p1
The boundary is out of the const Graphics const Rect const Point & p1
Definition: YDraw.h:162
YSLib::Drawing::GGraphics
二维图形接口上下文模板。
Definition: YGraphics.h:63
ystdex::cpp2017::size
auto size(const _tRange &c) -> decltype(c.size())
Definition: range.hpp:540
YSLib::UI::Styles::StyleMap::Remove
void Remove(const string &)
Definition: YStyle.cpp:513
platform::Descriptions::Notice
@ Notice
Definition: YCommon.h:184
YSLib::Drawing::Rotation
Rotation
逆时针旋转角度指示输出指向。
Definition: YGDIBase.h:1145
YSLib::UI::name
yconstfn const string & name
Definition: Loader.h:130
YSLib::UI::FetchGUIConfiguration
GUIConfiguration & FetchGUIConfiguration()
Definition: YGUI.cpp:517
YSLib::Drawing::GBinaryGroup< SPos >
YSLib::i
return i
Definition: YCoreUtilities.h:177
yunseq
#define yunseq
无序列依赖表达式组求值。
Definition: ydef.h:1535
YTraceDe
#define YTraceDe(...)
YCLib 默认调试跟踪。
Definition: Debug.h:407
platform::SDst
std::uint16_t SDst
屏幕坐标距离。
Definition: Video.h:44
YSLib::UI::Styles::Palette::colors
ColorListType colors
颜色组。
Definition: YStyle.h:354
YSLib::Drawing::RectDrawCornerArrowOutline
YF_API void RectDrawCornerArrowOutline(const PaintContext &, SDst, Rotation=RDeg0, Color=ColorSpace::Black)
在指定上下文的矩形中描画腰和坐标轴共线的等腰直角三角形箭头轮廓。
Definition: YStyle.cpp:186
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
YSLib::Drawing::GBinaryGroup::X
_type X
分量。
Definition: YGDIBase.h:305
YSLib::UI::e
void e
Definition: YWidget.h:356
YSLib::Drawing::Rect
屏幕标准矩形：表示屏幕矩形区域。
Definition: YGDIBase.h:788
YSLib::Drawing::RectDrawCornerArrow
YF_API void RectDrawCornerArrow(const PaintContext &, SDst, Rotation=RDeg0, Color=ColorSpace::Black)
在指定上下文的矩形中描画腰和坐标轴共线的等腰直角三角形箭头。
Definition: YStyle.cpp:149
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:46
CHRLib::s
_tDst const _tSrc * s
Definition: CharacterProcessing.h:143
Color
Pixel Color
Definition: CharRenderer.cpp:59
YB_LIKELY
#define YB_LIKELY(_expr)
Definition: ydef.h:827
YModules.h
YSLib 用户界面模块配置文件。
YSLib::Drawing::y1
The boundary is out of the const Rect SDst SPos SPos y1
Definition: YDraw.h:127
ystdex::is_undereferenceable
bool is_undereferenceable(const _tIter &)
Definition: deref_op.hpp:46
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::IsInClosedInterval
YB_STATELESS bool IsInClosedInterval(_type i, _type b) ynothrow
判断 i 是否在闭区间 [_type(0), b] 中。
Definition: YCoreUtilities.h:111
YSLib::Drawing::RDeg0
@ RDeg0
Definition: YGDIBase.h:1146
YSLib::Drawing::bounds
The boundary is out of the const Rect & bounds
Definition: YDraw.h:127
v
byte v
Definition: CharRenderer.cpp:76
ystdex
<memory> 特性测试宏。
Definition: ydef.h:1262
YSLib::UI::PaintEventArgs
部件绘制参数。
Definition: YWidgetEvent.h:330
YSLib::UI::Styles::FetchDefault
YB_ATTR_nodiscard YB_PURE YF_API HandlerTable & FetchDefault()
取默认样式处理器表。
Definition: YStyle.cpp:538
ystdex::map::cend
const_iterator cend() const
Definition: map.hpp:277
YSLib::UI::Styles::HandlerTable
unordered_map< Key, Handler, ystdex::combined_hash< Key > > HandlerTable
样式处理器表。
Definition: YStyle.h:386
YSLib::Drawing::GBinaryGroup::Y
_type Y
Definition: YGDIBase.h:305
platform::p
return p p
Definition: YCLib/FileSystem.h:209
YSLib::Drawing::DrawRectRoundCorner
YF_API void DrawRectRoundCorner(const PaintContext &pc, const Size &s, Color)
绘制部件边框用空心标准矩形。
Definition: YStyle.cpp:42
ystdex::map::empty
bool empty() const
Definition: map.hpp:295
YSLib::Drawing::Vec
GBinaryGroup< SPos > Vec
屏幕二维向量（直角坐标表示）。
Definition: YGDIBase.h:527
const
const Decapsulate const Decapsulate &y ynothrow ContextNode &ctx const
Definition: NPLA1Forms.cpp:1629
yimpl
#define yimpl(...)
实现标签。
Definition: ydef.h:413
platform::SPos
std::int16_t SPos
屏幕坐标度量。
Definition: Video.h:43
YSLib::Drawing::RDeg90
@ RDeg90
Definition: YGDIBase.h:1147
YSLib::UI::Styles::Painter::operator()
key second key first void operator()(PaintEventArgs &&) const
Definition: YStyle.cpp:484
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:1199
ystdex::map::cbegin
const_iterator cbegin() const
Definition: map.hpp:271
YSLib::UI::Styles::Painter::key
Key key
Definition: YStyle.h:453