Skip to content

Commit aff668a

Browse files
author
Koen Deforche
committed
fix #489, #493, and other misc bugs
1 parent 9dfc21c commit aff668a

File tree

18 files changed

+108
-101
lines changed

18 files changed

+108
-101
lines changed

CMakeLists.txt

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -216,22 +216,6 @@ ELSE(DEBUG)
216216
SET(WT_DEBUG_ENABLED 0)
217217
ENDIF(DEBUG)
218218

219-
# Compile time constants & make sure our build finds it
220-
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Wt)
221-
SET(WCONFIG_H_PATH ${CMAKE_CURRENT_BINARY_DIR}/Wt/WConfig.h)
222-
CONFIGURE_FILE(
223-
${WT_SOURCE_DIR}/WConfig.h.in
224-
${WCONFIG_H_PATH}
225-
)
226-
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
227-
INSTALL_FILES(/include/Wt FILES ${WCONFIG_H_PATH})
228-
229-
# Generate wt_config.xml from wt_config.xml.in
230-
CONFIGURE_FILE(
231-
${WT_SOURCE_DIR}/wt_config.xml.in
232-
${WT_BINARY_DIR}/wt_config.xml
233-
)
234-
235219
ADD_CUSTOM_TARGET(doc)
236220

237221
IF (ASCIIDOC_FOUND)
@@ -279,3 +263,28 @@ INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/resources DESTINATION
279263
IF(NOT EXISTS ${CONFIGDIR}/wt_config.xml)
280264
INSTALL(FILES ${WT_BINARY_DIR}/wt_config.xml DESTINATION ${CONFIGDIR})
281265
ENDIF (NOT EXISTS ${CONFIGDIR}/wt_config.xml)
266+
267+
IF(HARU_FOUND)
268+
SET(WT_HAS_WPDFIMAGE true)
269+
ENDIF(HARU_FOUND)
270+
271+
IF(GM_FOUND)
272+
SET(WT_HAS_WRASTERIMAGE true)
273+
ENDIF(GM_FOUND)
274+
275+
# Compile time constants & make sure our build finds it
276+
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Wt)
277+
SET(WCONFIG_H_PATH ${CMAKE_CURRENT_BINARY_DIR}/Wt/WConfig.h)
278+
CONFIGURE_FILE(
279+
${WT_SOURCE_DIR}/WConfig.h.in
280+
${WCONFIG_H_PATH}
281+
)
282+
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
283+
INSTALL_FILES(/include/Wt FILES ${WCONFIG_H_PATH})
284+
285+
# Generate wt_config.xml from wt_config.xml.in
286+
CONFIGURE_FILE(
287+
${WT_SOURCE_DIR}/wt_config.xml.in
288+
${WT_BINARY_DIR}/wt_config.xml
289+
)
290+

WConfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#cmakedefine WT_EXT_STATIC
2727
#cmakedefine WT_EXT_STATIC
2828

29+
#cmakedefine WT_HAS_WRASTERIMAGE
30+
#cmakedefine WT_HAS_WPDFIMAGE
31+
2932
#if ${WT_DEBUG_ENABLED}
3033
#ifndef WT_TARGET_JAVA
3134
#define WT_DEBUG(statement) do { if (Wt::WApplication::instance()->debug()) statement; } while(0)

examples/feature/socketnotifier/SocketNotifier.C

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ typedef int socklen_t;
3333
* This is a minimal socket notifier example, which is used to asynchronously
3434
* read an RSS file and display it in raw format on the browser using server
3535
* push.
36+
* Note that when the SocketNotifier signal is emitted, that Wt already
37+
* conveniently grabbed the update lock for you. You can simply modify
38+
* the widget tree and use the server push mechanism to push the changes
39+
* to the browser.
3640
* The example looks unnecessary complex due to the use of the raw POSIX
3741
* socket functions. Usually these are wrapped in a more programmer-friendly
3842
* API.
@@ -72,11 +76,9 @@ private:
7276
Wt::WText *rssText_;
7377
std::stringstream inStream_;
7478

