Skip to content

Commit fd7099d

Browse files
committed
Several changes:
- Made it possible to choose between standalone Asio and Boost.Asio at compile time - Made it possible to use compiled Wt without Boost headers when using standalone Asio - fix illegal use of modelindexes after removal (reported on Wt forum) - issue #5428: changed headers() implementation from map to vector - Fix issue 5463: Documentation missing on WModelIndexSet - issue #5314: WStackedWidget in a layout can receive incorrect height after animation - issue #5329: documented limitations to setTransitionAnimation - More debug logging for ackId checking - Wt.min.js: fixed if statement being optimized away by minifier
1 parent ed99039 commit fd7099d

Some content is hidden

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

90 files changed

+790
-546
lines changed

CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ SET(GM_PREFIX ${USERLIB_PREFIX} CACHE PATH
278278
SET(SKIA_PREFIX ${USERLIB_PREFIX} CACHE PATH
279279
"Prefix of skia library (overrides USERLIB_PREFIX)")
280280
SET(WT_TZDATA_INSTALL "." CACHE PATH "The location where the time zone data is installed (defaults to current working directory)")
281+
SET(ASIO_PREFIX ${USERLIB_PREFIX} CACHE PATH
282+
"Prefix of Asio (overrides USERLIB_PREFIX), only used when WT_ASIO_IMPLEMENTATION is standalone")
281283

282284
OPTION(DEBUG "Support for debugging, must be enabled also in wt_config.xml" OFF)
283285

@@ -433,6 +435,31 @@ ELSE (${WT_CPP17_ANY_IMPLEMENTATION} STREQUAL "thelink2012")
433435
MESSAGE(FATAL_ERROR "WT_CPP17_ANY_IMPLEMENTATION must be one of thelink2012, experimental, or std")
434436
ENDIF (${WT_CPP17_ANY_IMPLEMENTATION} STREQUAL "thelink2012")
435437

438+
SET(WT_ASIO_DEFAULT_IMPLEMENTATION "boost")
439+
SET(WT_ASIO_IMPLEMENTATION ${WT_ASIO_DEFAULT_IMPLEMENTATION} CACHE STRING
440+
"Implementation of Asio to use. Defaults to \"boost\". Use \"standalone\" and provide its path in ASIO_PREFIX to use the standalone version.")
441+
442+
IF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 8)
443+
MESSAGE(STATUS "Informational: WT_ASIO_IMPLEMENTATION should be boost, or standalone")
444+
ELSE (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 8)
445+
SET_PROPERTY(CACHE WT_ASIO_IMPLEMENTATION PROPERTY STRINGS boost standalone)
446+
ENDIF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 8)
447+
448+
IF (${WT_ASIO_IMPLEMENTATION} STREQUAL "boost")
449+
SET(WT_ASIO_IS_BOOST_ASIO ON)
450+
ELSEIF(${WT_ASIO_IMPLEMENTATION} STREQUAL "standalone")
451+
SET(WT_ASIO_IS_STANDALONE_ASIO ON)
452+
ELSE(${WT_ASIO_IMPLEMENTATION} STREQUAL "boost")
453+
MESSAGE(FATAL_ERROR "WT_ASIO_IMPLEMENTATION must be boost or standalone")
454+
ENDIF(${WT_ASIO_IMPLEMENTATION} STREQUAL "boost")
455+
456+
IF(WT_ASIO_IS_STANDALONE_ASIO)
457+
IF(NOT EXISTS "${ASIO_PREFIX}/include/asio.hpp")
458+
MESSAGE(FATAL_ERROR "WT_ASIO_IMPLEMENTATION is set to standalone, but Asio was not found in ASIO_PREFIX")
459+
ENDIF(NOT EXISTS "${ASIO_PREFIX}/include/asio.hpp")
460+
INCLUDE_DIRECTORIES("${ASIO_PREFIX}/include")
461+
ENDIF(WT_ASIO_IS_STANDALONE_ASIO)
462+
436463
FIND_PACKAGE(Doxygen)
437464

438465
# Boost is used nearly everywhere, so we can put these here

WConfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
#cmakedefine WT_ANY_IS_EXPERIMENTAL_ANY
4040
#cmakedefine WT_ANY_IS_STD_ANY
4141

42+
#cmakedefine WT_ASIO_IS_BOOST_ASIO
43+
#cmakedefine WT_ASIO_IS_STANDALONE_ASIO
44+
4245
// our win32: WIN32 (gcc) or _WIN32 (MSC)
4346
#if defined(WIN32) || defined(_WIN32)
4447
#define WT_WIN32 1

examples/feature/socketnotifier/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This is an example that illustrates the use of the `WSocketNotifier` API
55
to monitor one or more sockets within a Wt application.
66

77
If you need only to monitor networking sockets, then you can also use
8-
boost::asio, using the boost::asio service available from
8+
asio, using the asio service available from
99
`WServer::ioService()`.
1010

1111
How to run

examples/qrlogin/model/QRAuthService.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void QRAuthService::remoteLogin(QRTokenDatabase& database,
122122
}
123123
}
124124

