]> git.lyx.org Git - lyx.git/blob - src/ColorCode.h
Less expensive OP first as this might be called often.
[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         /// No particular color---clear or default
18         Color_none,
19         /// The different text colors
20         Color_black,
21         ///
22         Color_white,
23         ///
24         Color_blue,
25         ///
26         Color_brown,
27         ///
28         Color_cyan,
29         ///
30         Color_darkgray,
31         ///
32         Color_gray,
33         ///
34         Color_green,
35         ///
36         Color_lightgray,
37         ///
38         Color_lime,
39         ///
40         Color_magenta,
41         ///
42         Color_olive,
43         ///
44         Color_orange,
45         ///
46         Color_pink,
47         ///
48         Color_purple,
49         ///
50         Color_red,
51         ///
52         Color_teal,
53         ///
54         Color_violet,
55         ///
56         Color_yellow,
57
58         // Needed interface colors
59
60         /// Cursor color
61         Color_cursor,
62         /// Background color
63         Color_background,
64         /// Foreground color
65         Color_foreground,
66         /// Background color of selected text
67         Color_selection,
68         /// Foreground color of selected text
69         Color_selectiontext,
70         /// Text color in LaTeX mode
71         Color_latex,
72         /// The color used for previews
73         Color_preview,
74         /// Inline completion color
75         Color_inlinecompletion,
76         /// Inline completion color for the non-unique part
77         Color_nonunique_inlinecompletion,
78
79         /// Label color for notes
80         Color_notelabel,
81         /// Background color of notes
82         Color_notebg,
83         /// Label color for comments
84         Color_commentlabel,
85         /// Background color of comments
86         Color_commentbg,
87         /// Label color for greyedout insets
88         Color_greyedoutlabel,
89         /// Color for greyedout inset text
90         Color_greyedouttext,
91         /// Background color of greyedout inset
92         Color_greyedoutbg,
93         /// Background color of shaded box
94         Color_shadedbg,
95         /// Background color of listings inset
96         Color_listingsbg,
97
98         /// Label color for branches
99         Color_branchlabel,
100         /// Label color for footnotes
101         Color_footlabel,
102         /// Label color for index insets
103         Color_indexlabel,
104         /// Label color for margin notes
105         Color_marginlabel,
106         /// Text color for phantom insets
107         Color_phantomtext,
108         /// Label color for URL insets
109         Color_urllabel,
110
111         /// Label color 1 for text (layout) labels
112         Color_textlabel1,
113         /// Label color 2 for text (layout) labels
114         Color_textlabel2,
115         /// Label color 3 for text (layout) labels
116         Color_textlabel3,
117
118         /// Color for URL inset text
119         Color_urltext,
120
121         /// Color for the depth bars in the margin
122         Color_depthbar,
123         /// Color that indicates when a row can be scrolled
124         Color_scroll,
125         /// Color for marking foreign language words
126         Color_language,
127
128         /// Text color for command insets
129         Color_command,
130         /// Background color for command insets
131         Color_commandbg,
132         /// Frame color for command insets
133         Color_commandframe,
134
135         /// Special chars text color
136         Color_special,
137
138         /// Graphics inset background color
139         Color_graphicsbg,
140         /// Math inset text color
141         Color_math,
142         /// Math inset background color
143         Color_mathbg,
144         /// Macro math inset background color
145         Color_mathmacrobg,
146         /// Macro math inset background color hovered
147         Color_mathmacrohoverbg,
148         /// Macro math label color
149         Color_mathmacrolabel,
150         /// Macro math frame color
151         Color_mathmacroframe,
152         /// Macro math blended color
153         Color_mathmacroblend,
154         /// Macro template color for old parameters
155         Color_mathmacrooldarg,
156         /// Macro template color for new parameters
157         Color_mathmacronewarg,
158         /// Math inset frame color under focus
159         Color_mathframe,
160         /// Math inset frame color not under focus
161         Color_mathcorners,
162         /// Math empty box line color
163         Color_mathline,
164
165         /// Collapsible insets text
166         Color_collapsible,
167         /// Collapsible insets frame
168         Color_collapsibleframe,
169
170         /// Inset marker background color
171         Color_insetbg,
172         /// Inset marker frame color
173         Color_insetframe,
174         /// Inset marker label color
175         Color_insetlabel,
176
177         /// Error box text color
178         Color_error,
179         /// End of line (EOL) marker color
180         Color_eolmarker,
181         /// Added space colour
182         Color_added_space,
183         /// Appendix marker color
184         Color_appendix,
185         /// Changebar color
186         Color_changebar,
187         /// Deleted text color (exported output) in CT
188         Color_deletedtext_output,
189         /// Added text color (exported output) in CT
190         Color_addedtext_output,
191         /// Changed text color author 1 (workarea)
192         Color_changedtext_workarea_author1,
193         /// Changed text color author 2 (workarea)
194         Color_changedtext_workarea_author2,
195         /// Changed text color author 3 (workarea)
196         Color_changedtext_workarea_author3,
197         /// Changed text color author 4 (workarea)
198         Color_changedtext_workarea_author4,
199         /// Changed text color author 5 (workarea)
200         Color_changedtext_workarea_author5,
201         /// Changed text color document comparison (workarea)
202         Color_changedtext_workarea_comparison,
203         /// Deleted text modifying color (for brightness modulation) (workarea)
204         Color_deletedtext_workarea_modifier,
205         /// Table line color
206         Color_tabularline,
207         /// Table line color
208         Color_tabularonoffline,
209         /// Bottom area color
210         Color_bottomarea,
211         /// New page color
212         Color_newpage,
213         /// Page break color
214         Color_pagebreak,
215
216         // FIXME: why are the next four separate ??
217         /// Color used for button frame
218         Color_buttonframe,
219         /// Color used for bottom background
220         Color_buttonbg,
221         /// Color used for button under focus
222         Color_buttonhoverbg,
223         /// Text color for broken insets
224         Color_command_broken,
225         /// Background color for broken insets
226         Color_buttonbg_broken,
227         /// Frame color for broken insets
228         Color_buttonframe_broken,
229         /// Color used for broken inset button under focus
230         Color_buttonhoverbg_broken,
231         /// Color used for the pilcrow sign to mark the end of a paragraph
232         Color_paragraphmarker,
233         /// Preview frame color
234         Color_previewframe,
235         /// Bookmark indicator color
236         Color_bookmark,
237
238         // Logical attributes
239
240         /// Color is inherited
241         Color_inherit,
242         /// Color for regexp frame
243         Color_regexpframe,
244         /// For ignoring updates of a color
245         Color_ignore,
246         Color_max = 500
247 };
248
249
250 struct RGBColor {
251         unsigned int r;
252         unsigned int g;
253         unsigned int b;
254         RGBColor() : r(0), g(0), b(0) {}
255         RGBColor(unsigned int red, unsigned int green, unsigned int blue)
256                 : r(red), g(green), b(blue) {}
257 };
258
259 inline bool operator==(RGBColor const & c1, RGBColor const & c2)
260 {
261         return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
262 }
263
264
265 inline bool operator!=(RGBColor const & c1, RGBColor const & c2)
266 {
267         return !(c1 == c2);
268 }
269
270 } // namespace lyx
271
272 #endif