OpenCPN Partial API docs
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 
46 extern 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 
84 opencpn_plugin::~opencpn_plugin() {}
85 
86 int opencpn_plugin::Init(void) { return 0; }
87 
88 bool opencpn_plugin::DeInit(void) { return true; }
89 
90 int opencpn_plugin::GetAPIVersionMajor() { return 1; }
91 
92 int opencpn_plugin::GetAPIVersionMinor() { return 2; }
93 
94 int opencpn_plugin::GetPlugInVersionMajor() { return 1; }
95 
96 int opencpn_plugin::GetPlugInVersionMinor() { return 0; }
97 
98 wxString opencpn_plugin::GetCommonName() { return "BaseClassCommonName"; }
99 
100 wxString opencpn_plugin::GetShortDescription() {
101  return "OpenCPN PlugIn Base Class";
102 }
103 
104 wxString opencpn_plugin::GetLongDescription() {
105  return "OpenCPN PlugIn Base Class\n\
106 PlugInManager created this base class";
107 }
108 
109 void opencpn_plugin::SetPositionFix(PlugIn_Position_Fix& pfix) {}
110 
111 void opencpn_plugin::SetNMEASentence(wxString& sentence) {}
112 
113 void opencpn_plugin::SetAISSentence(wxString& sentence) {}
114 
115 int opencpn_plugin::GetToolbarToolCount(void) { return 0; }
116 
117 int opencpn_plugin::GetToolboxPanelCount(void) { return 0; }
118 
119 void opencpn_plugin::SetupToolboxPanel(int page_sel, wxNotebook* pnotebook) {}
120 
121 void opencpn_plugin::OnCloseToolboxPanel(int page_sel, int ok_apply_cancel) {}
122 
123 void opencpn_plugin::ShowPreferencesDialog(wxWindow* parent) {}
124 
125 void opencpn_plugin::OnToolbarToolCallback(int id) {}
126 
127 void opencpn_plugin::OnContextMenuItemCallback(int id) {}
128 
129 bool opencpn_plugin::RenderOverlay(wxMemoryDC* dc, PlugIn_ViewPort* vp) {
130  return false;
131 }
132 
133 void opencpn_plugin::SetCursorLatLon(double lat, double lon) {}
134 
135 void opencpn_plugin::SetCurrentViewPort(PlugIn_ViewPort& vp) {}
136 
137 void opencpn_plugin::SetDefaults(void) {}
138 
139 void opencpn_plugin::ProcessParentResize(int x, int y) {}
140 
141 void opencpn_plugin::SetColorScheme(PI_ColorScheme cs) {}
142 
143 void opencpn_plugin::UpdateAuiStatus(void) {}
144 
145 wxArrayString opencpn_plugin::GetDynamicChartClassNameArray() {
146  wxArrayString array;
147  return array;
148 }
149 
150 // Opencpn_Plugin_16 Implementation
151 opencpn_plugin_16::opencpn_plugin_16(void* pmgr) : opencpn_plugin(pmgr) {}
152 
153 opencpn_plugin_16::~opencpn_plugin_16(void) {}
154 
155 bool opencpn_plugin_16::RenderOverlay(wxDC& dc, PlugIn_ViewPort* vp) {
156  return false;
157 }
158 
159 void opencpn_plugin_16::SetPluginMessage(wxString& message_id,
160  wxString& message_body) {}
161 
162 // Opencpn_Plugin_17 Implementation
163 opencpn_plugin_17::opencpn_plugin_17(void* pmgr) : opencpn_plugin(pmgr) {}
164 
165 opencpn_plugin_17::~opencpn_plugin_17(void) {}
166 
167 bool opencpn_plugin_17::RenderOverlay(wxDC& dc, PlugIn_ViewPort* vp) {
168  return false;
169 }
170 
171 bool opencpn_plugin_17::RenderGLOverlay(wxGLContext* pcontext,
172  PlugIn_ViewPort* vp) {
173  return false;
174 }
175 
176 void opencpn_plugin_17::SetPluginMessage(wxString& message_id,
177  wxString& message_body) {}
178 
179 // Opencpn_Plugin_18 Implementation
180 opencpn_plugin_18::opencpn_plugin_18(void* pmgr) : opencpn_plugin(pmgr) {}
181 
182 opencpn_plugin_18::~opencpn_plugin_18(void) {}
183 
184 bool opencpn_plugin_18::RenderOverlay(wxDC& dc, PlugIn_ViewPort* vp) {
185  return false;
186 }
187 
188 bool opencpn_plugin_18::RenderGLOverlay(wxGLContext* pcontext,
189  PlugIn_ViewPort* vp) {
190  return false;
191 }
192 
193 void opencpn_plugin_18::SetPluginMessage(wxString& message_id,
194  wxString& message_body) {}
195 
196 void opencpn_plugin_18::SetPositionFixEx(PlugIn_Position_Fix_Ex& pfix) {}
197 
198 // Opencpn_Plugin_19 Implementation
199 opencpn_plugin_19::opencpn_plugin_19(void* pmgr) : opencpn_plugin_18(pmgr) {}
200 
201 opencpn_plugin_19::~opencpn_plugin_19(void) {}
202 
203 void opencpn_plugin_19::OnSetupOptions(void) {}
204 
205 // Opencpn_Plugin_110 Implementation
206 opencpn_plugin_110::opencpn_plugin_110(void* pmgr) : opencpn_plugin_19(pmgr) {}
207 
208 opencpn_plugin_110::~opencpn_plugin_110(void) {}
209 
210 void opencpn_plugin_110::LateInit(void) {}
211 
212 // Opencpn_Plugin_111 Implementation
213 opencpn_plugin_111::opencpn_plugin_111(void* pmgr) : opencpn_plugin_110(pmgr) {}
214 
215 opencpn_plugin_111::~opencpn_plugin_111(void) {}
216 
217 // Opencpn_Plugin_112 Implementation
218 opencpn_plugin_112::opencpn_plugin_112(void* pmgr) : opencpn_plugin_111(pmgr) {}
219 
220 opencpn_plugin_112::~opencpn_plugin_112(void) {}
221 
222 bool opencpn_plugin_112::MouseEventHook(wxMouseEvent& event) { return false; }
223 
224 void 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
229 opencpn_plugin_113::opencpn_plugin_113(void* pmgr) : opencpn_plugin_112(pmgr) {}
230 
231 opencpn_plugin_113::~opencpn_plugin_113(void) {}
232 
233 bool opencpn_plugin_113::KeyboardEventHook(wxKeyEvent& event) { return false; }
234 
235 void opencpn_plugin_113::OnToolbarToolDownCallback(int id) {}
236 void opencpn_plugin_113::OnToolbarToolUpCallback(int id) {}
237 
238 // Opencpn_Plugin_114 Implementation
239 opencpn_plugin_114::opencpn_plugin_114(void* pmgr) : opencpn_plugin_113(pmgr) {}
240 
241 opencpn_plugin_114::~opencpn_plugin_114(void) {}
242 
243 // Opencpn_Plugin_115 Implementation
244 opencpn_plugin_115::opencpn_plugin_115(void* pmgr) : opencpn_plugin_114(pmgr) {}
245 
246 opencpn_plugin_115::~opencpn_plugin_115(void) {}
247 
248 // Opencpn_Plugin_116 Implementation
249 opencpn_plugin_116::opencpn_plugin_116(void* pmgr) : opencpn_plugin_115(pmgr) {}
250 
251 opencpn_plugin_116::~opencpn_plugin_116(void) {}
252 
253 bool opencpn_plugin_116::RenderGLOverlayMultiCanvas(wxGLContext* pcontext,
254  PlugIn_ViewPort* vp,
255  int max_canvas) {
256  return false;
257 }
258 
259 bool opencpn_plugin_116::RenderOverlayMultiCanvas(wxDC& dc, PlugIn_ViewPort* vp,
260  int max_canvas) {
261  return false;
262 }
263 
264 void opencpn_plugin_116::PrepareContextMenu(int canvasIndex) { return; }
265 
266 // Opencpn_Plugin_117 Implementation
267 opencpn_plugin_117::opencpn_plugin_117(void* pmgr) : opencpn_plugin_116(pmgr) {}
268 
269 int opencpn_plugin_117::GetPlugInVersionPatch() { return 0; };
270 
272 
273 const char* opencpn_plugin_117::GetPlugInVersionPre() { return ""; };
274 
275 const char* opencpn_plugin_117::GetPlugInVersionBuild() { return ""; };
276 
277 void opencpn_plugin_117::SetActiveLegInfo(Plugin_Active_Leg_Info& leg_info) {}
278 
279 // Opencpn_Plugin_118 Implementation
280 opencpn_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 RenderGLOverlayMultiCanvas(wxGLContext *pcontext, PlugIn_ViewPort *vp, int canvasIndex, int priority)
Render plugin overlay over chart canvas in OpenGL mode.
virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp, int canvas_ix, int priority)
Render plugin overlay over chart canvas in non-OpenGL mode.
virtual wxBitmap * GetPlugInBitmap()
FIXME static wxBitmap* LoadSVG(const wxString filename, unsigned int width, unsigned int height) { if...
Definition: ocpn_plugin.cpp:78
Definition: Quilt.cpp:867