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

Implement pluginmanager.h. More...

#include <algorithm>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <typeinfo>
#include <unordered_map>
#include <cxxabi.h>
#include <archive.h>
#include <archive_entry.h>
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <wx/app.h>
#include <wx/aui/aui.h>
#include <wx/dir.h>
#include <wx/event.h>
#include <wx/filename.h>
#include <wx/hashmap.h>
#include <wx/hashset.h>
#include <wx/jsonreader.h>
#include <wx/jsonval.h>
#include <wx/listimpl.cpp>
#include <wx/platinfo.h>
#include <wx/popupwin.h>
#include <wx/progdlg.h>
#include <wx/statline.h>
#include <wx/tarstrm.h>
#include <wx/textwrapper.h>
#include <wx/tokenzr.h>
#include <wx/tooltip.h>
#include <wx/uri.h>
#include <wx/wx.h>
#include <wx/zipstrm.h>
#include <wx/zstream.h>
#include "config.h"
#include "pluginmanager.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/gui_vars.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 "canvas_menu.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 "font_mgr.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_aui_manager.h"
#include "ocpndc.h"
#include "ocpn_frame.h"
#include "ocpn_pixel.h"
#include "ocpn_platform.h"
#include "ocpn_region.h"
#include "options.h"
#include "piano.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"

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

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 ()
 Gets OpenCPN executable path.
 
wxString * GetpPlugInLocation ()
 Gets plugins directory location.
 
wxString GetWritableDocumentsDir ()
 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 ()
 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

wxLocale * plocale_def_lang
 
PlugInManagerg_pi_manager
 Global instance.
 
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 2123 of file pluginmanager.cpp.

◆ DL_EVENT_TIMER

#define DL_EVENT_TIMER   4388

Definition at line 5007 of file pluginmanager.cpp.

Typedef Documentation

◆ la_int64_t

typedef __LA_INT64_T la_int64_t

Definition at line 170 of file pluginmanager.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Definition at line 171 of file pluginmanager.cpp.

Function Documentation

◆ CreateCompatibleS57Object()

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

Definition at line 4397 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 4254 of file pluginmanager.cpp.

◆ GetInstalled()

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

Return sorted list of all installed plugins.

Definition at line 2478 of file pluginmanager.cpp.

◆ getInstalledVersion()

SemanticVersion getInstalledVersion ( const std::string  name)

Definition at line 423 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 4263 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 4271 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 4265 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 4267 of file pluginmanager.cpp.

◆ message_by_status()

wxString message_by_status ( PluginStatus  stat)

Definition at line 318 of file pluginmanager.cpp.

◆ NotifySetupOptionsPlugin()

void NotifySetupOptionsPlugin ( const PlugInData pic)

Definition at line 1579 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 5402 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 5165 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 5307 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 5451 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 5422 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 4258 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 4646 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 4636 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 4627 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 4614 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 4350 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 4332 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 4336 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 4654 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 4390 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 4343 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 4697 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 4357 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 4683 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 4772 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 4855 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 4730 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 4932 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 4506 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 4658 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 4695 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 4573 of file pluginmanager.cpp.

◆ RenderRotateToViewPort()

void RenderRotateToViewPort ( const ViewPort VPoint)

Definition at line 3883 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 4250 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 5301 of file pluginmanager.cpp.

◆ UndoRenderRotateToViewPort()

void UndoRenderRotateToViewPort ( const ViewPort VPoint)

Definition at line 3892 of file pluginmanager.cpp.

◆ UpdatePIObjectPlibContext()

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

Definition at line 4582 of file pluginmanager.cpp.

Variable Documentation

◆ g_download_condition

_OCPN_DLCondition g_download_condition

Definition at line 5005 of file pluginmanager.cpp.

◆ g_download_status

_OCPN_DLStatus g_download_status

Definition at line 5004 of file pluginmanager.cpp.

◆ g_pi_manager

PlugInManager* g_pi_manager

Global instance.

Definition at line 177 of file pluginmanager.cpp.

◆ g_piEventHandler

PI_DLEvtHandler* g_piEventHandler

Definition at line 5162 of file pluginmanager.cpp.

◆ plocale_def_lang

wxLocale* plocale_def_lang
extern

Definition at line 271 of file ocpn_app.cpp.

◆ s_ppim

PlugInManager* s_ppim

Definition at line 835 of file pluginmanager.cpp.

◆ wxEVT_DOWNLOAD_EVENT

DECL_EXP wxEventType wxEVT_DOWNLOAD_EVENT = wxNewEventType()

Definition at line 5002 of file pluginmanager.cpp.

◆ wxEVT_OCPN_MSG

const wxEventType wxEVT_OCPN_MSG = wxNewEventType()

Definition at line 791 of file pluginmanager.cpp.