Renderer, ...: use PixelRect::GetCenter()
[xcsoar.git] / src / Input / InputQueue.hpp
blob017e72cc06df83db77a4af3178ffeb5806987d3a
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_INPUT_QUEUE_HPP
25 #define XCSOAR_INPUT_QUEUE_HPP
27 #include "Math/fixed.hpp"
28 #include "Compiler.h"
30 #include <tchar.h>
32 struct InputConfig;
34 typedef void (*pt2Event)(const TCHAR *);
36 namespace InputEvents
38 void ClearQueues();
39 bool processNmea(unsigned key);
40 bool processGlideComputer(unsigned gce_id);
42 void DoQueuedEvents();
45 // GCE = Glide Computer Event
46 enum {
47 GCE_AIRSPACE_ENTER,
48 GCE_AIRSPACE_LEAVE,
49 GCE_COMMPORT_RESTART,
50 GCE_FLARM_NOTRAFFIC,
51 GCE_FLARM_TRAFFIC,
52 GCE_FLARM_NEWTRAFFIC,
53 GCE_FLIGHTMODE_CLIMB,
54 GCE_FLIGHTMODE_CRUISE,
55 GCE_FLIGHTMODE_FINALGLIDE,
56 GCE_FLIGHTMODE_FINALGLIDE_TERRAIN,
57 GCE_FLIGHTMODE_FINALGLIDE_ABOVE,
58 GCE_FLIGHTMODE_FINALGLIDE_BELOW,
59 GCE_GPS_CONNECTION_WAIT,
60 GCE_GPS_FIX_WAIT,
61 GCE_HEIGHT_MAX,
62 GCE_LANDING,
63 GCE_STARTUP_REAL,
64 GCE_STARTUP_SIMULATOR,
65 GCE_TAKEOFF,
66 GCE_TASK_NEXTWAYPOINT,
67 GCE_TASK_START,
68 GCE_TASK_FINISH,
69 GCE_TEAM_POS_REACHED,
70 GCE_ARM_READY,
71 GCE_POLAR_CHANGED,
72 GCE_ALTERNATE_CHANGED,
73 GCE_LANDABLE_UNREACHABLE,
74 GCE_COUNT // How many we have for arrays etc
77 // NE = NMEA Events (hard coded triggered events from the NMEA processor)
78 enum {
79 NE_DOWN_IN_FLAP_POS= 0,
80 NE_DOWN_IN_FLAP_ZERO= 1,
81 NE_DOWN_IN_FLAP_NEG= 2,
82 NE_DOWN_IN_SC= 3,
83 NE_DOWN_IN_GEAR_RETRACTED= 4,
84 NE_DOWN_IN_GEAR_EXTENDED= 5,
85 NE_DOWN_IN_AIRBRAKENOTLOCKED= 6,
86 NE_DOWN_IN_AUX= 7,
87 NE_DOWN_IN_ACK= 8,
88 NE_DOWN_IN_REP= 9,
89 NE_DOWN_IN_CIRCLING_PDA= 10,
90 NE_DOWN_IN_CIRCLING_FLARM= 11,
91 NE_DOWN_IN_FLYING= 12,
92 NE_DOWN_IN_NOTFLYING= 13,
93 NE_DOWN_IN_PDA_CONNECTED= 14,
94 NE_DOWN_IN_VELOCITY_MANOEUVERING= 15,
95 NE_DOWN_IN_VELOCITY_FLAP= 16,
96 NE_DOWN_IN_VELOCITY_AIRBRAKE= 17,
97 NE_DOWN_IN_VELOCITY_TERRAIN= 18,
98 NE_DOWN_IN_VELOCITY_NEVEREXCEED= 19,
99 NE_DOWN_IN_STALL= 20,
100 NE_DOWN_IN_AIRBRAKELOCKED= 21,
101 NE_DOWN_IN_TAKINGOFF= 22,
102 NE_DOWN_IN_USERSWUP= 23,
103 NE_DOWN_IN_USERSWMIDDLE= 24,
104 NE_DOWN_IN_USERSWDOWN= 25,
106 NE_UNUSED_0 = 26,
107 NE_UNUSED_1 = 27,
108 NE_UNUSED_2 = 28,
109 NE_UNUSED_3 = 29,
110 NE_UNUSED_4 = 30,
111 NE_UNUSED_5 = 31,
113 NE_DOWN_OUT_CIRCLING= 32,
114 NE_DOWN_OUT_VELOCITY_MANOEUVERING= 33,
115 NE_DOWN_OUT_VELOCITY_FLAP= 34,
116 NE_DOWN_OUT_VELOCITY_AIRBRAKE= 35,
117 NE_DOWN_OUT_VELOCITY_TERRAIN= 36,
118 NE_DOWN_OUT_VELOCITY_NEVEREXCEED= 37,
119 NE_DOWN_OUT_GEAR_LANDING= 38,
120 NE_DOWN_OUT_FLAP_LANDING= 39,
121 NE_DOWN_OUT_AIRBRAKE_TAKEOFF= 40,
122 NE_DOWN_OUT_STALL= 41,
124 NE_UNUSED_6 = 42,
125 NE_UNUSED_7 = 43,
126 NE_UNUSED_8 = 44,
127 NE_UNUSED_9 = 45,
128 NE_UNUSED_10 = 46,
129 NE_UNUSED_11 = 47,
130 NE_UNUSED_12 = 48,
131 NE_UNUSED_13 = 49,
132 NE_UNUSED_14 = 50,
133 NE_UNUSED_15 = 51,
134 NE_UNUSED_16 = 52,
135 NE_UNUSED_17 = 53,
136 NE_UNUSED_18 = 54,
137 NE_UNUSED_19 = 55,
138 NE_UNUSED_20 = 56,
139 NE_UNUSED_21 = 57,
140 NE_UNUSED_22 = 58,
141 NE_UNUSED_23 = 59,
142 NE_UNUSED_24 = 60,
143 NE_UNUSED_25 = 61,
144 NE_UNUSED_26 = 62,
145 NE_UNUSED_27 = 63,
147 NE_UP_IN_FLAP_POS= 64,
148 NE_UP_IN_FLAP_ZERO= 65,
149 NE_UP_IN_FLAP_NEG= 66,
150 NE_UP_IN_SC= 67,
151 NE_UP_IN_GEAR_RETRACTED= 68,
152 NE_UP_IN_GEAR_EXTENDED= 69,
153 NE_UP_IN_AIRBRAKENOTLOCKED= 70,
154 NE_UP_IN_AUX= 71,
155 NE_UP_IN_ACK= 72,
156 NE_UP_IN_REP= 73,
157 NE_UP_IN_CIRCLING_PDA= 74,
158 NE_UP_IN_CIRCLING_FLARM= 75,
159 NE_UP_IN_FLYING= 76,
160 NE_UP_IN_NOTFLYING= 77,
161 NE_UP_IN_PDA_CONNECTED= 78,
162 NE_UP_IN_VELOCITY_MANOEUVERING= 79,
163 NE_UP_IN_VELOCITY_FLAP= 80,
164 NE_UP_IN_VELOCITY_AIRBRAKE= 81,
165 NE_UP_IN_VELOCITY_TERRAIN= 82,
166 NE_UP_IN_VELOCITY_NEVEREXCEED= 83,
167 NE_UP_IN_STALL= 84,
168 NE_UP_IN_AIRBRAKELOCKED= 85,
169 NE_UP_IN_TAKINGOFF= 86,
170 NE_UP_IN_USERSWUP= 87,
171 NE_UP_IN_USERSWMIDDLE= 88,
172 NE_UP_IN_USERSWDOWN= 89,
174 NE_UNUSED_28 = 90,
175 NE_UNUSED_29 = 91,
176 NE_UNUSED_30 = 92,
177 NE_UNUSED_31 = 93,
178 NE_UNUSED_32 = 94,
179 NE_UNUSED_33 = 95,
181 NE_UP_OUT_CIRCLING= 96,
182 NE_UP_OUT_VELOCITY_MANOEUVERING= 97,
183 NE_UP_OUT_VELOCITY_FLAP= 98,
184 NE_UP_OUT_VELOCITY_AIRBRAKE= 99,
185 NE_UP_OUT_VELOCITY_TERRAIN= 100,
186 NE_UP_OUT_VELOCITY_NEVEREXCEED= 101,
187 NE_UP_OUT_GEAR_LANDING= 102,
188 NE_UP_OUT_FLAP_LANDING= 103,
189 NE_UP_OUT_AIRBRAKE_TAKEOFF= 104,
190 NE_UP_OUT_STALL= 105,
192 NE_UNUSED_34 = 106,
193 NE_UNUSED_35 = 107,
194 NE_UNUSED_36 = 108,
195 NE_UNUSED_37 = 108, // XXX Duplicate of above
196 NE_UNUSED_38 = 109,
197 NE_UNUSED_39 = 110,
198 NE_UNUSED_40 = 111,
199 NE_UNUSED_41 = 112,
200 NE_UNUSED_42 = 113,
201 NE_UNUSED_43 = 114,
202 NE_UNUSED_44 = 115,
203 NE_UNUSED_45 = 116,
204 NE_UNUSED_46 = 117,
205 NE_UNUSED_47 = 118,
206 NE_UNUSED_48 = 119,
207 NE_UNUSED_49 = 120,
208 NE_UNUSED_50 = 121,
209 NE_UNUSED_51 = 122,
210 NE_UNUSED_52 = 122, // XXX Duplicate of above
211 NE_UNUSED_53 = 123,
212 NE_UNUSED_54 = 124,
213 NE_UNUSED_55 = 125,
214 NE_UNUSED_56 = 126,
215 NE_UNUSED_57 = 127,
216 NE_COUNT = 132, // How many we have for arrays etc // XXX Increased arbitrarily for duplicates above
219 #endif