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_DRAW_THREAD_HPP
25 #define XCSOAR_DRAW_THREAD_HPP
27 #include "Thread/RecursivelySuspensibleThread.hpp"
28 #include "Thread/Trigger.hpp"
33 * The DrawThread handles the rendering and drawing on the screen.
34 * The Map and GaugeFLARM both are triggered on GPS updates synchronously,
35 * which is why they are both handled by this thread. The GaugeVario is
36 * triggered on vario data which may be faster than GPS updates, which is
37 * why it is not handled by this thread.
40 class DrawThread
: public RecursivelySuspensibleThread
{
46 * This triggers a redraw.
50 /** Pointer to the MapWindow */
54 DrawThread(GlueMapWindow
&_map
)
57 /** Locks the Mutex and "pauses" the drawing thread */
59 RecursivelySuspensibleThread::BeginSuspend();
69 * To be removed, only used by GlueMapWindow::Idle().
72 return trigger
.Test();
78 void TriggerRedraw() {
83 * Triggers thread shutdown. Call join() after this to wait
84 * synchronously for the thread to exit.
87 RecursivelySuspensibleThread::BeginStop();