OpenCPN Partial API docs
Loading...
Searching...
No Matches
OCPNPlatform Class Reference

Provides platform-specific support utilities for OpenCPN. More...

#include <OCPNPlatform.h>

Inheritance diagram for OCPNPlatform:
BasePlatform AbstractPlatform

Public Member Functions

bool startBluetoothScan ()
 
wxArrayString getBluetoothScanResults ()
 
bool stopBluetoothScan ()
 
void Initialize_2 (void)
 
void Initialize_3 (void)
 
void SetDefaultOptions (void)
 
void SetUpgradeOptions (wxString vString, wxString vStringConfig)
 
void applyExpertMode (bool mode)
 
virtual void ShowBusySpinner (void)
 
virtual void HideBusySpinner (void)
 
double getFontPointsperPixel (void)
 
wxSize getDisplaySize ()
 Get the display size in logical pixels.
 
double GetDisplaySizeMM ()
 Get the width of the screen in millimeters.
 
double GetDisplayAreaCM2 ()
 
virtual double GetDisplayDPmm ()
 
void SetDisplaySizeMM (size_t monitor, double size)
 Set the width of the monitor in millimeters.
 
unsigned int GetSelectRadiusPix ()
 
double GetToolbarScaleFactor (int GUIScaleFactor)
 
double GetCompassScaleFactor (int GUIScaleFactor)
 
wxFileDialog * AdjustFileDialogFont (wxWindow *container, wxFileDialog *dlg)
 
wxDirDialog * AdjustDirDialogFont (wxWindow *container, wxDirDialog *dlg)
 
void PositionAISAlert (wxWindow *alert_window)
 
float GetChartScaleFactorExp (float scale_linear)
 
float GetMarkScaleFactorExp (float scale_linear)
 
int GetStatusBarFieldCount ()
 
bool GetFullscreen ()
 
bool SetFullscreen (bool bFull)
 
bool AllowAlertDialog (const wxString &class_name)
 
double GetDisplayDensityFactor ()
 
long GetDefaultToolbarOrientation ()
 
MyConfigGetConfigObject ()
 
wxString GetSupplementalLicenseString ()
 
int DoFileSelectorDialog (wxWindow *parent, wxString *file_spec, wxString Title, wxString initDir, wxString suggestedName, wxString wildcard)
 
int DoDirSelectorDialog (wxWindow *parent, wxString *file_spec, wxString Title, wxString initDir, bool b_addFiles=true)
 
void setChartTypeMaskSel (int mask, wxString &indicator)
 
bool isPlatformCapable (int flag)
 
void LaunchLocalHelp ()
 
void DoHelpDialog (void)
 
int platformApplyPrivateSettingsString (wxString settings, ArrayOfCDI *pDirArray)
 
void platformLaunchDefaultBrowser (wxString URL)
 
void SetLocaleSearchPrefixes (void)
 
wxString GetDefaultSystemLocale ()
 
bool BuildGLCaps (void *pbuf)
 
bool IsGLCapable ()
 
- Public Member Functions inherited from BasePlatform
bool InitializeLogFile () override
 
- Public Member Functions inherited from AbstractPlatform
wxString & GetPrivateDataDir ()
 Return dir path for opencpn.log, etc., respecting -c cli option.
 
wxString & DefaultPrivateDataDir ()
 Return dir path for opencpn.log, etc., does not respect -c option.
 
wxString * GetPluginDirPtr ()
 
wxString * GetSharedDataDirPtr ()
 
wxString * GetPrivateDataDirPtr ()
 Legacy compatibility syntactic sugar for GetPrivateDataDir().
 
wxString & GetPluginDir ()
 The original in-tree plugin directory, sometimes not user-writable.
 
wxStandardPaths & GetStdPaths ()
 
wxString GetWinPluginBaseDir ()
 Base directory for user writable windows plugins, reflects winPluginDir option, defaults to LOCALAPPDATA%/opencpn.
 
wxString & GetSharedDataDir ()
 
wxString & GetExePath ()
 
wxString & GetHomeDir ()
 
wxString GetWritableDocumentsDir ()
 
