Projection: make invalid by default, add IsValid()
[xcsoar.git] / src / Look / InfoBoxLook.hpp
blob8e6430ac6887a78402a5fde6e10f732b22111c09
1 /*
2 Copyright_License {
4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #ifndef XCSOAR_INFO_BOX_LOOK_HPP
25 #define XCSOAR_INFO_BOX_LOOK_HPP
27 #include "Screen/Pen.hpp"
28 #include "Screen/Brush.hpp"
29 #include "Util/Macros.hpp"
31 class Font;
33 struct InfoBoxLook {
34 static const unsigned BORDER_WIDTH = 1;
36 bool inverse;
38 Pen border_pen, selector_pen;
39 Color background_color, focused_background_color, pressed_background_color;
41 struct {
42 Color fg_color;
43 const Font *font;
44 } title, value, comment;
46 const Font *small_font;
47 #ifndef GNAV
48 const Font *unit_font;
49 Pen unit_fraction_pen;
50 #endif
52 Color colors[6];
54 void Initialise(bool inverse, bool use_colors,
55 const Font &value_font,
56 const Font &small_font,
57 #ifndef GNAV
58 const Font &unit_font,
59 #endif
60 const Font &title_font);
62 Color GetColor(int i, Color default_color) const {
63 if (i < 0)
64 return colors[0];
65 else if (i >= 1 && (unsigned)i < ARRAY_SIZE(colors))
66 return colors[i];
67 else
68 return default_color;
71 Color GetTitleColor(int i) const {
72 return GetColor(i, title.fg_color);
75 Color GetValueColor(int i) const {
76 return GetColor(i, value.fg_color);
79 Color GetCommentColor(int i) const {
80 return GetColor(i, comment.fg_color);
84 #endif