30#if defined(__WXMSW__) || defined(__CYGWIN__)
31#define DECL_EXP __declspec(dllexport)
32#elif defined __GNUC__ && __GNUC__ >= 4
33#define DECL_EXP __attribute__((visibility("default")))
34#elif defined __WXOSX__
35#define DECL_EXP __attribute__((visibility("default")))
41#if defined(__WXMSW__) && defined(MAKING_PLUGIN)
42#define DECL_IMP __declspec(dllimport)
47#include <wx/xml/xml.h>
48#include <wx/dcmemory.h>
51#include <wx/menuitem.h>
60#include <unordered_map>
68#define API_VERSION_MAJOR 1
69#define API_VERSION_MINOR 18
76class wxScrolledWindow;
84#define WANTS_OVERLAY_CALLBACK 0x00000001
85#define WANTS_CURSOR_LATLON 0x00000002
86#define WANTS_TOOLBAR_CALLBACK 0x00000004
87#define INSTALLS_TOOLBAR_TOOL 0x00000008
88#define WANTS_CONFIG 0x00000010
89#define INSTALLS_TOOLBOX_PAGE 0x00000020
90#define INSTALLS_CONTEXTMENU_ITEMS 0x00000040
91#define WANTS_NMEA_SENTENCES 0x00000080
92#define WANTS_NMEA_EVENTS 0x00000100
93#define WANTS_AIS_SENTENCES 0x00000200
94#define USES_AUI_MANAGER 0x00000400
95#define WANTS_PREFERENCES 0x00000800
96#define INSTALLS_PLUGIN_CHART 0x00001000
97#define WANTS_ONPAINT_VIEWPORT 0x00002000
98#define WANTS_PLUGIN_MESSAGING 0x00004000
99#define WANTS_OPENGL_OVERLAY_CALLBACK 0x00008000
100#define WANTS_DYNAMIC_OPENGL_OVERLAY_CALLBACK 0x00010000
101#define WANTS_LATE_INIT 0x00020000
102#define INSTALLS_PLUGIN_CHART_GL 0x00040000
103#define WANTS_MOUSE_EVENTS 0x00080000
104#define WANTS_VECTOR_CHART_OBJECT_INFO 0x00100000
105#define WANTS_KEYBOARD_EVENTS 0x00200000
112#define OVERLAY_LEGACY 0
113#define OVERLAY_OVER_SHIPS 64
114#define OVERLAY_OVER_EMBOSS 96
115#define OVERLAY_OVER_UI 128
121 PI_GLOBAL_COLOR_SCHEME_RGB,
122 PI_GLOBAL_COLOR_SCHEME_DAY,
123 PI_GLOBAL_COLOR_SCHEME_DUSK,
124 PI_GLOBAL_COLOR_SCHEME_NIGHT,
132 double view_scale_ppm;
142 int m_projection_type;
144 double lat_min, lat_max, lon_min, lon_max;
183enum plugin_ais_alarm_type {
186 PI_AIS_ALARM_ACKNOWLEDGED
203 unsigned char ShipType;
214 plugin_ais_alarm_type alarm_state;
218typedef enum ChartTypeEnumPI {
219 PI_CHART_TYPE_UNKNOWN = 0,
221 PI_CHART_TYPE_DONTCARE,
226 PI_CHART_TYPE_CM93COMP,
231typedef enum ChartFamilyEnumPI {
232 PI_CHART_FAMILY_UNKNOWN = 0,
233 PI_CHART_FAMILY_RASTER,
234 PI_CHART_FAMILY_VECTOR,
235 PI_CHART_FAMILY_DONTCARE
239typedef enum ChartDepthUnitTypePI {
240 PI_DEPTH_UNIT_UNKNOWN,
242 PI_DEPTH_UNIT_METERS,
243 PI_DEPTH_UNIT_FATHOMS
244} _ChartDepthUnitTypePI;
247typedef enum OcpnProjTypePI {
248 PI_PROJECTION_UNKNOWN,
249 PI_PROJECTION_MERCATOR,
250 PI_PROJECTION_TRANSVERSE_MERCATOR,
251 PI_PROJECTION_POLYCONIC,
253 PI_PROJECTION_ORTHOGRAPHIC,
255 PI_PROJECTION_STEREOGRAPHIC,
256 PI_PROJECTION_GNOMONIC,
257 PI_PROJECTION_EQUIRECTANGULAR
268#define PI_FULL_INIT 0
269#define PI_HEADER_ONLY 1
270#define PI_THUMB_ONLY 2
283 virtual wxString GetFileSearchMask(
void);
285 virtual int Init(
const wxString &full_path,
int init_flags);
286 virtual void SetColorScheme(
int cs,
bool bApplyImmediate);
288 virtual double GetNormalScaleMin(
double canvas_scale_factor,
289 bool b_allow_overzoom);
290 virtual double GetNormalScaleMax(
double canvas_scale_factor,
292 virtual double GetNearestPreferredScalePPM(
double target_scale_ppm);
294 virtual bool GetChartExtent(
ExtentPI *pext);
297 const wxRegion &Region);
302 wxRegion *pValidRegion);
304 virtual int GetCOVREntries() {
return 0; }
305 virtual int GetCOVRTablePoints(
int iTable) {
return 0; }
306 virtual int GetCOVRTablenPoints(
int iTable) {
return 0; }
307 virtual float *GetCOVRTableHead(
int iTable) {
return (
float *)NULL; }
309 virtual wxBitmap *GetThumbnail(
int tnx,
int tny,
int cs);
313 virtual wxString GetFullPath()
const {
return m_FullPath; }
314 virtual ChartTypeEnumPI GetChartType() {
return m_ChartType; }
315 virtual ChartFamilyEnumPI GetChartFamily() {
return m_ChartFamily; }
316 virtual OcpnProjTypePI GetChartProjection() {
return m_projection; }
317 virtual wxString GetName() {
return m_Name; }
318 virtual wxString GetDescription() {
return m_Description; }
319 virtual wxString GetID() {
return m_ID; }
320 virtual wxString GetSE() {
return m_SE; }
321 virtual wxString GetDepthUnits() {
return m_DepthUnits; }
322 virtual wxString GetSoundingsDatum() {
return m_SoundingsDatum; }
323 virtual wxString GetDatumString() {
return m_datum_str; }
324 virtual wxString GetExtraInfo() {
return m_ExtraInfo; }
325 virtual wxString GetPubDate() {
return m_PubYear; }
326 virtual double GetChartErrorFactor() {
return m_Chart_Error_Factor; }
327 virtual ChartDepthUnitTypePI GetDepthUnitId() {
return m_depth_unit_id; }
328 virtual bool IsReadyToRender() {
return m_bReadyToRender; }
329 virtual int GetNativeScale() {
return m_Chart_Scale; };
330 virtual double GetChartSkew() {
return m_Chart_Skew; }
331 virtual wxDateTime GetEditionDate(
void) {
return m_EdDate; }
335 wxRect *pSourceRect);
336 virtual double GetRasterScaleFactor();
337 virtual bool GetChartBits(wxRect &source,
unsigned char *pPix,
int sub_samp);
338 virtual int GetSize_X();
339 virtual int GetSize_Y();
340 virtual void latlong_to_chartpix(
double lat,
double lon,
double &pixx,
342 virtual void chartpix_to_latlong(
double pixx,
double pixy,
double *plat,
346 ChartTypeEnumPI m_ChartType;
347 ChartFamilyEnumPI m_ChartFamily;
350 OcpnProjTypePI m_projection;
355 bool m_bReadyToRender;
358 wxString m_Description;
361 wxString m_SoundingsDatum;
362 wxString m_datum_str;
364 wxString m_DepthUnits;
365 wxString m_ExtraInfo;
367 ChartDepthUnitTypePI m_depth_unit_id;
369 double m_Chart_Error_Factor;
396 virtual int Init(
void);
397 virtual bool DeInit(
void);
399 virtual int GetAPIVersionMajor();
400 virtual int GetAPIVersionMinor();
401 virtual int GetPlugInVersionMajor();
402 virtual int GetPlugInVersionMinor();
403 virtual wxBitmap *GetPlugInBitmap();
408 virtual wxString GetCommonName();
409 virtual wxString GetShortDescription();
410 virtual wxString GetLongDescription();
415 virtual void SetDefaults(
419 virtual int GetToolbarToolCount(
void);
421 virtual int GetToolboxPanelCount(
void);
422 virtual void SetupToolboxPanel(
int page_sel, wxNotebook *pnotebook);
423 virtual void OnCloseToolboxPanel(
int page_sel,
int ok_apply_cancel);
425 virtual void ShowPreferencesDialog(wxWindow *parent);
428 virtual void SetCursorLatLon(
double lat,
double lon);
432 virtual void SetNMEASentence(wxString &sentence);
433 virtual void SetAISSentence(wxString &sentence);
435 virtual void ProcessParentResize(
int x,
int y);
436 virtual void SetColorScheme(PI_ColorScheme cs);
438 virtual void OnToolbarToolCallback(
int id);
439 virtual void OnContextMenuItemCallback(
int id);
441 virtual void UpdateAuiStatus(
void);
443 virtual wxArrayString GetDynamicChartClassNameArray(
void);
451#pragma clang diagnostic push
452#pragma clang diagnostic ignored "-Woverloaded-virtual"
462 virtual void SetPluginMessage(wxString &message_id, wxString &message_body);
471 virtual bool RenderGLOverlay(wxGLContext *pcontext,
PlugIn_ViewPort *vp);
473 virtual void SetPluginMessage(wxString &message_id, wxString &message_body);
482 virtual bool RenderGLOverlay(wxGLContext *pcontext,
PlugIn_ViewPort *vp);
483 virtual void SetPluginMessage(wxString &message_id, wxString &message_body);
488#pragma clang diagnostic pop
496 virtual void OnSetupOptions(
void);
504 virtual void LateInit(
void);
518 virtual bool MouseEventHook(wxMouseEvent &event);
519 virtual void SendVectorChartObjectInfo(wxString &chart, wxString &feature,
520 wxString &objname,
double lat,
521 double lon,
double scale,
530 virtual bool KeyboardEventHook(wxKeyEvent &event);
531 virtual void OnToolbarToolDownCallback(
int id);
532 virtual void OnToolbarToolUpCallback(
int id);
551 virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext,
555 virtual void PrepareContextMenu(
int canvasIndex);
565 virtual int GetPlugInVersionPatch();
568 virtual int GetPlugInVersionPost();
571 virtual const char *GetPlugInVersionPre();
574 virtual const char *GetPlugInVersionBuild();
591 virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext,
602 int canvasIndex,
int priority = -1);
622 const wxString &wp_name,
const wxString &GUID = _T(
""));
631 wxString m_MarkDescription;
632 wxDateTime m_CreateTime;
637 Plugin_HyperlinkList *m_HyperlinkList;
647 wxString m_NameString;
648 wxString m_StartString;
649 wxString m_EndString;
652 Plugin_WaypointList *pWaypointList;
660 wxString m_NameString;
661 wxString m_StartString;
662 wxString m_EndString;
665 Plugin_WaypointList *pWaypointList;
676extern "C" DECL_EXP
int InsertPlugInTool(wxString label, wxBitmap *bitmap,
677 wxBitmap *bmpRollover, wxItemKind kind,
678 wxString shortHelp, wxString longHelp,
679 wxObject *clientData,
int position,
681extern "C" DECL_EXP
void RemovePlugInTool(
int tool_id);
682extern "C" DECL_EXP
void SetToolbarToolViz(
684extern "C" DECL_EXP
void SetToolbarItemState(
int item,
bool toggle);
685extern "C" DECL_EXP
void SetToolbarToolBitmaps(
int item, wxBitmap *bitmap,
686 wxBitmap *bmpRollover);
688extern "C" DECL_EXP
int InsertPlugInToolSVG(
689 wxString label, wxString SVGfile, wxString SVGfileRollover,
690 wxString SVGfileToggled, wxItemKind kind, wxString shortHelp,
691 wxString longHelp, wxObject *clientData,
int position,
int tool_sel,
693extern "C" DECL_EXP
void SetToolbarToolBitmapsSVG(
int item, wxString SVGfile,
694 wxString SVGfileRollover,
695 wxString SVGfileToggled);
697extern "C" DECL_EXP
int AddCanvasContextMenuItem(wxMenuItem *pitem,
699extern "C" DECL_EXP
void RemoveCanvasContextMenuItem(
701extern "C" DECL_EXP
void SetCanvasContextMenuItemViz(
703extern "C" DECL_EXP
void SetCanvasContextMenuItemGrey(
int item,
bool grey);
705extern "C" DECL_EXP wxFileConfig *GetOCPNConfigObject(
void);
707extern "C" DECL_EXP
void RequestRefresh(wxWindow *);
708extern "C" DECL_EXP
bool GetGlobalColor(wxString colorName, wxColour *pcolour);
710extern "C" DECL_EXP
void GetCanvasPixLL(
PlugIn_ViewPort *vp, wxPoint *pp,
711 double lat,
double lon);
713 double *plat,
double *plon);
715extern "C" DECL_EXP wxWindow *GetOCPNCanvasWindow();
717extern "C" DECL_EXP wxFont *OCPNGetFont(wxString TextElement,
int default_size);
719extern "C" DECL_EXP wxString *GetpSharedDataLocation();
721extern "C" DECL_EXP ArrayOfPlugIn_AIS_Targets *GetAISTargetArray(
void);
723extern "C" DECL_EXP wxAuiManager *GetFrameAuiManager(
void);
725extern "C" DECL_EXP
bool AddLocaleCatalog(wxString catalog);
727extern "C" DECL_EXP
void PushNMEABuffer(wxString str);
729extern DECL_EXP wxXmlDocument GetChartDatabaseEntryXML(
int dbIndex,
732extern DECL_EXP
bool UpdateChartDBInplace(wxArrayString dir_array,
734 bool b_ProgressDialog);
735extern DECL_EXP wxArrayString GetChartDBDirArrayString();
737extern "C" DECL_EXP
void SendPluginMessage(wxString message_id,
738 wxString message_body);
740extern "C" DECL_EXP
void DimeWindow(wxWindow *);
742extern "C" DECL_EXP
void JumpToPosition(
double lat,
double lon,
double scale);
748extern "C" DECL_EXP
void PositionBearingDistanceMercator_Plugin(
749 double lat,
double lon,
double brg,
double dist,
double *dlat,
751extern "C" DECL_EXP
void DistanceBearingMercator_Plugin(
752 double lat0,
double lon0,
double lat1,
double lon1,
double *brg,
754extern "C" DECL_EXP
double DistGreatCircle_Plugin(
double slat,
double slon,
755 double dlat,
double dlon);
757extern "C" DECL_EXP
void toTM_Plugin(
float lat,
float lon,
float lat0,
758 float lon0,
double *x,
double *y);
759extern "C" DECL_EXP
void fromTM_Plugin(
double x,
double y,
double lat0,
760 double lon0,
double *lat,
double *lon);
761extern "C" DECL_EXP
void toSM_Plugin(
double lat,
double lon,
double lat0,
762 double lon0,
double *x,
double *y);
763extern "C" DECL_EXP
void fromSM_Plugin(
double x,
double y,
double lat0,
764 double lon0,
double *lat,
double *lon);
765extern "C" DECL_EXP
void toSM_ECC_Plugin(
double lat,
double lon,
double lat0,
766 double lon0,
double *x,
double *y);
767extern "C" DECL_EXP
void fromSM_ECC_Plugin(
double x,
double y,
double lat0,
768 double lon0,
double *lat,
771extern "C" DECL_EXP
bool DecodeSingleVDOMessage(
const wxString &str,
774extern "C" DECL_EXP
int GetChartbarHeight(
void);
775extern "C" DECL_EXP
bool GetActiveRoutepointGPX(
char *buffer,
776 unsigned int buffer_length);
779typedef enum OptionsParentPI {
780 PI_OPTIONS_PARENT_DISPLAY,
781 PI_OPTIONS_PARENT_CONNECTIONS,
782 PI_OPTIONS_PARENT_CHARTS,
783 PI_OPTIONS_PARENT_SHIPS,
784 PI_OPTIONS_PARENT_UI,
785 PI_OPTIONS_PARENT_PLUGINS
787extern DECL_EXP wxScrolledWindow *AddOptionsPage(OptionsParentPI parent,
789extern DECL_EXP
bool DeleteOptionsPage(wxScrolledWindow *page);
795extern "C" DECL_EXP
double toUsrDistance_Plugin(
double nm_distance,
797extern "C" DECL_EXP
double fromUsrDistance_Plugin(
double usr_distance,
799extern "C" DECL_EXP
double toUsrSpeed_Plugin(
double kts_speed,
int unit = -1);
800extern "C" DECL_EXP
double fromUsrSpeed_Plugin(
double usr_speed,
int unit = -1);
801extern "C" DECL_EXP
double toUsrTemp_Plugin(
double cel_temp,
int unit = -1);
802extern "C" DECL_EXP
double fromUsrTemp_Plugin(
double usr_temp,
int unit = -1);
803extern DECL_EXP wxString getUsrDistanceUnit_Plugin(
int unit = -1);
804extern DECL_EXP wxString getUsrSpeedUnit_Plugin(
int unit = -1);
805extern DECL_EXP wxString getUsrTempUnit_Plugin(
int unit = -1);
806extern DECL_EXP wxString GetNewGUID();
807extern "C" DECL_EXP
bool PlugIn_GSHHS_CrossesLand(
double lat1,
double lon1,
808 double lat2,
double lon2);
813extern DECL_EXP
void PlugInPlaySound(wxString &sound_file);
816extern DECL_EXP wxBitmap *FindSystemWaypointIcon(wxString &icon_name);
817extern DECL_EXP
bool AddCustomWaypointIcon(wxBitmap *pimage, wxString key,
818 wxString description);
821 bool b_permanent =
true);
822extern DECL_EXP
bool DeleteSingleWaypoint(wxString &GUID);
825extern DECL_EXP
bool AddPlugInRoute(
PlugIn_Route *proute,
826 bool b_permanent =
true);
827extern DECL_EXP
bool DeletePlugInRoute(wxString &GUID);
828extern DECL_EXP
bool UpdatePlugInRoute(
PlugIn_Route *proute);
830extern DECL_EXP
bool AddPlugInTrack(
PlugIn_Track *ptrack,
831 bool b_permanent =
true);
832extern DECL_EXP
bool DeletePlugInTrack(wxString &GUID);
833extern DECL_EXP
bool UpdatePlugInTrack(
PlugIn_Track *ptrack);
839wxColour DECL_EXP GetBaseGlobalColor(wxString colorName);
840int DECL_EXP OCPNMessageBox_PlugIn(wxWindow *parent,
const wxString &message,
841 const wxString &caption = _T(
"Message"),
842 int style = wxOK,
int x = -1,
int y = -1);
844extern DECL_EXP wxString toSDMM_PlugIn(
int NEflag,
double a,
845 bool hi_precision =
true);
847extern "C" DECL_EXP wxString *GetpPrivateApplicationDataLocation();
848extern DECL_EXP wxString GetOCPN_ExePath(
void);
849extern "C" DECL_EXP wxString *GetpPlugInLocation();
852extern "C" DECL_EXP
int AddChartToDBInPlace(wxString &full_path,
853 bool b_RefreshCanvas);
854extern "C" DECL_EXP
int RemoveChartFromDBInPlace(wxString &full_path);
855extern DECL_EXP wxString GetLocaleCanonicalName();
863#define PLIB_CAPS_LINE_VBO 1
864#define PLIB_CAPS_LINE_BUFFER 1 << 1
865#define PLIB_CAPS_SINGLEGEO_BUFFER 1 << 2
866#define PLIB_CAPS_OBJSEGLIST 1 << 3
867#define PLIB_CAPS_OBJCATMUTATE 1 << 4
871WX_DECLARE_LIST(
PI_S57Obj, ListOfPI_S57Obj);
883 virtual int RenderRegionViewOnGL(
const wxGLContext &glc,
885 const wxRegion &Region,
bool b_use_stencil);
887 virtual ListOfPI_S57Obj *GetObjRuleListAtLatLon(
float lat,
float lon,
890 virtual wxString CreateObjDescriptions(ListOfPI_S57Obj *obj_list);
892 virtual int GetNoCOVREntries();
893 virtual int GetNoCOVRTablePoints(
int iTable);
894 virtual int GetNoCOVRTablenPoints(
int iTable);
895 virtual float *GetNoCOVRTableHead(
int iTable);
908 virtual ListOfPI_S57Obj *GetLightsObjRuleListVisibleAtLatLon(
922 virtual int RenderRegionViewOnGL(
const wxGLContext &glc,
924 const wxRegion &Region,
bool b_use_stencil);
926 virtual wxBitmap &RenderRegionViewOnDCNoText(
const PlugIn_ViewPort &VPoint,
927 const wxRegion &Region);
928 virtual bool RenderRegionViewOnDCTextOnly(wxMemoryDC &dc,
930 const wxRegion &Region);
932 virtual int RenderRegionViewOnGLNoText(
const wxGLContext &glc,
934 const wxRegion &Region,
937 virtual int RenderRegionViewOnGLTextOnly(
const wxGLContext &glc,
939 const wxRegion &Region,
942 virtual ListOfPI_S57Obj *GetObjRuleListAtLatLon(
float lat,
float lon,
945 virtual wxString CreateObjDescriptions(ListOfPI_S57Obj *obj_list);
947 virtual int GetNoCOVREntries();
948 virtual int GetNoCOVRTablePoints(
int iTable);
949 virtual int GetNoCOVRTablenPoints(
int iTable);
950 virtual float *GetNoCOVRTableHead(
int iTable);
952 virtual void ClearPLIBTextList();
966 virtual ListOfPI_S57Obj *GetLightsObjRuleListVisibleAtLatLon(
970class wxArrayOfS57attVal;
973typedef enum _PI_LUPname {
975 PI_PAPER_CHART =
'R',
977 PI_PLAIN_BOUNDARIES =
'N',
978 PI_SYMBOLIZED_BOUNDARIES =
'O',
983typedef enum _PI_DisCat {
984 PI_DISPLAYBASE =
'D',
987 PI_MARINERS_STANDARD =
'M',
993typedef enum _PI_DisPrio {
994 PI_PRIO_NODATA =
'0',
995 PI_PRIO_GROUP1 =
'1',
996 PI_PRIO_AREA_1 =
'2',
997 PI_PRIO_AREA_2 =
'3',
998 PI_PRIO_SYMB_POINT =
'4',
999 PI_PRIO_SYMB_LINE =
'5',
1000 PI_PRIO_SYMB_AREA =
'6',
1001 PI_PRIO_ROUTEING =
'7',
1002 PI_PRIO_HAZARDS =
'8',
1003 PI_PRIO_MARINERS =
'9',
1008typedef enum PI_InitReturn {
1011 PI_INIT_FAIL_REMOVE,
1012 PI_INIT_FAIL_NOERROR
1037 char FeatureName[8];
1041 wxArrayOfS57attVal *attVal;
1061 double chart_ref_lat;
1062 double chart_ref_lon;
1078 int *m_lsindex_array;
1079 int m_n_edge_max_points;
1080 void *m_chart_context;
1082 PI_DisCat m_DisplayCat;
1102 bool m_bcategory_mutable;
1106wxString DECL_EXP PI_GetPLIBColorScheme();
1107int DECL_EXP PI_GetPLIBDepthUnitInt();
1108int DECL_EXP PI_GetPLIBSymbolStyle();
1109int DECL_EXP PI_GetPLIBBoundaryStyle();
1110int DECL_EXP PI_GetPLIBStateHash();
1111double DECL_EXP PI_GetPLIBMarinerSafetyContour();
1112bool DECL_EXP PI_GetObjectRenderBox(
PI_S57Obj *pObj,
double *lat_min,
1113 double *lat_max,
double *lon_min,
1115void DECL_EXP PI_UpdateContext(
PI_S57Obj *pObj);
1118PI_LUPname DECL_EXP PI_GetObjectLUPName(
PI_S57Obj *pObj);
1119PI_DisPrio DECL_EXP PI_GetObjectDisplayPriority(
PI_S57Obj *pObj);
1120PI_DisCat DECL_EXP PI_GetObjectDisplayCategory(
PI_S57Obj *pObj);
1121void DECL_EXP PI_PLIBSetLineFeaturePriority(
PI_S57Obj *pObj,
int prio);
1122void DECL_EXP PI_PLIBPrepareForNewRender(
void);
1123void DECL_EXP PI_PLIBFreeContext(
void *pContext);
1124void DECL_EXP PI_PLIBSetRenderCaps(
unsigned int flags);
1126bool DECL_EXP PI_PLIBSetContext(
PI_S57Obj *pObj);
1128int DECL_EXP PI_PLIBRenderObjectToDC(wxDC *pdc,
PI_S57Obj *pObj,
1130int DECL_EXP PI_PLIBRenderAreaToDC(wxDC *pdc,
PI_S57Obj *pObj,
1132 unsigned char *pixbuf);
1134int DECL_EXP PI_PLIBRenderAreaToGL(
const wxGLContext &glcc,
PI_S57Obj *pObj,
1137int DECL_EXP PI_PLIBRenderObjectToGL(
const wxGLContext &glcc,
PI_S57Obj *pObj,
1168 float lat = 0,
float lon = 0);
1169extern DECL_EXP
void PlugInNormalizeViewport(
PlugIn_ViewPort *vp,
float lat = 0,
1172class wxPoint2DDouble;
1174 wxPoint2DDouble *pp,
double lat,
1181extern DECL_EXP
double fromDMM_Plugin(wxString sdms);
1182extern DECL_EXP
void SetCanvasRotation(
double rotation);
1183extern DECL_EXP
void SetCanvasProjection(
int projection);
1184extern DECL_EXP
bool GetSingleWaypoint(wxString GUID,
1186extern DECL_EXP
bool CheckEdgePan_PlugIn(
int x,
int y,
bool dragging,
1187 int margin,
int delta);
1188extern DECL_EXP wxBitmap GetIcon_PlugIn(
const wxString &name);
1189extern DECL_EXP
void SetCursor_PlugIn(wxCursor *pPlugin_Cursor = NULL);
1190extern DECL_EXP wxFont *GetOCPNScaledFont_PlugIn(wxString TextElement,
1191 int default_size = 0);
1192extern DECL_EXP wxFont GetOCPNGUIScaledFont_PlugIn(wxString item);
1193extern DECL_EXP
double GetOCPNGUIToolScaleFactor_PlugIn(
int GUIScaledFactor);
1194extern DECL_EXP
double GetOCPNGUIToolScaleFactor_PlugIn();
1195extern DECL_EXP
float GetOCPNChartScaleFactor_Plugin();
1196extern DECL_EXP wxColour GetFontColour_PlugIn(wxString TextElement);
1198extern DECL_EXP
double GetCanvasTilt();
1199extern DECL_EXP
void SetCanvasTilt(
double tilt);
1206extern DECL_EXP
bool PlugInPlaySoundEx(wxString &sound_file,
1207 int deviceIndex = -1);
1208extern DECL_EXP
void AddChartDirectory(wxString &path);
1209extern DECL_EXP
void ForceChartDBUpdate();
1210extern DECL_EXP
void ForceChartDBRebuild();
1212extern DECL_EXP wxString GetWritableDocumentsDir(
void);
1213extern DECL_EXP wxDialog *GetActiveOptionsDialog();
1214extern DECL_EXP wxArrayString GetWaypointGUIDArray(
void);
1215extern DECL_EXP wxArrayString GetIconNameArray(
void);
1217extern DECL_EXP
bool AddPersistentFontKey(wxString TextElement);
1218extern DECL_EXP wxString GetActiveStyleName();
1220extern DECL_EXP wxBitmap GetBitmapFromSVGFile(wxString filename,
1222 unsigned int height);
1223extern DECL_EXP
bool IsTouchInterface_PlugIn(
void);
1226extern DECL_EXP
int PlatformDirSelectorDialog(wxWindow *parent,
1227 wxString *file_spec,
1228 wxString Title, wxString initDir);
1230extern DECL_EXP
int PlatformFileSelectorDialog(wxWindow *parent,
1231 wxString *file_spec,
1232 wxString Title, wxString initDir,
1233 wxString suggestedName,
1239typedef enum _OCPN_DLStatus {
1240 OCPN_DL_UNKNOWN = -1,
1241 OCPN_DL_NO_ERROR = 0,
1243 OCPN_DL_ABORTED = 2,
1244 OCPN_DL_USER_TIMEOUT = 4,
1248typedef enum _OCPN_DLCondition {
1249 OCPN_DL_EVENT_TYPE_UNKNOWN = -1,
1250 OCPN_DL_EVENT_TYPE_START = 80,
1251 OCPN_DL_EVENT_TYPE_PROGRESS = 81,
1252 OCPN_DL_EVENT_TYPE_END = 82
1257enum OCPN_DLDialogStyle {
1258 OCPN_DLDS_ELAPSED_TIME = 0x0001,
1259 OCPN_DLDS_ESTIMATED_TIME =
1261 OCPN_DLDS_REMAINING_TIME = 0x0004,
1262 OCPN_DLDS_SPEED = 0x0008,
1263 OCPN_DLDS_SIZE = 0x0010,
1270 OCPN_DLDS_CONN_SETTINGS_AUTH =
1273 OCPN_DLDS_CONN_SETTINGS_PORT = 0x0080,
1275 OCPN_DLDS_CONN_SETTINGS_PROXY =
1278 OCPN_DLDS_CONN_SETTINGS_ALL = OCPN_DLDS_CONN_SETTINGS_AUTH |
1279 OCPN_DLDS_CONN_SETTINGS_PORT |
1280 OCPN_DLDS_CONN_SETTINGS_PROXY,
1282 OCPN_DLDS_SHOW_ALL = OCPN_DLDS_ELAPSED_TIME | OCPN_DLDS_ESTIMATED_TIME |
1283 OCPN_DLDS_REMAINING_TIME | OCPN_DLDS_SPEED |
1284 OCPN_DLDS_SIZE | OCPN_DLDS_URL |
1285 OCPN_DLDS_CONN_SETTINGS_ALL,
1287 OCPN_DLDS_CAN_ABORT = 0x0200,
1288 OCPN_DLDS_CAN_START = 0x0400,
1290 OCPN_DLDS_CAN_PAUSE = 0x0800,
1292 OCPN_DLDS_AUTO_CLOSE =
1296 OCPN_DLDS_DEFAULT_STYLE = OCPN_DLDS_CAN_START | OCPN_DLDS_CAN_PAUSE |
1297 OCPN_DLDS_CAN_ABORT | OCPN_DLDS_SHOW_ALL |
1298 OCPN_DLDS_AUTO_CLOSE
1301#define ONLINE_CHECK_RETRY \
1306extern DECL_EXP _OCPN_DLStatus OCPN_downloadFile(
1307 const wxString &url,
const wxString &outputFile,
const wxString &title,
1308 const wxString &message,
const wxBitmap &bitmap, wxWindow *parent,
1309 long style,
int timeout_secs);
1313extern DECL_EXP _OCPN_DLStatus
1314OCPN_downloadFileBackground(
const wxString &url,
const wxString &outputFile,
1315 wxEvtHandler *handler,
long *handle);
1317extern DECL_EXP
void OCPN_cancelDownloadFileBackground(
long handle);
1321extern DECL_EXP _OCPN_DLStatus OCPN_postDataHttp(
const wxString &url,
1322 const wxString ¶meters,
1328extern DECL_EXP
bool OCPN_isOnline();
1352 _OCPN_DLStatus getDLEventStatus() {
return m_stat; }
1353 OCPN_DLCondition getDLEventCondition() {
return m_condition; }
1355 void setDLEventStatus(_OCPN_DLStatus stat) { m_stat = stat; }
1356 void setDLEventCondition(OCPN_DLCondition cond) { m_condition = cond; }
1358 void setTotal(
long bytes) { m_totalBytes = bytes; }
1359 void setTransferred(
long bytes) { m_sofarBytes = bytes; }
1360 long getTotal() {
return m_totalBytes; }
1361 long getTransferred() {
return m_sofarBytes; }
1363 void setComplete(
bool b_complete) { m_b_complete = b_complete; }
1364 bool getComplete() {
return m_b_complete; }
1367 wxEvent *Clone()
const;
1370 OCPN_DLStatus m_stat;
1371 OCPN_DLCondition m_condition;
1381extern DECL_IMP wxEventType wxEVT_DOWNLOAD_EVENT;
1383extern DECL_EXP wxEventType wxEVT_DOWNLOAD_EVENT;
1390bool LaunchDefaultBrowser_Plugin(wxString url);
1395extern DECL_EXP
void PlugInAISDrawGL(wxGLCanvas *glcanvas,
1397extern DECL_EXP
bool PlugInSetFontColor(
const wxString TextElement,
1398 const wxColour color);
1401extern DECL_EXP
double PlugInGetDisplaySizeMM();
1404extern DECL_EXP wxFont *FindOrCreateFont_PlugIn(
1405 int point_size, wxFontFamily family, wxFontStyle style, wxFontWeight weight,
1406 bool underline =
false,
const wxString &facename = wxEmptyString,
1407 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
1409extern DECL_EXP
int PlugInGetMinAvailableGshhgQuality();
1410extern DECL_EXP
int PlugInGetMaxAvailableGshhgQuality();
1412extern DECL_EXP
void PlugInHandleAutopilotRoute(
bool enable);
1431extern DECL_EXP wxString GetPluginDataDir(
const char *plugin_name);
1433extern DECL_EXP
bool ShuttingDown(
void);
1437extern DECL_EXP wxWindow *PluginGetFocusCanvas();
1438extern DECL_EXP wxWindow *PluginGetOverlayRenderCanvas();
1440extern "C" DECL_EXP
void CanvasJumpToPosition(wxWindow *canvas,
double lat,
1441 double lon,
double scale);
1442extern "C" DECL_EXP
int AddCanvasMenuItem(wxMenuItem *pitem,
1444 const char *name =
"");
1445extern "C" DECL_EXP
void RemoveCanvasMenuItem(
1446 int item,
const char *name =
"");
1447extern "C" DECL_EXP
void SetCanvasMenuItemViz(
1449 const char *name =
"");
1450extern "C" DECL_EXP
void SetCanvasMenuItemGrey(
int item,
bool grey,
1451 const char *name =
"");
1454extern DECL_EXP wxString GetSelectedWaypointGUID_Plugin();
1455extern DECL_EXP wxString GetSelectedRouteGUID_Plugin();
1456extern DECL_EXP wxString GetSelectedTrackGUID_Plugin();
1458extern DECL_EXP std::unique_ptr<PlugIn_Waypoint> GetWaypoint_Plugin(
1460extern DECL_EXP std::unique_ptr<PlugIn_Route> GetRoute_Plugin(
const wxString &);
1461extern DECL_EXP std::unique_ptr<PlugIn_Track> GetTrack_Plugin(
const wxString &);
1463extern DECL_EXP wxWindow *GetCanvasUnderMouse();
1464extern DECL_EXP
int GetCanvasIndexUnderMouse();
1466extern DECL_EXP wxWindow *GetCanvasByIndex(
int canvasIndex);
1467extern DECL_EXP
int GetCanvasCount();
1468extern DECL_EXP
bool CheckMUIEdgePan_PlugIn(
int x,
int y,
bool dragging,
1469 int margin,
int delta,
1471extern DECL_EXP
void SetMUICursor_PlugIn(wxCursor *pCursor,
int canvasIndex);
1475extern DECL_EXP wxRect GetMasterToolbarRect();
1478 DEGREES_DECIMAL_MINUTES = 0,
1480 DEGREES_MINUTES_SECONDS,
1484extern DECL_EXP
int GetLatLonFormat(
void);
1487extern "C" DECL_EXP
void ZeroXTE();
1494 const wxString &wp_name,
const wxString &GUID =
"",
1495 const double ScaMin = 1e9,
const bool bNameVisible =
false,
1496 const int nRanges = 0,
const double RangeDistance = 1.0,
1497 const wxColor RangeColor = wxColor(255, 0, 0));
1499 void InitDefaults();
1507 int GetRouteMembershipCount();
1515 wxString m_MarkName;
1516 wxString m_MarkDescription;
1517 wxDateTime m_CreateTime;
1525 double RangeRingSpace;
1526 wxColour RangeRingColor;
1529 wxString IconDescription;
1531 Plugin_HyperlinkList *m_HyperlinkList;
1541 wxString m_NameString;
1542 wxString m_StartString;
1543 wxString m_EndString;
1547 Plugin_WaypointExList *pWaypointList;
1550extern DECL_EXP wxArrayString GetRouteGUIDArray(
void);
1551extern DECL_EXP wxArrayString GetTrackGUIDArray(
void);
1553extern DECL_EXP
bool GetSingleWaypointEx(wxString GUID,
1557 bool b_permanent =
true);
1561 bool b_permanent =
true);
1564extern DECL_EXP std::unique_ptr<PlugIn_Waypoint_Ex> GetWaypointEx_Plugin(
1566extern DECL_EXP std::unique_ptr<PlugIn_Route_Ex> GetRouteEx_Plugin(
1569extern DECL_EXP wxString
1570GetActiveWaypointGUID(
void);
1571extern DECL_EXP wxString
1572GetActiveRouteGUID(
void);
1577extern DECL_EXP
double OCPN_GetDisplayContentScaleFactor();
1580extern DECL_EXP
double OCPN_GetWinDIPScaleFactor();
1583extern DECL_EXP std::vector<std::string> GetPriorityMaps();
1584extern DECL_EXP std::vector<std::string> GetActivePriorityIdentifiers();
1586extern DECL_EXP
int GetGlobalWatchdogTimoutSeconds();
1589typedef enum _OBJECT_LAYER_REQ {
1596extern DECL_EXP wxArrayString GetRouteGUIDArray(OBJECT_LAYER_REQ req);
1597extern DECL_EXP wxArrayString GetTrackGUIDArray(OBJECT_LAYER_REQ req);
1598extern DECL_EXP wxArrayString GetWaypointGUIDArray(OBJECT_LAYER_REQ req);
1609#ifndef OBSERVABLE_EVT_H
1610#define OBSERVABLE_EVT_H
1617 ObservedEvt(wxEventType commandType = obsNOTIFY,
int id = 0)
1618 : wxCommandEvent(commandType,
id) {}
1620 this->m_shared_ptr =
event.m_shared_ptr;
1623 wxEvent *Clone()
const {
return new ObservedEvt(*
this); }
1625 std::shared_ptr<const void> GetSharedPtr()
const {
return m_shared_ptr; }
1627 void SetSharedPtr(std::shared_ptr<const void> p) { m_shared_ptr = p; }
1630 std::shared_ptr<const void> m_shared_ptr;
1640 NMEA2000Id(
int value) : id(
static_cast<uint64_t
>(value)){};
1643extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
1644 NMEA2000Id id, wxEventType ev, wxEvtHandler *handler);
1648 const std::string id;
1652extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
1653 NMEA0183Id id, wxEventType ev, wxEvtHandler *handler);
1657 const std::string id;
1658 SignalkId(
const std::string &s) : id(s){};
1661extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
1662 SignalkId id, wxEventType ev, wxEvtHandler *handler);
1665extern DECL_EXP std::vector<uint8_t> GetN2000Payload(
NMEA2000Id id,
1680extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
1681 NavDataId id, wxEventType ev, wxEvtHandler *handler);
1716typedef std::string DriverHandle;
1720typedef enum CommDriverResult {
1721 RESULT_COMM_NO_ERROR = 0,
1722 RESULT_COMM_INVALID_HANDLE,
1723 RESULT_COMM_INVALID_PARMS,
1724 RESULT_COMM_TX_ERROR,
1725 RESULT_COMM_REGISTER_GATEWAY_ERROR,
1726 RESULT_COMM_REGISTER_PGN_ERROR
1730extern DECL_EXP std::vector<DriverHandle> GetActiveDrivers();
1746extern DECL_EXP
const std::unordered_map<std::string, std::string>
1747 GetAttributes(DriverHandle handle);
1756extern DECL_EXP CommDriverResult WriteCommDriver( DriverHandle handle,
1757 const std::shared_ptr <std::vector<uint8_t>> &payload);
1760extern DECL_EXP CommDriverResult WriteCommDriverN2K( DriverHandle handle,
int PGN,
1761 int destinationCANAddress,
int priority,
1762 const std::shared_ptr <std::vector<uint8_t>> &payload);
1771extern DECL_EXP CommDriverResult RegisterTXPGNs( DriverHandle handle, std::vector<int> &pgn_list);
Keeps listening over it's lifespan, removes itself on destruction.
Adds a std::shared<void> element to wxCommandEvent.
Facade for BasicNavDataMsg.
Available decoded data for plugins.
Facade for NavAddrSignalK.