OpenCPN Partial API docs
Loading...
Searching...
No Matches
dychart.h
1/**************************************************************************
2 * Copyright (C) 2010 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24//----------------------------------------------------------------------------------
25// Global Build options for opencpn
26//----------------------------------------------------------------------------------
27#ifndef _DYCHART_H_
28#define _DYCHART_H_
29
30#include <cmath>
31#include <algorithm>
32
33#include "gl_headers.h"
34
35#include "config.h"
36
37#ifdef __WXMSW__
38#include "wx/msw/private.h"
39#endif
40
41#ifdef __VISUALC__ // Memory Leak Detection Code
42#include <wx/msw/msvcrt.h>
43#endif
44
45#ifdef __ANDROID__
46#include "qdebug.h"
47#endif
48
49// Profiling support
50// #include "/usr/include/valgrind/callgrind.h"
51
52// Chart cacheing policy defaults
53
54#define CACHE_N_LIMIT_DEFAULT 20 // Cache no more than n charts
55
56#define CACHE_MEM_LIMIT_DEFAULT 0 // Application memory useage target, kBytes
57
58// If defined, update the system time using GPS receiver data.
59// Time update is applied if the system time and GPS time differ
60// by more than one minute, and only once per session.
61// On Linux, this option requires root privileges, obtained by sudo.
62// Thus, the following line is required in etc/sudoers:
63//
64// nav ALL=NOPASSWD:/bin/date -s *
65//
66// Where "nav" is the user's user name.
67//
68// Also, the opencpn configuration file must contain the key
69// [Settings]
70// SetSystemTime=1
71// For security, this option is not available on the "Options" dialog
72#define ocpnUPDATE_SYSTEM_TIME
73
74//------------------------------------------------------------------------------
75// Some private, app global type definitions
76//------------------------------------------------------------------------------
77
78//------------------------------------------------------------------------------
79// Various compile time options
80//------------------------------------------------------------------------------
81
82#ifdef __MSVC__
83#pragma warning(disable : 4114)
84#pragma warning( \
85 disable : 4284) // This one is to do with "reverse iterator UDT..." Huh?
86#endif
87
88// Following definition required by GDAL
89#define notdef 1
90
91#ifdef __MSVC__
92// __MSVC__ randomly does not link snprintf, or _snprintf
93// Replace it with a local version, code is in cutil.c
94#undef snprintf
95#define snprintf mysnprintf
96#endif
97
98//------------------------------------------------------------------------------
99// Some Build constants
100//------------------------------------------------------------------------------
101
102// Home Base, used if the config file lat/lon seems bogus or missing
103
104// #define START_LAT 35.1025 // New Bern (Ver 1.0)
105// #define START_LON -77.0342
106
107// #define START_LAT 26.783 // Green Turtle Key (Ver 1.2)
108// #define START_LON -77.333
109
110// #define START_LAT 25.786 // Miami Beach (Ver 1.2.2)
111// #define START_LON -80.148
112
113#define START_LAT 33.358 // Georgetown, SC (Ver 1.2.4)
114#define START_LON -79.282
115
116//----------------------------------------------------------------------------
117// Environment Access functions
118//----------------------------------------------------------------------------
119#ifdef __MSVC__
120#define _putenv _putenv // This is for MSVC
121#else
122#define _putenv putenv // This is for other Windows compiler
123#endif
124
125//----------------------------------------------------------------------------
126// Use the CPL Portability library only if S57 is enabled
127//----------------------------------------------------------------------------
128
129#define USE_CPL
130// #include "gdal/cpl_port.h"
131
132#ifndef NULL
133#define NULL 0
134#endif
135
136/***********************************************************************
137 * Define __POSIX__ to imply posix thread model compatibility
138 * Especially used for communication port multithreading.
139 *
140 * Posix thread model is available on selected platforms, see code.
141 */
142
143#ifdef __POSIX__
144#undef __POSIX__
145#endif
146
147#ifdef __WXOSX__
148#define __POSIX__
149#endif
150
151#ifdef __WXGTK__
152#define __POSIX__
153#endif
154
155#endif // __FILE__
Platform independent GL includes.