OpenCPN Partial API docs
Loading...
Searching...
No Matches
ocpn_plugin.cpp
1/***************************************************************************
2 *
3 * Project: OpenCPN
4 * Purpose: PlugIn Manager Object
5 * Author: David Register
6 *
7 ***************************************************************************
8 * Copyright (C) 2010 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#include "config.h"
27
28#include <algorithm>
29#include <set>
30#include <typeinfo>
31#include <unordered_map>
32
33
34#include <wx/wx.h>
35#include <wx/arrstr.h>
36#include <wx/dc.h>
37#include <wx/dcmemory.h>
38#include <wx/event.h>
39#include <wx/glcanvas.h>
40#include <wx/notebook.h>
41#include <wx/string.h>
42#include <wx/window.h>
43
44#include "ocpn_plugin.h"
45
46extern wxWindow* gFrame;
47
48//-----------------------------------------------------------------------------------------
49// The opencpn_plugin base class implementation
50//-----------------------------------------------------------------------------------------
51
79 static wxBitmap* bitmap = 0;
80 if (!bitmap) bitmap = new wxBitmap(1,1);
81 return bitmap;
82}
83
84opencpn_plugin::~opencpn_plugin() {}
85
86int opencpn_plugin::Init(void) { return 0; }
87
88bool opencpn_plugin::DeInit(void) { return true; }
89
90int opencpn_plugin::GetAPIVersionMajor() { return 1; }
91
92int opencpn_plugin::GetAPIVersionMinor() { return 2; }
93
94int opencpn_plugin::GetPlugInVersionMajor() { return 1; }
95
96int opencpn_plugin::GetPlugInVersionMinor() { return 0; }
97
98wxString opencpn_plugin::GetCommonName() { return "BaseClassCommonName"; }
99
100wxString opencpn_plugin::GetShortDescription() {
101 return "OpenCPN PlugIn Base Class";
102}
103
104wxString opencpn_plugin::GetLongDescription() {
105 return "OpenCPN PlugIn Base Class\n\
106PlugInManager created this base class";
107}
108
109void opencpn_plugin::SetPositionFix(PlugIn_Position_Fix& pfix) {}
110
111void opencpn_plugin::SetNMEASentence(wxString& sentence) {}
112
113void opencpn_plugin::SetAISSentence(wxString& sentence) {}
114
115int opencpn_plugin::GetToolbarToolCount(void) { return 0; }
116
117int opencpn_plugin::GetToolboxPanelCount(void) { return 0; }
118
119void opencpn_plugin::SetupToolboxPanel(int page_sel, wxNotebook* pnotebook) {}
120
121void opencpn_plugin::OnCloseToolboxPanel(int page_sel, int ok_apply_cancel) {}
122
123void opencpn_plugin::ShowPreferencesDialog(wxWindow* parent) {}
124
125void opencpn_plugin::OnToolbarToolCallback(int id) {}
126
127void opencpn_plugin::OnContextMenuItemCallback(int id) {}
128
129bool opencpn_plugin::RenderOverlay(wxMemoryDC* dc, PlugIn_ViewPort* vp) {
130 return false;
131}
132
133void opencpn_plugin::SetCursorLatLon(double lat, double lon) {}
134
135void opencpn_plugin::SetCurrentViewPort(PlugIn_ViewPort& vp) {}
136
137void opencpn_plugin::SetDefaults(void) {}
138
139void opencpn_plugin::ProcessParentResize(int x, int y) {}
140
141void opencpn_plugin::SetColorScheme(PI_ColorScheme cs) {}
142
143void opencpn_plugin::UpdateAuiStatus(void) {}
144
145wxArrayString opencpn_plugin::GetDynamicChartClassNameArray() {
146 wxArrayString array;
147 return array;
148}
149
150// Opencpn_Plugin_16 Implementation
151opencpn_plugin_16::opencpn_plugin_16(void* pmgr) : opencpn_plugin(pmgr) {}
152
153opencpn_plugin_16::~opencpn_plugin_16(void) {}
154
155bool opencpn_plugin_16::RenderOverlay(wxDC& dc, PlugIn_ViewPort* vp) {
156 return false;
157}
158
159void opencpn_plugin_16::SetPluginMessage(wxString& message_id,
160 wxString& message_body) {}
161
162// Opencpn_Plugin_17 Implementation
163opencpn_plugin_17::opencpn_plugin_17(void* pmgr) : opencpn_plugin(pmgr) {}
164
165opencpn_plugin_17::~opencpn_plugin_17(void) {}
166
167bool opencpn_plugin_17::RenderOverlay(wxDC& dc, PlugIn_ViewPort* vp) {
168 return false;
169}
170
171bool opencpn_plugin_17::RenderGLOverlay(wxGLContext* pcontext,
172 PlugIn_ViewPort* vp) {
173 return false;
174}
175
176void opencpn_plugin_17::SetPluginMessage(wxString& message_id,
177 wxString& message_body) {}
178
179// Opencpn_Plugin_18 Implementation
180opencpn_plugin_18::opencpn_plugin_18(void* pmgr) : opencpn_plugin(pmgr) {}
181
182opencpn_plugin_18::~opencpn_plugin_18(void) {}
183
184bool opencpn_plugin_18::RenderOverlay(wxDC& dc, PlugIn_ViewPort* vp) {
185 return false;
186}
187
188bool opencpn_plugin_18::RenderGLOverlay(wxGLContext* pcontext,
189 PlugIn_ViewPort* vp) {
190 return false;
191}
192
193void opencpn_plugin_18::SetPluginMessage(wxString& message_id,
194 wxString& message_body) {}
195
196void opencpn_plugin_18::SetPositionFixEx(PlugIn_Position_Fix_Ex& pfix) {}
197
198// Opencpn_Plugin_19 Implementation
199opencpn_plugin_19::opencpn_plugin_19(void* pmgr) : opencpn_plugin_18(pmgr) {}
200
201opencpn_plugin_19::~opencpn_plugin_19(void) {}
202
203void opencpn_plugin_19::OnSetupOptions(void) {}
204
205// Opencpn_Plugin_110 Implementation
206opencpn_plugin_110::opencpn_plugin_110(void* pmgr) : opencpn_plugin_19(pmgr) {}
207
208opencpn_plugin_110::~opencpn_plugin_110(void) {}
209
210void opencpn_plugin_110::LateInit(void) {}
211
212// Opencpn_Plugin_111 Implementation
213opencpn_plugin_111::opencpn_plugin_111(void* pmgr) : opencpn_plugin_110(pmgr) {}
214
215opencpn_plugin_111::~opencpn_plugin_111(void) {}
216
217// Opencpn_Plugin_112 Implementation
218opencpn_plugin_112::opencpn_plugin_112(void* pmgr) : opencpn_plugin_111(pmgr) {}
219
220opencpn_plugin_112::~opencpn_plugin_112(void) {}
221
222bool opencpn_plugin_112::MouseEventHook(wxMouseEvent& event) { return false; }
223
224void opencpn_plugin_112::SendVectorChartObjectInfo(
225 wxString& chart, wxString& feature, wxString& objname, double lat,
226 double lon, double scale, int nativescale) {}
227
228// Opencpn_Plugin_113 Implementation
229opencpn_plugin_113::opencpn_plugin_113(void* pmgr) : opencpn_plugin_112(pmgr) {}
230
231opencpn_plugin_113::~opencpn_plugin_113(void) {}
232
233bool opencpn_plugin_113::KeyboardEventHook(wxKeyEvent& event) { return false; }
234
235void opencpn_plugin_113::OnToolbarToolDownCallback(int id) {}
236void opencpn_plugin_113::OnToolbarToolUpCallback(int id) {}
237
238// Opencpn_Plugin_114 Implementation
239opencpn_plugin_114::opencpn_plugin_114(void* pmgr) : opencpn_plugin_113(pmgr) {}
240
241opencpn_plugin_114::~opencpn_plugin_114(void) {}
242
243// Opencpn_Plugin_115 Implementation
244opencpn_plugin_115::opencpn_plugin_115(void* pmgr) : opencpn_plugin_114(pmgr) {}
245
246opencpn_plugin_115::~opencpn_plugin_115(void) {}
247
248// Opencpn_Plugin_116 Implementation
249opencpn_plugin_116::opencpn_plugin_116(void* pmgr) : opencpn_plugin_115(pmgr) {}
250
251opencpn_plugin_116::~opencpn_plugin_116(void) {}
252
253bool opencpn_plugin_116::RenderGLOverlayMultiCanvas(wxGLContext* pcontext,
254 PlugIn_ViewPort* vp,
255 int max_canvas) {
256 return false;
257}
258
259bool opencpn_plugin_116::RenderOverlayMultiCanvas(wxDC& dc, PlugIn_ViewPort* vp,
260 int max_canvas) {
261 return false;
262}
263
264void opencpn_plugin_116::PrepareContextMenu(int canvasIndex) { return; }
265
266// Opencpn_Plugin_117 Implementation
267opencpn_plugin_117::opencpn_plugin_117(void* pmgr) : opencpn_plugin_116(pmgr) {}
268
269int opencpn_plugin_117::GetPlugInVersionPatch() { return 0; };
270
272
273const char* opencpn_plugin_117::GetPlugInVersionPre() { return ""; };
274
275const char* opencpn_plugin_117::GetPlugInVersionBuild() { return ""; };
276
277void opencpn_plugin_117::SetActiveLegInfo(Plugin_Active_Leg_Info& leg_info) {}
278
279// Opencpn_Plugin_118 Implementation
280opencpn_plugin_118::opencpn_plugin_118(void* pmgr) : opencpn_plugin_117(pmgr) {}
281
283 PlugIn_ViewPort* vp,
284 int max_canvas,
285 int priority) {
286 return false;
287}
288
290 int max_canvas,
291 int priority) {
292 return false;
293}
virtual const char * GetPlugInVersionPre()
Pre-release tag version part, see GetPlugInVersionPatch()
virtual const char * GetPlugInVersionBuild()
Build version part see GetPlugInVersionPatch().
virtual int GetPlugInVersionPost()
Post-release version part, extends the semver spec.
virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp, int canvasIndex, int priority=-1)
Render plugin overlay over chart canvas in non-OpenGL mode.
virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext, PlugIn_ViewPort *vp, int canvasIndex, int priority=-1)
Render plugin overlay over chart canvas in OpenGL mode.
virtual wxBitmap * GetPlugInBitmap()
FIXME static wxBitmap* LoadSVG(const wxString filename, unsigned int width, ...
Definition: ocpn_plugin.cpp:78
Definition: Quilt.cpp:864