OpenCPN Partial API docs
Loading...
Searching...
No Matches
pluginmanager.cpp File Reference

Implement pluginmanager.h. More...

#include <algorithm>
#include <archive.h>
#include <cstdio>
#include <errno.h>
#include <fcntl.h>
#include <fstream>
#include <iostream>
#include <memory>
#include <set>
#include <sstream>
#include <stdint.h>
#include <string>
#include <unordered_map>
#include <typeinfo>
#include <wx/wx.h>
#include <wx/dir.h>
#include <wx/event.h>
#include <wx/filename.h>
#include <wx/aui/aui.h>
#include <wx/platinfo.h>
#include <wx/popupwin.h>
#include <wx/progdlg.h>
#include <wx/statline.h>
#include <wx/tokenzr.h>
#include <wx/tooltip.h>
#include <wx/app.h>
#include <wx/hashset.h>
#include <wx/hashmap.h>
#include <wx/jsonval.h>
#include <wx/jsonreader.h>
#include <wx/uri.h>
#include <wx/zipstrm.h>
#include <wx/zstream.h>
#include <wx/tarstrm.h>
#include <wx/textwrapper.h>
#include <cxxabi.h>
#include <archive_entry.h>
#include "config.h"
#include "model/ais_target_data.h"
#include "model/catalog_handler.h"
#include "model/comm_drv_n0183_net.h"
#include "model/comm_drv_n0183_serial.h"
#include "model/comm_drv_n2k.h"
#include "model/comm_drv_registry.h"
#include "model/comm_navmsg_bus.h"
#include "model/comm_vars.h"
#include "model/config_vars.h"
#include "model/datetime.h"
#include "model/downloader.h"
#include "model/georef.h"
#include "model/json_event.h"
#include "model/logger.h"
#include "model/multiplexer.h"
#include "model/nav_object_database.h"
#include "model/navutil_base.h"
#include "model/ocpn_utils.h"
#include "model/plugin_cache.h"
#include "model/plugin_comm.h"
#include "model/plugin_handler.h"
#include "model/plugin_loader.h"
#include "model/plugin_paths.h"
#include "model/route.h"
#include "model/routeman.h"
#include "model/safe_mode.h"
#include "model/select.h"
#include "model/semantic_vers.h"
#include "model/track.h"
#include "ais.h"
#include "canvasMenu.h"
#include "cat_settings.h"
#include "chartbase.h"
#include "chartdb.h"
#include "chartdbs.h"
#include "chcanv.h"
#include "download_mgr.h"
#include "dychart.h"
#include "FontMgr.h"
#include "gshhs.h"
#include "model/ais_decoder.h"
#include "mygeom.h"
#include "navutil.h"
#include "observable_confvar.h"
#include "observable_globvar.h"
#include "ocpn_app.h"
#include "OCPN_AUIManager.h"
#include "ocpndc.h"
#include "ocpn_frame.h"
#include "ocpn_pixel.h"
#include "OCPNPlatform.h"
#include "OCPNRegion.h"
#include "options.h"
#include "piano.h"
#include "pluginmanager.h"
#include "routemanagerdialog.h"
#include "routeman_gui.h"
#include "s52plib.h"
#include "s52utils.h"
#include "SoundFactory.h"
#include "styles.h"
#include "model/svg_utils.h"
#include "SystemCmdSound.h"
#include "toolbar.h"
#include "update_mgr.h"
#include "waypointman_gui.h"
#include <wx/listimpl.cpp>

Go to the source code of this file.

Classes

class  RawKey
 KeyProvider wrapper for a plain key string. More...
 
class  BlacklistUI
 Handle messages for blacklisted plugins. More...
 
class  PanelHardBreakWrapper
 
struct  EnumClassHash
 
class  pluginUtilHandler
 
class  PI_DLEvtHandler
 

Macros

#define DISABLED_SETTINGS_MSG
 
#define DL_EVENT_TIMER   4388
 

Typedefs

typedef __LA_INT64_T la_int64_t
 

Enumerations

enum  { CurlThreadId = wxID_HIGHEST + 1 }
 

Functions

 WX_DEFINE_ARRAY_PTR (ChartCanvas *, arrayofCanvasPtr)
 
