Skip to content

Commit 42a9ce4

Browse files
committed
Several changes:
- Wt 4 specific: - Remove old throwing getCookie and rename getCookieValue to getCookie - Require CMake 3.1 or higher - Use CMAKE_CXX_STANDARD instead of WT_CPP_11_MODE - Use .h files in includes in WFileUpload.C - WLocale can be globally set (threadlocal) - Utils::st* casts now use std::invalid_argument exceptions so we use the same exception for when nothing can be converted - use std::invalid_argument for string to int conversion in blog example - Merges from master: - Fixed crash on missing err parameter in jserror request - WebSockets frame size integer overflow check - Fix #5597: iOS does not detect click events on non-clickable objects, detect 'clicks' with touchevents instead - Removed obsolete WtSoundManager.as - for wtisapi static library create named PDB files - SessionProcessManager: sessionsMutex_ should be mutable for use in sessions() - Generate documentation for WFlags - Only retrigger click on document when object is a WPopupWidget, fixes issue with WPopupMenu - Added missing lock in SessionProcessManager::sessions() - Fixed WTableView data disappearing with column resizes bug - Clearer exception for collection<C>::iterator::operator* - Added missing WT_API for Wt::utf8 - Omit default ports for corresponding protocols (Suggestion of issue #2018) - Added documentation that submenu of popup menu should be a popup menu - Charts: create paint device (if there is none) before font metrics check - Updated overview with latest command line arguments, clarified --http(s)address (issue #5586) - Fixed single touch without rubberband effect causing series select - Updated sqlite to 3.17.0 - Issue #5574: more documentation for font selection of WPdfRenderer - more space for text in wide legend columns
1 parent 08b73ba commit 42a9ce4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+89102
-40729
lines changed

CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
22

33
SET(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE true)
44

@@ -109,12 +109,11 @@ OPTION(ENABLE_LIBWTDBO "Build Wt::Dbo" ON)
109109
OPTION(WT_NO_STD_LOCALE "Build Wt to run on a system without std::locale support" OFF)
110110
OPTION(WT_NO_STD_WSTRING "Build Wt to run on a system without std::wstring support" OFF)
111111
OPTION(ENABLE_OPENGL "Build Wt with support for server-side opengl rendering" ON)
112+
OPTION(WT_WARN_HEADER_MISSING_H "Output a warning if a Wt header without .h extension is included (deprecated since Wt 4.0.0)" ON)
112113

113-
IF(NOT MSVC)
114-
#MSVC always enables its c++11 features by default
115-
SET(WT_CPP_11_MODE "-std=c++11" CACHE STRING "C++ mode to compile Wt in (defaults to -std=c++11, you can set it to -std=c++11, -std=c++0x, -std=c++14,...)")
116-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WT_CPP_11_MODE}")
117-
ENDIF(NOT MSVC)
114+
IF(NOT CMAKE_CXX_STANDARD)
115+
SET(CMAKE_CXX_STANDARD 11)
116+
ENDIF(NOT CMAKE_CXX_STANDARD)
118117

119118
IF(MSVC)
120119
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
@@ -417,7 +416,7 @@ ENDIF (${WT_WRASTERIMAGE_IMPLEMENTATION} STREQUAL "GraphicsMagick")
417416

418417
SET(WT_CPP17_ANY_DEFAULT_IMPLEMENTATION "thelink2012")
419418
SET(WT_CPP17_ANY_IMPLEMENTATION ${WT_CPP17_ANY_DEFAULT_IMPLEMENTATION} CACHE STRING
420-
"Implementation for Wt::cpp17::any. Defaults to \"thelink2012\": an included implementation of any by GitHub user thelink2012. Use \"std\" for std::any, or \"experimental\" for std::experimental::any, if compiler support is available. You may have to change WT_CPP_11_MODE to enable C++17 support in the compiler.")
419+
"Implementation for Wt::cpp17::any. Defaults to \"thelink2012\": an included implementation of any by GitHub user thelink2012. Use \"std\" for std::any, or \"experimental\" for std::experimental::any, if compiler support is available. You may have to change CMAKE_CXX_STANDARD to enable C++17 support in the compiler.")
421420

