Massive cleaning (#5538)
[opentx.git] / radio / src / gui / 480x272 / gui.h
blob19b55f7600bf2f09a299ef355a2b38912186c667
1 /*
2 * Copyright (C) OpenTX
4 * Based on code named
5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _GUI_H_
22 #define _GUI_H_
24 #include "gui_common.h"
25 #include "lcd.h"
26 #include "menus.h"
27 #include "widgets.h"
28 #include "bitmaps.h"
29 #include "theme.h"
31 #define MENU_TOOLTIPS
32 #define MENU_HEADER_HEIGHT 45
33 #define MENU_TITLE_TOP 48
34 #define MENU_TITLE_HEIGHT 21
35 #define MENU_BODY_TOP (MENU_TITLE_TOP+MENU_TITLE_HEIGHT)
36 #define MENU_CONTENT_TOP (MENU_BODY_TOP+1)
37 #define MENU_FOOTER_HEIGHT 21
38 #define MENU_FOOTER_TOP (LCD_H-MENU_FOOTER_HEIGHT)
39 #define MENU_BODY_HEIGHT (MENU_FOOTER_TOP-MENU_BODY_TOP)
40 #define MENUS_MARGIN_LEFT 6
42 #define DEFAULT_SCROLLBAR_X LCD_W-10
43 #define DEFAULT_SCROLLBAR_Y MENU_CONTENT_TOP
44 #define DEFAULT_SCROLLBAR_H (MENU_FOOTER_TOP - DEFAULT_SCROLLBAR_Y - 6)
46 #define FH 20
47 #define NUM_BODY_LINES (MENU_BODY_HEIGHT / FH)
49 #define INVERT_HORZ_MARGIN 2
50 #define INVERT_VERT_MARGIN 1
51 #define INVERT_LINE_HEIGHT 20
53 #define CURVE_SIDE_WIDTH 100
54 #define CURVE_CENTER_X (LCD_W-CURVE_SIDE_WIDTH-7)
55 #define CURVE_CENTER_Y 151
56 #define CURVE_COORD_WIDTH 36
57 #define CURVE_COORD_HEIGHT 17
59 #define DATETIME_SEPARATOR_X (LCD_W-53)
60 #define DATETIME_LINE1 9
61 #define DATETIME_LINE2 23
62 #define DATETIME_MIDDLE (LCD_W+DATETIME_SEPARATOR_X+4)/2
64 #define MENU_TITLE_NEXT_POS (lcdNextPos + 10)
65 #define MENU_INIT_VPOS -1
67 #if defined(HELI) && defined(GVARS) && defined(LUA_MODEL_SCRIPTS)
68 #define MENU_ICONS_SPACING 31
69 #else
70 #define MENU_ICONS_SPACING 33
71 #endif
73 #define SUBMENU_LINE_WIDTH 230
75 #define LOAD_MODEL_BITMAP()
77 #if defined(FLIGHT_MODES)
78 void displayFlightModes(coord_t x, coord_t y, FlightModesType value, uint8_t attr);
79 FlightModesType editFlightModes(coord_t x, coord_t y, event_t event, FlightModesType value, uint8_t attr);
80 #else
81 #define displayFlightModes(...)
82 #endif
84 #define ALERT_SOUND_ARG , uint8_t sound
86 // Curve functions
87 coord_t getCurveYCoord(FnFuncP fn, int x, int width);
88 void drawFunction(FnFuncP fn, int offset);
89 void drawCurveVerticalScale(int x);
90 void drawCurveHorizontalScale();
91 void drawCurveCoord(int x, int y, const char * text, bool active=false);
92 void drawCurvePoint(int x, int y, LcdFlags color);
94 extern Layout * customScreens[MAX_CUSTOM_SCREENS];
95 extern Topbar * topbar;
97 void drawAlertBox(const char * title, const char * text, const char * action);
98 void showAlertBox(const char * title, const char * text, const char * action, uint8_t sound);
100 #define IS_MAIN_VIEW_DISPLAYED() menuHandlers[0] == menuMainView
101 #define IS_TELEMETRY_VIEW_DISPLAYED() false
102 #define IS_OTHER_VIEW_DISPLAYED() false
104 #endif // _GUI_H_