void NotifySetupOptionsPlugin (const PlugInData *pic)
 
 WX_DEFINE_LIST (Plugin_WaypointList)
 
 WX_DEFINE_LIST (Plugin_HyperlinkList)
 
 wxDEFINE_EVENT (EVT_SIGNALK, ObservedEvt)
 
wxString message_by_status (PluginStatus stat)
 
SemanticVersion getInstalledVersion (const std::string name)
 
 wxDEFINE_EVENT (EVT_PLUGMGR_AIS_MSG, ObservedEvt)
 Set up actions to perform for messages generated by PluginLoader's evt_foo.notify() calls.
 
 wxDEFINE_EVENT (EVT_PLUGMGR_ROUTEMAN_MSG, ObservedEvt)
 
 wxDEFINE_EVENT (EVT_BLACKLISTED_PLUGIN, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_LOAD_DIRECTORY, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_LOAD_PLUGIN, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_PLUGIN_UNLOAD, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_PLUGLIST_CHANGE, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_UPDATE_CHART_TYPES, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_PLUGIN_LOADALL_FINALIZE, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_DOWNLOAD_FAILED, wxCommandEvent)
 Set up actions to perform for messages generated by PluginHandlers's evt_foo.notify() calls.
 
 wxDEFINE_EVENT (EVT_DOWNLOAD_OK, wxCommandEvent)
 
std::vector< const PlugInData * > GetInstalled ()
 Return sorted list of all installed plugins.
 
void RenderRotateToViewPort (const ViewPort &VPoint)
 
void UndoRenderRotateToViewPort (const ViewPort &VPoint)
 
wxString toSDMM_PlugIn (int NEflag, double a, bool hi_precision)
 Convert decimal degrees to a formatted string.
 
wxColour GetBaseGlobalColor (wxString colorName)
 Gets a global system color.
 
int OCPNMessageBox_PlugIn (wxWindow *parent, const wxString &message, const wxString &caption, int style, int x, int y)
 Shows a message box dialog.
 
wxString GetOCPN_ExePath (void)
 Gets OpenCPN executable path.
 
wxString * GetpPlugInLocation ()
 Gets plugins directory location.
 
wxString GetWritableDocumentsDir (void)
 Returns the platform-specific default documents directory.
 
wxString GetPlugInPath (opencpn_plugin *pplugin)
 Gets the installation path for a specific plugin.
 
wxString PI_GetPLIBColorScheme ()
 Gets current color scheme used by S52 PLIB.
 
int PI_GetPLIBDepthUnitInt ()
 Gets configured depth unit for S52 display.
 
int PI_GetPLIBSymbolStyle ()
 Gets configured S52 symbol style.
 
int PI_GetPLIBBoundaryStyle ()
 Gets configured S52 boundary style.
 
bool PI_PLIBObjectRenderCheck (PI_S57Obj *pObj, PlugIn_ViewPort *vp)
 Checks if object should be rendered.
 
int PI_GetPLIBStateHash ()
 Gets hash value representing current PLIB state.
 
void CreateCompatibleS57Object (PI_S57Obj *pObj, S57Obj *cobj, chart_context *pctx)
 
bool PI_PLIBSetContext (PI_S57Obj *pObj)
 Sets S52 PLIB rendering context for an object.
 
void PI_UpdateContext (PI_S57Obj *pObj)
 Updates rendering context for S57 object.
 
void UpdatePIObjectPlibContext (PI_S57Obj *pObj, S57Obj *cobj, ObjRazRules *rzRules)
 
bool PI_GetObjectRenderBox (PI_S57Obj *pObj, double *lat_min, double *lat_max, double *lon_min, double *lon_max)
 Gets geographic bounding box of S57 object.
 
PI_LUPname PI_GetObjectLUPName (PI_S57Obj *pObj)
 Gets Look-Up Table (LUP) name for object.
 
PI_DisPrio PI_GetObjectDisplayPriority (PI_S57Obj *pObj)
 Gets display priority for object.
 
PI_DisCat PI_GetObjectDisplayCategory (PI_S57Obj *pObj)
 Gets display category for object.
 
double PI_GetPLIBMarinerSafetyContour ()
 Gets configured safety contour depth.
 
void PI_PLIBSetLineFeaturePriority (PI_S57Obj *pObj, int prio)
 Sets rendering priority for line feature.
 
void PI_PLIBPrepareForNewRender (void)
 Prepares PLIB for new rendering pass.
 
