Skip to content

Commit

Permalink
Several changes:
Browse files Browse the repository at this point in the history
 - Release notes for Wt 3.3.7, bump version
 - Respond with 505 to strange versions, and only with HTTP/1.0 or HTTP/1.1
 - WAxis constructor should be public
 - Chart series selection: only select closest series if it is within 20px of the given point
 - Added touch drag documentation
 - Document new methods in WTimeEdit
 - Install instructions: set minimum Boost to the lowest version we test with
 - WFileDropWidget: use a different WResource for each upload, so we can't get a dataReceived() signal from a canceled upload, fixed cancel race condition
 - added PDF mimetype
 - fix unorthodox use of request to forward dataExceeded info broken by async handling in websession event queue
 - Fixed progressive bootstrap for WFileDropWidget
  • Loading branch information
RockinRoel committed Feb 1, 2017
1 parent c034339 commit 601fad0
Show file tree
Hide file tree
Showing 27 changed files with 313 additions and 114 deletions.
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ SET(CMAKE_MODULE_PATH

SET(VERSION_SERIES 3)
SET(VERSION_MAJOR 3)
SET(VERSION_MINOR 6)

SET(WT_SOVERSION 40)
SET(WTEXT_SOVERSION 40)
SET(WTHTTP_SOVERSION 40)
SET(WTFCGI_SOVERSION 40)
SET(WTISAPI_SOVERSION 16)
SET(WTDBO_SOVERSION 40)
SET(WTDBOSQLITE3_SOVERSION 40)
SET(WTDBOPOSTGRES_SOVERSION 40)
SET(WTDBOFIREBIRD_SOVERSION 40)
SET(WTDBOMYSQL_SOVERSION 40)
SET(WTTEST_SOVERSION 10)
SET(VERSION_MINOR 7)

SET(WT_SOVERSION 41)
SET(WTEXT_SOVERSION 41)
SET(WTHTTP_SOVERSION 41)
SET(WTFCGI_SOVERSION 41)
SET(WTISAPI_SOVERSION 17)
SET(WTDBO_SOVERSION 41)
SET(WTDBOSQLITE3_SOVERSION 41)
SET(WTDBOPOSTGRES_SOVERSION 41)
SET(WTDBOFIREBIRD_SOVERSION 41)
SET(WTDBOMYSQL_SOVERSION 41)
SET(WTTEST_SOVERSION 11)

IF(NOT SHARED_LIBS)
IF(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PROJECT_NAME = Wt
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 3.3.6
PROJECT_NUMBER = 3.3.7

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
Expand Down
38 changes: 19 additions & 19 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ Requirements
you can have both of them.

The built-in web server is more convenient during development and is
easier to setup.
easier to setup. It also allows you to use WebSockets.

The FastCGI based solution provides more flexibility for deployment of
the application. The built-in web server runs all sessions in a single
process, while the FastCGI based solution allows different deployment
schemes including dedicated processes per sessions.
The FastCGI based solution can be more convenient for deployment behind
another web server.

Each of these two choices correspond to a library, a so-called
connector library. Below it is outlined how to configure the build
Expand All @@ -38,7 +36,7 @@ Requirements
Preferably CMake 2.6, which comes with a usable script for finding
boost libraries, but CMake 2.4 is still supported using Wt's own
boost find script.
* [5]C++ boost library (preferably version 1.41 or higher), with or
* [5]C++ boost library (preferably version 1.46.1 or higher), with or
without thread support. You can verify you have a thread-enabled
boost installation by locating the libboost_thread library. Thread
support is not essential: Wt functionality is not affected except
Expand All @@ -49,10 +47,8 @@ Requirements
features will be disabled that depend on the revised versions of
spirit, namely JSON parsing and improved SQL parsing (for Wt::Dbo).
* Optionally, [6]OpenSSL, which is used to support the HTTPS protocol
in the web client, the HTTPS protocol in the built-in wthttpd
connector, additional cryptographic hash functions in the Auth
library, and WebSockets (which requires a SHA-1 hash
implementation).
in the web client, and the HTTPS protocol in the built-in wthttpd
connector.
* Optionally, [7]Haru Free PDF Library, which is used to provide
support for painting to PDF (WPdfImage).
* Optionally, [8]GraphicsMagick, for supporting painting to raster
Expand Down Expand Up @@ -80,8 +76,7 @@ Requirements
to enable optional features (you can also build without them), but
otherwise no extra dependencies are required.
* Optionally, zlib (libz), for compression over HTTP.
* Optionally, OpenSSL (libopenssl), for HTTPS and WebSockets (which
requires a SHA-1 hash implementation).
* Optionally, OpenSSL (libopenssl), for HTTPS.

2 Additional and optional requirements for some of the examples

Expand Down Expand Up @@ -124,10 +119,14 @@ Building and installing the Wt library
may help CMake by setting some variables to help CMake locate the
libraries. This may be done on the command-line using -Dvar=value or
using the interactive program:
$ ccmake .
$ ccmake ../

Variables that you may set to configure Wt's built-in boost finding
method:
or
$ cmake-gui ../

The GUI lists all variables that are configurable in Wt's build
process. Variables that you may set to configure Wt's built-in boost
finding method:

BOOST_COMPILER
The boost compiler signature. For a library
Expand All @@ -142,7 +141,8 @@ Building and installing the Wt library
lib/ and include/ are located for your boost installation.

Other variables specify several build and configuration aspects of Wt,
of which the most relevant ones are:
of which the most relevant ones are (there are many more visible in the
GUI):

CMAKE_INSTALL_PREFIX
Installation prefix for the library and include files)
Expand Down Expand Up @@ -333,9 +333,9 @@ HTTPS server options:

References

1. file://localhost/home/koen/project/wt/git/wt/INSTALL.html#requirements
2. file://localhost/home/koen/project/wt/git/wt/INSTALL.html#build
3. file://localhost/home/koen/project/wt/git/wt/INSTALL.html#examples
1. file:///home/roel/project/wt/git/wt/INSTALL.html#requirements
2. file:///home/roel/project/wt/git/wt/INSTALL.html#build
3. file:///home/roel/project/wt/git/wt/INSTALL.html#examples
4. http://www.cmake.org/
5. http://www.boost.org/
6. http://www.openssl.org/
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h3>1 Wt requirements</h3>
</div>
</li>
<li><a href="http://www.boost.org/">C++ boost library</a> (preferably
version 1.41 or higher), with or without thread support. You can
version 1.46.1 or higher), with or without thread support. You can
verify you have a thread-enabled boost installation by locating the
libboost_thread library. Thread support is not essential: Wt
functionality is not affected except for exotic things like server
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.win32.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h2>Requirements</h2>
build on the Express Edition, which is free (as in beer) to use.
<li>CMake cross-platform build system (www.cmake.org): cmake-2.6.x,
Windows version (2.8 or newer recommended).</li>
<li>Boost 1.36 (or later; a recent version is recommended)</li>
<li>Boost 1.46.1 (or later; a recent version is recommended)</li>
</ul>
</p>

