android/GlueIOIOPort: fix spurious errors after IOIO baud rate change
[xcsoar.git] / src / Look / InfoBoxLook.hpp
blob4bf3d94f0bdf993eec93182aa4d901f116fa92b2
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 constexpr unsigned BORDER_WIDTH = 1;
36 bool inverse;
38 Pen border_pen, selector_pen;
39 Color background_color, focused_background_color, pressed_background_color;
41 /**
42 * Used only by #InfoBoxSettings::BorderStyle::SHADED.
44 Color caption_background_color;
46 struct {
47 Color fg_color;
48 const Font *font;
49 } title, value, comment;
51 const Font *small_font;
52 #ifndef GNAV
53 const Font *unit_font;
54 Pen unit_fraction_pen;
55 #endif
57 Color colors[6];
59 void Initialise(bool inverse, bool use_colors,
60 const Font &value_font,
61 const Font &small_font,
62 #ifndef GNAV
63 const Font &unit_font,
64 #endif
65 const Font &title_font);
67 Color GetColor(int i, Color default_color) const {
68 if (i < 0)
69 return colors[0];
70 else if (i >= 1 && (unsigned)i < ARRAY_SIZE(colors))
71 return colors[i];
72 else
73 return default_color;
76 Color GetTitleColor(int i) const {
77 return GetColor(i, title.fg_color);
80 Color GetValueColor(int i) const {
81 return GetColor(i, value.fg_color);
84 Color GetCommentColor(int i) const {
85 return GetColor(i, comment.fg_color);
89 #endif