]> git.lyx.org Git - lyx.git/blob - src/ColorCode.h
* the automatic arity changing proposed by Uwe: you go into a macro and type \#9...
[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         /// Text color for notes
57         Color_note,
58         /// Background color of notes
59         Color_notebg,
60         /// Text color for comments
61         Color_comment,
62         /// Background color of comments
63         Color_commentbg,
64         /// Text color for greyedout inset
65         Color_greyedout,
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         /// Label color for URL text
82         Color_urltext,
83
84         /// Color for the depth bars in the margin
85         Color_depthbar,
86         /// Color for marking foreign language words
87         Color_language,
88
89         /// Text color for command insets
90         Color_command,
91         /// Background color for command insets
92         Color_commandbg,
93         /// Frame color for command insets
94         Color_commandframe,
95
96         /// Special chars text color
97         Color_special,
98
99         /// Graphics inset background color
100         Color_graphicsbg,
101         /// Math inset text color
102         Color_math,
103         /// Math inset background color
104         Color_mathbg,
105         /// Macro math inset background color
106         Color_mathmacrobg,
107         /// Macro math inset background color hovered
108         Color_mathmacrohoverbg,
109         /// Macro math label color
110         Color_mathmacrolabel,
111         /// Macro math frame color
112         Color_mathmacroframe,
113         /// Macro math blended color 
114         Color_mathmacroblend,
115         /// Macro template color for old parameters 
116         Color_mathmacrooldarg,
117         /// Macro template color for new parameters 
118         Color_mathmacronewarg,
119         /// Math inset frame color under focus
120         Color_mathframe,
121         /// Math inset frame color not under focus
122         Color_mathcorners,
123         /// Math line color
124         Color_mathline,
125
126         /// caption frame color
127         Color_captionframe,
128
129         /// collapsable insets text
130         Color_collapsable,
131         /// collapsable insets frame
132         Color_collapsableframe,
133
134         /// Inset marker background color
135         Color_insetbg,
136         /// Inset marker frame color
137         Color_insetframe,
138
139         /// Error box text color
140         Color_error,
141         /// EOL marker color
142         Color_eolmarker,
143         /// Added space colour
144         Color_added_space,
145         /// Appendix marker color
146         Color_appendix,
147         /// changebar color
148         Color_changebar,
149         /// deleted text color
150         Color_deletedtext,
151         /// added text color
152         Color_addedtext,
153         /// Top and bottom line color
154         Color_topline,
155         /// Table line color
156         Color_tabularline,
157         /// Table line color
158         Color_tabularonoffline,
159         /// Bottom area color
160         Color_bottomarea,
161         /// New page color
162         Color_newpage,
163         /// Page break color
164         Color_pagebreak,
165
166         // FIXME: why are the next four separate ??
167         /// Color used for button frame
168         Color_buttonframe,
169         /// Color used for bottom background
170         Color_buttonbg,
171         /// Color used for buttom under focus
172         Color_buttonhoverbg,
173
174         // Logical attributes
175
176         /// Color is inherited
177         Color_inherit,
178         /// For ignoring updates of a color
179         Color_ignore
180 };
181
182
183 struct RGBColor {
184         unsigned int r;
185         unsigned int g;
186         unsigned int b;
187         RGBColor() : r(0), g(0), b(0) {}
188         RGBColor(unsigned int red, unsigned int green, unsigned int blue)
189                 : r(red), g(green), b(blue) {}
190 };
191
192 inline bool operator==(RGBColor const & c1, RGBColor const & c2)
193 {
194         return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
195 }
196
197
198 inline bool operator!=(RGBColor const & c1, RGBColor const & c2)
199 {
200         return !(c1 == c2);
201 }
202
203 } // namespace lyx
204
205 #endif