OpenCPN Partial API docs
Loading...
Searching...
No Matches
ocpn_plugin.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2010 - 2024 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 **************************************************************************/
19
25#ifndef _PLUGIN_H_
26#define _PLUGIN_H_
27
28#ifndef DECL_EXP
29#if defined(__WXMSW__) || defined(__CYGWIN__)
30#define DECL_EXP __declspec(dllexport)
31#elif defined __GNUC__ && __GNUC__ >= 4
32#define DECL_EXP __attribute__((visibility("default")))
33#elif defined __WXOSX__
34#define DECL_EXP __attribute__((visibility("default")))
35#else
36#define DECL_EXP
37#endif
38#endif
39
40#if defined(__WXMSW__) && defined(MAKING_PLUGIN)
41#define DECL_IMP __declspec(dllimport)
42#else
43#define DECL_IMP
44#endif
45
46#include <wx/xml/xml.h>
47#include <wx/dcmemory.h>
48#include <wx/dialog.h>
49#include <wx/event.h>
50#include <wx/menuitem.h>
51#include <wx/gdicmn.h>
52
53#ifdef ocpnUSE_SVG
54#include <wx/bitmap.h>
55#endif // ocpnUSE_SVG
56
57#include <cstdint>
58#include <memory>
59#include <vector>
60#include <unordered_map>
61
62class wxGLContext;
63
64// This is the most modern API Version number
65// It is expected that the API will remain downward compatible, meaning that
66// PlugIns conforming to API Version less than the most modern will also
67// be correctly supported.
68#define API_VERSION_MAJOR 1
69#define API_VERSION_MINOR 20
70
71// Fwd Definitions
72class wxFileConfig;
73class wxNotebook;
74class wxFont;
75class wxAuiManager;
76class wxScrolledWindow;
77class wxGLCanvas;
78
79//---------------------------------------------------------------------------------------------------------
80//
81// Bitfield PlugIn Capabilities flag definition
82//
83//---------------------------------------------------------------------------------------------------------
87#define WANTS_OVERLAY_CALLBACK 0x00000001
91#define WANTS_CURSOR_LATLON 0x00000002
101#define WANTS_TOOLBAR_CALLBACK 0x00000004
107#define INSTALLS_TOOLBAR_TOOL 0x00000008
110#define WANTS_CONFIG 0x00000010
113#define INSTALLS_TOOLBOX_PAGE 0x00000020
116#define INSTALLS_CONTEXTMENU_ITEMS 0x00000040
119#define WANTS_NMEA_SENTENCES 0x00000080
123#define WANTS_NMEA_EVENTS 0x00000100
126#define WANTS_AIS_SENTENCES 0x00000200
129#define USES_AUI_MANAGER 0x00000400
132#define WANTS_PREFERENCES 0x00000800
135#define INSTALLS_PLUGIN_CHART 0x00001000
138#define WANTS_ONPAINT_VIEWPORT 0x00002000
141#define WANTS_PLUGIN_MESSAGING 0x00004000
142#define WANTS_OPENGL_OVERLAY_CALLBACK 0x00008000
143#define WANTS_DYNAMIC_OPENGL_OVERLAY_CALLBACK 0x00010000
146#define WANTS_LATE_INIT 0x00020000
149#define INSTALLS_PLUGIN_CHART_GL 0x00040000
152#define WANTS_MOUSE_EVENTS 0x00080000
155#define WANTS_VECTOR_CHART_OBJECT_INFO 0x00100000
158#define WANTS_KEYBOARD_EVENTS 0x00200000
161#define WANTS_PRESHUTDOWN_HOOK 0x00400000
162
163//---------------------------------------------------------------------------------------------------------
164//
165// Overlay priorities
166//
167//---------------------------------------------------------------------------------------------------------
168#define OVERLAY_LEGACY 0
169#define OVERLAY_OVER_SHIPS 64
170#define OVERLAY_OVER_EMBOSS 96
171#define OVERLAY_OVER_UI 128
172
173//----------------------------------------------------------------------------------------------------------
174// Some PlugIn API interface object class definitions
175//----------------------------------------------------------------------------------------------------------
190
195public:
196 double clat;
197 double clon;
199 double skew;
200 double rotation;
201
203
206 wxRect rv_rect;
207 bool b_quilt;
210
211 double lat_min;
212 double lat_max;
213 double lon_min;
214 double lon_max;
215
216 bool
218};
219
224public:
225 double Lat;
226 double Lon;
227 double Cog;
228 double Sog;
229 double Var;
230 time_t FixTime;
231 int nSats;
232};
244public:
251 double Lat;
252
259 double Lon;
260
262 double Cog;
263
268 double Sog;
269
271 double Var;
272
277 double Hdm;
278
284 double Hdt;
285
291 time_t FixTime;
292
299 int nSats;
300};
301
306public:
307 double Xte;
309 double Btw;
310 double Dtw;
311 wxString wp_name;
312 bool arrival;
314};
315
324
329public:
330 int MMSI;
331 int Class;
333 double SOG;
334 double COG;
335 double HDG;
336 double Lon;
337 double Lat;
338 int ROTAIS;
339 char CallSign[8];
340 char ShipName[21];
341 unsigned char ShipType;
342 int IMO;
343
344 double Range_NM;
345 double Brg;
346
347 // Per target collision parameters
349 double TCPA;
350 double CPA;
351
353};
354
369
379
389
412
416typedef struct _ExtentPI {
417 double SLAT;
418 double WLON;
419 double NLAT;
420 double ELON;
422
423// PlugInChartBase::Init() init_flags constants
426#define PI_FULL_INIT 0
429#define PI_HEADER_ONLY 1
431#define PI_THUMB_ONLY 2
432
446class DECL_EXP PlugInChartBase : public wxObject {
447public:
448 // These methods Must be overriden in any derived class
450 virtual ~PlugInChartBase();
451
472 virtual wxString GetFileSearchMask(void);
473
498 virtual int Init(const wxString &full_path, int init_flags);
499
519 virtual void SetColorScheme(int cs, bool bApplyImmediate);
520
541 virtual double GetNormalScaleMin(double canvas_scale_factor,
542 bool b_allow_overzoom);
560 virtual double GetNormalScaleMax(double canvas_scale_factor,
561 int canvas_width);
576 virtual double GetNearestPreferredScalePPM(double target_scale_ppm);
577
595 virtual bool GetChartExtent(ExtentPI *pext);
596
623 virtual wxBitmap &RenderRegionView(const PlugIn_ViewPort &VPoint,
624 const wxRegion &Region);
625
640 virtual bool AdjustVP(PlugIn_ViewPort &vp_last, PlugIn_ViewPort &vp_proposed);
641
657 virtual void GetValidCanvasRegion(const PlugIn_ViewPort &VPoint,
658 wxRegion *pValidRegion);
659
677 virtual int GetCOVREntries() { return 0; }
678
694 virtual int GetCOVRTablePoints(int iTable) { return 0; }
695
709 virtual int GetCOVRTablenPoints(int iTable) { return 0; }
710
731 virtual float *GetCOVRTableHead(int iTable) { return (float *)NULL; }
732
755 virtual wxBitmap *GetThumbnail(int tnx, int tny, int cs);
756
757 // Accessors, need not be overridden in derived class if the member
758 // variables are maintained
759
773 virtual wxString GetFullPath() const { return m_FullPath; }
774
796 virtual ChartTypeEnumPI GetChartType() { return m_ChartType; }
797
811 virtual ChartFamilyEnumPI GetChartFamily() { return m_ChartFamily; }
812
832 virtual OcpnProjTypePI GetChartProjection() { return m_projection; }
833
846 virtual wxString GetName() { return m_Name; }
847
858 virtual wxString GetDescription() { return m_Description; }
859
871 virtual wxString GetID() { return m_ID; }
872
886 virtual wxString GetSE() { return m_SE; }
887
903 virtual wxString GetDepthUnits() { return m_DepthUnits; }
904
921 virtual wxString GetSoundingsDatum() { return m_SoundingsDatum; }
922
938 virtual wxString GetDatumString() { return m_datum_str; }
939
953 virtual wxString GetExtraInfo() { return m_ExtraInfo; }
954
967 virtual wxString GetPubDate() { return m_PubYear; }
968
982 virtual double GetChartErrorFactor() { return m_Chart_Error_Factor; }
983
999 virtual ChartDepthUnitTypePI GetDepthUnitId() { return m_depth_unit_id; }
1000
1015 virtual bool IsReadyToRender() { return m_bReadyToRender; }
1016
1029 virtual int GetNativeScale() { return m_Chart_Scale; };
1030
1043 virtual double GetChartSkew() { return m_Chart_Skew; }
1044
1057 virtual wxDateTime GetEditionDate(void) { return m_EdDate; }
1058
1059 // Methods pertaining to CHART_FAMILY_RASTER type PlugIn charts only
1060
1079 virtual void ComputeSourceRectangle(const PlugIn_ViewPort &vp,
1080 wxRect *pSourceRect);
1081
1096 virtual double GetRasterScaleFactor();
1097
1118 virtual bool GetChartBits(wxRect &source, unsigned char *pPix, int sub_samp);
1119
1131 virtual int GetSize_X();
1132
1144 virtual int GetSize_Y();
1145
1160 virtual void latlong_to_chartpix(double lat, double lon, double &pixx,
1161 double &pixy);
1162
1177 virtual void chartpix_to_latlong(double pixx, double pixy, double *plat,
1178 double *plon);
1179
1180protected:
1181 ChartTypeEnumPI m_ChartType;
1182 ChartFamilyEnumPI m_ChartFamily;
1183
1184 wxString m_FullPath;
1185 OcpnProjTypePI m_projection;
1186 int m_Chart_Scale;
1187 double m_Chart_Skew;
1188
1189 wxDateTime m_EdDate;
1190 bool m_bReadyToRender;
1191
1192 wxString m_Name;
1193 wxString m_Description;
1194 wxString m_ID;
1195 wxString m_SE;
1196 wxString m_SoundingsDatum;
1197 wxString m_datum_str;
1198 wxString m_PubYear;
1199 wxString m_DepthUnits;
1200 wxString m_ExtraInfo;
1201
1202 ChartDepthUnitTypePI m_depth_unit_id;
1203
1204 double m_Chart_Error_Factor;
1205};
1206
1207// Declare an array of PlugIn_AIS_Targets
1208WX_DEFINE_ARRAY_PTR(PlugIn_AIS_Target *, ArrayOfPlugIn_AIS_Targets);
1209
1224class DECL_EXP opencpn_plugin {
1225public:
1226 opencpn_plugin(void *pmgr) {}
1227 virtual ~opencpn_plugin();
1228
1229 // Public API to the PlugIn class
1230
1231 // This group of methods is required, and will be called by the opencpn
1232 // host opencpn PlugIns must implement this group
1233
1248 virtual int Init(void);
1249
1259 virtual bool DeInit(void);
1260
1273 virtual int GetAPIVersionMajor();
1274
1287 virtual int GetAPIVersionMinor();
1288
1300 virtual int GetPlugInVersionMajor();
1301
1313 virtual int GetPlugInVersionMinor();
1314
1327 virtual wxBitmap *GetPlugInBitmap();
1328
1329 // These three methods should produce valid, meaningful strings always
1330 // ---EVEN IF--- the PlugIn has not (yet) been initialized.
1331 // They are used by the PlugInManager GUI
1332
1344 virtual wxString GetCommonName();
1345
1357 virtual wxString GetShortDescription();
1358
1372 virtual wxString GetLongDescription();
1373
1374 // This group is optional.
1375 // PlugIns may override any of these methods as required
1376
1388 virtual void SetDefaults(void);
1389
1403 virtual int GetToolbarToolCount(void);
1404
1417 virtual int GetToolboxPanelCount(void);
1418
1433 virtual void SetupToolboxPanel(int page_sel, wxNotebook *pnotebook);
1434
1450 virtual void OnCloseToolboxPanel(int page_sel, int ok_apply_cancel);
1451
1465 virtual void ShowPreferencesDialog(wxWindow *parent);
1466
1492 virtual bool RenderOverlay(wxMemoryDC *pmdc, PlugIn_ViewPort *vp);
1493
1507 virtual void SetCursorLatLon(double lat, double lon);
1526 virtual void SetCurrentViewPort(PlugIn_ViewPort &vp);
1527
1547 virtual void SetPositionFix(PlugIn_Position_Fix &pfix);
1562 virtual void SetNMEASentence(wxString &sentence);
1579 virtual void SetAISSentence(wxString &sentence);
1580
1590 virtual void ProcessParentResize(int x, int y);
1591
1603 virtual void SetColorScheme(PI_ColorScheme cs);
1604
1613 virtual void OnToolbarToolCallback(int id);
1614
1623 virtual void OnContextMenuItemCallback(int id);
1624
1632 virtual void UpdateAuiStatus(void);
1633
1645 virtual wxArrayString GetDynamicChartClassNameArray(void);
1646};
1647
1648// the types of the class factories used to create PlugIn instances
1649typedef opencpn_plugin *create_t(void *);
1650typedef void destroy_t(opencpn_plugin *);
1651
1652#ifdef __clang__
1653#pragma clang diagnostic push
1654#pragma clang diagnostic ignored "-Woverloaded-virtual"
1655#endif
1656
1657class DECL_EXP opencpn_plugin_16 : public opencpn_plugin {
1658public:
1659 opencpn_plugin_16(void *pmgr);
1660 virtual ~opencpn_plugin_16();
1661
1663
1681 virtual bool RenderOverlay(wxDC &dc, PlugIn_ViewPort *vp);
1682
1697 virtual void SetPluginMessage(wxString &message_id, wxString &message_body);
1698};
1699
1700class DECL_EXP opencpn_plugin_17 : public opencpn_plugin {
1701public:
1702 opencpn_plugin_17(void *pmgr);
1703 virtual ~opencpn_plugin_17();
1704
1706
1707 virtual bool RenderOverlay(wxDC &dc, PlugIn_ViewPort *vp);
1708 virtual bool RenderGLOverlay(wxGLContext *pcontext, PlugIn_ViewPort *vp);
1709
1710 virtual void SetPluginMessage(wxString &message_id, wxString &message_body);
1711};
1712
1713class DECL_EXP opencpn_plugin_18 : public opencpn_plugin {
1714public:
1715 opencpn_plugin_18(void *pmgr);
1716 virtual ~opencpn_plugin_18();
1717
1719
1720 virtual bool RenderOverlay(wxDC &dc, PlugIn_ViewPort *vp);
1742 virtual bool RenderGLOverlay(wxGLContext *pcontext, PlugIn_ViewPort *vp);
1743 virtual void SetPluginMessage(wxString &message_id, wxString &message_body);
1744
1759 virtual void SetPositionFixEx(PlugIn_Position_Fix_Ex &pfix);
1760};
1761
1762#ifdef __clang__
1763#pragma clang diagnostic pop
1764#endif
1765
1766class DECL_EXP opencpn_plugin_19 : public opencpn_plugin_18 {
1767public:
1768 opencpn_plugin_19(void *pmgr);
1769 virtual ~opencpn_plugin_19();
1770
1778 virtual void OnSetupOptions(void);
1779};
1780
1781class DECL_EXP opencpn_plugin_110 : public opencpn_plugin_19 {
1782public:
1783 opencpn_plugin_110(void *pmgr);
1784 virtual ~opencpn_plugin_110();
1785
1786 virtual void LateInit(void); // If WANTS_LATE_INIT is returned by Init()
1787};
1788
1790public:
1791 opencpn_plugin_111(void *pmgr);
1792 virtual ~opencpn_plugin_111();
1793};
1794
1796public:
1797 opencpn_plugin_112(void *pmgr);
1798 virtual ~opencpn_plugin_112();
1799
1809 virtual bool MouseEventHook(wxMouseEvent &event);
1810
1825 virtual void SendVectorChartObjectInfo(wxString &chart, wxString &feature,
1826 wxString &objname, double lat,
1827 double lon, double scale,
1828 int nativescale);
1829};
1830
1832public:
1833 opencpn_plugin_113(void *pmgr);
1834 virtual ~opencpn_plugin_113();
1835
1845 virtual bool KeyboardEventHook(wxKeyEvent &event);
1846
1854 virtual void OnToolbarToolDownCallback(int id);
1855
1863 virtual void OnToolbarToolUpCallback(int id);
1864};
1865
1867public:
1868 opencpn_plugin_114(void *pmgr);
1869 virtual ~opencpn_plugin_114();
1870};
1871
1873public:
1874 opencpn_plugin_115(void *pmgr);
1875 virtual ~opencpn_plugin_115();
1876};
1877
1879public:
1880 opencpn_plugin_116(void *pmgr);
1881 virtual ~opencpn_plugin_116();
1894 virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext,
1895 PlugIn_ViewPort *vp, int canvasIndex);
1896
1909 virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp,
1910 int canvasIndex);
1919 virtual void PrepareContextMenu(int canvasIndex);
1920};
1921
1923public:
1924 opencpn_plugin_117(void *pmgr);
1931 virtual int GetPlugInVersionPatch();
1932
1934 virtual int GetPlugInVersionPost();
1935
1937 virtual const char *GetPlugInVersionPre();
1938
1940 virtual const char *GetPlugInVersionBuild();
1941
1942 /*Provide active leg data to plugins*/
1943 virtual void SetActiveLegInfo(Plugin_Active_Leg_Info &leg_info);
1944};
1945
1947public:
1948 opencpn_plugin_118(void *pmgr);
1949
1952
1961#ifdef _MSC_VER
1962 virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext,
1963 PlugIn_ViewPort *vp, int canvasIndex,
1964 int priority = -1);
1965#else
1966 virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext,
1967 PlugIn_ViewPort *vp, int canvasIndex,
1968 int priority);
1969
1970 bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext, PlugIn_ViewPort *vp,
1971 int canvas_ix) override {
1972 return RenderGLOverlayMultiCanvas(pcontext, vp, canvas_ix, -1);
1973 }
1974#endif
1975
1984#ifdef _MSC_VER
1985 virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp,
1986 int canvasIndex, int priority = -1);
1987#else
1988 virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp,
1989 int canvas_ix, int priority);
1991 int canvas_ix) override {
1992 return RenderOverlayMultiCanvas(dc, vp, canvas_ix, -1);
1993 }
1994#endif
1995};
1996
1998public:
1999 opencpn_plugin_119(void *pmgr);
2000
2018 virtual void PreShutdownHook();
2019};
2020
2022public:
2023 opencpn_plugin_120(void *pmgr);
2024
2025 virtual void OnContextMenuItemCallbackExt(int id, std::string obj_ident,
2026 std::string obj_type, double lat,
2027 double lon);
2028};
2029
2030//------------------------------------------------------------------
2031// Route and Waypoint PlugIn support
2032//
2033//------------------------------------------------------------------
2034
2046class DECL_EXP Plugin_Hyperlink {
2047public:
2048 wxString DescrText;
2049 wxString Link;
2050 wxString Type;
2051};
2052
2053WX_DECLARE_LIST(Plugin_Hyperlink, Plugin_HyperlinkList);
2054
2069class DECL_EXP PlugIn_Waypoint {
2070public:
2075
2085 PlugIn_Waypoint(double lat, double lon, const wxString &icon_ident,
2086 const wxString &wp_name, const wxString &GUID = _T(""));
2088
2089 double m_lat;
2090 double m_lon;
2091 wxString m_GUID;
2092 wxString m_MarkName;
2094 wxDateTime m_CreateTime;
2096 wxString m_IconName;
2097
2098 Plugin_HyperlinkList *m_HyperlinkList;
2099};
2100
2101WX_DECLARE_LIST(PlugIn_Waypoint, Plugin_WaypointList);
2102
2109class DECL_EXP PlugIn_Route {
2110public:
2111 PlugIn_Route(void);
2112 ~PlugIn_Route(void);
2113
2114 wxString m_NameString;
2115 wxString m_StartString;
2116 wxString m_EndString;
2117 wxString m_GUID;
2118
2123 Plugin_WaypointList *pWaypointList;
2124};
2125
2139class DECL_EXP PlugIn_Track {
2140public:
2141 PlugIn_Track(void);
2142 ~PlugIn_Track(void);
2143
2144 wxString m_NameString;
2145 wxString m_StartString;
2146 wxString m_EndString;
2147 wxString m_GUID;
2148
2155 Plugin_WaypointList *pWaypointList;
2156};
2157
2158//----------------------------------------------------------------------------------------------------------
2159// The PlugIn CallBack API Definition
2160//
2161// The API back up to the PlugIn Manager
2162// PlugIns may call these static functions as necessary for system services
2163//
2164//----------------------------------------------------------------------------------------------------------
2165
2186extern "C" DECL_EXP int InsertPlugInTool(wxString label, wxBitmap *bitmap,
2187 wxBitmap *bmpRollover, wxItemKind kind,
2188 wxString shortHelp, wxString longHelp,
2189 wxObject *clientData, int position,
2190 int tool_sel, opencpn_plugin *pplugin);
2198extern "C" DECL_EXP void RemovePlugInTool(int tool_id);
2199
2208extern "C" DECL_EXP void SetToolbarToolViz(int item, bool viz);
2209
2218extern "C" DECL_EXP void SetToolbarItemState(int item, bool toggle);
2219
2229extern "C" DECL_EXP void SetToolbarToolBitmaps(int item, wxBitmap *bitmap,
2230 wxBitmap *bmpRollover);
2249extern "C" DECL_EXP int InsertPlugInToolSVG(
2250 wxString label, wxString SVGfile, wxString SVGfileRollover,
2251 wxString SVGfileToggled, wxItemKind kind, wxString shortHelp,
2252 wxString longHelp, wxObject *clientData, int position, int tool_sel,
2253 opencpn_plugin *pplugin);
2254
2265extern "C" DECL_EXP void SetToolbarToolBitmapsSVG(int item, wxString SVGfile,
2266 wxString SVGfileRollover,
2267 wxString SVGfileToggled);
2277extern "C" DECL_EXP int AddCanvasContextMenuItem(wxMenuItem *pitem,
2278 opencpn_plugin *pplugin);
2286extern "C" DECL_EXP void RemoveCanvasContextMenuItem(int item);
2287
2296extern "C" DECL_EXP void SetCanvasContextMenuItemViz(int item, bool viz);
2297
2306extern "C" DECL_EXP void SetCanvasContextMenuItemGrey(int item, bool grey);
2307
2317extern "C" DECL_EXP wxFileConfig *GetOCPNConfigObject(void);
2318
2326extern "C" DECL_EXP void RequestRefresh(wxWindow *);
2327
2337extern "C" DECL_EXP bool GetGlobalColor(wxString colorName, wxColour *pcolour);
2338
2350extern "C" DECL_EXP void GetCanvasPixLL(PlugIn_ViewPort *vp, wxPoint *pp,
2351 double lat, double lon);
2363extern "C" DECL_EXP void GetCanvasLLPix(PlugIn_ViewPort *vp, wxPoint p,
2364 double *plat, double *plon);
2372extern "C" DECL_EXP wxWindow *GetOCPNCanvasWindow();
2373
2412extern "C" DECL_EXP wxFont *OCPNGetFont(wxString TextElement,
2413 int default_size = 0);
2414
2427extern "C" DECL_EXP wxString *GetpSharedDataLocation();
2428
2437extern "C" DECL_EXP ArrayOfPlugIn_AIS_Targets *GetAISTargetArray(void);
2438
2448extern "C" DECL_EXP wxAuiManager *GetFrameAuiManager(void);
2449
2458extern "C" DECL_EXP bool AddLocaleCatalog(wxString catalog);
2459
2467extern "C" DECL_EXP void PushNMEABuffer(wxString str);
2468
2478extern DECL_EXP wxXmlDocument GetChartDatabaseEntryXML(int dbIndex,
2479 bool b_getGeom);
2490extern DECL_EXP bool UpdateChartDBInplace(wxArrayString dir_array,
2491 bool b_force_update,
2492 bool b_ProgressDialog);
2500extern DECL_EXP wxArrayString GetChartDBDirArrayString();
2501
2510extern "C" DECL_EXP void SendPluginMessage(wxString message_id,
2511 wxString message_body);
2519extern "C" DECL_EXP void DimeWindow(wxWindow *);
2520
2528extern "C" DECL_EXP void JumpToPosition(double lat, double lon, double scale);
2529
2530/* API 1.9 adds some common cartographic functions to avoid unnecessary code
2531 * duplication */
2532/* Study the original OpenCPN source (georef.c) for functional definitions */
2533
2545extern "C" DECL_EXP void PositionBearingDistanceMercator_Plugin(
2546 double lat, double lon, double brg, double dist, double *dlat,
2547 double *dlon);
2560extern "C" DECL_EXP void DistanceBearingMercator_Plugin(
2561 double lat0, double lon0, double lat1, double lon1, double *brg,
2562 double *dist);
2563
2573extern "C" DECL_EXP double DistGreatCircle_Plugin(double slat, double slon,
2574 double dlat, double dlon);
2585extern "C" DECL_EXP void toTM_Plugin(float lat, float lon, float lat0,
2586 float lon0, double *x, double *y);
2587
2598extern "C" DECL_EXP void fromTM_Plugin(double x, double y, double lat0,
2599 double lon0, double *lat, double *lon);
2600
2611extern "C" DECL_EXP void toSM_Plugin(double lat, double lon, double lat0,
2612 double lon0, double *x, double *y);
2613
2624extern "C" DECL_EXP void fromSM_Plugin(double x, double y, double lat0,
2625 double lon0, double *lat, double *lon);
2626
2637extern "C" DECL_EXP void toSM_ECC_Plugin(double lat, double lon, double lat0,
2638 double lon0, double *x, double *y);
2639
2650extern "C" DECL_EXP void fromSM_ECC_Plugin(double x, double y, double lat0,
2651 double lon0, double *lat,
2652 double *lon);
2653
2664extern "C" DECL_EXP bool DecodeSingleVDOMessage(const wxString &str,
2666 wxString *acc);
2667
2674extern "C" DECL_EXP int GetChartbarHeight(void);
2705extern "C" DECL_EXP bool GetActiveRoutepointGPX(char *buffer,
2706 unsigned int buffer_length);
2707
2708/* API 1.9 */
2709
2738
2753extern DECL_EXP wxScrolledWindow *AddOptionsPage(OptionsParentPI parent,
2754 wxString title);
2755
2763extern DECL_EXP bool DeleteOptionsPage(wxScrolledWindow *page);
2764
2765/* API 1.10 */
2766
2767/* API 1.10 adds some common functions to avoid unnecessary code duplication */
2768/* Study the original OpenCPN source for functional definitions */
2779extern "C" DECL_EXP double toUsrDistance_Plugin(double nm_distance,
2780 int unit = -1);
2781
2790extern "C" DECL_EXP double fromUsrDistance_Plugin(double usr_distance,
2791 int unit = -1);
2792
2801extern "C" DECL_EXP double toUsrSpeed_Plugin(double kts_speed, int unit = -1);
2802
2811extern "C" DECL_EXP double fromUsrSpeed_Plugin(double usr_speed, int unit = -1);
2812
2821extern "C" DECL_EXP double toUsrTemp_Plugin(double cel_temp, int unit = -1);
2822
2831extern "C" DECL_EXP double fromUsrTemp_Plugin(double usr_temp, int unit = -1);
2832
2840extern DECL_EXP wxString getUsrDistanceUnit_Plugin(int unit = -1);
2841
2849extern DECL_EXP wxString getUsrSpeedUnit_Plugin(int unit = -1);
2850
2858extern DECL_EXP wxString getUsrTempUnit_Plugin(int unit = -1);
2859
2867extern DECL_EXP wxString getUsrWindSpeedUnit_Plugin(int unit = -1);
2868
2877extern DECL_EXP double toUsrWindSpeed_Plugin(double kts_wspeed, int unit = -1);
2878
2887extern DECL_EXP double fromUsrWindSpeed_Plugin(double usr_wspeed,
2888 int unit = -1);
2889
2897extern DECL_EXP wxString getUsrDepthUnit_Plugin(int unit = -1);
2898
2907extern DECL_EXP double toUsrDepth_Plugin(double m_depth, int unit = -1);
2908
2917extern DECL_EXP double fromUsrDepth_Plugin(double usr_depth, int unit = -1);
2918
2935extern DECL_EXP double fromDMM_PlugIn(wxString sdms);
2936
2950struct DECL_EXP DateTimeFormatOptions {
2952 virtual ~DateTimeFormatOptions();
2953
2974
2990 wxString time_zone;
2991
2999
3005
3006 int version = 1; // For future compatibility checks
3007
3027 format_string = fmt;
3028 return *this;
3029 }
3030
3049 DateTimeFormatOptions &SetTimezone(const wxString &tz) {
3050 time_zone = tz;
3051 return *this;
3052 }
3053
3061 show_timezone = show;
3062 return *this;
3063 }
3064
3083 longitude = lon;
3084 return *this;
3085 }
3086};
3087
3107extern DECL_EXP wxString toUsrDateTimeFormat_Plugin(
3108 const wxDateTime date_time,
3110
3122extern DECL_EXP wxString GetNewGUID();
3123
3136extern "C" DECL_EXP bool PlugIn_GSHHS_CrossesLand(double lat1, double lon1,
3137 double lat2, double lon2);
3144extern DECL_EXP void PlugInPlaySound(wxString &sound_file);
3145
3146// API 1.10 Route and Waypoint Support
3147
3156extern DECL_EXP wxBitmap *FindSystemWaypointIcon(wxString &icon_name);
3157
3168extern DECL_EXP bool AddCustomWaypointIcon(wxBitmap *pimage, wxString key,
3169 wxString description);
3170
3180extern DECL_EXP bool AddSingleWaypoint(PlugIn_Waypoint *pwaypoint,
3181 bool b_permanent = true);
3182
3191extern DECL_EXP bool DeleteSingleWaypoint(wxString &GUID);
3192
3201extern DECL_EXP bool UpdateSingleWaypoint(PlugIn_Waypoint *pwaypoint);
3202
3212extern DECL_EXP bool AddPlugInRoute(PlugIn_Route *proute,
3213 bool b_permanent = true);
3214
3223extern DECL_EXP bool DeletePlugInRoute(wxString &GUID);
3224
3234extern DECL_EXP bool UpdatePlugInRoute(PlugIn_Route *proute);
3235
3245extern DECL_EXP bool AddPlugInTrack(PlugIn_Track *ptrack,
3246 bool b_permanent = true);
3247
3256extern DECL_EXP bool DeletePlugInTrack(wxString &GUID);
3257
3267extern DECL_EXP bool UpdatePlugInTrack(PlugIn_Track *ptrack);
3268
3269/* API 1.11 */
3270
3271/* API 1.11 adds some more common functions to avoid unnecessary code
3272 * duplication */
3273
3282wxColour DECL_EXP GetBaseGlobalColor(wxString colorName);
3283
3297int DECL_EXP OCPNMessageBox_PlugIn(wxWindow *parent, const wxString &message,
3298 const wxString &caption = _T("Message"),
3299 int style = wxOK, int x = -1, int y = -1);
3300
3315extern DECL_EXP wxString toSDMM_PlugIn(int NEflag, double a,
3316 bool hi_precision = true);
3317
3327extern "C" DECL_EXP wxString *GetpPrivateApplicationDataLocation();
3328
3336extern DECL_EXP wxString GetOCPN_ExePath(void);
3337
3346extern "C" DECL_EXP wxString *GetpPlugInLocation();
3347
3356extern DECL_EXP wxString GetPlugInPath(opencpn_plugin *pplugin);
3357
3367extern "C" DECL_EXP int AddChartToDBInPlace(wxString &full_path,
3368 bool b_RefreshCanvas);
3375extern "C" DECL_EXP int RemoveChartFromDBInPlace(wxString &full_path);
3376
3385extern DECL_EXP wxString GetLocaleCanonicalName();
3386
3401#define PLIB_CAPS_LINE_VBO 1
3405#define PLIB_CAPS_LINE_BUFFER 1 << 1
3406
3410#define PLIB_CAPS_SINGLEGEO_BUFFER 1 << 2
3411
3415#define PLIB_CAPS_OBJSEGLIST 1 << 3
3416
3420#define PLIB_CAPS_OBJCATMUTATE 1 << 4
3421
3422class PI_S57Obj;
3423
3424WX_DECLARE_LIST(PI_S57Obj, ListOfPI_S57Obj);
3425
3426// ----------------------------------------------------------------------------
3427// PlugInChartBaseGL
3428// Derived from PlugInChartBase, add OpenGL Vector chart support
3429// ----------------------------------------------------------------------------
3430
3443class DECL_EXP PlugInChartBaseGL : public PlugInChartBase {
3444public:
3446 virtual ~PlugInChartBaseGL();
3447
3462 virtual int RenderRegionViewOnGL(const wxGLContext &glc,
3463 const PlugIn_ViewPort &VPoint,
3464 const wxRegion &Region, bool b_use_stencil);
3465
3478 virtual ListOfPI_S57Obj *GetObjRuleListAtLatLon(float lat, float lon,
3479 float select_radius,
3480 PlugIn_ViewPort *VPoint);
3481
3491 virtual wxString CreateObjDescriptions(ListOfPI_S57Obj *obj_list);
3492
3498 virtual int GetNoCOVREntries();
3499
3506 virtual int GetNoCOVRTablePoints(int iTable);
3507
3514 virtual int GetNoCOVRTablenPoints(int iTable);
3515
3522 virtual float *GetNoCOVRTableHead(int iTable);
3523};
3524
3525// ----------------------------------------------------------------------------
3526// PlugInChartBaseGLPlus2
3527// Derived from PlugInChartBaseGL, add additional chart management methods
3528// ----------------------------------------------------------------------------
3529
3539public:
3541 virtual ~PlugInChartBaseGLPlus2();
3542
3559 virtual ListOfPI_S57Obj *GetLightsObjRuleListVisibleAtLatLon(
3560 float lat, float lon, PlugIn_ViewPort *VPoint);
3561};
3562
3563// ----------------------------------------------------------------------------
3564// PlugInChartBaseExtended
3565// Derived from PlugInChartBase, add extended chart support methods
3566// ----------------------------------------------------------------------------
3567
3576public:
3578 virtual ~PlugInChartBaseExtended();
3579
3592 virtual int RenderRegionViewOnGL(const wxGLContext &glc,
3593 const PlugIn_ViewPort &VPoint,
3594 const wxRegion &Region, bool b_use_stencil);
3595
3606 virtual wxBitmap &RenderRegionViewOnDCNoText(const PlugIn_ViewPort &VPoint,
3607 const wxRegion &Region);
3608
3619 virtual bool RenderRegionViewOnDCTextOnly(wxMemoryDC &dc,
3620 const PlugIn_ViewPort &VPoint,
3621 const wxRegion &Region);
3622
3634 virtual int RenderRegionViewOnGLNoText(const wxGLContext &glc,
3635 const PlugIn_ViewPort &VPoint,
3636 const wxRegion &Region,
3637 bool b_use_stencil);
3638
3650 virtual int RenderRegionViewOnGLTextOnly(const wxGLContext &glc,
3651 const PlugIn_ViewPort &VPoint,
3652 const wxRegion &Region,
3653 bool b_use_stencil);
3654
3655 virtual ListOfPI_S57Obj *GetObjRuleListAtLatLon(float lat, float lon,
3656 float select_radius,
3657 PlugIn_ViewPort *VPoint);
3658 virtual wxString CreateObjDescriptions(ListOfPI_S57Obj *obj_list);
3659
3660 virtual int GetNoCOVREntries();
3661 virtual int GetNoCOVRTablePoints(int iTable);
3662 virtual int GetNoCOVRTablenPoints(int iTable);
3663 virtual float *GetNoCOVRTableHead(int iTable);
3664
3671 virtual void ClearPLIBTextList();
3672};
3673
3674// ----------------------------------------------------------------------------
3675// PlugInChartBaseExtendedPlus2
3676// Derived from PlugInChartBaseExtended, add additional extended chart support
3677// methods
3678// ----------------------------------------------------------------------------
3679
3681public:
3684
3685 virtual ListOfPI_S57Obj *GetLightsObjRuleListVisibleAtLatLon(
3686 float lat, float lon, PlugIn_ViewPort *VPoint);
3687};
3688
3689class wxArrayOfS57attVal;
3690
3709
3733
3762
3776
3802
3810class DECL_EXP PI_S57Obj {
3811public:
3812 // Public Methods
3813 PI_S57Obj();
3814
3815public:
3816 // Instance Data
3817 char FeatureName[8];
3819
3821 wxArrayOfS57attVal *attVal;
3823
3824 int iOBJL;
3825 int Index;
3826
3827 double x;
3828 double y;
3829 double z;
3830 int npt;
3831 void *geoPt;
3832 double *geoPtz;
3833 double *geoPtMulti;
3834
3836
3837 double m_lat;
3838 double m_lon;
3839
3842
3843 double lat_min;
3844 double lat_max;
3845 double lon_min;
3846 double lon_max;
3847
3849
3851 int nRef;
3852
3853 bool bIsAton;
3855
3860
3862
3866
3867 // Coordinate transform coefficients
3868 double x_rate;
3869 double y_rate;
3870 double x_origin;
3871 double y_origin;
3872
3873 // OpenGL rendering parameters
3878
3882};
3883
3889wxString DECL_EXP PI_GetPLIBColorScheme();
3898int DECL_EXP PI_GetPLIBDepthUnitInt();
3899
3907int DECL_EXP PI_GetPLIBSymbolStyle();
3908
3916int DECL_EXP PI_GetPLIBBoundaryStyle();
3917
3924int DECL_EXP PI_GetPLIBStateHash();
3925
3931double DECL_EXP PI_GetPLIBMarinerSafetyContour();
3932
3943bool DECL_EXP PI_GetObjectRenderBox(PI_S57Obj *pObj, double *lat_min,
3944 double *lat_max, double *lon_min,
3945 double *lon_max);
3946
3952void DECL_EXP PI_UpdateContext(PI_S57Obj *pObj);
3953
3961bool DECL_EXP PI_PLIBObjectRenderCheck(PI_S57Obj *pObj, PlugIn_ViewPort *vp);
3962
3975
3983
3991
3998void DECL_EXP PI_PLIBSetLineFeaturePriority(PI_S57Obj *pObj, int prio);
3999
4004void DECL_EXP PI_PLIBPrepareForNewRender(void);
4005
4011void DECL_EXP PI_PLIBFreeContext(void *pContext);
4012
4022void DECL_EXP PI_PLIBSetRenderCaps(unsigned int flags);
4023
4033bool DECL_EXP PI_PLIBSetContext(PI_S57Obj *pObj);
4034
4049int DECL_EXP PI_PLIBRenderObjectToDC(wxDC *pdc, PI_S57Obj *pObj,
4050 PlugIn_ViewPort *vp);
4051
4068int DECL_EXP PI_PLIBRenderAreaToDC(wxDC *pdc, PI_S57Obj *pObj,
4069 PlugIn_ViewPort *vp, wxRect rect,
4070 unsigned char *pixbuf);
4071
4086int DECL_EXP PI_PLIBRenderAreaToGL(const wxGLContext &glcc, PI_S57Obj *pObj,
4087 PlugIn_ViewPort *vp, wxRect &render_rect);
4088
4105int DECL_EXP PI_PLIBRenderObjectToGL(const wxGLContext &glcc, PI_S57Obj *pObj,
4106 PlugIn_ViewPort *vp, wxRect &render_rect);
4107
4108/* API 1.11 OpenGL Display List and vertex buffer object routines
4109
4110 Effectively these two routines cancel each other so all
4111 of the translation, scaling and rotation can be done by opengl.
4112
4113 Display lists need only be built infrequently, but used in each frame
4114 greatly accelerates the speed of rendering. This avoids costly calculations,
4115 and also allows the vertexes to be stored in graphics memory.
4116
4117 static int dl = 0;
4118 glPushMatrix();
4119 PlugInMultMatrixViewport(current_viewport);
4120 if(dl)
4121 glCallList(dl);
4122 else {
4123 dl = glGenLists(1);
4124 PlugInViewPort norm_viewport = current_viewport;
4125 NormalizeViewPort(norm_viewport);
4126 glNewList(dl, GL_COMPILE_AND_EXECUTE);
4127 ... // use norm_viewport with GetCanvasLLPix here
4128 glEndList();
4129 }
4130 glPopMatrix();
4131 ... // use current_viewport with GetCanvasLLPix again
4132*/
4133
4143extern DECL_EXP bool PlugInHasNormalizedViewPort(PlugIn_ViewPort *vp);
4144
4159extern DECL_EXP void PlugInMultMatrixViewport(PlugIn_ViewPort *vp,
4160 float lat = 0, float lon = 0);
4161
4176extern DECL_EXP void PlugInNormalizeViewport(PlugIn_ViewPort *vp, float lat = 0,
4177 float lon = 0);
4178
4179class wxPoint2DDouble;
4180
4192extern "C" DECL_EXP void GetDoubleCanvasPixLL(PlugIn_ViewPort *vp,
4193 wxPoint2DDouble *pp, double lat,
4194 double lon);
4195
4196/* API 1.13 */
4197/* API 1.13 adds some more common functions to avoid unnecessary code
4198 * duplication */
4199
4208extern DECL_EXP double fromDMM_Plugin(wxString sdms);
4209
4220extern DECL_EXP void SetCanvasRotation(double rotation);
4221
4233extern DECL_EXP void SetCanvasProjection(int projection);
4234
4244extern DECL_EXP bool GetSingleWaypoint(wxString GUID,
4245 PlugIn_Waypoint *pwaypoint);
4246
4259extern DECL_EXP bool CheckEdgePan_PlugIn(int x, int y, bool dragging,
4260 int margin, int delta);
4261
4270extern DECL_EXP wxBitmap GetIcon_PlugIn(const wxString &name);
4271
4279extern DECL_EXP void SetCursor_PlugIn(wxCursor *pPlugin_Cursor = NULL);
4280
4316extern DECL_EXP wxFont *GetOCPNScaledFont_PlugIn(wxString TextElement,
4317 int default_size = 0);
4318
4332extern DECL_EXP wxFont GetOCPNGUIScaledFont_PlugIn(wxString item);
4333
4349extern DECL_EXP double GetOCPNGUIToolScaleFactor_PlugIn(int GUIScaledFactor);
4350
4365extern DECL_EXP double GetOCPNGUIToolScaleFactor_PlugIn();
4366
4381extern DECL_EXP float GetOCPNChartScaleFactor_Plugin();
4382
4390extern DECL_EXP wxColour GetFontColour_PlugIn(wxString TextElement);
4391
4402extern DECL_EXP double GetCanvasTilt();
4403
4414extern DECL_EXP void SetCanvasTilt(double tilt);
4415
4421extern DECL_EXP bool PlugInPlaySoundEx(wxString &sound_file,
4422 int deviceIndex = -1);
4423
4436extern DECL_EXP void AddChartDirectory(wxString &path);
4437
4448extern DECL_EXP void ForceChartDBUpdate();
4449
4461extern DECL_EXP void ForceChartDBRebuild();
4462
4468extern DECL_EXP wxString GetWritableDocumentsDir(void);
4469
4475extern DECL_EXP wxDialog *GetActiveOptionsDialog();
4476
4487extern DECL_EXP wxArrayString GetWaypointGUIDArray(void);
4488
4494extern DECL_EXP wxArrayString GetIconNameArray(void);
4495
4506extern DECL_EXP bool AddPersistentFontKey(wxString TextElement);
4507
4519extern DECL_EXP wxString GetActiveStyleName();
4520
4536extern DECL_EXP wxBitmap GetBitmapFromSVGFile(wxString filename,
4537 unsigned int width,
4538 unsigned int height);
4539
4552extern DECL_EXP bool IsTouchInterface_PlugIn(void);
4553
4554/* Platform optimized File/Dir selector dialogs */
4573extern DECL_EXP int PlatformDirSelectorDialog(wxWindow *parent,
4574 wxString *file_spec,
4575 wxString Title, wxString initDir);
4576
4598extern DECL_EXP int PlatformFileSelectorDialog(wxWindow *parent,
4599 wxString *file_spec,
4600 wxString Title, wxString initDir,
4601 wxString suggestedName,
4602 wxString wildcard);
4603
4604/* OpenCPN HTTP File Download PlugIn Interface */
4605
4606/* Various method Return Codes, etc */
4621
4634
4635// Style definitions for Synchronous file download modal dialogs, if
4636// desired. Abstracted from wxCURL package
4640 0x0002,
4643 OCPN_DLDS_SIZE = 0x0010,
4646 0x0020,
4647
4648 // styles related to the use of wxCurlConnectionSettingsDialog:
4649
4651 0x0040,
4656 0x0100,
4657
4658 OCPN_DLDS_CONN_SETTINGS_ALL = OCPN_DLDS_CONN_SETTINGS_AUTH |
4661
4662 OCPN_DLDS_SHOW_ALL = OCPN_DLDS_ELAPSED_TIME | OCPN_DLDS_ESTIMATED_TIME |
4665 OCPN_DLDS_CONN_SETTINGS_ALL,
4666
4668 OCPN_DLDS_CAN_START = 0x0400,
4671
4673 0x1000,
4674
4675 // by default all available features are enabled:
4676 OCPN_DLDS_DEFAULT_STYLE = OCPN_DLDS_CAN_START | OCPN_DLDS_CAN_PAUSE |
4677 OCPN_DLDS_CAN_ABORT | OCPN_DLDS_SHOW_ALL |
4679};
4680
4681#define ONLINE_CHECK_RETRY \
4682 30 // Recheck the Internet connection availability every ONLINE_CHECK_RETRY s
4683
4704extern DECL_EXP _OCPN_DLStatus OCPN_downloadFile(
4705 const wxString &url, const wxString &outputFile, const wxString &title,
4706 const wxString &message, const wxBitmap &bitmap, wxWindow *parent,
4707 long style, int timeout_secs);
4708
4726extern DECL_EXP _OCPN_DLStatus
4727OCPN_downloadFileBackground(const wxString &url, const wxString &outputFile,
4728 wxEvtHandler *handler, long *handle);
4729
4735extern DECL_EXP void OCPN_cancelDownloadFileBackground(long handle);
4736
4748extern DECL_EXP _OCPN_DLStatus OCPN_postDataHttp(const wxString &url,
4749 const wxString &parameters,
4750 wxString &result,
4751 int timeout_secs);
4752
4758extern DECL_EXP bool OCPN_isOnline();
4759
4760/* Supporting Event for Background downloading */
4761/* OCPN_downloadEvent Definition */
4762
4763/* PlugIn should be ready/able to handle this event after initiating a
4764 * background file transfer
4765 *
4766 * The event as received should be parsed primarily by the getDLEventCondition()
4767 * method. This will allow identification of download start, progress, and end
4768 * states.
4769 *
4770 * Other accessor methods contain status, byte counts, etc.
4771 *
4772 * A PlugIn may safely destroy its EvtHandler after receipt of an
4773 * OCPN_downloadEvent with getDLEventCondition == OCPN_DL_EVENT_TYPE_END
4774 */
4775class DECL_EXP OCPN_downloadEvent : public wxEvent {
4776public:
4777 OCPN_downloadEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
4779
4780 // accessors
4781 _OCPN_DLStatus getDLEventStatus() { return m_stat; }
4782 OCPN_DLCondition getDLEventCondition() { return m_condition; }
4783
4784 void setDLEventStatus(_OCPN_DLStatus stat) { m_stat = stat; }
4785 void setDLEventCondition(OCPN_DLCondition cond) { m_condition = cond; }
4786
4787 void setTotal(long bytes) { m_totalBytes = bytes; }
4788 void setTransferred(long bytes) { m_sofarBytes = bytes; }
4789 long getTotal() { return m_totalBytes; }
4790 long getTransferred() { return m_sofarBytes; }
4791
4792 void setComplete(bool b_complete) { m_b_complete = b_complete; }
4793 bool getComplete() { return m_b_complete; }
4794
4795 // required for sending with wxPostEvent()
4796 wxEvent *Clone() const;
4797
4798private:
4799 OCPN_DLStatus m_stat;
4800 OCPN_DLCondition m_condition;
4801
4802 long m_totalBytes;
4803 long m_sofarBytes;
4804 bool m_b_complete;
4805};
4806
4807// extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DOWNLOAD_EVENT;
4808
4809#ifdef MAKING_PLUGIN
4810extern DECL_IMP wxEventType wxEVT_DOWNLOAD_EVENT;
4811#else
4812extern DECL_EXP wxEventType wxEVT_DOWNLOAD_EVENT;
4813#endif
4814
4815/* API 1.14 */
4816/* API 1.14 adds some more common functions to avoid unnecessary code
4817 * duplication */
4818
4819extern DECL_EXP bool LaunchDefaultBrowser_Plugin(wxString url);
4820
4821// API 1.14 Extra canvas Support
4822
4838extern DECL_EXP void PlugInAISDrawGL(wxGLCanvas *glcanvas,
4839 const PlugIn_ViewPort &vp);
4840
4850extern DECL_EXP bool PlugInSetFontColor(const wxString TextElement,
4851 const wxColour color);
4852
4853// API 1.15
4854
4869extern DECL_EXP double PlugInGetDisplaySizeMM();
4870
4883extern DECL_EXP wxFont *FindOrCreateFont_PlugIn(
4884 int point_size, wxFontFamily family, wxFontStyle style, wxFontWeight weight,
4885 bool underline = false, const wxString &facename = wxEmptyString,
4886 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
4887
4907
4920
4934extern DECL_EXP void PlugInHandleAutopilotRoute(bool enable);
4935
4936// API 1.16
4937//
4952extern DECL_EXP wxString GetPluginDataDir(const char *plugin_name);
4953
4959extern DECL_EXP bool ShuttingDown(void);
4960
4961// Support for MUI MultiCanvas model
4962
4985extern DECL_EXP wxWindow *PluginGetFocusCanvas();
4986
4995extern DECL_EXP wxWindow *PluginGetOverlayRenderCanvas();
4996
5005extern "C" DECL_EXP void CanvasJumpToPosition(wxWindow *canvas, double lat,
5006 double lon, double scale);
5018extern "C" DECL_EXP int AddCanvasMenuItem(wxMenuItem *pitem,
5019 opencpn_plugin *pplugin,
5020 const char *name = "");
5029extern "C" DECL_EXP void RemoveCanvasMenuItem(int item, const char *name = "");
5030
5040extern "C" DECL_EXP void SetCanvasMenuItemViz(int item, bool viz,
5041 const char *name = "");
5042
5052extern "C" DECL_EXP void SetCanvasMenuItemGrey(int item, bool grey,
5053 const char *name = "");
5054
5055// Extract waypoints, routes and tracks
5061extern DECL_EXP wxString GetSelectedWaypointGUID_Plugin();
5062
5068extern DECL_EXP wxString GetSelectedRouteGUID_Plugin();
5069
5075extern DECL_EXP wxString GetSelectedTrackGUID_Plugin();
5076
5083extern DECL_EXP std::unique_ptr<PlugIn_Waypoint> GetWaypoint_Plugin(
5084 const wxString &);
5085
5092extern DECL_EXP std::unique_ptr<PlugIn_Route> GetRoute_Plugin(const wxString &);
5093
5100extern DECL_EXP std::unique_ptr<PlugIn_Track> GetTrack_Plugin(const wxString &);
5101
5107extern DECL_EXP wxWindow *GetCanvasUnderMouse();
5108
5122extern DECL_EXP int GetCanvasIndexUnderMouse();
5123
5124// extern DECL_EXP std::vector<wxWindow *> GetCanvasArray();
5137extern DECL_EXP wxWindow *GetCanvasByIndex(int canvasIndex);
5138
5149extern DECL_EXP int GetCanvasCount();
5150
5165extern DECL_EXP bool CheckMUIEdgePan_PlugIn(int x, int y, bool dragging,
5166 int margin, int delta,
5167 int canvasIndex);
5168
5177extern DECL_EXP void SetMUICursor_PlugIn(wxCursor *pCursor, int canvasIndex);
5178
5179// API 1.17
5180//
5181
5190extern DECL_EXP wxRect GetMasterToolbarRect();
5191
5211
5219extern DECL_EXP int GetLatLonFormat(void);
5220
5221// API 1.17
5222
5233extern "C" DECL_EXP void ZeroXTE();
5234
5258class DECL_EXP PlugIn_Waypoint_Ex {
5259public:
5261 PlugIn_Waypoint_Ex(double lat, double lon, const wxString &icon_ident,
5262 const wxString &wp_name, const wxString &GUID = "",
5263 const double ScaMin = 1e9, const bool bNameVisible = false,
5264 const int nRanges = 0, const double RangeDistance = 1.0,
5265 const wxColor RangeColor = wxColor(255, 0, 0));
5277 void InitDefaults();
5278
5290 bool GetFSStatus();
5291
5300 int GetRouteMembershipCount();
5301
5302 double m_lat;
5303 double m_lon;
5304 wxString m_GUID;
5305 wxString m_MarkName;
5307 wxDateTime m_CreateTime;
5310
5311 double scamin;
5314
5318
5319 wxString IconName;
5321
5327 Plugin_HyperlinkList *m_HyperlinkList;
5328};
5329
5330WX_DECLARE_LIST(PlugIn_Waypoint_Ex, Plugin_WaypointExList);
5331
5332class DECL_EXP PlugIn_Waypoint_ExV2 {
5333public:
5335 PlugIn_Waypoint_ExV2(double lat, double lon, const wxString &icon_ident,
5336 const wxString &wp_name, const wxString &GUID = "",
5337 const double ScaMin = 1e9, const double ScaMax = 1e6,
5338 const bool bNameVisible = false,
5339 const int nRangeRings = 0,
5340 const double RangeDistance = 1.0,
5341 const int RangeRingSpaceUnits = 0, // 0:nm, 1:km
5342 const wxColor RangeColor = wxColor(255, 0, 0),
5343 const double WaypointArrivalRadius = 0.0,
5344 const bool ShowWaypointRangeRings = false,
5345 const double PlannedSpeed = 0.0,
5346 const wxString TideStation = wxEmptyString);
5347
5348 virtual ~PlugIn_Waypoint_ExV2();
5349
5361 bool GetFSStatus();
5362
5371 int GetRouteMembershipCount();
5372
5373 double m_lat;
5374 double m_lon;
5375 wxString m_GUID;
5376 wxString m_MarkName;
5378 wxDateTime m_CreateTime;
5381
5382 double scamin;
5385
5390
5391 wxString IconName;
5393
5399 Plugin_HyperlinkList *m_HyperlinkList;
5400
5401 // New fields that are not in PlugIn_Waypoint_Ex
5402 double scamax;
5407 wxDateTime m_ETD;
5410
5411protected:
5422 void InitDefaults();
5423};
5424
5425WX_DECLARE_LIST(PlugIn_Waypoint_ExV2, Plugin_WaypointExV2List);
5426
5449class DECL_EXP PlugIn_Route_Ex {
5450public:
5451 PlugIn_Route_Ex(void);
5452 ~PlugIn_Route_Ex(void);
5453
5454 wxString m_NameString;
5455 wxString m_StartString;
5456 wxString m_EndString;
5457 wxString m_GUID;
5460 wxString m_Description;
5461
5467 Plugin_WaypointExList *pWaypointList;
5468};
5469
5484class DECL_EXP PlugIn_Route_ExV2 {
5485public:
5487 virtual ~PlugIn_Route_ExV2();
5488
5489 wxString m_NameString;
5490 wxString m_StartString;
5491 wxString m_EndString;
5492 wxString m_GUID;
5495 wxString m_Description;
5496
5502 Plugin_WaypointExV2List *pWaypointList;
5503};
5504
5512extern DECL_EXP wxArrayString GetRouteGUIDArray(void);
5513
5521extern DECL_EXP wxArrayString GetTrackGUIDArray(void);
5522
5530extern DECL_EXP bool GetSingleWaypointEx(wxString GUID,
5531 PlugIn_Waypoint_Ex *pwaypoint);
5532
5540extern DECL_EXP bool GetSingleWaypointExV2(wxString GUID,
5541 PlugIn_Waypoint_ExV2 *pwaypoint);
5542
5550extern DECL_EXP bool AddSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypoint,
5551 bool b_permanent = true);
5552
5560extern DECL_EXP bool AddSingleWaypointExV2(PlugIn_Waypoint_ExV2 *pwaypoint,
5561 bool b_permanent = true);
5562
5569extern DECL_EXP bool UpdateSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypoint);
5570
5577extern DECL_EXP bool UpdateSingleWaypointExV2(PlugIn_Waypoint_ExV2 *pwaypoint);
5578
5586extern DECL_EXP bool AddPlugInRouteEx(PlugIn_Route_Ex *proute,
5587 bool b_permanent = true);
5588
5595extern DECL_EXP bool AddPlugInRouteExV2(PlugIn_Route_ExV2 *proute,
5596 bool b_permanent = true);
5597
5604extern DECL_EXP bool UpdatePlugInRouteEx(PlugIn_Route_Ex *proute);
5605
5614extern DECL_EXP bool UpdatePlugInRouteExV2(PlugIn_Route_ExV2 *proute);
5615
5624extern DECL_EXP std::unique_ptr<PlugIn_Waypoint_Ex> GetWaypointEx_Plugin(
5625 const wxString &GUID);
5626
5635extern DECL_EXP std::unique_ptr<PlugIn_Waypoint_ExV2> GetWaypointExV2_Plugin(
5636 const wxString &GUID);
5637
5646extern DECL_EXP std::unique_ptr<PlugIn_Route_Ex> GetRouteEx_Plugin(
5647 const wxString &GUID);
5648
5657extern DECL_EXP std::unique_ptr<PlugIn_Route_ExV2> GetRouteExV2_Plugin(
5658 const wxString &GUID);
5659
5665extern DECL_EXP wxString GetActiveWaypointGUID(void);
5666
5672extern DECL_EXP wxString GetActiveRouteGUID(void);
5673
5674// API 1.18
5675
5690extern DECL_EXP double OCPN_GetDisplayContentScaleFactor();
5691
5706extern DECL_EXP double OCPN_GetWinDIPScaleFactor();
5707
5715extern DECL_EXP std::vector<std::string> GetPriorityMaps();
5716
5721extern DECL_EXP void UpdateAndApplyPriorityMaps(std::vector<std::string> map);
5722
5730extern DECL_EXP std::vector<std::string> GetActivePriorityIdentifiers();
5731
5739extern DECL_EXP int GetGlobalWatchdogTimoutSeconds();
5740
5752
5753// FIXME (dave) Implement these
5770extern DECL_EXP wxArrayString GetRouteGUIDArray(OBJECT_LAYER_REQ req);
5771
5787extern DECL_EXP wxArrayString GetTrackGUIDArray(OBJECT_LAYER_REQ req);
5788
5806extern DECL_EXP wxArrayString GetWaypointGUIDArray(OBJECT_LAYER_REQ req);
5807
5810/* Listening to messages. */
5811class ObservableListener;
5812
5814class ObservedEvt;
5815
5816// This is a verbatim copy from observable_evt.h, don't define twice.
5817#ifndef OBSERVABLE_EVT_H
5818#define OBSERVABLE_EVT_H
5819
5820wxDECLARE_EVENT(obsNOTIFY, ObservedEvt);
5821
5836class ObservedEvt : public wxCommandEvent {
5837public:
5844 ObservedEvt(wxEventType commandType = obsNOTIFY, int id = 0)
5845 : wxCommandEvent(commandType, id) {}
5846 ObservedEvt(const ObservedEvt &event) : wxCommandEvent(event) {
5847 this->m_shared_ptr = event.m_shared_ptr;
5848 }
5849
5857 wxEvent *Clone() const { return new ObservedEvt(*this); }
5858
5864 std::shared_ptr<const void> GetSharedPtr() const { return m_shared_ptr; }
5865
5871 void SetSharedPtr(std::shared_ptr<const void> p) { m_shared_ptr = p; }
5872
5873private:
5874 std::shared_ptr<const void> m_shared_ptr;
5875};
5876
5877#endif // OBSERVABLE_EVT_H
5878
5879class ObservableListener;
5880
5888 const uint64_t id;
5893 NMEA2000Id(int value) : id(static_cast<uint64_t>(value)) {};
5894};
5895
5906extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
5907 NMEA2000Id id, wxEventType ev, wxEvtHandler *handler);
5908
5916 const std::string id;
5921 NMEA0183Id(const std::string &s) : id(s) {};
5922};
5923
5934extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
5935 NMEA0183Id id, wxEventType ev, wxEvtHandler *handler);
5936
5944 const std::string id;
5949 SignalkId(const std::string &s) : id(s) {};
5950};
5951
5962extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
5963 SignalkId id, wxEventType ev, wxEvtHandler *handler);
5964
5980extern DECL_EXP std::vector<uint8_t> GetN2000Payload(NMEA2000Id id,
5981 ObservedEvt ev);
5982
5999extern DECL_EXP std::shared_ptr<void> GetSignalkPayload(ObservedEvt ev);
6000
6005extern DECL_EXP std::string GetN2000Source(NMEA2000Id id, ObservedEvt ev);
6006
6008extern DECL_EXP std::string GetN0183Payload(NMEA0183Id id, ObservedEvt ev);
6009
6017 const int type;
6022 NavDataId() : type(0) {}
6023};
6024
6036extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
6037 NavDataId id, wxEventType ev, wxEvtHandler *handler);
6038
6046 double lat;
6047 double lon;
6048 double sog;
6049 double cog;
6050 double var;
6051 double hdt;
6052 time_t time;
6053};
6054
6056extern DECL_EXP PluginNavdata GetEventNavdata(ObservedEvt ev);
6057
6059/*
6060 * Plugins may access comm ports for direct output.
6061 * The general program flow for a plugin may look something like this
6062 * pseudo-code:
6063 * 1. Plugin will query OCPN core for a list of active comm drivers.
6064 * 2. Plugin will inspect the list, and query OCPN core for driver
6065 * attributes.
6066 * 3. Plugin will select a comm driver with appropriate attributes for output.
6067 * 4. Plugin will register a list of PGNs expected to be transmitted
6068 * (N2K specific)
6069 * 5. Plugin may then send a payload buffer to a specific comm driver for
6070 * output as soon as possible.
6071 *
6072 * The mechanism for specifying a particular comm driver uses the notion of
6073 * "handles". Each active comm driver has an associated opaque handle, managed
6074 * by OCPN core. All references by a plugin to a driver are by means of its
6075 * handle. Handles should be considered to be "opaque", meaning that the exact
6076 * contents of the handle are of no specific value to the plugin, and only
6077 * have meaning to the OCPN core management of drivers.
6078 */
6079
6081typedef std::string DriverHandle;
6082
6105
6107extern DECL_EXP std::vector<DriverHandle> GetActiveDrivers();
6108
6123extern DECL_EXP const std::unordered_map<std::string, std::string>
6125
6126/* Writing to a specific driver */
6136extern DECL_EXP CommDriverResult WriteCommDriver(
6137 DriverHandle handle, const std::shared_ptr<std::vector<uint8_t>> &payload);
6138
6140extern DECL_EXP CommDriverResult WriteCommDriverN2K(
6141 DriverHandle handle, int PGN, int destinationCANAddress, int priority,
6142 const std::shared_ptr<std::vector<uint8_t>> &payload);
6143
6186extern DECL_EXP CommDriverResult RegisterTXPGNs(DriverHandle handle,
6187 std::vector<int> &pgn_list);
6188
6189// API 1.20
6190//
6191
6228
6231 const std::string id;
6232 PluginMsgId(const std::string &s) : id(s) {};
6233};
6234
6239extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
6240 PluginMsgId id, wxEventType ev, wxEvtHandler *handler);
6241
6246extern DECL_EXP std::string GetPluginMsgPayload(PluginMsgId id, ObservedEvt ev);
6247
6253extern DECL_EXP void ExitOCPN();
6254
6263extern "C" DECL_EXP void RequestWindowRefresh(wxWindow *win,
6264 bool eraseBackground);
6265
6271extern DECL_EXP bool GetFullScreen();
6272
6278extern DECL_EXP void SetFullScreen(bool full_screen_on);
6279
6285extern DECL_EXP void EnableTouchMode(bool enable);
6286
6292extern DECL_EXP bool GetTouchMode();
6293
6301extern DECL_EXP void SetGlobalColor(std::string table, std::string name,
6302 wxColor color);
6303
6311extern DECL_EXP wxColor GetGlobalColorD(std::string map_name, std::string name);
6312
6318extern DECL_EXP void EnableStatusBar(bool enable);
6319
6325extern DECL_EXP void EnableMenu(bool enable);
6326
6332extern DECL_EXP bool GetEnableStatusBar();
6333
6339extern DECL_EXP bool GetEnableMenu();
6340
6350extern DECL_EXP void SetNavigationMode(PI_NavMode mode, int CanvasIndex);
6351
6358extern DECL_EXP PI_NavMode GetNavigationMode(int CanvasIndex);
6359
6367extern DECL_EXP void EnableLookaheadMode(bool enable, int CanvasIndex);
6368
6375extern DECL_EXP bool GetEnableLookaheadMode(int CanvasIndex);
6376
6383extern DECL_EXP void EnableMUIBar(bool enable, int CanvasIndex);
6384
6391extern DECL_EXP void EnableCompassGPSIcon(bool enable, int CanvasIndex);
6392
6399extern DECL_EXP void EnableChartBar(bool enable, int CanvasIndex);
6400
6407extern DECL_EXP bool GetEnableMUIBar(int CanvasIndex);
6408
6415extern DECL_EXP bool GetEnableCompassGPSIcon(int CanvasIndex);
6416
6423extern DECL_EXP bool GetEnableChartBar(int CanvasIndex);
6424
6432extern DECL_EXP void EnableCanvasFocusBar(bool enable, int CanvasIndex);
6433
6440extern DECL_EXP bool GetEnableCanvasFocusBar(int CanvasIndex);
6441
6442/*
6443 * Allow plugin control of "Chart Panel Options" dialog
6444 */
6445
6452extern DECL_EXP void EnableLatLonGrid(bool enable, int CanvasIndex);
6453
6460extern DECL_EXP void EnableChartOutlines(bool enable, int CanvasIndex);
6461
6468extern DECL_EXP void EnableDepthUnitDisplay(bool enable, int CanvasIndex);
6469
6476extern DECL_EXP void EnableAisTargetDisplay(bool enable, int CanvasIndex);
6477
6484extern DECL_EXP void EnableTideStationsDisplay(bool enable, int CanvasIndex);
6485
6492extern DECL_EXP void EnableCurrentStationsDisplay(bool enable, int CanvasIndex);
6493
6500extern DECL_EXP void EnableENCTextDisplay(bool enable, int CanvasIndex);
6501
6508extern DECL_EXP void EnableENCDepthSoundingsDisplay(bool enable,
6509 int CanvasIndex);
6510
6517extern DECL_EXP void EnableBuoyLightLabelsDisplay(bool enable, int CanvasIndex);
6518
6525extern DECL_EXP void EnableLightsDisplay(bool enable, int CanvasIndex);
6526
6533extern DECL_EXP void EnableLightDescriptionsDisplay(bool enable,
6534 int CanvasIndex);
6535
6542extern DECL_EXP void SetENCDisplayCategory(PI_DisCat cat, int CanvasIndex);
6543
6550extern DECL_EXP bool GetEnableLatLonGrid(int CanvasIndex);
6551
6558extern DECL_EXP bool GetEnableChartOutlines(int CanvasIndex);
6559
6566extern DECL_EXP bool GetEnableDepthUnitDisplay(int CanvasIndex);
6567
6574extern DECL_EXP bool GetEnableAisTargetDisplay(int CanvasIndex);
6575
6582extern DECL_EXP bool GetEnableTideStationsDisplay(int CanvasIndex);
6583
6590extern DECL_EXP bool GetEnableCurrentStationsDisplay(int CanvasIndex);
6591
6598extern DECL_EXP bool GetEnableENCTextDisplay(int CanvasIndex);
6599
6606extern DECL_EXP bool GetEnableENCDepthSoundingsDisplay(int CanvasIndex);
6607
6614extern DECL_EXP bool GetEnableBuoyLightLabelsDisplay(int CanvasIndex);
6615
6622extern DECL_EXP bool GetEnableLightsDisplay(int CanvasIndex);
6623
6630extern DECL_EXP bool GetEnableLightDescriptionsDisplay(int CanvasIndex);
6631
6642extern DECL_EXP PI_DisCat GetENCDisplayCategory(int CanvasIndex);
6643
6652extern DECL_EXP void PluginSetFollowMode(int CanvasIndex, bool enable_follow);
6653
6660extern DECL_EXP bool PluginGetFollowMode(int CanvasIndex);
6661
6669extern DECL_EXP void SetTrackingMode(bool enable);
6670
6676extern DECL_EXP bool GetTrackingMode();
6677
6685extern DECL_EXP void SetAppColorScheme(PI_ColorScheme cs);
6686
6692extern DECL_EXP PI_ColorScheme GetAppColorScheme();
6693
6702extern DECL_EXP void EnableSplitScreenLayout(bool enable = true);
6703
6704// ChartCanvas control utilities
6705
6713extern DECL_EXP void PluginZoomCanvas(int CanvasIndex, double factor);
6714
6720extern DECL_EXP bool GetEnableMainToolbar();
6721
6727extern DECL_EXP void SetEnableMainToolbar(bool enable);
6728
6733extern DECL_EXP void ShowGlobalSettingsDialog();
6734
6740extern DECL_EXP void PluginCenterOwnship(int CanvasIndex);
6741
6749extern DECL_EXP bool GetEnableTenHertzUpdate();
6750
6757extern DECL_EXP void EnableTenHertzUpdate(bool enable);
6758
6764extern DECL_EXP void ConfigFlushAndReload();
6765
6766/*
6767 * Reload and restore all connections by direct read of config file
6768 */
6769extern DECL_EXP void ReloadConfigConnections();
6770
6774enum class PI_NotificationSeverity : int {
6775 PI_kInformational = 0,
6776 PI_kWarning = 1,
6777 PI_kCritical = 2
6778};
6779
6781public:
6783 const std::string &_message, int _timeout_start,
6784 int _timeout_left, std::string _guid);
6785 virtual ~PI_Notification() {};
6786
6787 PI_NotificationSeverity severity;
6788 std::string message;
6789 int auto_timeout_left;
6790 int auto_timeout_start;
6791 std::string guid;
6792 std::string action_verb; // Either "ACK" or "POST", when set by a
6793 // PI_Notification message payload.
6794 // Empty otherwise
6795};
6796
6797extern DECL_EXP int GetActiveNotificationCount();
6798extern DECL_EXP PI_NotificationSeverity GetMaxActiveNotificationLevel();
6799extern DECL_EXP std::string RaiseNotification(
6800 const PI_NotificationSeverity _severity, const std::string &_message,
6801 int timeout_secs = -1);
6802extern DECL_EXP bool AcknowledgeNotification(const std::string &guid);
6803extern DECL_EXP std::vector<std::shared_ptr<PI_Notification>>
6804GetActiveNotifications();
6805extern DECL_EXP void EnableNotificationCanvasIcon(bool enable);
6806
6807/*
6808 * Messaging interface for Notification Framework
6809 *
6810 */
6811
6812/*
6813 * Typical use pattern
6814 *
6815 * 1) Establish listener
6816 wxDEFINE_EVENT(EVT_NOTIFICATION_FRAME, ObservedEvt);
6817 static std::shared_ptr<ObservableListener> listener_note;
6818 NotificationMsgId note_id = NotificationMsgId();
6819 listener_note = GetListener(note_id, EVT_NOTIFICATION_FRAME, this);
6820 Bind(EVT_NOTIFICATION_FRAME, [&](ObservedEvt ev) { HandleNotification(ev); });
6821 *
6822 *
6823 *
6824 * 2) Define actions on receipt
6825 static void HandleNotification(ObservedEvt &ev) {
6826 NotificationMsgId id;
6827 std::shared_ptr<PI_Notification>payload=GetNotificationMsgPayload(id, ev);
6828 if (payload->action_verb == "ACK"){
6829 // Do Acknowledge notification actions
6830 }
6831 else if (payload->action_verb == "POST") {
6832 // Do Add Notification actions
6833 }
6834 }
6835
6836*/
6839 const std::string id;
6840 NotificationMsgId(const std::string &s) : id(s) {};
6841 NotificationMsgId() {};
6842};
6843
6848extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
6849 NotificationMsgId id, wxEventType ev, wxEvtHandler *handler);
6850
6854extern DECL_EXP std::shared_ptr<PI_Notification> GetNotificationMsgPayload(
6856
6857// * Plugin polled Comm Status support
6858enum class PI_Conn_Bus : int { N0183 = 0, Signalk = 1, N2000 = 2 };
6859
6860enum class PI_Comm_State : int {
6861 Disabled = 0,
6862 NoStats = 1,
6863 NoData = 2,
6864 Unavailable = 3,
6865 Ok = 4
6866};
6867
6869public:
6870 PI_Comm_State state;
6871 unsigned rx_count;
6872 unsigned tx_count;
6873 unsigned error_count;
6874};
6875
6876extern DECL_EXP PI_Comm_Status GetConnState(const std::string &iface,
6877 PI_Conn_Bus _bus);
6878
6879extern "C" DECL_EXP int AddCanvasContextMenuItemExt(
6880 wxMenuItem *pitem, opencpn_plugin *pplugin, const std::string object_type);
6881
6882#endif //_PLUGIN_H_
Keeps listening over it's lifespan, removes itself on destruction.
Definition observable.h:131
Custom event class for OpenCPN's notification system.
ObservedEvt(wxEventType commandType=obsNOTIFY, int id=0)
Constructor.
void SetSharedPtr(std::shared_ptr< const void > p)
Sets the event's payload data.
wxEvent * Clone() const
Creates a cloned copy of this event.
std::shared_ptr< const void > GetSharedPtr() const
Gets the event's payload data.
unsigned error_count
Number of detected errors since program start.
unsigned tx_count
Number of bytes sent since program start.
unsigned rx_count
Number of bytes received since program start.
Class representing an S-57 chart object.
int auxParm3
Auxiliary parameter 3.
PI_S57Obj * next
Linked list pointer.
PI_DisCat m_DisplayCat
Display category (base, standard, other)
double m_lon
Reference longitude.
double lon_max
Bounding box maximum longitude.
int Scamin
Minimum display scale.
int * m_lsindex_array
Array of line segment indices.
double x
X coordinate for point features.
int auxParm1
Auxiliary parameter 1.
void * m_chart_context
Parent chart context.
int m_n_lsindex
Number of line segments.
double lon_min
Bounding box minimum longitude.
PI_S57Obj * child
Child object list (for multipoint soundings)
double x_rate
X scale factor.
int npt
Number of points in geometry.
int auxParm2
Auxiliary parameter 2.
double lat_max
Bounding box maximum latitude.
int auxParm0
Auxiliary parameter 0.
int iOBJL
Object lookup index.
void * pPolyTessGeo
Tesselated polygon geometry.
double chart_ref_lon
Chart reference longitude.
bool bIsAssociable
True if object can have relationships.
int m_n_edge_max_points
Maximum points per edge.
void * geoPt
Geometry data for lines/areas.
double y
Y coordinate for point features.
int nRef
Reference count for memory management.
int n_attr
Number of attributes.
double * geoPtMulti
Lat/lon pairs for decomposed points.
double y_origin
Y origin offset.
PI_line_segment_element * m_ls_list
Line segment list.
int Index
Runtime object index.
void * S52_Context
S52 presentation data.
bool bIsClone
True if object is a clone.
char * att_array
Array of attribute types.
double * geoPtz
Z values for multipoint features.
double m_lat
Reference latitude.
int m_DPRI
Display priority.
bool m_bcategory_mutable
True if category can change.
bool bIsAton
True if object is an aid to navigation.
double chart_ref_lat
Chart reference latitude.
double z
Z coordinate (usually depth)
wxArrayOfS57attVal * attVal
Array of attribute values.
double y_rate
Y scale factor.
double lat_min
Bounding box minimum latitude.
double x_origin
X origin offset.
int Primitive_type
Geometry type (point, line, area)
Represents a line segment element for efficient vector chart rendering.
int priority
Drawing priority (higher draws on top)
int type
Line type identifier.
void * private0
Private data pointer for implementation use.
float lon_min
Minimum longitude of segment's bounding box.
float lat_min
Minimum latitude of segment's bounding box.
size_t vbo_offset
Offset into vertex buffer object for this segment.
float lat_max
Maximum latitude of segment's bounding box.
float lon_max
Maximum longitude of segment's bounding box.
PI_line_segment_element * next
Pointer to next segment in linked list.
size_t n_points
Number of points in this line segment.
Extended chart base class with separated text rendering.
Extended OpenGL-optimized chart base class with additional querying capabilities.
OpenGL-optimized chart base class for plugin chart types.
Base class for implementing custom chart types in OpenCPN plugins.
virtual ChartFamilyEnumPI GetChartFamily()
Returns the chart family classification.
virtual wxString GetID()
Returns a unique identifier for the chart.
virtual wxString GetDatumString()
Returns the horizontal geodetic datum of the chart.
virtual wxString GetName()
Returns the chart's name or title.
virtual wxDateTime GetEditionDate(void)
Returns the edition date of the chart.
virtual int GetCOVRTablenPoints(int iTable)
Alternative method to get the number of points in a coverage table entry.
virtual int GetCOVREntries()
Returns the number of coverage table entries for this chart.
virtual wxString GetSoundingsDatum()
Returns the vertical datum used for soundings in the chart.
virtual wxString GetExtraInfo()
Returns additional information about the chart.
virtual wxString GetDescription()
Returns a descriptive text about the chart.
virtual wxString GetFullPath() const
Returns the full file path of the chart.
virtual wxString GetSE()
Returns the chart's source edition identifier.
virtual bool IsReadyToRender()
Indicates whether the chart is ready for rendering.
virtual int GetNativeScale()
Returns the native scale of the chart.
virtual double GetChartSkew()
Returns the skew/rotation angle of the chart.
virtual wxString GetDepthUnits()
Returns the depth units used in the chart.
virtual float * GetCOVRTableHead(int iTable)
Returns a pointer to the coverage table data for a specific entry.
virtual double GetChartErrorFactor()
Returns the error factor for the chart.
virtual OcpnProjTypePI GetChartProjection()
Returns the projection type used by the chart.
virtual wxString GetPubDate()
Returns the publication date/year of the chart.
virtual ChartTypeEnumPI GetChartType()
Returns the chart type identifier.
virtual int GetCOVRTablePoints(int iTable)
Returns the number of points in a specific coverage table entry.
virtual ChartDepthUnitTypePI GetDepthUnitId()
Returns the depth unit type identifier.
AIS target information accessible to plugins.
char CallSign[8]
Call sign, includes NULL terminator.
double HDG
Heading in degrees true.
int ROTAIS
Rate of turn as indicated in AIS message.
unsigned char ShipType
Ship type as per ITU-R M.1371.
double Lat
Latitude in decimal degrees.
int MMSI
Maritime Mobile Service Identity number.
bool bCPA_Valid
True if CPA calculation is valid.
double Brg
Bearing to target in degrees true.
double Lon
Longitude in decimal degrees.
double CPA
Closest Point of Approach in nautical miles.
int Class
AIS class (Class A: 0, Class B: 1)
double SOG
Speed over ground in knots.
double Range_NM
Range to target in nautical miles.
int NavStatus
Navigational status (0-15 as per ITU-R M.1371)
int IMO
IMO ship identification number.
char ShipName[21]
Ship name, includes NULL terminator.
double TCPA
Time to Closest Point of Approach in minutes.
double COG
Course over ground in degrees.
plugin_ais_alarm_type alarm_state
Current alarm state for this target.
Extended position fix information.
int nSats
Number of satellites used in the fix.
double Var
Magnetic variation in degrees, typically from RMC message.
double Cog
Course over ground in degrees.
double Lat
Latitude in decimal degrees.
double Hdm
Heading magnetic in degrees.
time_t FixTime
UTC time of fix.
double Lon
Longitude in decimal degrees.
double Sog
Speed over ground in knots.
double Hdt
Heading true in degrees.
Basic position fix information.
double Cog
Course over ground in degrees.
double Sog
Speed over ground in knots.
time_t FixTime
UTC time of fix as time_t value.
double Lat
Latitude in decimal degrees.
int nSats
Number of satellites used in the fix.
double Var
Magnetic variation in degrees, typically from RMC message.
double Lon
Longitude in decimal degrees.
Enhanced route class for working with PlugIn_Waypoint_ExV2 waypoints.
bool m_isVisible
True if route should be displayed.
Plugin_WaypointExV2List * pWaypointList
List of waypoints making up this route in order.
wxString m_StartString
Description of route start point.
wxString m_Description
Optional route description/notes.
wxString m_NameString
User-visible name of the route.
bool m_isActive
True if this is the active route.
wxString m_GUID
Globally unique identifier.
wxString m_EndString
Description of route end point.
Extended route class for managing complex route features.
wxString m_Description
Optional route description/notes.
wxString m_EndString
Description of route end point.
Plugin_WaypointExList * pWaypointList
List of waypoints making up this route in order.
wxString m_NameString
User-visible name of the route.
bool m_isVisible
True if route should be displayed.
wxString m_GUID
Globally unique identifier.
bool m_isActive
True if this is the active route.
wxString m_StartString
Description of route start point.
Plugin route class for managing ordered waypoint collections.
wxString m_GUID
Globally unique identifier.
wxString m_EndString
Name/description of ending point.
wxString m_NameString
Route name.
Plugin_WaypointList * pWaypointList
List of waypoints making up this route in order.
wxString m_StartString
Name/description of starting point.
Plugin track class for managing recorded track data.
Plugin_WaypointList * pWaypointList
List of waypoints making up this track in chronological order.
wxString m_GUID
Globally unique identifier.
wxString m_EndString
Description of track end point/time.
wxString m_StartString
Description of track start point/time.
wxString m_NameString
Display name of the track.
Contains view parameters and status information for a chart display viewport.
double view_scale_ppm
Display scale in pixels per meter.
wxRect rv_rect
Rectangle defining the rendered view area.
int pix_width
Viewport width in pixels.
double lon_max
Maximum longitude of the viewport.
double clon
Center longitude of the viewport in decimal degrees.
double lat_max
Maximum latitude of the viewport.
int pix_height
Viewport height in pixels.
double clat
Center latitude of the viewport in decimal degrees.
double skew
Display skew angle in radians.
double rotation
Display rotation angle in radians.
bool bValid
True if this viewport is valid and can be used for rendering.
double lon_min
Minimum longitude of the viewport.
double lat_min
Minimum latitude of the viewport.
int m_projection_type
Chart projection type (PROJECTION_MERCATOR, etc.)
bool b_quilt
True if the viewport is in quilt mode (showing multiple charts)
float chart_scale
Conventional chart displayed scale (e.g., 1:50000)
wxDateTime m_ETD
Estimated departure time in UTC, or wxInvalidDateTime if not set.
wxString m_MarkDescription
Optional description text.
wxString m_GUID
Globally unique identifier.
wxString m_TideStation
Tide Station Identifier.
wxDateTime m_CreateTime
Creation timestamp in UTC.
bool m_bShowWaypointRangeRings
True to show range rings on chart.
wxString IconDescription
User-friendly description of icon.
double m_lat
Latitude in decimal degrees.
wxColour RangeRingColor
Color to draw range rings.
bool IsActive
Active state (e.g. destination)
Plugin_HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this waypoint.
double scamin
Minimum display scale (1:X) for waypoint visibility.
double scamax
Maximum display scale (1:X) for waypoint visibility.
bool b_useScamin
True to enable scale-dependent visibility.
wxString IconName
Name of icon to use for waypoint symbol.
bool IsNameVisible
True to show waypoint name on chart.
double m_PlannedSpeed
Planned speed for next leg (knots)
double RangeRingSpace
Distance between range rings in preferred units.
double m_lon
Longitude in decimal degrees.
double m_WaypointArrivalRadius
Arrival radius in nautical miles.
int RangeRingSpaceUnits
Units for range ring spacing - 0:nm, 1:km.
wxString m_MarkName
Display name of waypoint.
bool IsVisible
Visibility state on chart.
int nrange_rings
Number of range rings to display around waypoint.
Extended waypoint class with additional navigation features.
wxDateTime m_CreateTime
Creation timestamp in UTC.
wxColour RangeRingColor
Color to draw range rings.
int nrange_rings
Number of range rings to display around waypoint.
wxString IconDescription
User-friendly description of icon.
bool b_useScamin
True to enable scale-dependent visibility.
double RangeRingSpace
Distance between range rings in preferred units.
Plugin_HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this waypoint.
wxString m_MarkName
Display name of waypoint.
wxString m_GUID
Globally unique identifier.
double m_lon
Longitude in decimal degrees.
wxString IconName
Name of icon to use for waypoint symbol.
double scamin
Minimum display scale (1:X) for waypoint visibility.
bool IsNameVisible
True to show waypoint name on chart.
double m_lat
Latitude in decimal degrees.
wxString m_MarkDescription
Optional description text.
bool IsActive
Active state (e.g. destination)
bool IsVisible
Visibility state on chart.
Plugin waypoint class providing core waypoint/mark functionality.
double m_lon
Longitude in decimal degrees.
wxString m_IconName
Icon identifier.
wxString m_MarkDescription
Optional description.
wxString m_GUID
Globally unique identifier.
bool m_IsVisible
Visibility state.
wxDateTime m_CreateTime
Creation timestamp in UTC.
wxString m_MarkName
Display name.
double m_lat
Latitude in decimal degrees.
Plugin_HyperlinkList * m_HyperlinkList
List of associated hyperlinks.
Information about the currently active route leg.
double Dtw
Distance to waypoint in nautical miles.
wxString wp_name
Name of destination waypoint for the active leg.
double Xte
Cross track error in nautical miles, negative values indicate left side of track.
double Btw
Bearing to waypoint in degrees true.
bool arrival
True when vessel is within the arrival circle of the destination waypoint.
virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp, int canvasIndex)
Renders plugin overlay graphics with canvas selection.
virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext, PlugIn_ViewPort *vp, int canvasIndex)
Renders plugin overlay graphics in OpenGL mode with canvas selection.
bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext, PlugIn_ViewPort *vp, int canvas_ix) override
Renders plugin overlay graphics in OpenGL mode with canvas selection.
bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp, int canvas_ix) override
Renders plugin overlay graphics with canvas selection.
Base class for OpenCPN plugins.
virtual bool RenderOverlay(wxMemoryDC *pmdc, PlugIn_ViewPort *vp)
Render plugin overlay graphics using standard device context.
DECL_EXP void RemovePlugInTool(int tool_id)
Removes a tool from OpenCPN's toolbar.
DECL_EXP void EnableNotificationCanvasIcon(bool enable)
Plugin Notification Framework GUI support.
DECL_EXP void ForceChartDBUpdate()
Forces an update of the chart database.
DECL_EXP wxArrayString GetRouteGUIDArray(void)
Gets array of route GUIDs.
DECL_EXP std::unique_ptr< PlugIn_Route_Ex > GetRouteEx_Plugin(const wxString &GUID)
Gets extended route by GUID.
DECL_EXP CommDriverResult WriteCommDriverN2K(DriverHandle handle, int PGN, int destinationCANAddress, int priority, const std::shared_ptr< std::vector< uint8_t > > &payload)
Send a PGN message to an NMEA2000 address.
_OBJECT_LAYER_REQ
Filter options for object queries.
@ OBJECTS_ALL
Return all objects including those in layers.
@ OBJECTS_ONLY_LAYERS
Return only objects that are in layers.
@ OBJECTS_NO_LAYERS
Exclude objects that are in layers.
DECL_EXP void toSM_ECC_Plugin(double lat, double lon, double lat0, double lon0, double *x, double *y)
Converts geographic coordinates to Elliptical Simple Mercator projection.
DECL_EXP void EnableENCDepthSoundingsDisplay(bool enable, int CanvasIndex)
Controls ENC depth sounding display.
DECL_EXP void EnableChartBar(bool enable, int CanvasIndex)
Controls visibility of chart info bar.
DECL_EXP double fromDMM_Plugin(wxString sdms)
Converts degrees/decimal minutes string to decimal degrees.
DECL_EXP void SetCanvasMenuItemGrey(int item, bool grey, const char *name="")
Sets menu item enabled/disabled state.
DECL_EXP void EnableLatLonGrid(bool enable, int CanvasIndex)
Controls latitude/longitude grid display.
DECL_EXP void SetNavigationMode(PI_NavMode mode, int CanvasIndex)
Sets the navigation mode for a specific chart canvas.
DECL_EXP bool GetEnableENCDepthSoundingsDisplay(int CanvasIndex)
Gets ENC depth sounding visibility.
DECL_EXP void EnableENCTextDisplay(bool enable, int CanvasIndex)
Controls ENC text label display.
DECL_EXP wxXmlDocument GetChartDatabaseEntryXML(int dbIndex, bool b_getGeom)
Gets chart database entry as XML.
DECL_EXP void AddChartDirectory(wxString &path)
Adds a chart directory to OpenCPN's chart database.
DECL_EXP wxBitmap GetBitmapFromSVGFile(wxString filename, unsigned int width, unsigned int height)
Creates bitmap from SVG file.
DECL_EXP wxArrayString GetChartDBDirArrayString()
Gets chart database directory list.
DECL_EXP wxWindow * GetCanvasByIndex(int canvasIndex)
Gets chart canvas window by index.
DECL_EXP bool GetEnableCanvasFocusBar(int CanvasIndex)
Gets focus indicator visibility state.
DECL_EXP void UpdateAndApplyPriorityMaps(std::vector< std::string > map)
Sets and applies new priority mapping scheme.
DECL_EXP int GetCanvasIndexUnderMouse()
Gets index of chart canvas under mouse cursor.
DECL_EXP void DimeWindow(wxWindow *)
Applies system color scheme to window.
plugin_ais_alarm_type
Enumeration of AIS alarm states.
@ PI_AIS_ALARM_ACKNOWLEDGED
Alarm has been acknowledged by the user.
@ PI_AIS_NO_ALARM
No alarm condition exists.
@ PI_AIS_ALARM_SET
Alarm has been set but not acknowledged.
DECL_EXP bool GetSingleWaypointExV2(wxString GUID, PlugIn_Waypoint_ExV2 *pwaypoint)
Gets extended waypoint data by GUID.
enum ChartDepthUnitTypePI _ChartDepthUnitTypePI
Enumeration of depth unit types used in charts.
DECL_EXP std::unique_ptr< PlugIn_Waypoint_ExV2 > GetWaypointExV2_Plugin(const wxString &GUID)
Gets complete waypoint details by GUID.
DECL_EXP void EnableCanvasFocusBar(bool enable, int CanvasIndex)
Controls visibility of canvas focus indicator.
DECL_EXP void EnableTideStationsDisplay(bool enable, int CanvasIndex)
Controls tide station icon display.
enum _PI_DisCat PI_DisCat
Display categories for S52 chart features.
DECL_EXP void RemoveCanvasContextMenuItem(int item)
Removes a context menu item completely.
void DECL_EXP PI_PLIBSetRenderCaps(unsigned int flags)
Sets rendering capability flags.
DECL_EXP void fromSM_ECC_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Elliptical Simple Mercator coordinates to geographic.
DECL_EXP bool GetEnableChartBar(int CanvasIndex)
Gets chart bar visibility state.
DECL_EXP wxFont GetOCPNGUIScaledFont_PlugIn(wxString item)
Gets a uniquely scaled font copy for responsive UI elements.
DECL_EXP double DistGreatCircle_Plugin(double slat, double slon, double dlat, double dlon)
Calculates great circle distance between two points.
CommDriverResult
Error return values
@ RESULT_COMM_INVALID_PARMS
Invalid parameters provided to operation.
@ RESULT_COMM_REGISTER_GATEWAY_ERROR
Failed to register with gateway device.
@ RESULT_COMM_TX_ERROR
Error occurred during transmission.
@ RESULT_COMM_REGISTER_PGN_ERROR
Failed to register PGN parameters.
@ RESULT_COMM_NO_ERROR
Operation completed successfully.
@ RESULT_COMM_INVALID_HANDLE
Invalid or unknown driver handle specified.
DECL_EXP void RequestWindowRefresh(wxWindow *win, bool eraseBackground)
Requests window refresh.
DECL_EXP bool UpdateChartDBInplace(wxArrayString dir_array, bool b_force_update, bool b_ProgressDialog)
Updates chart database in place.
DECL_EXP wxString GetLocaleCanonicalName()
Gets system locale canonical name.
DECL_EXP bool GetEnableDepthUnitDisplay(int CanvasIndex)
Gets depth unit display state.
enum OptionsParentPI _OptionsParentPI
Enum defining parent pages in OpenCPN options dialog where plugins can add panels.
DECL_EXP void SetToolbarItemState(int item, bool toggle)
Sets toolbar item toggle state.
DECL_EXP bool UpdatePlugInRoute(PlugIn_Route *proute)
Updates an existing route.
DECL_EXP bool AddLocaleCatalog(wxString catalog)
Adds a locale catalog for translations.
int DECL_EXP PI_PLIBRenderObjectToDC(wxDC *pdc, PI_S57Obj *pObj, PlugIn_ViewPort *vp)
Renders an S57 object using standard device context.
DECL_EXP _OCPN_DLStatus OCPN_downloadFile(const wxString &url, const wxString &outputFile, const wxString &title, const wxString &message, const wxBitmap &bitmap, wxWindow *parent, long style, int timeout_secs)
Synchronously downloads a file with progress dialog.
void DECL_EXP PI_PLIBSetLineFeaturePriority(PI_S57Obj *pObj, int prio)
Sets rendering priority for line feature.
enum _PI_DisPrio PI_DisPrio
Display priority levels for S52 chart objects.
DECL_EXP void EnableCurrentStationsDisplay(bool enable, int CanvasIndex)
Controls current station icon display.
DECL_EXP wxArrayString GetIconNameArray(void)
Gets array of available waypoint icons.
DECL_EXP void toTM_Plugin(float lat, float lon, float lat0, float lon0, double *x, double *y)
Converts geographic coordinates to Transverse Mercator projection.
DECL_EXP bool GetGlobalColor(wxString colorName, wxColour *pcolour)
Gets a global color value.
DECL_EXP bool GetSingleWaypointEx(wxString GUID, PlugIn_Waypoint_Ex *pwaypoint)
Gets extended waypoint data by GUID.
DECL_EXP int PlatformFileSelectorDialog(wxWindow *parent, wxString *file_spec, wxString Title, wxString initDir, wxString suggestedName, wxString wildcard)
Shows platform-optimized file selector dialog.
DECL_EXP PI_DisCat GetENCDisplayCategory(int CanvasIndex)
Gets current ENC display category.
void DECL_EXP PI_UpdateContext(PI_S57Obj *pObj)
Updates rendering context for S57 object.
DECL_EXP int AddCanvasContextMenuItem(wxMenuItem *pitem, opencpn_plugin *pplugin)
Adds item to chart canvas context menu.
DECL_EXP double fromUsrSpeed_Plugin(double usr_speed, int unit=-1)
Converts from user's preferred speed unit to knots.
DECL_EXP _OCPN_DLStatus OCPN_postDataHttp(const wxString &url, const wxString &parameters, wxString &result, int timeout_secs)
Performs HTTP POST request.
DECL_EXP wxString GetActiveRouteGUID(void)
Gets GUID of currently active route.
DECL_EXP void RequestRefresh(wxWindow *)
Requests window refresh.
void DECL_EXP PI_PLIBPrepareForNewRender(void)
Prepares PLIB for new rendering pass.
DECL_EXP PI_NavMode GetNavigationMode(int CanvasIndex)
Gets current navigation mode for a canvas.
DECL_EXP void SetCanvasRotation(double rotation)
Sets chart display rotation angle.
DECL_EXP void PlugInMultMatrixViewport(PlugIn_ViewPort *vp, float lat=0, float lon=0)
Applies viewport transformation matrix.
DECL_EXP double toUsrDepth_Plugin(double m_depth, int unit=-1)
Converts meters to user's preferred depth unit.
DECL_EXP PI_Comm_Status GetConnState(const std::string &iface, PI_Conn_Bus _bus)
Plugin polled Comm Status support.
int DECL_EXP PI_GetPLIBDepthUnitInt()
Gets configured depth unit for S52 display.
DECL_EXP wxArrayString GetWaypointGUIDArray(void)
Gets array of all waypoint/marks GUIDs.
DECL_EXP double toUsrTemp_Plugin(double cel_temp, int unit=-1)
Converts Celsius to user's preferred temperature unit.
DECL_EXP bool CheckEdgePan_PlugIn(int x, int y, bool dragging, int margin, int delta)
Checks if chart should pan when cursor near edge.
DECL_EXP wxString * GetpSharedDataLocation()
Gets shared application data location.
DECL_EXP double toUsrSpeed_Plugin(double kts_speed, int unit=-1)
Converts knots to user's preferred speed unit.
DECL_EXP bool GetEnableBuoyLightLabelsDisplay(int CanvasIndex)
Gets buoy/light label visibility.
_OCPN_DLCondition
Event types for HTTP file download operations.
@ OCPN_DL_EVENT_TYPE_UNKNOWN
Unknown event type.
@ OCPN_DL_EVENT_TYPE_PROGRESS
Download progress update.
@ OCPN_DL_EVENT_TYPE_END
Download has completed.
@ OCPN_DL_EVENT_TYPE_START
Download is starting.
DECL_EXP bool DeleteOptionsPage(wxScrolledWindow *page)
Remove a previously added options page.
DECL_EXP void EnableTenHertzUpdate(bool enable)
Enable or disable 10 Hz update rate.
DECL_EXP void EnableLightDescriptionsDisplay(bool enable, int CanvasIndex)
Controls light description text display.
DECL_EXP bool AddPlugInRouteEx(PlugIn_Route_Ex *proute, bool b_permanent=true)
Adds a route with extended features.
bool DECL_EXP PI_PLIBObjectRenderCheck(PI_S57Obj *pObj, PlugIn_ViewPort *vp)
Checks if object should be rendered.
DECL_EXP void GetCanvasPixLL(PlugIn_ViewPort *vp, wxPoint *pp, double lat, double lon)
Converts lat/lon to canvas physical pixel coordinates.
DECL_EXP bool PlugIn_GSHHS_CrossesLand(double lat1, double lon1, double lat2, double lon2)
Checks if a great circle route crosses land.
ChartTypeEnumPI
Enumeration of chart types.
@ PI_CHART_TYPE_PLUGIN
Chart type provided by a plugin.
@ PI_CHART_TYPE_CM93COMP
CM93 Composite vector chart format.
@ PI_CHART_TYPE_CM93
CM93 vector chart format.
@ PI_CHART_TYPE_S57
S-57 vector chart format.
@ PI_CHART_TYPE_UNKNOWN
Chart type is unknown or undefined.
@ PI_CHART_TYPE_DONTCARE
Chart type is not important for the operation.
@ PI_CHART_TYPE_KAP
BSB/KAP raster chart format.
@ PI_CHART_TYPE_DUMMY
Dummy chart used when no actual chart is available.
@ PI_CHART_TYPE_GEO
GEO raster chart format.
DECL_EXP int GetChartbarHeight(void)
Gets height of chart bar in pixels.
DECL_EXP wxString GetNewGUID()
Generates a new globally unique identifier (GUID).
PI_ColorScheme
Enumeration of color schemes.
@ PI_GLOBAL_COLOR_SCHEME_DAY
Day color scheme, optimized for bright ambient light.
@ PI_GLOBAL_COLOR_SCHEME_NIGHT
Night color scheme, optimized for dark conditions with minimal impact on night vision.
@ PI_N_COLOR_SCHEMES
Number of color schemes, used for bounds checking.
@ PI_GLOBAL_COLOR_SCHEME_RGB
RGB color scheme, unmodified colors.
@ PI_GLOBAL_COLOR_SCHEME_DUSK
Dusk color scheme, optimized for low ambient light.
DECL_EXP wxString toSDMM_PlugIn(int NEflag, double a, bool hi_precision=true)
Convert decimal degrees to a formatted string.
DECL_EXP void SetEnableMainToolbar(bool enable)
Show or hide the main toolbar.
enum _OCPN_DLCondition OCPN_DLCondition
Event types for HTTP file download operations.
DECL_EXP wxString GetActiveStyleName()
Gets name of currently active style sheet.
DECL_EXP void EnableAisTargetDisplay(bool enable, int CanvasIndex)
Controls AIS target display.
DECL_EXP void ZeroXTE()
Resets cross track error to zero.
DECL_EXP void SetENCDisplayCategory(PI_DisCat cat, int CanvasIndex)
Sets ENC (Electronic Navigation Chart) feature display category.
DECL_EXP wxString GetOCPN_ExePath(void)
Gets OpenCPN executable path.
int DECL_EXP OCPNMessageBox_PlugIn(wxWindow *parent, const wxString &message, const wxString &caption=_T("Message"), int style=wxOK, int x=-1, int y=-1)
Shows a message box dialog.
DECL_EXP wxString * GetpPlugInLocation()
Gets plugins directory location.
DECL_EXP std::string GetN2000Source(NMEA2000Id id, ObservedEvt ev)
Return source identifier (iface) of a received n2000 message of type id in ev.
DECL_EXP int GetLatLonFormat(void)
Gets currently selected latitude/longitude display format.
PI_NotificationSeverity
Plugin Notification Framework support.
DECL_EXP std::shared_ptr< void > GetSignalkPayload(ObservedEvt ev)
Get SignalK status payload after receiving a message.
DECL_EXP double OCPN_GetWinDIPScaleFactor()
Gets Windows-specific DPI scaling factor.
DECL_EXP std::shared_ptr< ObservableListener > GetListener(NMEA2000Id id, wxEventType ev, wxEvtHandler *handler)
Gets listener for NMEA 2000 messages.
DECL_EXP wxWindow * GetCanvasUnderMouse()
Gets canvas window under mouse cursor.
DECL_EXP void EnableBuoyLightLabelsDisplay(bool enable, int CanvasIndex)
Controls buoy/light name label display.
int DECL_EXP PI_PLIBRenderAreaToDC(wxDC *pdc, PI_S57Obj *pObj, PlugIn_ViewPort *vp, wxRect rect, unsigned char *pixbuf)
Renders an S57 area object using standard device context.
DECL_EXP void SetGlobalColor(std::string table, std::string name, wxColor color)
Sets a color in the global color scheme.
DECL_EXP void PushNMEABuffer(wxString str)
Pushes NMEA sentence to the system.
DECL_EXP bool OCPN_isOnline()
Checks internet connectivity.
DECL_EXP void SetCanvasContextMenuItemGrey(int item, bool grey)
Sets menu item enabled/disabled state.
DECL_EXP std::unique_ptr< PlugIn_Waypoint > GetWaypoint_Plugin(const wxString &)
Gets waypoint details by GUID.
enum PI_InitReturn _PI_InitReturn
Return values for plugin initialization.
DECL_EXP void CanvasJumpToPosition(wxWindow *canvas, double lat, double lon, double scale)
Centers specified canvas on given position at given scale.
DECL_EXP double fromUsrTemp_Plugin(double usr_temp, int unit=-1)
Converts from user's preferred temperature unit to Celsius.
DECL_EXP bool GetEnableMenu()
Gets menu bar visibility state.
bool DECL_EXP PI_GetObjectRenderBox(PI_S57Obj *pObj, double *lat_min, double *lat_max, double *lon_min, double *lon_max)
Gets geographic bounding box of S57 object.
_OCPN_DLStatus
Status codes for HTTP file download operations.
@ OCPN_DL_NO_ERROR
Download completed successfully.
@ OCPN_DL_USER_TIMEOUT
Download timed out waiting for user action.
@ OCPN_DL_STARTED
Download has begun but not yet complete.
@ OCPN_DL_FAILED
Download failed (general error)
@ OCPN_DL_UNKNOWN
Unknown or uninitialized status.
@ OCPN_DL_ABORTED
Download was cancelled by user.
SDDMFORMAT
Coordinate format options for lat/lon display.
@ DEGREES_DECIMAL_MINUTES
Format like "50° 12.345' N".
@ DEGREES_MINUTES_SECONDS
Format like "50° 12' 34.5" N".
@ DECIMAL_DEGREES
Format like "50.12345° N".
@ END_SDDMFORMATS
Number of available formats.
DECL_EXP bool IsTouchInterface_PlugIn(void)
Checks if touch interface mode is enabled.
DECL_EXP wxString GetPlugInPath(opencpn_plugin *pplugin)
Gets the installation path for a specific plugin.
DECL_EXP double GetCanvasTilt()
Gets current canvas tilt angle.
DECL_EXP bool GetEnableAisTargetDisplay(int CanvasIndex)
Gets AIS target display state.
OCPN_DLDialogStyle
@ OCPN_DLDS_CONN_SETTINGS_AUTH
The dialog allows the user to change the authentication settings.
@ OCPN_DLDS_CAN_START
The transfer won't start automatically.
@ OCPN_DLDS_URL
The dialog shows the URL involved in the transfer.
@ OCPN_DLDS_AUTO_CLOSE
The dialog auto closes when transfer is complete.
@ OCPN_DLDS_CAN_ABORT
The transfer can be aborted by the user.
@ OCPN_DLDS_ESTIMATED_TIME
The dialog shows the estimated total time.
@ OCPN_DLDS_SIZE
The dialog shows the size of the resource to download/upload.
@ OCPN_DLDS_CONN_SETTINGS_PROXY
The dialog allows the user to change the proxy settings.
@ OCPN_DLDS_REMAINING_TIME
The dialog shows the remaining time.
@ OCPN_DLDS_SPEED
The dialog shows the transfer speed.
@ OCPN_DLDS_ELAPSED_TIME
The dialog shows the elapsed time.
@ OCPN_DLDS_CAN_PAUSE
The transfer can be paused.
@ OCPN_DLDS_CONN_SETTINGS_PORT
The dialog allows the user to change the port for the transfer.
DECL_EXP void RemoveCanvasMenuItem(int item, const char *name="")
Removes a context menu item completely.
DECL_EXP void EnableStatusBar(bool enable)
Shows/hides the status bar.
ChartFamilyEnumPI
Enumeration of chart families (broad categories).
@ PI_CHART_FAMILY_UNKNOWN
Chart family is unknown.
@ PI_CHART_FAMILY_VECTOR
Vector chart formats (S-57, CM93, etc.)
@ PI_CHART_FAMILY_RASTER
Raster chart formats (KAP, GEO, etc.)
@ PI_CHART_FAMILY_DONTCARE
Chart family is not important for the operation.
DECL_EXP void EnableChartOutlines(bool enable, int CanvasIndex)
Controls chart outline display.
DECL_EXP bool UpdatePlugInRouteExV2(PlugIn_Route_ExV2 *proute)
Updates existing route with V2 waypoints.
DECL_EXP wxString GetWritableDocumentsDir(void)
Returns the platform-specific default documents directory.
DECL_EXP wxString GetSelectedTrackGUID_Plugin()
Gets GUID of currently selected track.
DECL_EXP bool GetEnableTenHertzUpdate()
Check if 10 Hz update rate is enabled.
DECL_EXP std::unique_ptr< PlugIn_Route_ExV2 > GetRouteExV2_Plugin(const wxString &GUID)
Gets route details with V2 waypoints by GUID.
DECL_EXP bool DeletePlugInRoute(wxString &GUID)
Deletes a route.
DECL_EXP void GetDoubleCanvasPixLL(PlugIn_ViewPort *vp, wxPoint2DDouble *pp, double lat, double lon)
Converts lat/lon to canvas pixels with double precision.
DECL_EXP bool GetFullScreen()
Gets full screen state.
DECL_EXP bool PluginGetFollowMode(int CanvasIndex)
Get the current follow mode status for a specific canvas.
DECL_EXP bool GetSingleWaypoint(wxString GUID, PlugIn_Waypoint *pwaypoint)
Gets waypoint data by GUID.
enum _PI_LUPname PI_LUPname
Name identifiers for S57 lookup table sets.
DECL_EXP double OCPN_GetDisplayContentScaleFactor()
Gets content scaling factor for current display.
DECL_EXP double fromUsrDepth_Plugin(double usr_depth, int unit=-1)
Converts from user's preferred depth unit to meters.
DECL_EXP bool UpdatePlugInTrack(PlugIn_Track *ptrack)
Updates an existing track.
DECL_EXP wxArrayString GetTrackGUIDArray(void)
Gets array of track GUIDs.
DECL_EXP bool GetEnableLightsDisplay(int CanvasIndex)
Gets light icon visibility.
int DECL_EXP PI_GetPLIBStateHash()
Gets hash value representing current PLIB state.
DECL_EXP double toUsrDistance_Plugin(double nm_distance, int unit=-1)
Converts nautical miles to user's preferred distance unit.
DECL_EXP bool GetActiveRoutepointGPX(char *buffer, unsigned int buffer_length)
Gets GPX representation of active route waypoint.
DECL_EXP wxBitmap * FindSystemWaypointIcon(wxString &icon_name)
Finds built-in system waypoint icon.
DECL_EXP void ExitOCPN()
Exits OpenCPN application.
DECL_EXP int PlugInGetMinAvailableGshhgQuality()
Gets minimum available GSHHS coastline data quality.
DECL_EXP bool GetEnableLookaheadMode(int CanvasIndex)
Gets look-ahead mode state for a canvas.
DECL_EXP wxString getUsrTempUnit_Plugin(int unit=-1)
Gets display string for user's preferred temperature unit.
DECL_EXP double fromDMM_PlugIn(wxString sdms)
Parse a formatted coordinate string to get decimal degrees.
DECL_EXP int PlugInGetMaxAvailableGshhgQuality()
Gets maximum available GSHHS coastline data quality.
ChartDepthUnitTypePI
Enumeration of depth unit types used in charts.
@ PI_DEPTH_UNIT_METERS
Depths shown in meters.
@ PI_DEPTH_UNIT_UNKNOWN
Depth unit is unknown or not specified.
@ PI_DEPTH_UNIT_FATHOMS
Depths shown in fathoms.
@ PI_DEPTH_UNIT_FEET
Depths shown in feet.
DECL_EXP bool PlugInHasNormalizedViewPort(PlugIn_ViewPort *vp)
Checks if viewport has been normalized.
DECL_EXP bool AddSingleWaypoint(PlugIn_Waypoint *pwaypoint, bool b_permanent=true)
Adds a single waypoint.
DECL_EXP double fromUsrWindSpeed_Plugin(double usr_wspeed, int unit=-1)
Converts from user's preferred wind speed unit to knots.
DECL_EXP bool PlugInSetFontColor(const wxString TextElement, const wxColour color)
Sets text color for a UI element.
DECL_EXP wxString getUsrWindSpeedUnit_Plugin(int unit=-1)
Gets display string for user's preferred wind speed unit.
DECL_EXP bool DeleteSingleWaypoint(wxString &GUID)
Deletes a single waypoint.
DECL_EXP bool ShuttingDown(void)
Checks if OpenCPN is in shutdown process.
DECL_EXP void EnableDepthUnitDisplay(bool enable, int CanvasIndex)
Controls depth unit display.
DECL_EXP void PlugInAISDrawGL(wxGLCanvas *glcanvas, const PlugIn_ViewPort &vp)
Renders AIS targets on a secondary OpenGL canvas.
DECL_EXP void PlugInHandleAutopilotRoute(bool enable)
Controls autopilot route handling.
DECL_EXP void EnableMUIBar(bool enable, int CanvasIndex)
Controls visibility of MUI (Mobile/Touch User Interface) bar.
DECL_EXP void JumpToPosition(double lat, double lon, double scale)
Centers chart display on specified position at given scale.
DECL_EXP CommDriverResult WriteCommDriver(DriverHandle handle, const std::shared_ptr< std::vector< uint8_t > > &payload)
Send a non-NMEA2000 message.
DECL_EXP int PlatformDirSelectorDialog(wxWindow *parent, wxString *file_spec, wxString Title, wxString initDir)
Shows platform-optimized directory selector dialog.
DECL_EXP std::string GetN0183Payload(NMEA0183Id id, ObservedEvt ev)
Return payload in a received n0183 message of type id in ev.
wxString DECL_EXP PI_GetPLIBColorScheme()
Gets current color scheme used by S52 PLIB.
DECL_EXP void SetToolbarToolBitmaps(int item, wxBitmap *bitmap, wxBitmap *bmpRollover)
Updates toolbar tool bitmaps.
DECL_EXP bool GetTrackingMode()
Get the current tracking mode status.
std::string DriverHandle
Plugin API supporting direct access to comm drivers for output purposes.
PI_LUPname DECL_EXP PI_GetObjectLUPName(PI_S57Obj *pObj)
Gets Look-Up Table (LUP) name for object.
DECL_EXP bool AddPersistentFontKey(wxString TextElement)
Registers a new font configuration element.
enum _OCPN_DLStatus OCPN_DLStatus
Status codes for HTTP file download operations.
DECL_EXP bool AddPlugInRouteExV2(PlugIn_Route_ExV2 *proute, bool b_permanent=true)
Adds a new route with V2 waypoints.
DECL_EXP wxAuiManager * GetFrameAuiManager(void)
Gets main frame AUI manager.
DECL_EXP void PlugInNormalizeViewport(PlugIn_ViewPort *vp, float lat=0, float lon=0)
Normalizes viewport parameters.
DECL_EXP wxString getUsrDistanceUnit_Plugin(int unit=-1)
Gets display string for user's preferred distance unit.
struct _ExtentPI ExtentPI
Geographic extent structure defining a bounding box.
DECL_EXP wxFileConfig * GetOCPNConfigObject(void)
Gets OpenCPN's configuration object.
DECL_EXP bool AddCustomWaypointIcon(wxBitmap *pimage, wxString key, wxString description)
Adds a custom waypoint icon.
DECL_EXP wxString toUsrDateTimeFormat_Plugin(const wxDateTime date_time, const DateTimeFormatOptions &options=DateTimeFormatOptions())
Format a date/time to a localized string representation, conforming to the global date/time format an...
DECL_EXP wxRect GetMasterToolbarRect()
Gets bounding rectangle of master toolbar.
DECL_EXP wxWindow * PluginGetOverlayRenderCanvas()
Gets the canvas currently designated for overlay rendering.
DECL_EXP void EnableLookaheadMode(bool enable, int CanvasIndex)
Enables/disables look-ahead mode for a canvas.
DECL_EXP void OCPN_cancelDownloadFileBackground(long handle)
Cancels a background download.
DECL_EXP PI_ColorScheme GetAppColorScheme()
Get the current application color scheme.
DECL_EXP PluginNavdata GetEventNavdata(ObservedEvt ev)
Return BasicNavDataMsg decoded data available in ev.
DECL_EXP bool UpdateSingleWaypointExV2(PlugIn_Waypoint_ExV2 *pwaypoint)
Updates an existing extended V2 waypoint.
DECL_EXP int AddChartToDBInPlace(wxString &full_path, bool b_RefreshCanvas)
Adds a chart to the database without full rebuild.
DECL_EXP void toSM_Plugin(double lat, double lon, double lat0, double lon0, double *x, double *y)
Converts geographic coordinates to Simple Mercator projection.
DECL_EXP wxString getUsrDepthUnit_Plugin(int unit=-1)
Gets display string for user's preferred depth unit.
DECL_EXP void EnableMenu(bool enable)
Shows/hides the main menu bar.
DECL_EXP wxFont * OCPNGetFont(wxString TextElement, int default_size=0)
Gets a font for UI elements.
DECL_EXP int GetGlobalWatchdogTimoutSeconds()
Gets global watchdog timeout value.
DECL_EXP void SetTrackingMode(bool enable)
Enable or disable tracking mode.
enum ChartTypeEnumPI _ChartTypeEnumPI
Enumeration of chart types.
DECL_EXP std::shared_ptr< PI_Notification > GetNotificationMsgPayload(NotificationMsgId id, ObservedEvt ev)
Retrieve the Notification Event in a Notification message.
enum OcpnProjTypePI _OcpnProjTypePI
Enumeration of chart projection types.
DECL_EXP bool GetEnableStatusBar()
Gets status bar visibility state.
DECL_EXP float GetOCPNChartScaleFactor_Plugin()
Gets chart rendering scale factor.
void DECL_EXP PI_PLIBFreeContext(void *pContext)
Frees S52 PLIB context.
DECL_EXP bool GetEnableChartOutlines(int CanvasIndex)
Gets chart outline visibility state.
DECL_EXP std::unique_ptr< PlugIn_Track > GetTrack_Plugin(const wxString &)
Gets track details by GUID.
DECL_EXP bool AddPlugInRoute(PlugIn_Route *proute, bool b_permanent=true)
Adds a new route.
DECL_EXP std::vector< uint8_t > GetN2000Payload(NMEA2000Id id, ObservedEvt ev)
Return N2K payload for a received n2000 message of type id in ev.
DECL_EXP wxColour GetFontColour_PlugIn(wxString TextElement)
Gets color configured for a UI text element.
DECL_EXP bool GetEnableMainToolbar()
Check if the main toolbar is enabled.
enum ChartFamilyEnumPI _ChartFamilyEnumPI
Enumeration of chart families (broad categories).
DECL_EXP wxFont * FindOrCreateFont_PlugIn(int point_size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline=false, const wxString &facename=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
Creates or finds a font in the font cache.
DECL_EXP void SetCanvasContextMenuItemViz(int item, bool viz)
Temporarily changes context menu item visibility.
DECL_EXP bool PlugInPlaySoundEx(wxString &sound_file, int deviceIndex=-1)
Start playing a sound file asynchronously.
DECL_EXP wxBitmap GetIcon_PlugIn(const wxString &name)
Gets icon bitmap by name.
DECL_EXP double toUsrWindSpeed_Plugin(double kts_wspeed, int unit=-1)
Converts knots to user's preferred wind speed unit.
DECL_EXP wxWindow * GetOCPNCanvasWindow()
Gets OpenCPN's main canvas window.
_PI_NavMode
Navigation mode options for chart display orientation.
@ PI_NORTH_UP_MODE
North Up Mode - True north is always at the top of the display.
@ PI_COURSE_UP_MODE
Course Up Mode - Current course over ground at the top.
@ PI_HEAD_UP_MODE
Head Up Mode - Current vessel heading at the top.
DECL_EXP void SetMUICursor_PlugIn(wxCursor *pCursor, int canvasIndex)
Sets mouse cursor for specific canvas.
DECL_EXP const std::unordered_map< std::string, std::string > GetAttributes(DriverHandle handle)
Query a specific driver for attributes.
DECL_EXP int InsertPlugInTool(wxString label, wxBitmap *bitmap, wxBitmap *bmpRollover, wxItemKind kind, wxString shortHelp, wxString longHelp, wxObject *clientData, int position, int tool_sel, opencpn_plugin *pplugin)
Adds a tool to OpenCPN's toolbar.
DECL_EXP void ConfigFlushAndReload()
Flush configuration changes to disk and reload settings.
DECL_EXP bool AddSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypoint, bool b_permanent=true)
Adds a waypoint with extended properties.
DECL_EXP bool GetEnableLatLonGrid(int CanvasIndex)
Gets latitude/longitude grid visibility state.
_PI_DisPrio
Display priority levels for S52 chart objects.
@ PI_PRIO_AREA_2
Superimposed areas including water features.
@ PI_PRIO_NUM
Number of priority levels.
@ PI_PRIO_AREA_1
Superimposed areas.
@ PI_PRIO_MARINERS
VRM, EBL, own ship (highest priority)
@ PI_PRIO_SYMB_POINT
Point symbols including land features.
@ PI_PRIO_ROUTEING
Routeing lines (TSS, recommended tracks)
@ PI_PRIO_GROUP1
S57 group 1 filled areas (land, etc)
@ PI_PRIO_SYMB_AREA
Area symbols including traffic areas.
@ PI_PRIO_SYMB_LINE
Line symbols including restricted areas.
@ PI_PRIO_NODATA
No data fill area pattern (lowest priority)
@ PI_PRIO_HAZARDS
Hazards, buoys, beacons.
bool DECL_EXP PI_PLIBSetContext(PI_S57Obj *pObj)
Sets S52 PLIB rendering context for an object.
DECL_EXP bool UpdatePlugInRouteEx(PlugIn_Route_Ex *proute)
Updates an existing extended route.
DECL_EXP std::vector< DriverHandle > GetActiveDrivers()
Query OCPN core for a list of active drivers
DECL_EXP void SetCursor_PlugIn(wxCursor *pPlugin_Cursor=NULL)
Sets mouse cursor.
enum CommDriverResult _CommDriverResult
Error return values
DECL_EXP void PositionBearingDistanceMercator_Plugin(double lat, double lon, double brg, double dist, double *dlat, double *dlon)
Calculates destination point given start point, bearing and distance.
DECL_EXP std::unique_ptr< PlugIn_Route > GetRoute_Plugin(const wxString &)
Gets route details by GUID.
_PI_DisCat
Display categories for S52 chart features.
@ PI_DISP_CAT_NUM
Number of categories (for array sizing)
@ PI_OTHER
Other - additional features for detailed navigation.
@ PI_MARINERS_OTHER
Additional mariner specified features.
@ PI_DISPLAYBASE
Display Base - features that must always be shown.
@ PI_STANDARD
Standard - default features for safe navigation.
@ PI_MARINERS_STANDARD
Mariner specified standard features.
DECL_EXP bool DecodeSingleVDOMessage(const wxString &str, PlugIn_Position_Fix_Ex *pos, wxString *acc)
Decodes a single VDO (Own Ship AIS) message.
PI_DisPrio DECL_EXP PI_GetObjectDisplayPriority(PI_S57Obj *pObj)
Gets display priority for object.
DECL_EXP double PlugInGetDisplaySizeMM()
Gets physical display size in millimeters.
DECL_EXP std::string GetPluginMsgPayload(PluginMsgId id, ObservedEvt ev)
Retrieve the string in a plugin message, internal or received on the REST insterface.
DECL_EXP double fromUsrDistance_Plugin(double usr_distance, int unit=-1)
Converts from user's preferred distance unit to nautical miles.
DECL_EXP wxWindow * PluginGetFocusCanvas()
Gets the currently focused chart canvas.
int DECL_EXP PI_PLIBRenderAreaToGL(const wxGLContext &glcc, PI_S57Obj *pObj, PlugIn_ViewPort *vp, wxRect &render_rect)
Renders an S57 area object using OpenGL.
DECL_EXP bool UpdateSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypoint)
Updates an existing extended waypoint.
DECL_EXP void SetFullScreen(bool full_screen_on)
Sets full screen mode.
DECL_EXP void PluginCenterOwnship(int CanvasIndex)
Center the chart view on the own ship position for a specific canvas.
DECL_EXP double GetOCPNGUIToolScaleFactor_PlugIn()
Gets current global GUI scaling factor.
DECL_EXP wxString GetSelectedRouteGUID_Plugin()
Gets GUID of currently selected route.
DECL_EXP void DistanceBearingMercator_Plugin(double lat0, double lon0, double lat1, double lon1, double *brg, double *dist)
Calculates bearing and distance between two points.
DECL_EXP std::unique_ptr< PlugIn_Waypoint_Ex > GetWaypointEx_Plugin(const wxString &GUID)
Gets extended waypoint by GUID.
DECL_EXP wxColor GetGlobalColorD(std::string map_name, std::string name)
Gets a color from the global color scheme.
enum _PI_NavMode PI_NavMode
Navigation mode options for chart display orientation.
DECL_EXP void ShowGlobalSettingsDialog()
Display the global settings dialog.
DECL_EXP void SetToolbarToolBitmapsSVG(int item, wxString SVGfile, wxString SVGfileRollover, wxString SVGfileToggled)
Updates SVG graphics for toolbar tool.
DECL_EXP void PlugInPlaySound(wxString &sound_file)
Plays a sound file asynchronously.
_PI_LUPname
Name identifiers for S57 lookup table sets.
@ PI_PLAIN_BOUNDARIES
Area objects with simple boundaries.
@ PI_PAPER_CHART
Point objects using traditional paper chart symbols.
@ PI_LINES
Line objects (e.g., depth contours, coastlines)
@ PI_LUPNAME_NUM
Total number of lookup table types.
@ PI_SIMPLIFIED
Point objects using simplified symbols.
@ PI_SYMBOLIZED_BOUNDARIES
Area objects with symbolized boundaries.
DECL_EXP std::vector< std::string > GetPriorityMaps()
Gets list of configured priority mapping schemes.
DECL_EXP ArrayOfPlugIn_AIS_Targets * GetAISTargetArray(void)
Gets array of AIS targets.
DECL_EXP void EnableSplitScreenLayout(bool enable=true)
Enable or disable the split-screen layout.
DECL_EXP bool UpdateSingleWaypoint(PlugIn_Waypoint *pwaypoint)
Updates a single waypoint.
DECL_EXP void SetCanvasProjection(int projection)
Sets chart projection type.
DECL_EXP bool AddPlugInTrack(PlugIn_Track *ptrack, bool b_permanent=true)
Adds a new track.
DECL_EXP int InsertPlugInToolSVG(wxString label, wxString SVGfile, wxString SVGfileRollover, wxString SVGfileToggled, wxItemKind kind, wxString shortHelp, wxString longHelp, wxObject *clientData, int position, int tool_sel, opencpn_plugin *pplugin)
Adds a tool using SVG graphics.
DECL_EXP wxString getUsrSpeedUnit_Plugin(int unit=-1)
Gets display string for user's preferred speed unit.
wxColour DECL_EXP GetBaseGlobalColor(wxString colorName)
Gets a global system color.
DECL_EXP bool GetEnableENCTextDisplay(int CanvasIndex)
Gets ENC text label visibility.
DECL_EXP bool GetEnableCompassGPSIcon(int CanvasIndex)
Gets compass icon visibility state.
OcpnProjTypePI
Enumeration of chart projection types.
@ PI_PROJECTION_UNKNOWN
Projection type is unknown or undefined.
@ PI_PROJECTION_MERCATOR
Mercator projection, standard for navigation charts.
@ PI_PROJECTION_STEREOGRAPHIC
Stereographic projection, used for polar and specialty charts.
@ PI_PROJECTION_GNOMONIC
Gnomonic projection, in which great circles appear as straight lines.
@ PI_PROJECTION_POLAR
Polar projection, used for polar regions.
@ PI_PROJECTION_POLYCONIC
Polyconic projection, sometimes used for inland charts.
@ PI_PROJECTION_TRANSVERSE_MERCATOR
Transverse Mercator projection, used for some coastal charts.
@ PI_PROJECTION_ORTHOGRAPHIC
Orthographic projection, showing Earth as viewed from space.
@ PI_PROJECTION_EQUIRECTANGULAR
Equirectangular/Plate Carrée projection, simple lat/lon grid.
DECL_EXP bool GetEnableMUIBar(int CanvasIndex)
Gets MUI bar visibility state.
DECL_EXP bool CheckMUIEdgePan_PlugIn(int x, int y, bool dragging, int margin, int delta, int canvasIndex)
Checks if chart should pan when cursor near edge.
DECL_EXP void EnableTouchMode(bool enable)
Enables/disables touch interface mode.
DECL_EXP void PluginZoomCanvas(int CanvasIndex, double factor)
Zoom a specific chart canvas by the given factor.
DECL_EXP wxString GetActiveWaypointGUID(void)
Gets GUID of currently active waypoint.
DECL_EXP bool AddSingleWaypointExV2(PlugIn_Waypoint_ExV2 *pwaypoint, bool b_permanent=true)
Adds a waypoint with extended V2 properties.
DECL_EXP void GetCanvasLLPix(PlugIn_ViewPort *vp, wxPoint p, double *plat, double *plon)
Converts canvas physical pixel coordinates to lat/lon.
DECL_EXP bool GetEnableLightDescriptionsDisplay(int CanvasIndex)
Gets light description text visibility.
enum _OBJECT_LAYER_REQ OBJECT_LAYER_REQ
Filter options for object queries.
DECL_EXP CommDriverResult RegisterTXPGNs(DriverHandle handle, std::vector< int > &pgn_list)
Register PGNs that this application intends to transmit for some NMEA 2000 adapters like Actisense NG...
DECL_EXP void SendPluginMessage(wxString message_id, wxString message_body)
Sends message to other plugins.
DECL_EXP wxString * GetpPrivateApplicationDataLocation()
Gets private application data directory.
DECL_EXP wxDialog * GetActiveOptionsDialog()
Gets pointer to active options dialog.
DECL_EXP void SetAppColorScheme(PI_ColorScheme cs)
Set the application color scheme.
DECL_EXP bool DeletePlugInTrack(wxString &GUID)
Deletes a track.
DECL_EXP bool GetEnableCurrentStationsDisplay(int CanvasIndex)
Gets current station icon visibility.
DECL_EXP int AddCanvasMenuItem(wxMenuItem *pitem, opencpn_plugin *pplugin, const char *name="")
Adds item to canvas context menu.
int DECL_EXP PI_PLIBRenderObjectToGL(const wxGLContext &glcc, PI_S57Obj *pObj, PlugIn_ViewPort *vp, wxRect &render_rect)
Renders any S57 object using OpenGL.
DECL_EXP bool GetEnableTideStationsDisplay(int CanvasIndex)
Gets tide station icon visibility.
DECL_EXP void SetCanvasMenuItemViz(int item, bool viz, const char *name="")
Temporarily changes context menu item visibility.
DECL_EXP void SetCanvasTilt(double tilt)
Gets current canvas tilt angle.
DECL_EXP std::vector< std::string > GetActivePriorityIdentifiers()
Gets list of active priority identifiers.
DECL_EXP void fromSM_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Simple Mercator coordinates to geographic.
DECL_EXP int GetCanvasCount()
Gets total number of chart canvases.
DECL_EXP void PluginSetFollowMode(int CanvasIndex, bool enable_follow)
Set follow mode for a specific canvas.
double DECL_EXP PI_GetPLIBMarinerSafetyContour()
Gets configured safety contour depth.
DECL_EXP void EnableLightsDisplay(bool enable, int CanvasIndex)
Controls light icon display.
PI_InitReturn
Return values for plugin initialization.
@ PI_INIT_OK
Initialization successful.
@ PI_INIT_FAIL_NOERROR
Init failed, request no explicit error message.
@ PI_INIT_FAIL_RETRY
Init failed, retry suggested.
@ PI_INIT_FAIL_REMOVE
Init failed, suggest remove from further use.
DECL_EXP void fromTM_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Transverse Mercator coordinates to geographic.
PI_DisCat DECL_EXP PI_GetObjectDisplayCategory(PI_S57Obj *pObj)
Gets display category for object.
DECL_EXP int RemoveChartFromDBInPlace(wxString &full_path)
Removes a chart from database without full rebuild.
DECL_EXP _OCPN_DLStatus OCPN_downloadFileBackground(const wxString &url, const wxString &outputFile, wxEvtHandler *handler, long *handle)
Asynchronously downloads a file in the background.
DECL_EXP wxString GetPluginDataDir(const char *plugin_name)
Returns an installed plugin's data directory given a plugin name.
DECL_EXP wxScrolledWindow * AddOptionsPage(OptionsParentPI parent, wxString title)
Adds a new preferences page to OpenCPN options dialog.
DECL_EXP bool GetTouchMode()
Gets touch interface mode state.
DECL_EXP wxString GetSelectedWaypointGUID_Plugin()
Gets GUID of currently selected waypoint.
DECL_EXP void ForceChartDBRebuild()
Forces complete rebuild of chart database.
OptionsParentPI
Enum defining parent pages in OpenCPN options dialog where plugins can add panels.
@ PI_OPTIONS_PARENT_DISPLAY
Display settings section.
@ PI_OPTIONS_PARENT_UI
User Interface section.
@ PI_OPTIONS_PARENT_SHIPS
Ships section.
@ PI_OPTIONS_PARENT_CHARTS
Charts section.
@ PI_OPTIONS_PARENT_PLUGINS
Plugins section.
@ PI_OPTIONS_PARENT_CONNECTIONS
Connections section.
DECL_EXP void SetToolbarToolViz(int item, bool viz)
Temporarily changes toolbar tool visibility.
int DECL_EXP PI_GetPLIBSymbolStyle()
Gets configured S52 symbol style.
DECL_EXP void EnableCompassGPSIcon(bool enable, int CanvasIndex)
Controls visibility of compass/GPS status icon.
int DECL_EXP PI_GetPLIBBoundaryStyle()
Gets configured S52 boundary style.
Configuration options for date and time formatting.
bool show_timezone
Whether to show timezone information in the formatted date/time string.
wxString format_string
The format string for date/time.
DateTimeFormatOptions & SetFormatString(const wxString &fmt)
Sets the date/time format pattern string.
DateTimeFormatOptions & SetShowTimezone(bool show)
Sets whether to show timezone information in the formatted output.
DateTimeFormatOptions & SetTimezone(const wxString &tz)
Sets the timezone mode for date/time display.
wxString time_zone
The timezone to use when formatting the date/time.
DateTimeFormatOptions & SetLongitude(double lon)
Sets the reference longitude for Local Mean Time (LMT) calculations.
double longitude
The longitude to use when formatting the date/time in Local Mean Time (LMT).
Identifier for NMEA 0183 sentence types.
const std::string id
Sentence identifier.
NMEA0183Id(const std::string &s)
Creates identifier from sentence type.
Identifier for NMEA 2000 message types.
const uint64_t id
The PGN value.
NMEA2000Id(int value)
Creates identifier from PGN value.
Navigation data message identifier.
const int type
Message type identifier (currently only 0 supported)
NavDataId()
Default constructor.
Facade for NotificationMsg.
Facade for NavAddrPluginMsg.
Basic navigation data structure.
double var
Magnetic variation in degrees.
double cog
Course over ground in degrees.
double lon
Longitude in decimal degrees.
double lat
Latitude in decimal degrees.
double sog
Speed over ground in knots.
double hdt
True heading in degrees.
time_t time
UTC timestamp of data.
Identifier for Signal K paths.
SignalkId(const std::string &s)
Creates identifier from Signal K path.
const std::string id
Signal K path.
Geographic extent structure defining a bounding box.
double NLAT
Northern latitude boundary in decimal degrees.
double WLON
Western longitude boundary in decimal degrees.
double SLAT
Southern latitude boundary in decimal degrees.
double ELON
Eastern longitude boundary in decimal degrees.