Expand Down
82 changes: 82 additions & 0 deletions ReleaseNotes.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,88 @@ <h1>Wt Release notes</h1>
the way you build Wt, the way you configure Wt or the Wt API and
behaviour.

<h2>Release 3.3.7 (February ?, 2017)</h2>
<p>
This release fixes many bugs, but also introduces some new features:
</p>
<dl>
<dt>
<a href="classWt_1_1WFileDropWidget.html">WFileDropWidget</a>
</dt>
<dd>
The WFileDropWidget is a new widget that allows you to upload a file or multiple files by dragging them onto an area.
</dd>
<dt>
Scroll visibility
</dt>
<dd>
Some applications require you to know whether a widget is currently visible within the viewport, or whether it is
scrolled out of view, e.g. to load more content as you scroll down the page. You can now enable scroll visibility
detection with
<a href="classWt_1_1WWidget.html#a5d403e0390841df77a23445b28044d5d">WWidget::setScrollVisibilityEnabled(bool)</a>,
and react to changes in visibility with
<a href="classWt_1_1WWidget.html#aa5ce605dd465e06f3e3c2dbce2a4098e">WWidget::scrollVisibilityChanged()</a>.
A new scrollvisibility feature example has been added to demonstrate this infinite scrolling application.
</dd>
<dt>
Touch events
</dt>
<dd>
Although Wt already supported touch interactions in the charting library, touch events were previously
not exposed by Wt. Now,
we've added <a href="classWt_1_1WTouchEvent.html">WTouchEvent</a>, and the touchStarted, touchEnded, and touchMoved
events have been added to
<a href="classWt_1_1WInteractWidget.html">WInteractWidget</a>.
Also, <a href="classWt_1_1WInteractWidget.html#a556c14d02388720b1d95b2149be2e867">draggable widgets</a> can now also
be dragged after a long press, and you can select a range using a double touch in
<a href="classWt_1_1WTableView.html">WTableView</a> and <a href="classWt_1_1WTreeView.html">WTreeView</a>.
</dd>
<dt>
Combined session tracking mode
</dt>
<dd>
<p>
The default session tracking method for Wt is URL rewriting, using JavaScript to hide the session id from
the address bar. Alternatively, cookies can be used with the Auto option, falling back to URL rewriting when
cookies are not available. However, the cookie-based method did not allow for multiple sessions within the
same browser.
</p>
<p>
In order to make the URL rewriting method with requirement 6.5.10 of the PCI Data Security Standard, while not
sacrificing the ability to have multiple sessions, a new Combined session tracking strategy has been added.
Wt already makes it difficult to steal a session when the session id is discovered, but resources are not as
protected. The Combined session tracking strategy uses URL rewriting in combination with a cookie that is shared
between sessions as an extra measure against session hijacking. This is the most secure strategy, but it will
deny access if cookie support is not available.
</p>
</dd>
<dt>
Wraparound for <a href="classWt_1_1WSpinBox.html">WSpinBox</a> and <a href="classWt_1_1WTimeEdit.html">WTimeEdit</a>
</dt>
<dd>
WSpinBox will now wrap around from its maximum to its minimum if you <a href="classWt_1_1WSpinBox.html#a08413e777fefab00e36dc8d6c492bda5">enable wraparound</a>. WTimeEdit will take advantage of this feature by default.
</dd>
<dt>
Some minor extra features:
</dt>
<dd>
<ul>
<li>
It's now possible to retrieve a vector of all request headers with <a href="classWt_1_1Http_1_1Request.html#a0afe45bf93bb77270a85c75ca67cd521">Wt::Http::Request::headers()</a> in <a href="classWt_1_1WResource.html#a3a740f8cc29e2e6e4e58defc9c88b8b6">handleRequest</a> when implementing a WResource. It is still recommended, and more efficient, to use <a href="classWt_1_1Http_1_1Request.html#ade2596aa6802a63e21460094ea30a4d9">headerValue</a>, but retrieving a vector of all headers could be useful for debugging purposes.
</li>
<li>
In an effort to reduce the amount of JavaScript generated by the charting API, the
<a href="classWt_1_1WPainter.html#abccad19493d7461ca08c9e50ad7326f1">WPainter::drawStencilAlongPath()</a>
method was added to WPainter.
</li>
<li>
Previously, WDialogs were movable by default. It's now possible to disable this with
<a href="classWt_1_1WDialog.html#afbccf557a0343591f3087c9a0a9b7051">WDialog::setMovable()</a>.
</li>
</ul>
</dd>
</dl>