void PI_PLIBSetRenderCaps (unsigned int flags)
 Sets rendering capability flags.
 
void PI_PLIBFreeContext (void *pContext)
 Frees S52 PLIB context.
 
int PI_PLIBRenderObjectToDC (wxDC *pdc, PI_S57Obj *pObj, PlugIn_ViewPort *vp)
 Renders an S57 object using standard device context.
 
int PI_PLIBRenderAreaToDC (wxDC *pdc, PI_S57Obj *pObj, PlugIn_ViewPort *vp, wxRect rect, unsigned char *pixbuf)
 Renders an S57 area object using standard device context.
 
int PI_PLIBRenderAreaToGL (const wxGLContext &glcc, PI_S57Obj *pObj, PlugIn_ViewPort *vp, wxRect &render_rect)
 Renders an S57 area object using OpenGL.
 
int PI_PLIBRenderObjectToGL (const wxGLContext &glcc, PI_S57Obj *pObj, PlugIn_ViewPort *vp, wxRect &render_rect)
 Renders any S57 object using OpenGL.
 
_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)
 Synchronously download a file with progress dialog.
 
wxString toUsrDateTimeFormat_Plugin (const wxDateTime date_time, const DateTimeFormatOptions &options)
 Format a date/time to a localized string representation, conforming to the global date/time format and timezone settings.
 
_OCPN_DLStatus OCPN_downloadFileBackground (const wxString &url, const wxString &outputFile, wxEvtHandler *handler, long *handle)
 Asynchronously downloads a file in the background.
 
void OCPN_cancelDownloadFileBackground (long handle)
 Cancels a background download.
 
_OCPN_DLStatus OCPN_postDataHttp (const wxString &url, const wxString &parameters, wxString &result, int timeout_secs)
 Performs HTTP POST request.
 
bool OCPN_isOnline ()
 Checks internet connectivity.
 

Variables

MyConfigpConfig
 
OCPN_AUIManagerg_pauimgr
 
wxLocale * plocale_def_lang
 
OCPNPlatformg_Platform
 
ChartDBChartData
 
MyFramegFrame
 
ocpnStyle::StyleManagerg_StyleManager
 
optionsg_pOptions
 
Multiplexerg_pMUX
 
bool g_bShowChartBar
 
Routemang_pRouteMan
 
SelectpSelect
 
RouteManagerDialogpRouteManagerDialog
 
RouteList * pRouteList
 
std::vector< Track * > g_TrackList
 
PlugInManagerg_pi_manager
 
s52plib * ps52plib
 
wxString ChartListFileName
 
optionsg_options
 
ColorScheme global_color_scheme
 
wxArrayString g_locale_catalog_array
 
int g_GUIScaleFactor
 
int g_ChartScaleFactor
 
wxString g_locale
 Global locale setting for OpenCPN UI.
 
ocpnFloatingToolbarDialogg_MainToolbar
 
int g_chart_zoom_modifier_raster
 
int g_chart_zoom_modifier_vector
 
double g_display_size_mm
 The width of the physical screen in millimeters.
 
bool g_bopengl
 
ChartGroupArray * g_pGroupArray
 
unsigned int g_canvasConfig
 
wxString g_CmdSoundString
 
unsigned int gs_plib_flags
 
ChartCanvasg_focusCanvas
 
ChartCanvasg_overlayCanvas
 
bool g_bquiting
 
arrayofCanvasPtr g_canvasArray
 
const wxEventType wxEVT_OCPN_MSG = wxNewEventType()
 
PlugInManagers_ppim
 
DECL_EXP wxEventType wxEVT_DOWNLOAD_EVENT = wxNewEventType()
 
_OCPN_DLStatus g_download_status
 
_OCPN_DLCondition g_download_condition
 
PI_DLEvtHandlerg_piEventHandler
 

Detailed Description

Implement pluginmanager.h.

Definition in file pluginmanager.cpp.

Macro Definition Documentation

◆ DISABLED_SETTINGS_MSG

#define DISABLED_SETTINGS_MSG
Value:
_("These settings might destabilize OpenCPN and are by default disabled." \
" To despite the dangers enable them manually add a CatalogExpert=1" \
" line in the [PlugIns] section in the configuration file.")

Definition at line 2144 of file pluginmanager.cpp.

◆ DL_EVENT_TIMER

