YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ystyle.h
浏览该文件的文档.
1 /*
2  Copyright by FrankHB 2010 - 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_ystyle_h_
29 #define YSL_INC_UI_ystyle_h_ 1
30 
31 #include "ycomp.h"
32 #include "../Service/ydraw.h"
33 #include <ystdex/rational.hpp>
34 
36 
37 YSL_BEGIN_NAMESPACE(Drawing)
38 
39 
44 YF_API bool
45 DrawRectRoundCorner(const Graphics&, const Point&, const Size&, Color);
46 
47 
52 YF_API void
53 RectDrawArrow(const Graphics&, const Point&, SDst, Rotation = RDeg0,
54  Color c = ColorSpace::Black);
55 
60 YF_API void
61 DrawArrow(const Graphics&, const Rect&, SDst = 4, Rotation = RDeg0,
62  Color = ColorSpace::Black);
63 
69 YF_API void
70 DrawCross(const Graphics&, const Point&, const Size&, Color);
71 
72 
77 template<Color::MonoType r, Color::MonoType g, Color::MonoType b>
78 inline void
80 {
81  const Color d(*dst);
82 
83  *dst = Color(d.GetR() ^ r, d.GetG() ^ g, d.GetB() ^ b);
84 }
85 
86 
87 //平台无关色彩系统类型和转换。
88 
95 
96 
101 typedef struct
102 {
113  float s, l;
114 } hsl_t;
115 
122 
129 
130 
131 YSL_END_NAMESPACE(Drawing)
132 
134 
136 
141 typedef enum
142 {
143  //背景和填充区域。
144  Null = 0,
145  Desktop = 1,
146  Window = 2,
147  Panel = 3,
148  Track = 4,
149  Workspace = 5,
150  Shadow = 6,
152  Light = 8,
153  Frame = 9,
154  Highlight = 10,
155  BorderFill = 11,
158  ActiveTitle = 14,
160 
161  //前景和文本。
164  PanelText = 18,
165  GrayText = 19,
166  TitleText = 20,
169 
170  EndArea = 24
171 } Area;
172 
173 
179 {
180 public:
181  typedef Drawing::Color ItemType; //项目类型。
182  typedef vector<ItemType> ColorListType; //颜色组类型。
183 
184 private:
185  ColorListType colors; //颜色组。
186 // Drawing::Color colors[EndArea];
187 
188 public:
193  Palette();
194 
198  PDefHOp(Drawing::Color&, [], size_t s)
199  ImplRet(colors[s])
200 
201  DefGetter(const ynothrow, const ColorListType&, List, colors)
202  DefGetter(ynothrow, ColorListType&, List, colors)
206  pair<Drawing::Color, Drawing::Color>
207  GetPair(ColorListType::size_type, ColorListType::size_type) const;
208 };
209 
210 YSL_END_NAMESPACE(Styles)
211 
213 
214 YSL_END
215 
216 #endif
217