75-
// Convenience function that updates the status message. It grabs
76-
// the updateLock before doing so, so it is safe to call at any time.
79+
// Convenience function that updates the status message.
7780
void addText(const Wt::WString &text)
7881
{
79-
Wt::WApplication::UpdateLock uiLock = wApp->getUpdateLock();
8082
resultText_->setText(resultText_->text() + text);
8183
if (wApp->updatesEnabled())
8284
wApp->triggerUpdate();
@@ -237,9 +239,6 @@ private:
237239

238240
void cleanup()
239241
{
240-
// We'll be modifying the widget tree
241-
Wt::WApplication::UpdateLock uiLock = wApp->getUpdateLock();
242-
243242
/*
244243
* It is mandatory not to have notifiers on closed sockets,
245244
* as select() fails miserably in this case. Disable (or even
33.6 KB
Loading

examples/wt-homepage/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ WT_ADD_EXAMPLE(Home.wt
2323
../blog/view/BlogView.C
2424
../blog/view/CommentView.C
2525
../blog/view/PostView.C
26-
../blog/view/EditUsers.C
26+
../blog/view/EditUsers.C
2727
../blog/model/Comment.C
2828
../blog/model/Post.C
2929
../blog/model/Tag.C

src/Wt/WCalendar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class WTemplate;
8686
8787
.Wt-cal td : Day cell
8888
.Wt-cal-oom : Out-of-month day
89-
.Wt-cal-oom : Out-of-range day (day < bottom or day > top)
89+
.Wt-cal-oor : Out-of-range day (day < bottom or day > top)
9090
.Wt-cal-sel : Selected day
9191
.Wt-cal-now : Today day
9292
\endverbatim

src/Wt/WTemplate.C

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,6 @@ DomElementType WTemplate::domElementType() const
283283

284284
void WTemplate::refresh()
285285
{
286-
for (WidgetMap::const_iterator i = widgets_.begin(); i != widgets_.end();
287-
++i) {
288-
WWidget *w = i->second;
289-
if (w->isRendered())
290-
w->refresh();
291-
}
292-
293286
if (text_.refresh()) {
294287
changed_ = true;
295288
repaint(RepaintInnerHtml);

src/Wt/WVmlImage.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ void WVmlImage::init()
8989
currentShadow_ = painter()->shadow();
9090
penBrushShadowChanged_ = true;
9191

92-
startClip(WRectF(0, 0, width().value(), height().value()));
93-
9492
if (!(paintFlags_ & PaintUpdate))
9593
rendered_.str(std::string());
94+
95+
startClip(WRectF(0, 0, width().value(), height().value()));
9696
}
9797

9898
void WVmlImage::done()

src/Wt/WWidget.C

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ void WWidget::renderOk()
9494
{
9595
if (flags_.test(BIT_NEED_RERENDER)) {
9696
flags_.reset(BIT_NEED_RERENDER);
97-
WApplication::instance()->session()->renderer().doneUpdate(this);
97+
WApplication *app = WApplication::instance();
98+
if (app)
99+
app->session()->renderer().doneUpdate(this);
98100
}
99101
}
100102

@@ -359,7 +361,7 @@ void WWidget::setLayoutSizeAware(bool aware)
359361
if (aware == (resized_ != 0))
360362
return;
361363

362-
if (aware) {
364+
if (aware && WApplication::instance()) {
363365
resized_ = new JSignal<int, int>(this, "resized");
364366
resized_->connect(this, &WContainerWidget::layoutSizeChanged);
365367

src/http/Server.C

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ Server::Server(const Configuration& config, const Wt::Configuration& wtConfig,
5757
ssl_context_(io_service_, asio::ssl::context::sslv23),
5858
ssl_acceptor_(io_service_),
5959
#endif // HTTP_WITH_SSL
60-
#if defined(WT_THREADED) && BOOST_VERSION < 103600
61-
select_reactor_(io_service_),
62-
#endif // defined(WT_THREADED) && BOOST_VERSION < 103600
6360
connection_manager_(),
6461
request_handler_(config, wtConfig.entryPoints(),
6562
accessLogger_),

0 commit comments

Comments
 (0)