wxString GetPluginDataPath ()
 Return ';'-separated list of base directories for plugin data.
 
wxString & GetConfigFileName ()
 
wxString & GetLogFileName ()
 
bool isFlatpacked ()
 
bool isPlatformCapable (int flag)
 
OCPN_OSDetailGetOSDetail ()
 
void CloseLogFile (void)
 
wxString & GetLargeLogMessage (void)
 
FILE * GetLogFilePtr ()
 
wxString NormalizePath (const wxString &full_path)
 
double GetDisplayDIPMult (wxWindow *win)
 Get the display scaling factor for DPI-aware rendering.
 

Static Public Member Functions

static bool hasInternalGPS (wxString profile=_T(""))
 
static bool hasInternalBT (wxString profile=_T(""))
 
static void Initialize_1 (void)
 
static void Initialize_4 (void)
 
static void OnExit_1 (void)
 
static void OnExit_2 (void)
 
- Static Public Member Functions inherited from AbstractPlatform
static void ShowBusySpinner ()
 
static void HideBusySpinner ()
 

Public Attributes

double m_pt_per_pixel
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractPlatform
bool DetectOSDetail (OCPN_OSDetail *detail)
 
- Protected Attributes inherited from AbstractPlatform
wxString m_default_private_datadir
 
wxString m_PrivateDataDir
 
wxString m_PluginsDir
 
bool m_isFlatpacked
 
wxString m_homeDir
 
wxString m_exePath
 
wxString m_SData_Dir
 
wxString m_config_file_name
 
wxString m_pluginDataPath
 
wxString mlog_file
 
OCPN_OSDetailm_osDetail
 
FILE * flog
 
wxLog * m_old_logger
 
wxString large_log_message
 
std::vector< int > m_displaySizeMMOverride
 
int m_monitorWidth
 
int m_monitorHeight
 
bool m_bdisableWindowsDisplayEnum
 
- Static Protected Attributes inherited from AbstractPlatform
static bool m_isBusy = false
 

Detailed Description

Provides platform-specific support utilities for OpenCPN.

Extends BasePlatform to implement platform-specific functionality for various aspects of the application, including device support, initialization, display handling, and file operations, and more.

Definition at line 76 of file OCPNPlatform.h.

Constructor & Destructor Documentation

◆ OCPNPlatform()

OCPNPlatform::OCPNPlatform ( )

Definition at line 249 of file OCPNPlatform.cpp.

◆ ~OCPNPlatform()

OCPNPlatform::~OCPNPlatform ( )
virtual

Definition at line 260 of file OCPNPlatform.cpp.

Member Function Documentation

◆ AdjustDirDialogFont()

wxDirDialog * OCPNPlatform::AdjustDirDialogFont ( wxWindow *  container,
wxDirDialog *  dlg 
)

Definition at line 1871 of file OCPNPlatform.cpp.

◆ AdjustFileDialogFont()

wxFileDialog * OCPNPlatform::AdjustFileDialogFont ( wxWindow *  container,
wxFileDialog *  dlg 
)

Definition at line 1908 of file OCPNPlatform.cpp.

◆ AllowAlertDialog()

bool OCPNPlatform::AllowAlertDialog ( const wxString &  class_name)

Definition at line 2168 of file OCPNPlatform.cpp.

◆ applyExpertMode()

void OCPNPlatform::applyExpertMode ( bool  mode)

Definition at line 1542 of file OCPNPlatform.cpp.

◆ DoDirSelectorDialog()

int OCPNPlatform::DoDirSelectorDialog ( wxWindow *  parent,
wxString *  file_spec,
wxString  Title,
wxString  initDir,
bool  b_addFiles = true 
)

Definition at line 1615 of file OCPNPlatform.cpp.

◆ DoFileSelectorDialog()

int OCPNPlatform::DoFileSelectorDialog ( wxWindow *  parent,
wxString *  file_spec,
wxString  Title,
wxString  initDir,
wxString  suggestedName,
wxString  wildcard 
)

Definition at line 1563 of file OCPNPlatform.cpp.

◆ DoHelpDialog()

void OCPNPlatform::DoHelpDialog ( void  )