125-
void QRAuthService::handleHttpResponse(boost::system::error_code err,
125+
void QRAuthService::handleHttpResponse(Wt::Asio::error_code err,
126126
const Http::Message& response,
127127
Http::Client *client) const
128128
{

examples/qrlogin/model/QRAuthService.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
#define QR_AUTH_SERVICE_H_
99

1010
#include <string>
11-
#include <system_error>
1211
#include <Wt/WGlobal.h>
1312
#include <Wt/Http/Client.h>
1413

14+
// #include <system_error> for standalone Asio
15+
// #include <boost/system/system_error.hpp> for Boost.Asio
16+
#include <Wt/Asio/system_error.hpp>
17+
1518
using namespace Wt;
1619

1720
class QRTokenDatabase;
@@ -42,7 +45,7 @@ class QRAuthService
4245
const Auth::AuthService& baseAuth_;
4346
std::string redirectParameter_;
4447

45-
void handleHttpResponse(boost::system::error_code err,
48+
void handleHttpResponse(Wt::Asio::error_code err,
4649
const Http::Message& response,
4750
Http::Client *client) const;
4851
};

resources/webkit-transitions.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108

109109

110110
@-webkit-keyframes slideinfromtop {
111-
from { -webkit-transform: translate3d(0,-100%,); }
111+
from { -webkit-transform: translate3d(0,-100%,0); }
112112
to { -webkit-transform: translate3d(0,0,0); }
113113
}
114114

src/Wt/Asio/asio.hpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// This may look like C code, but it's really -*- C++ -*-
2+
/*
3+
* Copyright (C) 2016 Emweb bvba, Herent, Belgium.
4+
*
5+
* See the LICENSE file for terms of use.
6+
*/
7+
#ifndef WT_ASIO_ASIO_H_
8+
#define WT_ASIO_ASIO_H_
9+
10+
#include "Wt/WConfig.h"
11+
12+
#ifdef WT_ASIO_IS_BOOST_ASIO
13+
14+
#include <boost/asio.hpp>
15+
16+
#else // WT_ASIO_IS_STANDALONE_ASIO
17+
18+
#include <asio.hpp>
19+
20+
#endif // WT_ASIO_IS_BOOST_ASIO
21+
22+
#include "namespace.hpp"
23+
24+
#endif // WT_ASIO_ASIO_H_

src/Wt/Asio/io_service.hpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// This may look like C code, but it's really -*- C++ -*-
2+
/*
3+
* Copyright (C) 2016 Emweb bvba, Herent, Belgium.
4+
*
5+
* See the LICENSE file for terms of use.
6+
*/
7+
#ifndef WT_ASIO_IO_SERVICE_H_
8+
#define WT_ASIO_IO_SERVICE_H_
9+
10+
#include "Wt/WConfig.h"
11+
12+
#ifdef WT_ASIO_IS_BOOST_ASIO
13+
14+
#include <boost/asio/io_service.hpp>
15+
16+
#else // WT_ASIO_IS_STANDALONE_ASIO
17+
18+
#include <asio/io_service.hpp>
19+
20+
#endif // WT_ASIO_IS_BOOST_ASIO
21+
22+
#include "namespace.hpp"
23+
24+
#endif // WT_ASIO_IO_SERVICE_H_

src/Wt/Asio/namespace.hpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// This may look like C code, but it's really -*- C++ -*-
2+
/*
3+
* Copyright (C) 2016 Emweb bvba, Herent, Belgium.
4+
*
5+
* See the LICENSE file for terms of use.
6+
*/
7+
#ifndef WT_ASIO_NAMESPACE_H_
8+
#define WT_ASIO_NAMESPACE_H_
9+
10+
#if defined(WT_ASIO_IS_BOOST_ASIO)
11+
12+
namespace Wt {
13+
namespace Asio {
14+
namespace asio = ::boost::asio;
15+
}
16+
}
17+
18+
#elif defined(WT_ASIO_IS_STANDALONE_ASIO)
19+
20+
namespace Wt {
21+
namespace Asio {
22+
namespace asio = ::asio;
23+
}
24+
}
25+
26+
#endif // WT_ASIO_IS_BOOST_ASIO
27+
28+
#endif // WT_ASIO_NAMESPACE_H_

src/Wt/Asio/ssl.hpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// This may look like C code, but it's really -*- C++ -*-
2+
/*
3+
* Copyright (C) 2016 Emweb bvba, Herent, Belgium.
4+
*
5+
* See the LICENSE file for terms of use.
6+
*/
7+
#ifndef WT_ASIO_SSL_H_
8+
#define WT_ASIO_SSL_H_
9+
10+
#include "Wt/WConfig.h"
11+
12+
#ifdef WT_ASIO_IS_BOOST_ASIO
13+
14+
#include <boost/asio/ssl.hpp>
15+
16+
#else // WT_ASIO_IS_STANDALONE_ASIO
17+
18+
#include <asio/ssl.hpp>
19+
20+
#endif // WT_ASIO_IS_BOOST_ASIO
21+
22+
#include "namespace.hpp"
23+
24+
#endif // WT_ASIO_SSL_H_

0 commit comments

Comments
 (0)