#define DL_EVENT_TIMER   4388

Definition at line 5028 of file pluginmanager.cpp.

Typedef Documentation

◆ la_int64_t

typedef __LA_INT64_T la_int64_t

Definition at line 77 of file pluginmanager.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Definition at line 214 of file pluginmanager.cpp.

Function Documentation

◆ CreateCompatibleS57Object()

void CreateCompatibleS57Object ( PI_S57Obj pObj,
S57Obj *  cobj,
chart_context *  pctx 
)

Definition at line 4418 of file pluginmanager.cpp.

◆ GetBaseGlobalColor()

wxColour GetBaseGlobalColor ( wxString  colorName)

Gets a global system color.

Retrieves a base color value from OpenCPN's color management system.

Parameters
colorNameName of the color to retrieve
Returns
wxColour containing the color value
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4275 of file pluginmanager.cpp.

◆ GetInstalled()

std::vector< const PlugInData * > GetInstalled ( )

Return sorted list of all installed plugins.

Definition at line 2501 of file pluginmanager.cpp.

◆ getInstalledVersion()

SemanticVersion getInstalledVersion ( const std::string  name)

Definition at line 459 of file pluginmanager.cpp.

◆ GetOCPN_ExePath()

wxString GetOCPN_ExePath ( void  )

Gets OpenCPN executable path.

Returns full path to OpenCPN executable file.

Returns
wxString containing executable path
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4284 of file pluginmanager.cpp.

◆ GetPlugInPath()

wxString GetPlugInPath ( opencpn_plugin pplugin)

Gets the installation path for a specific plugin.

Returns the full directory path where the specified plugin is installed.

Parameters
ppluginPointer to plugin instance
Returns
wxString containing plugin's installation path
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4292 of file pluginmanager.cpp.

◆ GetpPlugInLocation()

wxString * GetpPlugInLocation ( )

Gets plugins directory location.

Returns path to directory containing installed plugins.

Returns
Pointer to wxString containing plugins path
Note
Do not delete the returned pointer
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4286 of file pluginmanager.cpp.

◆ GetWritableDocumentsDir()

wxString GetWritableDocumentsDir ( void  )

Returns the platform-specific default documents directory.

Returns
Path to writeable documents directory
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4288 of file pluginmanager.cpp.

◆ message_by_status()

wxString message_by_status ( PluginStatus  stat)

Definition at line 354 of file pluginmanager.cpp.

◆ NotifySetupOptionsPlugin()

void NotifySetupOptionsPlugin ( const PlugInData pic)

Definition at line 1599 of file pluginmanager.cpp.

◆ OCPN_cancelDownloadFileBackground()

void OCPN_cancelDownloadFileBackground ( long  handle)

Cancels a background download.

Parameters
handleDownload handle from OCPN_downloadFileBackground()
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 5423 of file pluginmanager.cpp.

◆ OCPN_downloadFile()

_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 
)

Synchronously download a file with progress dialog.

Download a file from a URL while showing a progress dialog. Blocks until the download completes or fails.

Parameters
urlURL to download from
outputFileLocal file path to save to
titleProgress dialog title
messageProgress dialog message
bitmapOptional bitmap to show in dialog
parentParent window for dialog
styleDialog style flags (see OCPN_DLDialogStyle)
timeout_secsTimeout in seconds (0 for no timeout)
Returns
Download status:
  • OCPN_DL_NO_ERROR: Success
  • OCPN_DL_FAILED: Download failed
  • OCPN_DL_ABORTED: User cancelled
  • OCPN_DL_USER_TIMEOUT: Timeout expired
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 5186 of file pluginmanager.cpp.

◆ OCPN_downloadFileBackground()

_OCPN_DLStatus OCPN_downloadFileBackground ( const wxString &  url,
const wxString &  outputFile,
wxEvtHandler *  handler,
long *  handle 
)

Asynchronously downloads a file in the background.

Initiates a background download that does not block. Progress and completion are reported via events sent to the provided handler.

Parameters
urlURL to download from
outputFileLocal file path to save to
handlerEvent handler to receive download events
handleWill receive handle to track download
Returns
Initial status:
  • OCPN_DL_STARTED: Download started
  • OCPN_DL_FAILED: Failed to start download
Note
Handler will receive OCPN_downloadEvent events
Use handle with OCPN_cancelDownloadFileBackground()
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 5328 of file pluginmanager.cpp.