422421
IF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 8)
423422
MESSAGE(STATUS "Informational: WT_CPP17_ANY_IMPLEMENTATION should be thelink2012, experimental, or std")

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ FULL_PATH_NAMES = YES
138138
# If left blank the directory from which doxygen is run is used as the
139139
# path to strip.
140140

141-
STRIP_FROM_PATH = /home/dietrich/project/wt/git/wt
141+
STRIP_FROM_PATH = /home/roel/project/wt/git/wt
142142

143143
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
144144
# the path mentioned in the documentation of a class, which tells

WConfig.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#cmakedefine WT_ASIO_IS_BOOST_ASIO
4343
#cmakedefine WT_ASIO_IS_STANDALONE_ASIO
4444

45+
#cmakedefine WT_WARN_HEADER_MISSING_H
46+
4547
// our win32: WIN32 (gcc) or _WIN32 (MSC)
4648
#if defined(WIN32) || defined(_WIN32)
4749
#define WT_WIN32 1

doc/main

Lines changed: 86 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -818,56 +818,96 @@ The configuration file syntax is line based:
818818
Allowed options:
819819

820820
General options:
821-
-h [ --help ] produce help message
822-
-t [ --threads ] arg (=10) number of threads
823-
--servername arg (=vierwerf) servername (IP address or DNS name)
824-
--docroot arg document root for static files, optionally
825-
followed by a comma-separated list of paths
826-
with static files (even if they are within a
827-
deployment path), after a ';'
828-
829-
e.g. --docroot=".;/favicon.ico,/resources,/style"
830-
831-
--approot arg application root for private support files; if
832-
unspecified, the value of the environment
833-
variable $WT_APP_ROOT is used, or else the
834-
current working directory
835-
--docroot-static arg comma-separated list of paths that correspond
836-
to static files, even if they are within a
837-
deployment path
838-
--errroot arg root for error pages
839-
--accesslog arg access log file (defaults to stdout)
840-
--no-compression do not use compression
841-
--deploy-path arg (=/) location for deployment
842-
--session-id-prefix arg prefix for session-id's (overrides
843-
wt_config.xml setting)
844-
-p [ --pid-file ] arg path to pid file (optional)
845-
-c [ --config ] arg location of wt_config.xml; if unspecified, the
846-
value of the environment variable
847-
$WT_CONFIG_XML is used, or else the built-in
848-
default (/etc/wt/wt_config.xml) is tried, or
849-
else built-in defaults are used
850-
--max-memory-request-size arg threshold for request size (bytes), for
851-
spooling the entire request to disk to avoid,
852-
to avoid DoS
853-
--gdb do not shutdown when receiving Ctrl-C (and let
854-
gdb break instead)
821+
-h [ --help ] produce help message
822+
-t [ --threads ] arg (=-1) number of threads (-1 indicates that
823+
num_threads from wt_config.xml is to be
824+
used, which defaults to 10)
825+
--servername arg servername (IP address or DNS name)
826+
--docroot arg document root for static files,
827+
optionally followed by a
828+
comma-separated list of paths with
829+
static files (even if they are within a
830+
deployment path), after a ';'
831+
832+
e.g. --docroot=".;/favicon.ico,/resourc
833+
es,/style"
834+
835+
--approot arg application root for private support
836+
files; if unspecified, the value of the
837+
environment variable $WT_APP_ROOT is
838+
used, or else the current working
839+
directory
840+
--errroot arg root for error pages
841+
--accesslog arg access log file (defaults to stdout),
842+
to disable access logging completely,
843+
use --accesslog=-
844+
--no-compression do not use compression
845+
--deploy-path arg (=/) location for deployment
846+
--session-id-prefix arg prefix for session IDs (overrides
847+
wt_config.xml setting)
848+
-p [ --pid-file ] arg path to pid file (optional)
849+
-c [ --config ] arg location of wt_config.xml; if
850+
unspecified, the value of the
851+
environment variable $WT_CONFIG_XML is
852+
used, or else the built-in default
853+
(/etc/wt/wt_config.xml) is tried,
854+
or else built-in defaults are used
855+
--max-memory-request-size arg (=131072)
856+
threshold for request size (bytes), for
857+
spooling the entire request to disk, to
858+
avoid DoS
859+
--gdb do not shutdown when receiving Ctrl-C
860+
(and let gdb break instead)
855861

