]> git.lyx.org Git - lyx.git/blob - src/ColorCode.h
* GuiTabular.cpp:
[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         /// Foreground color of selected text
48         Color_selectiontext,
49         /// Text color in LaTeX mode
50         Color_latex,
51         /// The color used for previews
52         Color_preview,
53         /// Inline completion color
54         Color_inlinecompletion,
55         /// Inline completion color for the non-unique part
56         Color_nonunique_inlinecompletion,
57
58         /// Label color for notes
59         Color_notelabel,
60         /// Background color of notes
61         Color_notebg,
62         /// Label color for comments
63         Color_commentlabel,
64         /// Background color of comments
65         Color_commentbg,
66         /// Label color for greyedout insets
67         Color_greyedoutlabel,
68         /// Color for greyedout inset text
69         Color_greyedouttext,
70         /// Background color of greyedout inset
71         Color_greyedoutbg,
72         /// Background color of shaded box
73         Color_shadedbg,
74         /// Background color of listings inset
75         Color_listingsbg,
76
77         /// Label color for branches
78         Color_branchlabel,
79         /// Label color for footnotes
80         Color_footlabel,
81         /// Label color for index insets
82         Color_indexlabel,
83         /// Label color for margin notes
84         Color_marginlabel,
85         /// Text color for phantom insets
86         Color_phantomtext,
87         /// Label color for URL insets
88         Color_urllabel,
89
90         /// Color for URL inset text
91         Color_urltext,
92
93         /// Color for the depth bars in the margin
94         Color_depthbar,
95         /// Color for marking foreign language words
96         Color_language,
97
98         /// Text color for command insets
99         Color_command,
100         /// Background color for command insets
101         Color_commandbg,
102         /// Frame color for command insets
103         Color_commandframe,
104
105         /// Special chars text color
106         Color_special,
107
108         /// Graphics inset background color
109         Color_graphicsbg,
110         /// Math inset text color
111         Color_math,
112         /// Math inset background color
113         Color_mathbg,
114         /// Macro math inset background color
115         Color_mathmacrobg,
116         /// Macro math inset background color hovered
117         Color_mathmacrohoverbg,
118         /// Macro math label color
119         Color_mathmacrolabel,
120         /// Macro math frame color
121         Color_mathmacroframe,
122         /// Macro math blended color 
123         Color_mathmacroblend,
124         /// Macro template color for old parameters 
125         Color_mathmacrooldarg,
126         /// Macro template color for new parameters 
127         Color_mathmacronewarg,
128         /// Math inset frame color under focus
129         Color_mathframe,
130         /// Math inset frame color not under focus
131         Color_mathcorners,
132         /// Math line color
133         Color_mathline,
134
135         /// Collapsable insets text
136         Color_collapsable,
137         /// Collapsable insets frame
138         Color_collapsableframe,
139
140         /// Inset marker background color
141         Color_insetbg,
142         /// Inset marker frame color
143         Color_insetframe,
144
145         /// Error box text color
146         Color_error,
147         /// EOL marker color
148         Color_eolmarker,
149         /// Added space colour
150         Color_added_space,
151         /// Appendix marker color
152         Color_appendix,
153         /// Changebar color
154         Color_changebar,
155         /// Deleted text color
156         Color_deletedtext,
157         /// Added text color
158         Color_addedtext,
159         /// Changed text color author 1
160         Color_changedtextauthor1,
161         /// Changed text color author 2
162         Color_changedtextauthor2,
163         /// Changed text color author 3
164         Color_changedtextauthor3,
165         /// Changed text color author 4
166         Color_changedtextauthor4,
167         /// Changed text color author 5
168         Color_changedtextauthor5,
169         /// Deleted text modifying color
170         Color_deletedtextmodifier,
171         /// Table line color
172         Color_tabularline,
173         /// Table line color
174         Color_tabularonoffline,
175         /// Bottom area color
176         Color_bottomarea,
177         /// New page color
178         Color_newpage,
179         /// Page break color
180         Color_pagebreak,
181
182         // FIXME: why are the next four separate ??
183         /// Color used for button frame
184         Color_buttonframe,
185         /// Color used for bottom background
186         Color_buttonbg,
187         /// Color used for buttom under focus
188         Color_buttonhoverbg,
189         /// Color used for the pilcrow sign to mark the end of a paragraph
190         Color_paragraphmarker,
191         /// Preview frame color
192         Color_previewframe,
193
194         // Logical attributes
195
196         /// Color is inherited
197         Color_inherit,
198         /// Color for regexp frame
199         Color_regexpframe,
200         /// For ignoring updates of a color
201         Color_ignore
202 };
203
204
205 struct RGBColor {
206         unsigned int r;
207         unsigned int g;
208         unsigned int b;
209         RGBColor() : r(0), g(0), b(0) {}
210         RGBColor(unsigned int red, unsigned int green, unsigned int blue)
211                 : r(red), g(green), b(blue) {}
212 };
213
214 inline bool operator==(RGBColor const & c1, RGBColor const & c2)
215 {
216         return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
217 }
218
219
220 inline bool operator!=(RGBColor const & c1, RGBColor const & c2)
221 {
222         return !(c1 == c2);
223 }
224
225 } // namespace lyx
226
227 #endif