]> git.lyx.org Git - lyx.git/blob - src/ColorCode.h
Change string
[lyx.git] / src / ColorCode.h
1 // -*- C++ -*-
2 /**
3  * \file ColorCode.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * Full author contact details are available in file CREDITS.
8  */
9
10 #ifndef COLOR_CODE_H
11 #define COLOR_CODE_H
12
13 namespace lyx {
14
15 /// Names of colors, including all logical colors
16 enum ColorCode
17 {
18         /// No particular color---clear or default
19         Color_none,
20         /// The different text colors
21         Color_black,
22         ///
23         Color_white,
24         ///
25         Color_red,
26         ///
27         Color_green,
28         ///
29         Color_blue,
30         ///
31         Color_cyan,
32         ///
33         Color_magenta,
34         ///
35         Color_yellow,
36
37         // Needed interface colors
38
39         /// Cursor color
40         Color_cursor,
41         /// Background color
42         Color_background,
43         /// Foreground color
44         Color_foreground,
45         /// Background color of selected text
46         Color_selection,
47         /// Text color in LaTeX mode
48         Color_latex,
49         /// The color used for previews
50         Color_preview,
51         /// Inline completion color
52         Color_inlinecompletion,
53         /// Inline completion color for the non-unique part
54         Color_nonunique_inlinecompletion,
55
56         /// Label color for notes
57         Color_notelabel,
58         /// Background color of notes
59         Color_notebg,
60         /// Label color for comments
61         Color_commentlabel,
62         /// Background color of comments
63         Color_commentbg,
64         /// Label color for greyedout insets
65         Color_greyedoutlabel,
66         /// Background color of greyedout inset
67         Color_greyedoutbg,
68         /// Shaded box background
69         Color_shadedbg,
70
71         /// Label color for branches
72         Color_branchlabel,
73         /// Label color for footnotes
74         Color_footlabel,
75         /// Label color for index insets
76         Color_indexlabel,
77         /// Label color for margin notes
78         Color_marginlabel,
79         /// Label color for URL insets
80         Color_urllabel,
81
82         /// Color for URL inset text
83         Color_urltext,
84
85         /// Color for the depth bars in the margin
86         Color_depthbar,
87         /// Color for marking foreign language words
88         Color_language,
89
90         /// Text color for command insets
91         Color_command,
92         /// Background color for command insets
93         Color_commandbg,
94         /// Frame color for command insets
95         Color_commandframe,
96
97         /// Special chars text color
98         Color_special,
99
100         /// Graphics inset background color
101         Color_graphicsbg,
102         /// Math inset text color
103         Color_math,
104         /// Math inset background color
105         Color_mathbg,
106         /// Macro math inset background color
107         Color_mathmacrobg,
108         /// Macro math inset background color hovered
109         Color_mathmacrohoverbg,
110         /// Macro math label color
111         Color_mathmacrolabel,
112         /// Macro math frame color
113         Color_mathmacroframe,
114         /// Macro math blended color 
115         Color_mathmacroblend,
116         /// Macro template color for old parameters 
117         Color_mathmacrooldarg,
118         /// Macro template color for new parameters 
119         Color_mathmacronewarg,
120         /// Math inset frame color under focus
121         Color_mathframe,
122         /// Math inset frame color not under focus
123         Color_mathcorners,
124         /// Math line color
125         Color_mathline,
126
127         /// caption frame color
128         Color_captionframe,
129
130         /// collapsable insets text
131         Color_collapsable,
132         /// collapsable insets frame
133         Color_collapsableframe,
134
135         /// Inset marker background color
136         Color_insetbg,
137         /// Inset marker frame color
138         Color_insetframe,
139
140         /// Error box text color
141         Color_error,
142         /// EOL marker color
143         Color_eolmarker,
144         /// Added space colour
145         Color_added_space,
146         /// Appendix marker color
147         Color_appendix,
148         /// changebar color
149         Color_changebar,
150         /// deleted text color
151         Color_deletedtext,
152         /// added text color
153         Color_addedtext,
154         /// Top and bottom line color
155         Color_topline,
156         /// Table line color
157         Color_tabularline,
158         /// Table line color
159         Color_tabularonoffline,
160         /// Bottom area color
161         Color_bottomarea,
162         /// New page color
163         Color_newpage,
164         /// Page break color
165         Color_pagebreak,
166
167         // FIXME: why are the next four separate ??
168         /// Color used for button frame
169         Color_buttonframe,
170         /// Color used for bottom background
171         Color_buttonbg,
172         /// Color used for buttom under focus
173         Color_buttonhoverbg,
174
175         // Logical attributes
176
177         /// Color is inherited
178         Color_inherit,
179         /// For ignoring updates of a color
180         Color_ignore
181 };
182
183
184 struct RGBColor {
185         unsigned int r;
186         unsigned int g;
187         unsigned int b;
188         RGBColor() : r(0), g(0), b(0) {}
189         RGBColor(unsigned int red, unsigned int green, unsigned int blue)
190                 : r(red), g(green), b(blue) {}
191 };
192
193 inline bool operator==(RGBColor const & c1, RGBColor const & c2)
194 {
195         return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
196 }
197
198
199 inline bool operator!=(RGBColor const & c1, RGBColor const & c2)
200 {
201         return !(c1 == c2);
202 }
203
204 } // namespace lyx
205
206 #endif