◆ OCPN_isOnline()

bool OCPN_isOnline ( )

Checks internet connectivity.

Returns
True if internet appears to be available
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 5472 of file pluginmanager.cpp.

◆ OCPN_postDataHttp()

_OCPN_DLStatus OCPN_postDataHttp ( const wxString &  url,
const wxString &  parameters,
wxString &  result,
int  timeout_secs 
)

Performs HTTP POST request.

Makes a blocking HTTP POST request and returns the response.

Parameters
urlURL to post to
parametersPOST parameters/data
resultWill receive response body
timeout_secsTimeout in seconds
Returns
Status code (see OCPN_DLStatus)
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 5443 of file pluginmanager.cpp.

◆ OCPNMessageBox_PlugIn()

int OCPNMessageBox_PlugIn ( wxWindow *  parent,
const wxString &  message,
const wxString &  caption = _T("Message"),
int  style = wxOK,
int  x = -1,
int  y = -1 
)

Shows a message box dialog.

Displays a platform-native message dialog with specified text and buttons.

Parameters
parentParent window
messageMessage text to display
captionDialog title text
styleButton/icon style flags (wxOK, wxCANCEL, etc)
xOptional X position (-1 for default)
yOptional Y position (-1 for default)
Returns
ID of button pressed
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4279 of file pluginmanager.cpp.

◆ PI_GetObjectDisplayCategory()

PI_DisCat PI_GetObjectDisplayCategory ( PI_S57Obj pObj)

Gets display category for object.

Parameters
pObjObject to get category for
Returns
Display category enum value
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4667 of file pluginmanager.cpp.

◆ PI_GetObjectDisplayPriority()

PI_DisPrio PI_GetObjectDisplayPriority ( PI_S57Obj pObj)

Gets display priority for object.

Parameters
pObjObject to get priority for
Returns
Display priority enum value
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4657 of file pluginmanager.cpp.

◆ PI_GetObjectLUPName()

PI_LUPname PI_GetObjectLUPName ( PI_S57Obj pObj)

Gets Look-Up Table (LUP) name for object.

The LUP in the S-52 standard defines how chart features should be symbolized and displayed.

See also
PI_LUPname
Parameters
pObjObject to get LUP name for
Returns
LUP name enum value
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4648 of file pluginmanager.cpp.

◆ PI_GetObjectRenderBox()

bool PI_GetObjectRenderBox ( PI_S57Obj pObj,
double *  lat_min,
double *  lat_max,
double *  lon_min,
double *  lon_max 
)

Gets geographic bounding box of S57 object.

Parameters
pObjS57 object to get bounds for
lat_minMin latitude output
lat_maxMax latitude output
lon_minMin longitude output
lon_maxMax longitude output
Returns
True if bounds were calculated
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4635 of file pluginmanager.cpp.

◆ PI_GetPLIBBoundaryStyle()

int PI_GetPLIBBoundaryStyle ( )

Gets configured S52 boundary style.

Returns
Integer boundary style: 0 = Plain boundaries 1 = Symbolized boundaries
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4371 of file pluginmanager.cpp.

◆ PI_GetPLIBColorScheme()

wxString PI_GetPLIBColorScheme ( )

Gets current color scheme used by S52 PLIB.

Returns
Color scheme name ("DAY", "DUSK", or "NIGHT")
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4353 of file pluginmanager.cpp.

◆ PI_GetPLIBDepthUnitInt()

int PI_GetPLIBDepthUnitInt ( )

Gets configured depth unit for S52 display.

Returns
Integer depth unit code: 0 = Meters 1 = Feet 2 = Fathoms
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4357 of file pluginmanager.cpp.

◆ PI_GetPLIBMarinerSafetyContour()

double PI_GetPLIBMarinerSafetyContour ( )

Gets configured safety contour depth.

Returns
Safety contour depth in configured units
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4675 of file pluginmanager.cpp.

◆ PI_GetPLIBStateHash()

int PI_GetPLIBStateHash ( )

Gets hash value representing current PLIB state.

Used to detect configuration changes.

Returns
Integer hash of PLIB settings
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4411 of file pluginmanager.cpp.

◆ PI_GetPLIBSymbolStyle()

int PI_GetPLIBSymbolStyle ( )

Gets configured S52 symbol style.