856862
HTTP/WebSocket server options:
857-
--http-address arg IPv4 (e.g. 0.0.0.0) or IPv6 Address (e.g. 0::0)
858-
--http-port arg (=80) HTTP port (e.g. 80)
863+
--http-address arg IPv4 (e.g. 0.0.0.0) or IPv6 Address
864+
(e.g. 0::0). You must specify either
865+
this option or --https-address (or
866+
both)
867+
--http-port arg (=80) HTTP port (e.g. 80)
859868

860869
HTTPS/Secure WebSocket server options:
861-
--https-address arg IPv4 (e.g. 0.0.0.0) or IPv6 Address (e.g. 0::0)
862-
--https-port arg (=443) HTTPS port (e.g. 443)
863-
--ssl-certificate arg SSL server certificate chain file
864-
e.g. "/etc/ssl/certs/vsign1.pem"
865-
--ssl-private-key arg SSL server private key file
866-
e.g. "/etc/ssl/private/company.pem"
867-
--ssl-tmp-dh arg File for temporary Diffie-Hellman parameters
868-
e.g. "/etc/ssl/dh512.pem"
869-
--ssl-client-verification arg (=none) Enable SSL Client Certificate verification.
870-
Can be required, once, optional or none
870+
--https-address arg IPv4 (e.g. 0.0.0.0) or IPv6 Address
871+
(e.g. 0::0). You must specify either
872+
this option or --http-address (or both)
873+
--https-port arg (=443) HTTPS port (e.g. 443)
874+
--ssl-certificate arg SSL server certificate chain file
875+
e.g. "/etc/ssl/certs/vsign1.pem"
876+
--ssl-private-key arg SSL server private key file
877+
e.g. "/etc/ssl/private/company.pem"
878+
--ssl-tmp-dh arg File for temporary Diffie-Hellman
879+
parameters
880+
e.g. "/etc/ssl/dh512.pem"
881+
--ssl-enable-v3 Switch on SSLv3 support (not
882+
recommended; disabled by default)
883+
--ssl-client-verification arg (=none) The verification mode for client
884+
certificates.
885+
This is either 'none', 'optional' or
886+
'required'. When 'none', the server
887+
will not request a client certificate.
888+
When 'optional', the server will
889+
request a certificate, but the client
890+
does not have to supply one. With
891+
'required', the connection will be
892+
terminated if the client does not
893+
provide a valid certificate.
894+
--ssl-verify-depth arg (=1) Specifies the maximum length of the
895+
server certificate chain.
896+
897+
--ssl-ca-certificates arg Path to a file containing the
898+
concatenated trusted CA certificates,
899+
which can be used to authenticate the
900+
client. The file should contains a a
901+
number of PEM-encoded certificates.
902+
903+
--ssl-cipherlist arg List of acceptable ciphers for SSL.
904+
This list is passed as-is to the SSL
905+
layer, so see openssl for the proper
906+
syntax. When empty, the default
907+
acceptable cipher list will be used.
908+
Example cipher list string:
909+
"TLSv1+HIGH:!SSLv2"
910+
871911

