OpenCPN Partial API docs
Loading...
Searching...
No Matches
ocpn_app.h
1/***************************************************************************
2 *
3 * Project: OpenCPN
4 * Purpose: OpenCPN Main wxWidgets Program
5 * Author: David Register
6 *
7 ***************************************************************************
8 * Copyright (C) 2022 by David S. Register *
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
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. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24 **************************************************************************/
25
26#ifndef _OCPN_APP_H
27#define _OCPN_APP_H
28
29#include <wx/wxprec.h>
30
31#ifndef WX_PRECOMP
32#include <wx/app.h>
33#include <wx/cmdline.h>
34#include <wx/event.h>
35#endif // precompiled headers
36
37#include <wx/snglinst.h>
38
39#include "comm_bridge.h"
40#include "REST_server.h"
41
42class Track;
43
44class MyApp : public wxApp {
45public:
46 MyApp();
47 ~MyApp(){};
48
49 bool OnInit();
50 int OnExit();
51 void OnInitCmdLine(wxCmdLineParser& parser);
52 bool OnCmdLineParsed(wxCmdLineParser& parser);
53 void OnActivateApp(wxActivateEvent& event);
54
55#ifdef LINUX_CRASHRPT
57 void OnFatalException();
58#endif
59
60#ifdef __WXMSW__
61 // Catch malloc/new fail exceptions
62 // All the rest will be caught be CrashRpt
63 bool OnExceptionInMainLoop();
64#endif
65
66 Track* TrackOff(void);
67
68 wxSingleInstanceChecker* m_checker;
69 CommBridge m_comm_bridge;
70
71 RESTServer m_RESTserver;
72
73 DECLARE_EVENT_TABLE()
74};
75
76#endif
Handle most incoming messages and make them available for other parties.
Definition: comm_bridge.h:69
Definition: ocpn_app.h:44
Definition: track.h:79