Returns
Integer symbol style: 0 = Simplified symbols 1 = Traditional paper chart symbols
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4364 of file pluginmanager.cpp.

◆ PI_PLIBFreeContext()

void PI_PLIBFreeContext ( void *  pContext)

Frees S52 PLIB context.

Parameters
pContextContext pointer to free
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4718 of file pluginmanager.cpp.

◆ PI_PLIBObjectRenderCheck()

bool PI_PLIBObjectRenderCheck ( PI_S57Obj pObj,
PlugIn_ViewPort vp 
)

Checks if object should be rendered.

Parameters
pObjObject to check
vpCurrent viewport
Returns
True if object should be rendered
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4378 of file pluginmanager.cpp.

◆ PI_PLIBPrepareForNewRender()

void PI_PLIBPrepareForNewRender ( void  )

Prepares PLIB for new rendering pass.

Clears internal caches and states.

Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4704 of file pluginmanager.cpp.

◆ PI_PLIBRenderAreaToDC()

int PI_PLIBRenderAreaToDC ( wxDC *  pdc,
PI_S57Obj pObj,
PlugIn_ViewPort vp,
wxRect  rect,
unsigned char *  pixbuf 
)

Renders an S57 area object using standard device context.

Specialized rendering for area features like depth areas, land areas etc. Supports pixel buffer output for optimized drawing.

Parameters
pdcDevice context to draw into
pObjS57 area object to render
vpCurrent viewport parameters
rectRectangle defining render area
pixbufOptional pixel buffer for cached rendering
Returns
Status code (0 = success)
Note
For area patterns and fills
Context must be set with PLIBSetContext() first
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4793 of file pluginmanager.cpp.

◆ PI_PLIBRenderAreaToGL()

int PI_PLIBRenderAreaToGL ( const wxGLContext &  glcc,
PI_S57Obj pObj,
PlugIn_ViewPort vp,
wxRect &  render_rect 
)

Renders an S57 area object using OpenGL.

OpenGL-optimized rendering for area features with hardware acceleration.

Parameters
glccOpenGL context for rendering
pObjS57 area object to render
vpCurrent viewport parameters
render_rectRectangle defining render bounds
Returns
Status code (0 = success)
Note
For hardware-accelerated area rendering
Context must be set with PLIBSetContext() first
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4876 of file pluginmanager.cpp.

◆ PI_PLIBRenderObjectToDC()

int PI_PLIBRenderObjectToDC ( wxDC *  pdc,
PI_S57Obj pObj,
PlugIn_ViewPort vp 
)

Renders an S57 object using standard device context.

Draws a chart object using S52 presentation library rules through a standard wxDC device context.

Parameters
pdcDevice context to draw into
pObjS57 object to render
vpCurrent viewport parameters
Returns
Status code (0 = success)
Note
For non-OpenGL rendering
Context must be set with PLIBSetContext() first
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4751 of file pluginmanager.cpp.

◆ PI_PLIBRenderObjectToGL()

int PI_PLIBRenderObjectToGL ( const wxGLContext &  glcc,
PI_S57Obj pObj,
PlugIn_ViewPort vp,
wxRect &  render_rect 
)

Renders any S57 object using OpenGL.

Generic OpenGL rendering for any chart object type with hardware acceleration.

Parameters
glccOpenGL context for rendering
pObjS57 object to render
vpCurrent viewport parameters
render_rectRectangle defining render bounds
Returns
Status code (0 = success)
Note
For hardware-accelerated rendering
Context must be set with PLIBSetContext() first
Handles points, lines, areas and text
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4953 of file pluginmanager.cpp.

◆ PI_PLIBSetContext()

bool PI_PLIBSetContext ( PI_S57Obj pObj)

Sets S52 PLIB rendering context for an object.

Prepares the S52 presentation library context for rendering a chart object. Must be called before rendering to ensure proper symbolization.

Parameters
pObjS57 object to set context for
Returns
True if context was set successfully
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4527 of file pluginmanager.cpp.

◆ PI_PLIBSetLineFeaturePriority()

void PI_PLIBSetLineFeaturePriority ( PI_S57Obj pObj,
int  prio 
)

Sets rendering priority for line feature.

Parameters
pObjLine object to set priority for
prioNew priority value
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4679 of file pluginmanager.cpp.

◆ PI_PLIBSetRenderCaps()