<h2>Release 3.3.6 (July 13, 2016)</h2>
<p>
This release has a focus on bug fixes and some new features:
Expand Down
2 changes: 1 addition & 1 deletion examples/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Wt examples"
PROJECT_NUMBER = 3.3.6
PROJECT_NUMBER = 3.3.7
OUTPUT_DIRECTORY = ../doc/examples
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
Expand Down
6 changes: 4 additions & 2 deletions src/Wt/Chart/WAxis
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ public:
*/
static const double AUTO_MAXIMUM;

/*! \brief Constructor
*/
WAxis();

/*! \brief Destructor
*/
virtual ~WAxis();
Expand Down Expand Up @@ -970,8 +974,6 @@ protected:
TickLabel(double v, TickLength length, const WString& l = WString());
};

WAxis();

/*! \brief Returns the label (and ticks) information for this axis.
*/
virtual void getLabelTicks(std::vector<TickLabel>& ticks, int segment, AxisConfig config) const;
Expand Down
2 changes: 1 addition & 1 deletion src/Wt/Chart/WCartesianChart
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ public:
/*! \brief A signal that notifies the selection of a new curve.
*
* This signal is emitted if a series is selected using a mouse
* click or long press. The first argument is the model column of the selected
* click or long press. The first argument is the selected
* series. The second argument is the point that was selected, in model
* coordinates.
*
Expand Down
32 changes: 23 additions & 9 deletions src/Wt/Chart/WCartesianChart.C
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace {
const int TICK_LENGTH = 5;
const int CURVE_LABEL_PADDING = 10;
const int DEFAULT_CURVE_LABEL_WIDTH = 100;
const int CURVE_SELECTION_DISTANCE_SQUARED = 400; // Maximum selection distance in pixels, squared

inline int toZoomLevel(double zoomFactor)
{
Expand Down Expand Up @@ -4064,11 +4065,14 @@ void WCartesianChart::yTransformChanged()

void WCartesianChart::jsSeriesSelected(double x, double y)
{
if (!seriesSelectionEnabled()) return;
WPointF p = zoomRangeTransform(xTransformHandle_.value(), yTransformHandle_.value()).inverted().map(WPointF(x,y));
if (!seriesSelectionEnabled())
return;
WTransform transform = zoomRangeTransform(xTransformHandle_.value(), yTransformHandle_.value());
WPointF p = transform.inverted().map(WPointF(x,y));
double smallestSqDistance = std::numeric_limits<double>::infinity();
const WDataSeries *closestSeries = 0;
WPointF closestPoint;
WPointF closestPointPx;
WPointF closestPointBeforeSeriesTransform;
for (std::size_t i = 0; i < series_.size(); ++i) {
const WDataSeries &series = *series_[i];
if (!series.isHidden() && (series.type() == LineSeries || series.type() == CurveSeries)) {
Expand All @@ -4082,22 +4086,32 @@ void WCartesianChart::jsSeriesSelected(double x, double y)
WPointF segP = t.map(WPointF(seg.x(), seg.y()));
double dx = p.x() - segP.x();
double dy = p.y() - segP.y();
double d = dx * dx + dy * dy;
if (d < smallestSqDistance) {
smallestSqDistance = d;
double d2 = dx * dx + dy * dy;
if (d2 < smallestSqDistance) {
smallestSqDistance = d2;
closestSeries = &series;
closestPoint = p;
closestPointPx = segP;
closestPointBeforeSeriesTransform = WPointF(seg.x(), seg.y());
}
}
}
}
}
{
WPointF closestDisplayPoint = transform.map(closestPointPx);
double dx = closestDisplayPoint.x() - x;
double dy = closestDisplayPoint.y() - y;
double d2 = dx * dx + dy * dy;
if (d2 > CURVE_SELECTION_DISTANCE_SQUARED) {
return;
}
}
setSelectedSeries(closestSeries);
if (closestSeries) {
seriesSelected_.emit(closestSeries,
mapFromDeviceWithoutTransform(closestPoint, closestSeries->axis()));
mapFromDeviceWithoutTransform(closestPointBeforeSeriesTransform, closestSeries->axis()));
} else {
seriesSelected_.emit(0, mapFromDeviceWithoutTransform(closestPoint, YAxis));
seriesSelected_.emit(0, mapFromDeviceWithoutTransform(closestPointBeforeSeriesTransform, YAxis));
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/Wt/WFileDropWidget
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ public:
*/
Signal<File*>& uploadFailed() { return uploadFailed_; }

protected:
virtual void enableAjax() WT_CXX11ONLY(override);

private:
class WFileDropUploadResource : public WResource {
public:
Expand All @@ -194,12 +197,14 @@ private:
File *currentFile_;
};

void setup();
void handleDrop(const std::string& newDrops);
void handleTooLarge(::uint64_t size);
void handleSendRequest(int id);
void emitUploaded(int id);
void stopReceiving();
void onData(::uint64_t current, ::uint64_t total);
void onDataExceeded(::uint64_t dataExceeded);

// Functions for handling incoming requests
void setUploadedFile(Http::UploadedFile file);
Expand Down
Loading

0 comments on commit 601fad0

Please sign in to comment.