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