void PI_PLIBSetRenderCaps ( unsigned int  flags)

Sets rendering capability flags.

Parameters
flagsBitwise combination of PLIB_CAPS flags: PLIB_CAPS_LINE_VBO PLIB_CAPS_LINE_BUFFER PLIB_CAPS_SINGLEGEO_BUFFER etc.
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4716 of file pluginmanager.cpp.

◆ PI_UpdateContext()

void PI_UpdateContext ( PI_S57Obj pObj)

Updates rendering context for S57 object.

Parameters
pObjObject to update context for
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4594 of file pluginmanager.cpp.

◆ RenderRotateToViewPort()

void RenderRotateToViewPort ( const ViewPort VPoint)

Definition at line 3904 of file pluginmanager.cpp.

◆ toSDMM_PlugIn()

wxString toSDMM_PlugIn ( int  NEflag,
double  a,
bool  hi_precision = true 
)

Convert decimal degrees to a formatted string.

Converts a decimal degrees value to a string formatted in the currently specified format. For example, -123.456 can be converted to "123° 27.36' W".

Parameters
NEflagNorth/East flags: 1 = N/S, 2 = E/W
aDegrees decimal in the range -180.0 to 180.0
hi_precisionIf true, format with 4 decimal places instead of 1
Returns
Formatted string in one of these formats depending on preferences:
  • DD° MM.mmm'
  • DD.ddddd°
  • DD° MM' SS.sss"
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 4271 of file pluginmanager.cpp.

◆ toUsrDateTimeFormat_Plugin()

wxString toUsrDateTimeFormat_Plugin ( const wxDateTime  date_time,
const DateTimeFormatOptions options = DateTimeFormatOptions() 
)

Format a date/time to a localized string representation, conforming to the global date/time format and timezone settings.

The function expects date_time to be in local time and formats it according to the timezone configuration either in:

  • UTC: Coordinated Universal Time (default)
  • Local Time: System's configured timezone with proper DST handling
  • LMT: Local Mean Time calculated based on the longitude specified in options
Note
This function should be used instead of wxDateTime.Format() to ensure consistent date/time formatting across the entire application.
Parameters
date_timeThe date/time to format, must be in local time.
optionsThe date/time format options including target timezone and formatting preferences.
Returns
wxString The formatted date/time string with appropriate timezone indicator.
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 5322 of file pluginmanager.cpp.

◆ UndoRenderRotateToViewPort()

void UndoRenderRotateToViewPort ( const ViewPort VPoint)

Definition at line 3913 of file pluginmanager.cpp.

◆ UpdatePIObjectPlibContext()

void UpdatePIObjectPlibContext ( PI_S57Obj pObj,
S57Obj *  cobj,
ObjRazRules *  rzRules 
)

Definition at line 4603 of file pluginmanager.cpp.

Variable Documentation

◆ ChartData

ChartDB* ChartData
extern

Definition at line 269 of file ocpn_app.cpp.

◆ ChartListFileName

wxString ChartListFileName
extern

Definition at line 299 of file ocpn_app.cpp.

◆ g_bopengl

bool g_bopengl
extern

Definition at line 476 of file ocpn_app.cpp.

◆ g_bquiting

bool g_bquiting
extern

Definition at line 606 of file ocpn_app.cpp.

◆ g_bShowChartBar

bool g_bShowChartBar
extern

Definition at line 347 of file ocpn_app.cpp.

◆ g_canvasArray

arrayofCanvasPtr g_canvasArray
extern

Definition at line 696 of file ocpn_app.cpp.

◆ g_canvasConfig

unsigned int g_canvasConfig
extern

Definition at line 685 of file ocpn_app.cpp.

◆ g_chart_zoom_modifier_raster

int g_chart_zoom_modifier_raster
extern

Definition at line 674 of file ocpn_app.cpp.

◆ g_chart_zoom_modifier_vector

int g_chart_zoom_modifier_vector
extern

Definition at line 675 of file ocpn_app.cpp.

◆ g_ChartScaleFactor

int g_ChartScaleFactor
extern

Definition at line 399 of file ocpn_app.cpp.

◆ g_CmdSoundString

wxString g_CmdSoundString
extern

Definition at line 652 of file ocpn_app.cpp.

◆ g_display_size_mm

double g_display_size_mm
extern

