Skip to content

Commit

Permalink
Correct MSW build
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbcat committed Apr 15, 2020
1 parent d35f0f0 commit a79d59c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 302 deletions.
72 changes: 9 additions & 63 deletions src/ocpn_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@
#define _PLUGIN_H_

#ifndef DECL_EXP
#if defined(__WXMSW__) || defined(__CYGWIN__)
#ifdef __WXMSW__
# define DECL_EXP __declspec(dllexport)
#elif defined __GNUC__ && __GNUC__ >= 4
# define DECL_EXP __attribute__((visibility("default")))
#elif defined __WXOSX__
# define DECL_EXP __attribute__((visibility("default")))
#else
# define DECL_EXP
# ifdef __GNUC__
# define DECL_EXP __attribute__((visibility("default")))
# endif
#endif
#endif

Expand All @@ -45,15 +43,9 @@
#endif

#include <wx/xml/xml.h>
#include <wx/dcmemory.h>
#include <wx/dialog.h>
#include <wx/event.h>
#include <wx/menuitem.h>
#include <wx/gdicmn.h>


#ifdef ocpnUSE_SVG
#include <wx/bitmap.h>
#include "wxSVG/svg.h"
#endif // ocpnUSE_SVG

#include <memory>
Expand All @@ -66,7 +58,7 @@ class wxGLContext;
// PlugIns conforming to API Version less then the most modern will also
// be correctly supported.
#define API_VERSION_MAJOR 1
#define API_VERSION_MINOR 17
#define API_VERSION_MINOR 16

// Fwd Definitions
class wxFileConfig;
Expand Down Expand Up @@ -164,16 +156,6 @@ class PlugIn_Position_Fix_Ex
int nSats;
};

class Plugin_Active_Leg_Info
{
public:
double Xte; // Left side of the track -> negative XTE
double Btw;
double Dtw;
wxString wp_name; // Name of destination waypoint for active leg
bool arrival; // True when within arrival circle
};

// Describe AIS Alarm state
enum plugin_ais_alarm_type
{
Expand Down Expand Up @@ -554,6 +536,7 @@ 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
Expand All @@ -567,28 +550,6 @@ class DECL_EXP opencpn_plugin_116 : public opencpn_plugin_115

};

class DECL_EXP opencpn_plugin_117 : public opencpn_plugin_116
{
public:
opencpn_plugin_117(void *pmgr);
/*
* Forms a semantic version together with GetPlugInVersionMajor() and
* GetPlugInVersionMinor(), see https://semver.org/
*/
virtual int GetPlugInVersionPatch();

/** Post-release version part, extends the semver spec. */
virtual int GetPlugInVersionPost();

/** Pre-release tag version part, see GetPlugInVersionPatch() */
virtual const char* GetPlugInVersionPre();

/** Build version part see GetPlugInVersionPatch(). */
virtual const char* GetPlugInVersionBuild();

/*Provide active leg data to plugins*/
virtual void SetActiveLegInfo(Plugin_Active_Leg_Info &leg_info);
};
//------------------------------------------------------------------
// Route and Waypoint PlugIn support
//
Expand Down Expand Up @@ -1136,7 +1097,6 @@ extern DECL_EXP void SetCanvasTilt(double tilt);
extern DECL_EXP bool PlugInPlaySoundEx( wxString &sound_file, int deviceIndex=-1 );
extern DECL_EXP void AddChartDirectory( wxString &path );
extern DECL_EXP void ForceChartDBUpdate();
extern DECL_EXP void ForceChartDBRebuild();

extern DECL_EXP wxString GetWritableDocumentsDir( void );
extern DECL_EXP wxDialog *GetActiveOptionsDialog();
Expand Down Expand Up @@ -1212,7 +1172,7 @@ enum OCPN_DLDialogStyle

/* Synchronous (Blocking) download of a single file */

extern DECL_EXP _OCPN_DLStatus OCPN_downloadFile( const wxString& url, const wxString &outputFile,
extern 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);
Expand Down Expand Up @@ -1290,13 +1250,6 @@ extern DECL_IMP wxEventType wxEVT_DOWNLOAD_EVENT;
extern DECL_EXP wxEventType wxEVT_DOWNLOAD_EVENT;
#endif


/* API 1.14 */
/* API 1.14 adds some more common functions to avoid unnecessary code duplication */

bool LaunchDefaultBrowser_Plugin( wxString url );


// API 1.14 Extra canvas Support

/* Allow drawing of objects onto other OpenGL canvases */
Expand All @@ -1307,7 +1260,7 @@ extern DECL_EXP bool PlugInSetFontColor(const wxString TextElement, const wxColo
extern DECL_EXP double PlugInGetDisplaySizeMM();

//
extern DECL_EXP wxFont* FindOrCreateFont_PlugIn( int point_size, wxFontFamily family,
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 );
Expand Down Expand Up @@ -1366,10 +1319,6 @@ 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 );

// API 1.17
//
extern DECL_EXP wxRect GetMasterToolbarRect();

enum SDDMFORMAT
{
DEGREES_DECIMAL_MINUTES = 0,
Expand All @@ -1380,7 +1329,4 @@ enum SDDMFORMAT

extern DECL_EXP int GetLatLonFormat(void);

// API 1.17
extern "C" DECL_EXP void ZeroXTE();

#endif //_PLUGIN_H_
Loading

0 comments on commit a79d59c

Please sign in to comment.