26 #ifndef OCPNPLATFORM_H
27 #define OCPNPLATFORM_H
35 #include <wx/wxprec.h>
43 #include <wx/bmpbuttn.h>
44 #include <wx/clrpicker.h>
45 #include <wx/colordlg.h>
46 #include <wx/colour.h>
47 #include <wx/colourdata.h>
48 #include <wx/dirdlg.h>
49 #include <wx/filedlg.h>
50 #include <wx/gdicmn.h>
51 #include <wx/stdpaths.h>
52 #include <wx/string.h>
53 #include <wx/validate.h>
54 #include <wx/window.h>
56 #include "model/base_platform.h"
77 static bool hasInternalGPS(wxString profile = _T(
""));
79 static bool hasInternalBT(wxString profile = _T(
""));
80 bool startBluetoothScan();
81 wxArrayString getBluetoothScanResults();
82 bool stopBluetoothScan();
87 static void Initialize_1(
void);
90 void Initialize_2(
void);
94 void Initialize_3(
void);
97 static void Initialize_4(
void);
99 static void OnExit_1(
void);
100 static void OnExit_2(
void);
102 void SetDefaultOptions(
void);
103 void SetUpgradeOptions(wxString vString, wxString vStringConfig);
105 void applyExpertMode(
bool mode);
110 virtual void ShowBusySpinner(
void);
111 virtual void HideBusySpinner(
void);
112 double getFontPointsperPixel(
void);
113 wxSize getDisplaySize();
114 double GetDisplaySizeMM();
115 double GetDisplayAreaCM2();
116 virtual double GetDisplayDPmm();
118 void SetDisplaySizeMM(
size_t monitor,
double size);
119 unsigned int GetSelectRadiusPix();
120 double GetToolbarScaleFactor(
int GUIScaleFactor);
121 double GetCompassScaleFactor(
int GUIScaleFactor);
123 wxFileDialog *AdjustFileDialogFont(wxWindow *container, wxFileDialog *dlg);
124 wxDirDialog *AdjustDirDialogFont(wxWindow *container, wxDirDialog *dlg);
126 void PositionAISAlert(wxWindow *alert_window);
127 float GetChartScaleFactorExp(
float scale_linear);
128 float GetMarkScaleFactorExp(
float scale_linear);
130 int GetStatusBarFieldCount();
131 bool GetFullscreen();
132 bool SetFullscreen(
bool bFull);
133 bool AllowAlertDialog(
const wxString &class_name);
134 double GetDisplayDensityFactor();
135 double m_pt_per_pixel;
136 long GetDefaultToolbarOrientation();
143 wxString GetSupplementalLicenseString();
145 int DoFileSelectorDialog(wxWindow *parent, wxString *file_spec,
146 wxString Title, wxString initDir,
147 wxString suggestedName, wxString wildcard);
148 int DoDirSelectorDialog(wxWindow *parent, wxString *file_spec, wxString Title,
149 wxString initDir,
bool b_addFiles =
true);
155 void setChartTypeMaskSel(
int mask, wxString &indicator);
156 bool isPlatformCapable(
int flag);
157 void LaunchLocalHelp();
158 void DoHelpDialog(
void);
160 int platformApplyPrivateSettingsString(wxString settings,
161 ArrayOfCDI *pDirArray);
162 void platformLaunchDefaultBrowser(wxString URL);
164 void SetLocaleSearchPrefixes(
void);
165 wxString GetDefaultSystemLocale();
168 wxString GetAdjustedAppLocale();
169 wxString ChangeLocale(wxString &newLocaleID, wxLocale *presentLocale,
170 wxLocale **newLocale);
176 bool BuildGLCaps(
void *pbuf);
180 wxString m_SData_Dir;
192 const wxColour &initial = *wxBLACK,
193 const wxPoint &pos = wxDefaultPosition,
194 const wxSize &size = wxDefaultSize,
long style = 0,
195 const wxValidator &validator = wxDefaultValidator,
196 const wxString &name = _T(
""));
198 bool Create(wxWindow *parent, wxWindowID
id,
199 const wxColour &initial = *wxBLACK,
200 const wxPoint &pos = wxDefaultPosition,
201 const wxSize &size = wxDefaultSize,
long style = 0,
202 const wxValidator &validator = wxDefaultValidator,
203 const wxString &name = _T(
""));
205 void OnButtonClick(wxCommandEvent &WXUNUSED(ev));
206 void InitColourData();
207 void SetColour(wxColour &c);
208 wxColour GetColour(
void);
211 virtual void UpdateColour();
212 wxSize DoGetBestSize()
const;
214 void OnPaint(wxPaintEvent &event);
216 DECLARE_EVENT_TABLE();
221 wxColourData ms_data;