diff -Nru opencpn-plugin-launcher-1.2/CMakeLists.txt opencpn-plugin-launcher-1.2/CMakeLists.txt --- opencpn-plugin-launcher-1.2/CMakeLists.txt 2019-03-09 15:31:21.000000000 +0000 +++ opencpn-plugin-launcher-1.2/CMakeLists.txt 2019-05-30 22:59:01.000000000 +0000 @@ -15,7 +15,7 @@ SET(CPACK_PACKAGE_CONTACT "Pavel Kalian") SET(VERSION_MAJOR "1") -SET(VERSION_MINOR "2") +SET(VERSION_MINOR "3") SET(NAME_SUFFIX "ov50") diff -Nru opencpn-plugin-launcher-1.2/debian/changelog opencpn-plugin-launcher-1.2/debian/changelog --- opencpn-plugin-launcher-1.2/debian/changelog 2019-03-09 15:31:21.000000000 +0000 +++ opencpn-plugin-launcher-1.2/debian/changelog 2019-05-30 22:59:01.000000000 +0000 @@ -1,8 +1,8 @@ -opencpn-plugin-launcher (1.2-0~201903091358~ubuntu18.10.1) cosmic; urgency=low +opencpn-plugin-launcher (1.2-0~201905302214~ubuntu18.10.1) cosmic; urgency=low * Auto build. - -- Pavel Kalian Sat, 09 Mar 2019 15:31:21 +0000 + -- Pavel Kalian Thu, 30 May 2019 22:59:01 +0000 opencpn-plugin-launcher (1.2-1) unstable; urgency=medium diff -Nru opencpn-plugin-launcher-1.2/debian/git-build-recipe.manifest opencpn-plugin-launcher-1.2/debian/git-build-recipe.manifest --- opencpn-plugin-launcher-1.2/debian/git-build-recipe.manifest 2019-03-09 15:31:21.000000000 +0000 +++ opencpn-plugin-launcher-1.2/debian/git-build-recipe.manifest 2019-05-30 22:59:01.000000000 +0000 @@ -1,2 +1,2 @@ -# git-build-recipe format 0.4 deb-version {debupstream}-0~201903091358 -lp:~nohal/launcher-pi/+git/master git-commit:4baa90b88dce1836c91cda0507615bf0e69e15a9 +# git-build-recipe format 0.4 deb-version {debupstream}-0~201905302214 +lp:~nohal/launcher-pi/+git/master git-commit:706dc20f0ae39526ba9ba928dcdfaaeac03d72d1 diff -Nru opencpn-plugin-launcher-1.2/src/launcher_pi.cpp opencpn-plugin-launcher-1.2/src/launcher_pi.cpp --- opencpn-plugin-launcher-1.2/src/launcher_pi.cpp 2019-03-09 15:31:21.000000000 +0000 +++ opencpn-plugin-launcher-1.2/src/launcher_pi.cpp 2019-05-30 22:59:01.000000000 +0000 @@ -258,11 +258,20 @@ m_window_pos_x = pConf->Read(_T ( "PosX" ), 0l); m_window_pos_y = pConf->Read(_T ( "PosY" ), 0l); - if (m_launcher_labels != wxEmptyString) { + if (m_launcher_labels != wxEmptyString || m_launcher_commands != wxEmptyString) { m_alauncher_labels = wxSplit(m_launcher_labels, ';', '\\'); m_alauncher_commands = wxSplit(m_launcher_commands, ';', '\\'); } + for (size_t i = 1; i <= wxMax(m_alauncher_labels.Count(), m_alauncher_commands.Count()); i++) { + if (m_alauncher_labels.Count() < i) { + m_alauncher_labels.Add(wxString::Format("Unknown %d", i)); + } + if (m_alauncher_commands.Count() < i) { + m_alauncher_commands.Add(wxString::Format("unknown%d", i)); + } + } + return true; } diff -Nru opencpn-plugin-launcher-1.2/src/LauncherSettingsDialog.cpp opencpn-plugin-launcher-1.2/src/LauncherSettingsDialog.cpp --- opencpn-plugin-launcher-1.2/src/LauncherSettingsDialog.cpp 2019-03-09 15:31:21.000000000 +0000 +++ opencpn-plugin-launcher-1.2/src/LauncherSettingsDialog.cpp 2019-05-30 22:59:01.000000000 +0000 @@ -77,7 +77,7 @@ m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton(this, wxID_OK); m_sdbSizer->AddButton(m_sdbSizerOK); - m_sdbSizerCancel = new wxButton(this, wxID_CANCEL); + m_sdbSizerCancel = new wxButton(this, wxID_CANCEL, _("Cancel")); m_sdbSizer->AddButton(m_sdbSizerCancel); m_sdbSizer->Realize(); @@ -244,7 +244,7 @@ m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton(this, wxID_OK); m_sdbSizer->AddButton(m_sdbSizerOK); - m_sdbSizerCancel = new wxButton(this, wxID_CANCEL); + m_sdbSizerCancel = new wxButton(this, wxID_CANCEL, _("Cancel")); m_sdbSizer->AddButton(m_sdbSizerCancel); m_sdbSizer->Realize(); diff -Nru opencpn-plugin-launcher-1.2/src/ocpn_plugin.h opencpn-plugin-launcher-1.2/src/ocpn_plugin.h --- opencpn-plugin-launcher-1.2/src/ocpn_plugin.h 2019-03-09 15:31:21.000000000 +0000 +++ opencpn-plugin-launcher-1.2/src/ocpn_plugin.h 2019-05-30 22:59:01.000000000 +0000 @@ -36,11 +36,16 @@ #endif #endif +#ifdef __WXMSW__ +#ifdef MAKING_PLUGIN +#define DECL_IMP __declspec(dllimport) +#endif +#endif + #include -#ifdef ocpnUSE_SVG -#include "wxsvg/include/wxSVG/svg.h" -#endif // ocpnUSE_SVG +#include +#include class wxGLContext; @@ -49,7 +54,7 @@ // PlugIns conforming to API Version less then the most modern will also // be correctly supported. #define API_VERSION_MAJOR 1 -#define API_VERSION_MINOR 13 +#define API_VERSION_MINOR 16 // Fwd Definitions class wxFileConfig; @@ -57,6 +62,7 @@ class wxFont; class wxAuiManager; class wxScrolledWindow; +class wxGLCanvas; //--------------------------------------------------------------------------------------------------------- // @@ -429,7 +435,6 @@ virtual bool RenderOverlay(wxDC &dc, PlugIn_ViewPort *vp); virtual bool RenderGLOverlay(wxGLContext *pcontext, PlugIn_ViewPort *vp); - virtual void SetPluginMessage(wxString &message_id, wxString &message_body); virtual void SetPositionFixEx(PlugIn_Position_Fix_Ex &pfix); }; @@ -476,6 +481,27 @@ virtual void OnToolbarToolUpCallback(int id); }; +class DECL_EXP opencpn_plugin_114 : public opencpn_plugin_113 { + public: + opencpn_plugin_114(void *pmgr); + virtual ~opencpn_plugin_114(); +}; + +class DECL_EXP opencpn_plugin_115 : public opencpn_plugin_114 { + public: + opencpn_plugin_115(void *pmgr); + virtual ~opencpn_plugin_115(); +}; + +class DECL_EXP opencpn_plugin_116 : public opencpn_plugin_115 { + public: + opencpn_plugin_116(void *pmgr); + virtual ~opencpn_plugin_116(); + virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext, PlugIn_ViewPort *vp, int canvasIndex); + virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp, int canvasIndex); + virtual void PrepareContextMenu(int canvasIndex); +}; + //------------------------------------------------------------------ // Route and Waypoint PlugIn support // @@ -642,6 +668,10 @@ extern DECL_EXP wxString getUsrSpeedUnit_Plugin(int unit = -1); extern DECL_EXP wxString GetNewGUID(); extern "C" DECL_EXP bool PlugIn_GSHHS_CrossesLand(double lat1, double lon1, double lat2, double lon2); +/** + * Start playing a sound file asynchronously. Supported formats depends + * on sound backend. + */ extern DECL_EXP void PlugInPlaySound(wxString &sound_file); // API 1.10 Route and Waypoint Support @@ -715,6 +745,39 @@ virtual float *GetNoCOVRTableHead(int iTable); }; +// ---------------------------------------------------------------------------- +// PlugInChartBaseExtended +// Derived from PlugInChartBase, add extended chart support methods +// ---------------------------------------------------------------------------- + +class DECL_EXP PlugInChartBaseExtended : public PlugInChartBase { + public: + PlugInChartBaseExtended(); + virtual ~PlugInChartBaseExtended(); + + virtual int RenderRegionViewOnGL(const wxGLContext &glc, const PlugIn_ViewPort &VPoint, const wxRegion &Region, + bool b_use_stencil); + + virtual wxBitmap &RenderRegionViewOnDCNoText(const PlugIn_ViewPort &VPoint, const wxRegion &Region); + virtual bool RenderRegionViewOnDCTextOnly(wxMemoryDC &dc, const PlugIn_ViewPort &VPoint, const wxRegion &Region); + + virtual int RenderRegionViewOnGLNoText(const wxGLContext &glc, const PlugIn_ViewPort &VPoint, const wxRegion &Region, + bool b_use_stencil); + + virtual int RenderRegionViewOnGLTextOnly(const wxGLContext &glc, const PlugIn_ViewPort &VPoint, const wxRegion &Region, + bool b_use_stencil); + + virtual ListOfPI_S57Obj *GetObjRuleListAtLatLon(float lat, float lon, float select_radius, PlugIn_ViewPort *VPoint); + virtual wxString CreateObjDescriptions(ListOfPI_S57Obj *obj_list); + + virtual int GetNoCOVREntries(); + virtual int GetNoCOVRTablePoints(int iTable); + virtual int GetNoCOVRTablenPoints(int iTable); + virtual float *GetNoCOVRTableHead(int iTable); + + virtual void ClearPLIBTextList(); +}; + class wxArrayOfS57attVal; // name of the addressed look up table set (fifth letter) @@ -932,6 +995,11 @@ extern DECL_EXP double GetCanvasTilt(); extern DECL_EXP void SetCanvasTilt(double tilt); +/** + * Start playing a sound file asynchronously. Supported formats depends + * on sound backend. The deviceIx is only used on platforms using the + * portaudio sound backend where -1 indicates the default device. + */ extern DECL_EXP bool PlugInPlaySoundEx(wxString &sound_file, int deviceIndex = -1); extern DECL_EXP void AddChartDirectory(wxString &path); extern DECL_EXP void ForceChartDBUpdate(); @@ -939,6 +1007,7 @@ extern DECL_EXP wxString GetWritableDocumentsDir(void); extern DECL_EXP wxDialog *GetActiveOptionsDialog(); extern DECL_EXP wxArrayString GetWaypointGUIDArray(void); +extern DECL_EXP wxArrayString GetIconNameArray(void); extern DECL_EXP bool AddPersistentFontKey(wxString TextElement); extern DECL_EXP wxString GetActiveStyleName(); @@ -1073,9 +1142,85 @@ bool m_b_complete; }; -// DECLARE_EVENT_TYPE(wxEVT_DOWNLOAD_EVENT, -1) -// extern const wxEventType DECL_EXP wxEVT_DOWNLOAD_EVENT; +// extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DOWNLOAD_EVENT; + +#ifdef MAKING_PLUGIN +extern DECL_IMP wxEventType wxEVT_DOWNLOAD_EVENT; +#else +extern DECL_EXP wxEventType wxEVT_DOWNLOAD_EVENT; +#endif + +// API 1.14 Extra canvas Support + +/* Allow drawing of objects onto other OpenGL canvases */ +extern DECL_EXP void PlugInAISDrawGL(wxGLCanvas *glcanvas, const PlugIn_ViewPort &vp); +extern DECL_EXP bool PlugInSetFontColor(const wxString TextElement, const wxColour color); + +// API 1.15 +extern DECL_EXP double PlugInGetDisplaySizeMM(); + +// +extern 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); + +extern DECL_EXP int PlugInGetMinAvailableGshhgQuality(); +extern DECL_EXP int PlugInGetMaxAvailableGshhgQuality(); + +extern DECL_EXP void PlugInHandleAutopilotRoute(bool enable); + +// API 1.16 +// +/** + * Return the plugin data directory for a given directory name. + * + * On Linux, the returned data path is an existing directory ending in + * "opencpn/plugins/" where the last part is the plugin_name + * argument. The prefix part is one of the directories listed in the + * environment variable XDG_DATA_DIRS, by default + * ~/.local/share:/usr/local/share:/usr/share. + * + * On other platforms, the returned value is GetSharedDataDir() + + * "/opencpn/plugins/" + plugin_name (with native path separators) + * if that path exists. + * + * Return "" if no existing directory is found. + */ +extern DECL_EXP wxString GetPluginDataDir(const char *plugin_name); + +extern DECL_EXP bool ShuttingDown(void); + +// Support for MUI MultiCanvas model + +extern DECL_EXP wxWindow *PluginGetFocusCanvas(); +extern DECL_EXP wxWindow *PluginGetOverlayRenderCanvas(); + +extern "C" DECL_EXP void CanvasJumpToPosition(wxWindow *canvas, double lat, double lon, double scale); +extern "C" DECL_EXP int AddCanvasMenuItem(wxMenuItem *pitem, opencpn_plugin *pplugin, const char *name = ""); +extern "C" DECL_EXP void RemoveCanvasMenuItem(int item, const char *name = ""); // Fully remove this item +extern "C" DECL_EXP void SetCanvasMenuItemViz(int item, bool viz, + const char *name = ""); // Temporarily change context menu options +extern "C" DECL_EXP void SetCanvasMenuItemGrey(int item, bool grey, const char *name = ""); + +// Extract waypoints, routes and tracks +extern DECL_EXP wxString GetSelectedWaypointGUID_Plugin(); +extern DECL_EXP wxString GetSelectedRouteGUID_Plugin(); +extern DECL_EXP wxString GetSelectedTrackGUID_Plugin(); + +extern DECL_EXP std::unique_ptr GetWaypoint_Plugin(const wxString &); // doublon with GetSingleWaypoint +extern DECL_EXP std::unique_ptr GetRoute_Plugin(const wxString &); +extern DECL_EXP std::unique_ptr GetTrack_Plugin(const wxString &); + +extern DECL_EXP wxWindow *GetCanvasUnderMouse(); +extern DECL_EXP int GetCanvasIndexUnderMouse(); +// extern DECL_EXP std::vector GetCanvasArray(); +extern DECL_EXP wxWindow *GetCanvasByIndex(int canvasIndex); +extern DECL_EXP int GetCanvasCount(); +extern DECL_EXP bool CheckMUIEdgePan_PlugIn(int x, int y, bool dragging, int margin, int delta, int canvasIndex); +extern DECL_EXP void SetMUICursor_PlugIn(wxCursor *pCursor, int canvasIndex); + +enum SDDMFORMAT { DEGREES_DECIMAL_MINUTES = 0, DECIMAL_DEGREES, DEGREES_MINUTES_SECONDS, END_SDDMFORMATS }; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DOWNLOAD_EVENT; +extern DECL_EXP int GetLatLonFormat(void); #endif //_PLUGIN_H_