Definition at line 2244 of file OCPNPlatform.cpp.

◆ getBluetoothScanResults()

wxArrayString OCPNPlatform::getBluetoothScanResults ( )

Definition at line 2150 of file OCPNPlatform.cpp.

◆ GetChartScaleFactorExp()

float OCPNPlatform::GetChartScaleFactorExp ( float  scale_linear)

Definition at line 2082 of file OCPNPlatform.cpp.

◆ GetCompassScaleFactor()

double OCPNPlatform::GetCompassScaleFactor ( int  GUIScaleFactor)

Definition at line 2020 of file OCPNPlatform.cpp.

◆ GetConfigObject()

MyConfig * OCPNPlatform::GetConfigObject ( )

Definition at line 1665 of file OCPNPlatform.cpp.

◆ GetDefaultSystemLocale()

wxString OCPNPlatform::GetDefaultSystemLocale ( )

Definition at line 1025 of file OCPNPlatform.cpp.

◆ GetDefaultToolbarOrientation()

long OCPNPlatform::GetDefaultToolbarOrientation ( )

Definition at line 1709 of file OCPNPlatform.cpp.

◆ GetDisplayAreaCM2()

double OCPNPlatform::GetDisplayAreaCM2 ( )

Definition at line 1802 of file OCPNPlatform.cpp.

◆ GetDisplayDensityFactor()

double OCPNPlatform::GetDisplayDensityFactor ( )

Definition at line 1701 of file OCPNPlatform.cpp.

◆ GetDisplayDPmm()

double OCPNPlatform::GetDisplayDPmm ( )
virtual

Reimplemented from BasePlatform.

Definition at line 1822 of file OCPNPlatform.cpp.

◆ getDisplaySize()

wxSize OCPNPlatform::getDisplaySize ( )
virtual

Get the display size in logical pixels.

Returns the display dimensions in logical pixels, which may differ from physical pixels on high-DPI displays. For example:

  • On a MacBook Pro 16" Retina: returns 1792x1120 (logical) rather than 4096x2560 (physical).
  • On standard displays: logical pixels equal physical pixels.
Note
On Retina/HiDPI displays, multiply by GetContentScaleFactor() to get physical pixels.
Returns
wxSize containing the width and height in logical pixels.

Reimplemented from BasePlatform.

Definition at line 1777 of file OCPNPlatform.cpp.

◆ GetDisplaySizeMM()

double OCPNPlatform::GetDisplaySizeMM ( )
virtual

Get the width of the screen in millimeters.

Reimplemented from BasePlatform.

Definition at line 1786 of file OCPNPlatform.cpp.

◆ getFontPointsperPixel()

double OCPNPlatform::getFontPointsperPixel ( void  )

Definition at line 1746 of file OCPNPlatform.cpp.

◆ GetFullscreen()

bool OCPNPlatform::GetFullscreen ( )

Definition at line 1836 of file OCPNPlatform.cpp.

◆ GetMarkScaleFactorExp()

float OCPNPlatform::GetMarkScaleFactorExp ( float  scale_linear)

Definition at line 2100 of file OCPNPlatform.cpp.

◆ GetSelectRadiusPix()

unsigned int OCPNPlatform::GetSelectRadiusPix ( )
virtual

Reimplemented from AbstractPlatform.

Definition at line 1831 of file OCPNPlatform.cpp.

◆ GetStatusBarFieldCount()

int OCPNPlatform::GetStatusBarFieldCount ( )

Definition at line 1717 of file OCPNPlatform.cpp.

◆ GetSupplementalLicenseString()

wxString OCPNPlatform::GetSupplementalLicenseString ( )

Definition at line 1549 of file OCPNPlatform.cpp.

◆ GetToolbarScaleFactor()

double OCPNPlatform::GetToolbarScaleFactor ( int  GUIScaleFactor)

Definition at line 1947 of file OCPNPlatform.cpp.

◆ hasInternalBT()

bool OCPNPlatform::hasInternalBT ( wxString  profile = _T(""))
static

Definition at line 2121 of file OCPNPlatform.cpp.

◆ hasInternalGPS()