The width of the physical screen in millimeters.

Definition at line 394 of file ocpn_app.cpp.

◆ g_download_condition

_OCPN_DLCondition g_download_condition

Definition at line 5026 of file pluginmanager.cpp.

◆ g_download_status

_OCPN_DLStatus g_download_status

Definition at line 5025 of file pluginmanager.cpp.

◆ g_focusCanvas

ChartCanvas* g_focusCanvas
extern

Definition at line 699 of file ocpn_app.cpp.

◆ g_GUIScaleFactor

int g_GUIScaleFactor
extern

Definition at line 398 of file ocpn_app.cpp.

◆ g_locale

wxString g_locale
extern

Global locale setting for OpenCPN UI.

If not set in config (empty string), uses system default locale. Stores the language/locale name in format "en_US", "fr_FR", etc. A valid setting triggers loading the corresponding .mo translation files from the appropriate locale directory.

Definition at line 596 of file ocpn_app.cpp.

◆ g_locale_catalog_array

wxArrayString g_locale_catalog_array
extern

Definition at line 681 of file ocpn_app.cpp.

◆ g_MainToolbar

ocpnFloatingToolbarDialog* g_MainToolbar
extern

Definition at line 620 of file ocpn_app.cpp.

◆ g_options

options* g_options
extern

Definition at line 524 of file ocpn_app.cpp.

◆ g_overlayCanvas

ChartCanvas* g_overlayCanvas
extern

Definition at line 700 of file ocpn_app.cpp.

◆ g_pauimgr

OCPN_AUIManager* g_pauimgr
extern

Definition at line 615 of file ocpn_app.cpp.

◆ g_pGroupArray

ChartGroupArray* g_pGroupArray
extern

Definition at line 516 of file ocpn_app.cpp.

◆ g_pi_manager

PlugInManager* g_pi_manager
extern

Definition at line 508 of file ocpn_app.cpp.

◆ g_piEventHandler

PI_DLEvtHandler* g_piEventHandler

Definition at line 5183 of file pluginmanager.cpp.

◆ g_Platform

OCPNPlatform* g_Platform
extern

Definition at line 255 of file ocpn_app.cpp.

◆ g_pMUX

Multiplexer* g_pMUX
extern

Definition at line 53 of file multiplexer.cpp.

◆ g_pOptions

options* g_pOptions
extern

Definition at line 260 of file options.cpp.

◆ g_pRouteMan

Routeman* g_pRouteMan
extern

Definition at line 67 of file routeman.cpp.

◆ g_StyleManager

ocpnStyle::StyleManager* g_StyleManager
extern

Definition at line 341 of file ocpn_app.cpp.

◆ g_TrackList

std::vector<Track*> g_TrackList
extern

Definition at line 101 of file track.cpp.

◆ gFrame

MyFrame* gFrame
extern

Definition at line 264 of file ocpn_app.cpp.

◆ global_color_scheme

ColorScheme global_color_scheme
extern

Definition at line 372 of file ocpn_app.cpp.

◆ gs_plib_flags

unsigned int gs_plib_flags
extern

Definition at line 118 of file ocpn_plugin_gui.cpp.

◆ pConfig

MyConfig* pConfig
extern

Definition at line 268 of file ocpn_app.cpp.

◆ plocale_def_lang

wxLocale* plocale_def_lang
extern

Definition at line 585 of file ocpn_app.cpp.

◆ pRouteList

RouteList* pRouteList
extern

Definition at line 73 of file routeman.cpp.

◆ pRouteManagerDialog

RouteManagerDialog* pRouteManagerDialog
extern

Definition at line 281 of file ocpn_app.cpp.

◆ ps52plib

s52plib* ps52plib
extern

Definition at line 410 of file ocpn_app.cpp.

◆ pSelect

Select* pSelect
extern

Definition at line 37 of file select.cpp.

◆ s_ppim

PlugInManager* s_ppim

Definition at line 873 of file pluginmanager.cpp.

◆ wxEVT_DOWNLOAD_EVENT

DECL_EXP wxEventType wxEVT_DOWNLOAD_EVENT = wxNewEventType()

Definition at line 5023 of file pluginmanager.cpp.

◆ wxEVT_OCPN_MSG

const wxEventType wxEVT_OCPN_MSG = wxNewEventType()

Definition at line 829 of file pluginmanager.cpp.