872912
Settings may be set in the configuration file /etc/wt/wthttpd
873913
\endcode

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ IF("${CMAKE_CURRENT_LIST_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
3131
IF(WIN32)
3232
# preamble to make this a toplevel CMakeLists.txt for Windows, intended
3333
# for being used
34-
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
34+
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
3535

3636
Project(WtExamples)
3737

examples/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ABBREVIATE_BRIEF = "The $name class" \
2424
ALWAYS_DETAILED_SEC = NO
2525
INLINE_INHERITED_MEMB = NO
2626
FULL_PATH_NAMES = YES
27-
STRIP_FROM_PATH = /home/kdforc0/project/wt/examples
27+
STRIP_FROM_PATH = /home/roel/project/wt/examples
2828
STRIP_FROM_INC_PATH =
2929
SHORT_NAMES = NO
3030
JAVADOC_AUTOBRIEF = NO

examples/blog/view/BlogView.C

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,12 @@
3535
namespace dbo = Wt::Dbo;
3636

3737
namespace {
38-
struct ConversionException : public std::exception {
39-
};
40-
4138
static int try_stoi(const std::string &v)
4239
{
4340
std::size_t pos;
4441
auto result = std::stoi(v, &pos);
4542
if (pos != v.length())
46-
throw ConversionException{};
43+
throw std::invalid_argument("stoi() of " + v + " failed");
4744
return result;
4845
}
4946
}
@@ -403,7 +400,7 @@ private:
403400
lower.setDate(year, 1, 1);
404401
upper = lower.addYears(1);
405402
}
406-
} catch (ConversionException &) {
403+
} catch (std::invalid_argument &) {
407404
showError(tr("blog-no-post"));
408405
return;
409406
}

src/Wt/Auth/AuthModel.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ User AuthModel::processAuthToken()
230230

231231
if (baseAuth()->authTokensEnabled()) {
232232
const std::string *token =
233-
env.getCookieValue(baseAuth()->authTokenCookieName());
233+
env.getCookie(baseAuth()->authTokenCookieName());
234234

235235
if (token) {
236236
AuthTokenResult result = baseAuth()->processAuthToken(*token, users());

src/Wt/Chart/WCartesianChart.C

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2430,9 +2430,16 @@ bool WCartesianChart::initLayout(const WRectF& rectangle, WPaintDevice *device)
24302430
for (int i = 0; i < 3; ++i)
24312431
location_[i] = AxisValue::Minimum;
24322432

2433+
std::unique_ptr<WPaintDevice> created;
2434+
WPaintDevice *d = device;
2435+
if (!d) {
2436+
created = createPaintDevice();
2437+
d = created.get();
2438+
}
2439+
24332440
bool autoLayout = isAutoLayoutEnabled();
2434-
if (autoLayout &&
2435-
(!device || (device->features() & PaintDeviceFeatureFlag::FontMetrics).empty())) {
2441+
if (autoLayout &&
2442+
((d->features() & PaintDeviceFeatureFlag::FontMetrics).empty())) {
24362443
LOG_ERROR("setAutoLayout(): device does not have font metrics "
24372444
"(not even server-side font metrics).");
24382445
autoLayout = false;
@@ -2456,13 +2463,6 @@ bool WCartesianChart::initLayout(const WRectF& rectangle, WPaintDevice *device)
24562463
return false;
24572464
}
24582465

2459-
std::unique_ptr<WPaintDevice> created;
2460-
WPaintDevice *d = device;
2461-
if (!d) {
2462-
created = createPaintDevice();
2463-
d = created.get();
2464-
}
2465-
24662466
{
24672467
WMeasurePaintDevice md(d);
24682468
WPainter painter(&md);
@@ -2493,6 +2493,8 @@ bool WCartesianChart::initLayout(const WRectF& rectangle, WPaintDevice *device)
24932493
}
24942494
}
24952495

2496+
created.reset();
2497+
24962498
calcChartArea();
24972499

24982500
bool result = chartArea_.width() > 5 && chartArea_.height() > 5 && prepareAxes();
@@ -2660,7 +2662,10 @@ void WCartesianChart::renderLegendItem(WPainter& painter,
26602662
#else
26612663
painter.setPen(fontPen);
26622664
#endif
2663-
painter.drawText(pos.x() + 23, pos.y() - 9, 100, 20,
2665+
int width = (int)legendColumnWidth().toPixels();
2666+
if (width < 100)
2667+
width = 100;
2668+
painter.drawText(pos.x() + 23, pos.y() - 0, width, 20,
26642669
AlignmentFlag::Left | AlignmentFlag::Middle,
26652670
series.model()->headerData(series.modelColumn()));
26662671
}

0 commit comments

Comments
 (0)