bool OCPNPlatform::hasInternalGPS ( wxString  profile = _T(""))
static

Definition at line 1677 of file OCPNPlatform.cpp.

◆ HideBusySpinner()

void OCPNPlatform::HideBusySpinner ( void  )
virtual

Definition at line 1697 of file OCPNPlatform.cpp.

◆ Initialize_1()

void OCPNPlatform::Initialize_1 ( void  )
static

Definition at line 335 of file OCPNPlatform.cpp.

◆ Initialize_2()

void OCPNPlatform::Initialize_2 ( void  )

Definition at line 558 of file OCPNPlatform.cpp.

◆ Initialize_3()

void OCPNPlatform::Initialize_3 ( void  )

Definition at line 602 of file OCPNPlatform.cpp.

◆ Initialize_4()

void OCPNPlatform::Initialize_4 ( void  )
static

Definition at line 659 of file OCPNPlatform.cpp.

◆ IsGLCapable()

bool OCPNPlatform::IsGLCapable ( )

Definition at line 904 of file OCPNPlatform.cpp.

◆ isPlatformCapable()

bool OCPNPlatform::isPlatformCapable ( int  flag)

Definition at line 2222 of file OCPNPlatform.cpp.

◆ LaunchLocalHelp()

void OCPNPlatform::LaunchLocalHelp ( void  )

Definition at line 2263 of file OCPNPlatform.cpp.

◆ OnExit_1()

void OCPNPlatform::OnExit_1 ( void  )
static

Definition at line 676 of file OCPNPlatform.cpp.

◆ OnExit_2()

void OCPNPlatform::OnExit_2 ( void  )
static

Definition at line 678 of file OCPNPlatform.cpp.

◆ platformApplyPrivateSettingsString()

int OCPNPlatform::platformApplyPrivateSettingsString ( wxString  settings,
ArrayOfCDI *  pDirArray 
)

Definition at line 1532 of file OCPNPlatform.cpp.

◆ platformLaunchDefaultBrowser()

void OCPNPlatform::platformLaunchDefaultBrowser ( wxString  URL)

Definition at line 2292 of file OCPNPlatform.cpp.

◆ PositionAISAlert()

void OCPNPlatform::PositionAISAlert ( wxWindow *  alert_window)

Definition at line 1857 of file OCPNPlatform.cpp.

◆ setChartTypeMaskSel()

void OCPNPlatform::setChartTypeMaskSel ( int  mask,
wxString &  indicator 
)

Definition at line 2192 of file OCPNPlatform.cpp.

◆ SetDefaultOptions()

void OCPNPlatform::SetDefaultOptions ( void  )

Definition at line 1210 of file OCPNPlatform.cpp.

◆ SetDisplaySizeMM()

void OCPNPlatform::SetDisplaySizeMM ( size_t  monitor,
double  size 
)

Set the width of the monitor in millimeters.

Definition at line 1816 of file OCPNPlatform.cpp.

◆ SetFullscreen()

bool OCPNPlatform::SetFullscreen ( bool  bFull)

Definition at line 1847 of file OCPNPlatform.cpp.

◆ SetLocaleSearchPrefixes()

void OCPNPlatform::SetLocaleSearchPrefixes ( void  )

Definition at line 960 of file OCPNPlatform.cpp.

◆ SetUpgradeOptions()

void OCPNPlatform::SetUpgradeOptions ( wxString  vString,
wxString  vStringConfig 
)

Definition at line 1427 of file OCPNPlatform.cpp.

◆ ShowBusySpinner()

void OCPNPlatform::ShowBusySpinner ( void  )
virtual

Definition at line 1693 of file OCPNPlatform.cpp.

◆ startBluetoothScan()

bool OCPNPlatform::startBluetoothScan ( )

Definition at line 2132 of file OCPNPlatform.cpp.

◆ stopBluetoothScan()

bool OCPNPlatform::stopBluetoothScan ( )

Definition at line 2141 of file OCPNPlatform.cpp.

Member Data Documentation

◆ m_pt_per_pixel

double OCPNPlatform::m_pt_per_pixel

Definition at line 159 of file OCPNPlatform.h.


The documentation for this class was generated from the following files: