From d2c7d80544941100587c4bcf513cc64336da8126 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Sun, 14 Oct 2018 22:20:54 +0200 Subject: [PATCH 001/218] Add wxWebRequest documentation --- interface/wx/webrequest.h | 337 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 337 insertions(+) create mode 100644 interface/wx/webrequest.h diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h new file mode 100644 index 0000000000..4fa7f6fa9a --- /dev/null +++ b/interface/wx/webrequest.h @@ -0,0 +1,337 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: webrequest.h +// Created: 2018-10-14 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +/** + @class wxWebRequest + + This class allows for simple HTTP requests using the operating systems + components as implementation. + + The latest features of the operating system will be used if available + (e.g. HTTP/2, TLS 1.2). + System wide configuration like proxy and SSL certificates will be used + when possible. + + Instances of wxWebRequest are created by using + wxWebRequestSession::CreateRequest(). + + The requests are handled asynchronously and event handlers are used to + communicate the request status. + + Example usage: + + @code + // Create the request object + wxObjectDataPtr request( + wxWebRequestSession::GetDefault()->CreateRequest("https://www.wxwidgets.org/downloads/logos/blocks.png")); + + // Bind events + request->Bind(wxEVT_WEBREQUEST_READY, [](wxWebRequestEvent& evt) { + wxImage logoImage(evt->GetResponse()->GetStream()); + if (logoImage.IsOK()) + wxLogInfo("Image loaded"); + }); + request->Bind(wxEVT_WEBREQUEST_FAILED, [](wxWebRequestEvent& evt) { + wxLogError("Could not load logo: %s", evt.GetErrorDescription()); + }); + + // Start the request + request->Start(); + @endcode + + @section descriptions Implementation Descriptions + + The following APIs are used per platform, additional documentation + about supported features may be found in their documentation + + Available features by implementation and minimum version: + + + + + + + + + + + + + + + + + + + + + + + + + + +
Operating SystemAPIHTTPSHTTP/2
Windows + WinHTTP + YesWindows 10 1607
macOS + NSURLSession + macOS 10.9macOS 10.11
iOS + NSURLSession + iOS 7.0iOS 9.0
Linux + libcurl + Yes7.47.0
+ + @beginEventEmissionTable{wxWebRequestEvent} + @event{wxEVT_WEBREQUEST_READY(id, func)} + The response data is ready to be used. + @event{wxEVT_WEBREQUEST_FAILED(id, func)} + A network error has occured. This could be client side or server side. + Use wxWebRequestEvent::GetErrorDescription() to get more details. + @event{wxEVT_WEBREQUEST_AUTH_REQUIRED(id, func)} + The request needs additional authentication to continue. + @endEventTable + + @since 3.1.2 + + @library{wxnet} + @category{net} + + @see wxWebRequestResponse, wxWebRequestSession +*/ +class wxWebRequest: public wxEvtHandler, public wxRefCounter +{ +public: + /** + Adds a request header send by this request. + + @param name Name if the header + @param value String value of the header + */ + void AddHeader(const wxString& name, const wxString& value); + + /** + Set HTTP method. + + Set common + or expanded HTTP method. + + The default method is GET unless request data is provided in which + case POST is the default. + + @param method + HTTP method name, e.g. "GET". + */ + void SetMethod(const wxString& method); + + /** + Set the text to be posted to the server. + + After a successful call to this method, the request will use HTTP @c + POST instead of the default @c GET when it's executed. + + @param data + The data to post. + @param contentType + The value of HTTP "Content-Type" header, e.g. "text/html; + charset=UTF-8". + */ + void SetData(const wxString& data, const wxString& contentType); + + /** + Set the binary data to be posted to the server. + + The next request will + be an HTTP @c POST instead of the default HTTP @c GET and the given @a + data will be posted as the body of this request. + + @param dataStream + The data in this stream will be posted as the request body + @param contentType + The value of HTTP "Content-Type" header, e.g. "text/html; + charset=UTF-8". + */ + void SetData(const wxInputStream& dataStream, const wxString& contentType); + + /** + Instructs the request to ignore server error status codes. + + Per default server side errors (status code 500-599) will be send + a wxEVT_WEBREQUEST_FAILED event just like network errors, but + if the response is still required in this cases (e.g. to get more + details from the response body) this may be set to ignore these. + If ignored wxWebRequestResponse::GetStatus() has to be checked + from the wxEVT_WEBREQUEST_READY event handler. + */ + void SetIgnoreServerErrorStatus(bool ignore); + + /** + Send the request to the server asynchronously. + + Events will be triggered on success or failure + + @see Cancel() + */ + void Start(); + + /** + Cancel an active request + */ + void Cancel(); + + /** + Return a response object after a successful request. + */ + const wxWebRequestResponse* GetResponse() const; +}; + +/** + A wxWebRequestResponse allows access to the response sent by the server. + + @since 3.1.2 + + @library{wxnet} + @category{net} + + @see wxWebRequest +*/ +class wxWebRequestResponse +{ +public: + /** + Returns the final URL. + This URL might be different than the request URL when a redirection + occured. + */ + wxString GetURL() const; + + /** + Return a header from the response or an empty string if the header + could not be found. + + @param name Name of the header field + */ + wxString GetHeader(const wxString& name) const; + + /** + Returns the status code returned by the server + */ + int GetStatus() const; + + /** + Returns the response status text + */ + wxString GetStatusText() const; + + /** + Returns a stream which represents the response data sent by the server. + */ + wxInputStream& GetStream() const; + + /** + Returns all response data as a string. + + @param conv wxMBConv used to convert the response to a string. + If @c NULL the conversion will be determined by + response headers. Defaulting to UTF-8 + */ + wxString AsString(wxMBConv* conv = NULL) const; +}; + +/** + @class wxWebRequestSession + + This class handles session wide parameters and data used by wxWebRequest + instances. + + Usually the default session available via wxWebRequestSession::GetDefault() + should be used. Additional instances might be useful if session separation + is required. Instances must not be deleted before every active web + request has finished. + + Every wxWebRequest sharing the same session object will use the same + cookies. Additionally an underlying network connection might be kept + alive to achieve faster additional responses. + + @since 3.1.2 + + @library{wxnet} + @category{net} + + @see wxWebRequest +*/ +class wxWebRequestSession +{ +public: + /** + Constructor for the session + + All requests created by a call to CreateRequest() will use this session + for communication and to store cookies. + */ + wxWebRequestSession(); + + /** + Create a new request for the specified URL + + @param url + The URL of the HTTP resource for this request + @param id + Optional id send with events + */ + wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY); + + + /** + Returns the default session + */ + static wxWebRequestSession* GetDefault(); + + /** + Adds a request header send by every wxWebRequest using this session. + + A good example for a session wide request header is the @c User-Agent + header. + + @param name Name if the header + @param value String value of the header + */ + void AddRequestHeader(const wxString& name, const wxString& value); +}; + +/** + @class wxWebRequestEvent + + A web request event send during or after server communication. + + @since 3.1.2 + + @library{wxnet} + @category{net} + + @see wxWebRequest +*/ +class wxWebRequestEvent : public wxEvent +{ +public: + wxWebViewEvent(); + wxWebViewEvent(wxEventType type, int id); + + /** + The response for a wxEVT_WEBREQUEST_READY event + */ + const wxWebRequestResponse* GetResponse() const; + + /** + A textual error description for a client side error + wxEVT_WEBREQUEST_FAILED + */ + const wxString& GetErrorDescription() const; +}; + +wxEventType wxEVT_WEBREQUEST_READY; +wxEventType wxEVT_WEBREQUEST_FAILED; +wxEventType wxEVT_WEBREQUEST_AUTH_REQUIRED; From 1090e8f6e94ef486180de6fe9123ad3246abfa90 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 15 Oct 2018 22:28:07 +0200 Subject: [PATCH 002/218] Add webrequest sample application --- build/cmake/options.cmake | 1 + build/cmake/samples/CMakeLists.txt | 1 + samples/makefile.bcc | 12 +- samples/makefile.gcc | 9 +- samples/makefile.vc | 10 +- samples/samples.bkl | 1 + samples/webrequest/Makefile.in | 187 +++++ samples/webrequest/makefile.bcc | 243 +++++++ samples/webrequest/makefile.gcc | 239 +++++++ samples/webrequest/makefile.unx | 100 +++ samples/webrequest/makefile.vc | 378 +++++++++++ samples/webrequest/webrequest.bkl | 15 + samples/webrequest/webrequest.cpp | 152 +++++ samples/webrequest/webrequest_vc7.vcproj | 303 +++++++++ samples/webrequest/webrequest_vc8.vcproj | 829 +++++++++++++++++++++++ samples/webrequest/webrequest_vc9.vcproj | 801 ++++++++++++++++++++++ 16 files changed, 3277 insertions(+), 4 deletions(-) create mode 100644 samples/webrequest/Makefile.in create mode 100644 samples/webrequest/makefile.bcc create mode 100644 samples/webrequest/makefile.gcc create mode 100644 samples/webrequest/makefile.unx create mode 100644 samples/webrequest/makefile.vc create mode 100644 samples/webrequest/webrequest.bkl create mode 100644 samples/webrequest/webrequest.cpp create mode 100644 samples/webrequest/webrequest_vc7.vcproj create mode 100644 samples/webrequest/webrequest_vc8.vcproj create mode 100644 samples/webrequest/webrequest_vc9.vcproj diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index 1ea8458bda..a35a88eb57 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -146,6 +146,7 @@ wx_option(wxUSE_TEXTBUFFER "use wxTextBuffer class") wx_option(wxUSE_TEXTFILE "use wxTextFile class") wx_option(wxUSE_TIMER "use wxTimer class") wx_option(wxUSE_VARIANT "use wxVariant class") +wx_option(wxUSE_WEBREQUEST "use wxWebRequest class") wx_option(wxUSE_ZIPSTREAM "use wxZip streams") # URL-related classes diff --git a/build/cmake/samples/CMakeLists.txt b/build/cmake/samples/CMakeLists.txt index 2f8d28070a..03c481af21 100644 --- a/build/cmake/samples/CMakeLists.txt +++ b/build/cmake/samples/CMakeLists.txt @@ -156,6 +156,7 @@ wx_add_sample(webview LIBRARIES webview NAME webviewsample DEPENDS wxUSE_WEBVIEW if(TARGET webviewsample AND wxUSE_STC) wx_exe_link_libraries(webviewsample stc) endif() +wx_add_sample(webrequest LIBRARIES net DEPENDS wxUSE_WEBREQUEST) # widgets Sample set(SAMPLE_WIDGETS_SRC activityindicator.cpp diff --git a/samples/makefile.bcc b/samples/makefile.bcc index 11b46019ca..ea43cc8723 100644 --- a/samples/makefile.bcc +++ b/samples/makefile.bcc @@ -83,7 +83,7 @@ __xrc___depname = xrc ### Targets: ### -all: access animate archive artprov $(__aui___depname) calendar caret clipboard collpane combo config console dataview dialogs dialup display dll dnd docview dragimag drawing erase event $(__except___depname) exec font grid $(__help___depname) $(__htlbox___depname) $(__html___depname) image internat ipc joytest keyboard layout listctrl mdi $(__mediaplayer___depname) menu minimal nativdlg notebook oleauto opengl ownerdrw popup power preferences printing $(__propgrid___depname) regtest render $(__ribbon___depname) $(__richtext___depname) sashtest scroll secretstore shaped sockets sound $(__splash___depname) splitter statbar $(__stc___depname) svg taborder taskbar text thread toolbar treectrl typetest uiaction validate vscroll $(__webview___depname) widgets wizard wrapsizer $(__xrc___depname) +all: access animate archive artprov $(__aui___depname) calendar caret clipboard collpane combo config console dataview dialogs dialup display dll dnd docview dragimag drawing erase event $(__except___depname) exec font grid $(__help___depname) $(__htlbox___depname) $(__html___depname) image internat ipc joytest keyboard layout listctrl mdi $(__mediaplayer___depname) menu minimal nativdlg notebook oleauto opengl ownerdrw popup power preferences printing $(__propgrid___depname) regtest render $(__ribbon___depname) $(__richtext___depname) sashtest scroll secretstore shaped sockets sound $(__splash___depname) splitter statbar $(__stc___depname) svg taborder taskbar text thread toolbar treectrl typetest uiaction validate vscroll $(__webview___depname) webrequest widgets wizard wrapsizer $(__xrc___depname) clean: -if exist .\*.obj del .\*.obj @@ -397,6 +397,10 @@ clean: @echo $(MAKE) -f makefile.bcc $(MAKEARGS) clean >>webview.bat call webview.bat @del webview.bat + @echo cd webrequest >webrequest.bat + @echo $(MAKE) -f makefile.bcc $(MAKEARGS) clean >>webrequest.bat + call webrequest.bat + @del webrequest.bat @echo cd widgets >widgets.bat @echo $(MAKE) -f makefile.bcc $(MAKEARGS) clean >>widgets.bat call widgets.bat @@ -904,6 +908,12 @@ webview: @del webview.bat !endif +webrequest: + @echo cd webrequest >webrequest.bat + @echo $(MAKE) -f makefile.bcc $(MAKEARGS) all >>webrequest.bat + call webrequest.bat + @del webrequest.bat + widgets: @echo cd widgets >widgets.bat @echo $(MAKE) -f makefile.bcc $(MAKEARGS) all >>widgets.bat diff --git a/samples/makefile.gcc b/samples/makefile.gcc index fb5ec26a18..470863333b 100644 --- a/samples/makefile.gcc +++ b/samples/makefile.gcc @@ -80,7 +80,7 @@ endif ### Targets: ### -all: access animate archive artprov $(__aui___depname) calendar caret clipboard collpane combo config console dataview dialogs dialup display dll dnd docview dragimag drawing erase event $(__except___depname) exec font grid $(__help___depname) $(__htlbox___depname) $(__html___depname) image internat ipc joytest keyboard layout listctrl mdi $(__mediaplayer___depname) menu minimal nativdlg notebook oleauto opengl ownerdrw popup power preferences printing $(__propgrid___depname) regtest render $(__ribbon___depname) $(__richtext___depname) sashtest scroll secretstore shaped sockets sound $(__splash___depname) splitter statbar $(__stc___depname) svg taborder taskbar text thread toolbar treectrl typetest uiaction validate vscroll $(__webview___depname) widgets wizard wrapsizer $(__xrc___depname) +all: access animate archive artprov $(__aui___depname) calendar caret clipboard collpane combo config console dataview dialogs dialup display dll dnd docview dragimag drawing erase event $(__except___depname) exec font grid $(__help___depname) $(__htlbox___depname) $(__html___depname) image internat ipc joytest keyboard layout listctrl mdi $(__mediaplayer___depname) menu minimal nativdlg notebook oleauto opengl ownerdrw popup power preferences printing $(__propgrid___depname) regtest render $(__ribbon___depname) $(__richtext___depname) sashtest scroll secretstore shaped sockets sound $(__splash___depname) splitter statbar $(__stc___depname) svg taborder taskbar text thread toolbar treectrl typetest uiaction validate vscroll $(__webview___depname) webrequest widgets wizard wrapsizer $(__xrc___depname) clean: -if exist .\*.o del .\*.o @@ -162,6 +162,7 @@ clean: $(MAKE) -C validate -f makefile.gcc $(MAKEARGS) clean $(MAKE) -C vscroll -f makefile.gcc $(MAKEARGS) clean $(MAKE) -C webview -f makefile.gcc $(MAKEARGS) clean + $(MAKE) -C webrequest -f makefile.gcc $(MAKEARGS) clean $(MAKE) -C widgets -f makefile.gcc $(MAKEARGS) clean $(MAKE) -C wizard -f makefile.gcc $(MAKEARGS) clean $(MAKE) -C wrapsizer -f makefile.gcc $(MAKEARGS) clean @@ -425,6 +426,9 @@ webview: $(MAKE) -C webview -f makefile.gcc $(MAKEARGS) all endif +webrequest: + $(MAKE) -C webrequest -f makefile.gcc $(MAKEARGS) all + widgets: $(MAKE) -C widgets -f makefile.gcc $(MAKEARGS) all @@ -451,7 +455,8 @@ memcheck: notebook oleauto opengl ownerdrw popup power preferences printing propgrid \ regtest render ribbon richtext sashtest scroll secretstore shaped sockets sound \ splash splitter statbar stc svg taborder taskbar text thread toolbar treectrl \ - typetest uiaction validate vscroll webview widgets wizard wrapsizer xrc memcheck + typetest uiaction validate vscroll webview webrequest widgets wizard wrapsizer \ + xrc memcheck SHELL := $(COMSPEC) diff --git a/samples/makefile.vc b/samples/makefile.vc index b0dc178ce9..f078503165 100644 --- a/samples/makefile.vc +++ b/samples/makefile.vc @@ -74,7 +74,7 @@ __xrc___depname = sub_xrc ### Targets: ### -all: sub_access sub_animate sub_archive sub_artprov $(__aui___depname) sub_calendar sub_caret sub_clipboard sub_collpane sub_combo sub_config sub_console sub_dataview sub_dialogs sub_dialup sub_display sub_dll sub_dnd sub_docview sub_dragimag sub_drawing sub_erase sub_event $(__except___depname) sub_exec sub_font sub_grid $(__help___depname) $(__htlbox___depname) $(__html___depname) sub_image sub_internat sub_ipc sub_joytest sub_keyboard sub_layout sub_listctrl sub_mdi $(__mediaplayer___depname) sub_menu sub_minimal sub_nativdlg sub_notebook sub_oleauto sub_opengl sub_ownerdrw sub_popup sub_power sub_preferences sub_printing $(__propgrid___depname) sub_regtest sub_render $(__ribbon___depname) $(__richtext___depname) sub_sashtest sub_scroll sub_secretstore sub_shaped sub_sockets sub_sound $(__splash___depname) sub_splitter sub_statbar $(__stc___depname) sub_svg sub_taborder sub_taskbar sub_text sub_thread sub_toolbar sub_treectrl sub_typetest sub_uiaction sub_validate sub_vscroll $(__webview___depname) sub_widgets sub_wizard sub_wrapsizer $(__xrc___depname) +all: sub_access sub_animate sub_archive sub_artprov $(__aui___depname) sub_calendar sub_caret sub_clipboard sub_collpane sub_combo sub_config sub_console sub_dataview sub_dialogs sub_dialup sub_display sub_dll sub_dnd sub_docview sub_dragimag sub_drawing sub_erase sub_event $(__except___depname) sub_exec sub_font sub_grid $(__help___depname) $(__htlbox___depname) $(__html___depname) sub_image sub_internat sub_ipc sub_joytest sub_keyboard sub_layout sub_listctrl sub_mdi $(__mediaplayer___depname) sub_menu sub_minimal sub_nativdlg sub_notebook sub_oleauto sub_opengl sub_ownerdrw sub_popup sub_power sub_preferences sub_printing $(__propgrid___depname) sub_regtest sub_render $(__ribbon___depname) $(__richtext___depname) sub_sashtest sub_scroll sub_secretstore sub_shaped sub_sockets sub_sound $(__splash___depname) sub_splitter sub_statbar $(__stc___depname) sub_svg sub_taborder sub_taskbar sub_text sub_thread sub_toolbar sub_treectrl sub_typetest sub_uiaction sub_validate sub_vscroll $(__webview___depname) sub_webrequest sub_widgets sub_wizard sub_wrapsizer $(__xrc___depname) clean: -if exist .\*.obj del .\*.obj @@ -311,6 +311,9 @@ clean: cd webview $(MAKE) -f makefile.vc $(MAKEARGS) clean cd "$(MAKEDIR)" + cd webrequest + $(MAKE) -f makefile.vc $(MAKEARGS) clean + cd "$(MAKEDIR)" cd widgets $(MAKE) -f makefile.vc $(MAKEARGS) clean cd "$(MAKEDIR)" @@ -742,6 +745,11 @@ sub_webview: cd "$(MAKEDIR)" !endif +sub_webrequest: + cd webrequest + $(MAKE) -f makefile.vc $(MAKEARGS) all + cd "$(MAKEDIR)" + sub_widgets: cd widgets $(MAKE) -f makefile.vc $(MAKEARGS) all diff --git a/samples/samples.bkl b/samples/samples.bkl index 3d415c22c1..711647ccc6 100644 --- a/samples/samples.bkl +++ b/samples/samples.bkl @@ -89,6 +89,7 @@ + diff --git a/samples/webrequest/Makefile.in b/samples/webrequest/Makefile.in new file mode 100644 index 0000000000..7bec92a75a --- /dev/null +++ b/samples/webrequest/Makefile.in @@ -0,0 +1,187 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.11 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + +@MAKE_SET@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ +INSTALL = @INSTALL@ +EXEEXT = @EXEEXT@ +WINDRES = @WINDRES@ +NM = @NM@ +BK_DEPS = @BK_DEPS@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +LIBS = @LIBS@ +LDFLAGS_GUI = @LDFLAGS_GUI@ +CXX = @CXX@ +CXXFLAGS = @CXXFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +WX_LIB_FLAVOUR = @WX_LIB_FLAVOUR@ +TOOLKIT = @TOOLKIT@ +TOOLKIT_LOWERCASE = @TOOLKIT_LOWERCASE@ +TOOLKIT_VERSION = @TOOLKIT_VERSION@ +TOOLCHAIN_FULLNAME = @TOOLCHAIN_FULLNAME@ +EXTRALIBS = @EXTRALIBS@ +EXTRALIBS_XML = @EXTRALIBS_XML@ +EXTRALIBS_GUI = @EXTRALIBS_GUI@ +CXXWARNINGS = @CXXWARNINGS@ +HOST_SUFFIX = @HOST_SUFFIX@ +SAMPLES_RPATH_FLAG = @SAMPLES_RPATH_FLAG@ +SAMPLES_CXXFLAGS = @SAMPLES_CXXFLAGS@ +wx_top_builddir = @wx_top_builddir@ + +### Variables: ### + +DESTDIR = +WX_RELEASE = 3.1 +WX_VERSION = $(WX_RELEASE).2 +LIBDIRNAME = $(wx_top_builddir)/lib +WEBREQUEST_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ + $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ + $(__THREAD_DEFINE_p) -I$(srcdir) $(__DLLFLAG_p) -I$(srcdir)/../../samples \ + $(CXXWARNINGS) $(SAMPLES_CXXFLAGS) $(CPPFLAGS) $(CXXFLAGS) +WEBREQUEST_OBJECTS = \ + $(__webrequest___win32rc) \ + webrequest_webrequest.o + +### Conditionally set variables: ### + +@COND_DEPS_TRACKING_0@CXXC = $(CXX) +@COND_DEPS_TRACKING_1@CXXC = $(BK_DEPS) $(CXX) +@COND_USE_GUI_0@PORTNAME = base +@COND_USE_GUI_1@PORTNAME = $(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION) +@COND_TOOLKIT_MAC@WXBASEPORT = _carbon +@COND_BUILD_debug@WXDEBUGFLAG = d +@COND_UNICODE_1@WXUNICODEFLAG = u +@COND_WXUNIV_1@WXUNIVNAME = univ +@COND_MONOLITHIC_0@EXTRALIBS_FOR_BASE = $(EXTRALIBS) +@COND_MONOLITHIC_1@EXTRALIBS_FOR_BASE = $(EXTRALIBS) \ +@COND_MONOLITHIC_1@ $(EXTRALIBS_XML) $(EXTRALIBS_GUI) +@COND_MONOLITHIC_0@EXTRALIBS_FOR_GUI = $(EXTRALIBS_GUI) +@COND_MONOLITHIC_1@EXTRALIBS_FOR_GUI = +@COND_WXUNIV_1@__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__ +@COND_WXUNIV_1@__WXUNIV_DEFINE_p_1 = --define __WXUNIVERSAL__ +@COND_DEBUG_FLAG_0@__DEBUG_DEFINE_p = -DwxDEBUG_LEVEL=0 +@COND_DEBUG_FLAG_0@__DEBUG_DEFINE_p_1 = --define wxDEBUG_LEVEL=0 +@COND_USE_EXCEPTIONS_0@__EXCEPTIONS_DEFINE_p = -DwxNO_EXCEPTIONS +@COND_USE_EXCEPTIONS_0@__EXCEPTIONS_DEFINE_p_1 = --define wxNO_EXCEPTIONS +@COND_USE_RTTI_0@__RTTI_DEFINE_p = -DwxNO_RTTI +@COND_USE_RTTI_0@__RTTI_DEFINE_p_1 = --define wxNO_RTTI +@COND_USE_THREADS_0@__THREAD_DEFINE_p = -DwxNO_THREADS +@COND_USE_THREADS_0@__THREAD_DEFINE_p_1 = --define wxNO_THREADS +@COND_SHARED_1@__DLLFLAG_p = -DWXUSINGDLL +@COND_SHARED_1@__DLLFLAG_p_1 = --define WXUSINGDLL +COND_PLATFORM_OS2_1___webrequest___os2_emxbindcmd = $(NM) webrequest$(EXEEXT) \ + | if grep -q pmwin.763 ; then emxbind -ep webrequest$(EXEEXT) ; fi +@COND_PLATFORM_OS2_1@__webrequest___os2_emxbindcmd = $(COND_PLATFORM_OS2_1___webrequest___os2_emxbindcmd) +@COND_TOOLKIT_MSW@__RCDEFDIR_p = --include-dir \ +@COND_TOOLKIT_MSW@ $(LIBDIRNAME)/wx/include/$(TOOLCHAIN_FULLNAME) +@COND_PLATFORM_WIN32_1@__webrequest___win32rc = webrequest_sample_rc.o +@COND_PLATFORM_MACOSX_1@__webrequest_app_Contents_PkgInfo___depname \ +@COND_PLATFORM_MACOSX_1@ = webrequest.app/Contents/PkgInfo +@COND_PLATFORM_MACOSX_1@__webrequest_bundle___depname = webrequest_bundle +@COND_TOOLKIT_MAC@____webrequest_BUNDLE_TGT_REF_DEP = \ +@COND_TOOLKIT_MAC@ $(__webrequest_app_Contents_PkgInfo___depname) +@COND_TOOLKIT_OSX_CARBON@____webrequest_BUNDLE_TGT_REF_DEP \ +@COND_TOOLKIT_OSX_CARBON@ = $(__webrequest_app_Contents_PkgInfo___depname) +@COND_TOOLKIT_OSX_COCOA@____webrequest_BUNDLE_TGT_REF_DEP \ +@COND_TOOLKIT_OSX_COCOA@ = $(__webrequest_app_Contents_PkgInfo___depname) +@COND_TOOLKIT_OSX_IPHONE@____webrequest_BUNDLE_TGT_REF_DEP \ +@COND_TOOLKIT_OSX_IPHONE@ = $(__webrequest_app_Contents_PkgInfo___depname) +@COND_TOOLKIT_COCOA@____webrequest_BUNDLE_TGT_REF_DEP = \ +@COND_TOOLKIT_COCOA@ $(__webrequest_app_Contents_PkgInfo___depname) +COND_MONOLITHIC_0___WXLIB_CORE_p = \ + -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_MONOLITHIC_0@__WXLIB_CORE_p = $(COND_MONOLITHIC_0___WXLIB_CORE_p) +COND_MONOLITHIC_0___WXLIB_BASE_p = \ + -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_MONOLITHIC_0@__WXLIB_BASE_p = $(COND_MONOLITHIC_0___WXLIB_BASE_p) +COND_MONOLITHIC_0___WXLIB_NET_p = \ + -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_net-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_MONOLITHIC_0@__WXLIB_NET_p = $(COND_MONOLITHIC_0___WXLIB_NET_p) +COND_MONOLITHIC_1___WXLIB_MONO_p = \ + -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_MONOLITHIC_1@__WXLIB_MONO_p = $(COND_MONOLITHIC_1___WXLIB_MONO_p) +@COND_MONOLITHIC_1_USE_STC_1@__LIB_SCINTILLA_IF_MONO_p \ +@COND_MONOLITHIC_1_USE_STC_1@ = \ +@COND_MONOLITHIC_1_USE_STC_1@ -lwxscintilla$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_USE_GUI_1_wxUSE_LIBTIFF_builtin@__LIB_TIFF_p \ +@COND_USE_GUI_1_wxUSE_LIBTIFF_builtin@ = \ +@COND_USE_GUI_1_wxUSE_LIBTIFF_builtin@ -lwxtiff$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_USE_GUI_1_wxUSE_LIBJPEG_builtin@__LIB_JPEG_p \ +@COND_USE_GUI_1_wxUSE_LIBJPEG_builtin@ = \ +@COND_USE_GUI_1_wxUSE_LIBJPEG_builtin@ -lwxjpeg$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_USE_GUI_1_wxUSE_LIBPNG_builtin@__LIB_PNG_p \ +@COND_USE_GUI_1_wxUSE_LIBPNG_builtin@ = \ +@COND_USE_GUI_1_wxUSE_LIBPNG_builtin@ -lwxpng$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_wxUSE_ZLIB_builtin@__LIB_ZLIB_p = \ +@COND_wxUSE_ZLIB_builtin@ -lwxzlib$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) +COND_wxUSE_REGEX_builtin___LIB_REGEX_p = \ + -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_wxUSE_REGEX_builtin@__LIB_REGEX_p = $(COND_wxUSE_REGEX_builtin___LIB_REGEX_p) +@COND_wxUSE_EXPAT_builtin@__LIB_EXPAT_p = \ +@COND_wxUSE_EXPAT_builtin@ -lwxexpat$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) + +### Targets: ### + +all: webrequest$(EXEEXT) $(__webrequest_bundle___depname) + +install: + +uninstall: + +install-strip: install + +clean: + rm -rf ./.deps ./.pch + rm -f ./*.o + rm -f webrequest$(EXEEXT) + rm -rf webrequest.app + +distclean: clean + rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile + +webrequest$(EXEEXT): $(WEBREQUEST_OBJECTS) $(__webrequest___win32rc) + $(CXX) -o $@ $(WEBREQUEST_OBJECTS) -L$(LIBDIRNAME) $(LDFLAGS_GUI) $(SAMPLES_RPATH_FLAG) $(LDFLAGS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_NET_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) + $(__webrequest___os2_emxbindcmd) + +@COND_PLATFORM_MACOSX_1@webrequest.app/Contents/PkgInfo: webrequest$(EXEEXT) $(top_srcdir)/src/osx/carbon/Info.plist.in $(top_srcdir)/src/osx/carbon/wxmac.icns +@COND_PLATFORM_MACOSX_1@ mkdir -p webrequest.app/Contents +@COND_PLATFORM_MACOSX_1@ mkdir -p webrequest.app/Contents/MacOS +@COND_PLATFORM_MACOSX_1@ mkdir -p webrequest.app/Contents/Resources +@COND_PLATFORM_MACOSX_1@ +@COND_PLATFORM_MACOSX_1@ +@COND_PLATFORM_MACOSX_1@ sed -e "s/IDENTIFIER/`echo $(srcdir) | sed -e 's,\.\./,,g' | sed -e 's,/,.,g'`/" \ +@COND_PLATFORM_MACOSX_1@ -e "s/EXECUTABLE/webrequest/" \ +@COND_PLATFORM_MACOSX_1@ -e "s/VERSION/$(WX_VERSION)/" \ +@COND_PLATFORM_MACOSX_1@ $(top_srcdir)/src/osx/carbon/Info.plist.in >webrequest.app/Contents/Info.plist +@COND_PLATFORM_MACOSX_1@ +@COND_PLATFORM_MACOSX_1@ +@COND_PLATFORM_MACOSX_1@ /bin/echo "APPL????" >webrequest.app/Contents/PkgInfo +@COND_PLATFORM_MACOSX_1@ +@COND_PLATFORM_MACOSX_1@ +@COND_PLATFORM_MACOSX_1@ ln -f webrequest$(EXEEXT) webrequest.app/Contents/MacOS/webrequest +@COND_PLATFORM_MACOSX_1@ +@COND_PLATFORM_MACOSX_1@ +@COND_PLATFORM_MACOSX_1@ cp -f $(top_srcdir)/src/osx/carbon/wxmac.icns webrequest.app/Contents/Resources/wxmac.icns + +@COND_PLATFORM_MACOSX_1@webrequest_bundle: $(____webrequest_BUNDLE_TGT_REF_DEP) + +webrequest_sample_rc.o: $(srcdir)/../../samples/sample.rc + $(WINDRES) -i$< -o$@ --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) --include-dir $(srcdir) $(__DLLFLAG_p_1) --include-dir $(srcdir)/../../samples $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include + +webrequest_webrequest.o: $(srcdir)/webrequest.cpp + $(CXXC) -c -o $@ $(WEBREQUEST_CXXFLAGS) $(srcdir)/webrequest.cpp + + +# Include dependency info, if present: +@IF_GNU_MAKE@-include ./.deps/*.d + +.PHONY: all install uninstall clean distclean webrequest_bundle diff --git a/samples/webrequest/makefile.bcc b/samples/webrequest/makefile.bcc new file mode 100644 index 0000000000..94384cec98 --- /dev/null +++ b/samples/webrequest/makefile.bcc @@ -0,0 +1,243 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.11 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + +.autodepend + +!ifndef BCCDIR +!ifndef MAKEDIR +!error Your Borland compiler does not define MAKEDIR. Please define the BCCDIR variable, e.g. BCCDIR=d:\bc4 +!endif +BCCDIR = $(MAKEDIR)\.. +!endif + +!include ../../build/msw/config.bcc + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +WX_RELEASE_NODOT = 31 +COMPILER_PREFIX = bcc +OBJS = \ + $(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) +LIBDIRNAME = \ + .\..\..\lib\$(COMPILER_PREFIX)$(COMPILER_VERSION)_$(LIBTYPE_SUFFIX)$(CFG) +SETUPHDIR = \ + $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG) +WEBREQUEST_CXXFLAGS = $(__RUNTIME_LIBS_7) -I$(BCCDIR)\include $(__DEBUGINFO) \ + $(__OPTIMIZEFLAG_2) $(__THREADSFLAG_6) -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ + $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ + $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) \ + -I$(SETUPHDIR) -I.\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_p) -I. \ + $(__DLLFLAG_p) -I.\..\..\samples -DNOPCH $(CPPFLAGS) $(CXXFLAGS) +WEBREQUEST_OBJECTS = \ + $(OBJS)\webrequest_webrequest.obj + +### Conditionally set variables: ### + +!if "$(USE_GUI)" == "0" +PORTNAME = base +!endif +!if "$(USE_GUI)" == "1" +PORTNAME = msw$(TOOLKIT_VERSION) +!endif +!if "$(OFFICIAL_BUILD)" == "1" +COMPILER_VERSION = ERROR-COMPILER-VERSION-MUST-BE-SET-FOR-OFFICIAL-BUILD +!endif +!if "$(BUILD)" == "debug" +WXDEBUGFLAG = d +!endif +!if "$(UNICODE)" == "1" +WXUNICODEFLAG = u +!endif +!if "$(WXUNIV)" == "1" +WXUNIVNAME = univ +!endif +!if "$(SHARED)" == "1" +WXDLLFLAG = dll +!endif +!if "$(SHARED)" == "0" +LIBTYPE_SUFFIX = lib +!endif +!if "$(SHARED)" == "1" +LIBTYPE_SUFFIX = dll +!endif +!if "$(MONOLITHIC)" == "0" +EXTRALIBS_FOR_BASE = +!endif +!if "$(MONOLITHIC)" == "1" +EXTRALIBS_FOR_BASE = +!endif +!if "$(BUILD)" == "debug" +__OPTIMIZEFLAG_2 = -Od +!endif +!if "$(BUILD)" == "release" +__OPTIMIZEFLAG_2 = -O2 +!endif +!if "$(USE_THREADS)" == "0" +__THREADSFLAG_5 = +!endif +!if "$(USE_THREADS)" == "1" +__THREADSFLAG_5 = mt +!endif +!if "$(USE_THREADS)" == "0" +__THREADSFLAG_6 = +!endif +!if "$(USE_THREADS)" == "1" +__THREADSFLAG_6 = -tWM +!endif +!if "$(RUNTIME_LIBS)" == "dynamic" +__RUNTIME_LIBS_7 = -tWR +!endif +!if "$(RUNTIME_LIBS)" == "static" +__RUNTIME_LIBS_7 = +!endif +!if "$(RUNTIME_LIBS)" == "dynamic" +__RUNTIME_LIBS_8 = i +!endif +!if "$(RUNTIME_LIBS)" == "static" +__RUNTIME_LIBS_8 = +!endif +!if "$(WXUNIV)" == "1" +__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__ +!endif +!if "$(WXUNIV)" == "1" +__WXUNIV_DEFINE_p_1 = -d__WXUNIVERSAL__ +!endif +!if "$(DEBUG_FLAG)" == "0" +__DEBUG_DEFINE_p = -DwxDEBUG_LEVEL=0 +!endif +!if "$(DEBUG_FLAG)" == "0" +__DEBUG_DEFINE_p_1 = -dwxDEBUG_LEVEL=0 +!endif +!if "$(BUILD)" == "release" +__NDEBUG_DEFINE_p = -DNDEBUG +!endif +!if "$(BUILD)" == "release" +__NDEBUG_DEFINE_p_1 = -dNDEBUG +!endif +!if "$(USE_EXCEPTIONS)" == "0" +__EXCEPTIONS_DEFINE_p = -DwxNO_EXCEPTIONS +!endif +!if "$(USE_EXCEPTIONS)" == "0" +__EXCEPTIONS_DEFINE_p_1 = -dwxNO_EXCEPTIONS +!endif +!if "$(USE_RTTI)" == "0" +__RTTI_DEFINE_p = -DwxNO_RTTI +!endif +!if "$(USE_RTTI)" == "0" +__RTTI_DEFINE_p_1 = -dwxNO_RTTI +!endif +!if "$(USE_THREADS)" == "0" +__THREAD_DEFINE_p = -DwxNO_THREADS +!endif +!if "$(USE_THREADS)" == "0" +__THREAD_DEFINE_p_1 = -dwxNO_THREADS +!endif +!if "$(UNICODE)" == "0" +__UNICODE_DEFINE_p = -DwxUSE_UNICODE=0 +!endif +!if "$(UNICODE)" == "1" +__UNICODE_DEFINE_p = -D_UNICODE +!endif +!if "$(UNICODE)" == "0" +__UNICODE_DEFINE_p_1 = -dwxUSE_UNICODE=0 +!endif +!if "$(UNICODE)" == "1" +__UNICODE_DEFINE_p_1 = -d_UNICODE +!endif +!if "$(USE_CAIRO)" == "1" +____CAIRO_INCLUDEDIR_FILENAMES_p = -I$(CAIRO_ROOT)\include\cairo +!endif +!if "$(USE_CAIRO)" == "1" +____CAIRO_INCLUDEDIR_FILENAMES_1_p = -i$(CAIRO_ROOT)\include\cairo +!endif +!if "$(SHARED)" == "1" +__DLLFLAG_p = -DWXUSINGDLL +!endif +!if "$(SHARED)" == "1" +__DLLFLAG_p_1 = -dWXUSINGDLL +!endif +!if "$(MONOLITHIC)" == "0" +__WXLIB_CORE_p = \ + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core.lib +!endif +!if "$(MONOLITHIC)" == "0" +__WXLIB_BASE_p = \ + wxbase$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).lib +!endif +!if "$(MONOLITHIC)" == "0" +__WXLIB_NET_p = \ + wxbase$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_net.lib +!endif +!if "$(MONOLITHIC)" == "1" +__WXLIB_MONO_p = \ + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).lib +!endif +!if "$(MONOLITHIC)" == "1" && "$(USE_STC)" == "1" +__LIB_SCINTILLA_IF_MONO_p = wxscintilla$(WXDEBUGFLAG).lib +!endif +!if "$(USE_GUI)" == "1" +__LIB_TIFF_p = wxtiff$(WXDEBUGFLAG).lib +!endif +!if "$(USE_GUI)" == "1" +__LIB_JPEG_p = wxjpeg$(WXDEBUGFLAG).lib +!endif +!if "$(USE_GUI)" == "1" +__LIB_PNG_p = wxpng$(WXDEBUGFLAG).lib +!endif +!if "$(USE_CAIRO)" == "1" +__CAIRO_LIB_p = cairo.lib +!endif +!if "$(USE_CAIRO)" == "1" +____CAIRO_LIBDIR_FILENAMES_p = -L$(CAIRO_ROOT)\lib +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default" +__DEBUGINFO = -v +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default" +__DEBUGINFO = -v- +!endif +!if "$(DEBUG_INFO)" == "0" +__DEBUGINFO = -v- +!endif +!if "$(DEBUG_INFO)" == "1" +__DEBUGINFO = -v +!endif + + +all: $(OBJS) +$(OBJS): + -if not exist $(OBJS) mkdir $(OBJS) + +### Targets: ### + +all: $(OBJS)\webrequest.exe + +clean: + -if exist $(OBJS)\*.obj del $(OBJS)\*.obj + -if exist $(OBJS)\*.res del $(OBJS)\*.res + -if exist $(OBJS)\*.csm del $(OBJS)\*.csm + -if exist $(OBJS)\webrequest.exe del $(OBJS)\webrequest.exe + -if exist $(OBJS)\webrequest.tds del $(OBJS)\webrequest.tds + -if exist $(OBJS)\webrequest.ilc del $(OBJS)\webrequest.ilc + -if exist $(OBJS)\webrequest.ild del $(OBJS)\webrequest.ild + -if exist $(OBJS)\webrequest.ilf del $(OBJS)\webrequest.ilf + -if exist $(OBJS)\webrequest.ils del $(OBJS)\webrequest.ils + +$(OBJS)\webrequest.exe: $(WEBREQUEST_OBJECTS) $(OBJS)\webrequest_sample.res + ilink32 -Tpe -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(__DEBUGINFO) -L$(LIBDIRNAME) -aa $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) @&&| + c0w32.obj $(WEBREQUEST_OBJECTS),$@,, $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_NET_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) ole2w32.lib oleacc.lib uxtheme.lib import32.lib cw32$(__THREADSFLAG_5)$(__RUNTIME_LIBS_8).lib,, $(OBJS)\webrequest_sample.res +| + +$(OBJS)\webrequest_sample.res: .\..\..\samples\sample.rc + brcc32 -32 -r -fo$@ -i$(BCCDIR)\include -d__WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) -i$(SETUPHDIR) -i.\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_1_p) -i. $(__DLLFLAG_p_1) -i.\..\..\samples -i$(BCCDIR)\include\windows\sdk -dNOPCH .\..\..\samples\sample.rc + +$(OBJS)\webrequest_webrequest.obj: .\webrequest.cpp + $(CXX) -q -c -P -o$@ $(WEBREQUEST_CXXFLAGS) .\webrequest.cpp + diff --git a/samples/webrequest/makefile.gcc b/samples/webrequest/makefile.gcc new file mode 100644 index 0000000000..100ec310de --- /dev/null +++ b/samples/webrequest/makefile.gcc @@ -0,0 +1,239 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.11 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + +include ../../build/msw/config.gcc + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +CPPDEPS = -MT$@ -MF$@.d -MD -MP +WX_RELEASE_NODOT = 31 +COMPILER_PREFIX = gcc +OBJS = \ + $(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) +LIBDIRNAME = \ + .\..\..\lib\$(COMPILER_PREFIX)$(COMPILER_VERSION)_$(LIBTYPE_SUFFIX)$(CFG) +SETUPHDIR = \ + $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG) +WEBREQUEST_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG_2) $(__THREADSFLAG) \ + $(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ + $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ + $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) \ + -I$(SETUPHDIR) -I.\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_p) -W \ + -Wall -I. $(__DLLFLAG_p) -I.\..\..\samples -DNOPCH $(__RTTIFLAG_5) \ + $(__EXCEPTIONSFLAG_6) -Wno-ctor-dtor-privacy $(CPPFLAGS) $(CXXFLAGS) +WEBREQUEST_OBJECTS = \ + $(OBJS)\webrequest_sample_rc.o \ + $(OBJS)\webrequest_webrequest.o + +### Conditionally set variables: ### + +ifeq ($(GCC_VERSION),2.95) +GCCFLAGS = -fvtable-thunks +endif +ifeq ($(USE_GUI),0) +PORTNAME = base +endif +ifeq ($(USE_GUI),1) +PORTNAME = msw$(TOOLKIT_VERSION) +endif +ifeq ($(OFFICIAL_BUILD),1) +COMPILER_VERSION = ERROR-COMPILER-VERSION-MUST-BE-SET-FOR-OFFICIAL-BUILD +endif +ifeq ($(BUILD),debug) +WXDEBUGFLAG = d +endif +ifeq ($(UNICODE),1) +WXUNICODEFLAG = u +endif +ifeq ($(WXUNIV),1) +WXUNIVNAME = univ +endif +ifeq ($(SHARED),1) +WXDLLFLAG = dll +endif +ifeq ($(SHARED),0) +LIBTYPE_SUFFIX = lib +endif +ifeq ($(SHARED),1) +LIBTYPE_SUFFIX = dll +endif +ifeq ($(MONOLITHIC),0) +EXTRALIBS_FOR_BASE = +endif +ifeq ($(MONOLITHIC),1) +EXTRALIBS_FOR_BASE = +endif +ifeq ($(BUILD),debug) +__OPTIMIZEFLAG_2 = -O0 +endif +ifeq ($(BUILD),release) +__OPTIMIZEFLAG_2 = -O2 +endif +ifeq ($(USE_RTTI),0) +__RTTIFLAG_5 = -fno-rtti +endif +ifeq ($(USE_RTTI),1) +__RTTIFLAG_5 = +endif +ifeq ($(USE_EXCEPTIONS),0) +__EXCEPTIONSFLAG_6 = -fno-exceptions +endif +ifeq ($(USE_EXCEPTIONS),1) +__EXCEPTIONSFLAG_6 = +endif +ifeq ($(WXUNIV),1) +__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__ +endif +ifeq ($(WXUNIV),1) +__WXUNIV_DEFINE_p_1 = --define __WXUNIVERSAL__ +endif +ifeq ($(DEBUG_FLAG),0) +__DEBUG_DEFINE_p = -DwxDEBUG_LEVEL=0 +endif +ifeq ($(DEBUG_FLAG),0) +__DEBUG_DEFINE_p_1 = --define wxDEBUG_LEVEL=0 +endif +ifeq ($(BUILD),release) +__NDEBUG_DEFINE_p = -DNDEBUG +endif +ifeq ($(BUILD),release) +__NDEBUG_DEFINE_p_1 = --define NDEBUG +endif +ifeq ($(USE_EXCEPTIONS),0) +__EXCEPTIONS_DEFINE_p = -DwxNO_EXCEPTIONS +endif +ifeq ($(USE_EXCEPTIONS),0) +__EXCEPTIONS_DEFINE_p_1 = --define wxNO_EXCEPTIONS +endif +ifeq ($(USE_RTTI),0) +__RTTI_DEFINE_p = -DwxNO_RTTI +endif +ifeq ($(USE_RTTI),0) +__RTTI_DEFINE_p_1 = --define wxNO_RTTI +endif +ifeq ($(USE_THREADS),0) +__THREAD_DEFINE_p = -DwxNO_THREADS +endif +ifeq ($(USE_THREADS),0) +__THREAD_DEFINE_p_1 = --define wxNO_THREADS +endif +ifeq ($(UNICODE),0) +__UNICODE_DEFINE_p = -DwxUSE_UNICODE=0 +endif +ifeq ($(UNICODE),1) +__UNICODE_DEFINE_p = -D_UNICODE +endif +ifeq ($(UNICODE),0) +__UNICODE_DEFINE_p_1 = --define wxUSE_UNICODE=0 +endif +ifeq ($(UNICODE),1) +__UNICODE_DEFINE_p_1 = --define _UNICODE +endif +ifeq ($(USE_CAIRO),1) +____CAIRO_INCLUDEDIR_FILENAMES_p = -I$(CAIRO_ROOT)\include\cairo +endif +ifeq ($(USE_CAIRO),1) +__CAIRO_INCLUDEDIR_p = --include-dir $(CAIRO_ROOT)/include/cairo +endif +ifeq ($(SHARED),1) +__DLLFLAG_p = -DWXUSINGDLL +endif +ifeq ($(SHARED),1) +__DLLFLAG_p_1 = --define WXUSINGDLL +endif +ifeq ($(MONOLITHIC),0) +__WXLIB_CORE_p = \ + -lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core +endif +ifeq ($(MONOLITHIC),0) +__WXLIB_BASE_p = \ + -lwxbase$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR) +endif +ifeq ($(MONOLITHIC),0) +__WXLIB_NET_p = \ + -lwxbase$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_net +endif +ifeq ($(MONOLITHIC),1) +__WXLIB_MONO_p = \ + -lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR) +endif +ifeq ($(MONOLITHIC),1) +ifeq ($(USE_STC),1) +__LIB_SCINTILLA_IF_MONO_p = -lwxscintilla$(WXDEBUGFLAG) +endif +endif +ifeq ($(USE_GUI),1) +__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG) +endif +ifeq ($(USE_GUI),1) +__LIB_JPEG_p = -lwxjpeg$(WXDEBUGFLAG) +endif +ifeq ($(USE_GUI),1) +__LIB_PNG_p = -lwxpng$(WXDEBUGFLAG) +endif +ifeq ($(USE_CAIRO),1) +__CAIRO_LIB_p = -lcairo +endif +ifeq ($(USE_CAIRO),1) +____CAIRO_LIBDIR_FILENAMES_p = -L$(CAIRO_ROOT)\lib +endif +ifeq ($(BUILD),debug) +ifeq ($(DEBUG_INFO),default) +__DEBUGINFO = -g +endif +endif +ifeq ($(BUILD),release) +ifeq ($(DEBUG_INFO),default) +__DEBUGINFO = +endif +endif +ifeq ($(DEBUG_INFO),0) +__DEBUGINFO = +endif +ifeq ($(DEBUG_INFO),1) +__DEBUGINFO = -g +endif +ifeq ($(USE_THREADS),0) +__THREADSFLAG = +endif +ifeq ($(USE_THREADS),1) +__THREADSFLAG = -mthreads +endif + + +all: $(OBJS) +$(OBJS): + -if not exist $(OBJS) mkdir $(OBJS) + +### Targets: ### + +all: $(OBJS)\webrequest.exe + +clean: + -if exist $(OBJS)\*.o del $(OBJS)\*.o + -if exist $(OBJS)\*.d del $(OBJS)\*.d + -if exist $(OBJS)\webrequest.exe del $(OBJS)\webrequest.exe + +$(OBJS)\webrequest.exe: $(WEBREQUEST_OBJECTS) $(OBJS)\webrequest_sample_rc.o + $(CXX) -o $@ $(WEBREQUEST_OBJECTS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--subsystem,windows -mwindows $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_NET_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet -loleacc -luxtheme + +$(OBJS)\webrequest_sample_rc.o: ./../../samples/sample.rc + $(WINDRES) -i$< -o$@ --define __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) --include-dir $(SETUPHDIR) --include-dir ./../../include $(__CAIRO_INCLUDEDIR_p) --include-dir . $(__DLLFLAG_p_1) --include-dir ./../../samples --define NOPCH + +$(OBJS)\webrequest_webrequest.o: ./webrequest.cpp + $(CXX) -c -o $@ $(WEBREQUEST_CXXFLAGS) $(CPPDEPS) $< + +.PHONY: all clean + + +SHELL := $(COMSPEC) + +# Dependencies tracking: +-include $(OBJS)/*.d diff --git a/samples/webrequest/makefile.unx b/samples/webrequest/makefile.unx new file mode 100644 index 0000000000..f749ec2e62 --- /dev/null +++ b/samples/webrequest/makefile.unx @@ -0,0 +1,100 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.11 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# C++ compiler +CXX = `$(WX_CONFIG) --cxx` + +# Standard flags for C++ +CXXFLAGS ?= + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS ?= + +# Standard linker flags +LDFLAGS ?= + +# Location and arguments of wx-config script +WX_CONFIG ?= wx-config + +# Port of the wx library to build against [gtk1,gtk2,msw,x11,motif,osx_cocoa,osx_carbon,dfb] +WX_PORT ?= $(shell $(WX_CONFIG) --query-toolkit) + +# Use DLL build of wx library to use? [0,1] +WX_SHARED ?= $(shell if test -z `$(WX_CONFIG) --query-linkage`; then echo 1; else echo 0; fi) + +# Compile Unicode build of wxWidgets? [0,1] +WX_UNICODE ?= $(shell $(WX_CONFIG) --query-chartype | sed 's/unicode/1/;s/ansi/0/') + +# Version of the wx library to build against. +WX_VERSION ?= $(shell $(WX_CONFIG) --query-version | sed -e 's/\([0-9]*\)\.\([0-9]*\)/\1\2/') + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +CPPDEPS = -MT$@ -MF`echo $@ | sed -e 's,\.o$$,.d,'` -MD -MP +WX_VERSION_MAJOR = $(shell echo $(WX_VERSION) | cut -c1,1) +WX_VERSION_MINOR = $(shell echo $(WX_VERSION) | cut -c2,2) +WX_CONFIG_FLAGS = $(WX_CONFIG_UNICODE_FLAG) $(WX_CONFIG_SHARED_FLAG) \ + --toolkit=$(WX_PORT) --version=$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR) +WEBREQUEST_CXXFLAGS = -I. `$(WX_CONFIG) --cxxflags $(WX_CONFIG_FLAGS)` \ + $(CPPFLAGS) $(CXXFLAGS) +WEBREQUEST_OBJECTS = \ + webrequest_webrequest.o + +### Conditionally set variables: ### + +ifeq ($(WX_UNICODE),0) +WX_CONFIG_UNICODE_FLAG = --unicode=no +endif +ifeq ($(WX_UNICODE),1) +WX_CONFIG_UNICODE_FLAG = --unicode=yes +endif +ifeq ($(WX_SHARED),0) +WX_CONFIG_SHARED_FLAG = --static=yes +endif +ifeq ($(WX_SHARED),1) +WX_CONFIG_SHARED_FLAG = --static=no +endif + + +### Targets: ### + +all: test_for_selected_wxbuild webrequest + +install: + +uninstall: + +clean: + rm -f ./*.o + rm -f ./*.d + rm -f webrequest + +test_for_selected_wxbuild: + @$(WX_CONFIG) $(WX_CONFIG_FLAGS) + +webrequest: $(WEBREQUEST_OBJECTS) + $(CXX) -o $@ $(WEBREQUEST_OBJECTS) $(LDFLAGS) `$(WX_CONFIG) $(WX_CONFIG_FLAGS) --libs core,base` + +webrequest_webrequest.o: ./webrequest.cpp + $(CXX) -c -o $@ $(WEBREQUEST_CXXFLAGS) $(CPPDEPS) $< + +.PHONY: all install uninstall clean + + +# Dependencies tracking: +-include ./*.d diff --git a/samples/webrequest/makefile.vc b/samples/webrequest/makefile.vc new file mode 100644 index 0000000000..5eb9d80929 --- /dev/null +++ b/samples/webrequest/makefile.vc @@ -0,0 +1,378 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.11 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + +!include <../../build/msw/config.vc> + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +WX_RELEASE_NODOT = 31 +COMPILER_PREFIX = vc +OBJS = \ + $(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)$(ARCH_SUFFIX) +LIBDIRNAME = \ + .\..\..\lib\$(COMPILER_PREFIX)$(COMPILER_VERSION)$(ARCH_SUFFIX)_$(LIBTYPE_SUFFIX)$(CFG) +SETUPHDIR = \ + $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG) +WEBREQUEST_CXXFLAGS = /M$(__RUNTIME_LIBS_10)$(__DEBUGRUNTIME_4) /DWIN32 \ + $(__DEBUGINFO_0) /Fd$(OBJS)\webrequest.pdb $(____DEBUGRUNTIME_3_p) \ + $(__OPTIMIZEFLAG_6) /D_CRT_SECURE_NO_DEPRECATE=1 \ + /D_CRT_NON_CONFORMING_SWPRINTFS=1 /D_SCL_SECURE_NO_WARNINGS=1 \ + $(__NO_VC_CRTDBG_p) /D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ + $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ + $(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) /I$(SETUPHDIR) /I.\..\..\include \ + $(____CAIRO_INCLUDEDIR_FILENAMES_p) /W4 /I. $(__DLLFLAG_p) /D_WINDOWS \ + /I.\..\..\samples /DNOPCH $(__RTTIFLAG_11) $(__EXCEPTIONSFLAG_12) \ + $(CPPFLAGS) $(CXXFLAGS) +WEBREQUEST_OBJECTS = \ + $(OBJS)\webrequest_webrequest.obj +WEBREQUEST_RESOURCES = \ + $(OBJS)\webrequest_sample.res + +### Conditionally set variables: ### + +!if "$(TARGET_CPU)" == "AMD64" +ARCH_SUFFIX = _x64 +!endif +!if "$(TARGET_CPU)" == "ARM64" +ARCH_SUFFIX = _arm64 +!endif +!if "$(TARGET_CPU)" == "IA64" +ARCH_SUFFIX = _ia64 +!endif +!if "$(TARGET_CPU)" == "X64" +ARCH_SUFFIX = _x64 +!endif +!if "$(TARGET_CPU)" == "amd64" +ARCH_SUFFIX = _x64 +!endif +!if "$(TARGET_CPU)" == "arm64" +ARCH_SUFFIX = _arm64 +!endif +!if "$(TARGET_CPU)" == "ia64" +ARCH_SUFFIX = _ia64 +!endif +!if "$(TARGET_CPU)" == "x64" +ARCH_SUFFIX = _x64 +!endif +!if "$(USE_GUI)" == "0" +PORTNAME = base +!endif +!if "$(USE_GUI)" == "1" +PORTNAME = msw$(TOOLKIT_VERSION) +!endif +!if "$(OFFICIAL_BUILD)" == "1" +COMPILER_VERSION = ERROR-COMPILER-VERSION-MUST-BE-SET-FOR-OFFICIAL-BUILD +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default" +WXDEBUGFLAG = d +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "1" +WXDEBUGFLAG = d +!endif +!if "$(UNICODE)" == "1" +WXUNICODEFLAG = u +!endif +!if "$(WXUNIV)" == "1" +WXUNIVNAME = univ +!endif +!if "$(SHARED)" == "1" +WXDLLFLAG = dll +!endif +!if "$(SHARED)" == "0" +LIBTYPE_SUFFIX = lib +!endif +!if "$(SHARED)" == "1" +LIBTYPE_SUFFIX = dll +!endif +!if "$(TARGET_CPU)" == "AMD64" +LINK_TARGET_CPU = /MACHINE:X64 +!endif +!if "$(TARGET_CPU)" == "ARM64" +LINK_TARGET_CPU = /MACHINE:ARM64 +!endif +!if "$(TARGET_CPU)" == "IA64" +LINK_TARGET_CPU = /MACHINE:IA64 +!endif +!if "$(TARGET_CPU)" == "X64" +LINK_TARGET_CPU = /MACHINE:X64 +!endif +!if "$(TARGET_CPU)" == "amd64" +LINK_TARGET_CPU = /MACHINE:X64 +!endif +!if "$(TARGET_CPU)" == "arm64" +LINK_TARGET_CPU = /MACHINE:ARM64 +!endif +!if "$(TARGET_CPU)" == "ia64" +LINK_TARGET_CPU = /MACHINE:IA64 +!endif +!if "$(TARGET_CPU)" == "x64" +LINK_TARGET_CPU = /MACHINE:X64 +!endif +!if "$(MONOLITHIC)" == "0" +EXTRALIBS_FOR_BASE = +!endif +!if "$(MONOLITHIC)" == "1" +EXTRALIBS_FOR_BASE = +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default" +__DEBUGINFO_0 = /Zi +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default" +__DEBUGINFO_0 = +!endif +!if "$(DEBUG_INFO)" == "0" +__DEBUGINFO_0 = +!endif +!if "$(DEBUG_INFO)" == "1" +__DEBUGINFO_0 = /Zi +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default" +__DEBUGINFO_1 = /DEBUG +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default" +__DEBUGINFO_1 = +!endif +!if "$(DEBUG_INFO)" == "0" +__DEBUGINFO_1 = +!endif +!if "$(DEBUG_INFO)" == "1" +__DEBUGINFO_1 = /DEBUG +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default" +__DEBUGINFO_2 = $(__DEBUGRUNTIME_5) +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default" +__DEBUGINFO_2 = +!endif +!if "$(DEBUG_INFO)" == "0" +__DEBUGINFO_2 = +!endif +!if "$(DEBUG_INFO)" == "1" +__DEBUGINFO_2 = $(__DEBUGRUNTIME_5) +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default" +____DEBUGRUNTIME_3_p = /D_DEBUG +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default" +____DEBUGRUNTIME_3_p = +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "0" +____DEBUGRUNTIME_3_p = +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "1" +____DEBUGRUNTIME_3_p = /D_DEBUG +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default" +____DEBUGRUNTIME_3_p_1 = /d _DEBUG +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default" +____DEBUGRUNTIME_3_p_1 = +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "0" +____DEBUGRUNTIME_3_p_1 = +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "1" +____DEBUGRUNTIME_3_p_1 = /d _DEBUG +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default" +__DEBUGRUNTIME_4 = d +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default" +__DEBUGRUNTIME_4 = +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "0" +__DEBUGRUNTIME_4 = +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "1" +__DEBUGRUNTIME_4 = d +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default" +__DEBUGRUNTIME_5 = +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default" +__DEBUGRUNTIME_5 = /opt:ref /opt:icf +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "0" +__DEBUGRUNTIME_5 = /opt:ref /opt:icf +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "1" +__DEBUGRUNTIME_5 = +!endif +!if "$(BUILD)" == "debug" +__OPTIMIZEFLAG_6 = /Od +!endif +!if "$(BUILD)" == "release" +__OPTIMIZEFLAG_6 = /O2 +!endif +!if "$(USE_THREADS)" == "0" +__THREADSFLAG_9 = L +!endif +!if "$(USE_THREADS)" == "1" +__THREADSFLAG_9 = T +!endif +!if "$(RUNTIME_LIBS)" == "dynamic" +__RUNTIME_LIBS_10 = D +!endif +!if "$(RUNTIME_LIBS)" == "static" +__RUNTIME_LIBS_10 = $(__THREADSFLAG_9) +!endif +!if "$(USE_RTTI)" == "0" +__RTTIFLAG_11 = /GR- +!endif +!if "$(USE_RTTI)" == "1" +__RTTIFLAG_11 = /GR +!endif +!if "$(USE_EXCEPTIONS)" == "0" +__EXCEPTIONSFLAG_12 = +!endif +!if "$(USE_EXCEPTIONS)" == "1" +__EXCEPTIONSFLAG_12 = /EHsc +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "0" +__NO_VC_CRTDBG_p = /D__NO_VC_CRTDBG__ +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_FLAG)" == "1" +__NO_VC_CRTDBG_p = /D__NO_VC_CRTDBG__ +!endif +!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "0" +__NO_VC_CRTDBG_p_1 = /d __NO_VC_CRTDBG__ +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_FLAG)" == "1" +__NO_VC_CRTDBG_p_1 = /d __NO_VC_CRTDBG__ +!endif +!if "$(WXUNIV)" == "1" +__WXUNIV_DEFINE_p = /D__WXUNIVERSAL__ +!endif +!if "$(WXUNIV)" == "1" +__WXUNIV_DEFINE_p_1 = /d __WXUNIVERSAL__ +!endif +!if "$(DEBUG_FLAG)" == "0" +__DEBUG_DEFINE_p = /DwxDEBUG_LEVEL=0 +!endif +!if "$(DEBUG_FLAG)" == "0" +__DEBUG_DEFINE_p_1 = /d wxDEBUG_LEVEL=0 +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default" +__NDEBUG_DEFINE_p = /DNDEBUG +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "0" +__NDEBUG_DEFINE_p = /DNDEBUG +!endif +!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default" +__NDEBUG_DEFINE_p_1 = /d NDEBUG +!endif +!if "$(DEBUG_RUNTIME_LIBS)" == "0" +__NDEBUG_DEFINE_p_1 = /d NDEBUG +!endif +!if "$(USE_EXCEPTIONS)" == "0" +__EXCEPTIONS_DEFINE_p = /DwxNO_EXCEPTIONS +!endif +!if "$(USE_EXCEPTIONS)" == "0" +__EXCEPTIONS_DEFINE_p_1 = /d wxNO_EXCEPTIONS +!endif +!if "$(USE_RTTI)" == "0" +__RTTI_DEFINE_p = /DwxNO_RTTI +!endif +!if "$(USE_RTTI)" == "0" +__RTTI_DEFINE_p_1 = /d wxNO_RTTI +!endif +!if "$(USE_THREADS)" == "0" +__THREAD_DEFINE_p = /DwxNO_THREADS +!endif +!if "$(USE_THREADS)" == "0" +__THREAD_DEFINE_p_1 = /d wxNO_THREADS +!endif +!if "$(UNICODE)" == "0" +__UNICODE_DEFINE_p = /DwxUSE_UNICODE=0 +!endif +!if "$(UNICODE)" == "1" +__UNICODE_DEFINE_p = /D_UNICODE +!endif +!if "$(UNICODE)" == "0" +__UNICODE_DEFINE_p_1 = /d wxUSE_UNICODE=0 +!endif +!if "$(UNICODE)" == "1" +__UNICODE_DEFINE_p_1 = /d _UNICODE +!endif +!if "$(USE_CAIRO)" == "1" +____CAIRO_INCLUDEDIR_FILENAMES_p = /I$(CAIRO_ROOT)\include\cairo +!endif +!if "$(USE_CAIRO)" == "1" +____CAIRO_INCLUDEDIR_FILENAMES_1_p = /i $(CAIRO_ROOT)\include\cairo +!endif +!if "$(SHARED)" == "1" +__DLLFLAG_p = /DWXUSINGDLL +!endif +!if "$(SHARED)" == "1" +__DLLFLAG_p_1 = /d WXUSINGDLL +!endif +!if "$(MONOLITHIC)" == "0" +__WXLIB_CORE_p = \ + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core.lib +!endif +!if "$(MONOLITHIC)" == "0" +__WXLIB_BASE_p = \ + wxbase$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).lib +!endif +!if "$(MONOLITHIC)" == "0" +__WXLIB_NET_p = \ + wxbase$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_net.lib +!endif +!if "$(MONOLITHIC)" == "1" +__WXLIB_MONO_p = \ + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).lib +!endif +!if "$(MONOLITHIC)" == "1" && "$(USE_STC)" == "1" +__LIB_SCINTILLA_IF_MONO_p = wxscintilla$(WXDEBUGFLAG).lib +!endif +!if "$(USE_GUI)" == "1" +__LIB_TIFF_p = wxtiff$(WXDEBUGFLAG).lib +!endif +!if "$(USE_GUI)" == "1" +__LIB_JPEG_p = wxjpeg$(WXDEBUGFLAG).lib +!endif +!if "$(USE_GUI)" == "1" +__LIB_PNG_p = wxpng$(WXDEBUGFLAG).lib +!endif +!if "$(USE_CAIRO)" == "1" +__CAIRO_LIB_p = cairo.lib +!endif +!if "$(USE_CAIRO)" == "1" +____CAIRO_LIBDIR_FILENAMES_p = /LIBPATH:$(CAIRO_ROOT)\lib +!endif + + +all: $(OBJS) +$(OBJS): + -if not exist $(OBJS) mkdir $(OBJS) + +### Targets: ### + +all: $(OBJS)\webrequest.exe + +clean: + -if exist $(OBJS)\*.obj del $(OBJS)\*.obj + -if exist $(OBJS)\*.res del $(OBJS)\*.res + -if exist $(OBJS)\*.pch del $(OBJS)\*.pch + -if exist $(OBJS)\webrequest.exe del $(OBJS)\webrequest.exe + -if exist $(OBJS)\webrequest.ilk del $(OBJS)\webrequest.ilk + -if exist $(OBJS)\webrequest.pdb del $(OBJS)\webrequest.pdb + +$(OBJS)\webrequest.exe: $(WEBREQUEST_OBJECTS) $(OBJS)\webrequest_sample.res + link /NOLOGO /OUT:$@ $(__DEBUGINFO_1) /pdb:"$(OBJS)\webrequest.pdb" $(__DEBUGINFO_2) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:WINDOWS $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) @<< + $(WEBREQUEST_OBJECTS) $(WEBREQUEST_RESOURCES) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_NET_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib +<< + +$(OBJS)\webrequest_sample.res: .\..\..\samples\sample.rc + rc /fo$@ /d WIN32 $(____DEBUGRUNTIME_3_p_1) /d _CRT_SECURE_NO_DEPRECATE=1 /d _CRT_NON_CONFORMING_SWPRINTFS=1 /d _SCL_SECURE_NO_WARNINGS=1 $(__NO_VC_CRTDBG_p_1) /d __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) /i $(SETUPHDIR) /i .\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_1_p) /i . $(__DLLFLAG_p_1) /d _WINDOWS /i .\..\..\samples /d NOPCH .\..\..\samples\sample.rc + +$(OBJS)\webrequest_webrequest.obj: .\webrequest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WEBREQUEST_CXXFLAGS) .\webrequest.cpp + diff --git a/samples/webrequest/webrequest.bkl b/samples/webrequest/webrequest.bkl new file mode 100644 index 0000000000..f1e746db2e --- /dev/null +++ b/samples/webrequest/webrequest.bkl @@ -0,0 +1,15 @@ + + + + + + + + webrequest.cpp + core + base + net + wx06 + + + diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp new file mode 100644 index 0000000000..45ab8e817f --- /dev/null +++ b/samples/webrequest/webrequest.cpp @@ -0,0 +1,152 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: samples/webrequest.cpp +// Purpose: wxWebRequest Sample +// Author: Tobias Taschner +// Created: 2018-10-15 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif + +#include +#include + +#ifndef wxHAS_IMAGES_IN_RESOURCES + #include "../sample.xpm" +#endif + +class WebRequestFrame : public wxFrame +{ +public: + WebRequestFrame(const wxString& title): + wxFrame(NULL, wxID_ANY, title) + { + // set the frame icon + SetIcon(wxICON(sample)); + + // Prepare UI controls + + // If menus are not available add a button to access the about box + wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); + wxNotebook* notebook = new wxNotebook(this, wxID_ANY); + + // Get image page + wxPanel* getPanel = new wxPanel(notebook); + wxSizer* getSizer = new wxBoxSizer(wxVERTICAL); + getSizer->Add(new wxStaticText(getPanel, wxID_ANY, "Image URL to load:"), + wxSizerFlags().Border()); + m_getURLTextCtrl = new wxTextCtrl(getPanel, wxID_ANY, + "https://www.wxwidgets.org/downloads/logos/blocks.png"); + getSizer->Add(m_getURLTextCtrl, + wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); + + wxButton* getLoadButton = new wxButton(getPanel, wxID_ANY, "&Load"); + getLoadButton->Bind(wxEVT_BUTTON, &WebRequestFrame::OnGetLoadButton, this); + getSizer->Add(getLoadButton, wxSizerFlags().Border()); + + wxStaticBoxSizer* getImageBox = + new wxStaticBoxSizer(wxVERTICAL, getPanel, "Image"); + m_getStaticBitmap = new wxStaticBitmap(getImageBox->GetStaticBox(), + wxID_ANY, wxArtProvider::GetBitmap(wxART_MISSING_IMAGE)); + getImageBox->Add(m_getStaticBitmap, wxSizerFlags(1).Expand()); + getSizer->Add(getImageBox, wxSizerFlags(1).Expand().Border()); + + getPanel->SetSizer(getSizer); + notebook->AddPage(getPanel, "GET Image", true); + + // POST Text page + wxPanel* postPanel = new wxPanel(notebook); + wxSizer* postSizer = new wxBoxSizer(wxVERTICAL); + postSizer->Add(new wxStaticText(postPanel, wxID_ANY, "Request URL:"), + wxSizerFlags().Border()); + m_postURLTextCtrl = new wxTextCtrl(postPanel, wxID_ANY, + "https://api.github.com/"); + postSizer->Add(m_postURLTextCtrl, + wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); + + postSizer->Add(new wxStaticText(postPanel, wxID_ANY, "Content type:"), + wxSizerFlags().Border()); + m_postContentTypeTextCtrl = new wxTextCtrl(postPanel, wxID_ANY, + "application/json"); + postSizer->Add(m_postContentTypeTextCtrl, + wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); + + postSizer->Add(new wxStaticText(postPanel, wxID_ANY, "Request body:"), + wxSizerFlags().Border()); + m_postRequestTextCtrl = new wxTextCtrl(postPanel, wxID_ANY, "", + wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); + postSizer->Add(m_postRequestTextCtrl, + wxSizerFlags(1).Expand().Border(wxLEFT | wxRIGHT)); + + wxButton* postSendButton = new wxButton(postPanel, wxID_ANY, "&Send"); + postSendButton->Bind(wxEVT_BUTTON, &WebRequestFrame::OnPostSendButton, this); + postSizer->Add(postSendButton, wxSizerFlags().Border()); + + postSizer->Add(new wxStaticText(postPanel, wxID_ANY, "Response body:"), + wxSizerFlags().Border()); + m_postResponseTextCtrl = new wxTextCtrl(postPanel, wxID_ANY, "", + wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY); + m_postResponseTextCtrl->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); + postSizer->Add(m_postResponseTextCtrl, + wxSizerFlags(1).Expand().Border(wxLEFT | wxRIGHT | wxBOTTOM)); + + postPanel->SetSizer(postSizer); + notebook->AddPage(postPanel, "POST Text"); + + mainSizer->Add(notebook, wxSizerFlags(1).Expand().Border()); + + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); + SetSizer(mainSizer); + + SetSize(FromDIP(wxSize(400, 500))); + + CreateStatusBar(); + } + + void OnGetLoadButton(wxCommandEvent& WXUNUSED(evt)) + { + GetStatusBar()->SetStatusText("Requesting image..."); + } + + void OnPostSendButton(wxCommandEvent& WXUNUSED(evt)) + { + GetStatusBar()->SetStatusText("Requesting text..."); + } + +private: + wxTextCtrl* m_getURLTextCtrl; + wxStaticBitmap* m_getStaticBitmap; + + wxTextCtrl* m_postURLTextCtrl; + wxTextCtrl* m_postContentTypeTextCtrl; + wxTextCtrl* m_postRequestTextCtrl; + wxTextCtrl* m_postResponseTextCtrl; +}; + +class WebRequestApp : public wxApp +{ +public: + virtual bool OnInit() wxOVERRIDE + { + if (!wxApp::OnInit()) + return false; + + // create the main application window + WebRequestFrame *frame = new WebRequestFrame("wxWebRequest Sample App"); + frame->Show(true); + + return true; + } +}; + +wxIMPLEMENT_APP(WebRequestApp); diff --git a/samples/webrequest/webrequest_vc7.vcproj b/samples/webrequest/webrequest_vc7.vcproj new file mode 100644 index 0000000000..1696510aa0 --- /dev/null +++ b/samples/webrequest/webrequest_vc7.vcproj @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/webrequest/webrequest_vc8.vcproj b/samples/webrequest/webrequest_vc8.vcproj new file mode 100644 index 0000000000..1a78ec0520 --- /dev/null +++ b/samples/webrequest/webrequest_vc8.vcproj @@ -0,0 +1,829 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/webrequest/webrequest_vc9.vcproj b/samples/webrequest/webrequest_vc9.vcproj new file mode 100644 index 0000000000..1bc8a6ffea --- /dev/null +++ b/samples/webrequest/webrequest_vc9.vcproj @@ -0,0 +1,801 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From bd73551f1f5bc1f02a19bbf2e2fbc48f5131e0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Wed, 17 Oct 2018 11:12:19 +0200 Subject: [PATCH 003/218] Fix various typos and style in wxWebRequest documentation --- interface/wx/webrequest.h | 40 +++++++++++++++---------------- samples/webrequest/webrequest.cpp | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 4fa7f6fa9a..be9d49bf78 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -12,7 +12,7 @@ components as implementation. The latest features of the operating system will be used if available - (e.g. HTTP/2, TLS 1.2). + (e.g. HTTP/2, TLS 1.3). System wide configuration like proxy and SSL certificates will be used when possible. @@ -108,7 +108,7 @@ public: /** Adds a request header send by this request. - @param name Name if the header + @param name Name of the header @param value String value of the header */ void AddHeader(const wxString& name, const wxString& value); @@ -159,10 +159,10 @@ public: /** Instructs the request to ignore server error status codes. - Per default server side errors (status code 500-599) will be send + Per default, server side errors (status code 500-599) will send a wxEVT_WEBREQUEST_FAILED event just like network errors, but if the response is still required in this cases (e.g. to get more - details from the response body) this may be set to ignore these. + details from the response body), set this option to ignore all errors. If ignored wxWebRequestResponse::GetStatus() has to be checked from the wxEVT_WEBREQUEST_READY event handler. */ @@ -171,14 +171,14 @@ public: /** Send the request to the server asynchronously. - Events will be triggered on success or failure + Events will be triggered on success or failure. @see Cancel() */ void Start(); /** - Cancel an active request + Cancel an active request. */ void Cancel(); @@ -204,12 +204,12 @@ public: /** Returns the final URL. This URL might be different than the request URL when a redirection - occured. + occurred. */ wxString GetURL() const; /** - Return a header from the response or an empty string if the header + Returns a header from the response or an empty string if the header could not be found. @param name Name of the header field @@ -217,12 +217,12 @@ public: wxString GetHeader(const wxString& name) const; /** - Returns the status code returned by the server + Returns the status code returned by the server. */ int GetStatus() const; /** - Returns the response status text + Returns the status text of the response. */ wxString GetStatusText() const; @@ -235,8 +235,8 @@ public: Returns all response data as a string. @param conv wxMBConv used to convert the response to a string. - If @c NULL the conversion will be determined by - response headers. Defaulting to UTF-8 + If @c NULL, the conversion will be determined by + response headers. The default is UTF-8. */ wxString AsString(wxMBConv* conv = NULL) const; }; @@ -244,7 +244,7 @@ public: /** @class wxWebRequestSession - This class handles session wide parameters and data used by wxWebRequest + This class handles session-wide parameters and data used by wxWebRequest instances. Usually the default session available via wxWebRequestSession::GetDefault() @@ -253,7 +253,7 @@ public: request has finished. Every wxWebRequest sharing the same session object will use the same - cookies. Additionally an underlying network connection might be kept + cookies. Additionally, an underlying network connection might be kept alive to achieve faster additional responses. @since 3.1.2 @@ -280,7 +280,7 @@ public: @param url The URL of the HTTP resource for this request @param id - Optional id send with events + Optional id sent with events */ wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY); @@ -291,12 +291,12 @@ public: static wxWebRequestSession* GetDefault(); /** - Adds a request header send by every wxWebRequest using this session. + Adds a request header to every wxWebRequest using this session. - A good example for a session wide request header is the @c User-Agent + A good example for a session-wide request header is the @c User-Agent header. - @param name Name if the header + @param name Name of the header @param value String value of the header */ void AddRequestHeader(const wxString& name, const wxString& value); @@ -305,7 +305,7 @@ public: /** @class wxWebRequestEvent - A web request event send during or after server communication. + A web request event sent during or after server communication. @since 3.1.2 @@ -327,7 +327,7 @@ public: /** A textual error description for a client side error - wxEVT_WEBREQUEST_FAILED + in case of wxEVT_WEBREQUEST_FAILED */ const wxString& GetErrorDescription() const; }; diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 45ab8e817f..cbdcc30a00 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -138,7 +138,7 @@ class WebRequestApp : public wxApp public: virtual bool OnInit() wxOVERRIDE { - if (!wxApp::OnInit()) + if ( !wxApp::OnInit() ) return false; // create the main application window From 30d56ec5b7bf9a2f4269863d3230cce0961a6e77 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 17 Oct 2018 21:18:47 +0200 Subject: [PATCH 004/218] Further wxWebRequest documentation improvements --- interface/wx/webrequest.h | 67 ++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index be9d49bf78..f356ee2d4e 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -17,7 +17,7 @@ when possible. Instances of wxWebRequest are created by using - wxWebRequestSession::CreateRequest(). + wxWebSession::CreateRequest(). The requests are handled asynchronously and event handlers are used to communicate the request status. @@ -27,7 +27,7 @@ @code // Create the request object wxObjectDataPtr request( - wxWebRequestSession::GetDefault()->CreateRequest("https://www.wxwidgets.org/downloads/logos/blocks.png")); + wxWebSession::GetDefault().CreateRequest("https://www.wxwidgets.org/downloads/logos/blocks.png")); // Bind events request->Bind(wxEVT_WEBREQUEST_READY, [](wxWebRequestEvent& evt) { @@ -100,22 +100,20 @@ @library{wxnet} @category{net} - @see wxWebRequestResponse, wxWebRequestSession + @see wxWebResponse, wxWebSession */ class wxWebRequest: public wxEvtHandler, public wxRefCounter { public: /** - Adds a request header send by this request. + Sets a request header send by this request. @param name Name of the header @param value String value of the header */ - void AddHeader(const wxString& name, const wxString& value); + void SetHeader(const wxString& name, const wxString& value); /** - Set HTTP method. - Set common or expanded HTTP method. @@ -133,37 +131,37 @@ public: After a successful call to this method, the request will use HTTP @c POST instead of the default @c GET when it's executed. - @param data - The data to post. + @param text + The text data to post. @param contentType The value of HTTP "Content-Type" header, e.g. "text/html; charset=UTF-8". */ - void SetData(const wxString& data, const wxString& contentType); + void SetData(const wxString& text, const wxString& contentType); /** Set the binary data to be posted to the server. - The next request will - be an HTTP @c POST instead of the default HTTP @c GET and the given @a - data will be posted as the body of this request. + The next request will be a HTTP @c POST instead of the default HTTP + @c GET and the given @a dataStream will be posted as the body of + this request. @param dataStream The data in this stream will be posted as the request body @param contentType - The value of HTTP "Content-Type" header, e.g. "text/html; - charset=UTF-8". + The value of HTTP "Content-Type" header, e.g. + "application/octet-stream". */ void SetData(const wxInputStream& dataStream, const wxString& contentType); /** Instructs the request to ignore server error status codes. - Per default, server side errors (status code 500-599) will send + Per default, server side errors (status code 400-599) will send a wxEVT_WEBREQUEST_FAILED event just like network errors, but if the response is still required in this cases (e.g. to get more details from the response body), set this option to ignore all errors. - If ignored wxWebRequestResponse::GetStatus() has to be checked + If ignored, wxWebResponse::GetStatus() has to be checked from the wxEVT_WEBREQUEST_READY event handler. */ void SetIgnoreServerErrorStatus(bool ignore); @@ -183,13 +181,16 @@ public: void Cancel(); /** - Return a response object after a successful request. + Returns a response object after a successful request. + + Before sending a request or after a failed request this will return + @c NULL. */ - const wxWebRequestResponse* GetResponse() const; + const wxWebResponse* GetResponse() const; }; /** - A wxWebRequestResponse allows access to the response sent by the server. + A wxWebResponse allows access to the response sent by the server. @since 3.1.2 @@ -198,7 +199,7 @@ public: @see wxWebRequest */ -class wxWebRequestResponse +class wxWebResponse { public: /** @@ -242,12 +243,12 @@ public: }; /** - @class wxWebRequestSession + @class wxWebSession This class handles session-wide parameters and data used by wxWebRequest instances. - Usually the default session available via wxWebRequestSession::GetDefault() + Usually the default session available via wxWebSession::GetDefault() should be used. Additional instances might be useful if session separation is required. Instances must not be deleted before every active web request has finished. @@ -263,7 +264,7 @@ public: @see wxWebRequest */ -class wxWebRequestSession +class wxWebSession { public: /** @@ -272,7 +273,7 @@ public: All requests created by a call to CreateRequest() will use this session for communication and to store cookies. */ - wxWebRequestSession(); + wxWebSession(); /** Create a new request for the specified URL @@ -288,10 +289,11 @@ public: /** Returns the default session */ - static wxWebRequestSession* GetDefault(); + static wxWebSession& GetDefault(); /** - Adds a request header to every wxWebRequest using this session. + Sets a request header in every wxWebRequest created from this session + after is has been set. A good example for a session-wide request header is the @c User-Agent header. @@ -299,7 +301,7 @@ public: @param name Name of the header @param value String value of the header */ - void AddRequestHeader(const wxString& name, const wxString& value); + void SetHeader(const wxString& name, const wxString& value); }; /** @@ -317,13 +319,14 @@ public: class wxWebRequestEvent : public wxEvent { public: - wxWebViewEvent(); - wxWebViewEvent(wxEventType type, int id); + wxWebRequestEvent(); + wxWebRequestEvent(wxEventType type, int id); /** - The response for a wxEVT_WEBREQUEST_READY event + The response for a wxEVT_WEBREQUEST_READY event or @c NULL for other + events. */ - const wxWebRequestResponse* GetResponse() const; + const wxWebResponse* GetResponse() const; /** A textual error description for a client side error From 2c8fcf2584221d4856dc11b240f8d314c18e8482 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 17 Oct 2018 21:33:17 +0200 Subject: [PATCH 005/218] Add wxUSE_WEBREQUEST preprocessor constant --- build/cmake/setup.h.in | 2 ++ configure | 36 +++++++++++++++++++++++++ configure.in | 5 ++++ docs/doxygen/mainpages/const_wxusedef.h | 1 + include/wx/android/setup.h | 6 +++++ include/wx/chkconf.h | 8 ++++++ include/wx/gtk/setup0.h | 6 +++++ include/wx/motif/setup0.h | 6 +++++ include/wx/msw/setup0.h | 6 +++++ include/wx/osx/setup0.h | 6 +++++ include/wx/setup_inc.h | 6 +++++ include/wx/univ/setup0.h | 6 +++++ setup.h.in | 2 ++ 13 files changed, 96 insertions(+) diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index 8b3788591c..87c54ba807 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -299,6 +299,8 @@ #cmakedefine01 wxUSE_MIMETYPE +#cmakedefine01 wxUSE_WEBREQUEST + #cmakedefine01 wxUSE_PROTOCOL #cmakedefine01 wxUSE_PROTOCOL_FILE diff --git a/configure b/configure index 031ff5c97b..5fcda9185d 100755 --- a/configure +++ b/configure @@ -1137,6 +1137,7 @@ enable_sockets enable_ipv6 enable_ole enable_dataobj +enable_webrequest enable_ipc enable_baseevtloop enable_epollloop @@ -2078,6 +2079,7 @@ Optional Features: --enable-ipv6 enable IPv6 support in wxSocket --enable-ole use OLE classes (Win32 only) --enable-dataobj use data object classes + --enable-webrequest use wxWebRequest --enable-ipc use interprocess communication (wxSocket etc.) --enable-baseevtloop use event loop in console programs too --enable-epollloop use wxEpollDispatcher class (Linux only) @@ -6517,6 +6519,35 @@ fi eval "$wx_cv_use_dataobj" + enablestring= + defaultval=$wxUSE_ALL_FEATURES + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + # Check whether --enable-webrequest was given. +if test "${enable_webrequest+set}" = set; then : + enableval=$enable_webrequest; + if test "$enableval" = yes; then + wx_cv_use_webrequest='wxUSE_WEBREQUEST=yes' + else + wx_cv_use_webrequest='wxUSE_WEBREQUEST=no' + fi + +else + + wx_cv_use_webrequest='wxUSE_WEBREQUEST=${'DEFAULT_wxUSE_WEBREQUEST":-$defaultval}" + +fi + + + eval "$wx_cv_use_webrequest" + + enablestring= defaultval=$wxUSE_ALL_FEATURES @@ -36553,6 +36584,11 @@ if test "$wxUSE_FS_INET" = "yes"; then fi +if test "$wxUSE_WEBREQUEST" = "yes"; then + $as_echo "#define wxUSE_WEBREQUEST 1" >>confdefs.h + +fi + if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then wxUSE_JOYSTICK=no diff --git a/configure.in b/configure.in index b2aadfa781..40fb6ab0e0 100644 --- a/configure.in +++ b/configure.in @@ -698,6 +698,7 @@ WX_ARG_FEATURE(sockets, [ --enable-sockets use socket/network clas WX_ARG_FEATURE(ipv6, [ --enable-ipv6 enable IPv6 support in wxSocket], wxUSE_IPV6) WX_ARG_FEATURE(ole, [ --enable-ole use OLE classes (Win32 only)], wxUSE_OLE) WX_ARG_FEATURE(dataobj, [ --enable-dataobj use data object classes], wxUSE_DATAOBJ) +WX_ARG_FEATURE(webrequest, [ --enable-webrequest use wxWebRequest], wxUSE_WEBREQUEST) WX_ARG_FEATURE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC) @@ -6340,6 +6341,10 @@ if test "$wxUSE_FS_INET" = "yes"; then AC_DEFINE(wxUSE_FS_INET) fi +if test "$wxUSE_WEBREQUEST" = "yes"; then + AC_DEFINE(wxUSE_WEBREQUEST) +fi + dnl --------------------------------------------------------------------------- dnl Joystick support dnl --------------------------------------------------------------------------- diff --git a/docs/doxygen/mainpages/const_wxusedef.h b/docs/doxygen/mainpages/const_wxusedef.h index 9d52ed1821..c77c0cadae 100644 --- a/docs/doxygen/mainpages/const_wxusedef.h +++ b/docs/doxygen/mainpages/const_wxusedef.h @@ -253,6 +253,7 @@ library: @itemdef{wxUSE_URL_NATIVE, Use native support for some operations with wxURL.} @itemdef{wxUSE_VALIDATORS, Use wxValidator class.} @itemdef{wxUSE_VARIANT, Use wxVariant class.} +@itemdef{wxUSE_WEBREQUEST, Use wxWebRequest class.} @itemdef{wxUSE_WEBVIEW, Use wxWebView class.} @itemdef{wxUSE_WIZARDDLG, Use wxWizard class.} @itemdef{wxUSE_WXHTML_HELP, Use wxHtmlHelpController and related classes.} diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index ccc99e7ad0..272e381944 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -647,6 +647,12 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest and related classes: This will allow usage of system libraries +// for HTTP(S) requests +// +// Default is 1 +#define wxUSE_WEBREQUEST 1 + // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. // diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index 82bb132b8a..3a100bd3bf 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -1231,6 +1231,14 @@ # endif #endif /* !defined(wxUSE_VALIDATORS) */ +#ifndef wxUSE_WEBREQUEST +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_WEBREQUEST must be defined, please read comment near the top of this file." +# else +# define wxUSE_WEBREQUEST 0 +# endif +#endif /* !defined(wxUSE_WEBREQUEST) */ + #ifndef wxUSE_WEBVIEW # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_WEBVIEW must be defined, please read comment near the top of this file." diff --git a/include/wx/gtk/setup0.h b/include/wx/gtk/setup0.h index 22ee07b8d0..7bedbed0c4 100644 --- a/include/wx/gtk/setup0.h +++ b/include/wx/gtk/setup0.h @@ -648,6 +648,12 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest and related classes: This will allow usage of system libraries +// for HTTP(S) requests +// +// Default is 1 +#define wxUSE_WEBREQUEST 1 + // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. // diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index fc4c657c01..bf71fa4aa3 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -648,6 +648,12 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest and related classes: This will allow usage of system libraries +// for HTTP(S) requests +// +// Default is 1 +#define wxUSE_WEBREQUEST 1 + // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. // diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index dcbb2d7fde..1b6b30d7a6 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -648,6 +648,12 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest and related classes: This will allow usage of system libraries +// for HTTP(S) requests +// +// Default is 1 +#define wxUSE_WEBREQUEST 1 + // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. // diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index 49bf354be5..0b1849a279 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -654,6 +654,12 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest and related classes: This will allow usage of system libraries +// for HTTP(S) requests +// +// Default is 1 +#define wxUSE_WEBREQUEST 1 + // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. // diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index bece6430b8..f8b9346a32 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -644,6 +644,12 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest and related classes: This will allow usage of system libraries +// for HTTP(S) requests +// +// Default is 1 +#define wxUSE_WEBREQUEST 1 + // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. // diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index 11c7277097..f540e5816d 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -647,6 +647,12 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest and related classes: This will allow usage of system libraries +// for HTTP(S) requests +// +// Default is 1 +#define wxUSE_WEBREQUEST 1 + // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. // diff --git a/setup.h.in b/setup.h.in index 9f703405c1..48cf6734e7 100644 --- a/setup.h.in +++ b/setup.h.in @@ -299,6 +299,8 @@ #define wxUSE_MIMETYPE 0 +#define wxUSE_WEBREQUEST 0 + #define wxUSE_PROTOCOL 0 #define wxUSE_PROTOCOL_FILE 0 From 2fc1024949bae9829edb9c8d1ecf5f8fcb5b63ca Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 17 Oct 2018 23:19:35 +0200 Subject: [PATCH 006/218] Fix additional wxWebRequest typos and clarification --- interface/wx/webrequest.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index f356ee2d4e..be10739520 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -13,7 +13,7 @@ The latest features of the operating system will be used if available (e.g. HTTP/2, TLS 1.3). - System wide configuration like proxy and SSL certificates will be used + System-wide configuration like proxy and SSL certificates will be used when possible. Instances of wxWebRequest are created by using @@ -89,7 +89,7 @@ @event{wxEVT_WEBREQUEST_READY(id, func)} The response data is ready to be used. @event{wxEVT_WEBREQUEST_FAILED(id, func)} - A network error has occured. This could be client side or server side. + A network error has occurred. This could be client side or server side. Use wxWebRequestEvent::GetErrorDescription() to get more details. @event{wxEVT_WEBREQUEST_AUTH_REQUIRED(id, func)} The request needs additional authentication to continue. @@ -106,10 +106,15 @@ class wxWebRequest: public wxEvtHandler, public wxRefCounter { public: /** - Sets a request header send by this request. + Sets a request header which will be send to the server by this request. - @param name Name of the header - @param value String value of the header + The header will be added if it hasen't been set before or replaced + otherwise. + + @param name + Name of the header + @param value + String value of the header. An empty string will remove the header. */ void SetHeader(const wxString& name, const wxString& value); From 788c28f97d989e8ad8fe84c93298042a3d9a9fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Thu, 18 Oct 2018 09:46:48 +0200 Subject: [PATCH 007/218] Fix typos in interface/wx/webrequest.h --- interface/wx/webrequest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index be10739520..e81b5a1a48 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -106,9 +106,9 @@ class wxWebRequest: public wxEvtHandler, public wxRefCounter { public: /** - Sets a request header which will be send to the server by this request. + Sets a request header which will be sent to the server by this request. - The header will be added if it hasen't been set before or replaced + The header will be added if it hasn't been set before or replaced otherwise. @param name From cacd79d40eaeb951f4c3847a89d5db18625184ce Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 18 Oct 2018 21:04:29 +0200 Subject: [PATCH 008/218] Add wxWebSessionFactory and wxWebRequestEvent to documentation --- interface/wx/webrequest.h | 60 +++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index e81b5a1a48..3ba28f7290 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -290,12 +290,6 @@ public: */ wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY); - - /** - Returns the default session - */ - static wxWebSession& GetDefault(); - /** Sets a request header in every wxWebRequest created from this session after is has been set. @@ -307,6 +301,55 @@ public: @param value String value of the header */ void SetHeader(const wxString& name, const wxString& value); + + /** + Returns the default session + */ + static wxWebSession& GetDefault(); + + /** + Creates a new wxWebSession object. + + @param backend + The backend web session implementation to use. + + @return + The created wxWebSession + */ + static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); + + /** + Allows the registering of new backend for wxWebSession. + + backend can be used as an argument to New(). + + @param backend The name for the new backend to be registered under + @param factory A shared pointer to the factory which creates the appropriate backend. + */ + static void RegisterFactory(const wxString& backend, wxSharedPtr factory); +}; + +/** + @class wxWebSessionFactory + + An abstract factory class for creation wxWebSession backends. + + Each implementation of wxWebSession should have its own factory. + + @since 3.1.2 + + @library{wxnet} + @category{net} + + @see wxWebSession +*/ +class wxWebSessionFactory +{ +public: + /** + Creates a new web session object + */ + virtual wxWebSession* Create() = 0; }; /** @@ -325,13 +368,14 @@ class wxWebRequestEvent : public wxEvent { public: wxWebRequestEvent(); - wxWebRequestEvent(wxEventType type, int id); + wxWebRequestEvent(wxEventType type, int id, wxWebResponse* response = NULL, + const wxString& errorDesc = ""); /** The response for a wxEVT_WEBREQUEST_READY event or @c NULL for other events. */ - const wxWebResponse* GetResponse() const; + wxWebResponse* GetResponse() const; /** A textual error description for a client side error From e07c1bf40c964e621f5bb8ec95e1350cf199aa12 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 18 Oct 2018 23:19:17 +0200 Subject: [PATCH 009/218] Prepared wxWebRequest implementation --- Makefile.in | 44 ++++++++- autoconf_inc.m4 | 106 +++++++++++----------- build/bakefiles/files.bkl | 4 + build/cmake/files.cmake | 4 + build/files | 4 + build/msw/makefile.bcc | 36 +++++++- build/msw/makefile.gcc | 36 +++++++- build/msw/makefile.vc | 36 +++++++- build/msw/wx_net.vcxproj | 4 + build/msw/wx_net.vcxproj.filters | 16 +++- build/msw/wx_vc7_net.vcproj | 12 +++ build/msw/wx_vc8_net.vcproj | 16 ++++ build/msw/wx_vc9_net.vcproj | 16 ++++ include/wx/msw/webrequest_winhttp.h | 33 +++++++ include/wx/webrequest.h | 135 ++++++++++++++++++++++++++++ interface/wx/webrequest.h | 8 ++ samples/webrequest/webrequest.cpp | 28 +++++- src/common/webrequest.cpp | 89 ++++++++++++++++++ src/msw/webrequest_winhttp.cpp | 33 +++++++ 19 files changed, 593 insertions(+), 67 deletions(-) create mode 100644 include/wx/msw/webrequest_winhttp.h create mode 100644 include/wx/webrequest.h create mode 100644 src/common/webrequest.cpp create mode 100644 src/msw/webrequest_winhttp.cpp diff --git a/Makefile.in b/Makefile.in index c07f2d317d..94da2f332d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -545,6 +545,7 @@ ALL_BASE_HEADERS = \ wx/sckstrm.h \ wx/socket.h \ wx/url.h \ + wx/webrequest.h \ wx/xml/xml.h \ wx/xtixml.h ALL_HEADERS = \ @@ -764,6 +765,7 @@ ALL_PORTS_BASE_HEADERS = \ wx/sckstrm.h \ wx/socket.h \ wx/url.h \ + wx/webrequest.h \ wx/xml/xml.h \ wx/xtixml.h ALL_BASE_SOURCES = \ @@ -913,11 +915,13 @@ ALL_BASE_SOURCES = \ src/common/sckstrm.cpp \ src/common/socket.cpp \ src/common/url.cpp \ + src/common/webrequest.cpp \ src/common/socketiohandler.cpp \ src/unix/sockunix.cpp \ src/osx/core/sockosx.cpp \ src/msw/sockmsw.cpp \ src/msw/urlmsw.cpp \ + src/msw/webrequest_winhttp.cpp \ src/xml/xml.cpp \ src/common/xtixml.cpp MONODLL_CFLAGS = $(__monodll_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ @@ -1055,6 +1059,7 @@ MONODLL_OBJECTS = \ monodll_sckstrm.o \ monodll_socket.o \ monodll_url.o \ + monodll_webrequest.o \ $(__NET_PLATFORM_SRC_OBJECTS) \ $(__MONOLIB_GUI_SRC_OBJECTS) \ monodll_xml.o \ @@ -1197,6 +1202,7 @@ MONOLIB_OBJECTS = \ monolib_sckstrm.o \ monolib_socket.o \ monolib_url.o \ + monolib_webrequest.o \ $(__NET_PLATFORM_SRC_OBJECTS_1) \ $(__MONOLIB_GUI_SRC_OBJECTS_1) \ monolib_xml.o \ @@ -1451,6 +1457,7 @@ NETDLL_OBJECTS = \ netdll_sckstrm.o \ netdll_socket.o \ netdll_url.o \ + netdll_webrequest.o \ $(__NET_PLATFORM_SRC_OBJECTS_2) NETDLL_ODEP = $(_____pch_wxprec_netdll_wx_wxprec_h_gch___depname) NETLIB_CXXFLAGS = $(__netlib_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ @@ -1469,6 +1476,7 @@ NETLIB_OBJECTS = \ netlib_sckstrm.o \ netlib_socket.o \ netlib_url.o \ + netlib_webrequest.o \ $(__NET_PLATFORM_SRC_OBJECTS_3) NETLIB_ODEP = $(_____pch_wxprec_netlib_wx_wxprec_h_gch___depname) COREDLL_CFLAGS = $(__coredll_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ @@ -4229,7 +4237,8 @@ COND_PLATFORM_WIN32_1___BASE_PLATFORM_SRC_OBJECTS = \ @COND_PLATFORM_UNIX_1@__NET_PLATFORM_SRC_OBJECTS = \ @COND_PLATFORM_UNIX_1@ monodll_socketiohandler.o monodll_sockunix.o @COND_PLATFORM_WIN32_1@__NET_PLATFORM_SRC_OBJECTS = \ -@COND_PLATFORM_WIN32_1@ monodll_sockmsw.o monodll_urlmsw.o +@COND_PLATFORM_WIN32_1@ monodll_sockmsw.o monodll_urlmsw.o \ +@COND_PLATFORM_WIN32_1@ monodll_webrequest_winhttp.o COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS = \ $(__CORE_SRC_OBJECTS) \ monodll_mediactrlcmn.o \ @@ -6205,7 +6214,8 @@ COND_PLATFORM_WIN32_1___BASE_PLATFORM_SRC_OBJECTS_1 = \ @COND_PLATFORM_UNIX_1@__NET_PLATFORM_SRC_OBJECTS_1 = \ @COND_PLATFORM_UNIX_1@ monolib_socketiohandler.o monolib_sockunix.o @COND_PLATFORM_WIN32_1@__NET_PLATFORM_SRC_OBJECTS_1 \ -@COND_PLATFORM_WIN32_1@ = monolib_sockmsw.o monolib_urlmsw.o +@COND_PLATFORM_WIN32_1@ = monolib_sockmsw.o monolib_urlmsw.o \ +@COND_PLATFORM_WIN32_1@ monolib_webrequest_winhttp.o COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS_1 = \ $(__CORE_SRC_OBJECTS_1) \ monolib_mediactrlcmn.o \ @@ -8383,7 +8393,8 @@ COND_USE_SOVERSOLARIS_1___netdll___so_symlinks_uninst_cmd = rm -f \ @COND_PLATFORM_UNIX_1@__NET_PLATFORM_SRC_OBJECTS_2 = \ @COND_PLATFORM_UNIX_1@ netdll_socketiohandler.o netdll_sockunix.o @COND_PLATFORM_WIN32_1@__NET_PLATFORM_SRC_OBJECTS_2 \ -@COND_PLATFORM_WIN32_1@ = netdll_sockmsw.o netdll_urlmsw.o +@COND_PLATFORM_WIN32_1@ = netdll_sockmsw.o netdll_urlmsw.o \ +@COND_PLATFORM_WIN32_1@ netdll_webrequest_winhttp.o COND_MONOLITHIC_0_SHARED_0___netlib___depname = \ $(LIBDIRNAME)/$(LIBPREFIX)wx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_net-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT) @COND_MONOLITHIC_0_SHARED_0@__netlib___depname = $(COND_MONOLITHIC_0_SHARED_0___netlib___depname) @@ -8400,7 +8411,8 @@ COND_MONOLITHIC_0_SHARED_0___netlib___depname = \ @COND_PLATFORM_UNIX_1@__NET_PLATFORM_SRC_OBJECTS_3 = \ @COND_PLATFORM_UNIX_1@ netlib_socketiohandler.o netlib_sockunix.o @COND_PLATFORM_WIN32_1@__NET_PLATFORM_SRC_OBJECTS_3 \ -@COND_PLATFORM_WIN32_1@ = netlib_sockmsw.o netlib_urlmsw.o +@COND_PLATFORM_WIN32_1@ = netlib_sockmsw.o netlib_urlmsw.o \ +@COND_PLATFORM_WIN32_1@ netlib_webrequest_winhttp.o @COND_SHARED_1@____wxnet_namedll_DEP = $(__netdll___depname) @COND_SHARED_0@____wxnet_namelib_DEP = $(__netlib___depname) COND_MONOLITHIC_0_SHARED_1_USE_GUI_1___coredll___depname = \ @@ -15898,12 +15910,18 @@ monodll_socket.o: $(srcdir)/src/common/socket.cpp $(MONODLL_ODEP) monodll_url.o: $(srcdir)/src/common/url.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/url.cpp +monodll_webrequest.o: $(srcdir)/src/common/webrequest.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/webrequest.cpp + monodll_sockmsw.o: $(srcdir)/src/msw/sockmsw.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/sockmsw.cpp monodll_urlmsw.o: $(srcdir)/src/msw/urlmsw.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/urlmsw.cpp +monodll_webrequest_winhttp.o: $(srcdir)/src/msw/webrequest_winhttp.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/webrequest_winhttp.cpp + monodll_sockosx.o: $(srcdir)/src/osx/core/sockosx.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/sockosx.cpp @@ -21151,12 +21169,18 @@ monolib_socket.o: $(srcdir)/src/common/socket.cpp $(MONOLIB_ODEP) monolib_url.o: $(srcdir)/src/common/url.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/url.cpp +monolib_webrequest.o: $(srcdir)/src/common/webrequest.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/webrequest.cpp + monolib_sockmsw.o: $(srcdir)/src/msw/sockmsw.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/sockmsw.cpp monolib_urlmsw.o: $(srcdir)/src/msw/urlmsw.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/urlmsw.cpp +monolib_webrequest_winhttp.o: $(srcdir)/src/msw/webrequest_winhttp.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/webrequest_winhttp.cpp + monolib_sockosx.o: $(srcdir)/src/osx/core/sockosx.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/sockosx.cpp @@ -26974,12 +26998,18 @@ netdll_socket.o: $(srcdir)/src/common/socket.cpp $(NETDLL_ODEP) netdll_url.o: $(srcdir)/src/common/url.cpp $(NETDLL_ODEP) $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/common/url.cpp +netdll_webrequest.o: $(srcdir)/src/common/webrequest.cpp $(NETDLL_ODEP) + $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/common/webrequest.cpp + netdll_sockmsw.o: $(srcdir)/src/msw/sockmsw.cpp $(NETDLL_ODEP) $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/msw/sockmsw.cpp netdll_urlmsw.o: $(srcdir)/src/msw/urlmsw.cpp $(NETDLL_ODEP) $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/msw/urlmsw.cpp +netdll_webrequest_winhttp.o: $(srcdir)/src/msw/webrequest_winhttp.cpp $(NETDLL_ODEP) + $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/msw/webrequest_winhttp.cpp + netdll_sockosx.o: $(srcdir)/src/osx/core/sockosx.cpp $(NETDLL_ODEP) $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/osx/core/sockosx.cpp @@ -27025,12 +27055,18 @@ netlib_socket.o: $(srcdir)/src/common/socket.cpp $(NETLIB_ODEP) netlib_url.o: $(srcdir)/src/common/url.cpp $(NETLIB_ODEP) $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/common/url.cpp +netlib_webrequest.o: $(srcdir)/src/common/webrequest.cpp $(NETLIB_ODEP) + $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/common/webrequest.cpp + netlib_sockmsw.o: $(srcdir)/src/msw/sockmsw.cpp $(NETLIB_ODEP) $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/msw/sockmsw.cpp netlib_urlmsw.o: $(srcdir)/src/msw/urlmsw.cpp $(NETLIB_ODEP) $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/msw/urlmsw.cpp +netlib_webrequest_winhttp.o: $(srcdir)/src/msw/webrequest_winhttp.cpp $(NETLIB_ODEP) + $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/msw/webrequest_winhttp.cpp + netlib_sockosx.o: $(srcdir)/src/osx/core/sockosx.cpp $(NETLIB_ODEP) $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/osx/core/sockosx.cpp diff --git a/autoconf_inc.m4 b/autoconf_inc.m4 index 8d9e122a8a..3bead16019 100644 --- a/autoconf_inc.m4 +++ b/autoconf_inc.m4 @@ -1,4 +1,4 @@ -dnl ### begin block 00_header[../../demos/bombs/bombs.bkl,../../demos/demos.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/html_samples.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/opengl_samples.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/utils.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 00_header[../../demos/bombs/bombs.bkl,../../demos/demos.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/html_samples.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/opengl_samples.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/utils.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### dnl dnl This macro was generated by dnl Bakefile 0.2.11 (http://www.bakefile.org) @@ -8,55 +8,55 @@ BAKEFILE_AUTOCONF_INC_M4_VERSION="0.2.11" dnl ### begin block 10_AC_BAKEFILE_PRECOMP_HEADERS[../../tests/test.bkl,wx.bkl] ### AC_BAKEFILE_PRECOMP_HEADERS -dnl ### begin block 20_COND_BUILD_debug[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_BUILD_debug[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_BUILD_debug="#" if test "x$BUILD" = "xdebug" ; then COND_BUILD_debug="" fi AC_SUBST(COND_BUILD_debug) -dnl ### begin block 20_COND_BUILD_debug_DEBUG_INFO_default[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_BUILD_debug_DEBUG_INFO_default[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_BUILD_debug_DEBUG_INFO_default="#" if test "x$BUILD" = "xdebug" -a "x$DEBUG_INFO" = "xdefault" ; then COND_BUILD_debug_DEBUG_INFO_default="" fi AC_SUBST(COND_BUILD_debug_DEBUG_INFO_default) -dnl ### begin block 20_COND_BUILD_release[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_BUILD_release[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_BUILD_release="#" if test "x$BUILD" = "xrelease" ; then COND_BUILD_release="" fi AC_SUBST(COND_BUILD_release) -dnl ### begin block 20_COND_BUILD_release_DEBUG_INFO_default[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_BUILD_release_DEBUG_INFO_default[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_BUILD_release_DEBUG_INFO_default="#" if test "x$BUILD" = "xrelease" -a "x$DEBUG_INFO" = "xdefault" ; then COND_BUILD_release_DEBUG_INFO_default="" fi AC_SUBST(COND_BUILD_release_DEBUG_INFO_default) -dnl ### begin block 20_COND_DEBUG_FLAG_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_DEBUG_FLAG_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_DEBUG_FLAG_0="#" if test "x$DEBUG_FLAG" = "x0" ; then COND_DEBUG_FLAG_0="" fi AC_SUBST(COND_DEBUG_FLAG_0) -dnl ### begin block 20_COND_DEBUG_INFO_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_DEBUG_INFO_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_DEBUG_INFO_0="#" if test "x$DEBUG_INFO" = "x0" ; then COND_DEBUG_INFO_0="" fi AC_SUBST(COND_DEBUG_INFO_0) -dnl ### begin block 20_COND_DEBUG_INFO_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_DEBUG_INFO_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_DEBUG_INFO_1="#" if test "x$DEBUG_INFO" = "x1" ; then COND_DEBUG_INFO_1="" fi AC_SUBST(COND_DEBUG_INFO_1) -dnl ### begin block 20_COND_DEPS_TRACKING_0[../../demos/bombs/bombs.bkl,../../demos/demos.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/html_samples.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/opengl_samples.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/utils.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_DEPS_TRACKING_0[../../demos/bombs/bombs.bkl,../../demos/demos.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/html_samples.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/opengl_samples.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/utils.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_DEPS_TRACKING_0="#" if test "x$DEPS_TRACKING" = "x0" ; then COND_DEPS_TRACKING_0="" fi AC_SUBST(COND_DEPS_TRACKING_0) -dnl ### begin block 20_COND_DEPS_TRACKING_1[../../demos/bombs/bombs.bkl,../../demos/demos.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/html_samples.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/opengl_samples.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/utils.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_DEPS_TRACKING_1[../../demos/bombs/bombs.bkl,../../demos/demos.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/html_samples.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/opengl_samples.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/utils.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_DEPS_TRACKING_1="#" if test "x$DEPS_TRACKING" = "x1" ; then COND_DEPS_TRACKING_1="" @@ -74,7 +74,7 @@ dnl ### begin block 20_COND_ICC_PCH_1[../../tests/test.bkl,wx.bkl] ### COND_ICC_PCH_1="" fi AC_SUBST(COND_ICC_PCH_1) -dnl ### begin block 20_COND_MONOLITHIC_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_MONOLITHIC_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_MONOLITHIC_0="#" if test "x$MONOLITHIC" = "x0" ; then COND_MONOLITHIC_0="" @@ -152,7 +152,7 @@ dnl ### begin block 20_COND_MONOLITHIC_0_SHARED_0_USE_XRC_1[wx.bkl] ### COND_MONOLITHIC_0_SHARED_0_USE_XRC_1="" fi AC_SUBST(COND_MONOLITHIC_0_SHARED_0_USE_XRC_1) -dnl ### begin block 20_COND_MONOLITHIC_0_SHARED_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_MONOLITHIC_0_SHARED_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_MONOLITHIC_0_SHARED_1="#" if test "x$MONOLITHIC" = "x0" -a "x$SHARED" = "x1" ; then COND_MONOLITHIC_0_SHARED_1="" @@ -248,7 +248,7 @@ dnl ### begin block 20_COND_MONOLITHIC_0_USE_HTML_1[wx.bkl] ### COND_MONOLITHIC_0_USE_HTML_1="" fi AC_SUBST(COND_MONOLITHIC_0_USE_HTML_1) -dnl ### begin block 20_COND_MONOLITHIC_0_USE_MEDIA_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_MONOLITHIC_0_USE_MEDIA_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_MONOLITHIC_0_USE_MEDIA_1="#" if test "x$MONOLITHIC" = "x0" -a "x$USE_MEDIA" = "x1" ; then COND_MONOLITHIC_0_USE_MEDIA_1="" @@ -284,7 +284,7 @@ dnl ### begin block 20_COND_MONOLITHIC_0_USE_STC_1[wx.bkl] ### COND_MONOLITHIC_0_USE_STC_1="" fi AC_SUBST(COND_MONOLITHIC_0_USE_STC_1) -dnl ### begin block 20_COND_MONOLITHIC_0_USE_WEBVIEW_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_MONOLITHIC_0_USE_WEBVIEW_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_MONOLITHIC_0_USE_WEBVIEW_1="#" if test "x$MONOLITHIC" = "x0" -a "x$USE_WEBVIEW" = "x1" ; then COND_MONOLITHIC_0_USE_WEBVIEW_1="" @@ -296,7 +296,7 @@ dnl ### begin block 20_COND_MONOLITHIC_0_USE_XRC_1[wx.bkl] ### COND_MONOLITHIC_0_USE_XRC_1="" fi AC_SUBST(COND_MONOLITHIC_0_USE_XRC_1) -dnl ### begin block 20_COND_MONOLITHIC_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_MONOLITHIC_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_MONOLITHIC_1="#" if test "x$MONOLITHIC" = "x1" ; then COND_MONOLITHIC_1="" @@ -314,19 +314,19 @@ dnl ### begin block 20_COND_MONOLITHIC_1_SHARED_1[wx.bkl] ### COND_MONOLITHIC_1_SHARED_1="" fi AC_SUBST(COND_MONOLITHIC_1_SHARED_1) -dnl ### begin block 20_COND_MONOLITHIC_1_USE_STC_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_MONOLITHIC_1_USE_STC_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_MONOLITHIC_1_USE_STC_1="#" if test "x$MONOLITHIC" = "x1" -a "x$USE_STC" = "x1" ; then COND_MONOLITHIC_1_USE_STC_1="" fi AC_SUBST(COND_MONOLITHIC_1_USE_STC_1) -dnl ### begin block 20_COND_OFFICIAL_BUILD_0_PLATFORM_WIN32_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_OFFICIAL_BUILD_0_PLATFORM_WIN32_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_OFFICIAL_BUILD_0_PLATFORM_WIN32_1="#" if test "x$OFFICIAL_BUILD" = "x0" -a "x$PLATFORM_WIN32" = "x1" ; then COND_OFFICIAL_BUILD_0_PLATFORM_WIN32_1="" fi AC_SUBST(COND_OFFICIAL_BUILD_0_PLATFORM_WIN32_1) -dnl ### begin block 20_COND_OFFICIAL_BUILD_1_PLATFORM_WIN32_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_OFFICIAL_BUILD_1_PLATFORM_WIN32_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_OFFICIAL_BUILD_1_PLATFORM_WIN32_1="#" if test "x$OFFICIAL_BUILD" = "x1" -a "x$PLATFORM_WIN32" = "x1" ; then COND_OFFICIAL_BUILD_1_PLATFORM_WIN32_1="" @@ -344,7 +344,7 @@ dnl ### begin block 20_COND_PLATFORM_MACOSX_0_USE_SOVERSION_1[wx.bkl] ### COND_PLATFORM_MACOSX_0_USE_SOVERSION_1="" fi AC_SUBST(COND_PLATFORM_MACOSX_0_USE_SOVERSION_1) -dnl ### begin block 20_COND_PLATFORM_MACOSX_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_PLATFORM_MACOSX_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_PLATFORM_MACOSX_1="#" if test "x$PLATFORM_MACOSX" = "x1" ; then COND_PLATFORM_MACOSX_1="" @@ -416,19 +416,19 @@ dnl ### begin block 20_COND_PLATFORM_MACOSX_1_USE_SOVERSION_1[wx.bkl] ### COND_PLATFORM_MACOSX_1_USE_SOVERSION_1="" fi AC_SUBST(COND_PLATFORM_MACOSX_1_USE_SOVERSION_1) -dnl ### begin block 20_COND_PLATFORM_OS2_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../utils/emulator/src/emulator.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,wx.bkl] ### +dnl ### begin block 20_COND_PLATFORM_OS2_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../utils/emulator/src/emulator.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,wx.bkl] ### COND_PLATFORM_OS2_1="#" if test "x$PLATFORM_OS2" = "x1" ; then COND_PLATFORM_OS2_1="" fi AC_SUBST(COND_PLATFORM_OS2_1) -dnl ### begin block 20_COND_PLATFORM_UNIX_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_PLATFORM_UNIX_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_PLATFORM_UNIX_0="#" if test "x$PLATFORM_UNIX" = "x0" ; then COND_PLATFORM_UNIX_0="" fi AC_SUBST(COND_PLATFORM_UNIX_0) -dnl ### begin block 20_COND_PLATFORM_UNIX_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_PLATFORM_UNIX_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_PLATFORM_UNIX_1="#" if test "x$PLATFORM_UNIX" = "x1" ; then COND_PLATFORM_UNIX_1="" @@ -464,7 +464,7 @@ dnl ### begin block 20_COND_PLATFORM_UNIX_1_USE_PLUGINS_0[wx.bkl] ### COND_PLATFORM_UNIX_1_USE_PLUGINS_0="" fi AC_SUBST(COND_PLATFORM_UNIX_1_USE_PLUGINS_0) -dnl ### begin block 20_COND_PLATFORM_WIN32_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_PLATFORM_WIN32_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_PLATFORM_WIN32_0="#" if test "x$PLATFORM_WIN32" = "x0" ; then COND_PLATFORM_WIN32_0="" @@ -482,7 +482,7 @@ dnl ### begin block 20_COND_PLATFORM_WIN32_0_TOOLKIT_GTK_TOOLKIT_VERSION_4[wx.bk COND_PLATFORM_WIN32_0_TOOLKIT_GTK_TOOLKIT_VERSION_4="" fi AC_SUBST(COND_PLATFORM_WIN32_0_TOOLKIT_GTK_TOOLKIT_VERSION_4) -dnl ### begin block 20_COND_PLATFORM_WIN32_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_PLATFORM_WIN32_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_PLATFORM_WIN32_1="#" if test "x$PLATFORM_WIN32" = "x1" ; then COND_PLATFORM_WIN32_1="" @@ -584,7 +584,7 @@ dnl ### begin block 20_COND_SHARED_0_wxUSE_ZLIB_builtin[wx.bkl] ### COND_SHARED_0_wxUSE_ZLIB_builtin="" fi AC_SUBST(COND_SHARED_0_wxUSE_ZLIB_builtin) -dnl ### begin block 20_COND_SHARED_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_SHARED_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_SHARED_1="#" if test "x$SHARED" = "x1" ; then COND_SHARED_1="" @@ -608,7 +608,7 @@ dnl ### begin block 20_COND_TOOLKIT_[wx.bkl] ### COND_TOOLKIT_="" fi AC_SUBST(COND_TOOLKIT_) -dnl ### begin block 20_COND_TOOLKIT_COCOA[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,wx.bkl] ### +dnl ### begin block 20_COND_TOOLKIT_COCOA[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,wx.bkl] ### COND_TOOLKIT_COCOA="#" if test "x$TOOLKIT" = "xCOCOA" ; then COND_TOOLKIT_COCOA="" @@ -716,7 +716,7 @@ dnl ### begin block 20_COND_TOOLKIT_GTK_USE_GUI_1[wx.bkl] ### COND_TOOLKIT_GTK_USE_GUI_1="" fi AC_SUBST(COND_TOOLKIT_GTK_USE_GUI_1) -dnl ### begin block 20_COND_TOOLKIT_MAC[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_TOOLKIT_MAC[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_TOOLKIT_MAC="#" if test "x$TOOLKIT" = "xMAC" ; then COND_TOOLKIT_MAC="" @@ -740,7 +740,7 @@ dnl ### begin block 20_COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0[wx.bkl] ### COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0="" fi AC_SUBST(COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0) -dnl ### begin block 20_COND_TOOLKIT_MSW[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_TOOLKIT_MSW[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_TOOLKIT_MSW="#" if test "x$TOOLKIT" = "xMSW" ; then COND_TOOLKIT_MSW="" @@ -758,13 +758,13 @@ dnl ### begin block 20_COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0[wx.bkl] ### COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0="" fi AC_SUBST(COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0) -dnl ### begin block 20_COND_TOOLKIT_OSX_CARBON[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/screenshotgen/src/screenshotgen.bkl] ### +dnl ### begin block 20_COND_TOOLKIT_OSX_CARBON[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/screenshotgen/src/screenshotgen.bkl] ### COND_TOOLKIT_OSX_CARBON="#" if test "x$TOOLKIT" = "xOSX_CARBON" ; then COND_TOOLKIT_OSX_CARBON="" fi AC_SUBST(COND_TOOLKIT_OSX_CARBON) -dnl ### begin block 20_COND_TOOLKIT_OSX_COCOA[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,wx.bkl] ### +dnl ### begin block 20_COND_TOOLKIT_OSX_COCOA[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,wx.bkl] ### COND_TOOLKIT_OSX_COCOA="#" if test "x$TOOLKIT" = "xOSX_COCOA" ; then COND_TOOLKIT_OSX_COCOA="" @@ -788,7 +788,7 @@ dnl ### begin block 20_COND_TOOLKIT_OSX_COCOA_WXUNIV_0[../../samples/widgets/wid COND_TOOLKIT_OSX_COCOA_WXUNIV_0="" fi AC_SUBST(COND_TOOLKIT_OSX_COCOA_WXUNIV_0) -dnl ### begin block 20_COND_TOOLKIT_OSX_IPHONE[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,wx.bkl] ### +dnl ### begin block 20_COND_TOOLKIT_OSX_IPHONE[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,wx.bkl] ### COND_TOOLKIT_OSX_IPHONE="#" if test "x$TOOLKIT" = "xOSX_IPHONE" ; then COND_TOOLKIT_OSX_IPHONE="" @@ -836,37 +836,37 @@ dnl ### begin block 20_COND_TOOLKIT_X11_USE_GUI_1_WXUNIV_1[wx.bkl] ### COND_TOOLKIT_X11_USE_GUI_1_WXUNIV_1="" fi AC_SUBST(COND_TOOLKIT_X11_USE_GUI_1_WXUNIV_1) -dnl ### begin block 20_COND_UNICODE_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_UNICODE_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_UNICODE_1="#" if test "x$UNICODE" = "x1" ; then COND_UNICODE_1="" fi AC_SUBST(COND_UNICODE_1) -dnl ### begin block 20_COND_USE_CAIRO_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_CAIRO_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_CAIRO_1="#" if test "x$USE_CAIRO" = "x1" ; then COND_USE_CAIRO_1="" fi AC_SUBST(COND_USE_CAIRO_1) -dnl ### begin block 20_COND_USE_EXCEPTIONS_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_EXCEPTIONS_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_EXCEPTIONS_0="#" if test "x$USE_EXCEPTIONS" = "x0" ; then COND_USE_EXCEPTIONS_0="" fi AC_SUBST(COND_USE_EXCEPTIONS_0) -dnl ### begin block 20_COND_USE_EXCEPTIONS_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_EXCEPTIONS_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_EXCEPTIONS_1="#" if test "x$USE_EXCEPTIONS" = "x1" ; then COND_USE_EXCEPTIONS_1="" fi AC_SUBST(COND_USE_EXCEPTIONS_1) -dnl ### begin block 20_COND_USE_GUI_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_GUI_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_GUI_0="#" if test "x$USE_GUI" = "x0" ; then COND_USE_GUI_0="" fi AC_SUBST(COND_USE_GUI_0) -dnl ### begin block 20_COND_USE_GUI_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_GUI_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_GUI_1="#" if test "x$USE_GUI" = "x1" ; then COND_USE_GUI_1="" @@ -890,19 +890,19 @@ dnl ### begin block 20_COND_USE_GUI_1_WXUNIV_1[wx.bkl] ### COND_USE_GUI_1_WXUNIV_1="" fi AC_SUBST(COND_USE_GUI_1_WXUNIV_1) -dnl ### begin block 20_COND_USE_GUI_1_wxUSE_LIBJPEG_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_GUI_1_wxUSE_LIBJPEG_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_GUI_1_wxUSE_LIBJPEG_builtin="#" if test "x$USE_GUI" = "x1" -a "x$wxUSE_LIBJPEG" = "xbuiltin" ; then COND_USE_GUI_1_wxUSE_LIBJPEG_builtin="" fi AC_SUBST(COND_USE_GUI_1_wxUSE_LIBJPEG_builtin) -dnl ### begin block 20_COND_USE_GUI_1_wxUSE_LIBPNG_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_GUI_1_wxUSE_LIBPNG_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_GUI_1_wxUSE_LIBPNG_builtin="#" if test "x$USE_GUI" = "x1" -a "x$wxUSE_LIBPNG" = "xbuiltin" ; then COND_USE_GUI_1_wxUSE_LIBPNG_builtin="" fi AC_SUBST(COND_USE_GUI_1_wxUSE_LIBPNG_builtin) -dnl ### begin block 20_COND_USE_GUI_1_wxUSE_LIBTIFF_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_GUI_1_wxUSE_LIBTIFF_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_GUI_1_wxUSE_LIBTIFF_builtin="#" if test "x$USE_GUI" = "x1" -a "x$wxUSE_LIBTIFF" = "xbuiltin" ; then COND_USE_GUI_1_wxUSE_LIBTIFF_builtin="" @@ -920,19 +920,19 @@ dnl ### begin block 20_COND_USE_PCH_1[../../tests/test.bkl,wx.bkl] ### COND_USE_PCH_1="" fi AC_SUBST(COND_USE_PCH_1) -dnl ### begin block 20_COND_USE_PLUGINS_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_PLUGINS_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_PLUGINS_0="#" if test "x$USE_PLUGINS" = "x0" ; then COND_USE_PLUGINS_0="" fi AC_SUBST(COND_USE_PLUGINS_0) -dnl ### begin block 20_COND_USE_RTTI_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_RTTI_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_RTTI_0="#" if test "x$USE_RTTI" = "x0" ; then COND_USE_RTTI_0="" fi AC_SUBST(COND_USE_RTTI_0) -dnl ### begin block 20_COND_USE_RTTI_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_RTTI_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_RTTI_1="#" if test "x$USE_RTTI" = "x1" ; then COND_USE_RTTI_1="" @@ -980,19 +980,19 @@ dnl ### begin block 20_COND_USE_STC_1[wx.bkl] ### COND_USE_STC_1="" fi AC_SUBST(COND_USE_STC_1) -dnl ### begin block 20_COND_USE_THREADS_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_THREADS_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_THREADS_0="#" if test "x$USE_THREADS" = "x0" ; then COND_USE_THREADS_0="" fi AC_SUBST(COND_USE_THREADS_0) -dnl ### begin block 20_COND_USE_THREADS_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_THREADS_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_THREADS_1="#" if test "x$USE_THREADS" = "x1" ; then COND_USE_THREADS_1="" fi AC_SUBST(COND_USE_THREADS_1) -dnl ### begin block 20_COND_USE_WEBVIEW_WEBKIT2_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_USE_WEBVIEW_WEBKIT2_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_USE_WEBVIEW_WEBKIT2_1="#" if test "x$USE_WEBVIEW_WEBKIT2" = "x1" ; then COND_USE_WEBVIEW_WEBKIT2_1="" @@ -1016,43 +1016,43 @@ dnl ### begin block 20_COND_WITH_PLUGIN_SDL_1[wx.bkl] ### COND_WITH_PLUGIN_SDL_1="" fi AC_SUBST(COND_WITH_PLUGIN_SDL_1) -dnl ### begin block 20_COND_WXUNIV_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_WXUNIV_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_WXUNIV_1="#" if test "x$WXUNIV" = "x1" ; then COND_WXUNIV_1="" fi AC_SUBST(COND_WXUNIV_1) -dnl ### begin block 20_COND_wxUSE_EXPAT_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_wxUSE_EXPAT_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_wxUSE_EXPAT_builtin="#" if test "x$wxUSE_EXPAT" = "xbuiltin" ; then COND_wxUSE_EXPAT_builtin="" fi AC_SUBST(COND_wxUSE_EXPAT_builtin) -dnl ### begin block 20_COND_wxUSE_LIBJPEG_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_wxUSE_LIBJPEG_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_wxUSE_LIBJPEG_builtin="#" if test "x$wxUSE_LIBJPEG" = "xbuiltin" ; then COND_wxUSE_LIBJPEG_builtin="" fi AC_SUBST(COND_wxUSE_LIBJPEG_builtin) -dnl ### begin block 20_COND_wxUSE_LIBPNG_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_wxUSE_LIBPNG_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_wxUSE_LIBPNG_builtin="#" if test "x$wxUSE_LIBPNG" = "xbuiltin" ; then COND_wxUSE_LIBPNG_builtin="" fi AC_SUBST(COND_wxUSE_LIBPNG_builtin) -dnl ### begin block 20_COND_wxUSE_LIBTIFF_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_wxUSE_LIBTIFF_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_wxUSE_LIBTIFF_builtin="#" if test "x$wxUSE_LIBTIFF" = "xbuiltin" ; then COND_wxUSE_LIBTIFF_builtin="" fi AC_SUBST(COND_wxUSE_LIBTIFF_builtin) -dnl ### begin block 20_COND_wxUSE_REGEX_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_wxUSE_REGEX_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_wxUSE_REGEX_builtin="#" if test "x$wxUSE_REGEX" = "xbuiltin" ; then COND_wxUSE_REGEX_builtin="" fi AC_SUBST(COND_wxUSE_REGEX_builtin) -dnl ### begin block 20_COND_wxUSE_ZLIB_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_wxUSE_ZLIB_builtin[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/htmlctrl/htmlctrl.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/memcheck/memcheck.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/emulator/src/emulator.bkl,../../utils/execmon/execmon.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_wxUSE_ZLIB_builtin="#" if test "x$wxUSE_ZLIB" = "xbuiltin" ; then COND_wxUSE_ZLIB_builtin="" diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 3f84e21ae5..ea7679c556 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -756,8 +756,10 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/msw/sockmsw.cpp src/msw/urlmsw.cpp + src/msw/webrequest_winhttp.cpp + wx/msw/webrequest_winhttp.h @@ -772,6 +774,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/common/sckstrm.cpp src/common/socket.cpp src/common/url.cpp + src/common/webrequest.cpp wx/fs_inet.h @@ -785,6 +788,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/sckstrm.h wx/socket.h wx/url.h + wx/webrequest.h diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake index 3111a384c2..224d06b5b2 100644 --- a/build/cmake/files.cmake +++ b/build/cmake/files.cmake @@ -666,9 +666,11 @@ set(NET_OSX_SRC set(NET_WIN32_SRC src/msw/sockmsw.cpp src/msw/urlmsw.cpp + src/msw/webrequest_winhttp.cpp ) set(NET_WIN32_HDR + wx/msw/webrequest_winhttp.h ) set(NET_CMN_SRC @@ -682,6 +684,7 @@ set(NET_CMN_SRC src/common/sckstrm.cpp src/common/socket.cpp src/common/url.cpp + src/common/webrequest.cpp ) set(NET_CMN_HDR @@ -696,6 +699,7 @@ set(NET_CMN_HDR wx/sckstrm.h wx/socket.h wx/url.h + wx/webrequest.h ) set(QA_SRC diff --git a/build/files b/build/files index d774633b94..c121f78a8f 100644 --- a/build/files +++ b/build/files @@ -682,7 +682,9 @@ NET_OSX_SRC = NET_WIN32_SRC = src/msw/sockmsw.cpp src/msw/urlmsw.cpp + src/msw/webrequest_winhttp.cpp NET_WIN32_HDR = + wx/msw/webrequest_winhttp.h NET_CMN_SRC = src/common/fs_inet.cpp @@ -695,6 +697,7 @@ NET_CMN_SRC = src/common/sckstrm.cpp src/common/socket.cpp src/common/url.cpp + src/common/webrequest.cpp NET_CMN_HDR = wx/fs_inet.h wx/protocol/file.h @@ -707,6 +710,7 @@ NET_CMN_HDR = wx/sckstrm.h wx/socket.h wx/url.h + wx/webrequest.h # wxQA (non GUI library) diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index 61a863bb2b..67f8d38576 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -493,8 +493,10 @@ MONODLL_OBJECTS = \ $(OBJS)\monodll_sckstrm.obj \ $(OBJS)\monodll_socket.obj \ $(OBJS)\monodll_url.obj \ + $(OBJS)\monodll_webrequest.obj \ $(OBJS)\monodll_sockmsw.obj \ $(OBJS)\monodll_urlmsw.obj \ + $(OBJS)\monodll_webrequest_winhttp.obj \ $(____MONOLIB_GUI_SRC_FILENAMES_OBJECTS) \ $(OBJS)\monodll_xml.obj \ $(OBJS)\monodll_xtixml.obj @@ -645,8 +647,10 @@ MONOLIB_OBJECTS = \ $(OBJS)\monolib_sckstrm.obj \ $(OBJS)\monolib_socket.obj \ $(OBJS)\monolib_url.obj \ + $(OBJS)\monolib_webrequest.obj \ $(OBJS)\monolib_sockmsw.obj \ $(OBJS)\monolib_urlmsw.obj \ + $(OBJS)\monolib_webrequest_winhttp.obj \ $(____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS) \ $(OBJS)\monolib_xml.obj \ $(OBJS)\monolib_xtixml.obj @@ -937,8 +941,10 @@ NETDLL_OBJECTS = \ $(OBJS)\netdll_sckstrm.obj \ $(OBJS)\netdll_socket.obj \ $(OBJS)\netdll_url.obj \ + $(OBJS)\netdll_webrequest.obj \ $(OBJS)\netdll_sockmsw.obj \ - $(OBJS)\netdll_urlmsw.obj + $(OBJS)\netdll_urlmsw.obj \ + $(OBJS)\netdll_webrequest_winhttp.obj NETLIB_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ $(__OPTIMIZEFLAG) $(__THREADSFLAG) -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ @@ -959,8 +965,10 @@ NETLIB_OBJECTS = \ $(OBJS)\netlib_sckstrm.obj \ $(OBJS)\netlib_socket.obj \ $(OBJS)\netlib_url.obj \ + $(OBJS)\netlib_webrequest.obj \ $(OBJS)\netlib_sockmsw.obj \ - $(OBJS)\netlib_urlmsw.obj + $(OBJS)\netlib_urlmsw.obj \ + $(OBJS)\netlib_webrequest_winhttp.obj COREDLL_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ $(__OPTIMIZEFLAG) $(__THREADSFLAG) -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ @@ -6774,12 +6782,18 @@ $(OBJS)\monodll_socket.obj: ..\..\src\common\socket.cpp $(OBJS)\monodll_url.obj: ..\..\src\common\url.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\url.cpp +$(OBJS)\monodll_webrequest.obj: ..\..\src\common\webrequest.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\webrequest.cpp + $(OBJS)\monodll_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\sockmsw.cpp $(OBJS)\monodll_urlmsw.obj: ..\..\src\msw\urlmsw.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\urlmsw.cpp +$(OBJS)\monodll_webrequest_winhttp.obj: ..\..\src\msw\webrequest_winhttp.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\webrequest_winhttp.cpp + $(OBJS)\monodll_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\statusbr.cpp @@ -9315,12 +9329,18 @@ $(OBJS)\monolib_socket.obj: ..\..\src\common\socket.cpp $(OBJS)\monolib_url.obj: ..\..\src\common\url.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\url.cpp +$(OBJS)\monolib_webrequest.obj: ..\..\src\common\webrequest.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\webrequest.cpp + $(OBJS)\monolib_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\sockmsw.cpp $(OBJS)\monolib_urlmsw.obj: ..\..\src\msw\urlmsw.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\urlmsw.cpp +$(OBJS)\monolib_webrequest_winhttp.obj: ..\..\src\msw\webrequest_winhttp.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\webrequest_winhttp.cpp + $(OBJS)\monolib_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\statusbr.cpp @@ -12207,12 +12227,18 @@ $(OBJS)\netdll_socket.obj: ..\..\src\common\socket.cpp $(OBJS)\netdll_url.obj: ..\..\src\common\url.cpp $(CXX) -q -c -P -o$@ $(NETDLL_CXXFLAGS) ..\..\src\common\url.cpp +$(OBJS)\netdll_webrequest.obj: ..\..\src\common\webrequest.cpp + $(CXX) -q -c -P -o$@ $(NETDLL_CXXFLAGS) ..\..\src\common\webrequest.cpp + $(OBJS)\netdll_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) -q -c -P -o$@ $(NETDLL_CXXFLAGS) ..\..\src\msw\sockmsw.cpp $(OBJS)\netdll_urlmsw.obj: ..\..\src\msw\urlmsw.cpp $(CXX) -q -c -P -o$@ $(NETDLL_CXXFLAGS) ..\..\src\msw\urlmsw.cpp +$(OBJS)\netdll_webrequest_winhttp.obj: ..\..\src\msw\webrequest_winhttp.cpp + $(CXX) -q -c -P -o$@ $(NETDLL_CXXFLAGS) ..\..\src\msw\webrequest_winhttp.cpp + $(OBJS)\netlib_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) -q -c -P -o$@ $(NETLIB_CXXFLAGS) -H ..\..\src\common\dummy.cpp @@ -12246,12 +12272,18 @@ $(OBJS)\netlib_socket.obj: ..\..\src\common\socket.cpp $(OBJS)\netlib_url.obj: ..\..\src\common\url.cpp $(CXX) -q -c -P -o$@ $(NETLIB_CXXFLAGS) ..\..\src\common\url.cpp +$(OBJS)\netlib_webrequest.obj: ..\..\src\common\webrequest.cpp + $(CXX) -q -c -P -o$@ $(NETLIB_CXXFLAGS) ..\..\src\common\webrequest.cpp + $(OBJS)\netlib_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) -q -c -P -o$@ $(NETLIB_CXXFLAGS) ..\..\src\msw\sockmsw.cpp $(OBJS)\netlib_urlmsw.obj: ..\..\src\msw\urlmsw.cpp $(CXX) -q -c -P -o$@ $(NETLIB_CXXFLAGS) ..\..\src\msw\urlmsw.cpp +$(OBJS)\netlib_webrequest_winhttp.obj: ..\..\src\msw\webrequest_winhttp.cpp + $(CXX) -q -c -P -o$@ $(NETLIB_CXXFLAGS) ..\..\src\msw\webrequest_winhttp.cpp + $(OBJS)\coredll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) -H ..\..\src\common\dummy.cpp diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index 792e88f599..0fbe1ef059 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -481,8 +481,10 @@ MONODLL_OBJECTS = \ $(OBJS)\monodll_sckstrm.o \ $(OBJS)\monodll_socket.o \ $(OBJS)\monodll_url.o \ + $(OBJS)\monodll_webrequest.o \ $(OBJS)\monodll_sockmsw.o \ $(OBJS)\monodll_urlmsw.o \ + $(OBJS)\monodll_webrequest_winhttp.o \ $(____MONOLIB_GUI_SRC_FILENAMES_OBJECTS) \ $(OBJS)\monodll_xml.o \ $(OBJS)\monodll_xtixml.o \ @@ -634,8 +636,10 @@ MONOLIB_OBJECTS = \ $(OBJS)\monolib_sckstrm.o \ $(OBJS)\monolib_socket.o \ $(OBJS)\monolib_url.o \ + $(OBJS)\monolib_webrequest.o \ $(OBJS)\monolib_sockmsw.o \ $(OBJS)\monolib_urlmsw.o \ + $(OBJS)\monolib_webrequest_winhttp.o \ $(____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS) \ $(OBJS)\monolib_xml.o \ $(OBJS)\monolib_xtixml.o @@ -928,8 +932,10 @@ NETDLL_OBJECTS = \ $(OBJS)\netdll_sckstrm.o \ $(OBJS)\netdll_socket.o \ $(OBJS)\netdll_url.o \ + $(OBJS)\netdll_webrequest.o \ $(OBJS)\netdll_sockmsw.o \ - $(OBJS)\netdll_urlmsw.o + $(OBJS)\netdll_urlmsw.o \ + $(OBJS)\netdll_webrequest_winhttp.o NETLIB_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) $(GCCFLAGS) \ -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ @@ -950,8 +956,10 @@ NETLIB_OBJECTS = \ $(OBJS)\netlib_sckstrm.o \ $(OBJS)\netlib_socket.o \ $(OBJS)\netlib_url.o \ + $(OBJS)\netlib_webrequest.o \ $(OBJS)\netlib_sockmsw.o \ - $(OBJS)\netlib_urlmsw.o + $(OBJS)\netlib_urlmsw.o \ + $(OBJS)\netlib_webrequest_winhttp.o COREDLL_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \ $(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ @@ -6956,12 +6964,18 @@ $(OBJS)\monodll_socket.o: ../../src/common/socket.cpp $(OBJS)\monodll_url.o: ../../src/common/url.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monodll_webrequest.o: ../../src/common/webrequest.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monodll_sockmsw.o: ../../src/msw/sockmsw.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< $(OBJS)\monodll_urlmsw.o: ../../src/msw/urlmsw.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monodll_webrequest_winhttp.o: ../../src/msw/webrequest_winhttp.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monodll_generic_statusbr.o: ../../src/generic/statusbr.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< @@ -9497,12 +9511,18 @@ $(OBJS)\monolib_socket.o: ../../src/common/socket.cpp $(OBJS)\monolib_url.o: ../../src/common/url.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monolib_webrequest.o: ../../src/common/webrequest.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monolib_sockmsw.o: ../../src/msw/sockmsw.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< $(OBJS)\monolib_urlmsw.o: ../../src/msw/urlmsw.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monolib_webrequest_winhttp.o: ../../src/msw/webrequest_winhttp.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monolib_generic_statusbr.o: ../../src/generic/statusbr.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< @@ -12389,12 +12409,18 @@ $(OBJS)\netdll_socket.o: ../../src/common/socket.cpp $(OBJS)\netdll_url.o: ../../src/common/url.cpp $(CXX) -c -o $@ $(NETDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\netdll_webrequest.o: ../../src/common/webrequest.cpp + $(CXX) -c -o $@ $(NETDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\netdll_sockmsw.o: ../../src/msw/sockmsw.cpp $(CXX) -c -o $@ $(NETDLL_CXXFLAGS) $(CPPDEPS) $< $(OBJS)\netdll_urlmsw.o: ../../src/msw/urlmsw.cpp $(CXX) -c -o $@ $(NETDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\netdll_webrequest_winhttp.o: ../../src/msw/webrequest_winhttp.cpp + $(CXX) -c -o $@ $(NETDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\netlib_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(NETLIB_CXXFLAGS) $(CPPDEPS) $< @@ -12428,12 +12454,18 @@ $(OBJS)\netlib_socket.o: ../../src/common/socket.cpp $(OBJS)\netlib_url.o: ../../src/common/url.cpp $(CXX) -c -o $@ $(NETLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\netlib_webrequest.o: ../../src/common/webrequest.cpp + $(CXX) -c -o $@ $(NETLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\netlib_sockmsw.o: ../../src/msw/sockmsw.cpp $(CXX) -c -o $@ $(NETLIB_CXXFLAGS) $(CPPDEPS) $< $(OBJS)\netlib_urlmsw.o: ../../src/msw/urlmsw.cpp $(CXX) -c -o $@ $(NETLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\netlib_webrequest_winhttp.o: ../../src/msw/webrequest_winhttp.cpp + $(CXX) -c -o $@ $(NETLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\coredll_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index 6b918dd50d..0541f24c52 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -513,8 +513,10 @@ MONODLL_OBJECTS = \ $(OBJS)\monodll_sckstrm.obj \ $(OBJS)\monodll_socket.obj \ $(OBJS)\monodll_url.obj \ + $(OBJS)\monodll_webrequest.obj \ $(OBJS)\monodll_sockmsw.obj \ $(OBJS)\monodll_urlmsw.obj \ + $(OBJS)\monodll_webrequest_winhttp.obj \ $(____MONOLIB_GUI_SRC_FILENAMES_OBJECTS) \ $(OBJS)\monodll_xml.obj \ $(OBJS)\monodll_xtixml.obj @@ -675,8 +677,10 @@ MONOLIB_OBJECTS = \ $(OBJS)\monolib_sckstrm.obj \ $(OBJS)\monolib_socket.obj \ $(OBJS)\monolib_url.obj \ + $(OBJS)\monolib_webrequest.obj \ $(OBJS)\monolib_sockmsw.obj \ $(OBJS)\monolib_urlmsw.obj \ + $(OBJS)\monolib_webrequest_winhttp.obj \ $(____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS) \ $(OBJS)\monolib_xml.obj \ $(OBJS)\monolib_xtixml.obj @@ -989,8 +993,10 @@ NETDLL_OBJECTS = \ $(OBJS)\netdll_sckstrm.obj \ $(OBJS)\netdll_socket.obj \ $(OBJS)\netdll_url.obj \ + $(OBJS)\netdll_webrequest.obj \ $(OBJS)\netdll_sockmsw.obj \ - $(OBJS)\netdll_urlmsw.obj + $(OBJS)\netdll_urlmsw.obj \ + $(OBJS)\netdll_webrequest_winhttp.obj NETDLL_RESOURCES = \ $(OBJS)\netdll_version.res NETLIB_CXXFLAGS = /M$(__RUNTIME_LIBS_193)$(__DEBUGRUNTIME) /DWIN32 \ @@ -1017,8 +1023,10 @@ NETLIB_OBJECTS = \ $(OBJS)\netlib_sckstrm.obj \ $(OBJS)\netlib_socket.obj \ $(OBJS)\netlib_url.obj \ + $(OBJS)\netlib_webrequest.obj \ $(OBJS)\netlib_sockmsw.obj \ - $(OBJS)\netlib_urlmsw.obj + $(OBJS)\netlib_urlmsw.obj \ + $(OBJS)\netlib_webrequest_winhttp.obj COREDLL_CXXFLAGS = /M$(__RUNTIME_LIBS_209)$(__DEBUGRUNTIME) /DWIN32 \ $(__DEBUGINFO) \ /Fd$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core$(WXCOMPILER)$(VENDORTAG).pdb \ @@ -7483,12 +7491,18 @@ $(OBJS)\monodll_socket.obj: ..\..\src\common\socket.cpp $(OBJS)\monodll_url.obj: ..\..\src\common\url.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\url.cpp +$(OBJS)\monodll_webrequest.obj: ..\..\src\common\webrequest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\webrequest.cpp + $(OBJS)\monodll_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\sockmsw.cpp $(OBJS)\monodll_urlmsw.obj: ..\..\src\msw\urlmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\urlmsw.cpp +$(OBJS)\monodll_webrequest_winhttp.obj: ..\..\src\msw\webrequest_winhttp.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\webrequest_winhttp.cpp + $(OBJS)\monodll_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\statusbr.cpp @@ -10024,12 +10038,18 @@ $(OBJS)\monolib_socket.obj: ..\..\src\common\socket.cpp $(OBJS)\monolib_url.obj: ..\..\src\common\url.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\url.cpp +$(OBJS)\monolib_webrequest.obj: ..\..\src\common\webrequest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\webrequest.cpp + $(OBJS)\monolib_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\sockmsw.cpp $(OBJS)\monolib_urlmsw.obj: ..\..\src\msw\urlmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\urlmsw.cpp +$(OBJS)\monolib_webrequest_winhttp.obj: ..\..\src\msw\webrequest_winhttp.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\webrequest_winhttp.cpp + $(OBJS)\monolib_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\statusbr.cpp @@ -12916,12 +12936,18 @@ $(OBJS)\netdll_socket.obj: ..\..\src\common\socket.cpp $(OBJS)\netdll_url.obj: ..\..\src\common\url.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETDLL_CXXFLAGS) ..\..\src\common\url.cpp +$(OBJS)\netdll_webrequest.obj: ..\..\src\common\webrequest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(NETDLL_CXXFLAGS) ..\..\src\common\webrequest.cpp + $(OBJS)\netdll_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETDLL_CXXFLAGS) ..\..\src\msw\sockmsw.cpp $(OBJS)\netdll_urlmsw.obj: ..\..\src\msw\urlmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETDLL_CXXFLAGS) ..\..\src\msw\urlmsw.cpp +$(OBJS)\netdll_webrequest_winhttp.obj: ..\..\src\msw\webrequest_winhttp.cpp + $(CXX) /c /nologo /TP /Fo$@ $(NETDLL_CXXFLAGS) ..\..\src\msw\webrequest_winhttp.cpp + $(OBJS)\netlib_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETLIB_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp @@ -12955,12 +12981,18 @@ $(OBJS)\netlib_socket.obj: ..\..\src\common\socket.cpp $(OBJS)\netlib_url.obj: ..\..\src\common\url.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETLIB_CXXFLAGS) ..\..\src\common\url.cpp +$(OBJS)\netlib_webrequest.obj: ..\..\src\common\webrequest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(NETLIB_CXXFLAGS) ..\..\src\common\webrequest.cpp + $(OBJS)\netlib_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETLIB_CXXFLAGS) ..\..\src\msw\sockmsw.cpp $(OBJS)\netlib_urlmsw.obj: ..\..\src\msw\urlmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETLIB_CXXFLAGS) ..\..\src\msw\urlmsw.cpp +$(OBJS)\netlib_webrequest_winhttp.obj: ..\..\src\msw\webrequest_winhttp.cpp + $(CXX) /c /nologo /TP /Fo$@ $(NETLIB_CXXFLAGS) ..\..\src\msw\webrequest_winhttp.cpp + $(OBJS)\coredll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp diff --git a/build/msw/wx_net.vcxproj b/build/msw/wx_net.vcxproj index 2486938c55..5b18ceda45 100644 --- a/build/msw/wx_net.vcxproj +++ b/build/msw/wx_net.vcxproj @@ -468,6 +468,8 @@ + + @@ -509,6 +511,8 @@ + + diff --git a/build/msw/wx_net.vcxproj.filters b/build/msw/wx_net.vcxproj.filters index 00da630e3e..50bfaa3932 100644 --- a/build/msw/wx_net.vcxproj.filters +++ b/build/msw/wx_net.vcxproj.filters @@ -51,12 +51,18 @@ Common Sources + + Common Sources + MSW Sources MSW Sources + + MSW Sources + @@ -64,10 +70,13 @@ - + Common Headers - + + MSW Headers + + Common Headers @@ -97,6 +106,9 @@ Common Headers + + Common Headers + diff --git a/build/msw/wx_vc7_net.vcproj b/build/msw/wx_vc7_net.vcproj index bf77547cc5..8acd78d68f 100644 --- a/build/msw/wx_vc7_net.vcproj +++ b/build/msw/wx_vc7_net.vcproj @@ -333,6 +333,9 @@ + + + + + + + + diff --git a/build/msw/wx_vc8_net.vcproj b/build/msw/wx_vc8_net.vcproj index 1ceb1e9bf1..dc42378627 100644 --- a/build/msw/wx_vc8_net.vcproj +++ b/build/msw/wx_vc8_net.vcproj @@ -849,6 +849,10 @@ RelativePath="..\..\src\common\url.cpp" > + + + + + + + + diff --git a/build/msw/wx_vc9_net.vcproj b/build/msw/wx_vc9_net.vcproj index a9a35efbd9..be81ca3701 100644 --- a/build/msw/wx_vc9_net.vcproj +++ b/build/msw/wx_vc9_net.vcproj @@ -845,6 +845,10 @@ RelativePath="..\..\src\common\url.cpp" > + + + + + + + + diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h new file mode 100644 index 0000000000..87f327eb32 --- /dev/null +++ b/include/wx/msw/webrequest_winhttp.h @@ -0,0 +1,33 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/msw/webrequest_winhttp.h +// Purpose: wxWebRequest WinHTTP implementation +// Author: Tobias Taschner +// Created: 2018-10-17 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_MSW_WEBREQUEST_WINHTTP_H +#define _WX_MSW_WEBREQUEST_WINHTTP_H + +class WXDLLIMPEXP_NET wxWebSessionWinHTTP: public wxWebSession +{ +public: + wxWebSessionWinHTTP() { } + + wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + + void SetHeader(const wxString& name, const wxString& value) wxOVERRIDE; + +private: + +}; + +class WXDLLIMPEXP_NET wxWebSessionFactoryWinHTTP: public wxWebSessionFactory +{ +public: + wxWebSession* Create() wxOVERRIDE + { return new wxWebSessionWinHTTP(); } +}; + +#endif // _WX_MSW_WEBREQUEST_WINHTTP_H diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h new file mode 100644 index 0000000000..d505fbbf9e --- /dev/null +++ b/include/wx/webrequest.h @@ -0,0 +1,135 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/webrequest.h +// Purpose: wxWebRequest base classes +// Author: Tobias Taschner +// Created: 2018-10-17 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_WEBREQUEST_H +#define _WX_WEBREQUEST_H + +#include "wx/defs.h" + +#if wxUSE_WEBREQUEST + +#include "wx/event.h" +#include "wx/object.h" +#include "wx/scopedptr.h" +#include "wx/sharedptr.h" +#include "wx/vector.h" + +class wxWebResponse; +class wxWebSession; + +class WXDLLIMPEXP_NET wxWebRequest : public wxEvtHandler, public wxRefCounter +{ +public: + virtual void SetHeader(const wxString& name, const wxString& value) = 0; + + virtual void SetMethod(const wxString& method) = 0; + + virtual void SetData(const wxString& text, const wxString& contentType) = 0; + + virtual void SetData(const wxInputStream& dataStream, const wxString& contentType) = 0; + + virtual void SetIgnoreServerErrorStatus(bool ignore) = 0; + + virtual void Start() = 0; + + virtual void Cancel() = 0; + + virtual const wxWebResponse* GetResponse() const = 0; + +private: + wxDECLARE_NO_COPY_CLASS(wxWebRequest); +}; + +class WXDLLIMPEXP_NET wxWebResponse +{ +public: + virtual wxString GetURL() const = 0; + + virtual wxString GetHeader(const wxString& name) const = 0; + + virtual int GetStatus() const = 0; + + virtual wxString GetStatusText() const = 0; + + virtual wxInputStream& GetStream() const = 0; + + virtual wxString AsString(wxMBConv* conv = NULL) const = 0; + +private: + wxDECLARE_NO_COPY_CLASS(wxWebResponse); +}; + +class WXDLLIMPEXP_NET wxWebSessionFactory +{ +public: + virtual wxWebSession* Create() = 0; +}; + +WX_DECLARE_STRING_HASH_MAP(wxSharedPtr, wxStringWebSessionFactoryMap); + +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[]; +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[]; +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendURLSession[]; +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[]; + +class WXDLLIMPEXP_NET wxWebSession +{ +public: + virtual ~wxWebSession() { } + + virtual wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) = 0; + + virtual void SetHeader(const wxString& name, const wxString& value) = 0; + + static wxWebSession& GetDefault(); + + static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); + + static void RegisterFactory(const wxString& backend, wxSharedPtr factory); + + static bool IsBackendAvailable(const wxString& backend); + +protected: + wxWebSession() { } + +private: + + static wxScopedPtr ms_defaultSession; + static wxStringWebSessionFactoryMap ms_factoryMap; + + static void InitFactoryMap(); +}; + +class WXDLLIMPEXP_NET wxWebRequestEvent : public wxEvent +{ +public: + wxWebRequestEvent() {} + wxWebRequestEvent(wxEventType type, int id, wxWebResponse* response = NULL, + const wxString& errorDesc = "") + : wxEvent(id, type), + m_response(response), m_errorDescription(errorDesc) + { } + + wxWebResponse* GetResponse() const { return m_response; } + + const wxString& GetErrorDescription() const { return m_errorDescription; } + +private: + wxWebResponse* m_response; + wxString m_errorDescription; +}; + +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_READY, wxWebRequestEvent); +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_FAILED, wxWebRequestEvent); +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_AUTH_REQUIRED, wxWebRequestEvent); + + +#endif // wxUSE_WEBREQUEST + +#endif // _WX_WEBREQUEST_H diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 3ba28f7290..0aaeb92d3a 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -327,6 +327,14 @@ public: @param factory A shared pointer to the factory which creates the appropriate backend. */ static void RegisterFactory(const wxString& backend, wxSharedPtr factory); + + /** + Allows to check if the specified backend is available at runtime. + + Usually the default backend should always be available, but e.g. macOS + before 10.9 does not have the @c NSURLSession implementation available. + */ + static bool IsBackendAvailable(const wxString& backend); }; /** diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index cbdcc30a00..f7b6407df3 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -18,8 +18,9 @@ #include "wx/wx.h" #endif -#include -#include +#include "wx/notebook.h" +#include "wx/artprov.h" +#include "wx/webrequest.h" #ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" @@ -116,6 +117,29 @@ public: void OnGetLoadButton(wxCommandEvent& WXUNUSED(evt)) { GetStatusBar()->SetStatusText("Requesting image..."); + + // Create request for the specified URL from the default session + wxObjectDataPtr request(wxWebSession::GetDefault().CreateRequest( + m_getURLTextCtrl->GetValue())); + + // Bind events for failure and success + request->Bind(wxEVT_WEBREQUEST_READY, &WebRequestFrame::OnGetWebRequestReady, this); + request->Bind(wxEVT_WEBREQUEST_FAILED, &WebRequestFrame::OnWebRequestFailed, this); + + // Start the request (events will be called on success or failure) + request->Start(); + } + + void OnGetWebRequestReady(wxWebRequestEvent& evt) + { + wxImage img(evt.GetResponse()->GetStream()); + m_getStaticBitmap->SetBitmap(img); + } + + void OnWebRequestFailed(wxWebRequestEvent& evt) + { + wxLogError("Web Request failed: %s", evt.GetErrorDescription()); + GetStatusBar()->SetStatusText(""); } void OnPostSendButton(wxCommandEvent& WXUNUSED(evt)) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp new file mode 100644 index 0000000000..ce7fe4c130 --- /dev/null +++ b/src/common/webrequest.cpp @@ -0,0 +1,89 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/common/webrequest.cpp +// Purpose: wxWebRequest base class implementations +// Author: Tobias Taschner +// Created: 2018-10-17 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#if defined(__BORLANDC__) +#pragma hdrstop +#endif + +#if wxUSE_WEBREQUEST + +#include "wx/webrequest.h" + +#if defined(__WINDOWS__) +#include "wx/msw/webrequest_winhttp.h" +#endif + +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[] = "wxWebSessionBackendWinHTTP"; +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendURLSession[] = "wxWebSessionBackendURLSession"; +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[] = "wxWebSessionBackendCURL"; + +#if defined(__WINDOWS__) +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[] = "wxWebSessionBackendWinHTTP"; +#endif + +wxDEFINE_EVENT(wxEVT_WEBREQUEST_READY, wxWebRequestEvent); +wxDEFINE_EVENT(wxEVT_WEBREQUEST_FAILED, wxWebRequestEvent); +wxDEFINE_EVENT(wxEVT_WEBREQUEST_AUTH_REQUIRED, wxWebRequestEvent); + +wxScopedPtr wxWebSession::ms_defaultSession; +wxStringWebSessionFactoryMap wxWebSession::ms_factoryMap; + +// static +wxWebSession& wxWebSession::GetDefault() +{ + if (ms_defaultSession == NULL) + ms_defaultSession.reset(wxWebSession::New()); + + return *ms_defaultSession; +} + +// static +wxWebSession* wxWebSession::New(const wxString& backend) +{ + if (ms_factoryMap.empty()) + InitFactoryMap(); + + wxStringWebSessionFactoryMap::iterator factory = ms_factoryMap.find(backend); + if (factory != ms_factoryMap.end()) + return factory->second->Create(); + else + return NULL; +} + +// static +void wxWebSession::RegisterFactory(const wxString& backend, wxSharedPtr factory) +{ + ms_factoryMap[backend] = factory; +} + +// static +void wxWebSession::InitFactoryMap() +{ +#if defined(__WINDOWS__) + RegisterFactory(wxWebSessionBackendWinHTTP, + wxSharedPtr(new wxWebSessionFactoryWinHTTP())); +#endif +} + +// static +bool wxWebSession::IsBackendAvailable(const wxString& backend) +{ + if (ms_factoryMap.empty()) + InitFactoryMap(); + + wxStringWebSessionFactoryMap::iterator factory = ms_factoryMap.find(backend); + return factory != ms_factoryMap.end(); +} + + + +#endif // wxUSE_WEBREQUEST diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp new file mode 100644 index 0000000000..2d81617fa2 --- /dev/null +++ b/src/msw/webrequest_winhttp.cpp @@ -0,0 +1,33 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/msw/webrequest_winhttp.h +// Purpose: wxWebRequest WinHTTP implementation +// Author: Tobias Taschner +// Created: 2018-10-17 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#if defined(__BORLANDC__) +#pragma hdrstop +#endif + +#include "wx/webrequest.h" + +#if wxUSE_WEBREQUEST + +#include "wx/msw/webrequest_winhttp.h" + +wxWebRequest* wxWebSessionWinHTTP::CreateRequest(const wxString& url, int id) +{ + return NULL; +} + +void wxWebSessionWinHTTP::SetHeader(const wxString& name, const wxString& value) +{ + +} + +#endif // wxUSE_WEBREQUEST From a4279752f87ede82b203457916b0130820cb2461 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Sat, 20 Oct 2018 19:21:35 +0200 Subject: [PATCH 010/218] Start wxWebRequestWinHTTP implementation Can already run the GET request in the sample app --- build/cmake/lib/net/CMakeLists.txt | 4 + configure | 3 + configure.in | 3 + include/wx/msw/webrequest_winhttp.h | 89 +++++- include/wx/webrequest.h | 66 ++++- interface/wx/webrequest.h | 9 +- samples/webrequest/webrequest.cpp | 13 +- src/common/webrequest.cpp | 88 +++++- src/msw/webrequest_winhttp.cpp | 427 +++++++++++++++++++++++++++- 9 files changed, 676 insertions(+), 26 deletions(-) diff --git a/build/cmake/lib/net/CMakeLists.txt b/build/cmake/lib/net/CMakeLists.txt index 3d38412803..fa0af82227 100644 --- a/build/cmake/lib/net/CMakeLists.txt +++ b/build/cmake/lib/net/CMakeLists.txt @@ -25,6 +25,10 @@ wx_add_library(net IS_BASE ${NET_FILES}) if(WIN32) wx_lib_link_libraries(net PRIVATE ws2_32) + + if(wxUSE_WEBREQUEST) + wx_lib_link_libraries(net PRIVATE Winhttp) + endif() endif() wx_finalize_lib(net) diff --git a/configure b/configure index 5fcda9185d..dffae7b78c 100755 --- a/configure +++ b/configure @@ -23773,6 +23773,9 @@ fi if test "$wxUSE_ACCESSIBILITY" = "yes" ; then LIBS="$LIBS -loleacc" fi + if test "$wxUSE_WEBREQUEST" = "yes" ; then + LIBS="$LIBS -lwinhttp" + fi case "${host}" in *-*-cygwin* ) diff --git a/configure.in b/configure.in index 40fb6ab0e0..3ca104240e 100644 --- a/configure.in +++ b/configure.in @@ -2766,6 +2766,9 @@ if test "$USE_WIN32" = 1 ; then if test "$wxUSE_ACCESSIBILITY" = "yes" ; then LIBS="$LIBS -loleacc" fi + if test "$wxUSE_WEBREQUEST" = "yes" ; then + LIBS="$LIBS -lwinhttp" + fi case "${host}" in *-*-cygwin* ) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index 87f327eb32..493c984bf6 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -10,17 +10,102 @@ #ifndef _WX_MSW_WEBREQUEST_WINHTTP_H #define _WX_MSW_WEBREQUEST_WINHTTP_H +#include "wx/msw/wrapwin.h" +#include +#include "wx/buffer.h" + +class wxWebSessionWinHTTP; +class wxWebRequestWinHTTP; + +class WXDLLIMPEXP_NET wxWebResponseWinHTTP : public wxWebResponse +{ +public: + wxWebResponseWinHTTP(wxWebRequestWinHTTP& request); + + wxInt64 GetContentLength() const wxOVERRIDE { return m_contentLength; } + + wxString GetURL() const wxOVERRIDE; + + wxString GetHeader(const wxString& name) const wxOVERRIDE; + + int GetStatus() const wxOVERRIDE; + + wxString GetStatusText() const wxOVERRIDE; + + wxInputStream* GetStream() const wxOVERRIDE; + + wxString AsString(wxMBConv* conv = NULL) const wxOVERRIDE; + + bool ReadData(); + + bool ReportAvailableData(DWORD dataLen); + + void ReportDataComplete(); + +private: + wxWebRequestWinHTTP& m_request; + wxInt64 m_contentLength; + long m_readSize; + wxMemoryBuffer m_readBuffer; + wxScopedPtr m_stream; + + wxDECLARE_NO_COPY_CLASS(wxWebResponseWinHTTP); +}; + +class WXDLLIMPEXP_NET wxWebRequestWinHTTP : public wxWebRequest +{ +public: + wxWebRequestWinHTTP(int id, wxWebSessionWinHTTP& session, const wxString& url); + + ~wxWebRequestWinHTTP(); + + void SetMethod(const wxString& method) wxOVERRIDE; + + void SetData(const wxString& text, const wxString& contentType) wxOVERRIDE; + + void SetData(const wxInputStream& dataStream, const wxString& contentType) wxOVERRIDE; + + void Start() wxOVERRIDE; + + void Cancel() wxOVERRIDE; + + wxWebResponse* GetResponse() wxOVERRIDE; + + void HandleCallback(DWORD dwInternetStatus, LPVOID lpvStatusInformation, + DWORD dwStatusInformationLength); + + HINTERNET GetHandle() const { return m_request; } + +private: + wxWebSessionWinHTTP& m_session; + wxString m_url; + HINTERNET m_connect; + HINTERNET m_request; + wxScopedPtr m_response; + + void SetFailedWithLastError(); + + wxDECLARE_NO_COPY_CLASS(wxWebRequestWinHTTP); +}; + class WXDLLIMPEXP_NET wxWebSessionWinHTTP: public wxWebSession { public: - wxWebSessionWinHTTP() { } + wxWebSessionWinHTTP(); + + ~wxWebSessionWinHTTP(); wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; - void SetHeader(const wxString& name, const wxString& value) wxOVERRIDE; + HINTERNET GetHandle() const { return m_handle; } private: + bool m_initialized; + HINTERNET m_handle; + void Init(); + + wxDECLARE_NO_COPY_CLASS(wxWebSessionWinHTTP); }; class WXDLLIMPEXP_NET wxWebSessionFactoryWinHTTP: public wxWebSessionFactory diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index d505fbbf9e..c72c1a21f9 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -18,15 +18,29 @@ #include "wx/object.h" #include "wx/scopedptr.h" #include "wx/sharedptr.h" +#include "wx/stream.h" #include "wx/vector.h" class wxWebResponse; class wxWebSession; +WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); + class WXDLLIMPEXP_NET wxWebRequest : public wxEvtHandler, public wxRefCounter { public: - virtual void SetHeader(const wxString& name, const wxString& value) = 0; + enum State + { + State_Idle, + State_Active, + State_Ready, + State_Failed + }; + + virtual ~wxWebRequest() { } + + virtual void SetHeader(const wxString& name, const wxString& value) + { m_headers[name] = value; } virtual void SetMethod(const wxString& method) = 0; @@ -34,21 +48,50 @@ public: virtual void SetData(const wxInputStream& dataStream, const wxString& contentType) = 0; - virtual void SetIgnoreServerErrorStatus(bool ignore) = 0; + void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } virtual void Start() = 0; virtual void Cancel() = 0; - virtual const wxWebResponse* GetResponse() const = 0; + virtual wxWebResponse* GetResponse() = 0; + + int GetId() const { return m_id; } + + State GetState() const { return m_state; } + +protected: + wxWebRequestHeaderMap m_headers; + + wxWebRequest(int id): + m_id(id), + m_state(State_Idle), + m_ignoreServerErrorStatus(false) { } + + void SetState(State state, const wxString& failMsg = ""); + + bool CheckServerStatus(); private: + int m_id; + State m_state; + wxString m_failMessage; + bool m_ignoreServerErrorStatus; + + void ProcessReadyEvent(); + + void ProcessFailedEvent(); + wxDECLARE_NO_COPY_CLASS(wxWebRequest); }; class WXDLLIMPEXP_NET wxWebResponse { public: + virtual ~wxWebResponse() { } + + virtual wxInt64 GetContentLength() const = 0; + virtual wxString GetURL() const = 0; virtual wxString GetHeader(const wxString& name) const = 0; @@ -57,10 +100,13 @@ public: virtual wxString GetStatusText() const = 0; - virtual wxInputStream& GetStream() const = 0; + virtual wxInputStream* GetStream() const = 0; virtual wxString AsString(wxMBConv* conv = NULL) const = 0; +protected: + wxWebResponse() { } + private: wxDECLARE_NO_COPY_CLASS(wxWebResponse); }; @@ -69,6 +115,8 @@ class WXDLLIMPEXP_NET wxWebSessionFactory { public: virtual wxWebSession* Create() = 0; + + virtual ~wxWebSessionFactory() { } }; WX_DECLARE_STRING_HASH_MAP(wxSharedPtr, wxStringWebSessionFactoryMap); @@ -85,7 +133,10 @@ public: virtual wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) = 0; - virtual void SetHeader(const wxString& name, const wxString& value) = 0; + virtual void SetHeader(const wxString& name, const wxString& value) + { m_headers[name] = value; } + + const wxWebRequestHeaderMap& GetHeaders() const { return m_headers; } static wxWebSession& GetDefault(); @@ -96,9 +147,10 @@ public: static bool IsBackendAvailable(const wxString& backend); protected: - wxWebSession() { } + wxWebSession(); private: + wxWebRequestHeaderMap m_headers; static wxScopedPtr ms_defaultSession; static wxStringWebSessionFactoryMap ms_factoryMap; @@ -120,6 +172,8 @@ public: const wxString& GetErrorDescription() const { return m_errorDescription; } + wxEvent* Clone() const wxOVERRIDE { return new wxWebRequestEvent(*this); } + private: wxWebResponse* m_response; wxString m_errorDescription; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 0aaeb92d3a..8428636c22 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -31,7 +31,7 @@ // Bind events request->Bind(wxEVT_WEBREQUEST_READY, [](wxWebRequestEvent& evt) { - wxImage logoImage(evt->GetResponse()->GetStream()); + wxImage logoImage(*evt->GetResponse()->GetStream()); if (logoImage.IsOK()) wxLogInfo("Image loaded"); }); @@ -192,6 +192,11 @@ public: @c NULL. */ const wxWebResponse* GetResponse() const; + + /** + Returns the id specified while creating this request. + */ + int GetId() const; }; /** @@ -235,7 +240,7 @@ public: /** Returns a stream which represents the response data sent by the server. */ - wxInputStream& GetStream() const; + wxInputStream* GetStream() const; /** Returns all response data as a string. diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index f7b6407df3..f2e11617d4 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -55,12 +55,12 @@ public: getLoadButton->Bind(wxEVT_BUTTON, &WebRequestFrame::OnGetLoadButton, this); getSizer->Add(getLoadButton, wxSizerFlags().Border()); - wxStaticBoxSizer* getImageBox = + m_getImageBox = new wxStaticBoxSizer(wxVERTICAL, getPanel, "Image"); - m_getStaticBitmap = new wxStaticBitmap(getImageBox->GetStaticBox(), + m_getStaticBitmap = new wxStaticBitmap(m_getImageBox->GetStaticBox(), wxID_ANY, wxArtProvider::GetBitmap(wxART_MISSING_IMAGE)); - getImageBox->Add(m_getStaticBitmap, wxSizerFlags(1).Expand()); - getSizer->Add(getImageBox, wxSizerFlags(1).Expand().Border()); + m_getImageBox->Add(m_getStaticBitmap, wxSizerFlags(1).Expand()); + getSizer->Add(m_getImageBox, wxSizerFlags(1).Expand().Border()); getPanel->SetSizer(getSizer); notebook->AddPage(getPanel, "GET Image", true); @@ -132,8 +132,10 @@ public: void OnGetWebRequestReady(wxWebRequestEvent& evt) { - wxImage img(evt.GetResponse()->GetStream()); + wxImage img(*evt.GetResponse()->GetStream()); m_getStaticBitmap->SetBitmap(img); + m_getImageBox->Layout(); + GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes image data", evt.GetResponse()->GetContentLength())); } void OnWebRequestFailed(wxWebRequestEvent& evt) @@ -149,6 +151,7 @@ public: private: wxTextCtrl* m_getURLTextCtrl; + wxStaticBoxSizer* m_getImageBox; wxStaticBitmap* m_getStaticBitmap; wxTextCtrl* m_postURLTextCtrl; diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index ce7fe4c130..10c5e701ef 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -18,6 +18,11 @@ #include "wx/webrequest.h" +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/translation.h" +#endif + #if defined(__WINDOWS__) #include "wx/msw/webrequest_winhttp.h" #endif @@ -34,13 +39,86 @@ wxDEFINE_EVENT(wxEVT_WEBREQUEST_READY, wxWebRequestEvent); wxDEFINE_EVENT(wxEVT_WEBREQUEST_FAILED, wxWebRequestEvent); wxDEFINE_EVENT(wxEVT_WEBREQUEST_AUTH_REQUIRED, wxWebRequestEvent); +// +// wxWebRequest +// +bool wxWebRequest::CheckServerStatus() +{ + const wxWebResponse* resp = GetResponse(); + if ( resp && resp->GetStatus() >= 400 && !m_ignoreServerErrorStatus ) + { + SetState(State_Failed, wxString::Format(_("Error: %s (%d)"), + resp->GetStatusText(), resp->GetStatus())); + return false; + } + else + return true; +} + +void wxWebRequest::SetState(State state, const wxString & failMsg) +{ + switch (state) + { + case State_Active: + // Add a reference while the request is active + if ( m_state != State_Active ) + { + IncRef(); + m_state = state; + } + break; + case State_Ready: + // Trigger the ready event in main thread + CallAfter(&wxWebRequest::ProcessReadyEvent); + break; + case State_Failed: + m_failMessage = failMsg; + // Trigger the failed event in main thread + CallAfter(&wxWebRequest::ProcessFailedEvent); + break; + } +} + +void wxWebRequest::ProcessReadyEvent() +{ + wxWebRequestEvent evt(wxEVT_WEBREQUEST_READY, GetId(), GetResponse()); + ProcessEvent(evt); + // Remove reference after the request is no longer active + if ( m_state == State_Active ) + DecRef(); + m_state = State_Ready; +} + +void wxWebRequest::ProcessFailedEvent() +{ + wxWebRequestEvent evt(wxEVT_WEBREQUEST_FAILED, GetId(), NULL, + m_failMessage); + ProcessEvent(evt); + // Remove reference after the request is no longer active + if ( m_state == State_Active ) + DecRef(); + m_state = State_Failed; +} + +// +// wxWebSession +// + wxScopedPtr wxWebSession::ms_defaultSession; wxStringWebSessionFactoryMap wxWebSession::ms_factoryMap; +wxWebSession::wxWebSession() +{ + // Initialize the user-Agent header with a reasonable default + SetHeader("User-Agent", wxString::Format("%s/1 wxWidgets/%d.%d.%d", + wxTheApp->GetAppName(), + wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)); +} + // static wxWebSession& wxWebSession::GetDefault() { - if (ms_defaultSession == NULL) + if ( ms_defaultSession == NULL ) ms_defaultSession.reset(wxWebSession::New()); return *ms_defaultSession; @@ -49,11 +127,11 @@ wxWebSession& wxWebSession::GetDefault() // static wxWebSession* wxWebSession::New(const wxString& backend) { - if (ms_factoryMap.empty()) + if ( ms_factoryMap.empty() ) InitFactoryMap(); wxStringWebSessionFactoryMap::iterator factory = ms_factoryMap.find(backend); - if (factory != ms_factoryMap.end()) + if ( factory != ms_factoryMap.end() ) return factory->second->Create(); else return NULL; @@ -77,13 +155,11 @@ void wxWebSession::InitFactoryMap() // static bool wxWebSession::IsBackendAvailable(const wxString& backend) { - if (ms_factoryMap.empty()) + if ( ms_factoryMap.empty() ) InitFactoryMap(); wxStringWebSessionFactoryMap::iterator factory = ms_factoryMap.find(backend); return factory != ms_factoryMap.end(); } - - #endif // wxUSE_WEBREQUEST diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 2d81617fa2..118cacde06 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -18,16 +18,433 @@ #if wxUSE_WEBREQUEST +#include "wx/mstream.h" +#include "wx/uri.h" #include "wx/msw/webrequest_winhttp.h" +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/utils.h" + #include "wx/translation.h" +#endif + +// For MSVC we can link in the required library explicitly, for the other +// compilers (e.g. MinGW) this needs to be done at makefiles level. +#ifdef __VISUALC__ +#pragma comment(lib, "Winhttp") +#endif + +// Define constants potentially missing in old SDKs +#ifndef WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY +#define WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY 4 +#endif +#ifndef WINHTTP_PROTOCOL_FLAG_HTTP2 +#define WINHTTP_PROTOCOL_FLAG_HTTP2 0x1 +#endif +#ifndef WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL +#define WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL 133 +#endif +#ifndef WINHTTP_DECOMPRESSION_FLAG_ALL +#define WINHTTP_DECOMPRESSION_FLAG_GZIP 0x00000001 +#define WINHTTP_DECOMPRESSION_FLAG_DEFLATE 0x00000002 +#define WINHTTP_DECOMPRESSION_FLAG_ALL ( \ + WINHTTP_DECOMPRESSION_FLAG_GZIP | \ + WINHTTP_DECOMPRESSION_FLAG_DEFLATE) +#endif +#ifndef WINHTTP_OPTION_DECOMPRESSION +#define WINHTTP_OPTION_DECOMPRESSION 118 +#endif +#ifndef WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 +#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 0x00000200 +#endif +#ifndef WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 +#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800 +#endif + +// Helper functions + +static wxString wxWinHTTPErrorToString(DWORD errorCode) +{ + wxString errorString; + + LPVOID msgBuf; + if ( FormatMessageW( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_FROM_HMODULE, + GetModuleHandle(TEXT("WINHTTP")), + errorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPWSTR)&msgBuf, + 0, NULL) ) + { + errorString.assign((LPWSTR)msgBuf); + LocalFree(msgBuf); + // Truncate trailing \n\r + if ( errorString.size() > 2 ) + errorString.resize(errorString.size()); + } + return errorString; +} + +static wxString wxWinHTTPQueryHeaderString(HINTERNET hRequest, DWORD dwInfoLevel, + LPCWSTR pwszName = WINHTTP_HEADER_NAME_BY_INDEX) +{ + wxString result; + DWORD bufferLen = 0; + ::WinHttpQueryHeaders(hRequest, dwInfoLevel, pwszName, NULL, &bufferLen, + WINHTTP_NO_HEADER_INDEX); + if ( ::GetLastError() == ERROR_INSUFFICIENT_BUFFER ) + { + wxWCharBuffer resBuf(bufferLen); + if ( ::WinHttpQueryHeaders(hRequest, dwInfoLevel, pwszName, + resBuf.data(), &bufferLen, WINHTTP_NO_HEADER_INDEX) ) + result.assign(resBuf); + } + + return result; +} + +static wxString wxWinHTTPQueryOptionString(HINTERNET hInternet, DWORD dwOption) +{ + wxString result; + DWORD bufferLen = 0; + ::WinHttpQueryOption(hInternet, dwOption, NULL, &bufferLen); + if ( ::GetLastError() == ERROR_INSUFFICIENT_BUFFER ) + { + wxWCharBuffer resBuf(bufferLen); + if ( ::WinHttpQueryOption(hInternet, dwOption, resBuf.data(), &bufferLen) ) + result.assign(resBuf); + } + + return result; +} + +static void CALLBACK wxRequestStatusCallback( + HINTERNET WXUNUSED(hInternet), + DWORD_PTR dwContext, + DWORD dwInternetStatus, + LPVOID lpvStatusInformation, + DWORD dwStatusInformationLength +) +{ + if ( dwContext ) + { + wxWebRequestWinHTTP* request = + reinterpret_cast(dwContext); + request->HandleCallback(dwInternetStatus, lpvStatusInformation, + dwStatusInformationLength); + } +} + +// +// wxWebRequestWinHTTP +// + +wxWebRequestWinHTTP::wxWebRequestWinHTTP(int id, wxWebSessionWinHTTP& session, const wxString& url): + wxWebRequest(id), + m_session(session), + m_url(url), + m_connect(NULL), + m_request(NULL) +{ + m_headers = session.GetHeaders(); +} + +wxWebRequestWinHTTP::~wxWebRequestWinHTTP() +{ + if ( m_request ) + ::WinHttpCloseHandle(m_request); + if ( m_connect ) + ::WinHttpCloseHandle(m_connect); +} + +void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, + LPVOID lpvStatusInformation, DWORD dwStatusInformationLength) +{ + bool handleLastError = false; + static const int readSize = 8 * 1024; + + switch ( dwInternetStatus ) + { + case WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE: + if ( ::WinHttpReceiveResponse(m_request, NULL) ) + { + m_response.reset(new wxWebResponseWinHTTP(*this)); + if ( CheckServerStatus() ) + { + // Start reading the response + if ( !m_response->ReadData() ) + handleLastError = true; + } + } + else + handleLastError = true; + break; + case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: + if ( dwStatusInformationLength > 0 ) + { + if ( !m_response->ReportAvailableData(dwStatusInformationLength) ) + handleLastError = true; + } + else + { + m_response->ReportDataComplete(); + SetState(State_Ready); + } + break; + case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: + { + LPWINHTTP_ASYNC_RESULT asyncResult = reinterpret_cast(lpvStatusInformation); + SetState(State_Failed, wxWinHTTPErrorToString(asyncResult->dwError)); + break; + } + } + + if (handleLastError) + SetFailedWithLastError(); +} + +void wxWebRequestWinHTTP::SetFailedWithLastError() +{ + wxString failMessage = wxWinHTTPErrorToString(::GetLastError()); + SetState(State_Failed, failMessage); +} + +void wxWebRequestWinHTTP::SetMethod(const wxString& method) +{ + // TODO: implement +} + +void wxWebRequestWinHTTP::SetData(const wxString& text, const wxString& contentType) +{ + // TODO: implement +} + +void wxWebRequestWinHTTP::SetData(const wxInputStream& dataStream, const wxString& contentType) +{ + // TODO: implement +} + +void wxWebRequestWinHTTP::Start() +{ + if ( GetState() != State_Idle ) // Completed requests can not be restarted + return; + + // Parse the URL + wxURI uri(m_url); + bool isSecure = uri.GetScheme().IsSameAs("HTTPS", false); + + int port; + if ( !uri.HasPort() ) + port = (isSecure) ? 443 : 80; + else + port = wxAtoi(uri.GetPort()); + + // Open a connction + m_connect = ::WinHttpConnect(m_session.GetHandle(), uri.GetServer().wc_str(), + port, 0); + if ( m_connect == NULL ) + { + SetFailedWithLastError(); + return; + } + + // Open a request + m_request = ::WinHttpOpenRequest(m_connect, + L"GET", uri.GetPath().wc_str(), + NULL, WINHTTP_NO_REFERER, + WINHTTP_DEFAULT_ACCEPT_TYPES, + (isSecure) ? WINHTTP_FLAG_SECURE : 0); + if ( m_request == NULL ) + { + SetFailedWithLastError(); + return; + } + + // Register callback + if ( ::WinHttpSetStatusCallback(m_request, + (WINHTTP_STATUS_CALLBACK)wxRequestStatusCallback, + WINHTTP_CALLBACK_FLAG_READ_COMPLETE | + WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE | + WINHTTP_CALLBACK_FLAG_REQUEST_ERROR, + 0) == WINHTTP_INVALID_STATUS_CALLBACK ) + { + SetFailedWithLastError(); + return; + } + + // Combine all headers to a string + wxString allHeaders; + for (wxWebRequestHeaderMap::const_iterator header = m_headers.begin(); header != m_headers.end(); ++header) + allHeaders.append(wxString::Format("%s: %s\n", header->first, header->second)); + + // Send request + if ( WinHttpSendRequest(m_request, + allHeaders.wc_str(), allHeaders.length(), + NULL, 0, 0, + (DWORD_PTR)this) ) + { + SetState(State_Active); + } + else + SetFailedWithLastError(); +} + +void wxWebRequestWinHTTP::Cancel() +{ + // TODO: implement +} + +wxWebResponse* wxWebRequestWinHTTP::GetResponse() +{ + return m_response.get(); +} + +// +// wxWebResponseWinHTTP +// + +wxWebResponseWinHTTP::wxWebResponseWinHTTP(wxWebRequestWinHTTP& request): + m_request(request), + m_readSize(8 * 1024) +{ + wxString contentLengthStr = wxWinHTTPQueryHeaderString(m_request.GetHandle(), + WINHTTP_QUERY_CONTENT_LENGTH); + if ( contentLengthStr.empty() || + !contentLengthStr.ToLongLong(&m_contentLength) ) + m_contentLength = -1; +} + +wxString wxWebResponseWinHTTP::GetURL() const +{ + return wxWinHTTPQueryOptionString(m_request.GetHandle(), WINHTTP_OPTION_URL); +} + +wxString wxWebResponseWinHTTP::GetHeader(const wxString& name) const +{ + return wxWinHTTPQueryHeaderString(m_request.GetHandle(), + WINHTTP_QUERY_CUSTOM, name.wc_str()); +} + +int wxWebResponseWinHTTP::GetStatus() const +{ + DWORD status = 0; + DWORD statusSize = sizeof(status); + if ( !::WinHttpQueryHeaders(m_request.GetHandle(), + WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, + WINHTTP_HEADER_NAME_BY_INDEX, &status, &statusSize, 0) ) + { + status = 0; + wxLogLastError("WinHttpQueryHeaders/status"); + } + + return status; +} + +wxString wxWebResponseWinHTTP::GetStatusText() const +{ + return wxWinHTTPQueryHeaderString(m_request.GetHandle(), WINHTTP_QUERY_STATUS_TEXT); +} + +wxInputStream* wxWebResponseWinHTTP::GetStream() const +{ + return m_stream.get(); +} + +wxString wxWebResponseWinHTTP::AsString(wxMBConv* conv) const +{ + // TODO: try to determine encoding type from content-type header + if ( !conv ) + conv = &wxConvUTF8; + + size_t outLen = 0; + return conv->cMB2WC((const char*) m_readBuffer.GetData(), m_readBuffer.GetDataLen(), &outLen); +} + +bool wxWebResponseWinHTTP::ReadData() +{ + if ( ::WinHttpReadData(m_request.GetHandle(), + m_readBuffer.GetAppendBuf(m_readSize), m_readSize, NULL) ) + return true; + else + return false; +} + +bool wxWebResponseWinHTTP::ReportAvailableData(DWORD dataLen) +{ + m_readBuffer.UngetAppendBuf(dataLen); + return ReadData(); +} + +void wxWebResponseWinHTTP::ReportDataComplete() +{ + m_stream.reset(new wxMemoryInputStream(m_readBuffer.GetData(), m_readBuffer.GetDataLen())); +} + +// +// wxWebSessionWinHTTP +// + +wxWebSessionWinHTTP::wxWebSessionWinHTTP(): + m_initialized(false), + m_handle(NULL) +{ +} + +wxWebSessionWinHTTP::~wxWebSessionWinHTTP() +{ + if ( m_handle != INVALID_HANDLE_VALUE ) + ::WinHttpCloseHandle(m_handle); +} + +void wxWebSessionWinHTTP::Init() +{ + DWORD accessType; + if ( wxCheckOsVersion(6, 3) ) + accessType = WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY; + else + accessType = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY; + + m_handle = ::WinHttpOpen(GetHeaders().find("User-Agent")->second.wc_str(), accessType, + WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, + WINHTTP_FLAG_ASYNC); + if ( m_handle != NULL ) + { + // Try to enable HTTP/2 (available since Win 10 1607) + DWORD protFlags = WINHTTP_PROTOCOL_FLAG_HTTP2; + ::WinHttpSetOption(m_handle, WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL, + &protFlags, sizeof(protFlags)); + + // Try to enable GZIP and DEFLATE (available since Win 8.1) + DWORD decompressFlags = WINHTTP_DECOMPRESSION_FLAG_ALL; + ::WinHttpSetOption(m_handle, WINHTTP_OPTION_DECOMPRESSION, + &decompressFlags, sizeof(decompressFlags)); + + // Try to enable modern TLS for older Windows versions + if ( !wxCheckOsVersion(6, 3) ) + { + DWORD securityFlags = WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; + ::WinHttpSetOption(m_handle, WINHTTP_OPTION_SECURE_PROTOCOLS, + &securityFlags, sizeof(securityFlags)); + } + } + else + wxLogLastError("WinHttpOpen"); + + m_initialized = true; +} + wxWebRequest* wxWebSessionWinHTTP::CreateRequest(const wxString& url, int id) { - return NULL; -} - -void wxWebSessionWinHTTP::SetHeader(const wxString& name, const wxString& value) -{ + if ( !m_initialized ) + Init(); + return new wxWebRequestWinHTTP(id, *this, url); } #endif // wxUSE_WEBREQUEST From 3971a9ef7faf0a16f9b52c76b6ad558d95ac0bd9 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Sun, 21 Oct 2018 23:03:01 +0200 Subject: [PATCH 011/218] Expand webrequest sample --- samples/webrequest/webrequest.cpp | 202 +++++++++++++++++++++--------- 1 file changed, 140 insertions(+), 62 deletions(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index f2e11617d4..b09992089b 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -29,6 +29,14 @@ class WebRequestFrame : public wxFrame { public: + enum Pages + { + Page_Image, + Page_Text, + Page_Download, + Page_Advanced + }; + WebRequestFrame(const wxString& title): wxFrame(NULL, wxID_ANY, title) { @@ -39,72 +47,77 @@ public: // If menus are not available add a button to access the about box wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); - wxNotebook* notebook = new wxNotebook(this, wxID_ANY); - // Get image page - wxPanel* getPanel = new wxPanel(notebook); - wxSizer* getSizer = new wxBoxSizer(wxVERTICAL); - getSizer->Add(new wxStaticText(getPanel, wxID_ANY, "Image URL to load:"), + mainSizer->Add(new wxStaticText(this, wxID_ANY, "Request URL:"), wxSizerFlags().Border()); - m_getURLTextCtrl = new wxTextCtrl(getPanel, wxID_ANY, + m_urlTextCtrl = new wxTextCtrl(this, wxID_ANY, "https://www.wxwidgets.org/downloads/logos/blocks.png"); - getSizer->Add(m_getURLTextCtrl, + mainSizer->Add(m_urlTextCtrl, wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); - wxButton* getLoadButton = new wxButton(getPanel, wxID_ANY, "&Load"); - getLoadButton->Bind(wxEVT_BUTTON, &WebRequestFrame::OnGetLoadButton, this); - getSizer->Add(getLoadButton, wxSizerFlags().Border()); + m_notebook = new wxNotebook(this, wxID_ANY); + m_notebook->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, &WebRequestFrame::OnNotebookPageChanged, this); - m_getImageBox = - new wxStaticBoxSizer(wxVERTICAL, getPanel, "Image"); - m_getStaticBitmap = new wxStaticBitmap(m_getImageBox->GetStaticBox(), + // Image page + wxPanel* imagePanel = new wxPanel(m_notebook); + wxSizer* imageSizer = new wxBoxSizer(wxVERTICAL); + + m_imageStaticBitmap = new wxStaticBitmap(imagePanel, wxID_ANY, wxArtProvider::GetBitmap(wxART_MISSING_IMAGE)); - m_getImageBox->Add(m_getStaticBitmap, wxSizerFlags(1).Expand()); - getSizer->Add(m_getImageBox, wxSizerFlags(1).Expand().Border()); + imageSizer->Add(m_imageStaticBitmap, wxSizerFlags(1).Expand()); - getPanel->SetSizer(getSizer); - notebook->AddPage(getPanel, "GET Image", true); + imagePanel->SetSizer(imageSizer); + m_notebook->AddPage(imagePanel, "Image", true); - // POST Text page - wxPanel* postPanel = new wxPanel(notebook); - wxSizer* postSizer = new wxBoxSizer(wxVERTICAL); - postSizer->Add(new wxStaticText(postPanel, wxID_ANY, "Request URL:"), - wxSizerFlags().Border()); - m_postURLTextCtrl = new wxTextCtrl(postPanel, wxID_ANY, - "https://api.github.com/"); - postSizer->Add(m_postURLTextCtrl, - wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); + // Text page + wxPanel* textPanel = new wxPanel(m_notebook); + wxSizer* textSizer = new wxBoxSizer(wxVERTICAL); - postSizer->Add(new wxStaticText(postPanel, wxID_ANY, "Content type:"), - wxSizerFlags().Border()); - m_postContentTypeTextCtrl = new wxTextCtrl(postPanel, wxID_ANY, - "application/json"); - postSizer->Add(m_postContentTypeTextCtrl, - wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); + m_postCheckBox = new wxCheckBox(textPanel, wxID_ANY, "Post request body"); + textSizer->Add(m_postCheckBox, wxSizerFlags().Border()); + m_postCheckBox->Bind(wxEVT_CHECKBOX, &WebRequestFrame::OnPostCheckBox, this); - postSizer->Add(new wxStaticText(postPanel, wxID_ANY, "Request body:"), - wxSizerFlags().Border()); - m_postRequestTextCtrl = new wxTextCtrl(postPanel, wxID_ANY, "", + m_postRequestTextCtrl = new wxTextCtrl(textPanel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); - postSizer->Add(m_postRequestTextCtrl, + textSizer->Add(m_postRequestTextCtrl, wxSizerFlags(1).Expand().Border(wxLEFT | wxRIGHT)); - wxButton* postSendButton = new wxButton(postPanel, wxID_ANY, "&Send"); - postSendButton->Bind(wxEVT_BUTTON, &WebRequestFrame::OnPostSendButton, this); - postSizer->Add(postSendButton, wxSizerFlags().Border()); - - postSizer->Add(new wxStaticText(postPanel, wxID_ANY, "Response body:"), + textSizer->Add(new wxStaticText(textPanel, wxID_ANY, "Request body content type:"), wxSizerFlags().Border()); - m_postResponseTextCtrl = new wxTextCtrl(postPanel, wxID_ANY, "", + m_postContentTypeTextCtrl = new wxTextCtrl(textPanel, wxID_ANY, + "application/json"); + textSizer->Add(m_postContentTypeTextCtrl, + wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); + + textSizer->Add(new wxStaticText(textPanel, wxID_ANY, "Response body:"), + wxSizerFlags().Border()); + m_textResponseTextCtrl = new wxTextCtrl(textPanel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY); - m_postResponseTextCtrl->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - postSizer->Add(m_postResponseTextCtrl, + m_textResponseTextCtrl->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); + textSizer->Add(m_textResponseTextCtrl, wxSizerFlags(1).Expand().Border(wxLEFT | wxRIGHT | wxBOTTOM)); - postPanel->SetSizer(postSizer); - notebook->AddPage(postPanel, "POST Text"); + textPanel->SetSizer(textSizer); + m_notebook->AddPage(textPanel, "Text"); - mainSizer->Add(notebook, wxSizerFlags(1).Expand().Border()); + // Download page + wxPanel* downloadPanel = new wxPanel(m_notebook); + + m_notebook->AddPage(downloadPanel, "Download"); + + // Advanced page + wxPanel* advancedPanel = new wxPanel(m_notebook); + + m_notebook->AddPage(advancedPanel, "Advanced"); + + mainSizer->Add(m_notebook, wxSizerFlags(1).Expand().Border()); + + m_startButton = new wxButton(this, wxID_ANY, "&Start Request"); + m_startButton->Bind(wxEVT_BUTTON, &WebRequestFrame::OnStartButton, this); + mainSizer->Add(m_startButton, wxSizerFlags().Border()); + + wxCommandEvent evt; + OnPostCheckBox(evt); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); SetSizer(mainSizer); @@ -114,50 +127,115 @@ public: CreateStatusBar(); } - void OnGetLoadButton(wxCommandEvent& WXUNUSED(evt)) + void OnStartButton(wxCommandEvent& WXUNUSED(evt)) { - GetStatusBar()->SetStatusText("Requesting image..."); + GetStatusBar()->SetStatusText("Started request..."); // Create request for the specified URL from the default session wxObjectDataPtr request(wxWebSession::GetDefault().CreateRequest( - m_getURLTextCtrl->GetValue())); + m_urlTextCtrl->GetValue())); - // Bind events for failure and success - request->Bind(wxEVT_WEBREQUEST_READY, &WebRequestFrame::OnGetWebRequestReady, this); + // Bind event for failure request->Bind(wxEVT_WEBREQUEST_FAILED, &WebRequestFrame::OnWebRequestFailed, this); + // Prepare request based on selected action + switch (m_notebook->GetSelection()) + { + case Page_Image: + // Bind completion event to response as image + request->Bind(wxEVT_WEBREQUEST_READY, &WebRequestFrame::OnImageRequestReady, this); + break; + case Page_Text: + if (m_postCheckBox->IsChecked()) + { + request->SetData(m_postRequestTextCtrl->GetValue(), + m_postContentTypeTextCtrl->GetValue()); + } + + request->Bind(wxEVT_WEBREQUEST_READY, &WebRequestFrame::OnTextRequestReady, this); + break; + case Page_Download: + // TODO: implement + break; + case Page_Advanced: + // TODO: implement + break; + } + + m_startButton->Disable(); + // Start the request (events will be called on success or failure) request->Start(); } - void OnGetWebRequestReady(wxWebRequestEvent& evt) + void OnImageRequestReady(wxWebRequestEvent& evt) { wxImage img(*evt.GetResponse()->GetStream()); - m_getStaticBitmap->SetBitmap(img); - m_getImageBox->Layout(); + m_imageStaticBitmap->SetBitmap(img); + m_notebook->GetPage(Page_Image)->Layout(); GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes image data", evt.GetResponse()->GetContentLength())); + m_startButton->Enable(); + } + + void OnTextRequestReady(wxWebRequestEvent& evt) + { + m_textResponseTextCtrl->SetValue(evt.GetResponse()->AsString()); + GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes text data (Status: %d %s)", + evt.GetResponse()->GetContentLength(), + evt.GetResponse()->GetStatus(), + evt.GetResponse()->GetStatusText())); + m_startButton->Enable(); } void OnWebRequestFailed(wxWebRequestEvent& evt) { wxLogError("Web Request failed: %s", evt.GetErrorDescription()); GetStatusBar()->SetStatusText(""); + m_startButton->Enable(); } - void OnPostSendButton(wxCommandEvent& WXUNUSED(evt)) + void OnPostCheckBox(wxCommandEvent& WXUNUSED(evt)) { - GetStatusBar()->SetStatusText("Requesting text..."); + m_postContentTypeTextCtrl->Enable(m_postCheckBox->IsChecked()); + m_postRequestTextCtrl->Enable(m_postCheckBox->IsChecked()); + wxColour textBg = wxSystemSettings::GetColour( + (m_postCheckBox->IsChecked()) ? wxSYS_COLOUR_WINDOW : wxSYS_COLOUR_BTNFACE); + + m_postContentTypeTextCtrl->SetBackgroundColour(textBg); + m_postRequestTextCtrl->SetBackgroundColour(textBg); + } + + void OnNotebookPageChanged(wxBookCtrlEvent& event) + { + wxString defaultURL; + switch (event.GetSelection()) + { + case Page_Image: + defaultURL = "https://www.wxwidgets.org/downloads/logos/blocks.png"; + break; + case Page_Text: + defaultURL = "https://api.github.com"; + break; + case Page_Download: + defaultURL = "https://www.wxwidgets.com/download.zip"; + break; + case Page_Advanced: + defaultURL = "https://www.wxwidgets.com/adv.zip"; + break; + } + m_urlTextCtrl->SetValue(defaultURL); } private: - wxTextCtrl* m_getURLTextCtrl; - wxStaticBoxSizer* m_getImageBox; - wxStaticBitmap* m_getStaticBitmap; + wxNotebook* m_notebook; + wxTextCtrl* m_urlTextCtrl; + wxButton* m_startButton; + wxStaticBitmap* m_imageStaticBitmap; - wxTextCtrl* m_postURLTextCtrl; + wxCheckBox* m_postCheckBox; wxTextCtrl* m_postContentTypeTextCtrl; wxTextCtrl* m_postRequestTextCtrl; - wxTextCtrl* m_postResponseTextCtrl; + wxTextCtrl* m_textResponseTextCtrl; }; class WebRequestApp : public wxApp From d7dee7019e94138643ae9805320fcf34aaa7fd19 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 22 Oct 2018 21:39:30 +0200 Subject: [PATCH 012/218] Implement sending request data with wxWebRequest --- include/wx/msw/webrequest_winhttp.h | 12 ++-- include/wx/webrequest.h | 13 +++-- samples/webrequest/webrequest.cpp | 17 ++++-- src/common/webrequest.cpp | 27 +++++++++ src/msw/webrequest_winhttp.cpp | 91 ++++++++++++++++++----------- 5 files changed, 110 insertions(+), 50 deletions(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index 493c984bf6..09b51fb3f8 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -59,12 +59,6 @@ public: ~wxWebRequestWinHTTP(); - void SetMethod(const wxString& method) wxOVERRIDE; - - void SetData(const wxString& text, const wxString& contentType) wxOVERRIDE; - - void SetData(const wxInputStream& dataStream, const wxString& contentType) wxOVERRIDE; - void Start() wxOVERRIDE; void Cancel() wxOVERRIDE; @@ -82,6 +76,12 @@ private: HINTERNET m_connect; HINTERNET m_request; wxScopedPtr m_response; + wxMemoryBuffer m_dataWriteBuffer; + wxFileOffset m_dataWritten; + + void WriteData(); + + void CreateResponse(); void SetFailedWithLastError(); diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index c72c1a21f9..032f5436b5 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -42,11 +42,11 @@ public: virtual void SetHeader(const wxString& name, const wxString& value) { m_headers[name] = value; } - virtual void SetMethod(const wxString& method) = 0; + virtual void SetMethod(const wxString& method) { m_method = method; } - virtual void SetData(const wxString& text, const wxString& contentType) = 0; + void SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv = wxConvUTF8); - virtual void SetData(const wxInputStream& dataStream, const wxString& contentType) = 0; + void SetData(wxSharedPtr dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } @@ -61,12 +61,16 @@ public: State GetState() const { return m_state; } protected: + wxString m_method; wxWebRequestHeaderMap m_headers; + wxFileOffset m_dataSize; + wxSharedPtr m_dataStream; wxWebRequest(int id): m_id(id), m_state(State_Idle), - m_ignoreServerErrorStatus(false) { } + m_ignoreServerErrorStatus(false), + m_dataSize(0) { } void SetState(State state, const wxString& failMsg = ""); @@ -77,6 +81,7 @@ private: State m_state; wxString m_failMessage; bool m_ignoreServerErrorStatus; + wxCharBuffer m_dataText; void ProcessReadyEvent(); diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index b09992089b..d6225ee74b 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -77,15 +77,16 @@ public: textSizer->Add(m_postCheckBox, wxSizerFlags().Border()); m_postCheckBox->Bind(wxEVT_CHECKBOX, &WebRequestFrame::OnPostCheckBox, this); - m_postRequestTextCtrl = new wxTextCtrl(textPanel, wxID_ANY, "", - wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); + m_postRequestTextCtrl = new wxTextCtrl(textPanel, wxID_ANY, + "app=WebRequestSample&version=1", + wxDefaultPosition, wxSize(-1, FromDIP(60)), wxTE_MULTILINE); textSizer->Add(m_postRequestTextCtrl, - wxSizerFlags(1).Expand().Border(wxLEFT | wxRIGHT)); + wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); textSizer->Add(new wxStaticText(textPanel, wxID_ANY, "Request body content type:"), wxSizerFlags().Border()); m_postContentTypeTextCtrl = new wxTextCtrl(textPanel, wxID_ANY, - "application/json"); + "application/x-www-form-urlencoded"); textSizer->Add(m_postContentTypeTextCtrl, wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); @@ -142,10 +143,16 @@ public: switch (m_notebook->GetSelection()) { case Page_Image: + // Reset static bitmap image + m_imageStaticBitmap->SetBitmap(wxArtProvider::GetBitmap(wxART_MISSING_IMAGE)); // Bind completion event to response as image request->Bind(wxEVT_WEBREQUEST_READY, &WebRequestFrame::OnImageRequestReady, this); break; case Page_Text: + // Reset response text control + m_textResponseTextCtrl->Clear(); + + // Set postdata if checked if (m_postCheckBox->IsChecked()) { request->SetData(m_postRequestTextCtrl->GetValue(), @@ -214,7 +221,7 @@ public: defaultURL = "https://www.wxwidgets.org/downloads/logos/blocks.png"; break; case Page_Text: - defaultURL = "https://api.github.com"; + defaultURL = "https://httpbin.org/post"; break; case Page_Download: defaultURL = "https://www.wxwidgets.com/download.zip"; diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 10c5e701ef..8ab49bd37e 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -17,6 +17,7 @@ #if wxUSE_WEBREQUEST #include "wx/webrequest.h" +#include "wx/mstream.h" #ifndef WX_PRECOMP #include "wx/app.h" @@ -55,6 +56,32 @@ bool wxWebRequest::CheckServerStatus() return true; } +void wxWebRequest::SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv) +{ + m_dataText = text.mb_str(conv); + SetData(wxSharedPtr(new wxMemoryInputStream(m_dataText, m_dataText.length())), contentType); +} + +void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString& contentType, wxFileOffset dataSize) +{ + m_dataStream = dataStream; + if ( m_dataStream.get() ) + { + if ( dataSize == wxInvalidOffset ) + { + // Determine data size + m_dataSize = m_dataStream->SeekI(0, wxFromEnd); + m_dataStream->SeekI(0); + } + else + m_dataSize = dataSize; + } + else + m_dataSize = 0; + + SetHeader("Content-Type", contentType); +} + void wxWebRequest::SetState(State state, const wxString & failMsg) { switch (state) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 118cacde06..b644700c16 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -163,30 +163,19 @@ wxWebRequestWinHTTP::~wxWebRequestWinHTTP() void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength) { - bool handleLastError = false; - static const int readSize = 8 * 1024; - switch ( dwInternetStatus ) { case WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE: - if ( ::WinHttpReceiveResponse(m_request, NULL) ) - { - m_response.reset(new wxWebResponseWinHTTP(*this)); - if ( CheckServerStatus() ) - { - // Start reading the response - if ( !m_response->ReadData() ) - handleLastError = true; - } - } + if ( m_dataSize ) + WriteData(); else - handleLastError = true; + CreateResponse(); break; case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: if ( dwStatusInformationLength > 0 ) { if ( !m_response->ReportAvailableData(dwStatusInformationLength) ) - handleLastError = true; + SetFailedWithLastError(); } else { @@ -194,6 +183,9 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, SetState(State_Ready); } break; + case WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE: + WriteData(); + break; case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: { LPWINHTTP_ASYNC_RESULT asyncResult = reinterpret_cast(lpvStatusInformation); @@ -201,32 +193,49 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, break; } } - - if (handleLastError) - SetFailedWithLastError(); } +void wxWebRequestWinHTTP::WriteData() +{ + int dataWriteSize = 8 * 1024; + if ( m_dataWritten + dataWriteSize > m_dataSize ) + dataWriteSize = m_dataSize - m_dataWritten; + if ( dataWriteSize ) + { + m_dataWriteBuffer.Clear(); + m_dataWriteBuffer.GetWriteBuf(dataWriteSize); + m_dataStream->Read(m_dataWriteBuffer.GetData(), dataWriteSize); + + if ( !::WinHttpWriteData(m_request, m_dataWriteBuffer.GetData(), dataWriteSize, NULL) ) + SetFailedWithLastError(); + m_dataWritten += dataWriteSize; + } + else + CreateResponse(); +} + +void wxWebRequestWinHTTP::CreateResponse() +{ + if (::WinHttpReceiveResponse(m_request, NULL)) + { + m_response.reset(new wxWebResponseWinHTTP(*this)); + if (CheckServerStatus()) + { + // Start reading the response + if (!m_response->ReadData()) + SetFailedWithLastError(); + } + } + else + SetFailedWithLastError(); +} + void wxWebRequestWinHTTP::SetFailedWithLastError() { wxString failMessage = wxWinHTTPErrorToString(::GetLastError()); SetState(State_Failed, failMessage); } -void wxWebRequestWinHTTP::SetMethod(const wxString& method) -{ - // TODO: implement -} - -void wxWebRequestWinHTTP::SetData(const wxString& text, const wxString& contentType) -{ - // TODO: implement -} - -void wxWebRequestWinHTTP::SetData(const wxInputStream& dataStream, const wxString& contentType) -{ - // TODO: implement -} - void wxWebRequestWinHTTP::Start() { if ( GetState() != State_Idle ) // Completed requests can not be restarted @@ -251,9 +260,17 @@ void wxWebRequestWinHTTP::Start() return; } + wxString method; + if ( !m_method.empty() ) + method = m_method; + else if ( m_dataSize ) + method = "POST"; + else + method = "GET"; + // Open a request m_request = ::WinHttpOpenRequest(m_connect, - L"GET", uri.GetPath().wc_str(), + method.wc_str(), uri.GetPath().wc_str(), NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, (isSecure) ? WINHTTP_FLAG_SECURE : 0); @@ -267,6 +284,7 @@ void wxWebRequestWinHTTP::Start() if ( ::WinHttpSetStatusCallback(m_request, (WINHTTP_STATUS_CALLBACK)wxRequestStatusCallback, WINHTTP_CALLBACK_FLAG_READ_COMPLETE | + WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE | WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE | WINHTTP_CALLBACK_FLAG_REQUEST_ERROR, 0) == WINHTTP_INVALID_STATUS_CALLBACK ) @@ -280,10 +298,13 @@ void wxWebRequestWinHTTP::Start() for (wxWebRequestHeaderMap::const_iterator header = m_headers.begin(); header != m_headers.end(); ++header) allHeaders.append(wxString::Format("%s: %s\n", header->first, header->second)); + if ( m_dataSize ) + m_dataWritten = 0; + // Send request if ( WinHttpSendRequest(m_request, allHeaders.wc_str(), allHeaders.length(), - NULL, 0, 0, + NULL, 0, m_dataSize, (DWORD_PTR)this) ) { SetState(State_Active); From b24581811e31e709f9f63a79e095f1ad48c79c7c Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 22 Oct 2018 21:43:13 +0200 Subject: [PATCH 013/218] Send query of URL in wxWebRequestWinHTTP --- src/msw/webrequest_winhttp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index b644700c16..359644676b 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -268,9 +268,13 @@ void wxWebRequestWinHTTP::Start() else method = "GET"; + wxString objectName = uri.GetPath(); + if ( uri.HasQuery() ) + objectName += "?" + uri.GetQuery(); + // Open a request m_request = ::WinHttpOpenRequest(m_connect, - method.wc_str(), uri.GetPath().wc_str(), + method.wc_str(), objectName.wc_str(), NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, (isSecure) ? WINHTTP_FLAG_SECURE : 0); From b11fbd0901e73563a6fc5b842b824b8d2d32832a Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 22 Oct 2018 22:00:25 +0200 Subject: [PATCH 014/218] Update wxWebRequest documentation --- interface/wx/webrequest.h | 210 ++++++++++++++++++++++++++++++++------ 1 file changed, 180 insertions(+), 30 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 8428636c22..457113e301 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -20,7 +20,8 @@ wxWebSession::CreateRequest(). The requests are handled asynchronously and event handlers are used to - communicate the request status. + communicate the request status. The response data may be stored in + memory, to a file or processed directly, see SetStorage() for details. Example usage: @@ -29,14 +30,24 @@ wxObjectDataPtr request( wxWebSession::GetDefault().CreateRequest("https://www.wxwidgets.org/downloads/logos/blocks.png")); - // Bind events - request->Bind(wxEVT_WEBREQUEST_READY, [](wxWebRequestEvent& evt) { - wxImage logoImage(*evt->GetResponse()->GetStream()); - if (logoImage.IsOK()) - wxLogInfo("Image loaded"); - }); - request->Bind(wxEVT_WEBREQUEST_FAILED, [](wxWebRequestEvent& evt) { - wxLogError("Could not load logo: %s", evt.GetErrorDescription()); + // Bind state event + request->Bind(wxEVT_WEBREQUEST_STATE, [](wxWebRequestEvent& evt) { + switch (evt.GetState()) + { + // Request completed + case wxWebRequest::State_Completed: + { + wxImage logoImage(*evt->GetResponse()->GetStream()); + if (logoImage.IsOK()) + wxLogInfo("Image loaded"); + break; + } + // Request failed + case wxWebRequest::State_Failed: + wxLogError("Could not load logo: %s", evt.GetErrorDescription()); + break; + } + }); // Start the request @@ -86,13 +97,16 @@ @beginEventEmissionTable{wxWebRequestEvent} - @event{wxEVT_WEBREQUEST_READY(id, func)} - The response data is ready to be used. - @event{wxEVT_WEBREQUEST_FAILED(id, func)} - A network error has occurred. This could be client side or server side. - Use wxWebRequestEvent::GetErrorDescription() to get more details. - @event{wxEVT_WEBREQUEST_AUTH_REQUIRED(id, func)} - The request needs additional authentication to continue. + @event{wxEVT_WEBREQUEST_STATE(id, func)} + The request state changed. + @event{wxEVT_WEBREQUEST_DATA(id, func)} + A new block of data has been downloaded. + @event{wxEVT_WEBREQUEST_DOWNLOAD_PROGRESS(id, func)} + This event periodically reports the download progress while the request + is active. + @event{wxEVT_WEBREQUEST_UPLOAD_PROGRESS(id, func)} + This event periodically reports the upload progress while the request + is active. @endEventTable @since 3.1.2 @@ -105,6 +119,71 @@ class wxWebRequest: public wxEvtHandler, public wxRefCounter { public: + /** + Possible request states returned by GetState(). + */ + enum State + { + /// The request has just been created and Start() has not been called + State_Idle, + + /// The request has been started and is transferring data + State_Active, + + /** + The server denied the request because of insufficient + user credentials. When credentials are provided with + SetCredentials() the request will be retried with the supplied + user credentials. + */ + State_Unauthorized, + + /** + A proxy denied the request because of insufficient + user credentials. When credentials are provided with + SetCredentials() the request will be retried with the supplied + user credentials. + */ + State_UnauthorizedProxy, + + /// The request completed successfully and all data has been received. + State_Completed, + + /// The request failed + State_Failed, + + /// The request has been cancelled before completion by calling Cancel() + State_Cancelled + }; + + /** + Possible storage types. Set by SetStorage(). + */ + enum Storage + { + /// All data is collected in memory until the request is complete + Storage_Memory, + + /// The data is written to a file on disk + Storage_File, + + /** + The data is not stored by the request and is only available + via events. + */ + Storage_None + }; + + /// Possible credential targets used by SetCredentials(). + enum CredentialTarget + { + /// Set credentials to be sent to the server. + CredentialTarget_Server, + + /// Set credentials to be sent to a proxy. + CredentialTarget_Proxy + } + /** Sets a request header which will be sent to the server by this request. @@ -141,8 +220,11 @@ public: @param contentType The value of HTTP "Content-Type" header, e.g. "text/html; charset=UTF-8". + @param conv + Conversion used when sending the text to the server */ - void SetData(const wxString& text, const wxString& contentType); + void SetData(const wxString& text, const wxString& contentType, + const wxMBConv& conv = wxConvUTF8); /** Set the binary data to be posted to the server. @@ -156,21 +238,65 @@ public: @param contentType The value of HTTP "Content-Type" header, e.g. "application/octet-stream". + @param dataSize + Amount of data which is sent to the server. If set to + @c wxInvalidOffset all stream data is sent. + */ - void SetData(const wxInputStream& dataStream, const wxString& contentType); + void SetData(wxSharedPtr dataStream, + const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); + + /** + Sets the credentials to be sent to the server or proxy when + authentification is requested. + + @param user + User name + @param password + Password + @param target + Specify the credentials for the server @c CredentialTarget_Server + or the proxy @c CredentialTarget_Proxy. + */ + void SetCredentials(const wxString& user, const wxString& password, + CredentialTarget target); /** Instructs the request to ignore server error status codes. - Per default, server side errors (status code 400-599) will send - a wxEVT_WEBREQUEST_FAILED event just like network errors, but - if the response is still required in this cases (e.g. to get more + Per default, server side errors (status code 400-599) will enter + the State_Failed state just like network errors, but + if the response is still required in such cases (e.g. to get more details from the response body), set this option to ignore all errors. If ignored, wxWebResponse::GetStatus() has to be checked - from the wxEVT_WEBREQUEST_READY event handler. + from the State_Completed event handler. */ void SetIgnoreServerErrorStatus(bool ignore); + /** + Sets how response data will be stored. + + The default storage method @c Storage_Memory collects all response data + in memory until the request is completed. This is fine for most usage + scenarios like API calls, loading images, etc. For larger downloads or + if the response data will be used permanently @c Storage_File instructs + the request to write the response to a temporary file. This temporary + file may then be read or moved after the request is complete. The file + will be downloaded to the system temp directory as returned by + wxStandardPaths::GetTempDir(). To specify a different directory use + wxWebSession::SetTempDir(). + + Sometimes response data needs to be processed while its downloaded from + the server. For example if the response is in a format that can be + parsed piece by piece like XML, JSON or an archive format like ZIP. + In these cases storing the data in memory or a file before being able + to process it might not be ideal and @c Storage_None should be set. + With this storage method the data is only available during the + @c wxEVT_WEBREQUEST_DATA event calls as soon as it's received from the + server. + */ + void SetStorage(Storage storage); + /** Send the request to the server asynchronously. @@ -191,12 +317,17 @@ public: Before sending a request or after a failed request this will return @c NULL. */ - const wxWebResponse* GetResponse() const; + wxWebResponse* GetResponse(); /** Returns the id specified while creating this request. */ int GetId() const; + + /** + Returns the current state of the request. + */ + State GetState() const { return m_state; } }; /** @@ -240,7 +371,7 @@ public: /** Returns a stream which represents the response data sent by the server. */ - wxInputStream* GetStream() const; + wxInputStream* GetStream(); /** Returns all response data as a string. @@ -307,6 +438,19 @@ public: */ void SetHeader(const wxString& name, const wxString& value); + /** + Override the default temporary directory that may be used by the + session implemention, when required. + */ + void SetTempDir(const wxString& name); + + /** + Returns the current temporary directory. + + @see SetTempDir() + */ + const &wxString GetTempDir() const; + /** Returns the default session */ @@ -381,11 +525,16 @@ class wxWebRequestEvent : public wxEvent { public: wxWebRequestEvent(); - wxWebRequestEvent(wxEventType type, int id, wxWebResponse* response = NULL, - const wxString& errorDesc = ""); + wxWebRequestEvent(wxEventType type, int id, wxWebRequest::State state, + wxWebResponse* response = NULL, const wxString& errorDesc = ""); /** - The response for a wxEVT_WEBREQUEST_READY event or @c NULL for other + Return the current state of the request + */ + wxWebRequest::State GetState() const; + + /** + The response with the state set to @c State_Complete or @c NULL for other events. */ wxWebResponse* GetResponse() const; @@ -397,6 +546,7 @@ public: const wxString& GetErrorDescription() const; }; -wxEventType wxEVT_WEBREQUEST_READY; -wxEventType wxEVT_WEBREQUEST_FAILED; -wxEventType wxEVT_WEBREQUEST_AUTH_REQUIRED; +wxEventType wxEVT_WEBREQUEST_STATE; +wxEventType wxEVT_WEBREQUEST_DATA; +wxEventType wxEVT_WEBREQUEST_DOWNLOAD_PROGRESS; +wxEventType wxEVT_WEBREQUEST_UPLOAD_PROGRESS; From d756159f5d92da5d6c8b95392366629b0725b8f9 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Tue, 23 Oct 2018 19:58:34 +0200 Subject: [PATCH 015/218] Add common dialog wxCredentialEntryDialog Prompting for user name and password is a common task. At least windows provides these dialogs native but this is just a generic implementation for now. --- Makefile.in | 38 +++++++++--- build/bakefiles/files.bkl | 3 + build/cmake/files.cmake | 3 + build/cmake/options.cmake | 1 + build/cmake/setup.h.in | 2 + build/files | 3 + build/msw/makefile.bcc | 44 +++++++++++--- build/msw/makefile.gcc | 44 +++++++++++--- build/msw/makefile.vc | 44 +++++++++++--- build/msw/wx_core.vcxproj | 3 + build/msw/wx_core.vcxproj.filters | 9 +++ build/msw/wx_vc7_core.vcproj | 9 +++ build/msw/wx_vc8_core.vcproj | 12 ++++ build/msw/wx_vc9_core.vcproj | 12 ++++ configure | 36 +++++++++++ configure.in | 5 ++ docs/doxygen/overviews/commondialogs.h | 10 ++++ include/wx/android/setup.h | 3 + include/wx/chkconf.h | 1 + include/wx/creddlg.h | 15 +++++ include/wx/generic/creddlgg.h | 55 +++++++++++++++++ include/wx/gtk/setup0.h | 3 + include/wx/motif/setup0.h | 3 + include/wx/msw/setup0.h | 3 + include/wx/osx/setup0.h | 10 +--- include/wx/setup_inc.h | 3 + include/wx/univ/setup0.h | 3 + interface/wx/creddlg.h | 83 ++++++++++++++++++++++++++ samples/dialogs/dialogs.cpp | 28 ++++++++- samples/dialogs/dialogs.h | 5 ++ setup.h.in | 2 + src/generic/creddlgg.cpp | 77 ++++++++++++++++++++++++ 32 files changed, 532 insertions(+), 40 deletions(-) create mode 100644 include/wx/creddlg.h create mode 100644 include/wx/generic/creddlgg.h create mode 100644 interface/wx/creddlg.h create mode 100644 src/generic/creddlgg.cpp diff --git a/Makefile.in b/Makefile.in index 94da2f332d..b1d92f55df 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3939,6 +3939,8 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ wx/generic/dvrenderer.h \ wx/calctrl.h \ wx/propdlg.h \ + wx/generic/creddlgg.h \ + wx/creddlg.h \ $(LOWLEVEL_HDR) \ $(GUI_CORE_HEADERS) \ wx/mediactrl.h \ @@ -4588,7 +4590,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS = \ monodll_datavgen.o \ monodll_editlbox.o \ monodll_laywin.o \ - monodll_calctrlg.o + monodll_calctrlg.o \ + monodll_creddlgg.o @COND_USE_GUI_1_WXUNIV_0@__CORE_SRC_OBJECTS = $(COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS) COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS = \ $(__LOWLEVEL_SRC_OBJECTS_1) \ @@ -4848,7 +4851,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS = \ monodll_datavgen.o \ monodll_editlbox.o \ monodll_laywin.o \ - monodll_calctrlg.o + monodll_calctrlg.o \ + monodll_creddlgg.o @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS = \ monodll_fontmgrcmn.o \ @@ -6565,7 +6569,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_1 = \ monolib_datavgen.o \ monolib_editlbox.o \ monolib_laywin.o \ - monolib_calctrlg.o + monolib_calctrlg.o \ + monolib_creddlgg.o @COND_USE_GUI_1_WXUNIV_0@__CORE_SRC_OBJECTS_1 = $(COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_1) COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1 = \ $(__LOWLEVEL_SRC_OBJECTS_3) \ @@ -6825,7 +6830,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1 = \ monolib_datavgen.o \ monolib_editlbox.o \ monolib_laywin.o \ - monolib_calctrlg.o + monolib_calctrlg.o \ + monolib_creddlgg.o @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS_1 = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_2 = \ monolib_fontmgrcmn.o \ @@ -8690,7 +8696,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_2 = \ coredll_datavgen.o \ coredll_editlbox.o \ coredll_laywin.o \ - coredll_calctrlg.o + coredll_calctrlg.o \ + coredll_creddlgg.o @COND_USE_GUI_1_WXUNIV_0@__CORE_SRC_OBJECTS_2 = $(COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_2) COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2 = \ $(__LOWLEVEL_SRC_OBJECTS_5) \ @@ -8950,7 +8957,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2 = \ coredll_datavgen.o \ coredll_editlbox.o \ coredll_laywin.o \ - coredll_calctrlg.o + coredll_calctrlg.o \ + coredll_creddlgg.o @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS_2 = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_4 = \ coredll_fontmgrcmn.o \ @@ -10408,7 +10416,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_3 = \ corelib_datavgen.o \ corelib_editlbox.o \ corelib_laywin.o \ - corelib_calctrlg.o + corelib_calctrlg.o \ + corelib_creddlgg.o @COND_USE_GUI_1_WXUNIV_0@__CORE_SRC_OBJECTS_3 = $(COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_3) COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3 = \ $(__LOWLEVEL_SRC_OBJECTS_7) \ @@ -10668,7 +10677,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3 = \ corelib_datavgen.o \ corelib_editlbox.o \ corelib_laywin.o \ - corelib_calctrlg.o + corelib_calctrlg.o \ + corelib_creddlgg.o @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS_3 = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_6 = \ corelib_fontmgrcmn.o \ @@ -20716,6 +20726,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_USE_GUI_1@monodll_calctrlg.o: $(srcdir)/src/generic/calctrlg.cpp $(MONODLL_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/calctrlg.cpp +@COND_USE_GUI_1@monodll_creddlgg.o: $(srcdir)/src/generic/creddlgg.cpp $(MONODLL_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/creddlgg.cpp + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_osx_cocoa_mediactrl.o: $(srcdir)/src/osx/cocoa/mediactrl.mm $(MONODLL_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/mediactrl.mm @@ -25975,6 +25988,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1@monolib_calctrlg.o: $(srcdir)/src/generic/calctrlg.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/calctrlg.cpp +@COND_USE_GUI_1@monolib_creddlgg.o: $(srcdir)/src/generic/creddlgg.cpp $(MONOLIB_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/creddlgg.cpp + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_osx_cocoa_mediactrl.o: $(srcdir)/src/osx/cocoa/mediactrl.mm $(MONOLIB_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/mediactrl.mm @@ -31333,6 +31349,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_USE_GUI_1@coredll_calctrlg.o: $(srcdir)/src/generic/calctrlg.cpp $(COREDLL_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/calctrlg.cpp +@COND_USE_GUI_1@coredll_creddlgg.o: $(srcdir)/src/generic/creddlgg.cpp $(COREDLL_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/creddlgg.cpp + corelib_event.o: $(srcdir)/src/common/event.cpp $(CORELIB_ODEP) $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/event.cpp @@ -35581,6 +35600,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_USE_GUI_1@corelib_calctrlg.o: $(srcdir)/src/generic/calctrlg.cpp $(CORELIB_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/calctrlg.cpp +@COND_USE_GUI_1@corelib_creddlgg.o: $(srcdir)/src/generic/creddlgg.cpp $(CORELIB_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/creddlgg.cpp + advdll_version_rc.o: $(srcdir)/src/msw/version.rc $(ADVDLL_ODEP) $(WINDRES) -i$< -o$@ --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_66) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) --define WXBUILDING --define WXDLLNAME=$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG) $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include $(__INC_TIFF_BUILD_p_66) $(__INC_TIFF_p_66) $(__INC_JPEG_p_66) $(__INC_PNG_p_65) $(__INC_ZLIB_p_67) $(__INC_REGEX_p_65) $(__INC_EXPAT_p_65) --define WXUSINGDLL --define WXMAKINGDLL_ADV diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index ea7679c556..66ac82af7b 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -1009,6 +1009,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/generic/editlbox.cpp src/generic/laywin.cpp src/generic/calctrlg.cpp + src/generic/creddlgg.cpp wx/affinematrix2dbase.h @@ -1297,6 +1298,8 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/generic/dvrenderer.h wx/calctrl.h wx/propdlg.h + wx/generic/creddlgg.h + wx/creddlg.h diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake index 224d06b5b2..54659bf217 100644 --- a/build/cmake/files.cmake +++ b/build/cmake/files.cmake @@ -912,6 +912,7 @@ set(GUI_CMN_SRC src/generic/wizard.cpp src/generic/editlbox.cpp src/generic/datavgen.cpp + src/generic/creddlgg.cpp ) set(GUI_CMN_HDR @@ -1200,6 +1201,8 @@ set(GUI_CMN_HDR wx/generic/splash.h wx/generic/calctrlg.h wx/generic/sashwin.h + wx/creddlg.h + wx/generic/creddlgg.h ) set(UNIX_SRC diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index a35a88eb57..155ca66a35 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -328,6 +328,7 @@ wx_option(wxUSE_COMMON_DIALOGS "use all common dialogs") wx_option(wxUSE_ABOUTDLG "use wxAboutBox") wx_option(wxUSE_CHOICEDLG "use wxChoiceDialog") wx_option(wxUSE_COLOURDLG "use wxColourDialog") +wx_option(wxUSE_CREDENTIALDLG "use wxCredentialEntryDialog") wx_option(wxUSE_FILEDLG "use wxFileDialog") wx_option(wxUSE_FINDREPLDLG "use wxFindReplaceDialog") wx_option(wxUSE_FONTDLG "use wxFontDialog") diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index 87c54ba807..7c06dd28e2 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -524,6 +524,8 @@ #cmakedefine01 wxUSE_NUMBERDLG +#cmakedefine01 wxUSE_CREDENTIALDLG + #cmakedefine01 wxUSE_SPLASH #cmakedefine01 wxUSE_WIZARDDLG diff --git a/build/files b/build/files index c121f78a8f..5a0ebe658c 100644 --- a/build/files +++ b/build/files @@ -872,6 +872,7 @@ GUI_CMN_SRC = src/generic/collheaderctrlg.cpp src/generic/combog.cpp src/generic/commandlinkbuttong.cpp + src/generic/creddlgg.cpp src/generic/datavgen.cpp src/generic/datectlg.cpp src/generic/dcpsg.cpp @@ -968,6 +969,7 @@ GUI_CMN_HDR = wx/commandlinkbutton.h wx/compositewin.h wx/control.h + wx/creddlg.h wx/cshelp.h wx/ctrlsub.h wx/cursor.h @@ -1027,6 +1029,7 @@ GUI_CMN_HDR = wx/generic/collheaderctrl.h wx/generic/combo.h wx/generic/custombgwin.h + wx/generic/creddlgg.h wx/generic/dataview.h wx/generic/datectrl.h wx/generic/dcpsg.h diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index 67f8d38576..c9ccf9df3c 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -2134,7 +2134,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.obj \ $(OBJS)\monodll_editlbox.obj \ $(OBJS)\monodll_laywin.obj \ - $(OBJS)\monodll_calctrlg.obj + $(OBJS)\monodll_calctrlg.obj \ + $(OBJS)\monodll_creddlgg.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_OBJECTS = \ @@ -2459,7 +2460,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.obj \ $(OBJS)\monodll_editlbox.obj \ $(OBJS)\monodll_laywin.obj \ - $(OBJS)\monodll_calctrlg.obj + $(OBJS)\monodll_calctrlg.obj \ + $(OBJS)\monodll_creddlgg.obj !endif !if "$(USE_STC)" == "1" ____MONOLIB_STC_SRC_FILENAMES_OBJECTS = \ @@ -2963,7 +2965,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.obj \ $(OBJS)\monolib_editlbox.obj \ $(OBJS)\monolib_laywin.obj \ - $(OBJS)\monolib_calctrlg.obj + $(OBJS)\monolib_calctrlg.obj \ + $(OBJS)\monolib_creddlgg.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_1_OBJECTS = \ @@ -3288,7 +3291,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.obj \ $(OBJS)\monolib_editlbox.obj \ $(OBJS)\monolib_laywin.obj \ - $(OBJS)\monolib_calctrlg.obj + $(OBJS)\monolib_calctrlg.obj \ + $(OBJS)\monolib_creddlgg.obj !endif !if "$(USE_STC)" == "1" ____MONOLIB_STC_SRC_FILENAMES_1_OBJECTS = \ @@ -3667,7 +3671,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.obj \ $(OBJS)\coredll_editlbox.obj \ $(OBJS)\coredll_laywin.obj \ - $(OBJS)\coredll_calctrlg.obj + $(OBJS)\coredll_calctrlg.obj \ + $(OBJS)\coredll_creddlgg.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_2_OBJECTS = \ @@ -3992,7 +3997,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.obj \ $(OBJS)\coredll_editlbox.obj \ $(OBJS)\coredll_laywin.obj \ - $(OBJS)\coredll_calctrlg.obj + $(OBJS)\coredll_calctrlg.obj \ + $(OBJS)\coredll_creddlgg.obj !endif !if "$(MONOLITHIC)" == "0" && "$(SHARED)" == "0" && "$(USE_GUI)" == "1" __corelib___depname = \ @@ -4337,7 +4343,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.obj \ $(OBJS)\corelib_editlbox.obj \ $(OBJS)\corelib_laywin.obj \ - $(OBJS)\corelib_calctrlg.obj + $(OBJS)\corelib_calctrlg.obj \ + $(OBJS)\corelib_creddlgg.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_3_OBJECTS = \ @@ -4662,7 +4669,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.obj \ $(OBJS)\corelib_editlbox.obj \ $(OBJS)\corelib_laywin.obj \ - $(OBJS)\corelib_calctrlg.obj + $(OBJS)\corelib_calctrlg.obj \ + $(OBJS)\corelib_creddlgg.obj !endif !if "$(SHARED)" == "1" ____wxcore_namedll_DEP = $(__coredll___depname) @@ -8951,6 +8959,11 @@ $(OBJS)\monodll_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monodll_creddlgg.obj: ..\..\src\generic\creddlgg.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\creddlgg.cpp +!endif + $(OBJS)\monodll_version.res: ..\..\src\msw\version.rc brcc32 -32 -r -fo$@ -i$(BCCDIR)\include -d__WXMSW__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_66) $(__NDEBUG_DEFINE_p_65) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) $(__UNICODE_DEFINE_p_67) -i$(SETUPHDIR) -i..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_4) -dWXBUILDING -dWXDLLNAME=wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG) -i$(BCCDIR)\include\windows\sdk -i..\..\src\tiff\libtiff -i..\..\src\jpeg -i..\..\src\png -i..\..\src\zlib -i..\..\src\regex -i..\..\src\expat\expat\lib -i..\..\src\stc\scintilla\include -i..\..\src\stc\scintilla\lexlib -i..\..\src\stc\scintilla\src -d__WX__ -dSCI_LEXER -dNO_CXX11_REGEX -dLINK_LEXERS -dwxUSE_BASE=1 -dWXMAKINGDLL ..\..\src\msw\version.rc @@ -11498,6 +11511,11 @@ $(OBJS)\monolib_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monolib_creddlgg.obj: ..\..\src\generic\creddlgg.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\creddlgg.cpp +!endif + $(OBJS)\basedll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) -q -c -P -o$@ $(BASEDLL_CXXFLAGS) -H ..\..\src\common\dummy.cpp @@ -14015,6 +14033,11 @@ $(OBJS)\coredll_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\coredll_creddlgg.obj: ..\..\src\generic\creddlgg.cpp + $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\generic\creddlgg.cpp +!endif + $(OBJS)\corelib_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) -H ..\..\src\common\dummy.cpp @@ -15743,6 +15766,11 @@ $(OBJS)\corelib_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\corelib_creddlgg.obj: ..\..\src\generic\creddlgg.cpp + $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\generic\creddlgg.cpp +!endif + $(OBJS)\advdll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) -q -c -P -o$@ $(ADVDLL_CXXFLAGS) -H ..\..\src\common\dummy.cpp diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index 0fbe1ef059..280498e6fc 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -2160,7 +2160,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.o \ $(OBJS)\monodll_editlbox.o \ $(OBJS)\monodll_laywin.o \ - $(OBJS)\monodll_calctrlg.o + $(OBJS)\monodll_calctrlg.o \ + $(OBJS)\monodll_creddlgg.o endif endif ifeq ($(USE_GUI),1) @@ -2487,7 +2488,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.o \ $(OBJS)\monodll_editlbox.o \ $(OBJS)\monodll_laywin.o \ - $(OBJS)\monodll_calctrlg.o + $(OBJS)\monodll_calctrlg.o \ + $(OBJS)\monodll_creddlgg.o endif endif ifeq ($(USE_STC),1) @@ -2995,7 +2997,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.o \ $(OBJS)\monolib_editlbox.o \ $(OBJS)\monolib_laywin.o \ - $(OBJS)\monolib_calctrlg.o + $(OBJS)\monolib_calctrlg.o \ + $(OBJS)\monolib_creddlgg.o endif endif ifeq ($(USE_GUI),1) @@ -3322,7 +3325,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.o \ $(OBJS)\monolib_editlbox.o \ $(OBJS)\monolib_laywin.o \ - $(OBJS)\monolib_calctrlg.o + $(OBJS)\monolib_calctrlg.o \ + $(OBJS)\monolib_creddlgg.o endif endif ifeq ($(USE_STC),1) @@ -3715,7 +3719,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.o \ $(OBJS)\coredll_editlbox.o \ $(OBJS)\coredll_laywin.o \ - $(OBJS)\coredll_calctrlg.o + $(OBJS)\coredll_calctrlg.o \ + $(OBJS)\coredll_creddlgg.o endif endif ifeq ($(USE_GUI),1) @@ -4042,7 +4047,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.o \ $(OBJS)\coredll_editlbox.o \ $(OBJS)\coredll_laywin.o \ - $(OBJS)\coredll_calctrlg.o + $(OBJS)\coredll_calctrlg.o \ + $(OBJS)\coredll_creddlgg.o endif endif ifeq ($(MONOLITHIC),0) @@ -4393,7 +4399,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.o \ $(OBJS)\corelib_editlbox.o \ $(OBJS)\corelib_laywin.o \ - $(OBJS)\corelib_calctrlg.o + $(OBJS)\corelib_calctrlg.o \ + $(OBJS)\corelib_creddlgg.o endif endif ifeq ($(USE_GUI),1) @@ -4720,7 +4727,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.o \ $(OBJS)\corelib_editlbox.o \ $(OBJS)\corelib_laywin.o \ - $(OBJS)\corelib_calctrlg.o + $(OBJS)\corelib_calctrlg.o \ + $(OBJS)\corelib_creddlgg.o endif endif ifeq ($(SHARED),1) @@ -9133,6 +9141,11 @@ $(OBJS)\monodll_calctrlg.o: ../../src/generic/calctrlg.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\monodll_creddlgg.o: ../../src/generic/creddlgg.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +endif + $(OBJS)\monodll_version_rc.o: ../../src/msw/version.rc $(WINDRES) -i$< -o$@ --define __WXMSW__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_66) $(__NDEBUG_DEFINE_p_65) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) $(__UNICODE_DEFINE_p_67) --include-dir $(SETUPHDIR) --include-dir ../../include $(__CAIRO_INCLUDEDIR_p) --define WXBUILDING --define WXDLLNAME=wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG) --include-dir ../../src/tiff/libtiff --include-dir ../../src/jpeg --include-dir ../../src/png --include-dir ../../src/zlib --include-dir ../../src/regex --include-dir ../../src/expat/expat/lib --include-dir ../../src/stc/scintilla/include --include-dir ../../src/stc/scintilla/lexlib --include-dir ../../src/stc/scintilla/src --define __WX__ --define SCI_LEXER --define NO_CXX11_REGEX --define LINK_LEXERS --define wxUSE_BASE=1 --define WXMAKINGDLL @@ -11680,6 +11693,11 @@ $(OBJS)\monolib_calctrlg.o: ../../src/generic/calctrlg.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\monolib_creddlgg.o: ../../src/generic/creddlgg.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +endif + $(OBJS)\basedll_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(BASEDLL_CXXFLAGS) $(CPPDEPS) $< @@ -14197,6 +14215,11 @@ $(OBJS)\coredll_calctrlg.o: ../../src/generic/calctrlg.cpp $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\coredll_creddlgg.o: ../../src/generic/creddlgg.cpp + $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< +endif + $(OBJS)\corelib_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< @@ -15925,6 +15948,11 @@ $(OBJS)\corelib_calctrlg.o: ../../src/generic/calctrlg.cpp $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\corelib_creddlgg.o: ../../src/generic/creddlgg.cpp + $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< +endif + $(OBJS)\advdll_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(ADVDLL_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index 0541f24c52..ab3f90cd4e 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -2451,7 +2451,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.obj \ $(OBJS)\monodll_editlbox.obj \ $(OBJS)\monodll_laywin.obj \ - $(OBJS)\monodll_calctrlg.obj + $(OBJS)\monodll_calctrlg.obj \ + $(OBJS)\monodll_creddlgg.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_OBJECTS = \ @@ -2776,7 +2777,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.obj \ $(OBJS)\monodll_editlbox.obj \ $(OBJS)\monodll_laywin.obj \ - $(OBJS)\monodll_calctrlg.obj + $(OBJS)\monodll_calctrlg.obj \ + $(OBJS)\monodll_creddlgg.obj !endif !if "$(USE_STC)" == "1" ____MONOLIB_STC_SRC_FILENAMES_OBJECTS = \ @@ -3286,7 +3288,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.obj \ $(OBJS)\monolib_editlbox.obj \ $(OBJS)\monolib_laywin.obj \ - $(OBJS)\monolib_calctrlg.obj + $(OBJS)\monolib_calctrlg.obj \ + $(OBJS)\monolib_creddlgg.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_1_OBJECTS = \ @@ -3611,7 +3614,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.obj \ $(OBJS)\monolib_editlbox.obj \ $(OBJS)\monolib_laywin.obj \ - $(OBJS)\monolib_calctrlg.obj + $(OBJS)\monolib_calctrlg.obj \ + $(OBJS)\monolib_creddlgg.obj !endif !if "$(USE_STC)" == "1" ____MONOLIB_STC_SRC_FILENAMES_1_OBJECTS = \ @@ -4056,7 +4060,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.obj \ $(OBJS)\coredll_editlbox.obj \ $(OBJS)\coredll_laywin.obj \ - $(OBJS)\coredll_calctrlg.obj + $(OBJS)\coredll_calctrlg.obj \ + $(OBJS)\coredll_creddlgg.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_2_OBJECTS = \ @@ -4381,7 +4386,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.obj \ $(OBJS)\coredll_editlbox.obj \ $(OBJS)\coredll_laywin.obj \ - $(OBJS)\coredll_calctrlg.obj + $(OBJS)\coredll_calctrlg.obj \ + $(OBJS)\coredll_creddlgg.obj !endif !if "$(MONOLITHIC)" == "0" && "$(SHARED)" == "0" && "$(USE_GUI)" == "1" __corelib___depname = \ @@ -4732,7 +4738,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.obj \ $(OBJS)\corelib_editlbox.obj \ $(OBJS)\corelib_laywin.obj \ - $(OBJS)\corelib_calctrlg.obj + $(OBJS)\corelib_calctrlg.obj \ + $(OBJS)\corelib_creddlgg.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_3_OBJECTS = \ @@ -5057,7 +5064,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.obj \ $(OBJS)\corelib_editlbox.obj \ $(OBJS)\corelib_laywin.obj \ - $(OBJS)\corelib_calctrlg.obj + $(OBJS)\corelib_calctrlg.obj \ + $(OBJS)\corelib_creddlgg.obj !endif !if "$(SHARED)" == "1" ____wxcore_namedll_DEP = $(__coredll___depname) @@ -9660,6 +9668,11 @@ $(OBJS)\monodll_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monodll_creddlgg.obj: ..\..\src\generic\creddlgg.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\creddlgg.cpp +!endif + $(OBJS)\monodll_version.res: ..\..\src\msw\version.rc rc /fo$@ /d WIN32 $(____DEBUGRUNTIME_6) /d _CRT_SECURE_NO_DEPRECATE=1 /d _CRT_NON_CONFORMING_SWPRINTFS=1 /d _SCL_SECURE_NO_WARNINGS=1 $(__NO_VC_CRTDBG_p_72) /d __WXMSW__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_66) $(__NDEBUG_DEFINE_p_65) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) $(__UNICODE_DEFINE_p_67) /i $(SETUPHDIR) /i ..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_4) /d WXBUILDING /d WXDLLNAME=wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG) /i ..\..\src\tiff\libtiff /i ..\..\src\jpeg /i ..\..\src\png /i ..\..\src\zlib /i ..\..\src\regex /i ..\..\src\expat\expat\lib /i ..\..\src\stc\scintilla\include /i ..\..\src\stc\scintilla\lexlib /i ..\..\src\stc\scintilla\src /d __WX__ /d SCI_LEXER /d NO_CXX11_REGEX /d LINK_LEXERS /d wxUSE_BASE=1 /d WXMAKINGDLL ..\..\src\msw\version.rc @@ -12207,6 +12220,11 @@ $(OBJS)\monolib_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monolib_creddlgg.obj: ..\..\src\generic\creddlgg.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\creddlgg.cpp +!endif + $(OBJS)\basedll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(BASEDLL_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp @@ -14724,6 +14742,11 @@ $(OBJS)\coredll_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\coredll_creddlgg.obj: ..\..\src\generic\creddlgg.cpp + $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\generic\creddlgg.cpp +!endif + $(OBJS)\corelib_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp @@ -16452,6 +16475,11 @@ $(OBJS)\corelib_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\corelib_creddlgg.obj: ..\..\src\generic\creddlgg.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\generic\creddlgg.cpp +!endif + $(OBJS)\advdll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(ADVDLL_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp diff --git a/build/msw/wx_core.vcxproj b/build/msw/wx_core.vcxproj index bf3ea86b5a..0d36e815ac 100644 --- a/build/msw/wx_core.vcxproj +++ b/build/msw/wx_core.vcxproj @@ -1061,6 +1061,7 @@ + @@ -1497,6 +1498,8 @@ + + diff --git a/build/msw/wx_core.vcxproj.filters b/build/msw/wx_core.vcxproj.filters index 7e17bd7ad0..cd1a1b8095 100644 --- a/build/msw/wx_core.vcxproj.filters +++ b/build/msw/wx_core.vcxproj.filters @@ -501,6 +501,9 @@ Generic Sources + + Generic Sources + Generic Sources @@ -1195,6 +1198,9 @@ Common Headers + + Common Headers + Common Headers @@ -1381,6 +1387,9 @@ Generic Headers + + Generic Headers + Generic Headers diff --git a/build/msw/wx_vc7_core.vcproj b/build/msw/wx_vc7_core.vcproj index a161fe794c..905c9960b5 100644 --- a/build/msw/wx_vc7_core.vcproj +++ b/build/msw/wx_vc7_core.vcproj @@ -1184,6 +1184,9 @@ + + @@ -1845,6 +1848,9 @@ + + @@ -2192,6 +2198,9 @@ + + diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj index 701ec8da4e..eec9cbc66a 100644 --- a/build/msw/wx_vc8_core.vcproj +++ b/build/msw/wx_vc8_core.vcproj @@ -1991,6 +1991,10 @@ RelativePath="..\..\src\generic\commandlinkbuttong.cpp" > + + @@ -2962,6 +2966,10 @@ RelativePath="..\..\include\wx\generic\combo.h" > + + @@ -3424,6 +3432,10 @@ RelativePath="..\..\include\wx\ribbon\control.h" > + + diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj index c235625f90..a27fc40bc0 100644 --- a/build/msw/wx_vc9_core.vcproj +++ b/build/msw/wx_vc9_core.vcproj @@ -1987,6 +1987,10 @@ RelativePath="..\..\src\generic\commandlinkbuttong.cpp" > + + @@ -2958,6 +2962,10 @@ RelativePath="..\..\include\wx\generic\combo.h" > + + @@ -3420,6 +3428,10 @@ RelativePath="..\..\include\wx\ribbon\control.h" > + + diff --git a/configure b/configure index dffae7b78c..60db7082ed 100755 --- a/configure +++ b/configure @@ -1298,6 +1298,7 @@ enable_commondlg enable_aboutdlg enable_choicedlg enable_coldlg +enable_creddlg enable_filedlg enable_finddlg enable_fontdlg @@ -2240,6 +2241,7 @@ Optional Features: --enable-aboutdlg use wxAboutBox --enable-choicedlg use wxChoiceDialog --enable-coldlg use wxColourDialog + --enable-creddlg use wxCredentialEntryDialog --enable-filedlg use wxFileDialog --enable-finddlg use wxFindReplaceDialog --enable-fontdlg use wxFontDialog @@ -11277,6 +11279,35 @@ fi eval "$wx_cv_use_coldlg" + enablestring= + defaultval=$wxUSE_ALL_FEATURES + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + # Check whether --enable-creddlg was given. +if test "${enable_creddlg+set}" = set; then : + enableval=$enable_creddlg; + if test "$enableval" = yes; then + wx_cv_use_creddlg='wxUSE_CREDENTIALDLG=yes' + else + wx_cv_use_creddlg='wxUSE_CREDENTIALDLG=no' + fi + +else + + wx_cv_use_creddlg='wxUSE_CREDENTIALDLG=${'DEFAULT_wxUSE_CREDENTIALDLG":-$defaultval}" + +fi + + + eval "$wx_cv_use_creddlg" + + enablestring= defaultval=$wxUSE_ALL_FEATURES if test -z "$defaultval"; then @@ -38088,6 +38119,11 @@ if test "$wxUSE_COLOURDLG" = "yes"; then fi +if test "$wxUSE_CREDENTIALDLG" = "yes"; then + $as_echo "#define wxUSE_CREDENTIALDLG 1" >>confdefs.h + +fi + if test "$wxUSE_FILEDLG" = "yes"; then $as_echo "#define wxUSE_FILEDLG 1" >>confdefs.h diff --git a/configure.in b/configure.in index 3ca104240e..b632b2c84c 100644 --- a/configure.in +++ b/configure.in @@ -970,6 +970,7 @@ WX_ARG_FEATURE(commondlg, [ --enable-commondlg use all common dialogs], WX_ARG_FEATURE(aboutdlg, [ --enable-aboutdlg use wxAboutBox], wxUSE_ABOUTDLG) WX_ARG_FEATURE(choicedlg, [ --enable-choicedlg use wxChoiceDialog], wxUSE_CHOICEDLG) WX_ARG_FEATURE(coldlg, [ --enable-coldlg use wxColourDialog], wxUSE_COLOURDLG) +WX_ARG_FEATURE(creddlg, [ --enable-creddlg use wxCredentialEntryDialog], wxUSE_CREDENTIALDLG) WX_ARG_FEATURE(filedlg, [ --enable-filedlg use wxFileDialog], wxUSE_FILEDLG) WX_ARG_FEATURE(finddlg, [ --enable-finddlg use wxFindReplaceDialog], wxUSE_FINDREPLDLG) WX_ARG_FEATURE(fontdlg, [ --enable-fontdlg use wxFontDialog], wxUSE_FONTDLG) @@ -7374,6 +7375,10 @@ if test "$wxUSE_COLOURDLG" = "yes"; then AC_DEFINE(wxUSE_COLOURDLG) fi +if test "$wxUSE_CREDENTIALDLG" = "yes"; then + AC_DEFINE(wxUSE_CREDENTIALDLG) +fi + if test "$wxUSE_FILEDLG" = "yes"; then AC_DEFINE(wxUSE_FILEDLG) fi diff --git a/docs/doxygen/overviews/commondialogs.h b/docs/doxygen/overviews/commondialogs.h index e1affa2f63..6cf03ab906 100644 --- a/docs/doxygen/overviews/commondialogs.h +++ b/docs/doxygen/overviews/commondialogs.h @@ -214,6 +214,16 @@ is obtained using wxNumberEntryDialog::GetValue(). +@section overview_cmndlg_cred wxCredentialEntryDialog Overview + +Classes: wxCredentialEntryDialog + +This is a dialog with a user and password entry field. The values that the +users entered is obtained using wxCredentialEntryDialog::GetUser() and +wxCredentialEntryDialog::GetPassword(). + + + @section overview_cmndlg_msg wxMessageDialog Overview Classes: wxMessageDialog diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index 272e381944..5ae9543714 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -1299,6 +1299,9 @@ // number entry dialog #define wxUSE_NUMBERDLG 1 +// credential entry dialog +#define wxUSE_CREDENTIALDLG 1 + // splash screen class #define wxUSE_SPLASH 1 diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index 3a100bd3bf..d4db96bd15 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -2128,6 +2128,7 @@ # if wxUSE_FONTDLG || \ wxUSE_FILEDLG || \ wxUSE_CHOICEDLG || \ + wxUSE_CREDENTIALDLG || \ wxUSE_NUMBERDLG || \ wxUSE_TEXTDLG || \ wxUSE_DIRDLG || \ diff --git a/include/wx/creddlg.h b/include/wx/creddlg.h new file mode 100644 index 0000000000..13c8c7200f --- /dev/null +++ b/include/wx/creddlg.h @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/creddlg.h +// Purpose: wxCredentialEntryDialog interface +// Author: Tobias Taschner +// Created: 2018-10-23 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_CREDDLG_H_BASE +#define _WX_CREDDLG_H_BASE + +#include "wx/generic/creddlgg.h" + +#endif // _WX_CREDDLG_H_BASE diff --git a/include/wx/generic/creddlgg.h b/include/wx/generic/creddlgg.h new file mode 100644 index 0000000000..64c4e97199 --- /dev/null +++ b/include/wx/generic/creddlgg.h @@ -0,0 +1,55 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/generic/creddlgg.h +// Purpose: wxGenericCredentialEntryDialog interface +// Author: Tobias Taschner +// Created: 2018-10-23 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_CREDDLGG_H_BASE +#define _WX_CREDDLGG_H_BASE + +#include "wx/defs.h" + +#if wxUSE_CREDENTIALDLG + +#include "wx/dialog.h" + +class WXDLLIMPEXP_CORE wxGenericCredentialEntryDialog : public wxDialog +{ +public: + wxGenericCredentialEntryDialog(); + + wxGenericCredentialEntryDialog(wxWindow* parent, const wxString& message, + const wxString& title, + const wxString& user = "", + const wxString& password = ""); + + bool Create(wxWindow* parent, const wxString& message, + const wxString& title, + const wxString& user = "", + const wxString& password = ""); + + wxString GetUser() const { return m_userTextCtrl->GetValue(); } + void SetUser(const wxString& user) { m_userTextCtrl->SetValue(user); } + + wxString GetPassword() const { return m_passwordTextCtrl->GetValue(); } + void SetPassword(const wxString& password) + { m_passwordTextCtrl->SetValue(password); } + +private: + wxTextCtrl* m_userTextCtrl; + wxTextCtrl* m_passwordTextCtrl; + + void Init(const wxString& message, + const wxString& user, + const wxString& password); +}; + +// Add this typedef as long as the generic version is the only one available +typedef wxGenericCredentialEntryDialog wxCredentialEntryDialog; + +#endif // wxUSE_CREDENTIALDLG + +#endif // _WX_CREDDLGG_H_BASE diff --git a/include/wx/gtk/setup0.h b/include/wx/gtk/setup0.h index 7bedbed0c4..ddb2d2688a 100644 --- a/include/wx/gtk/setup0.h +++ b/include/wx/gtk/setup0.h @@ -1300,6 +1300,9 @@ // number entry dialog #define wxUSE_NUMBERDLG 1 +// credential entry dialog +#define wxUSE_CREDENTIALDLG 1 + // splash screen class #define wxUSE_SPLASH 1 diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index bf71fa4aa3..d7e39b324e 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -1300,6 +1300,9 @@ // number entry dialog #define wxUSE_NUMBERDLG 1 +// credential entry dialog +#define wxUSE_CREDENTIALDLG 1 + // splash screen class #define wxUSE_SPLASH 1 diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 1b6b30d7a6..d4560537bf 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -1300,6 +1300,9 @@ // number entry dialog #define wxUSE_NUMBERDLG 1 +// credential entry dialog +#define wxUSE_CREDENTIALDLG 1 + // splash screen class #define wxUSE_SPLASH 1 diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index 0b1849a279..89d1fae92c 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -1306,6 +1306,9 @@ // number entry dialog #define wxUSE_NUMBERDLG 1 +// credential entry dialog +#define wxUSE_CREDENTIALDLG 1 + // splash screen class #define wxUSE_SPLASH 1 @@ -1628,13 +1631,6 @@ // make sure we have the proper dispatcher for the console event loop #define wxUSE_SELECT_DISPATCHER 1 #define wxUSE_EPOLL_DISPATCHER 0 - -// set to 1 if you have older code that still needs icon refs -#define wxOSX_USE_ICONREF 0 - -// set to 0 if you have code that has problems with the new bitmap implementation -#define wxOSX_BITMAP_NATIVE_ACCESS 1 - /* --- end OSX options --- */ #endif diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index f8b9346a32..cad052ed0c 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -1296,6 +1296,9 @@ // number entry dialog #define wxUSE_NUMBERDLG 1 +// credential entry dialog +#define wxUSE_CREDENTIALDLG 1 + // splash screen class #define wxUSE_SPLASH 1 diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index f540e5816d..9028fe95fc 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -1299,6 +1299,9 @@ // number entry dialog #define wxUSE_NUMBERDLG 1 +// credential entry dialog +#define wxUSE_CREDENTIALDLG 1 + // splash screen class #define wxUSE_SPLASH 1 diff --git a/interface/wx/creddlg.h b/interface/wx/creddlg.h new file mode 100644 index 0000000000..cf67cc4821 --- /dev/null +++ b/interface/wx/creddlg.h @@ -0,0 +1,83 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: creddlg.h +// Created: 2018-10-23 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +/** + @class wxCredentialEntryDialog + + This class represents a dialog that requests a user name and a password + from the user. It is implemented as a generic wxWidgets dialog on all + platforms. + + @note For secure saving and loading, user and passwords have a look at + wxSecretStore. + + @since 3.1.2 + + @library{wxcore} + @category{cmndlg} + + @see @ref overview_cmndlg_cred +*/ +class wxCredentialEntryDialog: public wxDialog +{ +public: + /** + Default constructor. + + Call Create() to really create the dialog later. + */ + wxCredentialEntryDialog(); + + /** + Constructor. + + Use ShowModal() to show the dialog. + + See Create() method for parameter description. + */ + wxCredentialEntryDialog(wxWindow* parent, const wxString& message, + const wxString& title, + const wxString& user = "", + const wxString& password = ""); + + /** + @param parent + Parent window. + @param message + Message to show on the dialog. + @param title + The title of the dialog. + @param user + The default user value. + @param password + The default password. + */ + bool Create(wxWindow* parent, const wxString& message, + const wxString& title, + const wxString& user = "", + const wxString& password = ""); + + /** + Returns the entered user name. + */ + wxString GetUser() const; + + /** + Sets the current user name. + */ + void SetUser(const wxString& user); + + /** + Returns the entered password. + */ + wxString GetPassword() const; + + /** + Sets the current password. + */ + void SetPassword(const wxString& password); +}; diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 578bb940ce..223a1e2eac 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -110,6 +110,10 @@ #include "dialogs.h" +#if wxUSE_CREDENTIALDLG + #include "wx/creddlg.h" +#endif + #if USE_COLOURDLG_GENERIC #include "wx/generic/colrdlgg.h" #endif // USE_COLOURDLG_GENERIC @@ -168,6 +172,10 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(DIALOGS_PASSWORD_ENTRY, MyFrame::PasswordEntry) #endif // wxUSE_TEXTDLG +#if wxUSE_CREDENTIALDLG + EVT_MENU(DIALOGS_CREDENTIAL_ENTRY, MyFrame::CredentialEntry) +#endif // wxUSE_CREDENTIALDLG + #if wxUSE_NUMBERDLG EVT_MENU(DIALOGS_NUM_ENTRY, MyFrame::NumericEntry) #endif // wxUSE_NUMBERDLG @@ -444,7 +452,7 @@ bool MyApp::OnInit() #endif // wxUSE_COLOURDLG || wxUSE_FONTDLG || wxUSE_CHOICEDLG -#if wxUSE_TEXTDLG || wxUSE_NUMBERDLG +#if wxUSE_TEXTDLG || wxUSE_NUMBERDLG || wxUSE_CREDENTIALDLG wxMenu *entry_menu = new wxMenu; @@ -454,6 +462,10 @@ bool MyApp::OnInit() entry_menu->Append(DIALOGS_PASSWORD_ENTRY, "&Password entry\tCtrl-P"); #endif // wxUSE_TEXTDLG + #if wxUSE_CREDENTIALDLG + entry_menu->Append(DIALOGS_CREDENTIAL_ENTRY, "&Credential entry\tShift-Ctrl-C"); + #endif // wxUSE_CREDENTIALDLG + #if wxUSE_NUMBERDLG entry_menu->Append(DIALOGS_NUM_ENTRY, "&Numeric entry\tCtrl-N"); #endif // wxUSE_NUMBERDLG @@ -1083,6 +1095,20 @@ void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event)) } #endif // wxUSE_TEXTDLG +#if wxUSE_CREDENTIALDLG +void MyFrame::CredentialEntry(wxCommandEvent& WXUNUSED(event)) +{ + wxCredentialEntryDialog dialog(this, "A login is required", "Credentials"); + if (dialog.ShowModal() == wxID_OK) + { + wxMessageBox( + wxString::Format("User: %s Password: %s", + dialog.GetUser(), dialog.GetPassword()), + "Credentials", wxOK | wxICON_INFORMATION, this); + } +} +#endif // wxUSE_CREDENTIALDLG + #if wxUSE_CHOICEDLG void MyFrame::SingleChoice(wxCommandEvent& WXUNUSED(event) ) { diff --git a/samples/dialogs/dialogs.h b/samples/dialogs/dialogs.h index 9d37f4b69b..bb0427e1fb 100644 --- a/samples/dialogs/dialogs.h +++ b/samples/dialogs/dialogs.h @@ -413,6 +413,10 @@ public: void PasswordEntry(wxCommandEvent& event); #endif // wxUSE_TEXTDLG +#ifdef wxUSE_CREDENTIALDLG + void CredentialEntry(wxCommandEvent& event); +#endif // wxUSE_CREDENTIALDLG + #if wxUSE_NUMBERDLG void NumericEntry(wxCommandEvent& event); #endif // wxUSE_NUMBERDLG @@ -579,6 +583,7 @@ enum DIALOGS_LINE_ENTRY, DIALOGS_TEXT_ENTRY, DIALOGS_PASSWORD_ENTRY, + DIALOGS_CREDENTIAL_ENTRY, DIALOGS_FILE_OPEN, DIALOGS_FILE_OPEN2, DIALOGS_FILES_OPEN, diff --git a/setup.h.in b/setup.h.in index 48cf6734e7..792e771fd3 100644 --- a/setup.h.in +++ b/setup.h.in @@ -524,6 +524,8 @@ #define wxUSE_NUMBERDLG 0 +#define wxUSE_CREDENTIALDLG 0 + #define wxUSE_SPLASH 0 #define wxUSE_WIZARDDLG 0 diff --git a/src/generic/creddlgg.cpp b/src/generic/creddlgg.cpp new file mode 100644 index 0000000000..5415de6c3c --- /dev/null +++ b/src/generic/creddlgg.cpp @@ -0,0 +1,77 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/generic/creddlgg.h +// Purpose: wxGenericCredentialEntryDialog implementation +// Author: Tobias Taschner +// Created: 2018-10-23 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#if wxUSE_CREDENTIALDLG + +#ifndef WX_PRECOMP + #include "wx/dialog.h" + #include "wx/button.h" + #include "wx/stattext.h" + #include "wx/textctrl.h" + #include "wx/intl.h" + #include "wx/sizer.h" +#endif + +#include "wx/generic/creddlgg.h" + +wxGenericCredentialEntryDialog::wxGenericCredentialEntryDialog() +{ +} + +wxGenericCredentialEntryDialog::wxGenericCredentialEntryDialog( + wxWindow* parent, const wxString& message, const wxString& title, + const wxString& user, const wxString& password): + wxDialog(parent, wxID_ANY, title) +{ + Init(message, user, password); +} + +bool wxGenericCredentialEntryDialog::Create(wxWindow* parent, + const wxString& message, const wxString& title, const wxString& user, + const wxString& password) +{ + if ( !wxDialog::Create(parent, wxID_ANY, title) ) + return false; + + Init(message, user, password); + return true; +} + +void wxGenericCredentialEntryDialog::Init(const wxString& message, + const wxString& user, const wxString& password) +{ + wxSizer* topsizer = new wxBoxSizer(wxVERTICAL); + + topsizer->Add(CreateTextSizer(message), wxSizerFlags().Border()); + + topsizer->Add(new wxStaticText(this, wxID_ANY, _("Username:")), + wxSizerFlags().Border(wxLEFT | wxRIGHT)); + m_userTextCtrl = new wxTextCtrl(this, wxID_ANY, user, wxDefaultPosition, wxSize(FromDIP(300), wxDefaultCoord)); + topsizer->Add(m_userTextCtrl, wxSizerFlags().Expand().Border()); + + topsizer->Add(new wxStaticText(this, wxID_ANY, _("Password:")), + wxSizerFlags().Border(wxLEFT | wxRIGHT)); + m_passwordTextCtrl = new wxTextCtrl(this, wxID_ANY, password, + wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD); + topsizer->Add(m_passwordTextCtrl, wxSizerFlags().Expand().Border()); + + topsizer->Add(CreateStdDialogButtonSizer(wxOK | wxCANCEL), wxSizerFlags().Expand().Border()); + SetSizerAndFit(topsizer); + + m_userTextCtrl->SetFocus(); +} + +#endif // wxUSE_CREDENTIALDLG From 701f697fa4af9c47838a3e10fdc39b346e97706c Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Tue, 23 Oct 2018 22:27:14 +0200 Subject: [PATCH 016/218] Change wxWebRequest API to use STATE event --- include/wx/webrequest.h | 38 +++++++++++------ samples/webrequest/webrequest.cpp | 57 +++++++++++++------------ src/common/webrequest.cpp | 71 ++++++++++++------------------- src/msw/webrequest_winhttp.cpp | 18 ++++---- 4 files changed, 91 insertions(+), 93 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 032f5436b5..00cc2cecae 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -32,9 +32,18 @@ public: enum State { State_Idle, + State_Unauthorized, + State_UnauthorizedProxy, State_Active, - State_Ready, - State_Failed + State_Completed, + State_Failed, + State_Cancelled + }; + + enum CredentialTarget + { + CredentialTarget_Server, + CredentialTarget_Proxy }; virtual ~wxWebRequest() { } @@ -48,6 +57,9 @@ public: void SetData(wxSharedPtr dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); + void SetCredentials(const wxString& user, const wxString& password, + CredentialTarget target); + void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } virtual void Start() = 0; @@ -79,13 +91,10 @@ protected: private: int m_id; State m_state; - wxString m_failMessage; bool m_ignoreServerErrorStatus; wxCharBuffer m_dataText; - void ProcessReadyEvent(); - - void ProcessFailedEvent(); + void ProcessStateEvent(State state, const wxString& failMsg); wxDECLARE_NO_COPY_CLASS(wxWebRequest); }; @@ -167,12 +176,14 @@ class WXDLLIMPEXP_NET wxWebRequestEvent : public wxEvent { public: wxWebRequestEvent() {} - wxWebRequestEvent(wxEventType type, int id, wxWebResponse* response = NULL, - const wxString& errorDesc = "") + wxWebRequestEvent(wxEventType type, int id, wxWebRequest::State state, + wxWebResponse* response = NULL, const wxString& errorDesc = "") : wxEvent(id, type), - m_response(response), m_errorDescription(errorDesc) + m_state(state), m_response(response), m_errorDescription(errorDesc) { } + wxWebRequest::State GetState() const { return m_state; } + wxWebResponse* GetResponse() const { return m_response; } const wxString& GetErrorDescription() const { return m_errorDescription; } @@ -180,14 +191,15 @@ public: wxEvent* Clone() const wxOVERRIDE { return new wxWebRequestEvent(*this); } private: + wxWebRequest::State m_state; wxWebResponse* m_response; wxString m_errorDescription; }; -wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_READY, wxWebRequestEvent); -wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_FAILED, wxWebRequestEvent); -wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_AUTH_REQUIRED, wxWebRequestEvent); - +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_STATE, wxWebRequestEvent); +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_DATA, wxWebRequestEvent); +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_DOWNLOAD_PROGRESS, wxWebRequestEvent); +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_UPLOAD_PROGRESS, wxWebRequestEvent); #endif // wxUSE_WEBREQUEST diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index d6225ee74b..e2ceb6f354 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -136,8 +136,8 @@ public: wxObjectDataPtr request(wxWebSession::GetDefault().CreateRequest( m_urlTextCtrl->GetValue())); - // Bind event for failure - request->Bind(wxEVT_WEBREQUEST_FAILED, &WebRequestFrame::OnWebRequestFailed, this); + // Bind event for state change + request->Bind(wxEVT_WEBREQUEST_STATE, &WebRequestFrame::OnWebRequestState, this); // Prepare request based on selected action switch (m_notebook->GetSelection()) @@ -145,8 +145,6 @@ public: case Page_Image: // Reset static bitmap image m_imageStaticBitmap->SetBitmap(wxArtProvider::GetBitmap(wxART_MISSING_IMAGE)); - // Bind completion event to response as image - request->Bind(wxEVT_WEBREQUEST_READY, &WebRequestFrame::OnImageRequestReady, this); break; case Page_Text: // Reset response text control @@ -158,8 +156,6 @@ public: request->SetData(m_postRequestTextCtrl->GetValue(), m_postContentTypeTextCtrl->GetValue()); } - - request->Bind(wxEVT_WEBREQUEST_READY, &WebRequestFrame::OnTextRequestReady, this); break; case Page_Download: // TODO: implement @@ -175,30 +171,37 @@ public: request->Start(); } - void OnImageRequestReady(wxWebRequestEvent& evt) + void OnWebRequestState(wxWebRequestEvent& evt) { - wxImage img(*evt.GetResponse()->GetStream()); - m_imageStaticBitmap->SetBitmap(img); - m_notebook->GetPage(Page_Image)->Layout(); - GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes image data", evt.GetResponse()->GetContentLength())); - m_startButton->Enable(); - } + m_startButton->Enable(evt.GetState() != wxWebRequest::State_Active); - void OnTextRequestReady(wxWebRequestEvent& evt) - { - m_textResponseTextCtrl->SetValue(evt.GetResponse()->AsString()); - GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes text data (Status: %d %s)", - evt.GetResponse()->GetContentLength(), - evt.GetResponse()->GetStatus(), - evt.GetResponse()->GetStatusText())); - m_startButton->Enable(); - } + switch (evt.GetState()) + { + case wxWebRequest::State_Completed: + switch (m_notebook->GetSelection()) + { + case Page_Image: + { + wxImage img(*evt.GetResponse()->GetStream()); + m_imageStaticBitmap->SetBitmap(img); + m_notebook->GetPage(Page_Image)->Layout(); + GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes image data", evt.GetResponse()->GetContentLength())); + break; + } + case Page_Text: + m_textResponseTextCtrl->SetValue(evt.GetResponse()->AsString()); + GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes text data (Status: %d %s)", + evt.GetResponse()->GetContentLength(), + evt.GetResponse()->GetStatus(), + evt.GetResponse()->GetStatusText())); + break; + } - void OnWebRequestFailed(wxWebRequestEvent& evt) - { - wxLogError("Web Request failed: %s", evt.GetErrorDescription()); - GetStatusBar()->SetStatusText(""); - m_startButton->Enable(); + break; + case wxWebRequest::State_Failed: + wxLogError("Web Request failed: %s", evt.GetErrorDescription()); + GetStatusBar()->SetStatusText(""); + } } void OnPostCheckBox(wxCommandEvent& WXUNUSED(evt)) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 8ab49bd37e..c70bbb18d6 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -36,9 +36,10 @@ extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[] = "wxWebSessio extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[] = "wxWebSessionBackendWinHTTP"; #endif -wxDEFINE_EVENT(wxEVT_WEBREQUEST_READY, wxWebRequestEvent); -wxDEFINE_EVENT(wxEVT_WEBREQUEST_FAILED, wxWebRequestEvent); -wxDEFINE_EVENT(wxEVT_WEBREQUEST_AUTH_REQUIRED, wxWebRequestEvent); +wxDEFINE_EVENT(wxEVT_WEBREQUEST_STATE, wxWebRequestEvent); +wxDEFINE_EVENT(wxEVT_WEBREQUEST_DATA, wxWebRequestEvent); +wxDEFINE_EVENT(wxEVT_WEBREQUEST_DOWNLOAD_PROGRESS, wxWebRequestEvent); +wxDEFINE_EVENT(wxEVT_WEBREQUEST_UPLOAD_PROGRESS, wxWebRequestEvent); // // wxWebRequest @@ -56,13 +57,13 @@ bool wxWebRequest::CheckServerStatus() return true; } -void wxWebRequest::SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv) +void wxWebRequest::SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv) { m_dataText = text.mb_str(conv); SetData(wxSharedPtr(new wxMemoryInputStream(m_dataText, m_dataText.length())), contentType); -} - -void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString& contentType, wxFileOffset dataSize) +} + +void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString& contentType, wxFileOffset dataSize) { m_dataStream = dataStream; if ( m_dataStream.get() ) @@ -80,51 +81,33 @@ void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString m_dataSize = 0; SetHeader("Content-Type", contentType); -} - +} + +void wxWebRequest::SetCredentials(const wxString & user, const wxString & password, CredentialTarget target) +{ + wxFAIL_MSG("not implemented"); +} + void wxWebRequest::SetState(State state, const wxString & failMsg) { - switch (state) - { - case State_Active: - // Add a reference while the request is active - if ( m_state != State_Active ) - { - IncRef(); - m_state = state; - } - break; - case State_Ready: - // Trigger the ready event in main thread - CallAfter(&wxWebRequest::ProcessReadyEvent); - break; - case State_Failed: - m_failMessage = failMsg; - // Trigger the failed event in main thread - CallAfter(&wxWebRequest::ProcessFailedEvent); - break; - } + // Add a reference while the request is active + if (state == State_Active && m_state != State_Active) + IncRef(); + + // Trigger the event in the main thread + CallAfter(&wxWebRequest::ProcessStateEvent, state, failMsg); } -void wxWebRequest::ProcessReadyEvent() +void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) { - wxWebRequestEvent evt(wxEVT_WEBREQUEST_READY, GetId(), GetResponse()); + wxWebRequestEvent evt(wxEVT_WEBREQUEST_STATE, GetId(), state, + GetResponse(), failMsg); ProcessEvent(evt); // Remove reference after the request is no longer active - if ( m_state == State_Active ) + if (state == State_Completed || state == State_Failed || + state == State_Cancelled) DecRef(); - m_state = State_Ready; -} - -void wxWebRequest::ProcessFailedEvent() -{ - wxWebRequestEvent evt(wxEVT_WEBREQUEST_FAILED, GetId(), NULL, - m_failMessage); - ProcessEvent(evt); - // Remove reference after the request is no longer active - if ( m_state == State_Active ) - DecRef(); - m_state = State_Failed; + m_state = state; } // diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 359644676b..f813cf37b2 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -180,7 +180,7 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, else { m_response->ReportDataComplete(); - SetState(State_Ready); + SetState(State_Completed); } break; case WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE: @@ -195,7 +195,7 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, } } -void wxWebRequestWinHTTP::WriteData() +void wxWebRequestWinHTTP::WriteData() { int dataWriteSize = 8 * 1024; if ( m_dataWritten + dataWriteSize > m_dataSize ) @@ -211,10 +211,10 @@ void wxWebRequestWinHTTP::WriteData() m_dataWritten += dataWriteSize; } else - CreateResponse(); -} - -void wxWebRequestWinHTTP::CreateResponse() + CreateResponse(); +} + +void wxWebRequestWinHTTP::CreateResponse() { if (::WinHttpReceiveResponse(m_request, NULL)) { @@ -228,8 +228,8 @@ void wxWebRequestWinHTTP::CreateResponse() } else SetFailedWithLastError(); -} - +} + void wxWebRequestWinHTTP::SetFailedWithLastError() { wxString failMessage = wxWinHTTPErrorToString(::GetLastError()); @@ -319,7 +319,7 @@ void wxWebRequestWinHTTP::Start() void wxWebRequestWinHTTP::Cancel() { - // TODO: implement + wxFAIL_MSG("not implemented"); } wxWebResponse* wxWebRequestWinHTTP::GetResponse() From 6db3f5f115743fca64dfb50b41d6258c82ca4148 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 24 Oct 2018 23:55:27 +0200 Subject: [PATCH 017/218] Add unit test for wxWebRequest The environment variable WX_TEST_WEBREQUEST_URL has to be set to https://httpbin.org or a local instance of it to be run. --- build/cmake/tests/base/CMakeLists.txt | 1 + tests/Makefile.in | 4 + tests/makefile.bcc | 4 + tests/makefile.gcc | 4 + tests/makefile.vc | 4 + tests/net/webrequest.cpp | 129 ++++++++++++++++++++++++++ tests/test.bkl | 1 + tests/test_vc7_test.vcproj | 3 + tests/test_vc8_test.vcproj | 4 + tests/test_vc9_test.vcproj | 4 + 10 files changed, 158 insertions(+) create mode 100644 tests/net/webrequest.cpp diff --git a/build/cmake/tests/base/CMakeLists.txt b/build/cmake/tests/base/CMakeLists.txt index 9cab7a5079..747a8202ef 100644 --- a/build/cmake/tests/base/CMakeLists.txt +++ b/build/cmake/tests/base/CMakeLists.txt @@ -52,6 +52,7 @@ set(TEST_SRC misc/typeinfotest.cpp net/ipc.cpp net/socket.cpp + net/webrequest.cpp regex/regextest.cpp regex/wxregextest.cpp scopeguard/scopeguardtest.cpp diff --git a/tests/Makefile.in b/tests/Makefile.in index 698e3b0832..e17bfa9086 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -99,6 +99,7 @@ TEST_OBJECTS = \ test_typeinfotest.o \ test_ipc.o \ test_socket.o \ + test_webrequest.o \ test_regextest.o \ test_wxregextest.o \ test_scopeguardtest.o \ @@ -625,6 +626,9 @@ test_ipc.o: $(srcdir)/net/ipc.cpp $(TEST_ODEP) test_socket.o: $(srcdir)/net/socket.cpp $(TEST_ODEP) $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/net/socket.cpp +test_webrequest.o: $(srcdir)/net/webrequest.cpp $(TEST_ODEP) + $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/net/webrequest.cpp + test_regextest.o: $(srcdir)/regex/regextest.cpp $(TEST_ODEP) $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/regex/regextest.cpp diff --git a/tests/makefile.bcc b/tests/makefile.bcc index a0892cbd57..ef3b570077 100644 --- a/tests/makefile.bcc +++ b/tests/makefile.bcc @@ -82,6 +82,7 @@ TEST_OBJECTS = \ $(OBJS)\test_typeinfotest.obj \ $(OBJS)\test_ipc.obj \ $(OBJS)\test_socket.obj \ + $(OBJS)\test_webrequest.obj \ $(OBJS)\test_regextest.obj \ $(OBJS)\test_wxregextest.obj \ $(OBJS)\test_scopeguardtest.obj \ @@ -673,6 +674,9 @@ $(OBJS)\test_ipc.obj: .\net\ipc.cpp $(OBJS)\test_socket.obj: .\net\socket.cpp $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) .\net\socket.cpp +$(OBJS)\test_webrequest.obj: .\net\webrequest.cpp + $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) .\net\webrequest.cpp + $(OBJS)\test_regextest.obj: .\regex\regextest.cpp $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) .\regex\regextest.cpp diff --git a/tests/makefile.gcc b/tests/makefile.gcc index a4e16537b8..c674f1a1c0 100644 --- a/tests/makefile.gcc +++ b/tests/makefile.gcc @@ -74,6 +74,7 @@ TEST_OBJECTS = \ $(OBJS)\test_typeinfotest.o \ $(OBJS)\test_ipc.o \ $(OBJS)\test_socket.o \ + $(OBJS)\test_webrequest.o \ $(OBJS)\test_regextest.o \ $(OBJS)\test_wxregextest.o \ $(OBJS)\test_scopeguardtest.o \ @@ -650,6 +651,9 @@ $(OBJS)\test_ipc.o: ./net/ipc.cpp $(OBJS)\test_socket.o: ./net/socket.cpp $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\test_webrequest.o: ./net/webrequest.cpp + $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\test_regextest.o: ./regex/regextest.cpp $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $< diff --git a/tests/makefile.vc b/tests/makefile.vc index e197998717..4fcebf124f 100644 --- a/tests/makefile.vc +++ b/tests/makefile.vc @@ -77,6 +77,7 @@ TEST_OBJECTS = \ $(OBJS)\test_typeinfotest.obj \ $(OBJS)\test_ipc.obj \ $(OBJS)\test_socket.obj \ + $(OBJS)\test_webrequest.obj \ $(OBJS)\test_regextest.obj \ $(OBJS)\test_wxregextest.obj \ $(OBJS)\test_scopeguardtest.obj \ @@ -864,6 +865,9 @@ $(OBJS)\test_ipc.obj: .\net\ipc.cpp $(OBJS)\test_socket.obj: .\net\socket.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) .\net\socket.cpp +$(OBJS)\test_webrequest.obj: .\net\webrequest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) .\net\webrequest.cpp + $(OBJS)\test_regextest.obj: .\regex\regextest.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) .\regex\regextest.cpp diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp new file mode 100644 index 0000000000..147c3f9e5c --- /dev/null +++ b/tests/net/webrequest.cpp @@ -0,0 +1,129 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: tests/net/webrequest.cpp +// Purpose: wxWebRequest test +// Author: Tobias Taschner +// Created: 2018-10-24 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#include "testprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif // WX_PRECOMP + +#include "wx/webrequest.h" +#include "wx/wfstream.h" + +// This test requires the URL to an httpbin instance. +// httpbin is a HTTP Request & Response Service available at: +// https://httpbin.org +// It can also be run locally via a simple docker run +// +// For this test to run the the base URL has to be specified with +// an environment variable, e.g.: +// WX_TEST_WEBREQUEST_URL=https://httpbin.org + +#if wxUSE_WEBREQUEST + +class RequestFixture +{ +public: + RequestFixture() { } + + void Create(const wxString& subURL) + { + wxString baseURL; + wxGetEnv("WX_TEST_WEBREQUEST_URL", &baseURL); + CreateAbs(baseURL + subURL); + } + + void CreateAbs(const wxString& url) + { + request.reset(wxWebSession::GetDefault().CreateRequest(url)); + request->Bind(wxEVT_WEBREQUEST_STATE, &RequestFixture::OnRequestState, this); + } + + void OnRequestState(wxWebRequestEvent& evt) + { + switch (evt.GetState()) + { + case wxWebRequest::State_Completed: + case wxWebRequest::State_Failed: + case wxWebRequest::State_Cancelled: + loop.Exit(); + break; + } + } + + void Run(wxWebRequest::State requiredState = wxWebRequest::State_Completed, + int requiredStatus = 200) + { + REQUIRE( request->GetState() == wxWebRequest::State_Idle ); + request->Start(); + loop.Run(); + REQUIRE( request->GetState() == requiredState ); + if (requiredStatus) + REQUIRE( request->GetResponse()->GetStatus() == requiredStatus ); + } + + wxEventLoop loop; + wxObjectDataPtr request; +}; + +TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][.]") +{ + wxString baseURL; + if ( !wxGetEnv("WX_TEST_WEBREQUEST_URL", &baseURL) ) + { + WARN("Skipping WebRequest test because required WX_TEST_WEBREQUEST_URL" + " environment variable is not defined."); + return; + } + + SECTION("GET 64kb to memory") + { + Create("/bytes/65536"); + Run(); + REQUIRE( request->GetResponse()->GetContentLength() == 65536 ); + } + + SECTION("GET 404 error") + { + Create("/status/404"); + Run(wxWebRequest::State_Failed, 404); + } + + SECTION("Connect to invalid host") + { + CreateAbs("http://127.0.0.1:51234"); + Run(wxWebRequest::State_Failed, 0); + } + + SECTION("POST form data") + { + Create("/post"); + request->SetData("app=WebRequestSample&version=1", "application/x-www-form-urlencoded"); + Run(); + } + + SECTION("PUT file data") + { + Create("/put"); + request->SetData(wxSharedPtr(new wxFileInputStream("horse.png")), + "image/png"); + request->SetMethod("PUT"); + Run(); + } +} + +#endif // wxUSE_WEBREQUEST diff --git a/tests/test.bkl b/tests/test.bkl index b8c42324c8..24bcabc3c1 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -70,6 +70,7 @@ misc/typeinfotest.cpp net/ipc.cpp net/socket.cpp + net/webrequest.cpp regex/regextest.cpp regex/wxregextest.cpp scopeguard/scopeguardtest.cpp diff --git a/tests/test_vc7_test.vcproj b/tests/test_vc7_test.vcproj index 9443e3b8c9..98b24d250f 100644 --- a/tests/test_vc7_test.vcproj +++ b/tests/test_vc7_test.vcproj @@ -562,6 +562,9 @@ + + diff --git a/tests/test_vc8_test.vcproj b/tests/test_vc8_test.vcproj index d085fdc4a3..c7edd58a5a 100644 --- a/tests/test_vc8_test.vcproj +++ b/tests/test_vc8_test.vcproj @@ -1218,6 +1218,10 @@ RelativePath=".\weakref\weakref.cpp" > + + diff --git a/tests/test_vc9_test.vcproj b/tests/test_vc9_test.vcproj index 4570595312..a8947a97ed 100644 --- a/tests/test_vc9_test.vcproj +++ b/tests/test_vc9_test.vcproj @@ -1190,6 +1190,10 @@ RelativePath=".\weakref\weakref.cpp" > + + From 5f3dc058aac41d01f28f205e1b10bb754b37cddd Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 25 Oct 2018 13:08:51 +0200 Subject: [PATCH 018/218] Prepare additional wxWebRequest backends --- Makefile.in | 79 ++++++++++++++++++++++---- build/bakefiles/files.bkl | 3 + build/cmake/files.cmake | 7 +++ build/cmake/lib/net/CMakeLists.txt | 2 +- build/cmake/options.cmake | 12 ++++ build/cmake/setup.h.in | 24 ++++++++ build/files | 5 ++ build/msw/makefile.bcc | 16 ++++++ build/msw/makefile.gcc | 16 ++++++ build/msw/makefile.vc | 16 ++++++ build/msw/wx_net.vcxproj | 2 + build/msw/wx_net.vcxproj.filters | 6 ++ build/msw/wx_vc7_net.vcproj | 6 ++ build/msw/wx_vc8_net.vcproj | 8 +++ build/msw/wx_vc9_net.vcproj | 8 +++ configure | 5 ++ configure.in | 5 ++ include/wx/android/setup.h | 41 +++++++++++++ include/wx/chkconf.h | 9 +++ include/wx/gtk/setup0.h | 41 +++++++++++++ include/wx/motif/setup0.h | 41 +++++++++++++ include/wx/msw/setup0.h | 41 +++++++++++++ include/wx/osx/setup0.h | 41 +++++++++++++ include/wx/osx/webrequest_urlsession.h | 42 ++++++++++++++ include/wx/setup_inc.h | 41 +++++++++++++ include/wx/univ/setup0.h | 41 +++++++++++++ include/wx/webrequest_curl.h | 37 ++++++++++++ setup.h.in | 24 ++++++++ src/common/webrequest.cpp | 24 +++++++- src/common/webrequest_curl.cpp | 39 +++++++++++++ src/msw/webrequest_winhttp.cpp | 4 +- src/osx/webrequest_urlsession.mm | 42 ++++++++++++++ 32 files changed, 710 insertions(+), 18 deletions(-) create mode 100644 include/wx/osx/webrequest_urlsession.h create mode 100644 include/wx/webrequest_curl.h create mode 100644 src/common/webrequest_curl.cpp create mode 100644 src/osx/webrequest_urlsession.mm diff --git a/Makefile.in b/Makefile.in index b1d92f55df..a309da4ded 100644 --- a/Makefile.in +++ b/Makefile.in @@ -546,6 +546,7 @@ ALL_BASE_HEADERS = \ wx/socket.h \ wx/url.h \ wx/webrequest.h \ + wx/webrequest_curl.h \ wx/xml/xml.h \ wx/xtixml.h ALL_HEADERS = \ @@ -766,6 +767,7 @@ ALL_PORTS_BASE_HEADERS = \ wx/socket.h \ wx/url.h \ wx/webrequest.h \ + wx/webrequest_curl.h \ wx/xml/xml.h \ wx/xtixml.h ALL_BASE_SOURCES = \ @@ -916,9 +918,11 @@ ALL_BASE_SOURCES = \ src/common/socket.cpp \ src/common/url.cpp \ src/common/webrequest.cpp \ + src/common/webrequest_curl.cpp \ src/common/socketiohandler.cpp \ src/unix/sockunix.cpp \ src/osx/core/sockosx.cpp \ + src/osx/webrequest_urlsession.mm \ src/msw/sockmsw.cpp \ src/msw/urlmsw.cpp \ src/msw/webrequest_winhttp.cpp \ @@ -1060,6 +1064,7 @@ MONODLL_OBJECTS = \ monodll_socket.o \ monodll_url.o \ monodll_webrequest.o \ + monodll_webrequest_curl.o \ $(__NET_PLATFORM_SRC_OBJECTS) \ $(__MONOLIB_GUI_SRC_OBJECTS) \ monodll_xml.o \ @@ -1203,6 +1208,7 @@ MONOLIB_OBJECTS = \ monolib_socket.o \ monolib_url.o \ monolib_webrequest.o \ + monolib_webrequest_curl.o \ $(__NET_PLATFORM_SRC_OBJECTS_1) \ $(__MONOLIB_GUI_SRC_OBJECTS_1) \ monolib_xml.o \ @@ -1445,6 +1451,12 @@ NETDLL_CXXFLAGS = $(__netdll_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) $(__INC_REGEX_p) \ $(__INC_EXPAT_p) -DwxUSE_GUI=0 -DWXUSINGDLL -DWXMAKINGDLL_NET $(PIC_FLAG) \ $(CXXWARNINGS) $(CPPFLAGS) $(CXXFLAGS) +NETDLL_OBJCXXFLAGS = $(__netdll_PCH_INC) -D__WX$(TOOLKIT)__ \ + $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ + $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) -DWXBUILDING $(__INC_TIFF_BUILD_p) \ + $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) \ + $(__INC_REGEX_p) $(__INC_EXPAT_p) -DwxUSE_GUI=0 -DWXUSINGDLL \ + -DWXMAKINGDLL_NET $(PIC_FLAG) $(CPPFLAGS) $(OBJCXXFLAGS) NETDLL_OBJECTS = \ $(__netdll___win32rc) \ netdll_fs_inet.o \ @@ -1458,6 +1470,7 @@ NETDLL_OBJECTS = \ netdll_socket.o \ netdll_url.o \ netdll_webrequest.o \ + netdll_webrequest_curl.o \ $(__NET_PLATFORM_SRC_OBJECTS_2) NETDLL_ODEP = $(_____pch_wxprec_netdll_wx_wxprec_h_gch___depname) NETLIB_CXXFLAGS = $(__netlib_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ @@ -1465,6 +1478,11 @@ NETLIB_CXXFLAGS = $(__netlib_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__THREAD_DEFINE_p) -DWXBUILDING $(__INC_TIFF_BUILD_p) $(__INC_TIFF_p) \ $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) $(__INC_REGEX_p) \ $(__INC_EXPAT_p) -DwxUSE_GUI=0 $(CXXWARNINGS) $(CPPFLAGS) $(CXXFLAGS) +NETLIB_OBJCXXFLAGS = $(__netlib_PCH_INC) -D__WX$(TOOLKIT)__ \ + $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ + $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) -DWXBUILDING $(__INC_TIFF_BUILD_p) \ + $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) \ + $(__INC_REGEX_p) $(__INC_EXPAT_p) -DwxUSE_GUI=0 $(CPPFLAGS) $(OBJCXXFLAGS) NETLIB_OBJECTS = \ netlib_fs_inet.o \ netlib_ftp.o \ @@ -1477,6 +1495,7 @@ NETLIB_OBJECTS = \ netlib_socket.o \ netlib_url.o \ netlib_webrequest.o \ + netlib_webrequest_curl.o \ $(__NET_PLATFORM_SRC_OBJECTS_3) NETLIB_ODEP = $(_____pch_wxprec_netlib_wx_wxprec_h_gch___depname) COREDLL_CFLAGS = $(__coredll_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ @@ -4233,9 +4252,12 @@ COND_PLATFORM_WIN32_1___BASE_PLATFORM_SRC_OBJECTS = \ @COND_PLATFORM_WIN32_1@ = monodll_msw_main.o monodll_volume.o @COND_TOOLKIT_OSX_COCOA@__BASE_AND_GUI_TOOLKIT_SRC_OBJECTS \ @COND_TOOLKIT_OSX_COCOA@ = monodll_cocoa_power.o monodll_cocoa_utils.o -@COND_PLATFORM_MACOSX_1@__NET_PLATFORM_SRC_OBJECTS \ -@COND_PLATFORM_MACOSX_1@ = monodll_socketiohandler.o monodll_sockunix.o \ -@COND_PLATFORM_MACOSX_1@ monodll_sockosx.o +COND_PLATFORM_MACOSX_1___NET_PLATFORM_SRC_OBJECTS = \ + monodll_socketiohandler.o \ + monodll_sockunix.o \ + monodll_sockosx.o \ + monodll_webrequest_urlsession.o +@COND_PLATFORM_MACOSX_1@__NET_PLATFORM_SRC_OBJECTS = $(COND_PLATFORM_MACOSX_1___NET_PLATFORM_SRC_OBJECTS) @COND_PLATFORM_UNIX_1@__NET_PLATFORM_SRC_OBJECTS = \ @COND_PLATFORM_UNIX_1@ monodll_socketiohandler.o monodll_sockunix.o @COND_PLATFORM_WIN32_1@__NET_PLATFORM_SRC_OBJECTS = \ @@ -6212,9 +6234,12 @@ COND_PLATFORM_WIN32_1___BASE_PLATFORM_SRC_OBJECTS_1 = \ @COND_PLATFORM_WIN32_1@ = monolib_msw_main.o monolib_volume.o @COND_TOOLKIT_OSX_COCOA@__BASE_AND_GUI_TOOLKIT_SRC_OBJECTS_1 \ @COND_TOOLKIT_OSX_COCOA@ = monolib_cocoa_power.o monolib_cocoa_utils.o -@COND_PLATFORM_MACOSX_1@__NET_PLATFORM_SRC_OBJECTS_1 \ -@COND_PLATFORM_MACOSX_1@ = monolib_socketiohandler.o monolib_sockunix.o \ -@COND_PLATFORM_MACOSX_1@ monolib_sockosx.o +COND_PLATFORM_MACOSX_1___NET_PLATFORM_SRC_OBJECTS_1 = \ + monolib_socketiohandler.o \ + monolib_sockunix.o \ + monolib_sockosx.o \ + monolib_webrequest_urlsession.o +@COND_PLATFORM_MACOSX_1@__NET_PLATFORM_SRC_OBJECTS_1 = $(COND_PLATFORM_MACOSX_1___NET_PLATFORM_SRC_OBJECTS_1) @COND_PLATFORM_UNIX_1@__NET_PLATFORM_SRC_OBJECTS_1 = \ @COND_PLATFORM_UNIX_1@ monolib_socketiohandler.o monolib_sockunix.o @COND_PLATFORM_WIN32_1@__NET_PLATFORM_SRC_OBJECTS_1 \ @@ -8393,9 +8418,12 @@ COND_USE_SOVERSOLARIS_1___netdll___so_symlinks_uninst_cmd = rm -f \ $(LIBPREFIX)wx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_net-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_USE_SOVERSOLARIS_1@__netdll___so_symlinks_uninst_cmd = $(COND_USE_SOVERSOLARIS_1___netdll___so_symlinks_uninst_cmd) @COND_PLATFORM_WIN32_1@__netdll___win32rc = netdll_version_rc.o -@COND_PLATFORM_MACOSX_1@__NET_PLATFORM_SRC_OBJECTS_2 \ -@COND_PLATFORM_MACOSX_1@ = netdll_socketiohandler.o netdll_sockunix.o \ -@COND_PLATFORM_MACOSX_1@ netdll_sockosx.o +COND_PLATFORM_MACOSX_1___NET_PLATFORM_SRC_OBJECTS_2 = \ + netdll_socketiohandler.o \ + netdll_sockunix.o \ + netdll_sockosx.o \ + netdll_webrequest_urlsession.o +@COND_PLATFORM_MACOSX_1@__NET_PLATFORM_SRC_OBJECTS_2 = $(COND_PLATFORM_MACOSX_1___NET_PLATFORM_SRC_OBJECTS_2) @COND_PLATFORM_UNIX_1@__NET_PLATFORM_SRC_OBJECTS_2 = \ @COND_PLATFORM_UNIX_1@ netdll_socketiohandler.o netdll_sockunix.o @COND_PLATFORM_WIN32_1@__NET_PLATFORM_SRC_OBJECTS_2 \ @@ -8411,9 +8439,12 @@ COND_MONOLITHIC_0_SHARED_0___netlib___depname = \ @COND_ICC_PCH_1@ ./.pch/wxprec_netlib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_netlib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_netlib/wx/wxprec.h.gch -@COND_PLATFORM_MACOSX_1@__NET_PLATFORM_SRC_OBJECTS_3 \ -@COND_PLATFORM_MACOSX_1@ = netlib_socketiohandler.o netlib_sockunix.o \ -@COND_PLATFORM_MACOSX_1@ netlib_sockosx.o +COND_PLATFORM_MACOSX_1___NET_PLATFORM_SRC_OBJECTS_3 = \ + netlib_socketiohandler.o \ + netlib_sockunix.o \ + netlib_sockosx.o \ + netlib_webrequest_urlsession.o +@COND_PLATFORM_MACOSX_1@__NET_PLATFORM_SRC_OBJECTS_3 = $(COND_PLATFORM_MACOSX_1___NET_PLATFORM_SRC_OBJECTS_3) @COND_PLATFORM_UNIX_1@__NET_PLATFORM_SRC_OBJECTS_3 = \ @COND_PLATFORM_UNIX_1@ netlib_socketiohandler.o netlib_sockunix.o @COND_PLATFORM_WIN32_1@__NET_PLATFORM_SRC_OBJECTS_3 \ @@ -15923,6 +15954,9 @@ monodll_url.o: $(srcdir)/src/common/url.cpp $(MONODLL_ODEP) monodll_webrequest.o: $(srcdir)/src/common/webrequest.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/webrequest.cpp +monodll_webrequest_curl.o: $(srcdir)/src/common/webrequest_curl.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/webrequest_curl.cpp + monodll_sockmsw.o: $(srcdir)/src/msw/sockmsw.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/sockmsw.cpp @@ -15935,6 +15969,9 @@ monodll_webrequest_winhttp.o: $(srcdir)/src/msw/webrequest_winhttp.cpp $(MONODLL monodll_sockosx.o: $(srcdir)/src/osx/core/sockosx.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/sockosx.cpp +monodll_webrequest_urlsession.o: $(srcdir)/src/osx/webrequest_urlsession.mm $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/webrequest_urlsession.mm + monodll_gtk_eggtrayicon.o: $(srcdir)/src/gtk/eggtrayicon.c $(MONODLL_ODEP) $(CCC) -c -o $@ $(MONODLL_CFLAGS) $(srcdir)/src/gtk/eggtrayicon.c @@ -21185,6 +21222,9 @@ monolib_url.o: $(srcdir)/src/common/url.cpp $(MONOLIB_ODEP) monolib_webrequest.o: $(srcdir)/src/common/webrequest.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/webrequest.cpp +monolib_webrequest_curl.o: $(srcdir)/src/common/webrequest_curl.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/webrequest_curl.cpp + monolib_sockmsw.o: $(srcdir)/src/msw/sockmsw.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/sockmsw.cpp @@ -21197,6 +21237,9 @@ monolib_webrequest_winhttp.o: $(srcdir)/src/msw/webrequest_winhttp.cpp $(MONOLIB monolib_sockosx.o: $(srcdir)/src/osx/core/sockosx.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/sockosx.cpp +monolib_webrequest_urlsession.o: $(srcdir)/src/osx/webrequest_urlsession.mm $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/webrequest_urlsession.mm + monolib_gtk_eggtrayicon.o: $(srcdir)/src/gtk/eggtrayicon.c $(MONOLIB_ODEP) $(CCC) -c -o $@ $(MONOLIB_CFLAGS) $(srcdir)/src/gtk/eggtrayicon.c @@ -27017,6 +27060,9 @@ netdll_url.o: $(srcdir)/src/common/url.cpp $(NETDLL_ODEP) netdll_webrequest.o: $(srcdir)/src/common/webrequest.cpp $(NETDLL_ODEP) $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/common/webrequest.cpp +netdll_webrequest_curl.o: $(srcdir)/src/common/webrequest_curl.cpp $(NETDLL_ODEP) + $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/common/webrequest_curl.cpp + netdll_sockmsw.o: $(srcdir)/src/msw/sockmsw.cpp $(NETDLL_ODEP) $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/msw/sockmsw.cpp @@ -27029,6 +27075,9 @@ netdll_webrequest_winhttp.o: $(srcdir)/src/msw/webrequest_winhttp.cpp $(NETDLL_O netdll_sockosx.o: $(srcdir)/src/osx/core/sockosx.cpp $(NETDLL_ODEP) $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/osx/core/sockosx.cpp +netdll_webrequest_urlsession.o: $(srcdir)/src/osx/webrequest_urlsession.mm $(NETDLL_ODEP) + $(CXXC) -c -o $@ $(NETDLL_OBJCXXFLAGS) $(srcdir)/src/osx/webrequest_urlsession.mm + @COND_PLATFORM_UNIX_1@netdll_socketiohandler.o: $(srcdir)/src/common/socketiohandler.cpp $(NETDLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(NETDLL_CXXFLAGS) $(srcdir)/src/common/socketiohandler.cpp @@ -27074,6 +27123,9 @@ netlib_url.o: $(srcdir)/src/common/url.cpp $(NETLIB_ODEP) netlib_webrequest.o: $(srcdir)/src/common/webrequest.cpp $(NETLIB_ODEP) $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/common/webrequest.cpp +netlib_webrequest_curl.o: $(srcdir)/src/common/webrequest_curl.cpp $(NETLIB_ODEP) + $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/common/webrequest_curl.cpp + netlib_sockmsw.o: $(srcdir)/src/msw/sockmsw.cpp $(NETLIB_ODEP) $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/msw/sockmsw.cpp @@ -27086,6 +27138,9 @@ netlib_webrequest_winhttp.o: $(srcdir)/src/msw/webrequest_winhttp.cpp $(NETLIB_O netlib_sockosx.o: $(srcdir)/src/osx/core/sockosx.cpp $(NETLIB_ODEP) $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/osx/core/sockosx.cpp +netlib_webrequest_urlsession.o: $(srcdir)/src/osx/webrequest_urlsession.mm $(NETLIB_ODEP) + $(CXXC) -c -o $@ $(NETLIB_OBJCXXFLAGS) $(srcdir)/src/osx/webrequest_urlsession.mm + @COND_PLATFORM_UNIX_1@netlib_socketiohandler.o: $(srcdir)/src/common/socketiohandler.cpp $(NETLIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(NETLIB_CXXFLAGS) $(srcdir)/src/common/socketiohandler.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 66ac82af7b..0c6778fca6 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -751,6 +751,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/osx/core/sockosx.cpp + src/osx/webrequest_urlsession.mm @@ -775,6 +776,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/common/socket.cpp src/common/url.cpp src/common/webrequest.cpp + src/common/webrequest_curl.cpp wx/fs_inet.h @@ -789,6 +791,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/socket.h wx/url.h wx/webrequest.h + wx/webrequest_curl.h diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake index 54659bf217..5bcef6950b 100644 --- a/build/cmake/files.cmake +++ b/build/cmake/files.cmake @@ -661,6 +661,11 @@ set(NET_UNIX_SRC set(NET_OSX_SRC src/osx/core/sockosx.cpp + src/osx/webrequest_urlsession.mm +) + +set(NET_OSX_HDR + wx/osx/webrequest_urlsession.h ) set(NET_WIN32_SRC @@ -685,6 +690,7 @@ set(NET_CMN_SRC src/common/socket.cpp src/common/url.cpp src/common/webrequest.cpp + src/common/webrequest_curl.cpp ) set(NET_CMN_HDR @@ -700,6 +706,7 @@ set(NET_CMN_HDR wx/socket.h wx/url.h wx/webrequest.h + wx/webrequest_curl.h ) set(QA_SRC diff --git a/build/cmake/lib/net/CMakeLists.txt b/build/cmake/lib/net/CMakeLists.txt index fa0af82227..c19c24c092 100644 --- a/build/cmake/lib/net/CMakeLists.txt +++ b/build/cmake/lib/net/CMakeLists.txt @@ -26,7 +26,7 @@ wx_add_library(net IS_BASE ${NET_FILES}) if(WIN32) wx_lib_link_libraries(net PRIVATE ws2_32) - if(wxUSE_WEBREQUEST) + if(wxUSE_WEBREQUEST_WINHTTP) wx_lib_link_libraries(net PRIVATE Winhttp) endif() endif() diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index 155ca66a35..9d3852521e 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -146,7 +146,19 @@ wx_option(wxUSE_TEXTBUFFER "use wxTextBuffer class") wx_option(wxUSE_TEXTFILE "use wxTextFile class") wx_option(wxUSE_TIMER "use wxTimer class") wx_option(wxUSE_VARIANT "use wxVariant class") + +# WebRequest options wx_option(wxUSE_WEBREQUEST "use wxWebRequest class") +if(WIN32) + wx_option(wxUSE_WEBREQUEST_WINHTTP "use wxWebRequest WinHTTP backend") +endif() +if(APPLE) + wx_option(wxUSE_WEBREQUEST_URLSESSION "use wxWebRequest URLSession backend") +endif() +set(wxUSE_WEBREQUEST_CURL_DEFAULT OFF) +#TODO: determine wxUSE_WEBREQUEST_CURL_DEFAULT (based) +wx_option(wxUSE_WEBREQUEST_CURL "use wxWebRequest libcurl backend" ${wxUSE_WEBREQUEST_CURL_DEFAULT}) + wx_option(wxUSE_ZIPSTREAM "use wxZip streams") # URL-related classes diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index 7c06dd28e2..b3e964f146 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -299,7 +299,31 @@ #cmakedefine01 wxUSE_MIMETYPE + +#if defined(_MSC_VER) || \ + (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) +#cmakedefine01 wxUSE_WEBREQUEST_WINHTTP +#else +#cmakedefine01 wxUSE_WEBREQUEST_WINHTTP +#endif + +#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#cmakedefine01 wxUSE_WEBREQUEST_URLSESSION +#else +#cmakedefine01 wxUSE_WEBREQUEST_URLSESSION +#endif + +#if defined(__WINDOWS__) || defined(__APPLE__) +#cmakedefine01 wxUSE_WEBREQUEST_CURL +#else +#cmakedefine01 wxUSE_WEBREQUEST_CURL +#endif + +#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL #cmakedefine01 wxUSE_WEBREQUEST +#else +#cmakedefine01 wxUSE_WEBREQUEST +#endif #cmakedefine01 wxUSE_PROTOCOL diff --git a/build/files b/build/files index 5a0ebe658c..eeee55a364 100644 --- a/build/files +++ b/build/files @@ -678,6 +678,9 @@ NET_UNIX_SRC = NET_OSX_SRC = src/osx/core/sockosx.cpp + src/osx/webrequest_urlsession.mm +NET_OSX_HDR = + wx/osx/webrequest_urlsession.h NET_WIN32_SRC = src/msw/sockmsw.cpp @@ -698,6 +701,7 @@ NET_CMN_SRC = src/common/socket.cpp src/common/url.cpp src/common/webrequest.cpp + src/common/webrequest_curl.cpp NET_CMN_HDR = wx/fs_inet.h wx/protocol/file.h @@ -711,6 +715,7 @@ NET_CMN_HDR = wx/socket.h wx/url.h wx/webrequest.h + wx/webrequest_curl.h # wxQA (non GUI library) diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index c9ccf9df3c..4e2d3249d1 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -494,6 +494,7 @@ MONODLL_OBJECTS = \ $(OBJS)\monodll_socket.obj \ $(OBJS)\monodll_url.obj \ $(OBJS)\monodll_webrequest.obj \ + $(OBJS)\monodll_webrequest_curl.obj \ $(OBJS)\monodll_sockmsw.obj \ $(OBJS)\monodll_urlmsw.obj \ $(OBJS)\monodll_webrequest_winhttp.obj \ @@ -648,6 +649,7 @@ MONOLIB_OBJECTS = \ $(OBJS)\monolib_socket.obj \ $(OBJS)\monolib_url.obj \ $(OBJS)\monolib_webrequest.obj \ + $(OBJS)\monolib_webrequest_curl.obj \ $(OBJS)\monolib_sockmsw.obj \ $(OBJS)\monolib_urlmsw.obj \ $(OBJS)\monolib_webrequest_winhttp.obj \ @@ -942,6 +944,7 @@ NETDLL_OBJECTS = \ $(OBJS)\netdll_socket.obj \ $(OBJS)\netdll_url.obj \ $(OBJS)\netdll_webrequest.obj \ + $(OBJS)\netdll_webrequest_curl.obj \ $(OBJS)\netdll_sockmsw.obj \ $(OBJS)\netdll_urlmsw.obj \ $(OBJS)\netdll_webrequest_winhttp.obj @@ -966,6 +969,7 @@ NETLIB_OBJECTS = \ $(OBJS)\netlib_socket.obj \ $(OBJS)\netlib_url.obj \ $(OBJS)\netlib_webrequest.obj \ + $(OBJS)\netlib_webrequest_curl.obj \ $(OBJS)\netlib_sockmsw.obj \ $(OBJS)\netlib_urlmsw.obj \ $(OBJS)\netlib_webrequest_winhttp.obj @@ -6793,6 +6797,9 @@ $(OBJS)\monodll_url.obj: ..\..\src\common\url.cpp $(OBJS)\monodll_webrequest.obj: ..\..\src\common\webrequest.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\webrequest.cpp +$(OBJS)\monodll_webrequest_curl.obj: ..\..\src\common\webrequest_curl.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\webrequest_curl.cpp + $(OBJS)\monodll_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\sockmsw.cpp @@ -9345,6 +9352,9 @@ $(OBJS)\monolib_url.obj: ..\..\src\common\url.cpp $(OBJS)\monolib_webrequest.obj: ..\..\src\common\webrequest.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\webrequest.cpp +$(OBJS)\monolib_webrequest_curl.obj: ..\..\src\common\webrequest_curl.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\webrequest_curl.cpp + $(OBJS)\monolib_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\sockmsw.cpp @@ -12248,6 +12258,9 @@ $(OBJS)\netdll_url.obj: ..\..\src\common\url.cpp $(OBJS)\netdll_webrequest.obj: ..\..\src\common\webrequest.cpp $(CXX) -q -c -P -o$@ $(NETDLL_CXXFLAGS) ..\..\src\common\webrequest.cpp +$(OBJS)\netdll_webrequest_curl.obj: ..\..\src\common\webrequest_curl.cpp + $(CXX) -q -c -P -o$@ $(NETDLL_CXXFLAGS) ..\..\src\common\webrequest_curl.cpp + $(OBJS)\netdll_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) -q -c -P -o$@ $(NETDLL_CXXFLAGS) ..\..\src\msw\sockmsw.cpp @@ -12293,6 +12306,9 @@ $(OBJS)\netlib_url.obj: ..\..\src\common\url.cpp $(OBJS)\netlib_webrequest.obj: ..\..\src\common\webrequest.cpp $(CXX) -q -c -P -o$@ $(NETLIB_CXXFLAGS) ..\..\src\common\webrequest.cpp +$(OBJS)\netlib_webrequest_curl.obj: ..\..\src\common\webrequest_curl.cpp + $(CXX) -q -c -P -o$@ $(NETLIB_CXXFLAGS) ..\..\src\common\webrequest_curl.cpp + $(OBJS)\netlib_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) -q -c -P -o$@ $(NETLIB_CXXFLAGS) ..\..\src\msw\sockmsw.cpp diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index 280498e6fc..a4417135d2 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -482,6 +482,7 @@ MONODLL_OBJECTS = \ $(OBJS)\monodll_socket.o \ $(OBJS)\monodll_url.o \ $(OBJS)\monodll_webrequest.o \ + $(OBJS)\monodll_webrequest_curl.o \ $(OBJS)\monodll_sockmsw.o \ $(OBJS)\monodll_urlmsw.o \ $(OBJS)\monodll_webrequest_winhttp.o \ @@ -637,6 +638,7 @@ MONOLIB_OBJECTS = \ $(OBJS)\monolib_socket.o \ $(OBJS)\monolib_url.o \ $(OBJS)\monolib_webrequest.o \ + $(OBJS)\monolib_webrequest_curl.o \ $(OBJS)\monolib_sockmsw.o \ $(OBJS)\monolib_urlmsw.o \ $(OBJS)\monolib_webrequest_winhttp.o \ @@ -933,6 +935,7 @@ NETDLL_OBJECTS = \ $(OBJS)\netdll_socket.o \ $(OBJS)\netdll_url.o \ $(OBJS)\netdll_webrequest.o \ + $(OBJS)\netdll_webrequest_curl.o \ $(OBJS)\netdll_sockmsw.o \ $(OBJS)\netdll_urlmsw.o \ $(OBJS)\netdll_webrequest_winhttp.o @@ -957,6 +960,7 @@ NETLIB_OBJECTS = \ $(OBJS)\netlib_socket.o \ $(OBJS)\netlib_url.o \ $(OBJS)\netlib_webrequest.o \ + $(OBJS)\netlib_webrequest_curl.o \ $(OBJS)\netlib_sockmsw.o \ $(OBJS)\netlib_urlmsw.o \ $(OBJS)\netlib_webrequest_winhttp.o @@ -6975,6 +6979,9 @@ $(OBJS)\monodll_url.o: ../../src/common/url.cpp $(OBJS)\monodll_webrequest.o: ../../src/common/webrequest.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monodll_webrequest_curl.o: ../../src/common/webrequest_curl.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monodll_sockmsw.o: ../../src/msw/sockmsw.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< @@ -9527,6 +9534,9 @@ $(OBJS)\monolib_url.o: ../../src/common/url.cpp $(OBJS)\monolib_webrequest.o: ../../src/common/webrequest.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monolib_webrequest_curl.o: ../../src/common/webrequest_curl.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monolib_sockmsw.o: ../../src/msw/sockmsw.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< @@ -12430,6 +12440,9 @@ $(OBJS)\netdll_url.o: ../../src/common/url.cpp $(OBJS)\netdll_webrequest.o: ../../src/common/webrequest.cpp $(CXX) -c -o $@ $(NETDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\netdll_webrequest_curl.o: ../../src/common/webrequest_curl.cpp + $(CXX) -c -o $@ $(NETDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\netdll_sockmsw.o: ../../src/msw/sockmsw.cpp $(CXX) -c -o $@ $(NETDLL_CXXFLAGS) $(CPPDEPS) $< @@ -12475,6 +12488,9 @@ $(OBJS)\netlib_url.o: ../../src/common/url.cpp $(OBJS)\netlib_webrequest.o: ../../src/common/webrequest.cpp $(CXX) -c -o $@ $(NETLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\netlib_webrequest_curl.o: ../../src/common/webrequest_curl.cpp + $(CXX) -c -o $@ $(NETLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\netlib_sockmsw.o: ../../src/msw/sockmsw.cpp $(CXX) -c -o $@ $(NETLIB_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index ab3f90cd4e..3e366e2529 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -514,6 +514,7 @@ MONODLL_OBJECTS = \ $(OBJS)\monodll_socket.obj \ $(OBJS)\monodll_url.obj \ $(OBJS)\monodll_webrequest.obj \ + $(OBJS)\monodll_webrequest_curl.obj \ $(OBJS)\monodll_sockmsw.obj \ $(OBJS)\monodll_urlmsw.obj \ $(OBJS)\monodll_webrequest_winhttp.obj \ @@ -678,6 +679,7 @@ MONOLIB_OBJECTS = \ $(OBJS)\monolib_socket.obj \ $(OBJS)\monolib_url.obj \ $(OBJS)\monolib_webrequest.obj \ + $(OBJS)\monolib_webrequest_curl.obj \ $(OBJS)\monolib_sockmsw.obj \ $(OBJS)\monolib_urlmsw.obj \ $(OBJS)\monolib_webrequest_winhttp.obj \ @@ -994,6 +996,7 @@ NETDLL_OBJECTS = \ $(OBJS)\netdll_socket.obj \ $(OBJS)\netdll_url.obj \ $(OBJS)\netdll_webrequest.obj \ + $(OBJS)\netdll_webrequest_curl.obj \ $(OBJS)\netdll_sockmsw.obj \ $(OBJS)\netdll_urlmsw.obj \ $(OBJS)\netdll_webrequest_winhttp.obj @@ -1024,6 +1027,7 @@ NETLIB_OBJECTS = \ $(OBJS)\netlib_socket.obj \ $(OBJS)\netlib_url.obj \ $(OBJS)\netlib_webrequest.obj \ + $(OBJS)\netlib_webrequest_curl.obj \ $(OBJS)\netlib_sockmsw.obj \ $(OBJS)\netlib_urlmsw.obj \ $(OBJS)\netlib_webrequest_winhttp.obj @@ -7502,6 +7506,9 @@ $(OBJS)\monodll_url.obj: ..\..\src\common\url.cpp $(OBJS)\monodll_webrequest.obj: ..\..\src\common\webrequest.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\webrequest.cpp +$(OBJS)\monodll_webrequest_curl.obj: ..\..\src\common\webrequest_curl.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\webrequest_curl.cpp + $(OBJS)\monodll_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\sockmsw.cpp @@ -10054,6 +10061,9 @@ $(OBJS)\monolib_url.obj: ..\..\src\common\url.cpp $(OBJS)\monolib_webrequest.obj: ..\..\src\common\webrequest.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\webrequest.cpp +$(OBJS)\monolib_webrequest_curl.obj: ..\..\src\common\webrequest_curl.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\webrequest_curl.cpp + $(OBJS)\monolib_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\sockmsw.cpp @@ -12957,6 +12967,9 @@ $(OBJS)\netdll_url.obj: ..\..\src\common\url.cpp $(OBJS)\netdll_webrequest.obj: ..\..\src\common\webrequest.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETDLL_CXXFLAGS) ..\..\src\common\webrequest.cpp +$(OBJS)\netdll_webrequest_curl.obj: ..\..\src\common\webrequest_curl.cpp + $(CXX) /c /nologo /TP /Fo$@ $(NETDLL_CXXFLAGS) ..\..\src\common\webrequest_curl.cpp + $(OBJS)\netdll_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETDLL_CXXFLAGS) ..\..\src\msw\sockmsw.cpp @@ -13002,6 +13015,9 @@ $(OBJS)\netlib_url.obj: ..\..\src\common\url.cpp $(OBJS)\netlib_webrequest.obj: ..\..\src\common\webrequest.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETLIB_CXXFLAGS) ..\..\src\common\webrequest.cpp +$(OBJS)\netlib_webrequest_curl.obj: ..\..\src\common\webrequest_curl.cpp + $(CXX) /c /nologo /TP /Fo$@ $(NETLIB_CXXFLAGS) ..\..\src\common\webrequest_curl.cpp + $(OBJS)\netlib_sockmsw.obj: ..\..\src\msw\sockmsw.cpp $(CXX) /c /nologo /TP /Fo$@ $(NETLIB_CXXFLAGS) ..\..\src\msw\sockmsw.cpp diff --git a/build/msw/wx_net.vcxproj b/build/msw/wx_net.vcxproj index 5b18ceda45..4c2eb69153 100644 --- a/build/msw/wx_net.vcxproj +++ b/build/msw/wx_net.vcxproj @@ -470,6 +470,7 @@ + @@ -513,6 +514,7 @@ + diff --git a/build/msw/wx_net.vcxproj.filters b/build/msw/wx_net.vcxproj.filters index 50bfaa3932..d7cf069b48 100644 --- a/build/msw/wx_net.vcxproj.filters +++ b/build/msw/wx_net.vcxproj.filters @@ -54,6 +54,9 @@ Common Sources + + Common Sources + MSW Sources @@ -109,6 +112,9 @@ Common Headers + + Common Headers + diff --git a/build/msw/wx_vc7_net.vcproj b/build/msw/wx_vc7_net.vcproj index 8acd78d68f..6e3b5bafae 100644 --- a/build/msw/wx_vc7_net.vcproj +++ b/build/msw/wx_vc7_net.vcproj @@ -336,6 +336,9 @@ + + + + diff --git a/build/msw/wx_vc8_net.vcproj b/build/msw/wx_vc8_net.vcproj index dc42378627..11a6ba819b 100644 --- a/build/msw/wx_vc8_net.vcproj +++ b/build/msw/wx_vc8_net.vcproj @@ -853,6 +853,10 @@ RelativePath="..\..\src\common\webrequest.cpp" > + + + + diff --git a/build/msw/wx_vc9_net.vcproj b/build/msw/wx_vc9_net.vcproj index be81ca3701..3118e85cad 100644 --- a/build/msw/wx_vc9_net.vcproj +++ b/build/msw/wx_vc9_net.vcproj @@ -849,6 +849,10 @@ RelativePath="..\..\src\common\webrequest.cpp" > + + + + diff --git a/configure b/configure index 60db7082ed..6501210d28 100755 --- a/configure +++ b/configure @@ -36621,6 +36621,11 @@ fi if test "$wxUSE_WEBREQUEST" = "yes"; then $as_echo "#define wxUSE_WEBREQUEST 1" >>confdefs.h + + if test "$wxUSE_MSW" = 1; then + $as_echo "#define wxUSE_WEBREQUEST_WINHTTP 1" >>confdefs.h + + fi fi diff --git a/configure.in b/configure.in index b632b2c84c..03959b657b 100644 --- a/configure.in +++ b/configure.in @@ -6347,6 +6347,11 @@ fi if test "$wxUSE_WEBREQUEST" = "yes"; then AC_DEFINE(wxUSE_WEBREQUEST) + + if test "$wxUSE_MSW" = 1; then + dnl TODO: Check for the required headers/libraries under Windows + AC_DEFINE(wxUSE_WEBREQUEST_WINHTTP) + fi fi dnl --------------------------------------------------------------------------- diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index 5ae9543714..29319adf15 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -647,11 +647,52 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest backend based on WinHTTP +// +// Default is 1 +// +// Recommended setting: 1 on Windows + +// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() +// here as this file is included from wx/platform.h before they're defined. +#if defined(_MSC_VER) || \ + (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) +#define wxUSE_WEBREQUEST_WINHTTP 1 +#else +#define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 1 on macOS 10.9+ +#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#define wxUSE_WEBREQUEST_URLSESSION 1 +#else +#define wxUSE_WEBREQUEST_URLSESSION 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 0 on Windows and macOS otherwise 1 +#if defined(__WINDOWS__) || defined(__APPLE__) +#define wxUSE_WEBREQUEST_CURL 0 +#else +#define wxUSE_WEBREQUEST_CURL 1 +#endif + // wxWebRequest and related classes: This will allow usage of system libraries // for HTTP(S) requests // // Default is 1 +#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL #define wxUSE_WEBREQUEST 1 +#else +#define wxUSE_WEBREQUEST 0 +#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index d4db96bd15..9b524dfc79 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -2300,6 +2300,15 @@ # endif #endif /* wxUSE_WEBVIEW && !any web view backend */ +#if wxUSE_WEBREQUEST && !(wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL) +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_WEBREQUEST requires at least one backend" +# else +# undef wxUSE_WEBREQUEST +# define wxUSE_WEBREQUEST 0 +# endif +#endif /* wxUSE_WEBREQUEST && !any web request backend */ + #if wxUSE_PREFERENCES_EDITOR /* We can use either a generic implementation, using wxNotebook, or a diff --git a/include/wx/gtk/setup0.h b/include/wx/gtk/setup0.h index ddb2d2688a..4b3e816a4f 100644 --- a/include/wx/gtk/setup0.h +++ b/include/wx/gtk/setup0.h @@ -648,11 +648,52 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest backend based on WinHTTP +// +// Default is 1 +// +// Recommended setting: 1 on Windows + +// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() +// here as this file is included from wx/platform.h before they're defined. +#if defined(_MSC_VER) || \ + (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) +#define wxUSE_WEBREQUEST_WINHTTP 1 +#else +#define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 1 on macOS 10.9+ +#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#define wxUSE_WEBREQUEST_URLSESSION 1 +#else +#define wxUSE_WEBREQUEST_URLSESSION 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 0 on Windows and macOS otherwise 1 +#if defined(__WINDOWS__) || defined(__APPLE__) +#define wxUSE_WEBREQUEST_CURL 0 +#else +#define wxUSE_WEBREQUEST_CURL 1 +#endif + // wxWebRequest and related classes: This will allow usage of system libraries // for HTTP(S) requests // // Default is 1 +#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL #define wxUSE_WEBREQUEST 1 +#else +#define wxUSE_WEBREQUEST 0 +#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index d7e39b324e..4a5136a035 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -648,11 +648,52 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest backend based on WinHTTP +// +// Default is 1 +// +// Recommended setting: 1 on Windows + +// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() +// here as this file is included from wx/platform.h before they're defined. +#if defined(_MSC_VER) || \ + (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) +#define wxUSE_WEBREQUEST_WINHTTP 1 +#else +#define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 1 on macOS 10.9+ +#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#define wxUSE_WEBREQUEST_URLSESSION 1 +#else +#define wxUSE_WEBREQUEST_URLSESSION 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 0 on Windows and macOS otherwise 1 +#if defined(__WINDOWS__) || defined(__APPLE__) +#define wxUSE_WEBREQUEST_CURL 0 +#else +#define wxUSE_WEBREQUEST_CURL 1 +#endif + // wxWebRequest and related classes: This will allow usage of system libraries // for HTTP(S) requests // // Default is 1 +#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL #define wxUSE_WEBREQUEST 1 +#else +#define wxUSE_WEBREQUEST 0 +#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index d4560537bf..3b94cad9a6 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -648,11 +648,52 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest backend based on WinHTTP +// +// Default is 1 +// +// Recommended setting: 1 on Windows + +// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() +// here as this file is included from wx/platform.h before they're defined. +#if defined(_MSC_VER) || \ + (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) +#define wxUSE_WEBREQUEST_WINHTTP 1 +#else +#define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 1 on macOS 10.9+ +#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#define wxUSE_WEBREQUEST_URLSESSION 1 +#else +#define wxUSE_WEBREQUEST_URLSESSION 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 0 on Windows and macOS otherwise 1 +#if defined(__WINDOWS__) || defined(__APPLE__) +#define wxUSE_WEBREQUEST_CURL 0 +#else +#define wxUSE_WEBREQUEST_CURL 1 +#endif + // wxWebRequest and related classes: This will allow usage of system libraries // for HTTP(S) requests // // Default is 1 +#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL #define wxUSE_WEBREQUEST 1 +#else +#define wxUSE_WEBREQUEST 0 +#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index 89d1fae92c..e1d6df71a9 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -654,11 +654,52 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest backend based on WinHTTP +// +// Default is 1 +// +// Recommended setting: 1 on Windows + +// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() +// here as this file is included from wx/platform.h before they're defined. +#if defined(_MSC_VER) || \ + (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) +#define wxUSE_WEBREQUEST_WINHTTP 1 +#else +#define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 1 on macOS 10.9+ +#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#define wxUSE_WEBREQUEST_URLSESSION 1 +#else +#define wxUSE_WEBREQUEST_URLSESSION 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 0 on Windows and macOS otherwise 1 +#if defined(__WINDOWS__) || defined(__APPLE__) +#define wxUSE_WEBREQUEST_CURL 0 +#else +#define wxUSE_WEBREQUEST_CURL 1 +#endif + // wxWebRequest and related classes: This will allow usage of system libraries // for HTTP(S) requests // // Default is 1 +#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL #define wxUSE_WEBREQUEST 1 +#else +#define wxUSE_WEBREQUEST 0 +#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/osx/webrequest_urlsession.h b/include/wx/osx/webrequest_urlsession.h new file mode 100644 index 0000000000..4997ac7305 --- /dev/null +++ b/include/wx/osx/webrequest_urlsession.h @@ -0,0 +1,42 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/osx/webrequest_urlsession.h +// Purpose: wxWebRequest implementation using URLSession +// Author: Tobias Taschner +// Created: 2018-10-25 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_OSX_WEBREQUEST_URLSESSION_H +#define _WX_OSX_WEBREQUEST_URLSESSION_H + +#if wxUSE_WEBREQUEST_URLSESSION + +DECLARE_WXCOCOA_OBJC_CLASS(NSURLSession); +DECLARE_WXCOCOA_OBJC_CLASS(NSURLTask); + +class WXDLLIMPEXP_NET wxWebSessionURLSession: public wxWebSession +{ +public: + wxWebSessionURLSession(); + + ~wxWebSessionURLSession(); + + wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + +private: + WX_NSURLSession m_session; + + wxDECLARE_NO_COPY_CLASS(wxWebSessionURLSession); +}; + +class WXDLLIMPEXP_NET wxWebSessionFactoryURLSession: public wxWebSessionFactory +{ +public: + wxWebSession* Create() wxOVERRIDE + { return new wxWebSessionURLSession(); } +}; + +#endif // wxUSE_WEBREQUEST_URLSESSION + +#endif // _WX_OSX_WEBREQUEST_URLSESSION_H diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index cad052ed0c..e32adbb8ac 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -644,11 +644,52 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest backend based on WinHTTP +// +// Default is 1 +// +// Recommended setting: 1 on Windows + +// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() +// here as this file is included from wx/platform.h before they're defined. +#if defined(_MSC_VER) || \ + (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) +#define wxUSE_WEBREQUEST_WINHTTP 1 +#else +#define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 1 on macOS 10.9+ +#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#define wxUSE_WEBREQUEST_URLSESSION 1 +#else +#define wxUSE_WEBREQUEST_URLSESSION 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 0 on Windows and macOS otherwise 1 +#if defined(__WINDOWS__) || defined(__APPLE__) +#define wxUSE_WEBREQUEST_CURL 0 +#else +#define wxUSE_WEBREQUEST_CURL 1 +#endif + // wxWebRequest and related classes: This will allow usage of system libraries // for HTTP(S) requests // // Default is 1 +#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL #define wxUSE_WEBREQUEST 1 +#else +#define wxUSE_WEBREQUEST 0 +#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index 9028fe95fc..1fe8541ce7 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -647,11 +647,52 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 +// wxWebRequest backend based on WinHTTP +// +// Default is 1 +// +// Recommended setting: 1 on Windows + +// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() +// here as this file is included from wx/platform.h before they're defined. +#if defined(_MSC_VER) || \ + (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) +#define wxUSE_WEBREQUEST_WINHTTP 1 +#else +#define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 1 on macOS 10.9+ +#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#define wxUSE_WEBREQUEST_URLSESSION 1 +#else +#define wxUSE_WEBREQUEST_URLSESSION 0 +#endif + +// wxWebRequest backend based on NSURLSession +// +// Default is 1 +// +// Recommended setting: 0 on Windows and macOS otherwise 1 +#if defined(__WINDOWS__) || defined(__APPLE__) +#define wxUSE_WEBREQUEST_CURL 0 +#else +#define wxUSE_WEBREQUEST_CURL 1 +#endif + // wxWebRequest and related classes: This will allow usage of system libraries // for HTTP(S) requests // // Default is 1 +#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL #define wxUSE_WEBREQUEST 1 +#else +#define wxUSE_WEBREQUEST 0 +#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/webrequest_curl.h b/include/wx/webrequest_curl.h new file mode 100644 index 0000000000..9eb674095c --- /dev/null +++ b/include/wx/webrequest_curl.h @@ -0,0 +1,37 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/webrequest_curl.h +// Purpose: wxWebRequest implementation using libcurl +// Author: Tobias Taschner +// Created: 2018-10-25 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_WEBREQUEST_CURL_H +#define _WX_WEBREQUEST_CURL_H + +#if wxUSE_WEBREQUEST_CURL + +class WXDLLIMPEXP_NET wxWebSessionCURL: public wxWebSession +{ +public: + wxWebSessionCURL(); + + ~wxWebSessionCURL(); + + wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + +private: + wxDECLARE_NO_COPY_CLASS(wxWebSessionCURL); +}; + +class WXDLLIMPEXP_NET wxWebSessionFactoryCURL: public wxWebSessionFactory +{ +public: + wxWebSession* Create() wxOVERRIDE + { return new wxWebSessionCURL(); } +}; + +#endif // wxUSE_WEBREQUEST_CURL + +#endif diff --git a/setup.h.in b/setup.h.in index 792e771fd3..071776d9c3 100644 --- a/setup.h.in +++ b/setup.h.in @@ -299,7 +299,31 @@ #define wxUSE_MIMETYPE 0 + +#if defined(_MSC_VER) || \ + (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) +#define wxUSE_WEBREQUEST_WINHTTP 0 +#else +#define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + +#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#define wxUSE_WEBREQUEST_URLSESSION 0 +#else +#define wxUSE_WEBREQUEST_URLSESSION 0 +#endif + +#if defined(__WINDOWS__) || defined(__APPLE__) +#define wxUSE_WEBREQUEST_CURL 0 +#else +#define wxUSE_WEBREQUEST_CURL 0 +#endif + +#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL #define wxUSE_WEBREQUEST 0 +#else +#define wxUSE_WEBREQUEST 0 +#endif #define wxUSE_PROTOCOL 0 diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index c70bbb18d6..0433d9e5f9 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -24,16 +24,26 @@ #include "wx/translation.h" #endif -#if defined(__WINDOWS__) +#if wxUSE_WEBREQUEST_WINHTTP #include "wx/msw/webrequest_winhttp.h" #endif +#if wxUSE_WEBREQUEST_URLSESSION +#include "wx/osx/webrequest_urlsession.h" +#endif +#if wxUSE_WEBREQUEST_CURL +#include "wx/webrequest_curl.h" +#endif extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[] = "wxWebSessionBackendWinHTTP"; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendURLSession[] = "wxWebSessionBackendURLSession"; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[] = "wxWebSessionBackendCURL"; -#if defined(__WINDOWS__) +#if wxUSE_WEBREQUEST_WINHTTP extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[] = "wxWebSessionBackendWinHTTP"; +#elif wxUSE_WEBREQUEST_URLSESSION +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[] = "wxWebSessionBackendURLSession"; +#elif wxUSE_WEBREQUEST_CURL +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[] = "wxWebSessionBackendCURL"; #endif wxDEFINE_EVENT(wxEVT_WEBREQUEST_STATE, wxWebRequestEvent); @@ -156,10 +166,18 @@ void wxWebSession::RegisterFactory(const wxString& backend, wxSharedPtr(new wxWebSessionFactoryWinHTTP())); #endif +#if wxUSE_WEBREQUEST_URLSESSION + RegisterFactory(wxWebSessionBackendURLSession, + wxSharedPtr(new wxWebSessionFactoryURLSession())); +#endif +#if wxUSE_WEBREQUEST_CURL + RegisterFactory(wxWebSessionBackendCURL, + wxSharedPtr(new wxWebSessionFactoryCURL())); +#endif } // static diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp new file mode 100644 index 0000000000..86ce25c337 --- /dev/null +++ b/src/common/webrequest_curl.cpp @@ -0,0 +1,39 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/common/webrequest_curl.h +// Purpose: wxWebRequest implementation using libcurl +// Author: Tobias Taschner +// Created: 2018-10-25 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#if defined(__BORLANDC__) +#pragma hdrstop +#endif + +#include "wx/webrequest.h" + +#if wxUSE_WEBREQUEST_CURL + +#include "wx/webrequest_curl.h" + +wxWebSessionCURL::wxWebSessionCURL() +{ + +} + +wxWebSessionCURL::~wxWebSessionCURL() +{ + +} + +wxWebRequest* wxWebSessionCURL::CreateRequest(const wxString& url, int id) +{ + wxFAIL_MSG("not implemented"); + return NULL; +} + +#endif // wxUSE_WEBREQUEST_CURL diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index f813cf37b2..e2e9663e03 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -16,7 +16,7 @@ #include "wx/webrequest.h" -#if wxUSE_WEBREQUEST +#if wxUSE_WEBREQUEST_WINHTTP #include "wx/mstream.h" #include "wx/uri.h" @@ -472,4 +472,4 @@ wxWebRequest* wxWebSessionWinHTTP::CreateRequest(const wxString& url, int id) return new wxWebRequestWinHTTP(id, *this, url); } -#endif // wxUSE_WEBREQUEST +#endif // wxUSE_WEBREQUEST_WINHTTP diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm new file mode 100644 index 0000000000..7b241e8034 --- /dev/null +++ b/src/osx/webrequest_urlsession.mm @@ -0,0 +1,42 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/osx/webrequest_urlsession.h +// Purpose: wxWebRequest implementation using URLSession +// Author: Tobias Taschner +// Created: 2018-10-25 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#if defined(__BORLANDC__) +#pragma hdrstop +#endif + +#include "wx/webrequest.h" + +#if wxUSE_WEBREQUEST_URLSESSION + +#import + +#include "wx/osx/webrequest_urlsession.h" + +wxWebSessionURLSession::wxWebSessionURLSession() +{ + m_session = [NSURLSession sessionWithConfiguration: + [NSURLSessionConfiguration defaultSessionConfiguration]]; +} + +wxWebSessionURLSession::~wxWebSessionURLSession() +{ + [m_session release]; +} + +wxWebRequest* wxWebSessionURLSession::CreateRequest(const wxString& url, int id) +{ + wxFAIL_MSG("not implemented"); + return NULL; +} + +#endif // wxUSE_WEBREQUEST_URLSESSION From 1a34f3dab9db06e77034db4303d8997f37e9f550 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 25 Oct 2018 23:02:23 +0200 Subject: [PATCH 019/218] Document authentication changes --- interface/wx/webrequest.h | 60 +++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 457113e301..8ba0ce6934 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -131,21 +131,11 @@ public: State_Active, /** - The server denied the request because of insufficient - user credentials. When credentials are provided with - SetCredentials() the request will be retried with the supplied - user credentials. + The request is currently unauthorized. Calling GetAuthChallenge() + returns a challenge object with further details. */ State_Unauthorized, - /** - A proxy denied the request because of insufficient - user credentials. When credentials are provided with - SetCredentials() the request will be retried with the supplied - user credentials. - */ - State_UnauthorizedProxy, - /// The request completed successfully and all data has been received. State_Completed, @@ -174,16 +164,6 @@ public: Storage_None }; - /// Possible credential targets used by SetCredentials(). - enum CredentialTarget - { - /// Set credentials to be sent to the server. - CredentialTarget_Server, - - /// Set credentials to be sent to a proxy. - CredentialTarget_Proxy - } - /** Sets a request header which will be sent to the server by this request. @@ -247,19 +227,11 @@ public: const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); /** - Sets the credentials to be sent to the server or proxy when - authentification is requested. - - @param user - User name - @param password - Password - @param target - Specify the credentials for the server @c CredentialTarget_Server - or the proxy @c CredentialTarget_Proxy. + Returns the current authentication challenge object while the request + is in @c State_Unauthorized. */ - void SetCredentials(const wxString& user, const wxString& password, - CredentialTarget target); + wxWebAuthChallenge* GetAuthChallenge(); + /** Instructs the request to ignore server error status codes. @@ -330,6 +302,26 @@ public: State GetState() const { return m_state; } }; +/** + Authentication challenge information available via + wxWebRequest::GetAuthChallenge(). + + Use SetCredentials() to provide user credentials. +*/ +class wxWebAuthChallenge +{ +public: + /** + Used to provide user credentials to the authentication challenge. + + @param user + User name. + @param password + The users password. + */ + void SetCredentials(const wxString& user, const wxString& password); +}; + /** A wxWebResponse allows access to the response sent by the server. From 4fd60915138d95a7b26b7fc8d8e5f247f27fecd7 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 25 Oct 2018 23:33:05 +0200 Subject: [PATCH 020/218] Implement WinHTTP authentication --- include/wx/msw/webrequest_winhttp.h | 24 ++++++++++ include/wx/webrequest.h | 37 +++++++++++---- src/common/webrequest.cpp | 7 +-- src/msw/webrequest_winhttp.cpp | 74 +++++++++++++++++++++++++++-- tests/net/webrequest.cpp | 23 +++++++++ 5 files changed, 145 insertions(+), 20 deletions(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index 09b51fb3f8..5da61c7772 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -52,6 +52,23 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebResponseWinHTTP); }; +class WXDLLIMPEXP_NET wxWebAuthChallengeWinHTTP : public wxWebAuthChallenge +{ +public: + explicit wxWebAuthChallengeWinHTTP(Source source, wxWebRequestWinHTTP& request); + + bool Init(); + + void SetCredentials(const wxString& user, const wxString& password) wxOVERRIDE; + +private: + wxWebRequestWinHTTP& m_request; + DWORD m_target; + DWORD m_selectedScheme; + + wxDECLARE_NO_COPY_CLASS(wxWebAuthChallengeWinHTTP); +}; + class WXDLLIMPEXP_NET wxWebRequestWinHTTP : public wxWebRequest { public: @@ -65,6 +82,8 @@ public: wxWebResponse* GetResponse() wxOVERRIDE; + wxWebAuthChallenge* GetAuthChallenge() const wxOVERRIDE { return m_authChallenge.get(); } + void HandleCallback(DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength); @@ -76,15 +95,20 @@ private: HINTERNET m_connect; HINTERNET m_request; wxScopedPtr m_response; + wxScopedPtr m_authChallenge; wxMemoryBuffer m_dataWriteBuffer; wxFileOffset m_dataWritten; + void SendRequest(); + void WriteData(); void CreateResponse(); void SetFailedWithLastError(); + friend class wxWebAuthChallengeWinHTTP; + wxDECLARE_NO_COPY_CLASS(wxWebRequestWinHTTP); }; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 00cc2cecae..31987d0706 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -23,6 +23,7 @@ class wxWebResponse; class wxWebSession; +class wxWebAuthChallenge; WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); @@ -33,19 +34,12 @@ public: { State_Idle, State_Unauthorized, - State_UnauthorizedProxy, State_Active, State_Completed, State_Failed, State_Cancelled }; - enum CredentialTarget - { - CredentialTarget_Server, - CredentialTarget_Proxy - }; - virtual ~wxWebRequest() { } virtual void SetHeader(const wxString& name, const wxString& value) @@ -57,9 +51,6 @@ public: void SetData(wxSharedPtr dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); - void SetCredentials(const wxString& user, const wxString& password, - CredentialTarget target); - void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } virtual void Start() = 0; @@ -68,6 +59,8 @@ public: virtual wxWebResponse* GetResponse() = 0; + virtual wxWebAuthChallenge* GetAuthChallenge() const = 0; + int GetId() const { return m_id; } State GetState() const { return m_state; } @@ -125,6 +118,30 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebResponse); }; +class WXDLLIMPEXP_NET wxWebAuthChallenge +{ +public: + enum Source + { + Source_Server, + Source_Proxy + }; + + virtual ~wxWebAuthChallenge() { } + + Source GetSource() const { return m_source; } + + virtual void SetCredentials(const wxString& user, const wxString& password) = 0; + +protected: + wxWebAuthChallenge(Source source): m_source(source) { } + +private: + Source m_source; + + wxDECLARE_NO_COPY_CLASS(wxWebAuthChallenge); +}; + class WXDLLIMPEXP_NET wxWebSessionFactory { public: diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 0433d9e5f9..5f985fa3a1 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -93,15 +93,10 @@ void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString SetHeader("Content-Type", contentType); } -void wxWebRequest::SetCredentials(const wxString & user, const wxString & password, CredentialTarget target) -{ - wxFAIL_MSG("not implemented"); -} - void wxWebRequest::SetState(State state, const wxString & failMsg) { // Add a reference while the request is active - if (state == State_Active && m_state != State_Active) + if (state == State_Active && m_state != State_Active && m_state != State_Unauthorized) IncRef(); // Trigger the event in the main thread diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index e2e9663e03..26aa705ef6 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -219,10 +219,20 @@ void wxWebRequestWinHTTP::CreateResponse() if (::WinHttpReceiveResponse(m_request, NULL)) { m_response.reset(new wxWebResponseWinHTTP(*this)); - if (CheckServerStatus()) + int status = m_response->GetStatus(); + if ( status == 401 || status == 407) + { + m_authChallenge.reset(new wxWebAuthChallengeWinHTTP( + (status == 407) ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); + if ( m_authChallenge->Init() ) + SetState(State_Unauthorized, m_response->GetStatusText()); + else + SetFailedWithLastError(); + } + else if ( CheckServerStatus() ) { // Start reading the response - if (!m_response->ReadData()) + if ( !m_response->ReadData() ) SetFailedWithLastError(); } } @@ -297,16 +307,21 @@ void wxWebRequestWinHTTP::Start() return; } + SendRequest(); +} + +void wxWebRequestWinHTTP::SendRequest() +{ // Combine all headers to a string wxString allHeaders; - for (wxWebRequestHeaderMap::const_iterator header = m_headers.begin(); header != m_headers.end(); ++header) + for ( wxWebRequestHeaderMap::const_iterator header = m_headers.begin(); header != m_headers.end(); ++header ) allHeaders.append(wxString::Format("%s: %s\n", header->first, header->second)); if ( m_dataSize ) m_dataWritten = 0; // Send request - if ( WinHttpSendRequest(m_request, + if ( ::WinHttpSendRequest(m_request, allHeaders.wc_str(), allHeaders.length(), NULL, 0, m_dataSize, (DWORD_PTR)this) ) @@ -408,6 +423,57 @@ void wxWebResponseWinHTTP::ReportDataComplete() m_stream.reset(new wxMemoryInputStream(m_readBuffer.GetData(), m_readBuffer.GetDataLen())); } +// +// wxWebAuthChallengeWinHTTP +// +wxWebAuthChallengeWinHTTP::wxWebAuthChallengeWinHTTP(Source source, wxWebRequestWinHTTP & request): + wxWebAuthChallenge(source), + m_request(request), + m_target(0), + m_selectedScheme(0) +{ + +} + +bool wxWebAuthChallengeWinHTTP::Init() +{ + DWORD supportedSchemes; + DWORD firstScheme; + + if ( ::WinHttpQueryAuthSchemes(m_request.GetHandle(), + &supportedSchemes, &firstScheme, &m_target) ) + { + if ( supportedSchemes & WINHTTP_AUTH_SCHEME_NEGOTIATE ) + m_selectedScheme = WINHTTP_AUTH_SCHEME_NEGOTIATE; + else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_NTLM ) + m_selectedScheme = WINHTTP_AUTH_SCHEME_NTLM; + else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_PASSPORT ) + m_selectedScheme = WINHTTP_AUTH_SCHEME_PASSPORT; + else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_DIGEST ) + m_selectedScheme = WINHTTP_AUTH_SCHEME_DIGEST; + else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_BASIC ) + m_selectedScheme = WINHTTP_AUTH_SCHEME_BASIC; + else + m_selectedScheme = 0; + + if ( m_selectedScheme ) + return true; + } + + return false; +} + +void wxWebAuthChallengeWinHTTP::SetCredentials(const wxString& user, + const wxString& password) +{ + if ( ::WinHttpSetCredentials(m_request.GetHandle(), m_target, m_selectedScheme, + user.wc_str(), password.wc_str(), NULL) ) + m_request.SendRequest(); + else + m_request.SetFailedWithLastError(); +} + + // // wxWebSessionWinHTTP // diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 147c3f9e5c..9d40350e01 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -57,6 +57,7 @@ public: { switch (evt.GetState()) { + case wxWebRequest::State_Unauthorized: case wxWebRequest::State_Completed: case wxWebRequest::State_Failed: case wxWebRequest::State_Cancelled: @@ -124,6 +125,28 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][.]") request->SetMethod("PUT"); Run(); } + + SECTION("Server auth BASIC") + { + Create("/digest-auth/auth/wxtest/wxwidgets"); + Run(wxWebRequest::State_Unauthorized, 401); + REQUIRE( request->GetAuthChallenge() != NULL ); + request->GetAuthChallenge()->SetCredentials("wxtest", "wxwidgets"); + loop.Run(); + REQUIRE( request->GetResponse()->GetStatus() == 200 ); + REQUIRE( request->GetState() == wxWebRequest::State_Completed ); + } + + SECTION("Server auth DIGEST") + { + Create("/digest-auth/auth/wxtest/wxwidgets"); + Run(wxWebRequest::State_Unauthorized, 401); + REQUIRE( request->GetAuthChallenge() != NULL ); + request->GetAuthChallenge()->SetCredentials("wxtest", "wxwidgets"); + loop.Run(); + REQUIRE( request->GetResponse()->GetStatus() == 200 ); + REQUIRE( request->GetState() == wxWebRequest::State_Completed ); + } } #endif // wxUSE_WEBREQUEST From 03e9b1b5493f3d7c542bba3073bd3b43ad3dd65f Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 26 Oct 2018 22:27:48 +0200 Subject: [PATCH 021/218] Remove progress events --- include/wx/webrequest.h | 2 -- src/common/webrequest.cpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 31987d0706..da6ec690e5 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -215,8 +215,6 @@ private: wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_STATE, wxWebRequestEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_DATA, wxWebRequestEvent); -wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_DOWNLOAD_PROGRESS, wxWebRequestEvent); -wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_WEBREQUEST_UPLOAD_PROGRESS, wxWebRequestEvent); #endif // wxUSE_WEBREQUEST diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 5f985fa3a1..4432762d77 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -48,8 +48,6 @@ extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[] = "wxWebSes wxDEFINE_EVENT(wxEVT_WEBREQUEST_STATE, wxWebRequestEvent); wxDEFINE_EVENT(wxEVT_WEBREQUEST_DATA, wxWebRequestEvent); -wxDEFINE_EVENT(wxEVT_WEBREQUEST_DOWNLOAD_PROGRESS, wxWebRequestEvent); -wxDEFINE_EVENT(wxEVT_WEBREQUEST_UPLOAD_PROGRESS, wxWebRequestEvent); // // wxWebRequest From f1d0a0091182bd1a9ab2c518c44cfea4239acde2 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 26 Oct 2018 23:04:31 +0200 Subject: [PATCH 022/218] Update wxWebRequest documentation --- interface/wx/webrequest.h | 124 +++++++++++++++++++++++++------------- 1 file changed, 83 insertions(+), 41 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 8ba0ce6934..cefcb69e1f 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -101,12 +101,6 @@ The request state changed. @event{wxEVT_WEBREQUEST_DATA(id, func)} A new block of data has been downloaded. - @event{wxEVT_WEBREQUEST_DOWNLOAD_PROGRESS(id, func)} - This event periodically reports the download progress while the request - is active. - @event{wxEVT_WEBREQUEST_UPLOAD_PROGRESS(id, func)} - This event periodically reports the upload progress while the request - is active. @endEventTable @since 3.1.2 @@ -164,6 +158,43 @@ public: Storage_None }; + /** + Send the request to the server asynchronously. + + Events will be triggered on success or failure. + + @see Cancel() + */ + void Start(); + + /** + Cancel an active request. + */ + void Cancel(); + + /** + Returns a response object after a successful request. + + Before sending a request or after a failed request this will return + @c NULL. + */ + wxWebResponse* GetResponse(); + + /** + Returns the current authentication challenge object while the request + is in @c State_Unauthorized. + */ + wxWebAuthChallenge* GetAuthChallenge(); + + /** + Returns the id specified while creating this request. + */ + int GetId() const; + + /** @name Request options + Methods that set options before starting the request + */ + ///@{ /** Sets a request header which will be sent to the server by this request. @@ -226,13 +257,6 @@ public: void SetData(wxSharedPtr dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); - /** - Returns the current authentication challenge object while the request - is in @c State_Unauthorized. - */ - wxWebAuthChallenge* GetAuthChallenge(); - - /** Instructs the request to ignore server error status codes. @@ -268,38 +292,34 @@ public: server. */ void SetStorage(Storage storage); + ///@} - /** - Send the request to the server asynchronously. - - Events will be triggered on success or failure. - - @see Cancel() + /** @name Progress methods + Methods that describe the requests progress */ - void Start(); - - /** - Cancel an active request. - */ - void Cancel(); - - /** - Returns a response object after a successful request. - - Before sending a request or after a failed request this will return - @c NULL. - */ - wxWebResponse* GetResponse(); - - /** - Returns the id specified while creating this request. - */ - int GetId() const; - + ///@{ /** Returns the current state of the request. */ State GetState() const { return m_state; } + + /// Returns the number of bytes sent to the server. + wxFileOffset GetBytesSent() const; + + /// Returns the number of bytes expected to be send to the server. + wxFileOffset GetBytesExpectedToSend() const; + + /// Returns the number of bytes received from the server. + wxFileOffset GetBytesReceived() const; + + /** + Returns the number of bytes expected to be received from the server. + + This value is based on the @c Content-Length header, if none is found + it will return -1. + */ + wxFileOffset GetBytesExpectedToReceive() const; + ///@} }; /** @@ -311,6 +331,20 @@ public: class wxWebAuthChallenge { public: + enum Source + { + /// The server requested authentication + Source_Server, + + /// A proxy requested authentication + Source_Proxy + }; + + /** + Returns which source requested credentials with this challenge. + */ + Source GetSource() const { return m_source; } + /** Used to provide user credentials to the authentication challenge. @@ -350,6 +384,11 @@ public: */ wxString GetHeader(const wxString& name) const; + /** + Returns the MIME type of the response (if available). + */ + wxString GetMimeType() const; + /** Returns the status code returned by the server. */ @@ -365,6 +404,11 @@ public: */ wxInputStream* GetStream(); + /** + Returns a suggested filename for the response data. + */ + wxString GetSuggestedFileName() const; + /** Returns all response data as a string. @@ -540,5 +584,3 @@ public: wxEventType wxEVT_WEBREQUEST_STATE; wxEventType wxEVT_WEBREQUEST_DATA; -wxEventType wxEVT_WEBREQUEST_DOWNLOAD_PROGRESS; -wxEventType wxEVT_WEBREQUEST_UPLOAD_PROGRESS; From 871049f1a15a23b4aa7a86ae8e7440a77f89a733 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 26 Oct 2018 23:23:58 +0200 Subject: [PATCH 023/218] Implement wxWebResponse::GetMimeType() and GetSuggestedFileName() --- include/wx/webrequest.h | 4 ++++ src/common/webrequest.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index da6ec690e5..62d5ac4884 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -103,12 +103,16 @@ public: virtual wxString GetHeader(const wxString& name) const = 0; + virtual wxString GetMimeType() const; + virtual int GetStatus() const = 0; virtual wxString GetStatusText() const = 0; virtual wxInputStream* GetStream() const = 0; + virtual wxString GetSuggestedFileName() const; + virtual wxString AsString(wxMBConv* conv = NULL) const = 0; protected: diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 4432762d77..20f6afa719 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -18,6 +18,8 @@ #include "wx/webrequest.h" #include "wx/mstream.h" +#include "wx/uri.h" +#include "wx/filename.h" #ifndef WX_PRECOMP #include "wx/app.h" @@ -113,6 +115,33 @@ void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) m_state = state; } +// +// wxWebResponse +// +wxString wxWebResponse::GetMimeType() const +{ + return GetHeader("Mime-Type"); +} + +wxString wxWebResponse::GetSuggestedFileName() const +{ + wxString suggestedFilename; + + // TODO: get from Content-Disposition header + + wxURI uri(GetURL()); + if ( uri.HasPath() ) + { + wxFileName fn(uri.GetPath()); + suggestedFilename = fn.GetFullName(); + } + else + suggestedFilename = uri.GetServer(); + + return suggestedFilename; +} + + // // wxWebSession // From cf85c04d256128f7314b03b1b6a6b8f74ff2d8a6 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 26 Oct 2018 23:38:40 +0200 Subject: [PATCH 024/218] Add wxWebRequest progress methods --- include/wx/msw/webrequest_winhttp.h | 11 +++++++++++ include/wx/webrequest.h | 8 ++++++++ src/msw/webrequest_winhttp.cpp | 7 ++++++- tests/net/webrequest.cpp | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index 5da61c7772..b6e707cdc4 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -84,6 +84,14 @@ public: wxWebAuthChallenge* GetAuthChallenge() const wxOVERRIDE { return m_authChallenge.get(); } + wxFileOffset GetBytesSent() const wxOVERRIDE { return m_dataWritten; } + + wxFileOffset GetBytesExpectedToSend() const wxOVERRIDE { return m_dataSize; } + + wxFileOffset GetBytesReceived() const wxOVERRIDE { return m_bytesReceived; } + + wxFileOffset GetBytesExpectedToReceive() const wxOVERRIDE { return m_bytesExpectedToReceive; } + void HandleCallback(DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength); @@ -98,6 +106,8 @@ private: wxScopedPtr m_authChallenge; wxMemoryBuffer m_dataWriteBuffer; wxFileOffset m_dataWritten; + wxFileOffset m_bytesExpectedToReceive; + wxFileOffset m_bytesReceived; void SendRequest(); @@ -108,6 +118,7 @@ private: void SetFailedWithLastError(); friend class wxWebAuthChallengeWinHTTP; + friend class wxWebResponseWinHTTP; wxDECLARE_NO_COPY_CLASS(wxWebRequestWinHTTP); }; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 62d5ac4884..d670a6fe56 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -65,6 +65,14 @@ public: State GetState() const { return m_state; } + virtual wxFileOffset GetBytesSent() const = 0; + + virtual wxFileOffset GetBytesExpectedToSend() const = 0; + + virtual wxFileOffset GetBytesReceived() const = 0; + + virtual wxFileOffset GetBytesExpectedToReceive() const = 0; + protected: wxString m_method; wxWebRequestHeaderMap m_headers; diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 26aa705ef6..76248d45f2 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -147,7 +147,10 @@ wxWebRequestWinHTTP::wxWebRequestWinHTTP(int id, wxWebSessionWinHTTP& session, c m_session(session), m_url(url), m_connect(NULL), - m_request(NULL) + m_request(NULL), + m_dataWritten(0), + m_bytesExpectedToReceive(0), + m_bytesReceived(0) { m_headers = session.GetHeaders(); } @@ -219,6 +222,7 @@ void wxWebRequestWinHTTP::CreateResponse() if (::WinHttpReceiveResponse(m_request, NULL)) { m_response.reset(new wxWebResponseWinHTTP(*this)); + m_bytesExpectedToReceive = m_response->GetContentLength(); int status = m_response->GetStatus(); if ( status == 401 || status == 407) { @@ -415,6 +419,7 @@ bool wxWebResponseWinHTTP::ReadData() bool wxWebResponseWinHTTP::ReportAvailableData(DWORD dataLen) { m_readBuffer.UngetAppendBuf(dataLen); + m_request.m_bytesReceived += dataLen; return ReadData(); } diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 9d40350e01..4092036efa 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -96,6 +96,8 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][.]") Create("/bytes/65536"); Run(); REQUIRE( request->GetResponse()->GetContentLength() == 65536 ); + REQUIRE( request->GetBytesExpectedToReceive() == 65536 ); + REQUIRE( request->GetBytesReceived() == 65536 ); } SECTION("GET 404 error") From 566056508183eba065a43770fb7324249e148c12 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 29 Oct 2018 22:06:15 +0100 Subject: [PATCH 025/218] Prepare wxWebRequest::SetStorage() implementation --- include/wx/webrequest.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index d670a6fe56..20d8b2b59c 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -40,6 +40,13 @@ public: State_Cancelled }; + enum Storage + { + Storage_Memory, + Storage_File, + Storage_None + }; + virtual ~wxWebRequest() { } virtual void SetHeader(const wxString& name, const wxString& value) @@ -53,6 +60,8 @@ public: void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } + virtual void SetStorage(Storage storage); + virtual void Start() = 0; virtual void Cancel() = 0; @@ -75,6 +84,7 @@ public: protected: wxString m_method; + Storage m_storage; wxWebRequestHeaderMap m_headers; wxFileOffset m_dataSize; wxSharedPtr m_dataStream; @@ -83,7 +93,8 @@ protected: m_id(id), m_state(State_Idle), m_ignoreServerErrorStatus(false), - m_dataSize(0) { } + m_dataSize(0), + m_storage(Storage_Memory) { } void SetState(State state, const wxString& failMsg = ""); From 6530e3c08e4007a600147a6c68b10d919274e670 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 29 Oct 2018 23:00:08 +0100 Subject: [PATCH 026/218] Move response data handling to base class --- include/wx/msw/webrequest_winhttp.h | 11 +------ include/wx/webrequest.h | 35 +++++++++++++++------- src/common/webrequest.cpp | 36 +++++++++++++++++++++++ src/msw/webrequest_winhttp.cpp | 45 +++++++---------------------- 4 files changed, 72 insertions(+), 55 deletions(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index b6e707cdc4..b23d7e2dff 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -32,22 +32,13 @@ public: wxString GetStatusText() const wxOVERRIDE; - wxInputStream* GetStream() const wxOVERRIDE; - - wxString AsString(wxMBConv* conv = NULL) const wxOVERRIDE; - bool ReadData(); bool ReportAvailableData(DWORD dataLen); - void ReportDataComplete(); - private: - wxWebRequestWinHTTP& m_request; + HINTERNET m_requestHandle; wxInt64 m_contentLength; - long m_readSize; - wxMemoryBuffer m_readBuffer; - wxScopedPtr m_stream; wxDECLARE_NO_COPY_CLASS(wxWebResponseWinHTTP); }; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 20d8b2b59c..50d5974564 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -40,12 +40,12 @@ public: State_Cancelled }; - enum Storage - { - Storage_Memory, - Storage_File, - Storage_None - }; + enum Storage + { + Storage_Memory, + Storage_File, + Storage_None + }; virtual ~wxWebRequest() { } @@ -60,8 +60,10 @@ public: void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } - virtual void SetStorage(Storage storage); - + virtual void SetStorage(Storage storage) { m_storage = storage; } + + Storage GetStorage() const { return m_storage; } + virtual void Start() = 0; virtual void Cancel() = 0; @@ -128,16 +130,27 @@ public: virtual wxString GetStatusText() const = 0; - virtual wxInputStream* GetStream() const = 0; + virtual wxInputStream* GetStream() const; virtual wxString GetSuggestedFileName() const; - virtual wxString AsString(wxMBConv* conv = NULL) const = 0; + wxString AsString(wxMBConv* conv = NULL) const; protected: - wxWebResponse() { } + wxWebRequest& m_request; + size_t m_readSize; + + wxWebResponse(wxWebRequest& request): + m_request(request), m_readSize(8 * 1024) { } + + void* GetDataBuffer(size_t sizeNeeded); + + void ReportDataReceived(size_t sizeReceived); private: + wxMemoryBuffer m_readBuffer; + mutable wxScopedPtr m_stream; + wxDECLARE_NO_COPY_CLASS(wxWebResponse); }; diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 20f6afa719..997054aadc 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -123,6 +123,17 @@ wxString wxWebResponse::GetMimeType() const return GetHeader("Mime-Type"); } +wxInputStream * wxWebResponse::GetStream() const +{ + if ( !m_stream.get() ) + { + // Create stream + m_stream.reset(new wxMemoryInputStream(m_readBuffer.GetData(), m_readBuffer.GetDataLen())); + } + + return m_stream.get(); +} + wxString wxWebResponse::GetSuggestedFileName() const { wxString suggestedFilename; @@ -141,6 +152,31 @@ wxString wxWebResponse::GetSuggestedFileName() const return suggestedFilename; } +wxString wxWebResponse::AsString(wxMBConv * conv) const +{ + // TODO: try to determine encoding type from content-type header + if (!conv) + conv = &wxConvUTF8; + + if (m_request.GetStorage() == wxWebRequest::Storage_Memory) + { + size_t outLen = 0; + return conv->cMB2WC((const char*)m_readBuffer.GetData(), m_readBuffer.GetDataLen(), &outLen); + } + else + return wxString(); +} + +void* wxWebResponse::GetDataBuffer(size_t sizeNeeded) +{ + return m_readBuffer.GetAppendBuf(sizeNeeded); +} + +void wxWebResponse::ReportDataReceived(size_t sizeReceived) +{ + m_readBuffer.UngetAppendBuf(sizeReceived); +} + // // wxWebSession diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 76248d45f2..394c56e2a8 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -181,10 +181,7 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, SetFailedWithLastError(); } else - { - m_response->ReportDataComplete(); SetState(State_Completed); - } break; case WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE: WriteData(); @@ -351,10 +348,10 @@ wxWebResponse* wxWebRequestWinHTTP::GetResponse() // wxWebResponseWinHTTP::wxWebResponseWinHTTP(wxWebRequestWinHTTP& request): - m_request(request), - m_readSize(8 * 1024) + wxWebResponse(request), + m_requestHandle(request.GetHandle()) { - wxString contentLengthStr = wxWinHTTPQueryHeaderString(m_request.GetHandle(), + wxString contentLengthStr = wxWinHTTPQueryHeaderString(m_requestHandle, WINHTTP_QUERY_CONTENT_LENGTH); if ( contentLengthStr.empty() || !contentLengthStr.ToLongLong(&m_contentLength) ) @@ -363,12 +360,12 @@ wxWebResponseWinHTTP::wxWebResponseWinHTTP(wxWebRequestWinHTTP& request): wxString wxWebResponseWinHTTP::GetURL() const { - return wxWinHTTPQueryOptionString(m_request.GetHandle(), WINHTTP_OPTION_URL); + return wxWinHTTPQueryOptionString(m_requestHandle, WINHTTP_OPTION_URL); } wxString wxWebResponseWinHTTP::GetHeader(const wxString& name) const { - return wxWinHTTPQueryHeaderString(m_request.GetHandle(), + return wxWinHTTPQueryHeaderString(m_requestHandle, WINHTTP_QUERY_CUSTOM, name.wc_str()); } @@ -376,7 +373,7 @@ int wxWebResponseWinHTTP::GetStatus() const { DWORD status = 0; DWORD statusSize = sizeof(status); - if ( !::WinHttpQueryHeaders(m_request.GetHandle(), + if ( !::WinHttpQueryHeaders(m_requestHandle, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, WINHTTP_HEADER_NAME_BY_INDEX, &status, &statusSize, 0) ) { @@ -389,28 +386,13 @@ int wxWebResponseWinHTTP::GetStatus() const wxString wxWebResponseWinHTTP::GetStatusText() const { - return wxWinHTTPQueryHeaderString(m_request.GetHandle(), WINHTTP_QUERY_STATUS_TEXT); -} - -wxInputStream* wxWebResponseWinHTTP::GetStream() const -{ - return m_stream.get(); -} - -wxString wxWebResponseWinHTTP::AsString(wxMBConv* conv) const -{ - // TODO: try to determine encoding type from content-type header - if ( !conv ) - conv = &wxConvUTF8; - - size_t outLen = 0; - return conv->cMB2WC((const char*) m_readBuffer.GetData(), m_readBuffer.GetDataLen(), &outLen); + return wxWinHTTPQueryHeaderString(m_requestHandle, WINHTTP_QUERY_STATUS_TEXT); } bool wxWebResponseWinHTTP::ReadData() { - if ( ::WinHttpReadData(m_request.GetHandle(), - m_readBuffer.GetAppendBuf(m_readSize), m_readSize, NULL) ) + if ( ::WinHttpReadData(m_requestHandle, + GetDataBuffer(m_readSize), m_readSize, NULL) ) return true; else return false; @@ -418,16 +400,11 @@ bool wxWebResponseWinHTTP::ReadData() bool wxWebResponseWinHTTP::ReportAvailableData(DWORD dataLen) { - m_readBuffer.UngetAppendBuf(dataLen); - m_request.m_bytesReceived += dataLen; + ReportDataReceived(dataLen); + static_cast(m_request).m_bytesReceived += dataLen; return ReadData(); } -void wxWebResponseWinHTTP::ReportDataComplete() -{ - m_stream.reset(new wxMemoryInputStream(m_readBuffer.GetData(), m_readBuffer.GetDataLen())); -} - // // wxWebAuthChallengeWinHTTP // From d4362f4bcad8ecce3ae406e955b51e89d04ec0f2 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 29 Oct 2018 23:20:47 +0100 Subject: [PATCH 027/218] Add wxWebResponse::AsString() test --- tests/net/webrequest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 4092036efa..f7e68f3f39 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -119,6 +119,13 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][.]") Run(); } + SECTION("GET data as string") + { + Create("/base64/VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw=="); + Run(); + REQUIRE( request->GetResponse()->AsString() == "The quick brown fox jumps over the lazy dog" ); + } + SECTION("PUT file data") { Create("/put"); From c24efa98216b7bfd25a59b6a1c3f363cc33e534d Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Tue, 30 Oct 2018 21:54:40 +0100 Subject: [PATCH 028/218] Implement additional storage targets --- include/wx/msw/webrequest_winhttp.h | 1 - include/wx/webrequest.h | 45 ++++++++++-- src/common/webrequest.cpp | 103 +++++++++++++++++++++++++++- src/msw/webrequest_winhttp.cpp | 15 ++-- tests/net/webrequest.cpp | 41 ++++++++++- 5 files changed, 188 insertions(+), 17 deletions(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index b23d7e2dff..d11a1b327c 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -89,7 +89,6 @@ public: HINTERNET GetHandle() const { return m_request; } private: - wxWebSessionWinHTTP& m_session; wxString m_url; HINTERNET m_connect; HINTERNET m_request; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 50d5974564..60d874266d 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -15,6 +15,7 @@ #if wxUSE_WEBREQUEST #include "wx/event.h" +#include "wx/ffile.h" #include "wx/object.h" #include "wx/scopedptr.h" #include "wx/sharedptr.h" @@ -74,6 +75,8 @@ public: int GetId() const { return m_id; } + wxWebSession& GetSession() const { return m_session; } + State GetState() const { return m_state; } virtual wxFileOffset GetBytesSent() const = 0; @@ -84,6 +87,8 @@ public: virtual wxFileOffset GetBytesExpectedToReceive() const = 0; + void SetState(State state, const wxString& failMsg = ""); + protected: wxString m_method; Storage m_storage; @@ -91,18 +96,18 @@ protected: wxFileOffset m_dataSize; wxSharedPtr m_dataStream; - wxWebRequest(int id): + wxWebRequest(wxWebSession& session, int id): + m_session(session), m_id(id), m_state(State_Idle), m_ignoreServerErrorStatus(false), m_dataSize(0), m_storage(Storage_Memory) { } - void SetState(State state, const wxString& failMsg = ""); - bool CheckServerStatus(); private: + wxWebSession& m_session; int m_id; State m_state; bool m_ignoreServerErrorStatus; @@ -116,7 +121,7 @@ private: class WXDLLIMPEXP_NET wxWebResponse { public: - virtual ~wxWebResponse() { } + virtual ~wxWebResponse(); virtual wxInt64 GetContentLength() const = 0; @@ -136,12 +141,17 @@ public: wxString AsString(wxMBConv* conv = NULL) const; + void ReportDataCompleted(); + + bool Init(); + + virtual wxString GetFileName() const; + protected: wxWebRequest& m_request; size_t m_readSize; - wxWebResponse(wxWebRequest& request): - m_request(request), m_readSize(8 * 1024) { } + wxWebResponse(wxWebRequest& request); void* GetDataBuffer(size_t sizeNeeded); @@ -149,6 +159,7 @@ protected: private: wxMemoryBuffer m_readBuffer; + mutable wxFFile m_file; mutable wxScopedPtr m_stream; wxDECLARE_NO_COPY_CLASS(wxWebResponse); @@ -205,6 +216,10 @@ public: const wxWebRequestHeaderMap& GetHeaders() const { return m_headers; } + void SetTempDir(const wxString& dir) { m_tempDir = dir; } + + wxString GetTempDir() const; + static wxWebSession& GetDefault(); static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); @@ -218,6 +233,7 @@ protected: private: wxWebRequestHeaderMap m_headers; + wxString m_tempDir; static wxScopedPtr ms_defaultSession; static wxStringWebSessionFactoryMap ms_factoryMap; @@ -232,7 +248,8 @@ public: wxWebRequestEvent(wxEventType type, int id, wxWebRequest::State state, wxWebResponse* response = NULL, const wxString& errorDesc = "") : wxEvent(id, type), - m_state(state), m_response(response), m_errorDescription(errorDesc) + m_state(state), m_response(response), m_data(NULL), m_dataSize(0), + m_errorDescription(errorDesc) { } wxWebRequest::State GetState() const { return m_state; } @@ -241,11 +258,25 @@ public: const wxString& GetErrorDescription() const { return m_errorDescription; } + const wxString& GetResponseFileName() const { return m_responseFileName; } + + void SetResponseFileName(const wxString& filename) { m_responseFileName = filename; } + + const void* GetDataBuffer() const { return m_data; } + + size_t GetDataSize() const { return m_dataSize; } + + void SetDataBuffer(const void* buffer, size_t size) + { m_data = buffer; m_dataSize = size; } + wxEvent* Clone() const wxOVERRIDE { return new wxWebRequestEvent(*this); } private: wxWebRequest::State m_state; wxWebResponse* m_response; + wxString m_responseFileName; + const void* m_data; + size_t m_dataSize; wxString m_errorDescription; }; diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 997054aadc..276da34727 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -19,7 +19,10 @@ #include "wx/webrequest.h" #include "wx/mstream.h" #include "wx/uri.h" +#include "wx/filefn.h" #include "wx/filename.h" +#include "wx/stdpaths.h" +#include "wx/wfstream.h" #ifndef WX_PRECOMP #include "wx/app.h" @@ -105,9 +108,23 @@ void wxWebRequest::SetState(State state, const wxString & failMsg) void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) { + wxString responseFileName; + wxWebRequestEvent evt(wxEVT_WEBREQUEST_STATE, GetId(), state, GetResponse(), failMsg); + if ( state == State_Completed && m_storage == Storage::Storage_File ) + { + responseFileName = GetResponse()->GetFileName(); + evt.SetResponseFileName(responseFileName); + } + ProcessEvent(evt); + + // Remove temporary file if it still exists + if ( state == State_Completed && m_storage == Storage::Storage_File && + wxFileExists(responseFileName) ) + wxRemove(responseFileName); + // Remove reference after the request is no longer active if (state == State_Completed || state == State_Failed || state == State_Cancelled) @@ -118,6 +135,43 @@ void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) // // wxWebResponse // +wxWebResponse::wxWebResponse(wxWebRequest& request) : + m_request(request), + m_readSize(8 * 1024) +{ +} + +wxWebResponse::~wxWebResponse() +{ + if ( wxFileExists(m_file.GetName()) ) + wxRemove(m_file.GetName()); +} + +bool wxWebResponse::Init() +{ + if (m_request.GetStorage() == wxWebRequest::Storage_File) + { + wxFileName tmpPrefix; + tmpPrefix.AssignDir(m_request.GetSession().GetTempDir()); + if ( GetContentLength() > 0 ) + { + // Check available disk space + wxLongLong freeSpace; + if ( wxGetDiskSpace(tmpPrefix.GetFullPath(), NULL, &freeSpace) && + GetContentLength() > freeSpace ) + { + m_request.SetState(wxWebRequest::State_Failed, _("Not enough free disk space for download.")); + return false; + } + } + + tmpPrefix.SetName("wxd"); + wxFileName::CreateTempFileName(tmpPrefix.GetFullPath(), &m_file); + } + + return true; +} + wxString wxWebResponse::GetMimeType() const { return GetHeader("Mime-Type"); @@ -128,7 +182,20 @@ wxInputStream * wxWebResponse::GetStream() const if ( !m_stream.get() ) { // Create stream - m_stream.reset(new wxMemoryInputStream(m_readBuffer.GetData(), m_readBuffer.GetDataLen())); + switch (m_request.GetStorage()) + { + case wxWebRequest::Storage_Memory: + m_stream.reset(new wxMemoryInputStream(m_readBuffer.GetData(), m_readBuffer.GetDataLen())); + break; + case wxWebRequest::Storage_File: + m_stream.reset(new wxFFileInputStream(m_file)); + m_stream->SeekI(0); + break; + case wxWebRequest::Storage_None: + // No stream available + break; + } + } return m_stream.get(); @@ -155,10 +222,10 @@ wxString wxWebResponse::GetSuggestedFileName() const wxString wxWebResponse::AsString(wxMBConv * conv) const { // TODO: try to determine encoding type from content-type header - if (!conv) + if ( !conv ) conv = &wxConvUTF8; - if (m_request.GetStorage() == wxWebRequest::Storage_Memory) + if ( m_request.GetStorage() == wxWebRequest::Storage_Memory ) { size_t outLen = 0; return conv->cMB2WC((const char*)m_readBuffer.GetData(), m_readBuffer.GetDataLen(), &outLen); @@ -175,8 +242,30 @@ void* wxWebResponse::GetDataBuffer(size_t sizeNeeded) void wxWebResponse::ReportDataReceived(size_t sizeReceived) { m_readBuffer.UngetAppendBuf(sizeReceived); + + if ( m_request.GetStorage() == wxWebRequest::Storage_File ) + m_file.Write(m_readBuffer.GetData(), m_readBuffer.GetDataLen()); + else if ( m_request.GetStorage() == wxWebRequest::Storage_None ) + { + wxWebRequestEvent evt(wxEVT_WEBREQUEST_DATA, m_request.GetId(), wxWebRequest::State_Active); + evt.SetDataBuffer(m_readBuffer.GetData(), m_readBuffer.GetDataLen()); + m_request.ProcessEvent(evt); + } + + if ( m_request.GetStorage() != wxWebRequest::Storage_Memory ) + m_readBuffer.Clear(); } +wxString wxWebResponse::GetFileName() const +{ + return m_file.GetName(); +} + +void wxWebResponse::ReportDataCompleted() +{ + if ( m_request.GetStorage() == wxWebRequest::Storage_File ) + m_file.Close(); +} // // wxWebSession @@ -193,6 +282,14 @@ wxWebSession::wxWebSession() wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)); } +wxString wxWebSession::GetTempDir() const +{ + if ( m_tempDir.empty() ) + return wxStandardPaths::Get().GetTempDir(); + else + return m_tempDir; +} + // static wxWebSession& wxWebSession::GetDefault() { diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 394c56e2a8..55397aac54 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -143,8 +143,7 @@ static void CALLBACK wxRequestStatusCallback( // wxWebRequestWinHTTP::wxWebRequestWinHTTP(int id, wxWebSessionWinHTTP& session, const wxString& url): - wxWebRequest(id), - m_session(session), + wxWebRequest(session, id), m_url(url), m_connect(NULL), m_request(NULL), @@ -181,7 +180,10 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, SetFailedWithLastError(); } else + { + m_response->ReportDataCompleted(); SetState(State_Completed); + } break; case WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE: WriteData(); @@ -216,9 +218,11 @@ void wxWebRequestWinHTTP::WriteData() void wxWebRequestWinHTTP::CreateResponse() { - if (::WinHttpReceiveResponse(m_request, NULL)) + if ( ::WinHttpReceiveResponse(m_request, NULL) ) { m_response.reset(new wxWebResponseWinHTTP(*this)); + if ( !m_response->Init() ) + return; m_bytesExpectedToReceive = m_response->GetContentLength(); int status = m_response->GetStatus(); if ( status == 401 || status == 407) @@ -263,8 +267,9 @@ void wxWebRequestWinHTTP::Start() port = wxAtoi(uri.GetPort()); // Open a connction - m_connect = ::WinHttpConnect(m_session.GetHandle(), uri.GetServer().wc_str(), - port, 0); + m_connect = ::WinHttpConnect( + static_cast(GetSession()).GetHandle(), + uri.GetServer().wc_str(), port, 0); if ( m_connect == NULL ) { SetFailedWithLastError(); diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index f7e68f3f39..bb297c0ebc 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -22,6 +22,7 @@ #endif // WX_PRECOMP #include "wx/webrequest.h" +#include "wx/filename.h" #include "wx/wfstream.h" // This test requires the URL to an httpbin instance. @@ -38,7 +39,11 @@ class RequestFixture { public: - RequestFixture() { } + RequestFixture() + { + expectedFileSize = 0; + dataSize = 0; + } void Create(const wxString& subURL) { @@ -51,6 +56,7 @@ public: { request.reset(wxWebSession::GetDefault().CreateRequest(url)); request->Bind(wxEVT_WEBREQUEST_STATE, &RequestFixture::OnRequestState, this); + request->Bind(wxEVT_WEBREQUEST_DATA, &RequestFixture::OnData, this); } void OnRequestState(wxWebRequestEvent& evt) @@ -59,6 +65,12 @@ public: { case wxWebRequest::State_Unauthorized: case wxWebRequest::State_Completed: + if ( request->GetStorage() == wxWebRequest::Storage_File ) + { + wxFileName fn(evt.GetResponseFileName()); + REQUIRE( fn.GetSize() == expectedFileSize ); + } + wxFALLTHROUGH; case wxWebRequest::State_Failed: case wxWebRequest::State_Cancelled: loop.Exit(); @@ -66,6 +78,12 @@ public: } } + void OnData(wxWebRequestEvent& evt) + { + // Count all bytes recieved via data event for Storage_None + dataSize += evt.GetDataSize(); + } + void Run(wxWebRequest::State requiredState = wxWebRequest::State_Completed, int requiredStatus = 200) { @@ -79,6 +97,8 @@ public: wxEventLoop loop; wxObjectDataPtr request; + wxInt64 expectedFileSize; + wxInt64 dataSize; }; TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][.]") @@ -126,6 +146,25 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][.]") REQUIRE( request->GetResponse()->AsString() == "The quick brown fox jumps over the lazy dog" ); } + SECTION("GET 99KB to file") + { + expectedFileSize = 99 * 1024; + Create(wxString::Format("/bytes/%lld", expectedFileSize)); + request->SetStorage(wxWebRequest::Storage_File); + Run(); + REQUIRE( request->GetBytesReceived() == expectedFileSize ); + } + + SECTION("Process 99KB data") + { + int processingSize = 99 * 1024; + Create(wxString::Format("/bytes/%d", processingSize)); + request->SetStorage(wxWebRequest::Storage_None); + Run(); + REQUIRE( request->GetBytesReceived() == processingSize ); + REQUIRE( dataSize == processingSize ); + } + SECTION("PUT file data") { Create("/put"); From faa81dcdf1e865c50977c047d0c93f5ba3e3822e Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Tue, 30 Oct 2018 22:59:57 +0100 Subject: [PATCH 029/218] Update documentation --- interface/wx/webrequest.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index cefcb69e1f..f5a8a0eeee 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -485,7 +485,7 @@ public: @see SetTempDir() */ - const &wxString GetTempDir() const; + const wxString& GetTempDir() const; /** Returns the default session @@ -577,9 +577,34 @@ public: /** A textual error description for a client side error - in case of wxEVT_WEBREQUEST_FAILED + in case of @c State_Failed */ const wxString& GetErrorDescription() const; + + /** + Returns a file name to a temporary file containing the response data + when the state is @c State_Completed and storage is @Storage_File. + + The file will be removed after the event handlers are called. You can + move the file to location of your choice if you want to process the + contents outside of the event handler. + */ + const wxString& GetResponseFileName() const; + + void SetResponseFileName(const wxString& filename); + + /** + Only for @c wxEVT_WEBREQUEST_DATA events. The buffer is only valid + in the event handler. + */ + ///@{ + const void* GetDataBuffer() const; + + size_t GetDataSize() const; + ///@} + + void SetDataBuffer(const void* buffer, size_t size); + }; wxEventType wxEVT_WEBREQUEST_STATE; From e9618ce657d8d236c339648d10082f7ee0553351 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 31 Oct 2018 00:12:33 +0100 Subject: [PATCH 030/218] Implement Download page in webrequest sample --- samples/webrequest/webrequest.cpp | 110 ++++++++++++++++++++++++++++-- 1 file changed, 104 insertions(+), 6 deletions(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index e2ceb6f354..a8f675dea8 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -21,6 +21,7 @@ #include "wx/notebook.h" #include "wx/artprov.h" #include "wx/webrequest.h" +#include "wx/filedlg.h" #ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" @@ -103,11 +104,41 @@ public: // Download page wxPanel* downloadPanel = new wxPanel(m_notebook); + wxSizer* downloadSizer = new wxBoxSizer(wxVERTICAL); + wxStaticText* downloadHeader = new wxStaticText(downloadPanel, wxID_ANY, + "The URL will be downloaded to a file.\n"\ + "Progress will be shown and you will be asked, where\n"\ + "to save the file when the download completed."); + downloadSizer->Add(downloadHeader, wxSizerFlags().Expand().Border()); + downloadSizer->AddStretchSpacer(); + m_downloadGauge = new wxGauge(downloadPanel, wxID_ANY, 100); + downloadSizer->Add(m_downloadGauge, wxSizerFlags().Expand().Border()); + m_downloadStaticText = new wxStaticText(downloadPanel, wxID_ANY, ""); + downloadSizer->Add(m_downloadStaticText, wxSizerFlags().Expand().Border()); + downloadSizer->AddStretchSpacer(); + + downloadPanel->SetSizer(downloadSizer); m_notebook->AddPage(downloadPanel, "Download"); // Advanced page wxPanel* advancedPanel = new wxPanel(m_notebook); + wxSizer* advSizer = new wxBoxSizer(wxVERTICAL); + wxStaticText* advHeader = new wxStaticText(advancedPanel, wxID_ANY, + "As an example of processing data while\n"\ + "it's being received from the server every\n"\ + "zero byte in the response will be counted below."); + advSizer->Add(advHeader, wxSizerFlags().Expand().Border()); + + advSizer->AddStretchSpacer(); + m_advCountStaticText = new wxStaticText(advancedPanel, wxID_ANY, "0", + wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE_HORIZONTAL | wxST_NO_AUTORESIZE); + m_advCountStaticText->SetFont(m_advCountStaticText->GetFont() + .MakeBold().MakeLarger().MakeLarger()); + advSizer->Add(m_advCountStaticText, wxSizerFlags().Expand().Border()); + advSizer->AddStretchSpacer(); + + advancedPanel->SetSizer(advSizer); m_notebook->AddPage(advancedPanel, "Advanced"); @@ -123,9 +154,14 @@ public: SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); SetSizer(mainSizer); - SetSize(FromDIP(wxSize(400, 500))); + SetSize(FromDIP(wxSize(540, 500))); CreateStatusBar(); + + m_downloadProgressTimer.Bind(wxEVT_TIMER, + &WebRequestFrame::OnProgressTimer, this); + + m_downloadRequest = NULL; } void OnStartButton(wxCommandEvent& WXUNUSED(evt)) @@ -158,10 +194,19 @@ public: } break; case Page_Download: - // TODO: implement + m_downloadRequest = request.get(); + request->SetStorage(wxWebRequest::Storage_File); + m_downloadGauge->SetValue(0); + m_downloadGauge->Pulse(); + m_downloadStaticText->SetLabel(""); + m_downloadProgressTimer.Start(500); + GetStatusBar()->SetStatusText(""); break; case Page_Advanced: - // TODO: implement + request->SetStorage(wxWebRequest::Storage_None); + request->Bind(wxEVT_WEBREQUEST_DATA, &WebRequestFrame::OnRequestData, this); + + m_advCountStaticText->SetLabel("0"); break; } @@ -195,15 +240,61 @@ public: evt.GetResponse()->GetStatus(), evt.GetResponse()->GetStatusText())); break; - } + case Page_Download: + { + // Force last progress update + wxTimerEvent timerEvt; + OnProgressTimer(timerEvt); + // Stop updating download progress + m_downloadRequest = NULL; + m_downloadProgressTimer.Stop(); + + GetStatusBar()->SetStatusText("Download completed"); + + // Ask the user where to save the file + wxFileDialog fileDlg(this, "Save download", "", + evt.GetResponse()->GetSuggestedFileName(), "*.*", + wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + if ( fileDlg.ShowModal() == wxID_OK ) + { + if (!wxRenameFile(evt.GetResponseFileName(), fileDlg.GetPath())) + wxLogError("Could not move file"); + } + + break; + } + } break; + case wxWebRequest::State_Failed: + // Stop updating download progress + m_downloadRequest = NULL; + m_downloadProgressTimer.Stop(); wxLogError("Web Request failed: %s", evt.GetErrorDescription()); GetStatusBar()->SetStatusText(""); + break; } } + void OnRequestData(wxWebRequestEvent& evt) + { + + } + + void OnProgressTimer(wxTimerEvent& WXUNUSED(evt)) + { + if (!m_downloadRequest || m_downloadRequest->GetBytesExpectedToReceive() <= 0) + return; + + + m_downloadGauge->SetValue((m_downloadRequest->GetBytesReceived() * 100) / + m_downloadRequest->GetBytesExpectedToReceive()); + + m_downloadStaticText->SetLabelText(wxString::Format("%lld/%lld", + m_downloadRequest->GetBytesReceived(), m_downloadRequest->GetBytesExpectedToReceive())); + } + void OnPostCheckBox(wxCommandEvent& WXUNUSED(evt)) { m_postContentTypeTextCtrl->Enable(m_postCheckBox->IsChecked()); @@ -227,10 +318,10 @@ public: defaultURL = "https://httpbin.org/post"; break; case Page_Download: - defaultURL = "https://www.wxwidgets.com/download.zip"; + defaultURL = "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.7z"; break; case Page_Advanced: - defaultURL = "https://www.wxwidgets.com/adv.zip"; + defaultURL = "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.tar.bz2"; break; } m_urlTextCtrl->SetValue(defaultURL); @@ -246,6 +337,13 @@ private: wxTextCtrl* m_postContentTypeTextCtrl; wxTextCtrl* m_postRequestTextCtrl; wxTextCtrl* m_textResponseTextCtrl; + + wxGauge* m_downloadGauge; + wxStaticText* m_downloadStaticText; + wxTimer m_downloadProgressTimer; + wxWebRequest* m_downloadRequest; + + wxStaticText* m_advCountStaticText; }; class WebRequestApp : public wxApp From 22f1894266ef58094ddac1b42d398a4185054722 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 31 Oct 2018 10:03:12 +0100 Subject: [PATCH 031/218] Fix webrequest without precomp --- src/common/webrequest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 276da34727..57368d3055 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -27,6 +27,7 @@ #ifndef WX_PRECOMP #include "wx/app.h" #include "wx/translation.h" + #include "wx/utils.h" #endif #if wxUSE_WEBREQUEST_WINHTTP From f64fbf0b4b7400feadc11b182caa9eb44965c829 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 31 Oct 2018 10:07:02 +0100 Subject: [PATCH 032/218] Remove deprecated usage of wxRemove() --- src/common/webrequest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 57368d3055..be00b4a5be 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -124,7 +124,7 @@ void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) // Remove temporary file if it still exists if ( state == State_Completed && m_storage == Storage::Storage_File && wxFileExists(responseFileName) ) - wxRemove(responseFileName); + wxRemoveFile(responseFileName); // Remove reference after the request is no longer active if (state == State_Completed || state == State_Failed || @@ -145,7 +145,7 @@ wxWebResponse::wxWebResponse(wxWebRequest& request) : wxWebResponse::~wxWebResponse() { if ( wxFileExists(m_file.GetName()) ) - wxRemove(m_file.GetName()); + wxRemoveFile(m_file.GetName()); } bool wxWebResponse::Init() From 6a23c1342ebf029e0400cdefa41be9ebd3f304ce Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 31 Oct 2018 13:42:56 +0100 Subject: [PATCH 033/218] CMake: Find CURL when wxUSE_WEBREQUEST_CURL is ON --- build/cmake/lib/net/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/cmake/lib/net/CMakeLists.txt b/build/cmake/lib/net/CMakeLists.txt index c19c24c092..7d1e71cfda 100644 --- a/build/cmake/lib/net/CMakeLists.txt +++ b/build/cmake/lib/net/CMakeLists.txt @@ -31,4 +31,11 @@ if(WIN32) endif() endif() +if (wxUSE_WEBREQUEST_CURL) + find_package(CURL REQUIRED) + + target_include_directories(net PRIVATE ${CURL_INCLUDE_DIRS}) + wx_lib_link_libraries(net PRIVATE CURL::libcurl) +endif() + wx_finalize_lib(net) From d32e27191de90c7c8c83cb396f95a1ea169fdc3a Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 31 Oct 2018 14:01:12 +0100 Subject: [PATCH 034/218] Implement advanced page in webrequest sample --- samples/webrequest/webrequest.cpp | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index a8f675dea8..d80f72865d 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -206,6 +206,8 @@ public: request->SetStorage(wxWebRequest::Storage_None); request->Bind(wxEVT_WEBREQUEST_DATA, &WebRequestFrame::OnRequestData, this); + GetStatusBar()->SetStatusText("Counting..."); + m_advCount = 0; m_advCountStaticText->SetLabel("0"); break; } @@ -264,6 +266,10 @@ public: break; } + case Page_Advanced: + UpdateAdvCount(); + GetStatusBar()->SetStatusText(""); + break; } break; @@ -279,7 +285,28 @@ public: void OnRequestData(wxWebRequestEvent& evt) { + // Count zero bytes in data buffer + bool notify = false; + const char* p = (const char*) evt.GetDataBuffer(); + for ( size_t i = 0; i < evt.GetDataSize(); i++ ) + { + if ( *p == 0 ) + { + m_advCount++; + notify = true; + } + + p++; + } + + if ( notify ) + CallAfter(&WebRequestFrame::UpdateAdvCount); + } + + void UpdateAdvCount() + { + m_advCountStaticText->SetLabel(wxString::Format("%lld", m_advCount)); } void OnProgressTimer(wxTimerEvent& WXUNUSED(evt)) @@ -321,7 +348,7 @@ public: defaultURL = "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.7z"; break; case Page_Advanced: - defaultURL = "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.tar.bz2"; + defaultURL = "https://httpbin.org/bytes/64000"; break; } m_urlTextCtrl->SetValue(defaultURL); @@ -344,6 +371,7 @@ private: wxWebRequest* m_downloadRequest; wxStaticText* m_advCountStaticText; + long long m_advCount; }; class WebRequestApp : public wxApp From 6bafed4ceb92725a3e764b10d3ba1ad768462ee9 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 31 Oct 2018 22:49:34 +0100 Subject: [PATCH 035/218] Add Cancel button to webrequest sample --- samples/webrequest/webrequest.cpp | 182 +++++++++++++++++------------- 1 file changed, 101 insertions(+), 81 deletions(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index d80f72865d..0cd6025cac 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -144,9 +144,17 @@ public: mainSizer->Add(m_notebook, wxSizerFlags(1).Expand().Border()); - m_startButton = new wxButton(this, wxID_ANY, "&Start Request"); + wxStdDialogButtonSizer* btnSizer = new wxStdDialogButtonSizer(); + m_cancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + m_cancelButton->Bind(wxEVT_BUTTON, &WebRequestFrame::OnCancelButton, this); + m_cancelButton->Disable(); + btnSizer->AddButton(m_cancelButton); + + m_startButton = new wxButton(this, wxID_OK, "&Start Request"); m_startButton->Bind(wxEVT_BUTTON, &WebRequestFrame::OnStartButton, this); - mainSizer->Add(m_startButton, wxSizerFlags().Border()); + btnSizer->AddButton(m_startButton); + btnSizer->Realize(); + mainSizer->Add(btnSizer, wxSizerFlags().Border()); wxCommandEvent evt; OnPostCheckBox(evt); @@ -161,7 +169,7 @@ public: m_downloadProgressTimer.Bind(wxEVT_TIMER, &WebRequestFrame::OnProgressTimer, this); - m_downloadRequest = NULL; + m_currentRequest = NULL; } void OnStartButton(wxCommandEvent& WXUNUSED(evt)) @@ -171,6 +179,7 @@ public: // Create request for the specified URL from the default session wxObjectDataPtr request(wxWebSession::GetDefault().CreateRequest( m_urlTextCtrl->GetValue())); + m_currentRequest = request.get(); // Bind event for state change request->Bind(wxEVT_WEBREQUEST_STATE, &WebRequestFrame::OnWebRequestState, this); @@ -178,38 +187,37 @@ public: // Prepare request based on selected action switch (m_notebook->GetSelection()) { - case Page_Image: - // Reset static bitmap image - m_imageStaticBitmap->SetBitmap(wxArtProvider::GetBitmap(wxART_MISSING_IMAGE)); - break; - case Page_Text: - // Reset response text control - m_textResponseTextCtrl->Clear(); + case Page_Image: + // Reset static bitmap image + m_imageStaticBitmap->SetBitmap(wxArtProvider::GetBitmap(wxART_MISSING_IMAGE)); + break; + case Page_Text: + // Reset response text control + m_textResponseTextCtrl->Clear(); - // Set postdata if checked - if (m_postCheckBox->IsChecked()) - { - request->SetData(m_postRequestTextCtrl->GetValue(), - m_postContentTypeTextCtrl->GetValue()); - } - break; - case Page_Download: - m_downloadRequest = request.get(); - request->SetStorage(wxWebRequest::Storage_File); - m_downloadGauge->SetValue(0); - m_downloadGauge->Pulse(); - m_downloadStaticText->SetLabel(""); - m_downloadProgressTimer.Start(500); - GetStatusBar()->SetStatusText(""); - break; - case Page_Advanced: - request->SetStorage(wxWebRequest::Storage_None); - request->Bind(wxEVT_WEBREQUEST_DATA, &WebRequestFrame::OnRequestData, this); + // Set postdata if checked + if ( m_postCheckBox->IsChecked() ) + { + request->SetData(m_postRequestTextCtrl->GetValue(), + m_postContentTypeTextCtrl->GetValue()); + } + break; + case Page_Download: + request->SetStorage(wxWebRequest::Storage_File); + m_downloadGauge->SetValue(0); + m_downloadGauge->Pulse(); + m_downloadStaticText->SetLabel(""); + m_downloadProgressTimer.Start(500); + GetStatusBar()->SetStatusText(""); + break; + case Page_Advanced: + request->SetStorage(wxWebRequest::Storage_None); + request->Bind(wxEVT_WEBREQUEST_DATA, &WebRequestFrame::OnRequestData, this); - GetStatusBar()->SetStatusText("Counting..."); - m_advCount = 0; - m_advCountStaticText->SetLabel("0"); - break; + GetStatusBar()->SetStatusText("Counting..."); + m_advCount = 0; + m_advCountStaticText->SetLabel("0"); + break; } m_startButton->Disable(); @@ -218,68 +226,79 @@ public: request->Start(); } + void OnCancelButton(wxCommandEvent& WXUNUSED(evt)) + { + if ( m_currentRequest ) + m_currentRequest->Cancel(); + } + void OnWebRequestState(wxWebRequestEvent& evt) { m_startButton->Enable(evt.GetState() != wxWebRequest::State_Active); + m_cancelButton->Enable(evt.GetState() == wxWebRequest::State_Active); + + if ( evt.GetState() != wxWebRequest::State_Active ) + { + m_currentRequest = NULL; + m_downloadProgressTimer.Stop(); + } switch (evt.GetState()) { case wxWebRequest::State_Completed: switch (m_notebook->GetSelection()) { - case Page_Image: - { - wxImage img(*evt.GetResponse()->GetStream()); - m_imageStaticBitmap->SetBitmap(img); - m_notebook->GetPage(Page_Image)->Layout(); - GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes image data", evt.GetResponse()->GetContentLength())); - break; - } - case Page_Text: - m_textResponseTextCtrl->SetValue(evt.GetResponse()->AsString()); - GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes text data (Status: %d %s)", - evt.GetResponse()->GetContentLength(), - evt.GetResponse()->GetStatus(), - evt.GetResponse()->GetStatusText())); - break; - case Page_Download: - { - // Force last progress update - wxTimerEvent timerEvt; - OnProgressTimer(timerEvt); - - // Stop updating download progress - m_downloadRequest = NULL; - m_downloadProgressTimer.Stop(); - - GetStatusBar()->SetStatusText("Download completed"); - - // Ask the user where to save the file - wxFileDialog fileDlg(this, "Save download", "", - evt.GetResponse()->GetSuggestedFileName(), "*.*", - wxFD_SAVE | wxFD_OVERWRITE_PROMPT); - if ( fileDlg.ShowModal() == wxID_OK ) + case Page_Image: { - if (!wxRenameFile(evt.GetResponseFileName(), fileDlg.GetPath())) - wxLogError("Could not move file"); + wxImage img(*evt.GetResponse()->GetStream()); + m_imageStaticBitmap->SetBitmap(img); + m_notebook->GetPage(Page_Image)->Layout(); + GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes image data", evt.GetResponse()->GetContentLength())); + break; } + case Page_Text: + m_textResponseTextCtrl->SetValue(evt.GetResponse()->AsString()); + GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes text data (Status: %d %s)", + evt.GetResponse()->GetContentLength(), + evt.GetResponse()->GetStatus(), + evt.GetResponse()->GetStatusText())); + break; + case Page_Download: + { + m_downloadGauge->SetValue(100); + m_downloadStaticText->SetLabel(""); - break; - } - case Page_Advanced: - UpdateAdvCount(); - GetStatusBar()->SetStatusText(""); - break; + GetStatusBar()->SetStatusText("Download completed"); + + // Ask the user where to save the file + wxFileDialog fileDlg(this, "Save download", "", + evt.GetResponse()->GetSuggestedFileName(), "*.*", + wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + if ( fileDlg.ShowModal() == wxID_OK ) + { + if ( !wxRenameFile(evt.GetResponseFileName(), fileDlg.GetPath()) ) + wxLogError("Could not move file"); + } + + break; + } + case Page_Advanced: + UpdateAdvCount(); + GetStatusBar()->SetStatusText(""); + break; } break; case wxWebRequest::State_Failed: - // Stop updating download progress - m_downloadRequest = NULL; - m_downloadProgressTimer.Stop(); wxLogError("Web Request failed: %s", evt.GetErrorDescription()); GetStatusBar()->SetStatusText(""); break; + + case wxWebRequest::State_Cancelled: + m_downloadGauge->SetValue(0); + m_downloadStaticText->SetLabel(""); + GetStatusBar()->SetStatusText("Cancelled"); + break; } } @@ -311,15 +330,15 @@ public: void OnProgressTimer(wxTimerEvent& WXUNUSED(evt)) { - if (!m_downloadRequest || m_downloadRequest->GetBytesExpectedToReceive() <= 0) + if ( !m_currentRequest || m_currentRequest->GetBytesExpectedToReceive() <= 0 ) return; - m_downloadGauge->SetValue((m_downloadRequest->GetBytesReceived() * 100) / - m_downloadRequest->GetBytesExpectedToReceive()); + m_downloadGauge->SetValue((m_currentRequest->GetBytesReceived() * 100) / + m_currentRequest->GetBytesExpectedToReceive()); m_downloadStaticText->SetLabelText(wxString::Format("%lld/%lld", - m_downloadRequest->GetBytesReceived(), m_downloadRequest->GetBytesExpectedToReceive())); + m_currentRequest->GetBytesReceived(), m_currentRequest->GetBytesExpectedToReceive())); } void OnPostCheckBox(wxCommandEvent& WXUNUSED(evt)) @@ -358,7 +377,9 @@ private: wxNotebook* m_notebook; wxTextCtrl* m_urlTextCtrl; wxButton* m_startButton; + wxButton* m_cancelButton; wxStaticBitmap* m_imageStaticBitmap; + wxWebRequest* m_currentRequest; wxCheckBox* m_postCheckBox; wxTextCtrl* m_postContentTypeTextCtrl; @@ -368,7 +389,6 @@ private: wxGauge* m_downloadGauge; wxStaticText* m_downloadStaticText; wxTimer m_downloadProgressTimer; - wxWebRequest* m_downloadRequest; wxStaticText* m_advCountStaticText; long long m_advCount; From 56af6cbdeec4c88127d34ccf4313adf03e04896a Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 1 Nov 2018 11:54:30 +0100 Subject: [PATCH 036/218] Implement Cancel for WinHTTP backend --- include/wx/webrequest.h | 6 ++++-- src/common/webrequest.cpp | 18 +++++++++++++----- src/msw/webrequest_winhttp.cpp | 13 ++++++++----- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 60d874266d..edd130c338 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -106,6 +106,8 @@ protected: bool CheckServerStatus(); + static bool IsActiveState(State state); + private: wxWebSession& m_session; int m_id; @@ -141,10 +143,10 @@ public: wxString AsString(wxMBConv* conv = NULL) const; - void ReportDataCompleted(); - bool Init(); + void Finalize(); + virtual wxString GetFileName() const; protected: diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index be00b4a5be..bca423a6a7 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -71,6 +71,11 @@ bool wxWebRequest::CheckServerStatus() return true; } +bool wxWebRequest::IsActiveState(State state) +{ + return (state == State_Active || state == State_Unauthorized); +} + void wxWebRequest::SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv) { m_dataText = text.mb_str(conv); @@ -100,15 +105,20 @@ void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString void wxWebRequest::SetState(State state, const wxString & failMsg) { // Add a reference while the request is active - if (state == State_Active && m_state != State_Active && m_state != State_Unauthorized) + if ( IsActiveState(state) && !IsActiveState(m_state) ) IncRef(); + m_state = state; + // Trigger the event in the main thread CallAfter(&wxWebRequest::ProcessStateEvent, state, failMsg); } void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) { + if (!IsActiveState(state) && GetResponse()) + GetResponse()->Finalize(); + wxString responseFileName; wxWebRequestEvent evt(wxEVT_WEBREQUEST_STATE, GetId(), state, @@ -127,10 +137,8 @@ void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) wxRemoveFile(responseFileName); // Remove reference after the request is no longer active - if (state == State_Completed || state == State_Failed || - state == State_Cancelled) + if ( !IsActiveState(state) ) DecRef(); - m_state = state; } // @@ -262,7 +270,7 @@ wxString wxWebResponse::GetFileName() const return m_file.GetName(); } -void wxWebResponse::ReportDataCompleted() +void wxWebResponse::Finalize() { if ( m_request.GetStorage() == wxWebRequest::Storage_File ) m_file.Close(); diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 55397aac54..1d1d6bb617 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -176,14 +176,12 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: if ( dwStatusInformationLength > 0 ) { - if ( !m_response->ReportAvailableData(dwStatusInformationLength) ) + if ( !m_response->ReportAvailableData(dwStatusInformationLength) && + GetState() != State_Cancelled ) SetFailedWithLastError(); } else - { - m_response->ReportDataCompleted(); SetState(State_Completed); - } break; case WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE: WriteData(); @@ -340,7 +338,12 @@ void wxWebRequestWinHTTP::SendRequest() void wxWebRequestWinHTTP::Cancel() { - wxFAIL_MSG("not implemented"); + SetState(State_Cancelled); + if ( m_request != NULL ) + { + ::WinHttpCloseHandle(m_request); + m_request = NULL; + } } wxWebResponse* wxWebRequestWinHTTP::GetResponse() From 17d77fe8ce99a54cde6ab60a61572ed2a57b0f5f Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 1 Nov 2018 12:11:53 +0100 Subject: [PATCH 037/218] Fix various small issues in webrequest sample --- samples/webrequest/webrequest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 0cd6025cac..7e6930d124 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -45,8 +45,6 @@ public: SetIcon(wxICON(sample)); // Prepare UI controls - - // If menus are not available add a button to access the about box wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); mainSizer->Add(new wxStaticText(this, wxID_ANY, "Request URL:"), @@ -299,6 +297,9 @@ public: m_downloadStaticText->SetLabel(""); GetStatusBar()->SetStatusText("Cancelled"); break; + + default: + break; } } @@ -332,7 +333,6 @@ public: { if ( !m_currentRequest || m_currentRequest->GetBytesExpectedToReceive() <= 0 ) return; - m_downloadGauge->SetValue((m_currentRequest->GetBytesReceived() * 100) / m_currentRequest->GetBytesExpectedToReceive()); @@ -391,7 +391,7 @@ private: wxTimer m_downloadProgressTimer; wxStaticText* m_advCountStaticText; - long long m_advCount; + wxLongLong m_advCount; }; class WebRequestApp : public wxApp From e6b33cb76cde1fc60593761cbeb976efe0d4b6ff Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 1 Nov 2018 12:12:49 +0100 Subject: [PATCH 038/218] Various small interface changes --- include/wx/msw/webrequest_winhttp.h | 2 +- include/wx/webrequest.h | 8 ++++---- src/msw/webrequest_winhttp.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index d11a1b327c..99c736e01b 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -71,7 +71,7 @@ public: void Cancel() wxOVERRIDE; - wxWebResponse* GetResponse() wxOVERRIDE; + wxWebResponse* GetResponse() const wxOVERRIDE; wxWebAuthChallenge* GetAuthChallenge() const wxOVERRIDE { return m_authChallenge.get(); } diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index edd130c338..239db265b7 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -69,7 +69,7 @@ public: virtual void Cancel() = 0; - virtual wxWebResponse* GetResponse() = 0; + virtual wxWebResponse* GetResponse() const = 0; virtual wxWebAuthChallenge* GetAuthChallenge() const = 0; @@ -97,12 +97,12 @@ protected: wxSharedPtr m_dataStream; wxWebRequest(wxWebSession& session, int id): + m_storage(Storage_Memory), + m_dataSize(0), m_session(session), m_id(id), m_state(State_Idle), - m_ignoreServerErrorStatus(false), - m_dataSize(0), - m_storage(Storage_Memory) { } + m_ignoreServerErrorStatus(false) { } bool CheckServerStatus(); diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 1d1d6bb617..f92c81c33f 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -264,7 +264,7 @@ void wxWebRequestWinHTTP::Start() else port = wxAtoi(uri.GetPort()); - // Open a connction + // Open a connection m_connect = ::WinHttpConnect( static_cast(GetSession()).GetHandle(), uri.GetServer().wc_str(), port, 0); @@ -346,7 +346,7 @@ void wxWebRequestWinHTTP::Cancel() } } -wxWebResponse* wxWebRequestWinHTTP::GetResponse() +wxWebResponse* wxWebRequestWinHTTP::GetResponse() const { return m_response.get(); } From 028af93c35e20666ef8cc758a3d25551c301409b Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 1 Nov 2018 12:14:02 +0100 Subject: [PATCH 039/218] Fix documentation types/inconsistencies --- interface/wx/webrequest.h | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index f5a8a0eeee..03b563e48d 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -121,15 +121,15 @@ public: /// The request has just been created and Start() has not been called State_Idle, - /// The request has been started and is transferring data - State_Active, - /** The request is currently unauthorized. Calling GetAuthChallenge() returns a challenge object with further details. */ State_Unauthorized, + /// The request has been started and is transferring data + State_Active, + /// The request completed successfully and all data has been received. State_Completed, @@ -178,13 +178,13 @@ public: Before sending a request or after a failed request this will return @c NULL. */ - wxWebResponse* GetResponse(); + wxWebResponse* GetResponse() const; /** Returns the current authentication challenge object while the request is in @c State_Unauthorized. */ - wxWebAuthChallenge* GetAuthChallenge(); + wxWebAuthChallenge* GetAuthChallenge() const; /** Returns the id specified while creating this request. @@ -301,7 +301,7 @@ public: /** Returns the current state of the request. */ - State GetState() const { return m_state; } + State GetState() const; /// Returns the number of bytes sent to the server. wxFileOffset GetBytesSent() const; @@ -343,7 +343,7 @@ public: /** Returns which source requested credentials with this challenge. */ - Source GetSource() const { return m_source; } + Source GetSource() const; /** Used to provide user credentials to the authentication challenge. @@ -444,14 +444,6 @@ public: class wxWebSession { public: - /** - Constructor for the session - - All requests created by a call to CreateRequest() will use this session - for communication and to store cookies. - */ - wxWebSession(); - /** Create a new request for the specified URL @@ -476,16 +468,16 @@ public: /** Override the default temporary directory that may be used by the - session implemention, when required. + session implementation, when required. */ - void SetTempDir(const wxString& name); + void SetTempDir(const wxString& dir); /** Returns the current temporary directory. @see SetTempDir() */ - const wxString& GetTempDir() const; + wxString GetTempDir() const; /** Returns the default session @@ -540,9 +532,9 @@ class wxWebSessionFactory { public: /** - Creates a new web session object + Creates a new web session object. */ - virtual wxWebSession* Create() = 0; + virtual wxWebSession* Create(); }; /** From f40e2e64d952870133a16b1c023520d327c51bdd Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 1 Nov 2018 17:33:56 +0100 Subject: [PATCH 040/218] Add wxWebRequest::SplitParameters method This method is adapted for use in wxWidgets from the Poco library. --- include/wx/webrequest.h | 6 ++++ interface/wx/webrequest.h | 30 +++++++++++++++++++ src/common/webrequest.cpp | 63 +++++++++++++++++++++++++++++++++++++++ tests/net/webrequest.cpp | 13 ++++++++ 4 files changed, 112 insertions(+) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 239db265b7..75106322ea 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -89,6 +89,12 @@ public: void SetState(State state, const wxString& failMsg = ""); + static void SplitParameters(const wxString& s, wxString& value, + wxWebRequestHeaderMap& parameters); + + static void SplitParameters(const wxString::const_iterator& begin, + const wxString::const_iterator& end, wxWebRequestHeaderMap& parameters); + protected: wxString m_method; Storage m_storage; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 03b563e48d..e97f5e85c9 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -320,6 +320,36 @@ public: */ wxFileOffset GetBytesExpectedToReceive() const; ///@} + + /** + Splits the given string into a value and a collection of parameters. + Parameters are expected to be separated by semicolons. + Enclosing quotes of parameter values are removed. + + For example, the string + @code + multipart/mixed; boundary="MIME_boundary_01234567" + @endcode + is split into the value + @code + multipart/mixed + @endcode + and the parameter + @code + boundary -> MIME_boundary_01234567 + @endcode + */ + static void SplitParameters(const wxString& s, wxString& value, + wxWebRequestHeaderMap& parameters); + + /** + Splits the given string into a collection of parameters. + Parameters are expected to be separated by semicolons. + + Enclosing quotes of parameter values are removed. + */ + static void SplitParameters(const wxString::const_iterator& begin, + const wxString::const_iterator& end, wxWebRequestHeaderMap& parameters); }; /** diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index bca423a6a7..6bd870c384 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -114,6 +114,69 @@ void wxWebRequest::SetState(State state, const wxString & failMsg) CallAfter(&wxWebRequest::ProcessStateEvent, state, failMsg); } +// The SplitParamaters implementation is adapted to wxWidgets +// from Poco::Net::MessageHeader::splitParameters + +void wxWebRequest::SplitParameters(const wxString& s, wxString& value, + wxWebRequestHeaderMap& parameters) +{ + value.clear(); + parameters.clear(); + wxString::const_iterator it = s.begin(); + wxString::const_iterator end = s.end(); + while ( it != end && wxIsspace(*it) ) ++it; + while ( it != end && *it != ';' ) value += *it++; + value.Trim(); + if ( it != end ) ++it; + SplitParameters(it, end, parameters); +} + +void wxWebRequest::SplitParameters(const wxString::const_iterator& begin, + const wxString::const_iterator& end, wxWebRequestHeaderMap& parameters) +{ + wxString pname; + wxString pvalue; + pname.reserve(32); + pvalue.reserve(64); + wxString::const_iterator it = begin; + while ( it != end ) + { + pname.clear(); + pvalue.clear(); + while ( it != end && wxIsspace(*it) ) ++it; + while ( it != end && *it != '=' && *it != ';' ) pname += *it++; + pname.Trim(); + if ( it != end && *it != ';' ) ++it; + while ( it != end && wxIsspace(*it) ) ++it; + while ( it != end && *it != ';' ) + { + if ( *it == '"' ) + { + ++it; + while ( it != end && *it != '"' ) + { + if ( *it == '\\' ) + { + ++it; + if ( it != end ) pvalue += *it++; + } + else pvalue += *it++; + } + if ( it != end ) ++it; + } + else if ( *it == '\\' ) + { + ++it; + if ( it != end ) pvalue += *it++; + } + else pvalue += *it++; + } + pvalue.Trim(); + if ( !pname.empty() ) parameters[pname] = pvalue; + if ( it != end ) ++it; + } +} + void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) { if (!IsActiveState(state) && GetResponse()) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index bb297c0ebc..175fd071fc 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -197,4 +197,17 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][.]") } } +TEST_CASE("WebRequestUtils", "[net]") +{ + wxString value; + wxWebRequestHeaderMap params; + + wxString header = "multipart/mixed; boundary=\"MIME_boundary_01234567\""; + + wxWebRequest::SplitParameters(header, value, params); + REQUIRE( value == "multipart/mixed" ); + REQUIRE( params.size() == 1 ); + REQUIRE( params["boundary"] == "MIME_boundary_01234567" ); +} + #endif // wxUSE_WEBREQUEST From 00623291ac32c74f98ff14498773c4bc2c9852e1 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 1 Nov 2018 17:40:28 +0100 Subject: [PATCH 041/218] Use Content-Disposition in GetSuggestedFileName() --- src/common/webrequest.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 6bd870c384..db5fa75273 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -277,16 +277,29 @@ wxString wxWebResponse::GetSuggestedFileName() const { wxString suggestedFilename; - // TODO: get from Content-Disposition header - - wxURI uri(GetURL()); - if ( uri.HasPath() ) + // Try to determine from Content-Disposition header + wxString contentDisp = GetHeader("Content-Disposition"); + wxString disp; + wxWebRequestHeaderMap params; + wxWebRequest::SplitParameters(contentDisp, disp, params); + if ( disp == "attachment" ) { - wxFileName fn(uri.GetPath()); + // Parse as filename to filter potential path names + wxFileName fn(params["filename"]); suggestedFilename = fn.GetFullName(); } - else - suggestedFilename = uri.GetServer(); + + if ( suggestedFilename.empty() ) + { + wxURI uri(GetURL()); + if ( uri.HasPath() ) + { + wxFileName fn(uri.GetPath()); + suggestedFilename = fn.GetFullName(); + } + else + suggestedFilename = uri.GetServer(); + } return suggestedFilename; } From 7a5916175db7e8c5d7984b437a2ca482b2904e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Fri, 2 Nov 2018 15:53:53 +0100 Subject: [PATCH 042/218] Update docs/doxygen/overviews/commondialogs.h --- docs/doxygen/overviews/commondialogs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/doxygen/overviews/commondialogs.h b/docs/doxygen/overviews/commondialogs.h index 6cf03ab906..ee6a93ff2b 100644 --- a/docs/doxygen/overviews/commondialogs.h +++ b/docs/doxygen/overviews/commondialogs.h @@ -218,8 +218,8 @@ is obtained using wxNumberEntryDialog::GetValue(). Classes: wxCredentialEntryDialog -This is a dialog with a user and password entry field. The values that the -users entered is obtained using wxCredentialEntryDialog::GetUser() and +This is a dialog with user and password entry fields. The values that the +user entered are obtained using wxCredentialEntryDialog::GetUser() and wxCredentialEntryDialog::GetPassword(). From 09bc378aad7f9ecf8dee62d176e568eee528e83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Fri, 2 Nov 2018 15:54:14 +0100 Subject: [PATCH 043/218] Update interface/wx/creddlg.h Co-Authored-By: TcT2k --- interface/wx/creddlg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/creddlg.h b/interface/wx/creddlg.h index cf67cc4821..9264fbda54 100644 --- a/interface/wx/creddlg.h +++ b/interface/wx/creddlg.h @@ -12,7 +12,7 @@ from the user. It is implemented as a generic wxWidgets dialog on all platforms. - @note For secure saving and loading, user and passwords have a look at + @note For secure saving and loading users and passwords, have a look at wxSecretStore. @since 3.1.2 From 0051bbd605b83cf3e20e1681344c19014a6bd314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Fri, 2 Nov 2018 15:54:34 +0100 Subject: [PATCH 044/218] Update interface/wx/webrequest.h Co-Authored-By: TcT2k --- interface/wx/webrequest.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index e97f5e85c9..4c24ac1ec5 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -8,7 +8,7 @@ /** @class wxWebRequest - This class allows for simple HTTP requests using the operating systems + This class allows for simple HTTP requests using the operating system's components as implementation. The latest features of the operating system will be used if available @@ -56,8 +56,8 @@ @section descriptions Implementation Descriptions - The following APIs are used per platform, additional documentation - about supported features may be found in their documentation + The following APIs are used per platform, additional details + about supported features may be found in their documentation. Available features by implementation and minimum version: @@ -608,8 +608,8 @@ public: when the state is @c State_Completed and storage is @Storage_File. The file will be removed after the event handlers are called. You can - move the file to location of your choice if you want to process the - contents outside of the event handler. + move the file to a location of your choice if you want to process the + contents outside the event handler. */ const wxString& GetResponseFileName() const; @@ -617,7 +617,7 @@ public: /** Only for @c wxEVT_WEBREQUEST_DATA events. The buffer is only valid - in the event handler. + inside the event handler. */ ///@{ const void* GetDataBuffer() const; From 58ad18adf35bc780fcd2683aff58c4de56d3c3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Fri, 2 Nov 2018 15:56:25 +0100 Subject: [PATCH 045/218] Update samples/webrequest/webrequest.cpp Co-Authored-By: TcT2k --- samples/webrequest/webrequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 7e6930d124..5d3b1928e2 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -220,7 +220,7 @@ public: m_startButton->Disable(); - // Start the request (events will be called on success or failure) + // Start the request (events will be sent on success or failure) request->Start(); } From 2f4be7e1ae4666ef4264c1ecf7ddc9b67b52cd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Fri, 2 Nov 2018 15:56:36 +0100 Subject: [PATCH 046/218] Update src/common/webrequest.cpp Co-Authored-By: TcT2k --- src/common/webrequest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index db5fa75273..bdcca3649a 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -254,7 +254,7 @@ wxInputStream * wxWebResponse::GetStream() const if ( !m_stream.get() ) { // Create stream - switch (m_request.GetStorage()) + switch ( m_request.GetStorage() ) { case wxWebRequest::Storage_Memory: m_stream.reset(new wxMemoryInputStream(m_readBuffer.GetData(), m_readBuffer.GetDataLen())); @@ -408,15 +408,15 @@ void wxWebSession::InitFactoryMap() { #if wxUSE_WEBREQUEST_WINHTTP RegisterFactory(wxWebSessionBackendWinHTTP, - wxSharedPtr(new wxWebSessionFactoryWinHTTP())); + wxSharedPtr(new wxWebSessionFactoryWinHTTP())); #endif #if wxUSE_WEBREQUEST_URLSESSION - RegisterFactory(wxWebSessionBackendURLSession, - wxSharedPtr(new wxWebSessionFactoryURLSession())); + RegisterFactory(wxWebSessionBackendURLSession, + wxSharedPtr(new wxWebSessionFactoryURLSession())); #endif #if wxUSE_WEBREQUEST_CURL - RegisterFactory(wxWebSessionBackendCURL, - wxSharedPtr(new wxWebSessionFactoryCURL())); + RegisterFactory(wxWebSessionBackendCURL, + wxSharedPtr(new wxWebSessionFactoryCURL())); #endif } From ab544da1d25ec24e0865b1a60a47f4030c4b4156 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 2 Nov 2018 21:24:10 +0100 Subject: [PATCH 047/218] Move GetBytesExpectedToReceive() impl to base class --- include/wx/msw/webrequest_winhttp.h | 3 --- include/wx/webrequest.h | 2 +- src/common/webrequest.cpp | 8 ++++++++ src/msw/webrequest_winhttp.cpp | 2 -- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index 99c736e01b..edd4e66ffd 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -81,8 +81,6 @@ public: wxFileOffset GetBytesReceived() const wxOVERRIDE { return m_bytesReceived; } - wxFileOffset GetBytesExpectedToReceive() const wxOVERRIDE { return m_bytesExpectedToReceive; } - void HandleCallback(DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength); @@ -96,7 +94,6 @@ private: wxScopedPtr m_authChallenge; wxMemoryBuffer m_dataWriteBuffer; wxFileOffset m_dataWritten; - wxFileOffset m_bytesExpectedToReceive; wxFileOffset m_bytesReceived; void SendRequest(); diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 75106322ea..7f40cb9acf 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -85,7 +85,7 @@ public: virtual wxFileOffset GetBytesReceived() const = 0; - virtual wxFileOffset GetBytesExpectedToReceive() const = 0; + virtual wxFileOffset GetBytesExpectedToReceive() const; void SetState(State state, const wxString& failMsg = ""); diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index bdcca3649a..200e00080f 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -102,6 +102,14 @@ void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString SetHeader("Content-Type", contentType); } +wxFileOffset wxWebRequest::GetBytesExpectedToReceive() const +{ + if ( GetResponse() ) + return GetResponse()->GetContentLength(); + else + return -1; +} + void wxWebRequest::SetState(State state, const wxString & failMsg) { // Add a reference while the request is active diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index f92c81c33f..f7cca43d60 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -148,7 +148,6 @@ wxWebRequestWinHTTP::wxWebRequestWinHTTP(int id, wxWebSessionWinHTTP& session, c m_connect(NULL), m_request(NULL), m_dataWritten(0), - m_bytesExpectedToReceive(0), m_bytesReceived(0) { m_headers = session.GetHeaders(); @@ -221,7 +220,6 @@ void wxWebRequestWinHTTP::CreateResponse() m_response.reset(new wxWebResponseWinHTTP(*this)); if ( !m_response->Init() ) return; - m_bytesExpectedToReceive = m_response->GetContentLength(); int status = m_response->GetStatus(); if ( status == 401 || status == 407) { From f04094e4ec35b9f0fbcde8e8f99394e3bd2cc57d Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 2 Nov 2018 21:37:45 +0100 Subject: [PATCH 048/218] Implement GetBytesReceived() in base class --- include/wx/msw/webrequest_winhttp.h | 4 ---- include/wx/webrequest.h | 8 ++++++-- src/common/webrequest.cpp | 17 ++++++++++++++--- src/msw/webrequest_winhttp.cpp | 4 +--- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index edd4e66ffd..cd4c1750f2 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -79,8 +79,6 @@ public: wxFileOffset GetBytesExpectedToSend() const wxOVERRIDE { return m_dataSize; } - wxFileOffset GetBytesReceived() const wxOVERRIDE { return m_bytesReceived; } - void HandleCallback(DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength); @@ -94,7 +92,6 @@ private: wxScopedPtr m_authChallenge; wxMemoryBuffer m_dataWriteBuffer; wxFileOffset m_dataWritten; - wxFileOffset m_bytesReceived; void SendRequest(); @@ -105,7 +102,6 @@ private: void SetFailedWithLastError(); friend class wxWebAuthChallengeWinHTTP; - friend class wxWebResponseWinHTTP; wxDECLARE_NO_COPY_CLASS(wxWebRequestWinHTTP); }; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 7f40cb9acf..40987cc2a9 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -83,12 +83,14 @@ public: virtual wxFileOffset GetBytesExpectedToSend() const = 0; - virtual wxFileOffset GetBytesReceived() const = 0; + virtual wxFileOffset GetBytesReceived() const; virtual wxFileOffset GetBytesExpectedToReceive() const; void SetState(State state, const wxString& failMsg = ""); + void ReportDataReceived(size_t sizeReceived); + static void SplitParameters(const wxString& s, wxString& value, wxWebRequestHeaderMap& parameters); @@ -108,7 +110,8 @@ protected: m_session(session), m_id(id), m_state(State_Idle), - m_ignoreServerErrorStatus(false) { } + m_ignoreServerErrorStatus(false), + m_bytesReceived(0) { } bool CheckServerStatus(); @@ -119,6 +122,7 @@ private: int m_id; State m_state; bool m_ignoreServerErrorStatus; + wxFileOffset m_bytesReceived; wxCharBuffer m_dataText; void ProcessStateEvent(State state, const wxString& failMsg); diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 200e00080f..0414eaf146 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -102,14 +102,19 @@ void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString SetHeader("Content-Type", contentType); } -wxFileOffset wxWebRequest::GetBytesExpectedToReceive() const +wxFileOffset wxWebRequest::GetBytesReceived() const +{ + return m_bytesReceived;; +} + +wxFileOffset wxWebRequest::GetBytesExpectedToReceive() const { if ( GetResponse() ) return GetResponse()->GetContentLength(); else return -1; -} - +} + void wxWebRequest::SetState(State state, const wxString & failMsg) { // Add a reference while the request is active @@ -122,6 +127,11 @@ void wxWebRequest::SetState(State state, const wxString & failMsg) CallAfter(&wxWebRequest::ProcessStateEvent, state, failMsg); } +void wxWebRequest::ReportDataReceived(size_t sizeReceived) +{ + m_bytesReceived += sizeReceived; +} + // The SplitParamaters implementation is adapted to wxWidgets // from Poco::Net::MessageHeader::splitParameters @@ -335,6 +345,7 @@ void* wxWebResponse::GetDataBuffer(size_t sizeNeeded) void wxWebResponse::ReportDataReceived(size_t sizeReceived) { m_readBuffer.UngetAppendBuf(sizeReceived); + m_request.ReportDataReceived(sizeReceived); if ( m_request.GetStorage() == wxWebRequest::Storage_File ) m_file.Write(m_readBuffer.GetData(), m_readBuffer.GetDataLen()); diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index f7cca43d60..eb7608564c 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -147,8 +147,7 @@ wxWebRequestWinHTTP::wxWebRequestWinHTTP(int id, wxWebSessionWinHTTP& session, c m_url(url), m_connect(NULL), m_request(NULL), - m_dataWritten(0), - m_bytesReceived(0) + m_dataWritten(0) { m_headers = session.GetHeaders(); } @@ -407,7 +406,6 @@ bool wxWebResponseWinHTTP::ReadData() bool wxWebResponseWinHTTP::ReportAvailableData(DWORD dataLen) { ReportDataReceived(dataLen); - static_cast(m_request).m_bytesReceived += dataLen; return ReadData(); } From 7577c95aab481187d8408b753bf466205824b31d Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Sat, 3 Nov 2018 12:32:42 +0100 Subject: [PATCH 049/218] Destroy default wxWebSession in module --- include/wx/webrequest.h | 2 ++ src/common/webrequest.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 40987cc2a9..be5f4136fa 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -234,6 +234,8 @@ public: static wxWebSession& GetDefault(); + static void DestroyDefault(); + static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); static void RegisterFactory(const wxString& backend, wxSharedPtr factory); diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 0414eaf146..e282d98de7 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -18,6 +18,7 @@ #include "wx/webrequest.h" #include "wx/mstream.h" +#include "wx/module.h" #include "wx/uri.h" #include "wx/filefn.h" #include "wx/filename.h" @@ -401,6 +402,11 @@ wxWebSession& wxWebSession::GetDefault() ms_defaultSession.reset(wxWebSession::New()); return *ms_defaultSession; +} + +void wxWebSession::DestroyDefault() +{ + ms_defaultSession.reset(); } // static @@ -449,4 +455,31 @@ bool wxWebSession::IsBackendAvailable(const wxString& backend) return factory != ms_factoryMap.end(); } +// ---------------------------------------------------------------------------- +// Module ensuring all global/singleton objects are destroyed on shutdown. +// ---------------------------------------------------------------------------- + +class WebRequestModule : public wxModule +{ +public: + WebRequestModule() + { + } + + virtual bool OnInit() wxOVERRIDE + { + return true; + } + + virtual void OnExit() wxOVERRIDE + { + wxWebSession::DestroyDefault(); + } + +private: + wxDECLARE_DYNAMIC_CLASS(WebRequestModule); +}; + +wxIMPLEMENT_DYNAMIC_CLASS(WebRequestModule, wxModule); + #endif // wxUSE_WEBREQUEST From 2fa38b1d26b5e303828dccefa423fdeed6b30780 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Sat, 3 Nov 2018 22:08:49 +0100 Subject: [PATCH 050/218] Remove incompatible Storage:: specifier --- src/common/webrequest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index e282d98de7..48f63d4bc7 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -205,7 +205,7 @@ void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) wxWebRequestEvent evt(wxEVT_WEBREQUEST_STATE, GetId(), state, GetResponse(), failMsg); - if ( state == State_Completed && m_storage == Storage::Storage_File ) + if ( state == State_Completed && m_storage == Storage_File ) { responseFileName = GetResponse()->GetFileName(); evt.SetResponseFileName(responseFileName); @@ -214,7 +214,7 @@ void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) ProcessEvent(evt); // Remove temporary file if it still exists - if ( state == State_Completed && m_storage == Storage::Storage_File && + if ( state == State_Completed && m_storage == Storage_File && wxFileExists(responseFileName) ) wxRemoveFile(responseFileName); @@ -402,11 +402,11 @@ wxWebSession& wxWebSession::GetDefault() ms_defaultSession.reset(wxWebSession::New()); return *ms_defaultSession; -} - -void wxWebSession::DestroyDefault() +} + +void wxWebSession::DestroyDefault() { - ms_defaultSession.reset(); + ms_defaultSession.reset(); } // static From 127b596ada0aceb1d69a2a4c66989ded0d97d4ad Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Sat, 3 Nov 2018 17:50:04 +0100 Subject: [PATCH 051/218] Initial libcurl wxWebRequest implementation --- build/cmake/lib/net/CMakeLists.txt | 2 +- build/cmake/options.cmake | 7 +- configure | 92 ++++++ configure.in | 21 ++ include/wx/webrequest_curl.h | 125 +++++++- src/common/webrequest_curl.cpp | 443 ++++++++++++++++++++++++++++- 6 files changed, 676 insertions(+), 14 deletions(-) diff --git a/build/cmake/lib/net/CMakeLists.txt b/build/cmake/lib/net/CMakeLists.txt index 7d1e71cfda..7778ebf095 100644 --- a/build/cmake/lib/net/CMakeLists.txt +++ b/build/cmake/lib/net/CMakeLists.txt @@ -35,7 +35,7 @@ if (wxUSE_WEBREQUEST_CURL) find_package(CURL REQUIRED) target_include_directories(net PRIVATE ${CURL_INCLUDE_DIRS}) - wx_lib_link_libraries(net PRIVATE CURL::libcurl) + wx_lib_link_libraries(net PRIVATE ${CURL_LIBRARIES}) endif() wx_finalize_lib(net) diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index 9d3852521e..6927c412e4 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -155,8 +155,11 @@ endif() if(APPLE) wx_option(wxUSE_WEBREQUEST_URLSESSION "use wxWebRequest URLSession backend") endif() -set(wxUSE_WEBREQUEST_CURL_DEFAULT OFF) -#TODO: determine wxUSE_WEBREQUEST_CURL_DEFAULT (based) +if(APPLE OR WIN32) + set(wxUSE_WEBREQUEST_CURL_DEFAULT OFF) +else() + set(wxUSE_WEBREQUEST_CURL_DEFAULT ON) +endif() wx_option(wxUSE_WEBREQUEST_CURL "use wxWebRequest libcurl backend" ${wxUSE_WEBREQUEST_CURL_DEFAULT}) wx_option(wxUSE_ZIPSTREAM "use wxZip streams") diff --git a/configure b/configure index 6501210d28..03426ec764 100755 --- a/configure +++ b/configure @@ -1138,6 +1138,7 @@ enable_ipv6 enable_ole enable_dataobj enable_webrequest +enable_webrequestcurl enable_ipc enable_baseevtloop enable_epollloop @@ -2081,6 +2082,7 @@ Optional Features: --enable-ole use OLE classes (Win32 only) --enable-dataobj use data object classes --enable-webrequest use wxWebRequest + --enable-webrequest-curl use libcurl with wxWebRequest --enable-ipc use interprocess communication (wxSocket etc.) --enable-baseevtloop use event loop in console programs too --enable-epollloop use wxEpollDispatcher class (Linux only) @@ -6550,6 +6552,35 @@ fi eval "$wx_cv_use_webrequest" + enablestring= + defaultval=$wxUSE_ALL_FEATURES + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + # Check whether --enable-webrequestcurl was given. +if test "${enable_webrequestcurl+set}" = set; then : + enableval=$enable_webrequestcurl; + if test "$enableval" = yes; then + wx_cv_use_webrequestcurl='wxUSE_WEBREQUEST_LIBCURL=yes' + else + wx_cv_use_webrequestcurl='wxUSE_WEBREQUEST_LIBCURL=no' + fi + +else + + wx_cv_use_webrequestcurl='wxUSE_WEBREQUEST_LIBCURL=${'DEFAULT_wxUSE_WEBREQUEST_LIBCURL":-$defaultval}" + +fi + + + eval "$wx_cv_use_webrequestcurl" + + enablestring= defaultval=$wxUSE_ALL_FEATURES @@ -23764,6 +23795,67 @@ if test "$wxUSE_LIBMSPACK" != "no"; then fi +if test "$wxUSE_WEBREQUEST_CURL" != "no"; then + ac_fn_c_check_header_mongrel "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default" +if test "x$ac_cv_header_curl_curl_h" = xyes; then : + +fi + + + + if test "$ac_cv_header_curl_curl_h" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5 +$as_echo_n "checking for curl_easy_init in -lcurl... " >&6; } +if ${ac_cv_lib_curl_curl_easy_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char curl_easy_init (); +int +main () +{ +return curl_easy_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_curl_curl_easy_init=yes +else + ac_cv_lib_curl_curl_easy_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curl_curl_easy_init" >&5 +$as_echo "$ac_cv_lib_curl_curl_easy_init" >&6; } +if test "x$ac_cv_lib_curl_curl_easy_init" = xyes; then : + + CURL_LINK="-lcurl" + LIBS="$CURL_LINK $LIBS" + $as_echo "#define wxUSE_WEBREQUEST_CURL 1" >>confdefs.h + + +fi + + fi + + if test -z "$CURL_LINK"; then + wxUSE_WEBREQUEST_CURL=no + fi +fi + TOOLKIT= TOOLKIT_INCLUDE= diff --git a/configure.in b/configure.in index 03959b657b..db5151b392 100644 --- a/configure.in +++ b/configure.in @@ -699,6 +699,7 @@ WX_ARG_FEATURE(ipv6, [ --enable-ipv6 enable IPv6 support in WX_ARG_FEATURE(ole, [ --enable-ole use OLE classes (Win32 only)], wxUSE_OLE) WX_ARG_FEATURE(dataobj, [ --enable-dataobj use data object classes], wxUSE_DATAOBJ) WX_ARG_FEATURE(webrequest, [ --enable-webrequest use wxWebRequest], wxUSE_WEBREQUEST) +WX_ARG_FEATURE(webrequestcurl, [ --enable-webrequest-curl use libcurl with wxWebRequest], wxUSE_WEBREQUEST_LIBCURL) WX_ARG_FEATURE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC) @@ -2736,6 +2737,26 @@ if test "$wxUSE_LIBMSPACK" != "no"; then AC_DEFINE(wxUSE_LIBMSPACK) fi +dnl ------------------------------------------------------------------------ +dnl Check for libcurl +dnl ------------------------------------------------------------------------ + +if test "$wxUSE_WEBREQUEST_CURL" != "no"; then + AC_CHECK_HEADER(curl/curl.h,,,[]) + + if test "$ac_cv_header_curl_curl_h" = "yes"; then + AC_CHECK_LIB(curl, curl_easy_init, + [ + CURL_LINK="-lcurl" + LIBS="$CURL_LINK $LIBS" + AC_DEFINE(wxUSE_WEBREQUEST_CURL) + ]) + fi + + if test -z "$CURL_LINK"; then + wxUSE_WEBREQUEST_CURL=no + fi +fi dnl ---------------------------------------------------------------- dnl search for toolkit (widget sets) diff --git a/include/wx/webrequest_curl.h b/include/wx/webrequest_curl.h index 9eb674095c..6a75b35c53 100644 --- a/include/wx/webrequest_curl.h +++ b/include/wx/webrequest_curl.h @@ -12,24 +12,135 @@ #if wxUSE_WEBREQUEST_CURL -class WXDLLIMPEXP_NET wxWebSessionCURL: public wxWebSession +#include "wx/thread.h" + +#include "curl/curl.h" + +class wxWebResponseCURL; +class wxWebRequestCURL; + +class WXDLLIMPEXP_NET wxWebAuthChallengeCURL : public wxWebAuthChallenge { public: - wxWebSessionCURL(); + explicit wxWebAuthChallengeCURL(Source source, wxWebRequestCURL& request); - ~wxWebSessionCURL(); + bool Init(); - wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + void SetCredentials(const wxString& user, const wxString& password) wxOVERRIDE; private: - wxDECLARE_NO_COPY_CLASS(wxWebSessionCURL); + wxWebRequestCURL& m_request; + + wxDECLARE_NO_COPY_CLASS(wxWebAuthChallengeCURL); +}; + +class WXDLLIMPEXP_NET wxWebRequestCURL: public wxWebRequest +{ +public: + wxWebRequestCURL(wxWebSession& session, int id, const wxString& url); + + ~wxWebRequestCURL(); + + void Start() wxOVERRIDE; + + void Cancel() wxOVERRIDE; + + wxWebResponse* GetResponse() const wxOVERRIDE; + + wxWebAuthChallenge* GetAuthChallenge() const wxOVERRIDE + { return m_authChallenge.get(); } + + wxFileOffset GetBytesSent() const wxOVERRIDE; + + wxFileOffset GetBytesExpectedToSend() const wxOVERRIDE; + + CURL* GetHandle() const { return m_handle; } + + bool StartRequest(); + + void HandleCompletion(); + + wxString GetError() const; + + size_t ReadData(char* buffer, size_t size); + +private: + CURL* m_handle; + char m_errorBuffer[CURL_ERROR_SIZE]; + struct curl_slist *m_headerList; + wxScopedPtr m_response; + wxScopedPtr m_authChallenge; + + void DestroyHeaderList(); + + wxDECLARE_NO_COPY_CLASS(wxWebRequestCURL); +}; + +class WXDLLIMPEXP_NET wxWebResponseCURL : public wxWebResponse +{ +public: + wxWebResponseCURL(wxWebRequest& request); + + wxInt64 GetContentLength() const wxOVERRIDE; + + wxString GetURL() const wxOVERRIDE; + + wxString GetHeader(const wxString& name) const wxOVERRIDE; + + int GetStatus() const wxOVERRIDE; + + wxString GetStatusText() const wxOVERRIDE { return m_statusText; } + + size_t WriteData(void *buffer, size_t size); + + size_t AddHeaderData(const char* buffer, size_t size); + +private: + wxWebRequestHeaderMap m_headers; + wxString m_statusText; + + CURL* GetHandle() const + { return static_cast(m_request).GetHandle(); } + + wxDECLARE_NO_COPY_CLASS(wxWebResponseCURL); +}; + +class WXDLLIMPEXP_NET wxWebSessionCURL: public wxWebSession, private wxThreadHelper +{ +public: + wxWebSessionCURL(); + + ~wxWebSessionCURL(); + + wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + + bool StartRequest(wxWebRequestCURL& request); + +protected: + wxThread::ExitCode Entry() wxOVERRIDE; + +private: + CURLM* m_handle; + wxCondition m_condition; + wxMutex m_mutex; + bool m_shuttingDown; + + void Initialize(); + + static int ms_activeSessions; + + static void InitializeCURL(); + + static void CleanupCURL(); + + wxDECLARE_NO_COPY_CLASS(wxWebSessionCURL); }; class WXDLLIMPEXP_NET wxWebSessionFactoryCURL: public wxWebSessionFactory { public: - wxWebSession* Create() wxOVERRIDE - { return new wxWebSessionCURL(); } + wxWebSession* Create() wxOVERRIDE + { return new wxWebSessionCURL(); } }; #endif // wxUSE_WEBREQUEST_CURL diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 86ce25c337..c4f0ecb6d0 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -20,20 +20,455 @@ #include "wx/webrequest_curl.h" -wxWebSessionCURL::wxWebSessionCURL() -{ +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/utils.h" +#endif +// Define symbols that might be missing from older libcurl headers +#ifndef CURL_AT_LEAST_VERSION +#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z) +#define CURL_AT_LEAST_VERSION(x,y,z) \ + (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) +#endif + +// +// wxWebResponseCURL +// + +static size_t wxCURLWriteData(void* buffer, size_t size, size_t nmemb, void* userp) +{ + if ( userp ) + return static_cast(userp)->WriteData(buffer, size * nmemb); + else + return 0; +} + +static size_t wxCURLHeader(char *buffer, size_t size, size_t nitems, void *userdata) +{ + if ( userdata ) + return static_cast(userdata)->AddHeaderData(buffer, size * nitems); + else + return 0; +} + +wxWebResponseCURL::wxWebResponseCURL(wxWebRequest& request) : + wxWebResponse(request) +{ + curl_easy_setopt(GetHandle(), CURLOPT_WRITEDATA, static_cast(this)); + curl_easy_setopt(GetHandle(), CURLOPT_HEADERDATA, static_cast(this)); +} + +size_t wxWebResponseCURL::WriteData(void* buffer, size_t size) +{ + void* buf = GetDataBuffer(size); + memcpy(buf, buffer, size); + ReportDataReceived(size); + return size; +} + +size_t wxWebResponseCURL::AddHeaderData(const char * buffer, size_t size) +{ + wxString hdr(buffer, size); + hdr.Trim(); + + if ( hdr.StartsWith("HTTP/") ) + { + // First line of the headers contains status text after + // version and status + m_statusText = hdr.AfterFirst(' ').AfterFirst(' '); + m_headers.clear(); + } + else if ( !hdr.empty() ) + { + wxArrayString hdrArr = wxSplit(hdr, ':'); + wxString hdrName; + wxString hdrValue; + if ( hdrArr.size() > 0 ) + hdrName = hdrArr[0].Trim().MakeUpper(); + if ( hdrArr.size() > 1 ) + hdrValue = hdrArr[1].Trim(false); + m_headers[hdrName] = hdrValue; + } + + return size; +} + +wxInt64 wxWebResponseCURL::GetContentLength() const +{ +#if CURL_AT_LEAST_VERSION(7, 55, 0) + curl_off_t len = 0; + curl_easy_getinfo(GetHandle(), CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &len); + return len; +#else + double len = 0; + curl_easy_getinfo(GetHandle(), CURLINFO_CONTENT_LENGTH_DOWNLOAD, &len); + return (wxInt64)len; +#endif +} + +wxString wxWebResponseCURL::GetURL() const +{ + char* urlp = NULL; + curl_easy_getinfo(GetHandle(), CURLINFO_EFFECTIVE_URL, &urlp); + return wxString(urlp); +} + +wxString wxWebResponseCURL::GetHeader(const wxString& name) const +{ + wxWebRequestHeaderMap::const_iterator it = m_headers.find(name.Upper()); + if ( it != m_headers.end() ) + return it->second; + else + return wxString(); +} + +int wxWebResponseCURL::GetStatus() const +{ + long status = 0; + curl_easy_getinfo(GetHandle(), CURLINFO_RESPONSE_CODE, &status); + return status; +} + +// +// wxWebRequestCURL +// + +static size_t wxCURLRead(char *buffer, size_t size, size_t nitems, void *userdata) +{ + if ( userdata ) + return static_cast(userdata)->ReadData(buffer, size * nitems); + else + return 0; +} + +wxWebRequestCURL::wxWebRequestCURL(wxWebSession & session, int id, const wxString & url): + wxWebRequest(session, id) +{ + m_headers = session.GetHeaders(); + m_headerList = NULL; + + m_handle = curl_easy_init(); + // Set error buffer to get more detailed CURL status + m_errorBuffer[0] = '\0'; + curl_easy_setopt(m_handle, CURLOPT_ERRORBUFFER, m_errorBuffer); + // Set this request in the private pointer + curl_easy_setopt(m_handle, CURLOPT_PRIVATE, static_cast(this)); + // Set URL to handle + curl_easy_setopt(m_handle, CURLOPT_URL, static_cast(url.mb_str())); + // Set callback functions + curl_easy_setopt(m_handle, CURLOPT_WRITEFUNCTION, wxCURLWriteData); + curl_easy_setopt(m_handle, CURLOPT_HEADERFUNCTION, wxCURLHeader); + curl_easy_setopt(m_handle, CURLOPT_READFUNCTION, wxCURLRead); + curl_easy_setopt(m_handle, CURLOPT_READDATA, static_cast(this)); + // Enable gzip, etc decompression + curl_easy_setopt(m_handle, CURLOPT_ACCEPT_ENCODING, ""); + // Enable redirection handling + curl_easy_setopt(m_handle, CURLOPT_FOLLOWLOCATION, 1L); + // Limit redirect to HTTP + curl_easy_setopt(m_handle, CURLOPT_REDIR_PROTOCOLS, + CURLPROTO_HTTP | CURLPROTO_HTTPS); + // Enable all supported authentication methods + curl_easy_setopt(m_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY); + curl_easy_setopt(m_handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY); +} + +wxWebRequestCURL::~wxWebRequestCURL() +{ + DestroyHeaderList(); + + curl_easy_cleanup(m_handle); +} + +void wxWebRequestCURL::Start() +{ + if ( GetState() != State_Idle ) + return; + + m_response.reset(new wxWebResponseCURL(*this)); + m_response->Init(); + + if ( m_dataSize ) + { + if ( m_method.empty() || m_method.IsSameAs("POST", false) ) + { + curl_easy_setopt(m_handle, CURLOPT_POSTFIELDSIZE_LARGE, + static_cast(m_dataSize)); + curl_easy_setopt(m_handle, CURLOPT_POST, 1L); + } + else if ( m_method.IsSameAs("PUT", false) ) + { + curl_easy_setopt(m_handle, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(m_handle, CURLOPT_INFILESIZE_LARGE, + static_cast(m_dataSize)); + } + } + + if ( m_method.IsSameAs("HEAD", false) ) + { + curl_easy_setopt(m_handle, CURLOPT_NOBODY, 1L); + } + else if ( !m_method.empty() ) + { + curl_easy_setopt(m_handle, CURLOPT_CUSTOMREQUEST, + static_cast(m_method.mb_str())); + } + + for ( wxWebRequestHeaderMap::const_iterator it = m_headers.begin(); + it != m_headers.end(); ++it ) + { + wxString hdrStr = wxString::Format("%s: %s", it->first, it->second); + m_headerList = curl_slist_append(m_headerList, hdrStr.mb_str()); + } + curl_easy_setopt(m_handle, CURLOPT_HTTPHEADER, m_headerList); + + StartRequest(); +} + +bool wxWebRequestCURL::StartRequest() +{ + if ( static_cast(GetSession()).StartRequest(*this) ) + { + SetState(State_Active); + return true; + } + else + { + SetState(State_Failed); + return false; + } +} + +void wxWebRequestCURL::Cancel() +{ + wxFAIL_MSG("not implemented"); +} + +void wxWebRequestCURL::HandleCompletion() +{ + int status = (m_response) ? m_response->GetStatus() : 0; + + if ( status == 0) + SetState(State_Failed, GetError()); + else if ( status == 401 || status == 407 ) + { + m_authChallenge.reset(new wxWebAuthChallengeCURL( + (status == 407) ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); + if ( m_authChallenge->Init() ) + SetState(State_Unauthorized, m_response->GetStatusText()); + else + SetState(State_Failed); + } + else if ( CheckServerStatus() ) + SetState(wxWebRequest::State_Completed); +} + +wxString wxWebRequestCURL::GetError() const +{ + return wxString(m_errorBuffer); +} + +size_t wxWebRequestCURL::ReadData(char* buffer, size_t size) +{ + if ( m_dataStream ) + return m_dataStream->Read((void*)buffer, size).LastRead(); + else + return 0; +} + +void wxWebRequestCURL::DestroyHeaderList() +{ + if ( m_headerList ) + { + curl_slist_free_all(m_headerList); + m_headerList = NULL; + } +} + +wxWebResponse* wxWebRequestCURL::GetResponse() const +{ + return m_response.get(); +} + +wxFileOffset wxWebRequestCURL::GetBytesSent() const +{ + wxFAIL_MSG("not implemented"); + return 0; +} + +wxFileOffset wxWebRequestCURL::GetBytesExpectedToSend() const +{ + wxFAIL_MSG("not implemented"); + return 0; +} + +// +// wxWebAuthChallengeCURL +// + +wxWebAuthChallengeCURL::wxWebAuthChallengeCURL(Source source, wxWebRequestCURL& request) : + wxWebAuthChallenge(source), + m_request(request) +{ +} + +bool wxWebAuthChallengeCURL::Init() +{ + return true; +} + +void wxWebAuthChallengeCURL::SetCredentials(const wxString& user, const wxString& password) +{ + wxString authStr = wxString::Format("%s:%s", user, password); + curl_easy_setopt(m_request.GetHandle(), + (GetSource() == Source_Proxy) ? CURLOPT_PROXYUSERPWD : CURLOPT_USERPWD, + static_cast(authStr.mb_str())); + m_request.StartRequest(); +} + +// +// wxWebSessionCURL +// + +int wxWebSessionCURL::ms_activeSessions = 0; + +wxWebSessionCURL::wxWebSessionCURL() : + m_handle(NULL), + m_condition(m_mutex), + m_shuttingDown(false) +{ + // Initialize CURL globally if no sessions are active + if ( ms_activeSessions == 0 ) + InitializeCURL(); + + ms_activeSessions++; } wxWebSessionCURL::~wxWebSessionCURL() { + { + // Notify the work thread + m_shuttingDown = true; + wxMutexLocker lock(m_mutex); + m_condition.Broadcast(); + } + // Wait for work thread to finish + if ( GetThread() && GetThread()->IsRunning() ) + GetThread()->Wait(wxTHREAD_WAIT_BLOCK); + + if ( m_handle ) + curl_multi_cleanup(m_handle); + + // Global CURL cleanup if this is the last session + --ms_activeSessions; + if ( ms_activeSessions == 0 ) + CleanupCURL(); +} + +void wxWebSessionCURL::Initialize() +{ + m_handle = curl_multi_init(); } wxWebRequest* wxWebSessionCURL::CreateRequest(const wxString& url, int id) { - wxFAIL_MSG("not implemented"); - return NULL; + if ( !m_handle ) + Initialize(); + + return new wxWebRequestCURL(*this, id, url); +} + +wxThread::ExitCode wxWebSessionCURL::Entry() +{ + m_mutex.Lock(); + + int activeRequests = -1; + int repeats = 0; + + while ( activeRequests ) + { + // Instruct CURL to work on requests + curl_multi_perform(m_handle, &activeRequests); + + // Process CURL message queue + int msgQueueCount; + while ( CURLMsg* msg = curl_multi_info_read(m_handle, &msgQueueCount) ) + { + if ( msg->msg == CURLMSG_DONE ) + { + wxWebRequestCURL* request; + curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &request); + curl_multi_remove_handle(m_handle, msg->easy_handle); + request->HandleCompletion(); + } + } + + if ( activeRequests ) + { + // Wait for CURL work to finish + int numfds; + curl_multi_wait(m_handle, NULL, 0, 1000, &numfds); + + if ( !numfds ) + { + repeats++; // count number of repeated zero numfds + if ( repeats > 1 ) + wxMilliSleep(100); + } + else + repeats = 0; + } + else + { + // Wait for new requests or shutdown of the session + m_condition.Wait(); + if ( !m_shuttingDown ) + activeRequests = -1; + } + } + + return (wxThread::ExitCode)0; +} + +bool wxWebSessionCURL::StartRequest(wxWebRequestCURL & request) +{ + // Add request easy handle to multi handle + curl_multi_add_handle(m_handle, request.GetHandle()); + + // Create and start session thread if not yet running + if ( !GetThread() ) + { + if ( CreateThread() ) + return false; + + if ( GetThread()->Run() != wxTHREAD_NO_ERROR ) + return false; + } + + // Signal the worker thread to resume work + wxMutexLocker lock(m_mutex); + m_condition.Broadcast(); + + return true; +} + +// static +void wxWebSessionCURL::InitializeCURL() +{ + long initFlags = CURL_GLOBAL_SSL; +#ifdef WIN32 + initFlags |= CURL_GLOBAL_WIN32; +#endif // WIN32 + if ( curl_global_init(initFlags) ) + wxLogError("libcurl could not be initialized"); +} + +// static +void wxWebSessionCURL::CleanupCURL() +{ + if ( ms_activeSessions == 0 ) + curl_global_cleanup(); } #endif // wxUSE_WEBREQUEST_CURL From fe4a5343f7c0156b7615c887d616280756b5d00f Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Sun, 4 Nov 2018 14:46:03 +0100 Subject: [PATCH 052/218] Implement wxWebRequestCURL::GetBytesSent --- include/wx/webrequest_curl.h | 1 + src/common/webrequest_curl.cpp | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/wx/webrequest_curl.h b/include/wx/webrequest_curl.h index 6a75b35c53..45f34611e2 100644 --- a/include/wx/webrequest_curl.h +++ b/include/wx/webrequest_curl.h @@ -70,6 +70,7 @@ private: struct curl_slist *m_headerList; wxScopedPtr m_response; wxScopedPtr m_authChallenge; + wxFileOffset m_bytesSent; void DestroyHeaderList(); diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index c4f0ecb6d0..5c1a295c92 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -227,6 +227,8 @@ void wxWebRequestCURL::Start() bool wxWebRequestCURL::StartRequest() { + m_bytesSent = 0; + if ( static_cast(GetSession()).StartRequest(*this) ) { SetState(State_Active); @@ -271,7 +273,12 @@ wxString wxWebRequestCURL::GetError() const size_t wxWebRequestCURL::ReadData(char* buffer, size_t size) { if ( m_dataStream ) - return m_dataStream->Read((void*)buffer, size).LastRead(); + { + m_dataStream->Read((void*)buffer, size); + size_t readSize = m_dataStream->LastRead(); + m_bytesSent += readSize; + return readSize; + } else return 0; } @@ -292,14 +299,12 @@ wxWebResponse* wxWebRequestCURL::GetResponse() const wxFileOffset wxWebRequestCURL::GetBytesSent() const { - wxFAIL_MSG("not implemented"); - return 0; + return m_bytesSent; } wxFileOffset wxWebRequestCURL::GetBytesExpectedToSend() const { - wxFAIL_MSG("not implemented"); - return 0; + return m_dataSize; } // From d2420a064c3988dab602715890371090da88d563 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 5 Nov 2018 22:12:41 +0100 Subject: [PATCH 053/218] Implement wxWebRequestCURL::Cancel() --- include/wx/webrequest_curl.h | 5 +++++ src/common/webrequest_curl.cpp | 25 +++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/include/wx/webrequest_curl.h b/include/wx/webrequest_curl.h index 45f34611e2..d2cef8ad54 100644 --- a/include/wx/webrequest_curl.h +++ b/include/wx/webrequest_curl.h @@ -13,6 +13,7 @@ #if wxUSE_WEBREQUEST_CURL #include "wx/thread.h" +#include "wx/vector.h" #include "curl/curl.h" @@ -117,6 +118,8 @@ public: bool StartRequest(wxWebRequestCURL& request); + void CancelRequest(wxWebRequestCURL* request); + protected: wxThread::ExitCode Entry() wxOVERRIDE; @@ -125,6 +128,8 @@ private: wxCondition m_condition; wxMutex m_mutex; bool m_shuttingDown; + wxMutex m_cancelledMutex; + wxVector< wxObjectDataPtr > m_cancelledRequests; void Initialize(); diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 5c1a295c92..b4dbc00c89 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -243,7 +243,7 @@ bool wxWebRequestCURL::StartRequest() void wxWebRequestCURL::Cancel() { - wxFAIL_MSG("not implemented"); + static_cast(GetSession()).CancelRequest(this); } void wxWebRequestCURL::HandleCompletion() @@ -393,6 +393,18 @@ wxThread::ExitCode wxWebSessionCURL::Entry() while ( activeRequests ) { + // Handle cancelled requests + { + wxMutexLocker lock(m_cancelledMutex); + while ( !m_cancelledRequests.empty() ) + { + wxObjectDataPtr request(m_cancelledRequests.back()); + m_cancelledRequests.pop_back(); + curl_multi_remove_handle(m_handle, request->GetHandle()); + request->SetState(wxWebRequest::State_Cancelled); + } + } + // Instruct CURL to work on requests curl_multi_perform(m_handle, &activeRequests); @@ -413,7 +425,7 @@ wxThread::ExitCode wxWebSessionCURL::Entry() { // Wait for CURL work to finish int numfds; - curl_multi_wait(m_handle, NULL, 0, 1000, &numfds); + curl_multi_wait(m_handle, NULL, 0, 500, &numfds); if ( !numfds ) { @@ -458,6 +470,15 @@ bool wxWebSessionCURL::StartRequest(wxWebRequestCURL & request) return true; } +void wxWebSessionCURL::CancelRequest(wxWebRequestCURL* request) +{ + // Add the request to a list of threads that will be removed from the curl + // multi handle in the worker thread + wxMutexLocker lock(m_cancelledMutex); + request->IncRef(); + m_cancelledRequests.push_back(wxObjectDataPtr(request)); +} + // static void wxWebSessionCURL::InitializeCURL() { From 95264069eeb046ed87b1d74f71e6eea5479597aa Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 5 Nov 2018 23:08:18 +0100 Subject: [PATCH 054/218] Change creation order of mutex and condition --- include/wx/webrequest_curl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/webrequest_curl.h b/include/wx/webrequest_curl.h index d2cef8ad54..5d8d56b0a6 100644 --- a/include/wx/webrequest_curl.h +++ b/include/wx/webrequest_curl.h @@ -125,8 +125,8 @@ protected: private: CURLM* m_handle; - wxCondition m_condition; wxMutex m_mutex; + wxCondition m_condition; bool m_shuttingDown; wxMutex m_cancelledMutex; wxVector< wxObjectDataPtr > m_cancelledRequests; From 725e917ce8f3a4f9239915d2423940125f7a4ef6 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Tue, 6 Nov 2018 16:35:16 +0100 Subject: [PATCH 055/218] Add webrequest sample to configure --- configure | 2 ++ configure.in | 2 ++ 2 files changed, 4 insertions(+) diff --git a/configure b/configure index 03426ec764..f0b142da99 100755 --- a/configure +++ b/configure @@ -36718,6 +36718,8 @@ if test "$wxUSE_WEBREQUEST" = "yes"; then $as_echo "#define wxUSE_WEBREQUEST_WINHTTP 1" >>confdefs.h fi + + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS webrequest" fi diff --git a/configure.in b/configure.in index db5151b392..46c9067c47 100644 --- a/configure.in +++ b/configure.in @@ -6373,6 +6373,8 @@ if test "$wxUSE_WEBREQUEST" = "yes"; then dnl TODO: Check for the required headers/libraries under Windows AC_DEFINE(wxUSE_WEBREQUEST_WINHTTP) fi + + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS webrequest" fi dnl --------------------------------------------------------------------------- From 4af4dd6cbff1265340ae05f6fb98812cd11d4c22 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Tue, 6 Nov 2018 22:00:44 +0100 Subject: [PATCH 056/218] Init image handlers webrequest sample --- samples/webrequest/webrequest.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 5d3b1928e2..6b7e24afa3 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -22,6 +22,7 @@ #include "wx/artprov.h" #include "wx/webrequest.h" #include "wx/filedlg.h" +#include "wx/image.h" #ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" @@ -402,6 +403,8 @@ public: if ( !wxApp::OnInit() ) return false; + wxInitAllImageHandlers(); + // create the main application window WebRequestFrame *frame = new WebRequestFrame("wxWebRequest Sample App"); frame->Show(true); From 45f006d7528af14263ead2b245ca208e5a447b5e Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Tue, 6 Nov 2018 22:39:13 +0100 Subject: [PATCH 057/218] Add wxWebSession::GetLibraryVersionInfo() --- include/wx/msw/webrequest_winhttp.h | 2 ++ include/wx/webrequest.h | 3 +++ include/wx/webrequest_curl.h | 2 ++ interface/wx/webrequest.h | 6 ++++++ samples/webrequest/webrequest.cpp | 4 +++- src/common/webrequest_curl.cpp | 13 +++++++++++++ src/msw/webrequest_winhttp.cpp | 8 ++++++++ 7 files changed, 37 insertions(+), 1 deletion(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index cd4c1750f2..22607becd7 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -115,6 +115,8 @@ public: wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + wxVersionInfo GetLibraryVersionInfo() wxOVERRIDE; + HINTERNET GetHandle() const { return m_handle; } private: diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index be5f4136fa..644be4eb89 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -21,6 +21,7 @@ #include "wx/sharedptr.h" #include "wx/stream.h" #include "wx/vector.h" +#include "wx/versioninfo.h" class wxWebResponse; class wxWebSession; @@ -223,6 +224,8 @@ public: virtual wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) = 0; + virtual wxVersionInfo GetLibraryVersionInfo() = 0; + virtual void SetHeader(const wxString& name, const wxString& value) { m_headers[name] = value; } diff --git a/include/wx/webrequest_curl.h b/include/wx/webrequest_curl.h index 5d8d56b0a6..6d364241ff 100644 --- a/include/wx/webrequest_curl.h +++ b/include/wx/webrequest_curl.h @@ -116,6 +116,8 @@ public: wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + wxVersionInfo GetLibraryVersionInfo() wxOVERRIDE; + bool StartRequest(wxWebRequestCURL& request); void CancelRequest(wxWebRequestCURL* request); diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 4c24ac1ec5..b4d8c2f138 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -484,6 +484,12 @@ public: */ wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY); + /** + Retrieve the version information about the implementation library used + by this session. + */ + virtual wxVersionInfo GetLibraryVersionInfo(); + /** Sets a request header in every wxWebRequest created from this session after is has been set. diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 6b7e24afa3..52a347f242 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -165,6 +165,8 @@ public: CreateStatusBar(); + GetStatusBar()->SetStatusText(wxWebSession::GetDefault().GetLibraryVersionInfo().ToString()); + m_downloadProgressTimer.Bind(wxEVT_TIMER, &WebRequestFrame::OnProgressTimer, this); @@ -402,7 +404,7 @@ public: { if ( !wxApp::OnInit() ) return false; - + wxInitAllImageHandlers(); // create the main application window diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index b4dbc00c89..de4e96db31 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -479,6 +479,19 @@ void wxWebSessionCURL::CancelRequest(wxWebRequestCURL* request) m_cancelledRequests.push_back(wxObjectDataPtr(request)); } +wxVersionInfo wxWebSessionCURL::GetLibraryVersionInfo() +{ + const curl_version_info_data* vi = curl_version_info(CURLVERSION_NOW); + wxString desc = wxString::Format("libcurl/%s", vi->version); + if (vi->ssl_version[0]) + desc += " " + wxString(vi->ssl_version); + return wxVersionInfo("libcurl", + vi->version_num >> 16 & 0xff, + vi->version_num >> 8 & 0xff, + vi->version_num & 0xff, + desc); +} + // static void wxWebSessionCURL::InitializeCURL() { diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index eb7608564c..aad68998bc 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -524,4 +524,12 @@ wxWebRequest* wxWebSessionWinHTTP::CreateRequest(const wxString& url, int id) return new wxWebRequestWinHTTP(id, *this, url); } +wxVersionInfo wxWebSessionWinHTTP::GetLibraryVersionInfo() +{ + int verMaj, verMin, verMicro; + wxGetOsVersion(&verMaj, &verMin, &verMicro); + return wxVersionInfo("WinHTTP", verMaj, verMin, verMicro); +} + + #endif // wxUSE_WEBREQUEST_WINHTTP From 152e160f7616e5b2ff36805a930b7c06346595aa Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Tue, 6 Nov 2018 14:44:41 +0000 Subject: [PATCH 058/218] Initial NSURLSession implementation First incomplete implementation based on NSURLSession --- configure | 37 +++++ configure.in | 7 + include/wx/osx/webrequest_urlsession.h | 86 +++++++++- src/osx/webrequest_urlsession.mm | 218 ++++++++++++++++++++++++- 4 files changed, 335 insertions(+), 13 deletions(-) diff --git a/configure b/configure index f0b142da99..212a600a57 100755 --- a/configure +++ b/configure @@ -1139,6 +1139,7 @@ enable_ole enable_dataobj enable_webrequest enable_webrequestcurl +enable_webrequesturlsession enable_ipc enable_baseevtloop enable_epollloop @@ -2083,6 +2084,7 @@ Optional Features: --enable-dataobj use data object classes --enable-webrequest use wxWebRequest --enable-webrequest-curl use libcurl with wxWebRequest + --enable-webrequest-urlsession use NSURLSession with wxWebRequest --enable-ipc use interprocess communication (wxSocket etc.) --enable-baseevtloop use event loop in console programs too --enable-epollloop use wxEpollDispatcher class (Linux only) @@ -6580,7 +6582,37 @@ fi eval "$wx_cv_use_webrequestcurl" +if test "$USE_DARWIN" = 1; then + enablestring= + defaultval=$wxUSE_ALL_FEATURES + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + # Check whether --enable-webrequesturlsession was given. +if test "${enable_webrequesturlsession+set}" = set; then : + enableval=$enable_webrequesturlsession; + if test "$enableval" = yes; then + wx_cv_use_webrequesturlsession='wxUSE_WEBREQUEST_URLSESSION=yes' + else + wx_cv_use_webrequesturlsession='wxUSE_WEBREQUEST_URLSESSION=no' + fi + +else + + wx_cv_use_webrequesturlsession='wxUSE_WEBREQUEST_URLSESSION=${'DEFAULT_wxUSE_WEBREQUEST_URLSESSION":-$defaultval}" + +fi + + + eval "$wx_cv_use_webrequesturlsession" + +fi enablestring= defaultval=$wxUSE_ALL_FEATURES @@ -36714,6 +36746,11 @@ if test "$wxUSE_WEBREQUEST" = "yes"; then $as_echo "#define wxUSE_WEBREQUEST 1" >>confdefs.h + if test "$wxUSE_WEBREQUEST_URLSESSION" = "yes"; then + $as_echo "#define wxUSE_WEBREQUEST_URLSESSION 1" >>confdefs.h + + fi + if test "$wxUSE_MSW" = 1; then $as_echo "#define wxUSE_WEBREQUEST_WINHTTP 1" >>confdefs.h diff --git a/configure.in b/configure.in index 46c9067c47..76ce729155 100644 --- a/configure.in +++ b/configure.in @@ -700,6 +700,9 @@ WX_ARG_FEATURE(ole, [ --enable-ole use OLE classes (Win32 WX_ARG_FEATURE(dataobj, [ --enable-dataobj use data object classes], wxUSE_DATAOBJ) WX_ARG_FEATURE(webrequest, [ --enable-webrequest use wxWebRequest], wxUSE_WEBREQUEST) WX_ARG_FEATURE(webrequestcurl, [ --enable-webrequest-curl use libcurl with wxWebRequest], wxUSE_WEBREQUEST_LIBCURL) +if test "$USE_DARWIN" = 1; then +WX_ARG_FEATURE(webrequesturlsession, [ --enable-webrequest-urlsession use NSURLSession with wxWebRequest], wxUSE_WEBREQUEST_URLSESSION) +fi dnl USE_DARWIN WX_ARG_FEATURE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC) @@ -6369,6 +6372,10 @@ fi if test "$wxUSE_WEBREQUEST" = "yes"; then AC_DEFINE(wxUSE_WEBREQUEST) + if test "$wxUSE_WEBREQUEST_URLSESSION" = "yes"; then + AC_DEFINE(wxUSE_WEBREQUEST_URLSESSION) + fi + if test "$wxUSE_MSW" = 1; then dnl TODO: Check for the required headers/libraries under Windows AC_DEFINE(wxUSE_WEBREQUEST_WINHTTP) diff --git a/include/wx/osx/webrequest_urlsession.h b/include/wx/osx/webrequest_urlsession.h index 4997ac7305..3e4646907e 100644 --- a/include/wx/osx/webrequest_urlsession.h +++ b/include/wx/osx/webrequest_urlsession.h @@ -13,28 +13,98 @@ #if wxUSE_WEBREQUEST_URLSESSION DECLARE_WXCOCOA_OBJC_CLASS(NSURLSession); -DECLARE_WXCOCOA_OBJC_CLASS(NSURLTask); +DECLARE_WXCOCOA_OBJC_CLASS(NSURLSessionTask); +DECLARE_WXCOCOA_OBJC_CLASS(wxWebSessionDelegte); + +class wxWebSessionURLSession; +class wxWebResponseURLSession; + +class WXDLLIMPEXP_NET wxWebResponseURLSession: public wxWebResponse +{ +public: + wxWebResponseURLSession(wxWebRequest& request, WX_NSURLSessionTask task); + + ~wxWebResponseURLSession(); + + wxInt64 GetContentLength() const wxOVERRIDE; + + wxString GetURL() const wxOVERRIDE; + + wxString GetHeader(const wxString& name) const wxOVERRIDE; + + int GetStatus() const wxOVERRIDE; + + wxString GetStatusText() const wxOVERRIDE; + + wxString GetSuggestedFileName() const wxOVERRIDE; + + void HandleData(WX_NSData data); + +private: + WX_NSURLSessionTask m_task; +}; + +class WXDLLIMPEXP_NET wxWebRequestURLSession: public wxWebRequest +{ +public: + wxWebRequestURLSession(wxWebSessionURLSession& session, const wxString& url, int id); + + ~wxWebRequestURLSession(); + + void Start() wxOVERRIDE; + + void Cancel() wxOVERRIDE; + + wxWebResponse* GetResponse() const wxOVERRIDE + { return m_response.get(); } + + wxWebAuthChallenge* GetAuthChallenge() const wxOVERRIDE; + + wxFileOffset GetBytesSent() const wxOVERRIDE; + + wxFileOffset GetBytesExpectedToSend() const wxOVERRIDE; + + wxFileOffset GetBytesReceived() const wxOVERRIDE; + + wxFileOffset GetBytesExpectedToReceive() const wxOVERRIDE; + + void HandleCompletion(); + +private: + wxString m_url; + WX_NSURLSessionTask m_task; + wxScopedPtr m_response; + + wxDECLARE_NO_COPY_CLASS(wxWebRequestURLSession); +}; class WXDLLIMPEXP_NET wxWebSessionURLSession: public wxWebSession { public: - wxWebSessionURLSession(); + wxWebSessionURLSession(); - ~wxWebSessionURLSession(); + ~wxWebSessionURLSession(); - wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + + wxVersionInfo GetLibraryVersionInfo() wxOVERRIDE; + + WX_NSURLSession GetSession() { return m_session; } + + WX_wxWebSessionDelegte GetDelegate() { return m_delegate; } private: - WX_NSURLSession m_session; + WX_NSURLSession m_session; + WX_wxWebSessionDelegte m_delegate; - wxDECLARE_NO_COPY_CLASS(wxWebSessionURLSession); + wxDECLARE_NO_COPY_CLASS(wxWebSessionURLSession); }; class WXDLLIMPEXP_NET wxWebSessionFactoryURLSession: public wxWebSessionFactory { public: - wxWebSession* Create() wxOVERRIDE - { return new wxWebSessionURLSession(); } + wxWebSession* Create() wxOVERRIDE + { return new wxWebSessionURLSession(); } }; #endif // wxUSE_WEBREQUEST_URLSESSION diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 7b241e8034..2ef93d5957 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -21,22 +21,230 @@ #import #include "wx/osx/webrequest_urlsession.h" +#include "wx/osx/private.h" + +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/utils.h" +#endif + +@interface wxWebSessionDelegte : NSObject +{ + wxWebSessionURLSession* m_session; + NSMapTable* m_requests; +} + +@end + +@implementation wxWebSessionDelegte + +- initWithSession:(wxWebSessionURLSession*)session +{ + m_session = session; + m_requests = [[NSMapTable weakToStrongObjectsMapTable] retain]; + return self; +} + +- (void)dealloc +{ + [m_requests release]; + [super dealloc]; +} + +- (void)registerRequest:(wxWebRequestURLSession*)request task:(NSURLSessionTask*)task +{ + [m_requests setObject:[NSValue valueWithPointer:request] forKey:task]; +} + +- (wxWebRequestURLSession*)requestForTask:(NSURLSessionTask*)task +{ + wxWebRequestURLSession* request = NULL; + NSValue* val = [m_requests objectForKey:task]; + if (val) + request = static_cast(val.pointerValue); + + return request; +} + +- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data +{ + wxWebRequestURLSession* request = [self requestForTask:dataTask]; + if (request) + static_cast(request->GetResponse())->HandleData(data); +} + +- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error +{ + wxWebRequestURLSession* request = [self requestForTask:task]; + if (error) + request->SetState(wxWebRequest::State_Failed, wxCFStringRef(error.localizedDescription).AsString()); + else + request->HandleCompletion(); + + // After the task is completed it no longer needs to be mapped + [m_requests removeObjectForKey:task]; +} + +@end + +// +// wxWebRequestURLSession +// +wxWebRequestURLSession::wxWebRequestURLSession(wxWebSessionURLSession& session, const wxString& url, int id): + wxWebRequest(session, id), + m_url(url) +{ + +} + +wxWebRequestURLSession::~wxWebRequestURLSession() +{ + [m_task release]; +} + +void wxWebRequestURLSession::Start() +{ + wxWebSessionURLSession& session = static_cast(GetSession()); + + m_task = [[session.GetSession() dataTaskWithURL: + [NSURL URLWithString:wxCFStringRef(m_url).AsNSString()]] retain]; + + // The session delegate needs to know which task is wrapped in which request + [session.GetDelegate() registerRequest:this task:m_task]; + + m_response.reset(new wxWebResponseURLSession(*this, m_task)); + m_response->Init(); + + SetState(State_Active); + [m_task resume]; +} + +void wxWebRequestURLSession::Cancel() +{ + [m_task cancel]; +} + +void wxWebRequestURLSession::HandleCompletion() +{ + if ( CheckServerStatus() ) + SetState(State_Completed); +} + +wxWebAuthChallenge* wxWebRequestURLSession::GetAuthChallenge() const +{ + wxFAIL_MSG("not implemented"); + return NULL; +} + +wxFileOffset wxWebRequestURLSession::GetBytesSent() const +{ + return m_task.countOfBytesSent; +} + +wxFileOffset wxWebRequestURLSession::GetBytesExpectedToSend() const +{ + return m_task.countOfBytesExpectedToSend; +} + +wxFileOffset wxWebRequestURLSession::GetBytesReceived() const +{ + return m_task.countOfBytesReceived; +} + +wxFileOffset wxWebRequestURLSession::GetBytesExpectedToReceive() const +{ + return m_task.countOfBytesExpectedToReceive; +} + +// +// wxWebResponseURLSession +// + +wxWebResponseURLSession::wxWebResponseURLSession(wxWebRequest& request, WX_NSURLSessionTask task): + wxWebResponse(request) +{ + m_task = [task retain]; +} + +wxWebResponseURLSession::~wxWebResponseURLSession() +{ + [m_task release]; +} + +void wxWebResponseURLSession::HandleData(WX_NSData data) +{ + [data enumerateByteRangesUsingBlock:^(const void * _Nonnull bytes, NSRange byteRange, BOOL * _Nonnull stop) { + void* buf = GetDataBuffer(byteRange.length); + std::memcpy(buf, bytes, byteRange.length); + ReportDataReceived(byteRange.length); + }]; +} + +wxInt64 wxWebResponseURLSession::GetContentLength() const +{ + return m_task.response.expectedContentLength; +} + +wxString wxWebResponseURLSession::GetURL() const +{ + return wxCFStringRef(m_task.response.URL.absoluteString).AsString(); +} + +wxString wxWebResponseURLSession::GetHeader(const wxString& name) const +{ + NSHTTPURLResponse* httpResp = (NSHTTPURLResponse*) m_task.response; + NSString* value = [httpResp.allHeaderFields objectForKey:wxCFStringRef(name).AsNSString()]; + if (value) + return wxCFStringRef(value).AsString(); + else + return wxString(); +} + +int wxWebResponseURLSession::GetStatus() const +{ + NSHTTPURLResponse* httpResp = (NSHTTPURLResponse*) m_task.response; + return httpResp.statusCode; +} + +wxString wxWebResponseURLSession::GetStatusText() const +{ + return wxCFStringRef([NSHTTPURLResponse localizedStringForStatusCode:GetStatus()]).AsString(); +} + +wxString wxWebResponseURLSession::GetSuggestedFileName() const +{ + return wxCFStringRef(m_task.response.suggestedFilename).AsString(); +} + +// +// wxWebSessionURLSession +// wxWebSessionURLSession::wxWebSessionURLSession() { - m_session = [NSURLSession sessionWithConfiguration: - [NSURLSessionConfiguration defaultSessionConfiguration]]; + m_delegate = [[wxWebSessionDelegte alloc] initWithSession:this]; + + m_session = [[NSURLSession sessionWithConfiguration: + [NSURLSessionConfiguration defaultSessionConfiguration] + delegate:m_delegate delegateQueue:nil] retain]; } wxWebSessionURLSession::~wxWebSessionURLSession() { - [m_session release]; + [m_session release]; + [m_delegate release]; } wxWebRequest* wxWebSessionURLSession::CreateRequest(const wxString& url, int id) { - wxFAIL_MSG("not implemented"); - return NULL; + return new wxWebRequestURLSession(*this, url, id); +} + +wxVersionInfo wxWebSessionURLSession::GetLibraryVersionInfo() +{ + int verMaj, verMin, verMicro; + wxGetOsVersion(&verMaj, &verMin, &verMicro); + return wxVersionInfo("URLSession", verMaj, verMin, verMicro); } #endif // wxUSE_WEBREQUEST_URLSESSION From d477aade96d75debf07d7c78205c8f28637aa4b1 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 12 Nov 2018 14:14:11 +0100 Subject: [PATCH 059/218] Use different method to get NSData bytes --- src/osx/webrequest_urlsession.mm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 2ef93d5957..6a1e10937a 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -173,11 +173,9 @@ wxWebResponseURLSession::~wxWebResponseURLSession() void wxWebResponseURLSession::HandleData(WX_NSData data) { - [data enumerateByteRangesUsingBlock:^(const void * _Nonnull bytes, NSRange byteRange, BOOL * _Nonnull stop) { - void* buf = GetDataBuffer(byteRange.length); - std::memcpy(buf, bytes, byteRange.length); - ReportDataReceived(byteRange.length); - }]; + void* buf = GetDataBuffer(data.length); + [data getBytes:buf length:data.length]; + ReportDataReceived(data.length); } wxInt64 wxWebResponseURLSession::GetContentLength() const From 37df063a26909466fec7943a8bc8c3b436696d99 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 12 Nov 2018 14:57:10 +0100 Subject: [PATCH 060/218] Implement POST requests with NSURLSession --- src/osx/webrequest_urlsession.mm | 37 +++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 6a1e10937a..c80eac7568 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -24,8 +24,8 @@ #include "wx/osx/private.h" #ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/utils.h" + #include "wx/log.h" + #include "wx/utils.h" #endif @interface wxWebSessionDelegte : NSObject @@ -94,7 +94,7 @@ wxWebRequestURLSession::wxWebRequestURLSession(wxWebSessionURLSession& session, wxWebRequest(session, id), m_url(url) { - + m_headers = session.GetHeaders(); } wxWebRequestURLSession::~wxWebRequestURLSession() @@ -106,8 +106,35 @@ void wxWebRequestURLSession::Start() { wxWebSessionURLSession& session = static_cast(GetSession()); - m_task = [[session.GetSession() dataTaskWithURL: - [NSURL URLWithString:wxCFStringRef(m_url).AsNSString()]] retain]; + NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL: + [NSURL URLWithString:wxCFStringRef(m_url).AsNSString()]]; + if (m_method.empty()) + req.HTTPMethod = (m_dataSize) ? @"POST" : @"GET"; + else + req.HTTPMethod = wxCFStringRef(m_method).AsNSString(); + + // Set request headers + for (wxWebRequestHeaderMap::const_iterator it = m_headers.begin(); it != m_headers.end(); ++it) + { + [req setValue:wxCFStringRef(it->second).AsNSString() forHTTPHeaderField: + wxCFStringRef(it->first).AsNSString()]; + } + + if (m_dataSize) + { + // Read all upload data to memory buffer + wxMemoryBuffer memBuf; + m_dataStream->Read(memBuf.GetWriteBuf(m_dataSize), m_dataSize); + + // Create NSDAta from memory buffer + NSData* data = [NSData dataWithBytes:memBuf.GetData() length:m_dataSize]; + m_task = [[session.GetSession() uploadTaskWithRequest:req fromData:data] retain]; + } + else + { + // Create data task + m_task = [[session.GetSession() dataTaskWithRequest:req] retain]; + } // The session delegate needs to know which task is wrapped in which request [session.GetDelegate() registerRequest:this task:m_task]; From 5077eaee6c96ce0b1af5a803cfeea182c4101b2b Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 12 Nov 2018 17:32:36 +0100 Subject: [PATCH 061/218] Expand button sizer in webrequest sample --- samples/webrequest/webrequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 52a347f242..1e861d1ed1 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -153,7 +153,7 @@ public: m_startButton->Bind(wxEVT_BUTTON, &WebRequestFrame::OnStartButton, this); btnSizer->AddButton(m_startButton); btnSizer->Realize(); - mainSizer->Add(btnSizer, wxSizerFlags().Border()); + mainSizer->Add(btnSizer, wxSizerFlags().Expand().Border()); wxCommandEvent evt; OnPostCheckBox(evt); From 85c6fee7cf8917468029b28ae05ee71ae05b051c Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 12 Nov 2018 21:42:36 +0100 Subject: [PATCH 062/218] Add support for libcurl before version 7.28.0 Support older versions might be useful for older linux distributions and could be used as a possible fallback to macOS URLSession implementation on macOS 10.7 and 10.8. --- src/common/webrequest_curl.cpp | 48 +++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index de4e96db31..746e7455a5 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -32,6 +32,12 @@ (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) #endif +#if CURL_AT_LEAST_VERSION(7, 28, 0) + #define wxCURL_HAVE_MULTI_WAIT 1 +#else + #define wxCURL_HAVE_MULTI_WAIT 0 +#endif + // // wxWebResponseCURL // @@ -384,6 +390,46 @@ wxWebRequest* wxWebSessionCURL::CreateRequest(const wxString& url, int id) return new wxWebRequestCURL(*this, id, url); } +static CURLMcode wx_curl_multi_wait(CURLM *multi_handle, int timeout_ms, + int *ret) +{ + // since libcurl 7.28.0 the curl_multi_wait method is more convient than + // calling multiple curl_multi_... methods. + // When support for older libcurl versions is dropped this wrapper can be + // removed. +#if wxCURL_HAVE_MULTI_WAIT + return curl_multi_wait(multi_handle, NULL, 0, timeout_ms, ret); +#else + wxASSERT(ret != NULL); + + fd_set fdread; + fd_set fdwrite; + fd_set fdexcep; + timeval timeout; + + long curl_timeo; + + curl_multi_timeout(multi_handle, &curl_timeo); + if ( curl_timeo < 0 ) + curl_timeo = timeout_ms; + + timeout.tv_sec = curl_timeo / 1000; + timeout.tv_usec = (curl_timeo % 1000) * 1000; + + FD_ZERO(&fdread); + FD_ZERO(&fdwrite); + FD_ZERO(&fdexcep); + + curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, ret); + if ( *ret == -1 ) + return CURLM_OK; + else if ( select(*ret + 1, &fdread, &fdwrite, &fdexcep, &timeout) == -1 ) + return CURLM_BAD_SOCKET; + else + return CURLM_OK; +#endif +} + wxThread::ExitCode wxWebSessionCURL::Entry() { m_mutex.Lock(); @@ -425,7 +471,7 @@ wxThread::ExitCode wxWebSessionCURL::Entry() { // Wait for CURL work to finish int numfds; - curl_multi_wait(m_handle, NULL, 0, 500, &numfds); + wx_curl_multi_wait(m_handle, 500, &numfds); if ( !numfds ) { From 68cbd54db031e1328b30354c49a9ca73a1ead529 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Mon, 10 Dec 2018 21:09:47 +0100 Subject: [PATCH 063/218] Update since version --- interface/wx/webrequest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index b4d8c2f138..2e2f443854 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -103,7 +103,7 @@ A new block of data has been downloaded. @endEventTable - @since 3.1.2 + @since 3.1.3 @library{wxnet} @category{net} From fcaccbf12c092e0e9215ee3ce4c7fb0730b1be6a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Dec 2020 18:12:44 +0100 Subject: [PATCH 064/218] Avoid -Wswitch warnings in wxWebRequest test No real changes, just suppress the warnings about not handling all states in a switch. --- tests/net/webrequest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 175fd071fc..b2c0de4223 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -75,6 +75,10 @@ public: case wxWebRequest::State_Cancelled: loop.Exit(); break; + + case wxWebRequest::State_Idle: + case wxWebRequest::State_Active: + break; } } From 92e41a7477822d563408248c9c58f6c7d5a42767 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Dec 2020 18:13:25 +0100 Subject: [PATCH 065/218] Improve reporting test failures due to assert failures Show the condition which failed for wxASSERT() (as opposed to wxASSERT_MSG()), as otherwise the error message didn't show any information at all, making diagnosing the problem impossible. Also show the assert location, as this can be useful too and there doesn't seem to be any reason not to do it. --- tests/test.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test.cpp b/tests/test.cpp index f2b0d84ef7..76a99d1134 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -171,7 +171,13 @@ static void TestAssertHandler(const wxString& file, CATCH_TRANSLATE_EXCEPTION(TestAssertFailure& e) { - return e.m_msg.ToStdString(wxConvUTF8); + wxString desc = e.m_msg; + if ( desc.empty() ) + desc.Printf(wxASCII_STR("Condition \"%s\" failed"), e.m_cond); + + desc += wxString::Format(wxASCII_STR(" in %s() at %s:%d"), e.m_func, e.m_file, e.m_line); + + return desc.ToStdString(wxConvUTF8); } #endif // wxDEBUG_LEVEL From 64a380116009426ac416a75c4006986ef7680e1f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Dec 2020 18:46:28 +0100 Subject: [PATCH 066/218] Tweaks to wxWebRequest::SetData() overload taking stream Check that the stream is valid, if specified at all, and return false if it isn't -- or if no size was specified and determining stream size failed. Check for SetData() success in the test to provide better diagnostics in case the file it uses is not found (as is the case when running the test from another directory, for example). Also pass wxSharedPtr<> by const reference instead of by value to avoid unnecessary copies. --- include/wx/webrequest.h | 2 +- interface/wx/webrequest.h | 9 +++++++-- src/common/webrequest.cpp | 10 +++++++++- tests/net/webrequest.cpp | 6 ++++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 644be4eb89..1cf1604e00 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -58,7 +58,7 @@ public: void SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv = wxConvUTF8); - void SetData(wxSharedPtr dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); + bool SetData(const wxSharedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 2e2f443854..841c95bab7 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -245,7 +245,9 @@ public: this request. @param dataStream - The data in this stream will be posted as the request body + The data in this stream will be posted as the request body. The + stream may be empty, which will result in sending 0 bytes of data, + but if not empty, should be valid. @param contentType The value of HTTP "Content-Type" header, e.g. "application/octet-stream". @@ -253,8 +255,11 @@ public: Amount of data which is sent to the server. If set to @c wxInvalidOffset all stream data is sent. + @return @false if @a dataStream is not-empty but invalid or if @a + dataSize is not specified and the attempt to determine stream size + failed; @true in all the other cases. */ - void SetData(wxSharedPtr dataStream, + bool SetData(const wxSharedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); /** diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 48f63d4bc7..e4bb3d6171 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -83,8 +83,11 @@ void wxWebRequest::SetData(const wxString& text, const wxString& contentType, co SetData(wxSharedPtr(new wxMemoryInputStream(m_dataText, m_dataText.length())), contentType); } -void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString& contentType, wxFileOffset dataSize) +bool wxWebRequest::SetData(const wxSharedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize) { + if ( !dataStream->IsOk() ) + return false; + m_dataStream = dataStream; if ( m_dataStream.get() ) { @@ -92,6 +95,9 @@ void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString { // Determine data size m_dataSize = m_dataStream->SeekI(0, wxFromEnd); + if ( m_dataSize == wxInvalidOffset ) + return false; + m_dataStream->SeekI(0); } else @@ -101,6 +107,8 @@ void wxWebRequest::SetData(wxSharedPtr dataStream, const wxString m_dataSize = 0; SetHeader("Content-Type", contentType); + + return true; } wxFileOffset wxWebRequest::GetBytesReceived() const diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index b2c0de4223..3482492d11 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -172,8 +172,10 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][.]") SECTION("PUT file data") { Create("/put"); - request->SetData(wxSharedPtr(new wxFileInputStream("horse.png")), - "image/png"); + wxSharedPtr is(new wxFileInputStream("horse.png")); + REQUIRE( is->IsOk() ); + + request->SetData(is, "image/png"); request->SetMethod("PUT"); Run(); } From f35c2d9e5868d650499c3cc50901516ed1ba861b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Dec 2020 19:00:11 +0100 Subject: [PATCH 067/218] Use PKG_CHECK_MODULES() to test for libcurl in configure This is simpler and better (supports cross-compiling, manual override, ...) than doing it manually. Also disable wxWebRequest completely under Unix if libcurl was not found, as it's the only backend which can be used on non-MSW/Mac platforms. --- configure | 146 +++++++++++++++++++++++++++++++++------------------ configure.in | 33 +++++++----- 2 files changed, 114 insertions(+), 65 deletions(-) diff --git a/configure b/configure index 63454f3c1c..396dea18cb 100755 --- a/configure +++ b/configure @@ -983,6 +983,8 @@ DIRECTFB_CFLAGS GTK_CONFIG GTK_LIBS GTK_CFLAGS +LIBCURL_LIBS +LIBCURL_CFLAGS subdirs wxCFLAGS_C99 LIBTIFF_LIBS @@ -1388,6 +1390,8 @@ CCC PKG_CONFIG LIBTIFF_CFLAGS LIBTIFF_LIBS +LIBCURL_CFLAGS +LIBCURL_LIBS DIRECTFB_CFLAGS DIRECTFB_LIBS XMKMF @@ -2402,6 +2406,10 @@ Some influential environment variables: C compiler flags for LIBTIFF, overriding pkg-config LIBTIFF_LIBS linker flags for LIBTIFF, overriding pkg-config + LIBCURL_CFLAGS + C compiler flags for LIBCURL, overriding pkg-config + LIBCURL_LIBS + linker flags for LIBCURL, overriding pkg-config DIRECTFB_CFLAGS C compiler flags for DIRECTFB, overriding pkg-config DIRECTFB_LIBS @@ -22961,64 +22969,98 @@ if test "$wxUSE_LIBMSPACK" != "no"; then fi -if test "$wxUSE_WEBREQUEST_CURL" != "no"; then - ac_fn_c_check_header_mongrel "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default" -if test "x$ac_cv_header_curl_curl_h" = xyes; then : +if test "$wxUSE_WEBREQUEST_LIBCURL" != "no"; then -fi +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCURL" >&5 +$as_echo_n "checking for LIBCURL... " >&6; } - - - if test "$ac_cv_header_curl_curl_h" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5 -$as_echo_n "checking for curl_easy_init in -lcurl... " >&6; } -if ${ac_cv_lib_curl_curl_easy_init+:} false; then : - $as_echo_n "(cached) " >&6 +if test -n "$PKG_CONFIG"; then + if test -n "$LIBCURL_CFLAGS"; then + pkg_cv_LIBCURL_CFLAGS="$LIBCURL_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBCURL_CFLAGS=`$PKG_CONFIG --cflags "libcurl" 2>/dev/null` else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcurl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char curl_easy_init (); -int -main () -{ -return curl_easy_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_curl_curl_easy_init=yes -else - ac_cv_lib_curl_curl_easy_init=no + pkg_failed=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curl_curl_easy_init" >&5 -$as_echo "$ac_cv_lib_curl_curl_easy_init" >&6; } -if test "x$ac_cv_lib_curl_curl_easy_init" = xyes; then : - - CURL_LINK="-lcurl" - LIBS="$CURL_LINK $LIBS" - $as_echo "#define wxUSE_WEBREQUEST_CURL 1" >>confdefs.h - - -fi - fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$LIBCURL_LIBS"; then + pkg_cv_LIBCURL_LIBS="$LIBCURL_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBCURL_LIBS=`$PKG_CONFIG --libs "libcurl" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi - if test -z "$CURL_LINK"; then - wxUSE_WEBREQUEST_CURL=no + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBCURL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libcurl"` + else + LIBCURL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libcurl"` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBCURL_PKG_ERRORS" >&5 + + + wxUSE_WEBREQUEST_LIBCURL=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + + +elif test $pkg_failed = untried; then + + wxUSE_WEBREQUEST_LIBCURL=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + + +else + LIBCURL_CFLAGS=$pkg_cv_LIBCURL_CFLAGS + LIBCURL_LIBS=$pkg_cv_LIBCURL_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS" + LIBS="$LIBCURL_LIBS $LIBS" + $as_echo "#define wxUSE_WEBREQUEST_LIBCURL 1" >>confdefs.h + + +fi + + if test "$wxUSE_WEBREQUEST_LIBCURL" = "no"; then + if test "$USE_WIN32" != 1 -a "$USE_DARWIN" != 1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl not found, wxWebRequest won't be available" >&5 +$as_echo "$as_me: WARNING: libcurl not found, wxWebRequest won't be available" >&2;} + wxUSE_WEBREQUEST=no + fi fi fi diff --git a/configure.in b/configure.in index 620cbc6777..bd8853d87a 100644 --- a/configure.in +++ b/configure.in @@ -2924,20 +2924,27 @@ dnl ------------------------------------------------------------------------ dnl Check for libcurl dnl ------------------------------------------------------------------------ -if test "$wxUSE_WEBREQUEST_CURL" != "no"; then - AC_CHECK_HEADER(curl/curl.h,,,[]) +if test "$wxUSE_WEBREQUEST_LIBCURL" != "no"; then + PKG_CHECK_MODULES(LIBCURL, [libcurl], + [ + CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS" + LIBS="$LIBCURL_LIBS $LIBS" + AC_DEFINE(wxUSE_WEBREQUEST_LIBCURL) + ], + [ + wxUSE_WEBREQUEST_LIBCURL=no + AC_MSG_RESULT([not found]) + ] + ) - if test "$ac_cv_header_curl_curl_h" = "yes"; then - AC_CHECK_LIB(curl, curl_easy_init, - [ - CURL_LINK="-lcurl" - LIBS="$CURL_LINK $LIBS" - AC_DEFINE(wxUSE_WEBREQUEST_CURL) - ]) - fi - - if test -z "$CURL_LINK"; then - wxUSE_WEBREQUEST_CURL=no + if test "$wxUSE_WEBREQUEST_LIBCURL" = "no"; then + dnl Under these platforms we have other, always available, backends for + dnl wxWebRequest, but under the others (i.e. generic Unix) libcurl is + dnl the only way to implement wxWebRequest. + if test "$USE_WIN32" != 1 -a "$USE_DARWIN" != 1; then + AC_MSG_WARN([libcurl not found, wxWebRequest won't be available]) + wxUSE_WEBREQUEST=no + fi fi fi From efbfa321d6cf9a01f39241e094ac845837c1c807 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Dec 2020 19:12:49 +0100 Subject: [PATCH 068/218] Add --with-winhttp configure option This is mostly useful for disabling the use of WinHTTP, e.g. because only libcurl-based backend will be used or because WinHTTP headers or libraries are not available and so using it would fail in any case. --- configure | 53 ++++++++++++++++++++++++++++++++++++++++++++++++---- configure.in | 15 +++++++++++---- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/configure b/configure index 396dea18cb..bee0a146cb 100755 --- a/configure +++ b/configure @@ -1105,6 +1105,7 @@ with_regex with_liblzma with_zlib with_expat +with_winhttp with_macosx_sdk with_macosx_version_min enable_debug @@ -2380,6 +2381,7 @@ Optional Packages: --with-liblzma use LZMA compression) --with-zlib use zlib for LZW compression --with-expat enable XML support using expat parser + --with-winhttp use WinHTTP-based wxWebRequest --with-macosx-sdk=PATH use macOS SDK at PATH --with-macosx-version-min=VER build binaries requiring at least this macOS version (default and lowest supported: 10.10) --with-cxx=11|14|17 use the given C++ dialect @@ -5348,6 +5350,38 @@ fi eval "$wx_cv_use_expat" +if test "$USE_WIN32" = 1; then + + withstring= + defaultval=$wxUSE_ALL_FEATURES + if test -z "$defaultval"; then + if test x"$withstring" = xwithout; then + defaultval=yes + else + defaultval=no + fi + fi + +# Check whether --with-winhttp was given. +if test "${with_winhttp+set}" = set; then : + withval=$with_winhttp; + if test "$withval" = yes; then + wx_cv_use_winhttp='wxUSE_WINHTTP=yes' + else + wx_cv_use_winhttp='wxUSE_WINHTTP=no' + fi + +else + + wx_cv_use_winhttp='wxUSE_WINHTTP=${'DEFAULT_wxUSE_WINHTTP":-$defaultval}" + +fi + + + eval "$wx_cv_use_winhttp" + +fi + if test "$USE_DARWIN" = 1; then @@ -23091,8 +23125,19 @@ fi if test "$wxUSE_ACCESSIBILITY" = "yes" ; then LIBS="$LIBS -loleacc" fi - if test "$wxUSE_WEBREQUEST" = "yes" ; then - LIBS="$LIBS -lwinhttp" + if test "$wxUSE_WINHTTP" = "yes" ; then + ac_fn_c_check_header_mongrel "$LINENO" "winhttp.h" "ac_cv_header_winhttp_h" "$ac_includes_default" +if test "x$ac_cv_header_winhttp_h" = xyes; then : + +else + wxUSE_WINHTTP=no +fi + + + + if test "$wxUSE_WINHTTP" = "yes" ; then + LIBS="$LIBS -lwinhttp" + fi fi case "${host}" in @@ -36078,8 +36123,8 @@ if test "$wxUSE_WEBREQUEST" = "yes"; then fi - if test "$wxUSE_MSW" = 1; then - $as_echo "#define wxUSE_WEBREQUEST_WINHTTP 1" >>confdefs.h + if test "$wxUSE_WINHTTP" = "yes"; then + $as_echo "#define wxUSE_WEBREQUEST_WINHTTP 1" >>confdefs.h fi diff --git a/configure.in b/configure.in index bd8853d87a..608c413d5b 100644 --- a/configure.in +++ b/configure.in @@ -576,6 +576,10 @@ WX_ARG_WITH(liblzma, [ --with-liblzma use LZMA compression)], wx WX_ARG_SYS_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB) WX_ARG_SYS_WITH(expat, [ --with-expat enable XML support using expat parser], wxUSE_EXPAT) +if test "$USE_WIN32" = 1; then +WX_ARG_WITH(winhttp, [ --with-winhttp use WinHTTP-based wxWebRequest], wxUSE_WINHTTP) +fi + if test "$USE_DARWIN" = 1; then AC_ARG_WITH(macosx-sdk, [ --with-macosx-sdk=PATH use macOS SDK at PATH], [ @@ -2977,8 +2981,12 @@ if test "$USE_WIN32" = 1 ; then if test "$wxUSE_ACCESSIBILITY" = "yes" ; then LIBS="$LIBS -loleacc" fi - if test "$wxUSE_WEBREQUEST" = "yes" ; then - LIBS="$LIBS -lwinhttp" + if test "$wxUSE_WINHTTP" = "yes" ; then + AC_CHECK_HEADER(winhttp.h,,[ wxUSE_WINHTTP=no ]) + + if test "$wxUSE_WINHTTP" = "yes" ; then + LIBS="$LIBS -lwinhttp" + fi fi case "${host}" in @@ -6591,8 +6599,7 @@ if test "$wxUSE_WEBREQUEST" = "yes"; then AC_DEFINE(wxUSE_WEBREQUEST_URLSESSION) fi - if test "$wxUSE_MSW" = 1; then - dnl TODO: Check for the required headers/libraries under Windows + if test "$wxUSE_WINHTTP" = "yes"; then AC_DEFINE(wxUSE_WEBREQUEST_WINHTTP) fi From 56e58efcaaa93254437d02ce529286c976fc049e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:03:52 +0100 Subject: [PATCH 069/218] Replace --enable-webrequest-xxx configure options with --with-xxx Using --with is more appropriate for libcurl and WinHTTP as they introduce dependencies on external libraries and is done for NSURLSession too for consistency. And there doesn't seem to be any real reason to make these options names longer by including "webrequest" in their names, they're clear and unambiguous enough even without it. --- configure | 142 +++++++++++++++++++++++--------------------- configure.in | 20 ++++--- docs/gtk/install.md | 3 + 3 files changed, 89 insertions(+), 76 deletions(-) diff --git a/configure b/configure index bee0a146cb..a4a69b02a6 100755 --- a/configure +++ b/configure @@ -1105,7 +1105,9 @@ with_regex with_liblzma with_zlib with_expat +with_libcurl with_winhttp +with_urlsession with_macosx_sdk with_macosx_version_min enable_debug @@ -1156,8 +1158,6 @@ enable_ipv6 enable_ole enable_dataobj enable_webrequest -enable_webrequestcurl -enable_webrequesturlsession enable_ipc enable_baseevtloop enable_epollloop @@ -2124,8 +2124,6 @@ Optional Features: --enable-ole use OLE classes (Win32 only) --enable-dataobj use data object classes --enable-webrequest use wxWebRequest - --enable-webrequest-curl use libcurl with wxWebRequest - --enable-webrequest-urlsession use NSURLSession with wxWebRequest --enable-ipc use interprocess communication (wxSocket etc.) --enable-baseevtloop use event loop in console programs too --enable-epollloop use wxEpollDispatcher class (Linux only) @@ -2381,7 +2379,9 @@ Optional Packages: --with-liblzma use LZMA compression) --with-zlib use zlib for LZW compression --with-expat enable XML support using expat parser + --with-libcurl use libcurl-based wxWebRequest --with-winhttp use WinHTTP-based wxWebRequest + --with-urlsession use NSURLSession-based wxWebRequest --with-macosx-sdk=PATH use macOS SDK at PATH --with-macosx-version-min=VER build binaries requiring at least this macOS version (default and lowest supported: 10.10) --with-cxx=11|14|17 use the given C++ dialect @@ -5350,6 +5350,35 @@ fi eval "$wx_cv_use_expat" + + withstring= + defaultval=$wxUSE_ALL_FEATURES + if test -z "$defaultval"; then + if test x"$withstring" = xwithout; then + defaultval=yes + else + defaultval=no + fi + fi + +# Check whether --with-libcurl was given. +if test "${with_libcurl+set}" = set; then : + withval=$with_libcurl; + if test "$withval" = yes; then + wx_cv_use_libcurl='wxUSE_LIBCURL=yes' + else + wx_cv_use_libcurl='wxUSE_LIBCURL=no' + fi + +else + + wx_cv_use_libcurl='wxUSE_LIBCURL=${'DEFAULT_wxUSE_LIBCURL":-$defaultval}" + +fi + + + eval "$wx_cv_use_libcurl" + if test "$USE_WIN32" = 1; then withstring= @@ -5380,6 +5409,37 @@ fi eval "$wx_cv_use_winhttp" +fi +if test "$USE_DARWIN" = 1; then + + withstring= + defaultval=$wxUSE_ALL_FEATURES + if test -z "$defaultval"; then + if test x"$withstring" = xwithout; then + defaultval=yes + else + defaultval=no + fi + fi + +# Check whether --with-urlsession was given. +if test "${with_urlsession+set}" = set; then : + withval=$with_urlsession; + if test "$withval" = yes; then + wx_cv_use_urlsession='wxUSE_URLSESSION=yes' + else + wx_cv_use_urlsession='wxUSE_URLSESSION=no' + fi + +else + + wx_cv_use_urlsession='wxUSE_URLSESSION=${'DEFAULT_wxUSE_URLSESSION":-$defaultval}" + +fi + + + eval "$wx_cv_use_urlsession" + fi if test "$USE_DARWIN" = 1; then @@ -6744,65 +6804,6 @@ fi eval "$wx_cv_use_webrequest" - enablestring= - defaultval=$wxUSE_ALL_FEATURES - if test -z "$defaultval"; then - if test x"$enablestring" = xdisable; then - defaultval=yes - else - defaultval=no - fi - fi - - # Check whether --enable-webrequestcurl was given. -if test "${enable_webrequestcurl+set}" = set; then : - enableval=$enable_webrequestcurl; - if test "$enableval" = yes; then - wx_cv_use_webrequestcurl='wxUSE_WEBREQUEST_LIBCURL=yes' - else - wx_cv_use_webrequestcurl='wxUSE_WEBREQUEST_LIBCURL=no' - fi - -else - - wx_cv_use_webrequestcurl='wxUSE_WEBREQUEST_LIBCURL=${'DEFAULT_wxUSE_WEBREQUEST_LIBCURL":-$defaultval}" - -fi - - - eval "$wx_cv_use_webrequestcurl" - -if test "$USE_DARWIN" = 1; then - - enablestring= - defaultval=$wxUSE_ALL_FEATURES - if test -z "$defaultval"; then - if test x"$enablestring" = xdisable; then - defaultval=yes - else - defaultval=no - fi - fi - - # Check whether --enable-webrequesturlsession was given. -if test "${enable_webrequesturlsession+set}" = set; then : - enableval=$enable_webrequesturlsession; - if test "$enableval" = yes; then - wx_cv_use_webrequesturlsession='wxUSE_WEBREQUEST_URLSESSION=yes' - else - wx_cv_use_webrequesturlsession='wxUSE_WEBREQUEST_URLSESSION=no' - fi - -else - - wx_cv_use_webrequesturlsession='wxUSE_WEBREQUEST_URLSESSION=${'DEFAULT_wxUSE_WEBREQUEST_URLSESSION":-$defaultval}" - -fi - - - eval "$wx_cv_use_webrequesturlsession" - -fi enablestring= defaultval=$wxUSE_ALL_FEATURES @@ -23003,7 +23004,7 @@ if test "$wxUSE_LIBMSPACK" != "no"; then fi -if test "$wxUSE_WEBREQUEST_LIBCURL" != "no"; then +if test "$wxUSE_LIBCURL" != "no"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCURL" >&5 @@ -23064,14 +23065,14 @@ fi echo "$LIBCURL_PKG_ERRORS" >&5 - wxUSE_WEBREQUEST_LIBCURL=no + wxUSE_LIBCURL=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } elif test $pkg_failed = untried; then - wxUSE_WEBREQUEST_LIBCURL=no + wxUSE_LIBCURL=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } @@ -23089,7 +23090,7 @@ $as_echo "yes" >&6; } fi - if test "$wxUSE_WEBREQUEST_LIBCURL" = "no"; then + if test "$wxUSE_LIBCURL" = "no"; then if test "$USE_WIN32" != 1 -a "$USE_DARWIN" != 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl not found, wxWebRequest won't be available" >&5 $as_echo "$as_me: WARNING: libcurl not found, wxWebRequest won't be available" >&2;} @@ -36118,7 +36119,12 @@ if test "$wxUSE_WEBREQUEST" = "yes"; then $as_echo "#define wxUSE_WEBREQUEST 1" >>confdefs.h - if test "$wxUSE_WEBREQUEST_URLSESSION" = "yes"; then + if test "$wxUSE_LIBCURL" = "yes"; then + $as_echo "#define wxUSE_WEBREQUEST_CURL 1" >>confdefs.h + + fi + + if test "$wxUSE_URLSESSION" = "yes"; then $as_echo "#define wxUSE_WEBREQUEST_URLSESSION 1" >>confdefs.h fi diff --git a/configure.in b/configure.in index 608c413d5b..c898b2e283 100644 --- a/configure.in +++ b/configure.in @@ -576,9 +576,13 @@ WX_ARG_WITH(liblzma, [ --with-liblzma use LZMA compression)], wx WX_ARG_SYS_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB) WX_ARG_SYS_WITH(expat, [ --with-expat enable XML support using expat parser], wxUSE_EXPAT) +WX_ARG_WITH(libcurl, [ --with-libcurl use libcurl-based wxWebRequest], wxUSE_LIBCURL) if test "$USE_WIN32" = 1; then WX_ARG_WITH(winhttp, [ --with-winhttp use WinHTTP-based wxWebRequest], wxUSE_WINHTTP) fi +if test "$USE_DARWIN" = 1; then +WX_ARG_WITH(urlsession, [ --with-urlsession use NSURLSession-based wxWebRequest], wxUSE_URLSESSION) +fi if test "$USE_DARWIN" = 1; then @@ -721,10 +725,6 @@ WX_ARG_FEATURE(ipv6, [ --enable-ipv6 enable IPv6 support in WX_ARG_FEATURE(ole, [ --enable-ole use OLE classes (Win32 only)], wxUSE_OLE) WX_ARG_FEATURE(dataobj, [ --enable-dataobj use data object classes], wxUSE_DATAOBJ) WX_ARG_FEATURE(webrequest, [ --enable-webrequest use wxWebRequest], wxUSE_WEBREQUEST) -WX_ARG_FEATURE(webrequestcurl, [ --enable-webrequest-curl use libcurl with wxWebRequest], wxUSE_WEBREQUEST_LIBCURL) -if test "$USE_DARWIN" = 1; then -WX_ARG_FEATURE(webrequesturlsession, [ --enable-webrequest-urlsession use NSURLSession with wxWebRequest], wxUSE_WEBREQUEST_URLSESSION) -fi dnl USE_DARWIN WX_ARG_FEATURE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC) @@ -2928,7 +2928,7 @@ dnl ------------------------------------------------------------------------ dnl Check for libcurl dnl ------------------------------------------------------------------------ -if test "$wxUSE_WEBREQUEST_LIBCURL" != "no"; then +if test "$wxUSE_LIBCURL" != "no"; then PKG_CHECK_MODULES(LIBCURL, [libcurl], [ CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS" @@ -2936,12 +2936,12 @@ if test "$wxUSE_WEBREQUEST_LIBCURL" != "no"; then AC_DEFINE(wxUSE_WEBREQUEST_LIBCURL) ], [ - wxUSE_WEBREQUEST_LIBCURL=no + wxUSE_LIBCURL=no AC_MSG_RESULT([not found]) ] ) - if test "$wxUSE_WEBREQUEST_LIBCURL" = "no"; then + if test "$wxUSE_LIBCURL" = "no"; then dnl Under these platforms we have other, always available, backends for dnl wxWebRequest, but under the others (i.e. generic Unix) libcurl is dnl the only way to implement wxWebRequest. @@ -6595,7 +6595,11 @@ fi if test "$wxUSE_WEBREQUEST" = "yes"; then AC_DEFINE(wxUSE_WEBREQUEST) - if test "$wxUSE_WEBREQUEST_URLSESSION" = "yes"; then + if test "$wxUSE_LIBCURL" = "yes"; then + AC_DEFINE(wxUSE_WEBREQUEST_CURL) + fi + + if test "$wxUSE_URLSESSION" = "yes"; then AC_DEFINE(wxUSE_WEBREQUEST_URLSESSION) fi diff --git a/docs/gtk/install.md b/docs/gtk/install.md index 0955cab5a5..6876dd7036 100644 --- a/docs/gtk/install.md +++ b/docs/gtk/install.md @@ -148,6 +148,9 @@ minimize external dependencies. --without-liblzma Disable LZMA compression support. Don't use liblzma. + --without-libcurl Don't use libcurl even if it's available. + Disables wxWebRequest. + --without-opengl Disable OpenGL integration with wxGLCanvas. Don't use OpenGL or EGL libraries. From b48c72ed22de1988892982d4c089a7cd6ac6fed0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:08:20 +0100 Subject: [PATCH 070/218] Document wxUSE_CREDENTIALDLG in the options list too Just add the new option to the manual. --- docs/doxygen/mainpages/const_wxusedef.h | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/doxygen/mainpages/const_wxusedef.h b/docs/doxygen/mainpages/const_wxusedef.h index b663751922..b1ce1bd077 100644 --- a/docs/doxygen/mainpages/const_wxusedef.h +++ b/docs/doxygen/mainpages/const_wxusedef.h @@ -90,6 +90,7 @@ library: @itemdef{wxUSE_CONSOLE_EVENTLOOP, Enable event loop in console programs.} @itemdef{wxUSE_CONSTRAINTS, Use wxLayoutConstraints} @itemdef{wxUSE_CONTROLS, If set to 0, no classes deriving from wxControl can be used.} +@itemdef{wxUSE_CREDENTIALDLG, If set to 0, disabled wxCredentialEntryDialog used by wxWebRequest.} @itemdef{wxUSE_DATAOBJ, Use wxDataObject and related classes.} @itemdef{wxUSE_DATAVIEWCTRL, Use wxDataViewCtrl class.} @itemdef{wxUSE_DATEPICKCTRL, Use wxDatePickerCtrl class.} From 2ddf8705afd705556e33412bcfaad4a0531d0ae2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:09:22 +0100 Subject: [PATCH 071/218] Make wxGenericCredentialEntryDialog non-copyable No real changes, just a bit of extra safety. --- include/wx/generic/creddlgg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/wx/generic/creddlgg.h b/include/wx/generic/creddlgg.h index 64c4e97199..d2f58d6a1b 100644 --- a/include/wx/generic/creddlgg.h +++ b/include/wx/generic/creddlgg.h @@ -45,6 +45,8 @@ private: void Init(const wxString& message, const wxString& user, const wxString& password); + + wxDECLARE_NO_COPY_CLASS(wxGenericCredentialEntryDialog); }; // Add this typedef as long as the generic version is the only one available From 5c3db1574e16da0e386336d6cc4f0bcf3de84d67 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:10:28 +0100 Subject: [PATCH 072/218] Fix typo and slightly improve wxUSE_WEBREQUEST_CURL comment --- include/wx/android/setup.h | 8 +++++--- include/wx/gtk/setup0.h | 8 +++++--- include/wx/motif/setup0.h | 8 +++++--- include/wx/msw/setup0.h | 8 +++++--- include/wx/osx/setup0.h | 15 ++++++++++++--- include/wx/setup_inc.h | 5 +++-- include/wx/univ/setup0.h | 8 +++++--- 7 files changed, 40 insertions(+), 20 deletions(-) diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index be40c0ad30..0443cf7f9e 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -658,11 +658,12 @@ #define wxUSE_WEBREQUEST_URLSESSION 0 #endif -// wxWebRequest backend based on NSURLSession +// wxWebRequest backend based on libcurl, can be used under all platforms. // // Default is 1 // -// Recommended setting: 0 on Windows and macOS otherwise 1 +// Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required +// for wxWebRequest to be available at all. #if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 #else @@ -1437,7 +1438,8 @@ #define wxUSE_GLCANVAS 1 // Setting wxUSE_GLCANVAS_EGL to 1 enables OpenGL EGL backend. This will be -// automatically enabled if EGL support is detected. +// automatically enabled if EGL support is detected. EGL support is only +// available under Unix platforms. // // Default is 0. // diff --git a/include/wx/gtk/setup0.h b/include/wx/gtk/setup0.h index 5731813bec..d22b87749a 100644 --- a/include/wx/gtk/setup0.h +++ b/include/wx/gtk/setup0.h @@ -659,11 +659,12 @@ #define wxUSE_WEBREQUEST_URLSESSION 0 #endif -// wxWebRequest backend based on NSURLSession +// wxWebRequest backend based on libcurl, can be used under all platforms. // // Default is 1 // -// Recommended setting: 0 on Windows and macOS otherwise 1 +// Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required +// for wxWebRequest to be available at all. #if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 #else @@ -1438,7 +1439,8 @@ #define wxUSE_GLCANVAS 1 // Setting wxUSE_GLCANVAS_EGL to 1 enables OpenGL EGL backend. This will be -// automatically enabled if EGL support is detected. +// automatically enabled if EGL support is detected. EGL support is only +// available under Unix platforms. // // Default is 0. // diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index 4bbd0fb723..f88c0fefb7 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -659,11 +659,12 @@ #define wxUSE_WEBREQUEST_URLSESSION 0 #endif -// wxWebRequest backend based on NSURLSession +// wxWebRequest backend based on libcurl, can be used under all platforms. // // Default is 1 // -// Recommended setting: 0 on Windows and macOS otherwise 1 +// Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required +// for wxWebRequest to be available at all. #if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 #else @@ -1438,7 +1439,8 @@ #define wxUSE_GLCANVAS 1 // Setting wxUSE_GLCANVAS_EGL to 1 enables OpenGL EGL backend. This will be -// automatically enabled if EGL support is detected. +// automatically enabled if EGL support is detected. EGL support is only +// available under Unix platforms. // // Default is 0. // diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 104e122964..ed9a9e5072 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -659,11 +659,12 @@ #define wxUSE_WEBREQUEST_URLSESSION 0 #endif -// wxWebRequest backend based on NSURLSession +// wxWebRequest backend based on libcurl, can be used under all platforms. // // Default is 1 // -// Recommended setting: 0 on Windows and macOS otherwise 1 +// Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required +// for wxWebRequest to be available at all. #if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 #else @@ -1438,7 +1439,8 @@ #define wxUSE_GLCANVAS 1 // Setting wxUSE_GLCANVAS_EGL to 1 enables OpenGL EGL backend. This will be -// automatically enabled if EGL support is detected. +// automatically enabled if EGL support is detected. EGL support is only +// available under Unix platforms. // // Default is 0. // diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index 27dda7f942..ead9701e87 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -665,11 +665,12 @@ #define wxUSE_WEBREQUEST_URLSESSION 0 #endif -// wxWebRequest backend based on NSURLSession +// wxWebRequest backend based on libcurl, can be used under all platforms. // // Default is 1 // -// Recommended setting: 0 on Windows and macOS otherwise 1 +// Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required +// for wxWebRequest to be available at all. #if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 #else @@ -1444,7 +1445,8 @@ #define wxUSE_GLCANVAS 1 // Setting wxUSE_GLCANVAS_EGL to 1 enables OpenGL EGL backend. This will be -// automatically enabled if EGL support is detected. +// automatically enabled if EGL support is detected. EGL support is only +// available under Unix platforms. // // Default is 0. // @@ -1685,6 +1687,13 @@ // make sure we have the proper dispatcher for the console event loop #define wxUSE_SELECT_DISPATCHER 1 #define wxUSE_EPOLL_DISPATCHER 0 + +// set to 1 if you have older code that still needs icon refs +#define wxOSX_USE_ICONREF 0 + +// set to 0 if you have code that has problems with the new bitmap implementation +#define wxOSX_BITMAP_NATIVE_ACCESS 1 + /* --- end OSX options --- */ #endif diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index e847a0c8cb..1eb66bcaa6 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -655,11 +655,12 @@ #define wxUSE_WEBREQUEST_URLSESSION 0 #endif -// wxWebRequest backend based on NSURLSession +// wxWebRequest backend based on libcurl, can be used under all platforms. // // Default is 1 // -// Recommended setting: 0 on Windows and macOS otherwise 1 +// Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required +// for wxWebRequest to be available at all. #if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 #else diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index fdf8e562fe..9c057c2977 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -658,11 +658,12 @@ #define wxUSE_WEBREQUEST_URLSESSION 0 #endif -// wxWebRequest backend based on NSURLSession +// wxWebRequest backend based on libcurl, can be used under all platforms. // // Default is 1 // -// Recommended setting: 0 on Windows and macOS otherwise 1 +// Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required +// for wxWebRequest to be available at all. #if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 #else @@ -1437,7 +1438,8 @@ #define wxUSE_GLCANVAS 1 // Setting wxUSE_GLCANVAS_EGL to 1 enables OpenGL EGL backend. This will be -// automatically enabled if EGL support is detected. +// automatically enabled if EGL support is detected. EGL support is only +// available under Unix platforms. // // Default is 0. // From 92dfef908385849d419c33ddb917285d5dbbd5f4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:11:42 +0100 Subject: [PATCH 073/218] Use HorzBorder() in wxGenericCredentialEntryDialog code No real changes, just a tiny simplification. --- src/generic/creddlgg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/creddlgg.cpp b/src/generic/creddlgg.cpp index 5415de6c3c..0394234d26 100644 --- a/src/generic/creddlgg.cpp +++ b/src/generic/creddlgg.cpp @@ -58,12 +58,12 @@ void wxGenericCredentialEntryDialog::Init(const wxString& message, topsizer->Add(CreateTextSizer(message), wxSizerFlags().Border()); topsizer->Add(new wxStaticText(this, wxID_ANY, _("Username:")), - wxSizerFlags().Border(wxLEFT | wxRIGHT)); + wxSizerFlags().HorzBorder()); m_userTextCtrl = new wxTextCtrl(this, wxID_ANY, user, wxDefaultPosition, wxSize(FromDIP(300), wxDefaultCoord)); topsizer->Add(m_userTextCtrl, wxSizerFlags().Expand().Border()); topsizer->Add(new wxStaticText(this, wxID_ANY, _("Password:")), - wxSizerFlags().Border(wxLEFT | wxRIGHT)); + wxSizerFlags().HorzBorder()); m_passwordTextCtrl = new wxTextCtrl(this, wxID_ANY, password, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD); topsizer->Add(m_passwordTextCtrl, wxSizerFlags().Expand().Border()); From e3382b6e932e9425560573abd6e5a0b341937134 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:18:27 +0100 Subject: [PATCH 074/218] Minor improvements to wxCredentialEntryDialog documentation Add Create() description and, more importantly, explain why could SetXXX() be useful. --- interface/wx/creddlg.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/interface/wx/creddlg.h b/interface/wx/creddlg.h index 9264fbda54..336caf9f2a 100644 --- a/interface/wx/creddlg.h +++ b/interface/wx/creddlg.h @@ -45,6 +45,8 @@ public: const wxString& password = ""); /** + Create the dialog constructed using the default constructor. + @param parent Parent window. @param message @@ -68,6 +70,10 @@ public: /** Sets the current user name. + + This function may be called before showing the dialog to provide the + default value for the user name, if it's different from the one given + at the creation time. */ void SetUser(const wxString& user); @@ -78,6 +84,9 @@ public: /** Sets the current password. + + This function may be called before showing the dialog for the reasons + similar to SetUser(). */ void SetPassword(const wxString& password); }; From 727b5908143c79df662ff8ce9e4a55093575f7b4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:19:03 +0100 Subject: [PATCH 075/218] Pass wxSharedPtr argument of RegisterFactory() by const reference Avoid extra copies from passing it by value. --- include/wx/webrequest.h | 3 ++- interface/wx/webrequest.h | 3 ++- src/common/webrequest.cpp | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 1cf1604e00..f1db691915 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -241,7 +241,8 @@ public: static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); - static void RegisterFactory(const wxString& backend, wxSharedPtr factory); + static void RegisterFactory(const wxString& backend, + const wxSharedPtr& factory); static bool IsBackendAvailable(const wxString& backend); diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 841c95bab7..94de7fad1f 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -544,7 +544,8 @@ public: @param backend The name for the new backend to be registered under @param factory A shared pointer to the factory which creates the appropriate backend. */ - static void RegisterFactory(const wxString& backend, wxSharedPtr factory); + static void RegisterFactory(const wxString& backend, + const wxSharedPtr& factory); /** Allows to check if the specified backend is available at runtime. diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index e4bb3d6171..165c29cf39 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -431,7 +431,9 @@ wxWebSession* wxWebSession::New(const wxString& backend) } // static -void wxWebSession::RegisterFactory(const wxString& backend, wxSharedPtr factory) +void +wxWebSession::RegisterFactory(const wxString& backend, + const wxSharedPtr& factory) { ms_factoryMap[backend] = factory; } From f02f8cc8a137d439847c3c193df431dc18d9d9a5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:27:58 +0100 Subject: [PATCH 076/218] Remove unnecessary use of "explicit" It's not used anywhere else with constructors taking more than one (non-optional) argument and is not really useful with them (and not useful at all until C++17), so don't use it here neither for consistency. No real changes. --- include/wx/msw/webrequest_winhttp.h | 2 +- include/wx/webrequest_curl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index 22607becd7..11161be5b9 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -46,7 +46,7 @@ private: class WXDLLIMPEXP_NET wxWebAuthChallengeWinHTTP : public wxWebAuthChallenge { public: - explicit wxWebAuthChallengeWinHTTP(Source source, wxWebRequestWinHTTP& request); + wxWebAuthChallengeWinHTTP(Source source, wxWebRequestWinHTTP& request); bool Init(); diff --git a/include/wx/webrequest_curl.h b/include/wx/webrequest_curl.h index 6d364241ff..76cc0f56b8 100644 --- a/include/wx/webrequest_curl.h +++ b/include/wx/webrequest_curl.h @@ -23,7 +23,7 @@ class wxWebRequestCURL; class WXDLLIMPEXP_NET wxWebAuthChallengeCURL : public wxWebAuthChallenge { public: - explicit wxWebAuthChallengeCURL(Source source, wxWebRequestCURL& request); + wxWebAuthChallengeCURL(Source source, wxWebRequestCURL& request); bool Init(); From 700d6ddea6c8106f3fa9a55d7296d8f80d967184 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:27:09 +0100 Subject: [PATCH 077/218] Minor code formatting changes No real changes at all, just improve layout, consistency etc. --- include/wx/msw/webrequest_winhttp.h | 4 +-- include/wx/osx/webrequest_urlsession.h | 8 ++--- include/wx/webrequest_curl.h | 6 ++-- src/common/webrequest.cpp | 48 +++++++++++++++++--------- src/common/webrequest_curl.cpp | 2 +- src/msw/webrequest_winhttp.cpp | 9 +++-- src/osx/webrequest_urlsession.mm | 6 ++-- 7 files changed, 51 insertions(+), 32 deletions(-) diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/webrequest_winhttp.h index 11161be5b9..7dd322eb3f 100644 --- a/include/wx/msw/webrequest_winhttp.h +++ b/include/wx/msw/webrequest_winhttp.h @@ -106,7 +106,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebRequestWinHTTP); }; -class WXDLLIMPEXP_NET wxWebSessionWinHTTP: public wxWebSession +class WXDLLIMPEXP_NET wxWebSessionWinHTTP : public wxWebSession { public: wxWebSessionWinHTTP(); @@ -128,7 +128,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebSessionWinHTTP); }; -class WXDLLIMPEXP_NET wxWebSessionFactoryWinHTTP: public wxWebSessionFactory +class WXDLLIMPEXP_NET wxWebSessionFactoryWinHTTP : public wxWebSessionFactory { public: wxWebSession* Create() wxOVERRIDE diff --git a/include/wx/osx/webrequest_urlsession.h b/include/wx/osx/webrequest_urlsession.h index 3e4646907e..1e284885c1 100644 --- a/include/wx/osx/webrequest_urlsession.h +++ b/include/wx/osx/webrequest_urlsession.h @@ -19,7 +19,7 @@ DECLARE_WXCOCOA_OBJC_CLASS(wxWebSessionDelegte); class wxWebSessionURLSession; class wxWebResponseURLSession; -class WXDLLIMPEXP_NET wxWebResponseURLSession: public wxWebResponse +class WXDLLIMPEXP_NET wxWebResponseURLSession : public wxWebResponse { public: wxWebResponseURLSession(wxWebRequest& request, WX_NSURLSessionTask task); @@ -44,7 +44,7 @@ private: WX_NSURLSessionTask m_task; }; -class WXDLLIMPEXP_NET wxWebRequestURLSession: public wxWebRequest +class WXDLLIMPEXP_NET wxWebRequestURLSession : public wxWebRequest { public: wxWebRequestURLSession(wxWebSessionURLSession& session, const wxString& url, int id); @@ -78,7 +78,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebRequestURLSession); }; -class WXDLLIMPEXP_NET wxWebSessionURLSession: public wxWebSession +class WXDLLIMPEXP_NET wxWebSessionURLSession : public wxWebSession { public: wxWebSessionURLSession(); @@ -100,7 +100,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebSessionURLSession); }; -class WXDLLIMPEXP_NET wxWebSessionFactoryURLSession: public wxWebSessionFactory +class WXDLLIMPEXP_NET wxWebSessionFactoryURLSession : public wxWebSessionFactory { public: wxWebSession* Create() wxOVERRIDE diff --git a/include/wx/webrequest_curl.h b/include/wx/webrequest_curl.h index 76cc0f56b8..2033b65d10 100644 --- a/include/wx/webrequest_curl.h +++ b/include/wx/webrequest_curl.h @@ -35,7 +35,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebAuthChallengeCURL); }; -class WXDLLIMPEXP_NET wxWebRequestCURL: public wxWebRequest +class WXDLLIMPEXP_NET wxWebRequestCURL : public wxWebRequest { public: wxWebRequestCURL(wxWebSession& session, int id, const wxString& url); @@ -107,7 +107,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebResponseCURL); }; -class WXDLLIMPEXP_NET wxWebSessionCURL: public wxWebSession, private wxThreadHelper +class WXDLLIMPEXP_NET wxWebSessionCURL : public wxWebSession, private wxThreadHelper { public: wxWebSessionCURL(); @@ -144,7 +144,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebSessionCURL); }; -class WXDLLIMPEXP_NET wxWebSessionFactoryCURL: public wxWebSessionFactory +class WXDLLIMPEXP_NET wxWebSessionFactoryCURL : public wxWebSessionFactory { public: wxWebSession* Create() wxOVERRIDE diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 165c29cf39..943146671b 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -151,10 +151,13 @@ void wxWebRequest::SplitParameters(const wxString& s, wxString& value, parameters.clear(); wxString::const_iterator it = s.begin(); wxString::const_iterator end = s.end(); - while ( it != end && wxIsspace(*it) ) ++it; - while ( it != end && *it != ';' ) value += *it++; + while ( it != end && wxIsspace(*it) ) + ++it; + while ( it != end && *it != ';' ) + value += *it++; value.Trim(); - if ( it != end ) ++it; + if ( it != end ) + ++it; SplitParameters(it, end, parameters); } @@ -170,11 +173,15 @@ void wxWebRequest::SplitParameters(const wxString::const_iterator& begin, { pname.clear(); pvalue.clear(); - while ( it != end && wxIsspace(*it) ) ++it; - while ( it != end && *it != '=' && *it != ';' ) pname += *it++; + while ( it != end && wxIsspace(*it) ) + ++it; + while ( it != end && *it != '=' && *it != ';' ) + pname += *it++; pname.Trim(); - if ( it != end && *it != ';' ) ++it; - while ( it != end && wxIsspace(*it) ) ++it; + if ( it != end && *it != ';' ) + ++it; + while ( it != end && wxIsspace(*it) ) + ++it; while ( it != end && *it != ';' ) { if ( *it == '"' ) @@ -185,28 +192,35 @@ void wxWebRequest::SplitParameters(const wxString::const_iterator& begin, if ( *it == '\\' ) { ++it; - if ( it != end ) pvalue += *it++; + if ( it != end ) + pvalue += *it++; } - else pvalue += *it++; + else + pvalue += *it++; } - if ( it != end ) ++it; + if ( it != end ) + ++it; } else if ( *it == '\\' ) { ++it; - if ( it != end ) pvalue += *it++; + if ( it != end ) + pvalue += *it++; } - else pvalue += *it++; + else + pvalue += *it++; } pvalue.Trim(); - if ( !pname.empty() ) parameters[pname] = pvalue; - if ( it != end ) ++it; + if ( !pname.empty() ) + parameters[pname] = pvalue; + if ( it != end ) + ++it; } } void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) { - if (!IsActiveState(state) && GetResponse()) + if ( !IsActiveState(state) && GetResponse() ) GetResponse()->Finalize(); wxString responseFileName; @@ -248,7 +262,7 @@ wxWebResponse::~wxWebResponse() bool wxWebResponse::Init() { - if (m_request.GetStorage() == wxWebRequest::Storage_File) + if ( m_request.GetStorage() == wxWebRequest::Storage_File ) { wxFileName tmpPrefix; tmpPrefix.AssignDir(m_request.GetSession().GetTempDir()); @@ -357,7 +371,9 @@ void wxWebResponse::ReportDataReceived(size_t sizeReceived) m_request.ReportDataReceived(sizeReceived); if ( m_request.GetStorage() == wxWebRequest::Storage_File ) + { m_file.Write(m_readBuffer.GetData(), m_readBuffer.GetDataLen()); + } else if ( m_request.GetStorage() == wxWebRequest::Storage_None ) { wxWebRequestEvent evt(wxEVT_WEBREQUEST_DATA, m_request.GetId(), wxWebRequest::State_Active); diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 746e7455a5..b7280ffb20 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -254,7 +254,7 @@ void wxWebRequestCURL::Cancel() void wxWebRequestCURL::HandleCompletion() { - int status = (m_response) ? m_response->GetStatus() : 0; + int status = m_response ? m_response->GetStatus() : 0; if ( status == 0) SetState(State_Failed, GetError()); diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index aad68998bc..ce45266be0 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -31,7 +31,7 @@ // For MSVC we can link in the required library explicitly, for the other // compilers (e.g. MinGW) this needs to be done at makefiles level. #ifdef __VISUALC__ -#pragma comment(lib, "Winhttp") +#pragma comment(lib, "winhttp") #endif // Define constants potentially missing in old SDKs @@ -99,8 +99,11 @@ static wxString wxWinHTTPQueryHeaderString(HINTERNET hRequest, DWORD dwInfoLevel { wxWCharBuffer resBuf(bufferLen); if ( ::WinHttpQueryHeaders(hRequest, dwInfoLevel, pwszName, - resBuf.data(), &bufferLen, WINHTTP_NO_HEADER_INDEX) ) + resBuf.data(), &bufferLen, + WINHTTP_NO_HEADER_INDEX) ) + { result.assign(resBuf); + } } return result; @@ -257,7 +260,7 @@ void wxWebRequestWinHTTP::Start() int port; if ( !uri.HasPort() ) - port = (isSecure) ? 443 : 80; + port = isSecure ? 443 : 80; else port = wxAtoi(uri.GetPort()); diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index c80eac7568..38ec334e02 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: src/osx/webrequest_urlsession.h +// Name: src/osx/webrequest_urlsession.mm // Purpose: wxWebRequest implementation using URLSession // Author: Tobias Taschner // Created: 2018-10-25 @@ -109,7 +109,7 @@ void wxWebRequestURLSession::Start() NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL: [NSURL URLWithString:wxCFStringRef(m_url).AsNSString()]]; if (m_method.empty()) - req.HTTPMethod = (m_dataSize) ? @"POST" : @"GET"; + req.HTTPMethod = m_dataSize ? @"POST" : @"GET"; else req.HTTPMethod = wxCFStringRef(m_method).AsNSString(); @@ -126,7 +126,7 @@ void wxWebRequestURLSession::Start() wxMemoryBuffer memBuf; m_dataStream->Read(memBuf.GetWriteBuf(m_dataSize), m_dataSize); - // Create NSDAta from memory buffer + // Create NSData from memory buffer NSData* data = [NSData dataWithBytes:memBuf.GetData() length:m_dataSize]; m_task = [[session.GetSession() uploadTaskWithRequest:req fromData:data] retain]; } From 0d8616881d903a66edc8a992b40ce319a629252f Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 13 Dec 2020 00:39:07 +0100 Subject: [PATCH 078/218] Fix over-releasing NSStrings obtained from native API Use wxCFStringRefFromGet() instead of just using plain wxCFStringRef ctor as the latter takes ownership of the object. --- src/osx/webrequest_urlsession.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 38ec334e02..96e5e59045 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -77,7 +77,7 @@ { wxWebRequestURLSession* request = [self requestForTask:task]; if (error) - request->SetState(wxWebRequest::State_Failed, wxCFStringRef(error.localizedDescription).AsString()); + request->SetState(wxWebRequest::State_Failed, wxCFStringRefFromGet(error.localizedDescription).AsString()); else request->HandleCompletion(); @@ -212,7 +212,7 @@ wxInt64 wxWebResponseURLSession::GetContentLength() const wxString wxWebResponseURLSession::GetURL() const { - return wxCFStringRef(m_task.response.URL.absoluteString).AsString(); + return wxCFStringRefFromGet(m_task.response.URL.absoluteString).AsString(); } wxString wxWebResponseURLSession::GetHeader(const wxString& name) const @@ -220,7 +220,7 @@ wxString wxWebResponseURLSession::GetHeader(const wxString& name) const NSHTTPURLResponse* httpResp = (NSHTTPURLResponse*) m_task.response; NSString* value = [httpResp.allHeaderFields objectForKey:wxCFStringRef(name).AsNSString()]; if (value) - return wxCFStringRef(value).AsString(); + return wxCFStringRefFromGet(value).AsString(); else return wxString(); } @@ -233,12 +233,12 @@ int wxWebResponseURLSession::GetStatus() const wxString wxWebResponseURLSession::GetStatusText() const { - return wxCFStringRef([NSHTTPURLResponse localizedStringForStatusCode:GetStatus()]).AsString(); + return wxCFStringRefFromGet([NSHTTPURLResponse localizedStringForStatusCode:GetStatus()]).AsString(); } wxString wxWebResponseURLSession::GetSuggestedFileName() const { - return wxCFStringRef(m_task.response.suggestedFilename).AsString(); + return wxCFStringRefFromGet(m_task.response.suggestedFilename).AsString(); } // From 3a5f5006fbd8a5d208bd665a9bb905429a6844f6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:43:36 +0100 Subject: [PATCH 079/218] Fix typo in wxWebRequest documentation --- interface/wx/webrequest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 94de7fad1f..ac61675708 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -311,7 +311,7 @@ public: /// Returns the number of bytes sent to the server. wxFileOffset GetBytesSent() const; - /// Returns the number of bytes expected to be send to the server. + /// Returns the number of bytes expected to be sent to the server. wxFileOffset GetBytesExpectedToSend() const; /// Returns the number of bytes received from the server. From 0c9f4ababa93cdc04d56fc263dbfa5bbbafc7662 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:47:53 +0100 Subject: [PATCH 080/218] Document wxWebResponse pointers as being non-owning wxWebResponse objects belong to wxWebRequest itself. --- include/wx/webrequest.h | 2 +- interface/wx/webrequest.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index f1db691915..b1223d7ce4 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -291,7 +291,7 @@ public: private: wxWebRequest::State m_state; - wxWebResponse* m_response; + wxWebResponse* m_response; // non-owning, may be NULL wxString m_responseFileName; const void* m_data; size_t m_dataSize; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index ac61675708..5a65854b08 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -177,6 +177,9 @@ public: Before sending a request or after a failed request this will return @c NULL. + + Note that this pointer remains owned by wxWebRequest object and must + not be freed. */ wxWebResponse* GetResponse() const; From 204645a47cb6d9d39d0324a2d4c1c2cbb18881d2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:48:23 +0100 Subject: [PATCH 081/218] Initialize all fields in wxWebRequestEvent default ctor Default ctor was leaving pointers uninitialized which was dangerous, so merge it with the other ctor to ensure that we always set them to NULL. Also make m_response const as it can't be changed after creating the event. --- include/wx/webrequest.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index b1223d7ce4..65d371975c 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -262,9 +262,11 @@ private: class WXDLLIMPEXP_NET wxWebRequestEvent : public wxEvent { public: - wxWebRequestEvent() {} - wxWebRequestEvent(wxEventType type, int id, wxWebRequest::State state, - wxWebResponse* response = NULL, const wxString& errorDesc = "") + wxWebRequestEvent(wxEventType type = wxEVT_NULL, + int id = wxID_ANY, + wxWebRequest::State state = wxWebRequest::State_Idle, + wxWebResponse* response = NULL, + const wxString& errorDesc = wxString()) : wxEvent(id, type), m_state(state), m_response(response), m_data(NULL), m_dataSize(0), m_errorDescription(errorDesc) @@ -291,7 +293,7 @@ public: private: wxWebRequest::State m_state; - wxWebResponse* m_response; // non-owning, may be NULL + wxWebResponse* const m_response; // non-owning, may be NULL wxString m_responseFileName; const void* m_data; size_t m_dataSize; From 89946d1fc7d6ec78ffa4f40bd5a5f003d0976dcb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 00:50:03 +0100 Subject: [PATCH 082/218] Update version in @since comments for wxWebRequest to 3.1.5 Hopefully this is the last update. --- interface/wx/creddlg.h | 2 +- interface/wx/webrequest.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/interface/wx/creddlg.h b/interface/wx/creddlg.h index 336caf9f2a..37b2b59646 100644 --- a/interface/wx/creddlg.h +++ b/interface/wx/creddlg.h @@ -15,7 +15,7 @@ @note For secure saving and loading users and passwords, have a look at wxSecretStore. - @since 3.1.2 + @since 3.1.5 @library{wxcore} @category{cmndlg} diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 5a65854b08..777a5c4a77 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -103,7 +103,7 @@ A new block of data has been downloaded. @endEventTable - @since 3.1.3 + @since 3.1.5 @library{wxnet} @category{net} @@ -397,7 +397,7 @@ public: /** A wxWebResponse allows access to the response sent by the server. - @since 3.1.2 + @since 3.1.5 @library{wxnet} @category{net} @@ -472,7 +472,7 @@ public: cookies. Additionally, an underlying network connection might be kept alive to achieve faster additional responses. - @since 3.1.2 + @since 3.1.5 @library{wxnet} @category{net} @@ -566,7 +566,7 @@ public: Each implementation of wxWebSession should have its own factory. - @since 3.1.2 + @since 3.1.5 @library{wxnet} @category{net} @@ -587,7 +587,7 @@ public: A web request event sent during or after server communication. - @since 3.1.2 + @since 3.1.5 @library{wxnet} @category{net} From fd040b702d45323f540e0c877ddf4e3f03681914 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 01:07:55 +0100 Subject: [PATCH 083/218] Remove trailing spaces from webrequest sample No real changes. --- samples/webrequest/webrequest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 1e861d1ed1..4baf5abc62 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -336,7 +336,7 @@ public: { if ( !m_currentRequest || m_currentRequest->GetBytesExpectedToReceive() <= 0 ) return; - + m_downloadGauge->SetValue((m_currentRequest->GetBytesReceived() * 100) / m_currentRequest->GetBytesExpectedToReceive()); @@ -404,7 +404,7 @@ public: { if ( !wxApp::OnInit() ) return false; - + wxInitAllImageHandlers(); // create the main application window From 1c61fe6bafb4153f9f4fc662d80d9d95f71287d6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 01:11:47 +0100 Subject: [PATCH 084/218] Remove wxWebResponse::AsString() conversion parameter It doesn't make much sense to specify the conversion here, it would ideally be taken from the response Content-Type header itself and currently is just assumed to be UTF-8 anyhow. Also implement fallback to Latin-1 to avoid losing the data entirely if it's not in UTF-8. --- include/wx/webrequest.h | 2 +- interface/wx/webrequest.h | 6 ++---- src/common/webrequest.cpp | 9 +++------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 65d371975c..c7a430f2c2 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -152,7 +152,7 @@ public: virtual wxString GetSuggestedFileName() const; - wxString AsString(wxMBConv* conv = NULL) const; + wxString AsString() const; bool Init(); diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 777a5c4a77..8cf37b8b02 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -450,11 +450,9 @@ public: /** Returns all response data as a string. - @param conv wxMBConv used to convert the response to a string. - If @c NULL, the conversion will be determined by - response headers. The default is UTF-8. + This is mostly useful for debugging or diagnostics. */ - wxString AsString(wxMBConv* conv = NULL) const; + wxString AsString() const; }; /** diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 943146671b..564ea457a5 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -345,16 +345,13 @@ wxString wxWebResponse::GetSuggestedFileName() const return suggestedFilename; } -wxString wxWebResponse::AsString(wxMBConv * conv) const +wxString wxWebResponse::AsString() const { - // TODO: try to determine encoding type from content-type header - if ( !conv ) - conv = &wxConvUTF8; - if ( m_request.GetStorage() == wxWebRequest::Storage_Memory ) { + // TODO: try to determine encoding type from content-type header size_t outLen = 0; - return conv->cMB2WC((const char*)m_readBuffer.GetData(), m_readBuffer.GetDataLen(), &outLen); + return wxConvWhateverWorks.cMB2WC((const char*)m_readBuffer.GetData(), m_readBuffer.GetDataLen(), &outLen); } else return wxString(); From 8ea4f3868971dae9eb7c3dba8d6f689388738b8a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 01:33:01 +0100 Subject: [PATCH 085/218] Make wxWebResponse::Init() and Finalize() non-public The former can be called from the derived class ctors while the latter only needs to be called from wxWebRequest itself, so just make it a friend: this is not ideal, but still better than leaving this public and simpler than any alternatives. --- include/wx/webrequest.h | 13 +++++++++---- src/common/webrequest.cpp | 6 ++---- src/common/webrequest_curl.cpp | 3 ++- src/msw/webrequest_winhttp.cpp | 7 ++++++- src/osx/webrequest_urlsession.mm | 3 ++- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index c7a430f2c2..85fe58fb1f 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -154,10 +154,6 @@ public: wxString AsString() const; - bool Init(); - - void Finalize(); - virtual wxString GetFileName() const; protected: @@ -166,15 +162,24 @@ protected: wxWebResponse(wxWebRequest& request); + // Called from derived class ctor to finish initialization which can't be + // performed in ctor itself as it needs to use pure virtual method. + void Init(); + void* GetDataBuffer(size_t sizeNeeded); void ReportDataReceived(size_t sizeReceived); private: + // Called by wxWebRequest only. + void Finalize(); + wxMemoryBuffer m_readBuffer; mutable wxFFile m_file; mutable wxScopedPtr m_stream; + friend class wxWebRequest; + wxDECLARE_NO_COPY_CLASS(wxWebResponse); }; diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 564ea457a5..6f9641127c 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -260,7 +260,7 @@ wxWebResponse::~wxWebResponse() wxRemoveFile(m_file.GetName()); } -bool wxWebResponse::Init() +void wxWebResponse::Init() { if ( m_request.GetStorage() == wxWebRequest::Storage_File ) { @@ -274,15 +274,13 @@ bool wxWebResponse::Init() GetContentLength() > freeSpace ) { m_request.SetState(wxWebRequest::State_Failed, _("Not enough free disk space for download.")); - return false; + return; } } tmpPrefix.SetName("wxd"); wxFileName::CreateTempFileName(tmpPrefix.GetFullPath(), &m_file); } - - return true; } wxString wxWebResponse::GetMimeType() const diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index b7280ffb20..6c04d1eeee 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -63,6 +63,8 @@ wxWebResponseCURL::wxWebResponseCURL(wxWebRequest& request) : { curl_easy_setopt(GetHandle(), CURLOPT_WRITEDATA, static_cast(this)); curl_easy_setopt(GetHandle(), CURLOPT_HEADERDATA, static_cast(this)); + + Init(); } size_t wxWebResponseCURL::WriteData(void* buffer, size_t size) @@ -192,7 +194,6 @@ void wxWebRequestCURL::Start() return; m_response.reset(new wxWebResponseCURL(*this)); - m_response->Init(); if ( m_dataSize ) { diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index ce45266be0..ef8bfad462 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -220,8 +220,11 @@ void wxWebRequestWinHTTP::CreateResponse() if ( ::WinHttpReceiveResponse(m_request, NULL) ) { m_response.reset(new wxWebResponseWinHTTP(*this)); - if ( !m_response->Init() ) + // wxWebResponseWinHTTP ctor could have changed the state if its + // initialization failed, so check for this. + if ( GetState() == State_Failed ) return; + int status = m_response->GetStatus(); if ( status == 401 || status == 407) { @@ -364,6 +367,8 @@ wxWebResponseWinHTTP::wxWebResponseWinHTTP(wxWebRequestWinHTTP& request): if ( contentLengthStr.empty() || !contentLengthStr.ToLongLong(&m_contentLength) ) m_contentLength = -1; + + Init(); } wxString wxWebResponseWinHTTP::GetURL() const diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 96e5e59045..f0e0eb40ea 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -140,7 +140,6 @@ void wxWebRequestURLSession::Start() [session.GetDelegate() registerRequest:this task:m_task]; m_response.reset(new wxWebResponseURLSession(*this, m_task)); - m_response->Init(); SetState(State_Active); [m_task resume]; @@ -191,6 +190,8 @@ wxWebResponseURLSession::wxWebResponseURLSession(wxWebRequest& request, WX_NSURL wxWebResponse(request) { m_task = [task retain]; + + Init(); } wxWebResponseURLSession::~wxWebResponseURLSession() From fc633f5aae7af5b8553fc1d6f4b14257f9db4643 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 02:24:43 +0100 Subject: [PATCH 086/218] Move wxStringWebSessionFactoryMap out of the header Define wxWebSession::ms_defaultSession and ms_factoryMap in the implementation file to avoid having to make the otherwise unnecessary wxStringWebSessionFactoryMap type public. No real changes. --- include/wx/webrequest.h | 7 ------- src/common/webrequest.cpp | 39 +++++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 85fe58fb1f..d26707d556 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -215,8 +215,6 @@ public: virtual ~wxWebSessionFactory() { } }; -WX_DECLARE_STRING_HASH_MAP(wxSharedPtr, wxStringWebSessionFactoryMap); - extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[]; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[]; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendURLSession[]; @@ -242,8 +240,6 @@ public: static wxWebSession& GetDefault(); - static void DestroyDefault(); - static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); static void RegisterFactory(const wxString& backend, @@ -258,9 +254,6 @@ private: wxWebRequestHeaderMap m_headers; wxString m_tempDir; - static wxScopedPtr ms_defaultSession; - static wxStringWebSessionFactoryMap ms_factoryMap; - static void InitFactoryMap(); }; diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 6f9641127c..07b8946da0 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -395,8 +395,15 @@ void wxWebResponse::Finalize() // wxWebSession // -wxScopedPtr wxWebSession::ms_defaultSession; -wxStringWebSessionFactoryMap wxWebSession::ms_factoryMap; +WX_DECLARE_STRING_HASH_MAP(wxSharedPtr, wxStringWebSessionFactoryMap); + +namespace +{ + +wxScopedPtr gs_defaultSession; +wxStringWebSessionFactoryMap gs_factoryMap; + +} // anonymous namespace wxWebSession::wxWebSession() { @@ -417,25 +424,20 @@ wxString wxWebSession::GetTempDir() const // static wxWebSession& wxWebSession::GetDefault() { - if ( ms_defaultSession == NULL ) - ms_defaultSession.reset(wxWebSession::New()); + if ( gs_defaultSession == NULL ) + gs_defaultSession.reset(wxWebSession::New()); - return *ms_defaultSession; -} - -void wxWebSession::DestroyDefault() -{ - ms_defaultSession.reset(); + return *gs_defaultSession; } // static wxWebSession* wxWebSession::New(const wxString& backend) { - if ( ms_factoryMap.empty() ) + if ( gs_factoryMap.empty() ) InitFactoryMap(); - wxStringWebSessionFactoryMap::iterator factory = ms_factoryMap.find(backend); - if ( factory != ms_factoryMap.end() ) + wxStringWebSessionFactoryMap::iterator factory = gs_factoryMap.find(backend); + if ( factory != gs_factoryMap.end() ) return factory->second->Create(); else return NULL; @@ -446,7 +448,7 @@ void wxWebSession::RegisterFactory(const wxString& backend, const wxSharedPtr& factory) { - ms_factoryMap[backend] = factory; + gs_factoryMap[backend] = factory; } // static @@ -469,11 +471,11 @@ void wxWebSession::InitFactoryMap() // static bool wxWebSession::IsBackendAvailable(const wxString& backend) { - if ( ms_factoryMap.empty() ) + if ( gs_factoryMap.empty() ) InitFactoryMap(); - wxStringWebSessionFactoryMap::iterator factory = ms_factoryMap.find(backend); - return factory != ms_factoryMap.end(); + wxStringWebSessionFactoryMap::iterator factory = gs_factoryMap.find(backend); + return factory != gs_factoryMap.end(); } // ---------------------------------------------------------------------------- @@ -494,7 +496,8 @@ public: virtual void OnExit() wxOVERRIDE { - wxWebSession::DestroyDefault(); + gs_factoryMap.clear(); + gs_defaultSession.reset(); } private: From ea71cf398409df1aaffdca567e06a9968def9496 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 02:27:26 +0100 Subject: [PATCH 087/218] Include wx/hashmap.h from wx/webrequest.h explicitly This header was already implicitly included, but make it explicit. No real changes. --- include/wx/webrequest.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index d26707d556..8dae572afc 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -16,6 +16,7 @@ #include "wx/event.h" #include "wx/ffile.h" +#include "wx/hashmap.h" #include "wx/object.h" #include "wx/scopedptr.h" #include "wx/sharedptr.h" From be3eb334f6a0bd8d079430ce59e508eee3f0d102 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 02:39:23 +0100 Subject: [PATCH 088/218] Add file with wxWebRequest unit tests to MSVS project too This file is not generated and so needs to be updated manually. --- tests/test.vcxproj | 3 ++- tests/test.vcxproj.filters | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test.vcxproj b/tests/test.vcxproj index dad1177142..ab71189ad2 100644 --- a/tests/test.vcxproj +++ b/tests/test.vcxproj @@ -524,6 +524,7 @@ + @@ -570,4 +571,4 @@ - + \ No newline at end of file diff --git a/tests/test.vcxproj.filters b/tests/test.vcxproj.filters index 502e186b28..e285713fbf 100644 --- a/tests/test.vcxproj.filters +++ b/tests/test.vcxproj.filters @@ -265,5 +265,8 @@ Source Files + + Source Files + \ No newline at end of file From b37c7417f6ef5ac8ffa7d39ae34f18c6373351df Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 02:41:01 +0100 Subject: [PATCH 089/218] Don't make wxWebRequest::SplitParameters() public They're not necessary to use this class and we may consider exporting them later, possibly with a better API and more tests, if really needed. Also do change their API slightly by leaving only a single function and returning the value instead of using an out parameter for it to make it simpler to use. --- include/wx/webrequest.h | 6 ------ interface/wx/webrequest.h | 30 ------------------------------ src/common/webrequest.cpp | 26 ++++++++++++++------------ tests/net/webrequest.cpp | 8 +++++++- 4 files changed, 21 insertions(+), 49 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 8dae572afc..de45429126 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -93,12 +93,6 @@ public: void ReportDataReceived(size_t sizeReceived); - static void SplitParameters(const wxString& s, wxString& value, - wxWebRequestHeaderMap& parameters); - - static void SplitParameters(const wxString::const_iterator& begin, - const wxString::const_iterator& end, wxWebRequestHeaderMap& parameters); - protected: wxString m_method; Storage m_storage; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 8cf37b8b02..8172458560 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -328,36 +328,6 @@ public: */ wxFileOffset GetBytesExpectedToReceive() const; ///@} - - /** - Splits the given string into a value and a collection of parameters. - Parameters are expected to be separated by semicolons. - Enclosing quotes of parameter values are removed. - - For example, the string - @code - multipart/mixed; boundary="MIME_boundary_01234567" - @endcode - is split into the value - @code - multipart/mixed - @endcode - and the parameter - @code - boundary -> MIME_boundary_01234567 - @endcode - */ - static void SplitParameters(const wxString& s, wxString& value, - wxWebRequestHeaderMap& parameters); - - /** - Splits the given string into a collection of parameters. - Parameters are expected to be separated by semicolons. - - Enclosing quotes of parameter values are removed. - */ - static void SplitParameters(const wxString::const_iterator& begin, - const wxString::const_iterator& end, wxWebRequestHeaderMap& parameters); }; /** diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 07b8946da0..e46a9f3a07 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -144,11 +144,15 @@ void wxWebRequest::ReportDataReceived(size_t sizeReceived) // The SplitParamaters implementation is adapted to wxWidgets // from Poco::Net::MessageHeader::splitParameters -void wxWebRequest::SplitParameters(const wxString& s, wxString& value, - wxWebRequestHeaderMap& parameters) +// This function is used in a unit test, so define it inside wxPrivate +// namespace and an anonymous one. +namespace wxPrivate { - value.clear(); - parameters.clear(); + +WXDLLIMPEXP_NET wxString +SplitParameters(const wxString& s, wxWebRequestHeaderMap& parameters) +{ + wxString value; wxString::const_iterator it = s.begin(); wxString::const_iterator end = s.end(); while ( it != end && wxIsspace(*it) ) @@ -158,17 +162,12 @@ void wxWebRequest::SplitParameters(const wxString& s, wxString& value, value.Trim(); if ( it != end ) ++it; - SplitParameters(it, end, parameters); -} -void wxWebRequest::SplitParameters(const wxString::const_iterator& begin, - const wxString::const_iterator& end, wxWebRequestHeaderMap& parameters) -{ + parameters.clear(); wxString pname; wxString pvalue; pname.reserve(32); pvalue.reserve(64); - wxString::const_iterator it = begin; while ( it != end ) { pname.clear(); @@ -216,8 +215,12 @@ void wxWebRequest::SplitParameters(const wxString::const_iterator& begin, if ( it != end ) ++it; } + + return value; } +} // namespace wxPrivate + void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) { if ( !IsActiveState(state) && GetResponse() ) @@ -318,9 +321,8 @@ wxString wxWebResponse::GetSuggestedFileName() const // Try to determine from Content-Disposition header wxString contentDisp = GetHeader("Content-Disposition"); - wxString disp; wxWebRequestHeaderMap params; - wxWebRequest::SplitParameters(contentDisp, disp, params); + const wxString disp = wxPrivate::SplitParameters(contentDisp, params); if ( disp == "attachment" ) { // Parse as filename to filter potential path names diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 3482492d11..657e87cb04 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -203,6 +203,12 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][.]") } } +namespace wxPrivate +{ +WXDLLIMPEXP_NET wxString +SplitParameters(const wxString& s, wxWebRequestHeaderMap& parameters); +} + TEST_CASE("WebRequestUtils", "[net]") { wxString value; @@ -210,7 +216,7 @@ TEST_CASE("WebRequestUtils", "[net]") wxString header = "multipart/mixed; boundary=\"MIME_boundary_01234567\""; - wxWebRequest::SplitParameters(header, value, params); + value = wxPrivate::SplitParameters(header, params); REQUIRE( value == "multipart/mixed" ); REQUIRE( params.size() == 1 ); REQUIRE( params["boundary"] == "MIME_boundary_01234567" ); From 7b7f9fa6c0d158246665028f6d638da5d6646b3e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 02:49:06 +0100 Subject: [PATCH 090/218] Simplify header-parsing code in wxWebResponseCURL Use BeforeFirst() when we only need to find the first colon instead of wxSplit(). No real changes (except for pathological case when there is no colon at all, which wasn't handled correctly by the original code and still isn't, but in a slightly different way). --- src/common/webrequest_curl.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 6c04d1eeee..b62aa3241a 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -89,14 +89,10 @@ size_t wxWebResponseCURL::AddHeaderData(const char * buffer, size_t size) } else if ( !hdr.empty() ) { - wxArrayString hdrArr = wxSplit(hdr, ':'); - wxString hdrName; wxString hdrValue; - if ( hdrArr.size() > 0 ) - hdrName = hdrArr[0].Trim().MakeUpper(); - if ( hdrArr.size() > 1 ) - hdrValue = hdrArr[1].Trim(false); - m_headers[hdrName] = hdrValue; + wxString hdrName = hdr.BeforeFirst(':', &hdrValue).Strip(wxString::trailing); + hdrName.MakeUpper(); + m_headers[hdrName] = hdrValue.Strip(wxString::leading); } return size; From 59bc7e59d7fb1e069363b82a9eddf07881cd4650 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 03:09:55 +0100 Subject: [PATCH 091/218] Get rid of public wxWebSession::GetHeaders() This is unnecessary, it can be protected and we can initialize wxWebRequest::m_headers directly in its ctor instead of using this function (which also simplifies code and makes it impossible to forget to do this). --- include/wx/webrequest.h | 16 ++++++---------- src/common/webrequest.cpp | 12 ++++++++++++ src/common/webrequest_curl.cpp | 1 - src/msw/webrequest_winhttp.cpp | 1 - src/osx/webrequest_urlsession.mm | 1 - 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index de45429126..7cc8417bdc 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -100,14 +100,7 @@ protected: wxFileOffset m_dataSize; wxSharedPtr m_dataStream; - wxWebRequest(wxWebSession& session, int id): - m_storage(Storage_Memory), - m_dataSize(0), - m_session(session), - m_id(id), - m_state(State_Idle), - m_ignoreServerErrorStatus(false), - m_bytesReceived(0) { } + wxWebRequest(wxWebSession& session, int id); bool CheckServerStatus(); @@ -227,8 +220,6 @@ public: virtual void SetHeader(const wxString& name, const wxString& value) { m_headers[name] = value; } - const wxWebRequestHeaderMap& GetHeaders() const { return m_headers; } - void SetTempDir(const wxString& dir) { m_tempDir = dir; } wxString GetTempDir() const; @@ -245,7 +236,12 @@ public: protected: wxWebSession(); + const wxWebRequestHeaderMap& GetHeaders() const { return m_headers; } + private: + // Make it a friend to allow accessing our m_headers. + friend class wxWebRequest; + wxWebRequestHeaderMap m_headers; wxString m_tempDir; diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index e46a9f3a07..8df716811b 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -59,6 +59,18 @@ wxDEFINE_EVENT(wxEVT_WEBREQUEST_DATA, wxWebRequestEvent); // // wxWebRequest // +wxWebRequest::wxWebRequest(wxWebSession& session, int id) + : m_storage(Storage_Memory), + m_headers(session.m_headers), + m_dataSize(0), + m_session(session), + m_id(id), + m_state(State_Idle), + m_ignoreServerErrorStatus(false), + m_bytesReceived(0) +{ +} + bool wxWebRequest::CheckServerStatus() { const wxWebResponse* resp = GetResponse(); diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index b62aa3241a..c7e01c3e1c 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -149,7 +149,6 @@ static size_t wxCURLRead(char *buffer, size_t size, size_t nitems, void *userdat wxWebRequestCURL::wxWebRequestCURL(wxWebSession & session, int id, const wxString & url): wxWebRequest(session, id) { - m_headers = session.GetHeaders(); m_headerList = NULL; m_handle = curl_easy_init(); diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index ef8bfad462..71dd0f9864 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -152,7 +152,6 @@ wxWebRequestWinHTTP::wxWebRequestWinHTTP(int id, wxWebSessionWinHTTP& session, c m_request(NULL), m_dataWritten(0) { - m_headers = session.GetHeaders(); } wxWebRequestWinHTTP::~wxWebRequestWinHTTP() diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index f0e0eb40ea..7996b843e8 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -94,7 +94,6 @@ wxWebRequestURLSession::wxWebRequestURLSession(wxWebSessionURLSession& session, wxWebRequest(session, id), m_url(url) { - m_headers = session.GetHeaders(); } wxWebRequestURLSession::~wxWebRequestURLSession() From 0db857a460b56c6c98ca3b02d6f749bea8ab7e78 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 03:18:01 +0100 Subject: [PATCH 092/218] Disable libcurl test when building wxiOS It's not really useful in this case and somehow breaks Travis CI build. --- configure | 3 +++ configure.in | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/configure b/configure index a4a69b02a6..ec0f4072ff 100755 --- a/configure +++ b/configure @@ -23004,6 +23004,8 @@ if test "$wxUSE_LIBMSPACK" != "no"; then fi +if test "$wxUSE_OSX_IPHONE" != 1; then + if test "$wxUSE_LIBCURL" != "no"; then pkg_failed=no @@ -23099,6 +23101,7 @@ $as_echo "$as_me: WARNING: libcurl not found, wxWebRequest won't be available" > fi fi +fi TOOLKIT= TOOLKIT_INCLUDE= diff --git a/configure.in b/configure.in index c898b2e283..c8c37a34d7 100644 --- a/configure.in +++ b/configure.in @@ -2928,6 +2928,11 @@ dnl ------------------------------------------------------------------------ dnl Check for libcurl dnl ------------------------------------------------------------------------ +dnl Using libcurl on iOS doesn't make much sense and currently breaks the +dnl build, probably because it finds a wrong (native) libcurl.pc file, so just +dnl disable it for now. +if test "$wxUSE_OSX_IPHONE" != 1; then + if test "$wxUSE_LIBCURL" != "no"; then PKG_CHECK_MODULES(LIBCURL, [libcurl], [ @@ -2952,6 +2957,8 @@ if test "$wxUSE_LIBCURL" != "no"; then fi fi +fi dnl wxUSE_OSX_IPHONE != 1 + dnl ---------------------------------------------------------------- dnl search for toolkit (widget sets) dnl ---------------------------------------------------------------- From 893ebbab0c5c569e68c0e8c8337e7b79cbc302eb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 14:24:47 +0100 Subject: [PATCH 093/218] Disable use of build system pkg-config files when cross-compiling Using build system libraries for a different host doesn't make sense and can be actively harmful, so set PKG_CONFIG_LIBDIR to prevent pkg-config from finding them (it, or PKG_CONFIG_PATH, can still be set to some host-appropriate directory manually before/when running configure). This obviates the need for the changes in the previous commit, so revert it. --- configure | 12 +++++++++--- configure.in | 24 +++++++++++++++++------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/configure b/configure index ec0f4072ff..25e02a2322 100755 --- a/configure +++ b/configure @@ -21642,6 +21642,15 @@ $as_echo "no" >&6; } fi +if test "$build" != "$host"; then + + + if test -z "$PKG_CONFIG_LIBDIR"; then + PKG_CONFIG_LIBDIR=/dev/null + export PKG_CONFIG_LIBDIR + fi +fi + if test "$wxUSE_REGEX" != "no"; then @@ -23004,8 +23013,6 @@ if test "$wxUSE_LIBMSPACK" != "no"; then fi -if test "$wxUSE_OSX_IPHONE" != 1; then - if test "$wxUSE_LIBCURL" != "no"; then pkg_failed=no @@ -23101,7 +23108,6 @@ $as_echo "$as_me: WARNING: libcurl not found, wxWebRequest won't be available" > fi fi -fi TOOLKIT= TOOLKIT_INCLUDE= diff --git a/configure.in b/configure.in index c8c37a34d7..0626e73532 100644 --- a/configure.in +++ b/configure.in @@ -2383,6 +2383,23 @@ fi dnl End of pre-C++11 only checks section dnl Find pkg-config outside of any conditional. Done before any PKG_* call. PKG_PROG_PKG_CONFIG +dnl When cross-compiling, don't use .pc files on the build system, they are at +dnl best useless and can be harmful (e.g. they may define options inappropriate +dnl for the cross-build, resulting in the failure of all the subsequent tests). +if test "$build" != "$host"; then + dnl pkg.m4 forbids the use of PKG_XXX, so undo it here to avoid autoconf + dnl errors. + m4_pattern_allow([PKG_CONFIG_LIBDIR]) + + dnl If pkg-config libdir is already defined, we suppose that they know what + dnl they're doing and leave it alone, but if not, set it to a path in which + dnl no .pc files will be found. + if test -z "$PKG_CONFIG_LIBDIR"; then + PKG_CONFIG_LIBDIR=/dev/null + export PKG_CONFIG_LIBDIR + fi +fi + dnl --------------------------------------------------------------------------- dnl Optional libraries dnl @@ -2928,11 +2945,6 @@ dnl ------------------------------------------------------------------------ dnl Check for libcurl dnl ------------------------------------------------------------------------ -dnl Using libcurl on iOS doesn't make much sense and currently breaks the -dnl build, probably because it finds a wrong (native) libcurl.pc file, so just -dnl disable it for now. -if test "$wxUSE_OSX_IPHONE" != 1; then - if test "$wxUSE_LIBCURL" != "no"; then PKG_CHECK_MODULES(LIBCURL, [libcurl], [ @@ -2957,8 +2969,6 @@ if test "$wxUSE_LIBCURL" != "no"; then fi fi -fi dnl wxUSE_OSX_IPHONE != 1 - dnl ---------------------------------------------------------------- dnl search for toolkit (widget sets) dnl ---------------------------------------------------------------- From ff57081ff2d6a4fa2cad02037ffb6fc891ef4e71 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 14:34:28 +0100 Subject: [PATCH 094/218] Fix --with-winhttp configure option It was never defined because USE_WIN32 wasn't set at the time it was tested. Fix this by just always defining this option, even though it only makes sense for MSW. Also fix the test for winhttp.h, it needs to include windows.h first, as otherwise compiling the header would always fail. --- configure | 7 +++---- configure.in | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 25e02a2322..3827035f33 100755 --- a/configure +++ b/configure @@ -5379,7 +5379,6 @@ fi eval "$wx_cv_use_libcurl" -if test "$USE_WIN32" = 1; then withstring= defaultval=$wxUSE_ALL_FEATURES @@ -5409,7 +5408,6 @@ fi eval "$wx_cv_use_winhttp" -fi if test "$USE_DARWIN" = 1; then withstring= @@ -23136,11 +23134,12 @@ fi LIBS="$LIBS -loleacc" fi if test "$wxUSE_WINHTTP" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "winhttp.h" "ac_cv_header_winhttp_h" "$ac_includes_default" + ac_fn_c_check_header_compile "$LINENO" "winhttp.h" "ac_cv_header_winhttp_h" "#include +" if test "x$ac_cv_header_winhttp_h" = xyes; then : else - wxUSE_WINHTTP=no + wxUSE_WINHTTP=no fi diff --git a/configure.in b/configure.in index 0626e73532..77bcf7b436 100644 --- a/configure.in +++ b/configure.in @@ -577,9 +577,9 @@ WX_ARG_SYS_WITH(zlib, [ --with-zlib use zlib for LZW compressi WX_ARG_SYS_WITH(expat, [ --with-expat enable XML support using expat parser], wxUSE_EXPAT) WX_ARG_WITH(libcurl, [ --with-libcurl use libcurl-based wxWebRequest], wxUSE_LIBCURL) -if test "$USE_WIN32" = 1; then +dnl USE_WIN32 is not defined yet, so we always define this option even if it's +dnl MSW-specific, which is not ideal, but better than never defining it. WX_ARG_WITH(winhttp, [ --with-winhttp use WinHTTP-based wxWebRequest], wxUSE_WINHTTP) -fi if test "$USE_DARWIN" = 1; then WX_ARG_WITH(urlsession, [ --with-urlsession use NSURLSession-based wxWebRequest], wxUSE_URLSESSION) fi @@ -2999,7 +2999,7 @@ if test "$USE_WIN32" = 1 ; then LIBS="$LIBS -loleacc" fi if test "$wxUSE_WINHTTP" = "yes" ; then - AC_CHECK_HEADER(winhttp.h,,[ wxUSE_WINHTTP=no ]) + AC_CHECK_HEADER(winhttp.h,,[wxUSE_WINHTTP=no],[#include ]) if test "$wxUSE_WINHTTP" = "yes" ; then LIBS="$LIBS -lwinhttp" From b7450f52ff0a1b0011ff25f6b30dfe4bb4c55a2a Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 13 Dec 2020 14:36:31 +0100 Subject: [PATCH 095/218] Fixes to CMake build files for wxWebRequest Fix wrong library name in wx_add_sample() for webrequest. Also prefer to disable wxWebRequest if no backends for it are available, for consistency with the other libraries. --- build/cmake/init.cmake | 12 ++++++++++++ build/cmake/lib/net/CMakeLists.txt | 2 -- build/cmake/samples/CMakeLists.txt | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 4b56f6bfa3..6ca0f32985 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -308,6 +308,18 @@ if(wxUSE_LIBLZMA) endif() endif() +if(wxUSE_WEBREQUEST_CURL) + find_package(CURL) + if(NOT CURL_FOUND) + message(WARNING "CURL not found, wxWebSessionBackendCURL won't be available") + wx_option_force_value(wxUSE_WEBREQUEST_CURL OFF) + endif() +endif() +if (wxUSE_WEBREQUEST AND NOT (wxUSE_WEBREQUEST_WINHTTP OR wxUSE_WEBREQUEST_URLSESSION OR wxUSE_WEBREQUEST_CURL)) + message(WARNING "wxUSE_WEBREQUEST requires at least one backend, it won't be available") + wx_option_force_value(wxUSE_WEBREQUEST OFF) +endif() + if(UNIX) if(wxUSE_SECRETSTORE AND NOT APPLE) # The required APIs are always available under MSW and OS X but we must diff --git a/build/cmake/lib/net/CMakeLists.txt b/build/cmake/lib/net/CMakeLists.txt index 8f670d45b2..1d4dd83c3e 100644 --- a/build/cmake/lib/net/CMakeLists.txt +++ b/build/cmake/lib/net/CMakeLists.txt @@ -32,8 +32,6 @@ if(WIN32) endif() if (wxUSE_WEBREQUEST_CURL) - find_package(CURL REQUIRED) - target_include_directories(wxnet PRIVATE ${CURL_INCLUDE_DIRS}) wx_lib_link_libraries(wxnet PRIVATE ${CURL_LIBRARIES}) endif() diff --git a/build/cmake/samples/CMakeLists.txt b/build/cmake/samples/CMakeLists.txt index 7e72043e53..e4d4f788f9 100644 --- a/build/cmake/samples/CMakeLists.txt +++ b/build/cmake/samples/CMakeLists.txt @@ -157,7 +157,7 @@ wx_add_sample(webview LIBRARIES wxwebview DATA ../help/doc.zip:doc.zip if(TARGET webviewsample AND wxUSE_STC) wx_exe_link_libraries(webviewsample wxstc) endif() -wx_add_sample(webrequest LIBRARIES net DEPENDS wxUSE_WEBREQUEST) +wx_add_sample(webrequest LIBRARIES wxnet DEPENDS wxUSE_WEBREQUEST) # widgets Sample set(SAMPLE_WIDGETS_SRC activityindicator.cpp From 181be127a57f14394a0b31393f481b8569138929 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 15:51:12 +0100 Subject: [PATCH 096/218] Simplify wxUSE_WEBREQUEST_XXX logic Remove automatic definition of wxUSE_WEBREQUEST depending on whether wxUSE_WEBREQUEST_XXX are defined and follow the same approach as with wxUSE_GRAPHICS_XXX, i.e. define wxUSE_WEBREQUEST_XXX as wxUSE_WEBREQUEST by default instead. Move wxUSE_WEBREQUEST_WINHTTP to wxMSW-specific file, it doesn't need to be in common one (unfortunately this can't be done for the Mac-specific wxUSE_WEBREQUEST_URLSESSION yet, because macOS-specific settings are not injected into setup.h.in currently). Also fix test for winhttp.h availability: it seems to be present in all MinGW64 distributions, but not in MinGW32, so test for this and not for gcc version. Finally remove the now unnecessary test for macOS 10.9, as we only support 10.10+ anyhow by now. --- build/cmake/setup.h.in | 28 ++++++------------ include/wx/android/setup.h | 44 +++++++++------------------- include/wx/gtk/setup0.h | 60 ++++++++++++++++++-------------------- include/wx/motif/setup0.h | 44 +++++++++------------------- include/wx/msw/setup0.h | 60 ++++++++++++++++++-------------------- include/wx/msw/setup_inc.h | 16 +++++++++- include/wx/osx/setup0.h | 44 +++++++++------------------- include/wx/setup_inc.h | 44 +++++++++------------------- include/wx/univ/setup0.h | 44 +++++++++------------------- setup.h.in | 28 ++++++------------ 10 files changed, 161 insertions(+), 251 deletions(-) diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index 506c4655f4..db6e294e51 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -294,31 +294,15 @@ #cmakedefine01 wxUSE_MIMETYPE +#cmakedefine01 wxUSE_WEBREQUEST -#if defined(_MSC_VER) || \ - (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) -#cmakedefine01 wxUSE_WEBREQUEST_WINHTTP -#else -#cmakedefine01 wxUSE_WEBREQUEST_WINHTTP -#endif - -#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 -#cmakedefine01 wxUSE_WEBREQUEST_URLSESSION +#ifdef __APPLE__ +#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST #else #cmakedefine01 wxUSE_WEBREQUEST_URLSESSION #endif -#if defined(__WINDOWS__) || defined(__APPLE__) #cmakedefine01 wxUSE_WEBREQUEST_CURL -#else -#cmakedefine01 wxUSE_WEBREQUEST_CURL -#endif - -#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL -#cmakedefine01 wxUSE_WEBREQUEST -#else -#cmakedefine01 wxUSE_WEBREQUEST -#endif #cmakedefine01 wxUSE_PROTOCOL @@ -707,6 +691,12 @@ #cmakedefine01 wxUSE_GRAPHICS_DIRECT2D #endif +#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR) + #cmakedefine01 wxUSE_WEBREQUEST_WINHTTP +#else + #cmakedefine01 wxUSE_WEBREQUEST_WINHTTP +#endif + #cmakedefine01 wxUSE_OLE diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index 0443cf7f9e..3fd3ce552b 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -632,53 +632,37 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 -// wxWebRequest backend based on WinHTTP +// wxWebRequest allows usage of system libraries for HTTP(S) requests. +// +// Note that for wxWebRequest to be built, at least one of its backends must be +// available. Under MSW and macOS this will always be the case unless +// explicitly disabled. // // Default is 1 // -// Recommended setting: 1 on Windows - -// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() -// here as this file is included from wx/platform.h before they're defined. -#if defined(_MSC_VER) || \ - (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) -#define wxUSE_WEBREQUEST_WINHTTP 1 -#else -#define wxUSE_WEBREQUEST_WINHTTP 0 -#endif +// Recommended setting: 1, setting it to 0 may be useful to avoid dependencies +// on libcurl on Unix systems. +#define wxUSE_WEBREQUEST 1 // wxWebRequest backend based on NSURLSession // -// Default is 1 +// Default is 1 under macOS. // -// Recommended setting: 1 on macOS 10.9+ -#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 -#define wxUSE_WEBREQUEST_URLSESSION 1 +// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, +// otherwise wxWebRequest won't be available at all under Mac. +#ifdef __APPLE__ +#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST #else #define wxUSE_WEBREQUEST_URLSESSION 0 #endif // wxWebRequest backend based on libcurl, can be used under all platforms. // -// Default is 1 +// Default is 0 for MSW and macOS, detected automatically when using configure. // // Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required // for wxWebRequest to be available at all. -#if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 -#else -#define wxUSE_WEBREQUEST_CURL 1 -#endif - -// wxWebRequest and related classes: This will allow usage of system libraries -// for HTTP(S) requests -// -// Default is 1 -#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL -#define wxUSE_WEBREQUEST 1 -#else -#define wxUSE_WEBREQUEST 0 -#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/gtk/setup0.h b/include/wx/gtk/setup0.h index d22b87749a..77b1827e0f 100644 --- a/include/wx/gtk/setup0.h +++ b/include/wx/gtk/setup0.h @@ -633,53 +633,37 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 -// wxWebRequest backend based on WinHTTP +// wxWebRequest allows usage of system libraries for HTTP(S) requests. +// +// Note that for wxWebRequest to be built, at least one of its backends must be +// available. Under MSW and macOS this will always be the case unless +// explicitly disabled. // // Default is 1 // -// Recommended setting: 1 on Windows - -// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() -// here as this file is included from wx/platform.h before they're defined. -#if defined(_MSC_VER) || \ - (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) -#define wxUSE_WEBREQUEST_WINHTTP 1 -#else -#define wxUSE_WEBREQUEST_WINHTTP 0 -#endif +// Recommended setting: 1, setting it to 0 may be useful to avoid dependencies +// on libcurl on Unix systems. +#define wxUSE_WEBREQUEST 1 // wxWebRequest backend based on NSURLSession // -// Default is 1 +// Default is 1 under macOS. // -// Recommended setting: 1 on macOS 10.9+ -#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 -#define wxUSE_WEBREQUEST_URLSESSION 1 +// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, +// otherwise wxWebRequest won't be available at all under Mac. +#ifdef __APPLE__ +#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST #else #define wxUSE_WEBREQUEST_URLSESSION 0 #endif // wxWebRequest backend based on libcurl, can be used under all platforms. // -// Default is 1 +// Default is 0 for MSW and macOS, detected automatically when using configure. // // Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required // for wxWebRequest to be available at all. -#if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 -#else -#define wxUSE_WEBREQUEST_CURL 1 -#endif - -// wxWebRequest and related classes: This will allow usage of system libraries -// for HTTP(S) requests -// -// Default is 1 -#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL -#define wxUSE_WEBREQUEST 1 -#else -#define wxUSE_WEBREQUEST 0 -#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. @@ -1630,7 +1614,7 @@ /* --- start MSW options --- */ // ---------------------------------------------------------------------------- -// Graphics backends choices for Windows +// Windows-specific backends choices // ---------------------------------------------------------------------------- // The options here are only taken into account if wxUSE_GRAPHICS_CONTEXT is 1. @@ -1658,6 +1642,20 @@ #define wxUSE_GRAPHICS_DIRECT2D 0 #endif +// wxWebRequest backend based on WinHTTP. +// +// This is only taken into account if wxUSE_WEBREQUEST==1. +// +// Default is 1 if supported by the compiler (MSVS or MinGW64). +// +// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, +// otherwise wxWebRequest won't be available at all. +#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR) + #define wxUSE_WEBREQUEST_WINHTTP 1 +#else + #define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + // ---------------------------------------------------------------------------- // Windows-only settings // ---------------------------------------------------------------------------- diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index f88c0fefb7..9a6b48601d 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -633,53 +633,37 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 -// wxWebRequest backend based on WinHTTP +// wxWebRequest allows usage of system libraries for HTTP(S) requests. +// +// Note that for wxWebRequest to be built, at least one of its backends must be +// available. Under MSW and macOS this will always be the case unless +// explicitly disabled. // // Default is 1 // -// Recommended setting: 1 on Windows - -// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() -// here as this file is included from wx/platform.h before they're defined. -#if defined(_MSC_VER) || \ - (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) -#define wxUSE_WEBREQUEST_WINHTTP 1 -#else -#define wxUSE_WEBREQUEST_WINHTTP 0 -#endif +// Recommended setting: 1, setting it to 0 may be useful to avoid dependencies +// on libcurl on Unix systems. +#define wxUSE_WEBREQUEST 1 // wxWebRequest backend based on NSURLSession // -// Default is 1 +// Default is 1 under macOS. // -// Recommended setting: 1 on macOS 10.9+ -#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 -#define wxUSE_WEBREQUEST_URLSESSION 1 +// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, +// otherwise wxWebRequest won't be available at all under Mac. +#ifdef __APPLE__ +#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST #else #define wxUSE_WEBREQUEST_URLSESSION 0 #endif // wxWebRequest backend based on libcurl, can be used under all platforms. // -// Default is 1 +// Default is 0 for MSW and macOS, detected automatically when using configure. // // Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required // for wxWebRequest to be available at all. -#if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 -#else -#define wxUSE_WEBREQUEST_CURL 1 -#endif - -// wxWebRequest and related classes: This will allow usage of system libraries -// for HTTP(S) requests -// -// Default is 1 -#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL -#define wxUSE_WEBREQUEST 1 -#else -#define wxUSE_WEBREQUEST 0 -#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index ed9a9e5072..28a21cffed 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -633,53 +633,37 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 -// wxWebRequest backend based on WinHTTP +// wxWebRequest allows usage of system libraries for HTTP(S) requests. +// +// Note that for wxWebRequest to be built, at least one of its backends must be +// available. Under MSW and macOS this will always be the case unless +// explicitly disabled. // // Default is 1 // -// Recommended setting: 1 on Windows - -// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() -// here as this file is included from wx/platform.h before they're defined. -#if defined(_MSC_VER) || \ - (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) -#define wxUSE_WEBREQUEST_WINHTTP 1 -#else -#define wxUSE_WEBREQUEST_WINHTTP 0 -#endif +// Recommended setting: 1, setting it to 0 may be useful to avoid dependencies +// on libcurl on Unix systems. +#define wxUSE_WEBREQUEST 1 // wxWebRequest backend based on NSURLSession // -// Default is 1 +// Default is 1 under macOS. // -// Recommended setting: 1 on macOS 10.9+ -#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 -#define wxUSE_WEBREQUEST_URLSESSION 1 +// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, +// otherwise wxWebRequest won't be available at all under Mac. +#ifdef __APPLE__ +#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST #else #define wxUSE_WEBREQUEST_URLSESSION 0 #endif // wxWebRequest backend based on libcurl, can be used under all platforms. // -// Default is 1 +// Default is 0 for MSW and macOS, detected automatically when using configure. // // Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required // for wxWebRequest to be available at all. -#if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 -#else -#define wxUSE_WEBREQUEST_CURL 1 -#endif - -// wxWebRequest and related classes: This will allow usage of system libraries -// for HTTP(S) requests -// -// Default is 1 -#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL -#define wxUSE_WEBREQUEST 1 -#else -#define wxUSE_WEBREQUEST 0 -#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. @@ -1630,7 +1614,7 @@ /* --- start MSW options --- */ // ---------------------------------------------------------------------------- -// Graphics backends choices for Windows +// Windows-specific backends choices // ---------------------------------------------------------------------------- // The options here are only taken into account if wxUSE_GRAPHICS_CONTEXT is 1. @@ -1658,6 +1642,20 @@ #define wxUSE_GRAPHICS_DIRECT2D 0 #endif +// wxWebRequest backend based on WinHTTP. +// +// This is only taken into account if wxUSE_WEBREQUEST==1. +// +// Default is 1 if supported by the compiler (MSVS or MinGW64). +// +// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, +// otherwise wxWebRequest won't be available at all. +#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR) + #define wxUSE_WEBREQUEST_WINHTTP 1 +#else + #define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + // ---------------------------------------------------------------------------- // Windows-only settings // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/setup_inc.h b/include/wx/msw/setup_inc.h index c764432c9d..9a077f6156 100644 --- a/include/wx/msw/setup_inc.h +++ b/include/wx/msw/setup_inc.h @@ -8,7 +8,7 @@ /////////////////////////////////////////////////////////////////////////////// // ---------------------------------------------------------------------------- -// Graphics backends choices for Windows +// Windows-specific backends choices // ---------------------------------------------------------------------------- // The options here are only taken into account if wxUSE_GRAPHICS_CONTEXT is 1. @@ -36,6 +36,20 @@ #define wxUSE_GRAPHICS_DIRECT2D 0 #endif +// wxWebRequest backend based on WinHTTP. +// +// This is only taken into account if wxUSE_WEBREQUEST==1. +// +// Default is 1 if supported by the compiler (MSVS or MinGW64). +// +// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, +// otherwise wxWebRequest won't be available at all. +#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR) + #define wxUSE_WEBREQUEST_WINHTTP 1 +#else + #define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + // ---------------------------------------------------------------------------- // Windows-only settings // ---------------------------------------------------------------------------- diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index ead9701e87..5d20b4e33d 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -639,53 +639,37 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 -// wxWebRequest backend based on WinHTTP +// wxWebRequest allows usage of system libraries for HTTP(S) requests. +// +// Note that for wxWebRequest to be built, at least one of its backends must be +// available. Under MSW and macOS this will always be the case unless +// explicitly disabled. // // Default is 1 // -// Recommended setting: 1 on Windows - -// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() -// here as this file is included from wx/platform.h before they're defined. -#if defined(_MSC_VER) || \ - (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) -#define wxUSE_WEBREQUEST_WINHTTP 1 -#else -#define wxUSE_WEBREQUEST_WINHTTP 0 -#endif +// Recommended setting: 1, setting it to 0 may be useful to avoid dependencies +// on libcurl on Unix systems. +#define wxUSE_WEBREQUEST 1 // wxWebRequest backend based on NSURLSession // -// Default is 1 +// Default is 1 under macOS. // -// Recommended setting: 1 on macOS 10.9+ -#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 -#define wxUSE_WEBREQUEST_URLSESSION 1 +// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, +// otherwise wxWebRequest won't be available at all under Mac. +#ifdef __APPLE__ +#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST #else #define wxUSE_WEBREQUEST_URLSESSION 0 #endif // wxWebRequest backend based on libcurl, can be used under all platforms. // -// Default is 1 +// Default is 0 for MSW and macOS, detected automatically when using configure. // // Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required // for wxWebRequest to be available at all. -#if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 -#else -#define wxUSE_WEBREQUEST_CURL 1 -#endif - -// wxWebRequest and related classes: This will allow usage of system libraries -// for HTTP(S) requests -// -// Default is 1 -#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL -#define wxUSE_WEBREQUEST 1 -#else -#define wxUSE_WEBREQUEST 0 -#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index 1eb66bcaa6..28c9c6d5f8 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -629,53 +629,37 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 -// wxWebRequest backend based on WinHTTP +// wxWebRequest allows usage of system libraries for HTTP(S) requests. +// +// Note that for wxWebRequest to be built, at least one of its backends must be +// available. Under MSW and macOS this will always be the case unless +// explicitly disabled. // // Default is 1 // -// Recommended setting: 1 on Windows - -// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() -// here as this file is included from wx/platform.h before they're defined. -#if defined(_MSC_VER) || \ - (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) -#define wxUSE_WEBREQUEST_WINHTTP 1 -#else -#define wxUSE_WEBREQUEST_WINHTTP 0 -#endif +// Recommended setting: 1, setting it to 0 may be useful to avoid dependencies +// on libcurl on Unix systems. +#define wxUSE_WEBREQUEST 1 // wxWebRequest backend based on NSURLSession // -// Default is 1 +// Default is 1 under macOS. // -// Recommended setting: 1 on macOS 10.9+ -#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 -#define wxUSE_WEBREQUEST_URLSESSION 1 +// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, +// otherwise wxWebRequest won't be available at all under Mac. +#ifdef __APPLE__ +#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST #else #define wxUSE_WEBREQUEST_URLSESSION 0 #endif // wxWebRequest backend based on libcurl, can be used under all platforms. // -// Default is 1 +// Default is 0 for MSW and macOS, detected automatically when using configure. // // Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required // for wxWebRequest to be available at all. -#if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 -#else -#define wxUSE_WEBREQUEST_CURL 1 -#endif - -// wxWebRequest and related classes: This will allow usage of system libraries -// for HTTP(S) requests -// -// Default is 1 -#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL -#define wxUSE_WEBREQUEST 1 -#else -#define wxUSE_WEBREQUEST 0 -#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index 9c057c2977..72b1ea4a43 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -632,53 +632,37 @@ // wxMimeTypesManager class #define wxUSE_MIMETYPE 1 -// wxWebRequest backend based on WinHTTP +// wxWebRequest allows usage of system libraries for HTTP(S) requests. +// +// Note that for wxWebRequest to be built, at least one of its backends must be +// available. Under MSW and macOS this will always be the case unless +// explicitly disabled. // // Default is 1 // -// Recommended setting: 1 on Windows - -// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION() -// here as this file is included from wx/platform.h before they're defined. -#if defined(_MSC_VER) || \ - (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) -#define wxUSE_WEBREQUEST_WINHTTP 1 -#else -#define wxUSE_WEBREQUEST_WINHTTP 0 -#endif +// Recommended setting: 1, setting it to 0 may be useful to avoid dependencies +// on libcurl on Unix systems. +#define wxUSE_WEBREQUEST 1 // wxWebRequest backend based on NSURLSession // -// Default is 1 +// Default is 1 under macOS. // -// Recommended setting: 1 on macOS 10.9+ -#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 -#define wxUSE_WEBREQUEST_URLSESSION 1 +// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, +// otherwise wxWebRequest won't be available at all under Mac. +#ifdef __APPLE__ +#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST #else #define wxUSE_WEBREQUEST_URLSESSION 0 #endif // wxWebRequest backend based on libcurl, can be used under all platforms. // -// Default is 1 +// Default is 0 for MSW and macOS, detected automatically when using configure. // // Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required // for wxWebRequest to be available at all. -#if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 -#else -#define wxUSE_WEBREQUEST_CURL 1 -#endif - -// wxWebRequest and related classes: This will allow usage of system libraries -// for HTTP(S) requests -// -// Default is 1 -#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL -#define wxUSE_WEBREQUEST 1 -#else -#define wxUSE_WEBREQUEST 0 -#endif // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. diff --git a/setup.h.in b/setup.h.in index 640791704a..711f4dc682 100644 --- a/setup.h.in +++ b/setup.h.in @@ -294,31 +294,15 @@ #define wxUSE_MIMETYPE 0 +#define wxUSE_WEBREQUEST 0 -#if defined(_MSC_VER) || \ - (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8)) -#define wxUSE_WEBREQUEST_WINHTTP 0 -#else -#define wxUSE_WEBREQUEST_WINHTTP 0 -#endif - -#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 -#define wxUSE_WEBREQUEST_URLSESSION 0 +#ifdef __APPLE__ +#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST #else #define wxUSE_WEBREQUEST_URLSESSION 0 #endif -#if defined(__WINDOWS__) || defined(__APPLE__) #define wxUSE_WEBREQUEST_CURL 0 -#else -#define wxUSE_WEBREQUEST_CURL 0 -#endif - -#if wxUSE_WEBREQUEST_WINHTTP || wxUSE_WEBREQUEST_URLSESSION || wxUSE_WEBREQUEST_CURL -#define wxUSE_WEBREQUEST 0 -#else -#define wxUSE_WEBREQUEST 0 -#endif #define wxUSE_PROTOCOL 0 @@ -707,6 +691,12 @@ #define wxUSE_GRAPHICS_DIRECT2D 0 #endif +#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR) + #define wxUSE_WEBREQUEST_WINHTTP 0 +#else + #define wxUSE_WEBREQUEST_WINHTTP 0 +#endif + #define wxUSE_OLE 0 From c6b83194f10238c238af8314f9e6f9448df227d5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 16:20:48 +0100 Subject: [PATCH 097/218] Fix configure wxWebRequest detection and warning logic Only use wxUSE_WEBREQUEST_{URLSESSION,WINHTTP} under the platforms where they make sense. Turn wxUSE_WEBREQUEST off if no backends are available and warn about it, even under MSW/macOS platforms where this wasn't done previously. --- configure | 31 ++++++++++++++----------------- configure.in | 29 ++++++++++++----------------- 2 files changed, 26 insertions(+), 34 deletions(-) diff --git a/configure b/configure index 3827035f33..4d04ebdcda 100755 --- a/configure +++ b/configure @@ -23011,7 +23011,7 @@ if test "$wxUSE_LIBMSPACK" != "no"; then fi -if test "$wxUSE_LIBCURL" != "no"; then +if test "$wxUSE_WEBREQUEST" = "yes" -a "$wxUSE_LIBCURL" != "no"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCURL" >&5 @@ -23092,18 +23092,8 @@ $as_echo "yes" >&6; } CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS" LIBS="$LIBCURL_LIBS $LIBS" - $as_echo "#define wxUSE_WEBREQUEST_LIBCURL 1" >>confdefs.h - fi - - if test "$wxUSE_LIBCURL" = "no"; then - if test "$USE_WIN32" != 1 -a "$USE_DARWIN" != 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl not found, wxWebRequest won't be available" >&5 -$as_echo "$as_me: WARNING: libcurl not found, wxWebRequest won't be available" >&2;} - wxUSE_WEBREQUEST=no - fi - fi fi @@ -36124,25 +36114,32 @@ if test "$wxUSE_FS_INET" = "yes"; then fi if test "$wxUSE_WEBREQUEST" = "yes"; then - $as_echo "#define wxUSE_WEBREQUEST 1" >>confdefs.h - - if test "$wxUSE_LIBCURL" = "yes"; then $as_echo "#define wxUSE_WEBREQUEST_CURL 1" >>confdefs.h + have_webrequest_backend=1 fi - if test "$wxUSE_URLSESSION" = "yes"; then + if test "$USE_DARWIN" = 1 -a "$wxUSE_URLSESSION" = "yes"; then $as_echo "#define wxUSE_WEBREQUEST_URLSESSION 1" >>confdefs.h + have_webrequest_backend=1 fi - if test "$wxUSE_WINHTTP" = "yes"; then + if test "$USE_WIN32" = 1 -a "$wxUSE_WINHTTP" = "yes"; then $as_echo "#define wxUSE_WEBREQUEST_WINHTTP 1" >>confdefs.h + have_webrequest_backend=1 fi - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS webrequest" + if test "$have_webrequest_backend" = 1; then + $as_echo "#define wxUSE_WEBREQUEST 1" >>confdefs.h + + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS webrequest" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling wxWebRequest because no backends are available" >&5 +$as_echo "$as_me: WARNING: Disabling wxWebRequest because no backends are available" >&2;} + fi fi diff --git a/configure.in b/configure.in index 77bcf7b436..5d0629ddce 100644 --- a/configure.in +++ b/configure.in @@ -2945,28 +2945,17 @@ dnl ------------------------------------------------------------------------ dnl Check for libcurl dnl ------------------------------------------------------------------------ -if test "$wxUSE_LIBCURL" != "no"; then +if test "$wxUSE_WEBREQUEST" = "yes" -a "$wxUSE_LIBCURL" != "no"; then PKG_CHECK_MODULES(LIBCURL, [libcurl], [ CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS" LIBS="$LIBCURL_LIBS $LIBS" - AC_DEFINE(wxUSE_WEBREQUEST_LIBCURL) ], [ wxUSE_LIBCURL=no AC_MSG_RESULT([not found]) ] ) - - if test "$wxUSE_LIBCURL" = "no"; then - dnl Under these platforms we have other, always available, backends for - dnl wxWebRequest, but under the others (i.e. generic Unix) libcurl is - dnl the only way to implement wxWebRequest. - if test "$USE_WIN32" != 1 -a "$USE_DARWIN" != 1; then - AC_MSG_WARN([libcurl not found, wxWebRequest won't be available]) - wxUSE_WEBREQUEST=no - fi - fi fi dnl ---------------------------------------------------------------- @@ -6610,21 +6599,27 @@ if test "$wxUSE_FS_INET" = "yes"; then fi if test "$wxUSE_WEBREQUEST" = "yes"; then - AC_DEFINE(wxUSE_WEBREQUEST) - if test "$wxUSE_LIBCURL" = "yes"; then AC_DEFINE(wxUSE_WEBREQUEST_CURL) + have_webrequest_backend=1 fi - if test "$wxUSE_URLSESSION" = "yes"; then + if test "$USE_DARWIN" = 1 -a "$wxUSE_URLSESSION" = "yes"; then AC_DEFINE(wxUSE_WEBREQUEST_URLSESSION) + have_webrequest_backend=1 fi - if test "$wxUSE_WINHTTP" = "yes"; then + if test "$USE_WIN32" = 1 -a "$wxUSE_WINHTTP" = "yes"; then AC_DEFINE(wxUSE_WEBREQUEST_WINHTTP) + have_webrequest_backend=1 fi - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS webrequest" + if test "$have_webrequest_backend" = 1; then + AC_DEFINE(wxUSE_WEBREQUEST) + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS webrequest" + else + AC_MSG_WARN([Disabling wxWebRequest because no backends are available]) + fi fi dnl --------------------------------------------------------------------------- From ab795fa68ce59638b48fb54c522de7a5e2038d40 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 13 Dec 2020 16:35:34 +0100 Subject: [PATCH 098/218] Check for winhttp.h presence in CMake too --- build/cmake/init.cmake | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 6ca0f32985..d9b78ba412 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -308,16 +308,30 @@ if(wxUSE_LIBLZMA) endif() endif() -if(wxUSE_WEBREQUEST_CURL) - find_package(CURL) - if(NOT CURL_FOUND) - message(WARNING "CURL not found, wxWebSessionBackendCURL won't be available") - wx_option_force_value(wxUSE_WEBREQUEST_CURL OFF) +if (wxUSE_WEBREQUEST) + if(wxUSE_WEBREQUEST_CURL) + find_package(CURL) + if(NOT CURL_FOUND) + message(WARNING "CURL not found, wxWebSessionBackendCURL won't be available") + wx_option_force_value(wxUSE_WEBREQUEST_CURL OFF) + endif() + endif() + + if(wxUSE_WEBREQUEST_WINHTTP) + check_c_source_compiles("#include + #include + int main(){return 0;}" + HAVE_WINHTTP_H) + if(NOT HAVE_WINHTTP_H) + message(WARNING "winhttp.h not found, wxWebSessionBackendWinHTTP won't be available") + wx_option_force_value(wxUSE_WEBREQUEST_WINHTTP OFF) + endif() + endif() + + if (NOT(wxUSE_WEBREQUEST_WINHTTP OR wxUSE_WEBREQUEST_URLSESSION OR wxUSE_WEBREQUEST_CURL)) + message(WARNING "wxUSE_WEBREQUEST requires at least one backend, it won't be available") + wx_option_force_value(wxUSE_WEBREQUEST OFF) endif() -endif() -if (wxUSE_WEBREQUEST AND NOT (wxUSE_WEBREQUEST_WINHTTP OR wxUSE_WEBREQUEST_URLSESSION OR wxUSE_WEBREQUEST_CURL)) - message(WARNING "wxUSE_WEBREQUEST requires at least one backend, it won't be available") - wx_option_force_value(wxUSE_WEBREQUEST OFF) endif() if(UNIX) From 9cc35c54d23fb70751d6f44c9a5873f8ebb56e74 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 16:46:24 +0100 Subject: [PATCH 099/218] Simplify libcurl initialization by using CURL_GLOBAL_ALL Using anything else is not recommended by libcurl documentation and it's not clear why would we need it, so just follow the official advice and pass CURL_GLOBAL_ALL. --- src/common/webrequest_curl.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index c7e01c3e1c..e3f01b60be 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -537,11 +537,7 @@ wxVersionInfo wxWebSessionCURL::GetLibraryVersionInfo() // static void wxWebSessionCURL::InitializeCURL() { - long initFlags = CURL_GLOBAL_SSL; -#ifdef WIN32 - initFlags |= CURL_GLOBAL_WIN32; -#endif // WIN32 - if ( curl_global_init(initFlags) ) + if ( curl_global_init(CURL_GLOBAL_ALL) ) wxLogError("libcurl could not be initialized"); } From 7027f66a9aa944a683caadc4e632738a3c8a9ba3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 16:57:16 +0100 Subject: [PATCH 100/218] Simplify code by folding {Initialize,Cleanu[}CURL() in the caller There doesn't seem to be any need to have separate functions when they are just trivial wrappers. --- include/wx/webrequest_curl.h | 4 ---- src/common/webrequest_curl.cpp | 21 +++++---------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/include/wx/webrequest_curl.h b/include/wx/webrequest_curl.h index 2033b65d10..aa6b1c7c7d 100644 --- a/include/wx/webrequest_curl.h +++ b/include/wx/webrequest_curl.h @@ -137,10 +137,6 @@ private: static int ms_activeSessions; - static void InitializeCURL(); - - static void CleanupCURL(); - wxDECLARE_NO_COPY_CLASS(wxWebSessionCURL); }; diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index e3f01b60be..cf0e67a999 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -346,7 +346,10 @@ wxWebSessionCURL::wxWebSessionCURL() : { // Initialize CURL globally if no sessions are active if ( ms_activeSessions == 0 ) - InitializeCURL(); + { + if ( curl_global_init(CURL_GLOBAL_ALL) ) + wxLogError("libcurl could not be initialized"); + } ms_activeSessions++; } @@ -370,7 +373,7 @@ wxWebSessionCURL::~wxWebSessionCURL() // Global CURL cleanup if this is the last session --ms_activeSessions; if ( ms_activeSessions == 0 ) - CleanupCURL(); + curl_global_cleanup(); } void wxWebSessionCURL::Initialize() @@ -534,18 +537,4 @@ wxVersionInfo wxWebSessionCURL::GetLibraryVersionInfo() desc); } -// static -void wxWebSessionCURL::InitializeCURL() -{ - if ( curl_global_init(CURL_GLOBAL_ALL) ) - wxLogError("libcurl could not be initialized"); -} - -// static -void wxWebSessionCURL::CleanupCURL() -{ - if ( ms_activeSessions == 0 ) - curl_global_cleanup(); -} - #endif // wxUSE_WEBREQUEST_CURL From 77d25edce21680ea2dd6617031906839d751b5c1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 16:58:57 +0100 Subject: [PATCH 101/218] Translate the error message given in case libcurl init failure This message is user-visible and so should be translated. --- src/common/webrequest_curl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index cf0e67a999..904836ce1c 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -22,6 +22,7 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/translation.h" #include "wx/utils.h" #endif @@ -348,7 +349,7 @@ wxWebSessionCURL::wxWebSessionCURL() : if ( ms_activeSessions == 0 ) { if ( curl_global_init(CURL_GLOBAL_ALL) ) - wxLogError("libcurl could not be initialized"); + wxLogError(_("libcurl could not be initialized")); } ms_activeSessions++; From 76499a3e8b152c5ff7d4d2556aa3090b2b250ec7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 17:06:15 +0100 Subject: [PATCH 102/218] Check curl_multi_init() return value Return NULL wxWebRequest if this function fails. Also get rid of another unnecessary Initialize() function. --- include/wx/webrequest_curl.h | 2 -- src/common/webrequest_curl.cpp | 15 +++++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/wx/webrequest_curl.h b/include/wx/webrequest_curl.h index aa6b1c7c7d..f3659866db 100644 --- a/include/wx/webrequest_curl.h +++ b/include/wx/webrequest_curl.h @@ -133,8 +133,6 @@ private: wxMutex m_cancelledMutex; wxVector< wxObjectDataPtr > m_cancelledRequests; - void Initialize(); - static int ms_activeSessions; wxDECLARE_NO_COPY_CLASS(wxWebSessionCURL); diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 904836ce1c..b6cb346ec8 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -377,15 +377,18 @@ wxWebSessionCURL::~wxWebSessionCURL() curl_global_cleanup(); } -void wxWebSessionCURL::Initialize() -{ - m_handle = curl_multi_init(); -} - wxWebRequest* wxWebSessionCURL::CreateRequest(const wxString& url, int id) { + // Allocate our handle on demand. if ( !m_handle ) - Initialize(); + { + m_handle = curl_multi_init(); + if ( !m_handle ) + { + wxLogDebug("curl_multi_init() failed"); + return NULL; + } + } return new wxWebRequestCURL(*this, id, url); } From edd45bd5a1477b5bc7464dcaeb7306922ea71343 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 17:17:06 +0100 Subject: [PATCH 103/218] Disable wxUSE_WEBREQUEST when using MinGW32 We can't compile it with this compiler using WinHTTP backend. --- include/wx/msw/chkconf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/wx/msw/chkconf.h b/include/wx/msw/chkconf.h index 1d6feabd69..87ac46f30d 100644 --- a/include/wx/msw/chkconf.h +++ b/include/wx/msw/chkconf.h @@ -235,6 +235,16 @@ # define wxUSE_ACTIVITYINDICATOR 0 #endif /* !wxUSE_ACTIVITYINDICATOR && !_MSC_VER */ +/* + Similarly, turn off wxUSE_WEBREQUEST if we can't enable it because we don't + have any of its backends to allow the library to compile with the default + options when using MinGW32 which doesn't come with winhttp.h and so for + which we have to disable wxUSE_WEBREQUEST_WINHTTP. + */ +#if wxUSE_WEBREQUEST && !wxUSE_WEBREQUEST_CURL && !wxUSE_WEBREQUEST_WINHTTP +# undef wxUSE_WEBREQUEST +# define wxUSE_WEBREQUEST 0 +#endif /* wxUSE_WEBREQUEST */ /* check settings consistency for MSW-specific ones */ #if wxUSE_CRASHREPORT && !wxUSE_ON_FATAL_EXCEPTION From 373a3f8c572fb6f2ddb641196a6c48501b51aa04 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 17:29:05 +0100 Subject: [PATCH 104/218] Remove obsolete Borland hdrstop pragmas from the new code See f57f214122 (Remove BCC-specific hdrstop pragma from everywhere, 2020-10-12). --- src/common/webrequest.cpp | 4 ---- src/common/webrequest_curl.cpp | 4 ---- src/generic/creddlgg.cpp | 4 ---- src/msw/webrequest_winhttp.cpp | 4 ---- src/osx/webrequest_urlsession.mm | 4 ---- 5 files changed, 20 deletions(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 8df716811b..7697ca5635 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -10,10 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#if defined(__BORLANDC__) -#pragma hdrstop -#endif - #if wxUSE_WEBREQUEST #include "wx/webrequest.h" diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index b6cb346ec8..7fe9a90ac5 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -10,10 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#if defined(__BORLANDC__) -#pragma hdrstop -#endif - #include "wx/webrequest.h" #if wxUSE_WEBREQUEST_CURL diff --git a/src/generic/creddlgg.cpp b/src/generic/creddlgg.cpp index 0394234d26..b290670869 100644 --- a/src/generic/creddlgg.cpp +++ b/src/generic/creddlgg.cpp @@ -10,10 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - #if wxUSE_CREDENTIALDLG #ifndef WX_PRECOMP diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 71dd0f9864..baab5ce47b 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -10,10 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#if defined(__BORLANDC__) -#pragma hdrstop -#endif - #include "wx/webrequest.h" #if wxUSE_WEBREQUEST_WINHTTP diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 7996b843e8..15af7ae38b 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -10,10 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#if defined(__BORLANDC__) -#pragma hdrstop -#endif - #include "wx/webrequest.h" #if wxUSE_WEBREQUEST_URLSESSION From 2f77cbcdcd5fc9d10157178c441bda729d696b48 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 13 Dec 2020 17:38:30 +0100 Subject: [PATCH 105/218] Remove accidental empty statement in wxWebRequest curl backend No real changes, just avoid a warning. --- src/common/webrequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 7697ca5635..27a425613d 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -121,7 +121,7 @@ bool wxWebRequest::SetData(const wxSharedPtr& dataStream, const w wxFileOffset wxWebRequest::GetBytesReceived() const { - return m_bytesReceived;; + return m_bytesReceived; } wxFileOffset wxWebRequest::GetBytesExpectedToReceive() const From 889e974700115c782d2af4cb6c34fd3b555a0f14 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 20:45:18 +0100 Subject: [PATCH 106/218] Fix typo in wxWebSessionDelegate name No real changes, just add the missing "a". --- include/wx/osx/webrequest_urlsession.h | 6 +++--- src/osx/webrequest_urlsession.mm | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/wx/osx/webrequest_urlsession.h b/include/wx/osx/webrequest_urlsession.h index 1e284885c1..06745fb9a4 100644 --- a/include/wx/osx/webrequest_urlsession.h +++ b/include/wx/osx/webrequest_urlsession.h @@ -14,7 +14,7 @@ DECLARE_WXCOCOA_OBJC_CLASS(NSURLSession); DECLARE_WXCOCOA_OBJC_CLASS(NSURLSessionTask); -DECLARE_WXCOCOA_OBJC_CLASS(wxWebSessionDelegte); +DECLARE_WXCOCOA_OBJC_CLASS(wxWebSessionDelegate); class wxWebSessionURLSession; class wxWebResponseURLSession; @@ -91,11 +91,11 @@ public: WX_NSURLSession GetSession() { return m_session; } - WX_wxWebSessionDelegte GetDelegate() { return m_delegate; } + WX_wxWebSessionDelegate GetDelegate() { return m_delegate; } private: WX_NSURLSession m_session; - WX_wxWebSessionDelegte m_delegate; + WX_wxWebSessionDelegate m_delegate; wxDECLARE_NO_COPY_CLASS(wxWebSessionURLSession); }; diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 15af7ae38b..84cfcc643e 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -24,7 +24,7 @@ #include "wx/utils.h" #endif -@interface wxWebSessionDelegte : NSObject +@interface wxWebSessionDelegate : NSObject { wxWebSessionURLSession* m_session; NSMapTable* m_requests; @@ -32,7 +32,7 @@ @end -@implementation wxWebSessionDelegte +@implementation wxWebSessionDelegate - initWithSession:(wxWebSessionURLSession*)session { @@ -243,7 +243,7 @@ wxString wxWebResponseURLSession::GetSuggestedFileName() const wxWebSessionURLSession::wxWebSessionURLSession() { - m_delegate = [[wxWebSessionDelegte alloc] initWithSession:this]; + m_delegate = [[wxWebSessionDelegate alloc] initWithSession:this]; m_session = [[NSURLSession sessionWithConfiguration: [NSURLSessionConfiguration defaultSessionConfiguration] From 139db5cc169f6cfd97a039bcd37c0150e8fe8df2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Dec 2020 12:31:07 +0100 Subject: [PATCH 107/218] Fix harmless warning about missing return type in initWithSession: The return type defaults to "id" anyhow, but it's better to specify it explicitly. --- src/osx/webrequest_urlsession.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 84cfcc643e..2fc6ee6e12 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -34,7 +34,7 @@ @implementation wxWebSessionDelegate -- initWithSession:(wxWebSessionURLSession*)session +- (id)initWithSession:(wxWebSessionURLSession*)session { m_session = session; m_requests = [[NSMapTable weakToStrongObjectsMapTable] retain]; From 45757c67280c2e39632e9d0dcb924409d23a1d4e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Dec 2020 15:26:41 +0100 Subject: [PATCH 108/218] Fix harmless warnings about unused Objective C methods parameters Add wxUnusedVar() to suppress them (WXUNUSED() can't be used with Objective C functions). No real changes. --- src/osx/webrequest_urlsession.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 2fc6ee6e12..85dc8b768e 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -64,6 +64,8 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data { + wxUnusedVar(session); + wxWebRequestURLSession* request = [self requestForTask:dataTask]; if (request) static_cast(request->GetResponse())->HandleData(data); @@ -71,6 +73,8 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { + wxUnusedVar(session); + wxWebRequestURLSession* request = [self requestForTask:task]; if (error) request->SetState(wxWebRequest::State_Failed, wxCFStringRefFromGet(error.localizedDescription).AsString()); From 1f504d3c5caf52c0ddcb07ccf100334361e5a791 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sat, 26 Dec 2020 15:54:43 +0100 Subject: [PATCH 109/218] Fix using wxThreadHelper in DLL builds Remove the unnecessary and actually harmful WXDLLIMPEXP_BASE from the declaration of wxThreadHelperThread and wxThreadHelper classes that only have inline methods. --- include/wx/thread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wx/thread.h b/include/wx/thread.h index 5e90bb63ab..78dcc49cb4 100644 --- a/include/wx/thread.h +++ b/include/wx/thread.h @@ -649,7 +649,7 @@ private: // wxThreadHelperThread class // -------------------------- -class WXDLLIMPEXP_BASE wxThreadHelperThread : public wxThread +class wxThreadHelperThread : public wxThread { public: // constructor only creates the C++ thread object and doesn't create (or @@ -677,7 +677,7 @@ private: // derive from it to implement a threading background task in your class. // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxThreadHelper +class wxThreadHelper { private: void KillThread() From 13d0e0a152f08ee60ceadde15886cbadd10837e8 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sat, 26 Dec 2020 15:56:56 +0100 Subject: [PATCH 110/218] Fix linking with libcurl under MSW when using CMake Enable CMP0060 policy to use full path for the library. --- build/cmake/policies.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/cmake/policies.cmake b/build/cmake/policies.cmake index 8935c59ea2..e72c02f2f4 100644 --- a/build/cmake/policies.cmake +++ b/build/cmake/policies.cmake @@ -59,6 +59,11 @@ if(POLICY CMP0054) cmake_policy(SET CMP0054 NEW) endif() +if(POLICY CMP0060) + # Link libraries by full path even in implicit directories. + cmake_policy(SET CMP0060 NEW) +endif() + if(POLICY CMP0067) # Honor language standard in try_compile() source-file signature. cmake_policy(SET CMP0067 NEW) From 6a064c85d4a7115a6ae7f80eb02a6f17c1328718 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Dec 2020 16:00:03 +0100 Subject: [PATCH 111/218] Compile even less code when wxUSE_WEBREQUEST==0 in the test Move the check slightly higher, there is no need to include the headers if we're not going to compile any tests anyhow. --- tests/net/webrequest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 657e87cb04..961b8a1864 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -21,6 +21,8 @@ #include "wx/wx.h" #endif // WX_PRECOMP +#if wxUSE_WEBREQUEST + #include "wx/webrequest.h" #include "wx/filename.h" #include "wx/wfstream.h" @@ -34,8 +36,6 @@ // an environment variable, e.g.: // WX_TEST_WEBREQUEST_URL=https://httpbin.org -#if wxUSE_WEBREQUEST - class RequestFixture { public: From 8b632bb892d984a37efa5b6c14c2cdec7c412bcf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Dec 2020 16:43:03 +0100 Subject: [PATCH 112/218] Enable wxWebRequest tests by default Don't require WX_TEST_WEBREQUEST_URL environment variable to be set, but only allow defining it to override the default https://httpbin.org value or to disable the tests by setting it to 0. --- tests/net/webrequest.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 961b8a1864..6d8d51a178 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -27,14 +27,11 @@ #include "wx/filename.h" #include "wx/wfstream.h" -// This test requires the URL to an httpbin instance. -// httpbin is a HTTP Request & Response Service available at: -// https://httpbin.org -// It can also be run locally via a simple docker run -// -// For this test to run the the base URL has to be specified with -// an environment variable, e.g.: -// WX_TEST_WEBREQUEST_URL=https://httpbin.org +// This test uses https://httpbin.org by default, but this can be overridden by +// setting WX_TEST_WEBREQUEST_URL, e.g. when running httpbin locally in a +// docker container. This variable can also be set to a special value "0" to +// disable running the test entirely. +static const char* WX_TEST_WEBREQUEST_URL_DEFAULT = "https://httpbin.org"; class RequestFixture { @@ -45,10 +42,16 @@ public: dataSize = 0; } + bool InitBaseURL() + { + if ( !wxGetEnv("WX_TEST_WEBREQUEST_URL", &baseURL) ) + baseURL = WX_TEST_WEBREQUEST_URL_DEFAULT; + + return baseURL != "0"; + } + void Create(const wxString& subURL) { - wxString baseURL; - wxGetEnv("WX_TEST_WEBREQUEST_URL", &baseURL); CreateAbs(baseURL + subURL); } @@ -99,21 +102,18 @@ public: REQUIRE( request->GetResponse()->GetStatus() == requiredStatus ); } + wxString baseURL; wxEventLoop loop; wxObjectDataPtr request; wxInt64 expectedFileSize; wxInt64 dataSize; }; -TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][.]") +TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") { - wxString baseURL; - if ( !wxGetEnv("WX_TEST_WEBREQUEST_URL", &baseURL) ) - { - WARN("Skipping WebRequest test because required WX_TEST_WEBREQUEST_URL" - " environment variable is not defined."); + // Skip the test entirely if disabled. + if ( !InitBaseURL() ) return; - } SECTION("GET 64kb to memory") { @@ -209,7 +209,7 @@ WXDLLIMPEXP_NET wxString SplitParameters(const wxString& s, wxWebRequestHeaderMap& parameters); } -TEST_CASE("WebRequestUtils", "[net]") +TEST_CASE("WebRequestUtils", "[net][webrequest]") { wxString value; wxWebRequestHeaderMap params; From e5bd5a926c778301b305a4f6fc8a1794e65866ba Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Dec 2020 17:00:07 +0100 Subject: [PATCH 113/218] Move backend-specific wxWebRequest headers to private subdirs There is no need to make these headers public and keeping them private will allow making backwards-incompatible changes to them in the future. --- Makefile.in | 2 -- build/bakefiles/files.bkl | 1 - build/cmake/files.cmake | 1 - build/files | 5 ----- build/msw/wx_net.vcxproj | 2 -- build/msw/wx_net.vcxproj.filters | 6 ------ build/msw/wx_vc7_net.vcproj | 3 --- build/msw/wx_vc8_net.vcproj | 4 ---- build/msw/wx_vc9_net.vcproj | 4 ---- include/wx/msw/{ => private}/webrequest_winhttp.h | 0 include/wx/osx/{ => private}/webrequest_urlsession.h | 0 include/wx/{ => private}/webrequest_curl.h | 0 src/common/webrequest.cpp | 6 +++--- src/common/webrequest_curl.cpp | 2 +- src/msw/webrequest_winhttp.cpp | 2 +- src/osx/webrequest_urlsession.mm | 2 +- 16 files changed, 6 insertions(+), 34 deletions(-) rename include/wx/msw/{ => private}/webrequest_winhttp.h (100%) rename include/wx/osx/{ => private}/webrequest_urlsession.h (100%) rename include/wx/{ => private}/webrequest_curl.h (100%) diff --git a/Makefile.in b/Makefile.in index fcc4b8ea56..4b27ee3aae 100644 --- a/Makefile.in +++ b/Makefile.in @@ -567,7 +567,6 @@ ALL_BASE_HEADERS = \ wx/socket.h \ wx/url.h \ wx/webrequest.h \ - wx/webrequest_curl.h \ wx/xml/xml.h \ wx/xtixml.h ALL_HEADERS = \ @@ -788,7 +787,6 @@ ALL_PORTS_BASE_HEADERS = \ wx/socket.h \ wx/url.h \ wx/webrequest.h \ - wx/webrequest_curl.h \ wx/xml/xml.h \ wx/xtixml.h ALL_BASE_SOURCES = \ diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 14234f140d..9e13a46f20 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -789,7 +789,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/socket.h wx/url.h wx/webrequest.h - wx/webrequest_curl.h diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake index bc6d240fa3..b9c3e24629 100644 --- a/build/cmake/files.cmake +++ b/build/cmake/files.cmake @@ -705,7 +705,6 @@ set(NET_CMN_HDR wx/socket.h wx/url.h wx/webrequest.h - wx/webrequest_curl.h ) set(QA_SRC diff --git a/build/files b/build/files index 27071d78f6..08a035fc4c 100644 --- a/build/files +++ b/build/files @@ -679,15 +679,11 @@ NET_UNIX_SRC = NET_OSX_SRC = src/osx/core/sockosx.cpp src/osx/webrequest_urlsession.mm -NET_OSX_HDR = - wx/osx/webrequest_urlsession.h NET_WIN32_SRC = src/msw/sockmsw.cpp src/msw/urlmsw.cpp src/msw/webrequest_winhttp.cpp -NET_WIN32_HDR = - wx/msw/webrequest_winhttp.h NET_CMN_SRC = src/common/fs_inet.cpp @@ -715,7 +711,6 @@ NET_CMN_HDR = wx/socket.h wx/url.h wx/webrequest.h - wx/webrequest_curl.h # wxQA (non GUI library) diff --git a/build/msw/wx_net.vcxproj b/build/msw/wx_net.vcxproj index 4c2eb69153..7f36d05990 100644 --- a/build/msw/wx_net.vcxproj +++ b/build/msw/wx_net.vcxproj @@ -513,8 +513,6 @@ - - diff --git a/build/msw/wx_net.vcxproj.filters b/build/msw/wx_net.vcxproj.filters index d7cf069b48..2300c44998 100644 --- a/build/msw/wx_net.vcxproj.filters +++ b/build/msw/wx_net.vcxproj.filters @@ -76,9 +76,6 @@ Common Headers - - MSW Headers - Common Headers @@ -112,9 +109,6 @@ Common Headers - - Common Headers - diff --git a/build/msw/wx_vc7_net.vcproj b/build/msw/wx_vc7_net.vcproj index 0f2c913610..4ba46bc2f9 100644 --- a/build/msw/wx_vc7_net.vcproj +++ b/build/msw/wx_vc7_net.vcproj @@ -497,9 +497,6 @@ - - diff --git a/build/msw/wx_vc8_net.vcproj b/build/msw/wx_vc8_net.vcproj index 86c44ff5c6..f6590e3b87 100644 --- a/build/msw/wx_vc8_net.vcproj +++ b/build/msw/wx_vc8_net.vcproj @@ -1165,10 +1165,6 @@ RelativePath="..\..\include\wx\webrequest.h" > - - diff --git a/build/msw/wx_vc9_net.vcproj b/build/msw/wx_vc9_net.vcproj index 3dad3b6e8a..65e461df65 100644 --- a/build/msw/wx_vc9_net.vcproj +++ b/build/msw/wx_vc9_net.vcproj @@ -1161,10 +1161,6 @@ RelativePath="..\..\include\wx\webrequest.h" > - - diff --git a/include/wx/msw/webrequest_winhttp.h b/include/wx/msw/private/webrequest_winhttp.h similarity index 100% rename from include/wx/msw/webrequest_winhttp.h rename to include/wx/msw/private/webrequest_winhttp.h diff --git a/include/wx/osx/webrequest_urlsession.h b/include/wx/osx/private/webrequest_urlsession.h similarity index 100% rename from include/wx/osx/webrequest_urlsession.h rename to include/wx/osx/private/webrequest_urlsession.h diff --git a/include/wx/webrequest_curl.h b/include/wx/private/webrequest_curl.h similarity index 100% rename from include/wx/webrequest_curl.h rename to include/wx/private/webrequest_curl.h diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 27a425613d..ecd4e4d7b5 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -28,13 +28,13 @@ #endif #if wxUSE_WEBREQUEST_WINHTTP -#include "wx/msw/webrequest_winhttp.h" +#include "wx/msw/private/webrequest_winhttp.h" #endif #if wxUSE_WEBREQUEST_URLSESSION -#include "wx/osx/webrequest_urlsession.h" +#include "wx/osx/private/webrequest_urlsession.h" #endif #if wxUSE_WEBREQUEST_CURL -#include "wx/webrequest_curl.h" +#include "wx/private/webrequest_curl.h" #endif extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[] = "wxWebSessionBackendWinHTTP"; diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 7fe9a90ac5..68c2cff8b1 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -14,7 +14,7 @@ #if wxUSE_WEBREQUEST_CURL -#include "wx/webrequest_curl.h" +#include "wx/private/webrequest_curl.h" #ifndef WX_PRECOMP #include "wx/log.h" diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index baab5ce47b..86ef8fc003 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -16,7 +16,7 @@ #include "wx/mstream.h" #include "wx/uri.h" -#include "wx/msw/webrequest_winhttp.h" +#include "wx/msw/private/webrequest_winhttp.h" #ifndef WX_PRECOMP #include "wx/log.h" diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 85dc8b768e..b42b7f858f 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -16,7 +16,7 @@ #import -#include "wx/osx/webrequest_urlsession.h" +#include "wx/osx/private/webrequest_urlsession.h" #include "wx/osx/private.h" #ifndef WX_PRECOMP From 71d5729171dbba04c60f04556aae52d18a831fda Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 Dec 2020 00:40:16 +0100 Subject: [PATCH 114/218] Make wxWebSessionFactory private Having wxWebSessionFactory part of the public API implies keeping compatibility with the possible ways of implementing it which is too restrictive for no good reason, so move this class to the private header and don't document it nor wxWebSession::RegisterFactory() (which is now private). --- include/wx/msw/private/webrequest_winhttp.h | 2 ++ .../wx/osx/private/webrequest_urlsession.h | 2 ++ include/wx/private/webrequest.h | 25 ++++++++++++++ include/wx/private/webrequest_curl.h | 2 ++ include/wx/webrequest.h | 15 +++----- interface/wx/webrequest.h | 34 ------------------- src/common/webrequest.cpp | 2 ++ 7 files changed, 37 insertions(+), 45 deletions(-) create mode 100644 include/wx/private/webrequest.h diff --git a/include/wx/msw/private/webrequest_winhttp.h b/include/wx/msw/private/webrequest_winhttp.h index 7dd322eb3f..58bfcc52bd 100644 --- a/include/wx/msw/private/webrequest_winhttp.h +++ b/include/wx/msw/private/webrequest_winhttp.h @@ -10,6 +10,8 @@ #ifndef _WX_MSW_WEBREQUEST_WINHTTP_H #define _WX_MSW_WEBREQUEST_WINHTTP_H +#include "wx/private/webrequest.h" + #include "wx/msw/wrapwin.h" #include #include "wx/buffer.h" diff --git a/include/wx/osx/private/webrequest_urlsession.h b/include/wx/osx/private/webrequest_urlsession.h index 06745fb9a4..4d6f3721fa 100644 --- a/include/wx/osx/private/webrequest_urlsession.h +++ b/include/wx/osx/private/webrequest_urlsession.h @@ -12,6 +12,8 @@ #if wxUSE_WEBREQUEST_URLSESSION +#include "wx/private/webrequest.h" + DECLARE_WXCOCOA_OBJC_CLASS(NSURLSession); DECLARE_WXCOCOA_OBJC_CLASS(NSURLSessionTask); DECLARE_WXCOCOA_OBJC_CLASS(wxWebSessionDelegate); diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h new file mode 100644 index 0000000000..c4746f7fe9 --- /dev/null +++ b/include/wx/private/webrequest.h @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/private/webrequest.h +// Purpose: wxWebRequest implementation classes +// Author: Vadim Zeitlin +// Created: 2020-12-26 +// Copyright: (c) 2020 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_PRIVATE_WEBREQUEST_H_ +#define _WX_PRIVATE_WEBREQUEST_H_ + +// ---------------------------------------------------------------------------- +// wxWebSessionFactory +// ---------------------------------------------------------------------------- + +class wxWebSessionFactory +{ +public: + virtual wxWebSession* Create() = 0; + + virtual ~wxWebSessionFactory() { } +}; + +#endif // _WX_PRIVATE_WEBREQUEST_H_ diff --git a/include/wx/private/webrequest_curl.h b/include/wx/private/webrequest_curl.h index f3659866db..c88e1d16db 100644 --- a/include/wx/private/webrequest_curl.h +++ b/include/wx/private/webrequest_curl.h @@ -12,6 +12,8 @@ #if wxUSE_WEBREQUEST_CURL +#include "wx/private/webrequest.h" + #include "wx/thread.h" #include "wx/vector.h" diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 7cc8417bdc..8195d99a91 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -26,6 +26,7 @@ class wxWebResponse; class wxWebSession; +class wxWebSessionFactory; class wxWebAuthChallenge; WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); @@ -195,14 +196,6 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebAuthChallenge); }; -class WXDLLIMPEXP_NET wxWebSessionFactory -{ -public: - virtual wxWebSession* Create() = 0; - - virtual ~wxWebSessionFactory() { } -}; - extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[]; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[]; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendURLSession[]; @@ -228,9 +221,6 @@ public: static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); - static void RegisterFactory(const wxString& backend, - const wxSharedPtr& factory); - static bool IsBackendAvailable(const wxString& backend); protected: @@ -239,6 +229,9 @@ protected: const wxWebRequestHeaderMap& GetHeaders() const { return m_headers; } private: + static void RegisterFactory(const wxString& backend, + const wxSharedPtr& factory); + // Make it a friend to allow accessing our m_headers. friend class wxWebRequest; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 8172458560..76ea78de21 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -507,17 +507,6 @@ public: */ static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); - /** - Allows the registering of new backend for wxWebSession. - - backend can be used as an argument to New(). - - @param backend The name for the new backend to be registered under - @param factory A shared pointer to the factory which creates the appropriate backend. - */ - static void RegisterFactory(const wxString& backend, - const wxSharedPtr& factory); - /** Allows to check if the specified backend is available at runtime. @@ -527,29 +516,6 @@ public: static bool IsBackendAvailable(const wxString& backend); }; -/** - @class wxWebSessionFactory - - An abstract factory class for creation wxWebSession backends. - - Each implementation of wxWebSession should have its own factory. - - @since 3.1.5 - - @library{wxnet} - @category{net} - - @see wxWebSession -*/ -class wxWebSessionFactory -{ -public: - /** - Creates a new web session object. - */ - virtual wxWebSession* Create(); -}; - /** @class wxWebRequestEvent diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index ecd4e4d7b5..3f6b02cdb1 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -27,6 +27,8 @@ #include "wx/utils.h" #endif +#include "wx/private/webrequest.h" + #if wxUSE_WEBREQUEST_WINHTTP #include "wx/msw/private/webrequest_winhttp.h" #endif From be5f1344b6fa1f4645566174a767a58fc0a0aca6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 Dec 2020 13:01:49 +0100 Subject: [PATCH 115/218] Add some comments describing wxWebSession methods No real changes. --- include/wx/webrequest.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 8195d99a91..b6b9cae8f9 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -204,6 +204,16 @@ extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[]; class WXDLLIMPEXP_NET wxWebSession { public: + // Objects of this class can't be created directly, use the following + // factory functions to get access to them. + static wxWebSession& GetDefault(); + + static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); + + // Can be used to check if the given backend is available without actually + // creating a session using it. + static bool IsBackendAvailable(const wxString& backend); + virtual ~wxWebSession() { } virtual wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) = 0; @@ -217,12 +227,6 @@ public: wxString GetTempDir() const; - static wxWebSession& GetDefault(); - - static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); - - static bool IsBackendAvailable(const wxString& backend); - protected: wxWebSession(); From 04bbb844aede17328df80605a05ac98e23fa6f0d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 30 Dec 2020 01:02:47 +0100 Subject: [PATCH 116/218] Allow constructing/assigning wxObjectDataPtr from compatible type Generalize copy ctor and assignment operators to allow implicit conversions from wxObjectDataPtr to wxObjectDataPtr if D is implicitly convertible to B (e.g. if B is the base class and D is a class derived from it). This makes wxObjectDataPtr<> more like standard smart pointer classes and more useful. --- include/wx/object.h | 20 ++++++++++++++++++++ interface/wx/object.h | 10 ++++++++++ 2 files changed, 30 insertions(+) diff --git a/include/wx/object.h b/include/wx/object.h index dd1e2fb927..e4baee1396 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -278,6 +278,15 @@ public: m_ptr->IncRef(); } + // generalized copy ctor: U must be convertible to T + template + wxObjectDataPtr(const wxObjectDataPtr &tocopy) + : m_ptr(tocopy.get()) + { + if (m_ptr) + m_ptr->IncRef(); + } + ~wxObjectDataPtr() { if (m_ptr) @@ -330,6 +339,17 @@ public: return *this; } + template + wxObjectDataPtr& operator=(const wxObjectDataPtr &tocopy) + { + if (m_ptr) + m_ptr->DecRef(); + m_ptr = tocopy.get(); + if (m_ptr) + m_ptr->IncRef(); + return *this; + } + wxObjectDataPtr& operator=(T *ptr) { if (m_ptr) diff --git a/interface/wx/object.h b/interface/wx/object.h index 16d4905e74..dc290db79c 100644 --- a/interface/wx/object.h +++ b/interface/wx/object.h @@ -585,11 +585,17 @@ public: */ wxObjectDataPtr(T* ptr = NULL); + //@{ /** This copy constructor increases the count of the reference counted object to which @a tocopy points and then this class will point to, as well. + + Using @a U different from @c T is only supported since wxWidgets 3.1.5. */ + template + wxObjectDataPtr(const wxObjectDataPtr& tocopy); wxObjectDataPtr(const wxObjectDataPtr& tocopy); + //@} /** @@ -649,7 +655,11 @@ public: //@{ /** Assignment operator. + + Using @a U different from @c T is only supported since wxWidgets 3.1.5. */ + template + wxObjectDataPtr& operator=(const wxObjectDataPtr& tocopy); wxObjectDataPtr& operator=(const wxObjectDataPtr& tocopy); wxObjectDataPtr& operator=(T* ptr); //@} From 50424cba2cc8a195938b01a59234ff0e5d292f19 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 30 Dec 2020 01:10:02 +0100 Subject: [PATCH 117/218] Change wxWebRequest and related objects to hide ref counting Don't force the application code to deal with wxObjectDataPtr<> or, worse, calling {Inc,Dec}Ref() manually by hiding it inside the wx objects themselves and giving the value-like semantics to them. There should be no real changes in the behaviour, but the API does change significantly. Notably, wxWebRequest is not a wxEvtHandler itself any longer, as this would be incompatible with the value semantics, and an event handler needs to be specified when creating it, so that it could be notified about the request state changes. --- include/wx/msw/private/webrequest_winhttp.h | 38 +- .../wx/osx/private/webrequest_urlsession.h | 39 +- include/wx/private/webrequest.h | 205 ++++++- include/wx/private/webrequest_curl.h | 45 +- include/wx/webrequest.h | 276 +++++----- interface/wx/webrequest.h | 120 +++- samples/webrequest/webrequest.cpp | 49 +- src/common/webrequest.cpp | 512 ++++++++++++++++-- src/common/webrequest_curl.cpp | 51 +- src/msw/webrequest_winhttp.cpp | 50 +- src/osx/webrequest_urlsession.mm | 40 +- tests/net/webrequest.cpp | 60 +- 12 files changed, 1100 insertions(+), 385 deletions(-) diff --git a/include/wx/msw/private/webrequest_winhttp.h b/include/wx/msw/private/webrequest_winhttp.h index 58bfcc52bd..ad21393ec1 100644 --- a/include/wx/msw/private/webrequest_winhttp.h +++ b/include/wx/msw/private/webrequest_winhttp.h @@ -19,7 +19,7 @@ class wxWebSessionWinHTTP; class wxWebRequestWinHTTP; -class WXDLLIMPEXP_NET wxWebResponseWinHTTP : public wxWebResponse +class wxWebResponseWinHTTP : public wxWebResponseImpl { public: wxWebResponseWinHTTP(wxWebRequestWinHTTP& request); @@ -45,10 +45,11 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebResponseWinHTTP); }; -class WXDLLIMPEXP_NET wxWebAuthChallengeWinHTTP : public wxWebAuthChallenge +class wxWebAuthChallengeWinHTTP : public wxWebAuthChallengeImpl { public: - wxWebAuthChallengeWinHTTP(Source source, wxWebRequestWinHTTP& request); + wxWebAuthChallengeWinHTTP(wxWebAuthChallenge::Source source, + wxWebRequestWinHTTP& request); bool Init(); @@ -62,10 +63,14 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebAuthChallengeWinHTTP); }; -class WXDLLIMPEXP_NET wxWebRequestWinHTTP : public wxWebRequest +class wxWebRequestWinHTTP : public wxWebRequestImpl { public: - wxWebRequestWinHTTP(int id, wxWebSessionWinHTTP& session, const wxString& url); + wxWebRequestWinHTTP(wxWebSession& session, + wxWebSessionWinHTTP& sessionWinHTTP, + wxEvtHandler* handler, + const wxString& url, + int id); ~wxWebRequestWinHTTP(); @@ -73,9 +78,11 @@ public: void Cancel() wxOVERRIDE; - wxWebResponse* GetResponse() const wxOVERRIDE; + wxWebResponseImplPtr GetResponse() const wxOVERRIDE + { return m_response; } - wxWebAuthChallenge* GetAuthChallenge() const wxOVERRIDE { return m_authChallenge.get(); } + wxWebAuthChallengeImplPtr GetAuthChallenge() const wxOVERRIDE + { return m_authChallenge; } wxFileOffset GetBytesSent() const wxOVERRIDE { return m_dataWritten; } @@ -87,11 +94,12 @@ public: HINTERNET GetHandle() const { return m_request; } private: + wxWebSessionWinHTTP& m_sessionWinHTTP; wxString m_url; HINTERNET m_connect; HINTERNET m_request; - wxScopedPtr m_response; - wxScopedPtr m_authChallenge; + wxObjectDataPtr m_response; + wxObjectDataPtr m_authChallenge; wxMemoryBuffer m_dataWriteBuffer; wxFileOffset m_dataWritten; @@ -108,14 +116,18 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebRequestWinHTTP); }; -class WXDLLIMPEXP_NET wxWebSessionWinHTTP : public wxWebSession +class wxWebSessionWinHTTP : public wxWebSessionImpl { public: wxWebSessionWinHTTP(); ~wxWebSessionWinHTTP(); - wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + wxWebRequestImplPtr + CreateRequest(wxWebSession& session, + wxEvtHandler* handler, + const wxString& url, + int id) wxOVERRIDE; wxVersionInfo GetLibraryVersionInfo() wxOVERRIDE; @@ -130,10 +142,10 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebSessionWinHTTP); }; -class WXDLLIMPEXP_NET wxWebSessionFactoryWinHTTP : public wxWebSessionFactory +class wxWebSessionFactoryWinHTTP : public wxWebSessionFactory { public: - wxWebSession* Create() wxOVERRIDE + wxWebSessionImpl* Create() wxOVERRIDE { return new wxWebSessionWinHTTP(); } }; diff --git a/include/wx/osx/private/webrequest_urlsession.h b/include/wx/osx/private/webrequest_urlsession.h index 4d6f3721fa..770b42d305 100644 --- a/include/wx/osx/private/webrequest_urlsession.h +++ b/include/wx/osx/private/webrequest_urlsession.h @@ -19,12 +19,13 @@ DECLARE_WXCOCOA_OBJC_CLASS(NSURLSessionTask); DECLARE_WXCOCOA_OBJC_CLASS(wxWebSessionDelegate); class wxWebSessionURLSession; +class wxWebRequestURLSession; class wxWebResponseURLSession; -class WXDLLIMPEXP_NET wxWebResponseURLSession : public wxWebResponse +class wxWebResponseURLSession : public wxWebResponseImpl { public: - wxWebResponseURLSession(wxWebRequest& request, WX_NSURLSessionTask task); + wxWebResponseURLSession(wxWebRequestURLSession& request, WX_NSURLSessionTask task); ~wxWebResponseURLSession(); @@ -44,12 +45,18 @@ public: private: WX_NSURLSessionTask m_task; + + wxDECLARE_NO_COPY_CLASS(wxWebResponseURLSession); }; -class WXDLLIMPEXP_NET wxWebRequestURLSession : public wxWebRequest +class wxWebRequestURLSession : public wxWebRequestImpl { public: - wxWebRequestURLSession(wxWebSessionURLSession& session, const wxString& url, int id); + wxWebRequestURLSession(wxWebSession& session, + wxWebSessionURLSession& sessionImpl, + wxEvtHandler* handler, + const wxString& url, + int winid); ~wxWebRequestURLSession(); @@ -57,10 +64,10 @@ public: void Cancel() wxOVERRIDE; - wxWebResponse* GetResponse() const wxOVERRIDE - { return m_response.get(); } + wxWebResponseImplPtr GetResponse() const wxOVERRIDE + { return m_response; } - wxWebAuthChallenge* GetAuthChallenge() const wxOVERRIDE; + wxWebAuthChallengeImplPtr GetAuthChallenge() const wxOVERRIDE; wxFileOffset GetBytesSent() const wxOVERRIDE; @@ -72,22 +79,30 @@ public: void HandleCompletion(); + wxWebResponseURLSession* GetResponseImplPtr() const + { return m_response.get(); } + private: + wxWebSessionURLSession& m_sessionImpl; wxString m_url; WX_NSURLSessionTask m_task; - wxScopedPtr m_response; + wxObjectDataPtr m_response; wxDECLARE_NO_COPY_CLASS(wxWebRequestURLSession); }; -class WXDLLIMPEXP_NET wxWebSessionURLSession : public wxWebSession +class wxWebSessionURLSession : public wxWebSessionImpl { public: wxWebSessionURLSession(); ~wxWebSessionURLSession(); - wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + wxWebRequestImplPtr + CreateRequest(wxWebSession& session, + wxEvtHandler* handler, + const wxString& url, + int winid = wxID_ANY) wxOVERRIDE; wxVersionInfo GetLibraryVersionInfo() wxOVERRIDE; @@ -102,10 +117,10 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebSessionURLSession); }; -class WXDLLIMPEXP_NET wxWebSessionFactoryURLSession : public wxWebSessionFactory +class wxWebSessionFactoryURLSession : public wxWebSessionFactory { public: - wxWebSession* Create() wxOVERRIDE + wxWebSessionImpl* Create() wxOVERRIDE { return new wxWebSessionURLSession(); } }; diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index c4746f7fe9..e77858ef57 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -10,6 +10,170 @@ #ifndef _WX_PRIVATE_WEBREQUEST_H_ #define _WX_PRIVATE_WEBREQUEST_H_ +#include "wx/ffile.h" +#include "wx/hashmap.h" +#include "wx/scopedptr.h" + +WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); + +// ---------------------------------------------------------------------------- +// wxWebAuthChallengeImpl +// ---------------------------------------------------------------------------- + +class wxWebAuthChallengeImpl : public wxRefCounter +{ +public: + virtual ~wxWebAuthChallengeImpl() { } + + wxWebAuthChallenge::Source GetSource() const { return m_source; } + + virtual void + SetCredentials(const wxString& user, const wxString& password) = 0; + +protected: + explicit wxWebAuthChallengeImpl(wxWebAuthChallenge::Source source) + : m_source(source) { } + +private: + const wxWebAuthChallenge::Source m_source; + + wxDECLARE_NO_COPY_CLASS(wxWebAuthChallengeImpl); +}; + +// ---------------------------------------------------------------------------- +// wxWebRequestImpl +// ---------------------------------------------------------------------------- + +class wxWebRequestImpl : public wxRefCounter +{ +public: + virtual ~wxWebRequestImpl() { } + + void SetHeader(const wxString& name, const wxString& value) + { m_headers[name] = value; } + + void SetMethod(const wxString& method) { m_method = method; } + + void SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv = wxConvUTF8); + + bool SetData(const wxSharedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); + + void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } + + void SetStorage(wxWebRequest::Storage storage) { m_storage = storage; } + + wxWebRequest::Storage GetStorage() const { return m_storage; } + + virtual void Start() = 0; + + virtual void Cancel() = 0; + + virtual wxWebResponseImplPtr GetResponse() const = 0; + + virtual wxWebAuthChallengeImplPtr GetAuthChallenge() const = 0; + + int GetId() const { return m_id; } + + wxWebSession& GetSession() const { return m_session; } + + wxWebRequest::State GetState() const { return m_state; } + + virtual wxFileOffset GetBytesSent() const = 0; + + virtual wxFileOffset GetBytesExpectedToSend() const = 0; + + virtual wxFileOffset GetBytesReceived() const; + + virtual wxFileOffset GetBytesExpectedToReceive() const; + + void SetState(wxWebRequest::State state, const wxString& failMsg = wxString()); + + void ReportDataReceived(size_t sizeReceived); + + wxEvtHandler* GetHandler() const { return m_handler; } + + void ProcessStateEvent(wxWebRequest::State state, const wxString& failMsg); + +protected: + wxString m_method; + wxWebRequest::Storage m_storage; + wxWebRequestHeaderMap m_headers; + wxFileOffset m_dataSize; + wxSharedPtr m_dataStream; + + wxWebRequestImpl(wxWebSession& session, wxEvtHandler* handler, int id); + + bool CheckServerStatus(); + + static bool IsActiveState(wxWebRequest::State state); + +private: + wxWebSession& m_session; + wxEvtHandler* const m_handler; + const int m_id; + wxWebRequest::State m_state; + bool m_ignoreServerErrorStatus; + wxFileOffset m_bytesReceived; + wxCharBuffer m_dataText; + + wxDECLARE_NO_COPY_CLASS(wxWebRequestImpl); +}; + +// ---------------------------------------------------------------------------- +// wxWebResponseImpl +// ---------------------------------------------------------------------------- + +class wxWebResponseImpl : public wxRefCounter +{ +public: + virtual ~wxWebResponseImpl(); + + virtual wxInt64 GetContentLength() const = 0; + + virtual wxString GetURL() const = 0; + + virtual wxString GetHeader(const wxString& name) const = 0; + + virtual wxString GetMimeType() const; + + virtual int GetStatus() const = 0; + + virtual wxString GetStatusText() const = 0; + + virtual wxInputStream* GetStream() const; + + virtual wxString GetSuggestedFileName() const; + + wxString AsString() const; + + virtual wxString GetFileName() const; + +protected: + wxWebRequestImpl& m_request; + size_t m_readSize; + + explicit wxWebResponseImpl(wxWebRequestImpl& request); + + // Called from derived class ctor to finish initialization which can't be + // performed in ctor itself as it needs to use pure virtual method. + void Init(); + + void* GetDataBuffer(size_t sizeNeeded); + + void ReportDataReceived(size_t sizeReceived); + +private: + // Called by wxWebRequestImpl only. + friend class wxWebRequestImpl; + void Finalize(); + + wxMemoryBuffer m_readBuffer; + mutable wxFFile m_file; + mutable wxScopedPtr m_stream; + + wxDECLARE_NO_COPY_CLASS(wxWebResponseImpl); +}; + // ---------------------------------------------------------------------------- // wxWebSessionFactory // ---------------------------------------------------------------------------- @@ -17,9 +181,48 @@ class wxWebSessionFactory { public: - virtual wxWebSession* Create() = 0; + virtual wxWebSessionImpl* Create() = 0; virtual ~wxWebSessionFactory() { } }; +// ---------------------------------------------------------------------------- +// wxWebSessionImpl +// ---------------------------------------------------------------------------- + +class wxWebSessionImpl : public wxRefCounter +{ +public: + virtual ~wxWebSessionImpl() { } + + virtual wxWebRequestImplPtr + CreateRequest(wxWebSession& session, + wxEvtHandler* handler, + const wxString& url, + int id) = 0; + + virtual wxVersionInfo GetLibraryVersionInfo() = 0; + + void SetHeader(const wxString& name, const wxString& value) + { m_headers[name] = value; } + + void SetTempDir(const wxString& dir) { m_tempDir = dir; } + + wxString GetTempDir() const; + + const wxWebRequestHeaderMap& GetHeaders() const { return m_headers; } + +protected: + wxWebSessionImpl(); + +private: + // Make it a friend to allow accessing our m_headers. + friend class wxWebRequest; + + wxWebRequestHeaderMap m_headers; + wxString m_tempDir; + + wxDECLARE_NO_COPY_CLASS(wxWebSessionImpl); +}; + #endif // _WX_PRIVATE_WEBREQUEST_H_ diff --git a/include/wx/private/webrequest_curl.h b/include/wx/private/webrequest_curl.h index c88e1d16db..42669a5530 100644 --- a/include/wx/private/webrequest_curl.h +++ b/include/wx/private/webrequest_curl.h @@ -19,13 +19,15 @@ #include "curl/curl.h" -class wxWebResponseCURL; class wxWebRequestCURL; +class wxWebResponseCURL; +class wxWebSessionCURL; -class WXDLLIMPEXP_NET wxWebAuthChallengeCURL : public wxWebAuthChallenge +class wxWebAuthChallengeCURL : public wxWebAuthChallengeImpl { public: - wxWebAuthChallengeCURL(Source source, wxWebRequestCURL& request); + wxWebAuthChallengeCURL(wxWebAuthChallenge::Source source, + wxWebRequestCURL& request); bool Init(); @@ -37,10 +39,14 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebAuthChallengeCURL); }; -class WXDLLIMPEXP_NET wxWebRequestCURL : public wxWebRequest +class wxWebRequestCURL : public wxWebRequestImpl { public: - wxWebRequestCURL(wxWebSession& session, int id, const wxString& url); + wxWebRequestCURL(wxWebSession& session, + wxWebSessionCURL& sessionImpl, + wxEvtHandler* handler, + const wxString& url, + int id); ~wxWebRequestCURL(); @@ -48,10 +54,11 @@ public: void Cancel() wxOVERRIDE; - wxWebResponse* GetResponse() const wxOVERRIDE; + wxWebResponseImplPtr GetResponse() const wxOVERRIDE + { return m_response; } - wxWebAuthChallenge* GetAuthChallenge() const wxOVERRIDE - { return m_authChallenge.get(); } + wxWebAuthChallengeImplPtr GetAuthChallenge() const wxOVERRIDE + { return m_authChallenge; } wxFileOffset GetBytesSent() const wxOVERRIDE; @@ -68,11 +75,13 @@ public: size_t ReadData(char* buffer, size_t size); private: + wxWebSessionCURL& m_sessionImpl; + CURL* m_handle; char m_errorBuffer[CURL_ERROR_SIZE]; struct curl_slist *m_headerList; - wxScopedPtr m_response; - wxScopedPtr m_authChallenge; + wxObjectDataPtr m_response; + wxObjectDataPtr m_authChallenge; wxFileOffset m_bytesSent; void DestroyHeaderList(); @@ -80,10 +89,10 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebRequestCURL); }; -class WXDLLIMPEXP_NET wxWebResponseCURL : public wxWebResponse +class wxWebResponseCURL : public wxWebResponseImpl { public: - wxWebResponseCURL(wxWebRequest& request); + explicit wxWebResponseCURL(wxWebRequestCURL& request); wxInt64 GetContentLength() const wxOVERRIDE; @@ -109,14 +118,18 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebResponseCURL); }; -class WXDLLIMPEXP_NET wxWebSessionCURL : public wxWebSession, private wxThreadHelper +class wxWebSessionCURL : public wxWebSessionImpl, private wxThreadHelper { public: wxWebSessionCURL(); ~wxWebSessionCURL(); - wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) wxOVERRIDE; + wxWebRequestImplPtr + CreateRequest(wxWebSession& session, + wxEvtHandler* handler, + const wxString& url, + int id = wxID_ANY) wxOVERRIDE; wxVersionInfo GetLibraryVersionInfo() wxOVERRIDE; @@ -140,10 +153,10 @@ private: wxDECLARE_NO_COPY_CLASS(wxWebSessionCURL); }; -class WXDLLIMPEXP_NET wxWebSessionFactoryCURL : public wxWebSessionFactory +class wxWebSessionFactoryCURL : public wxWebSessionFactory { public: - wxWebSession* Create() wxOVERRIDE + wxWebSessionImpl* Create() wxOVERRIDE { return new wxWebSessionCURL(); } }; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index b6b9cae8f9..0f9da9aa3f 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -15,23 +15,93 @@ #if wxUSE_WEBREQUEST #include "wx/event.h" -#include "wx/ffile.h" -#include "wx/hashmap.h" #include "wx/object.h" -#include "wx/scopedptr.h" #include "wx/sharedptr.h" #include "wx/stream.h" -#include "wx/vector.h" #include "wx/versioninfo.h" class wxWebResponse; class wxWebSession; class wxWebSessionFactory; -class wxWebAuthChallenge; -WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); +class wxWebAuthChallengeImpl; +class wxWebRequestImpl; +class wxWebResponseImpl; +class wxWebSessionImpl; -class WXDLLIMPEXP_NET wxWebRequest : public wxEvtHandler, public wxRefCounter +typedef wxObjectDataPtr wxWebAuthChallengeImplPtr; +typedef wxObjectDataPtr wxWebRequestImplPtr; +typedef wxObjectDataPtr wxWebResponseImplPtr; +typedef wxObjectDataPtr wxWebSessionImplPtr; + +class WXDLLIMPEXP_NET wxWebAuthChallenge +{ +public: + enum Source + { + Source_Server, + Source_Proxy + }; + + wxWebAuthChallenge(); + wxWebAuthChallenge(const wxWebAuthChallenge& other); + wxWebAuthChallenge& operator=(const wxWebAuthChallenge& other); + ~wxWebAuthChallenge(); + + bool IsOk() const { return m_impl.get() != NULL; } + + Source GetSource() const; + + void SetCredentials(const wxString& user, const wxString& password); + +private: + // Ctor is used by wxWebRequest only. + friend class wxWebRequest; + explicit wxWebAuthChallenge(const wxWebAuthChallengeImplPtr& impl); + + wxWebAuthChallengeImplPtr m_impl; +}; + +class WXDLLIMPEXP_NET wxWebResponse +{ +public: + wxWebResponse(); + wxWebResponse(const wxWebResponse& other); + wxWebResponse& operator=(const wxWebResponse& other); + ~wxWebResponse(); + + bool IsOk() const { return m_impl.get() != NULL; } + + wxInt64 GetContentLength() const; + + wxString GetURL() const; + + wxString GetHeader(const wxString& name) const; + + wxString GetMimeType() const; + + int GetStatus() const; + + wxString GetStatusText() const; + + wxInputStream* GetStream() const; + + wxString GetSuggestedFileName() const; + + wxString AsString() const; + + wxString GetFileName() const; + +protected: + // Ctor is used by wxWebRequest and wxWebRequestImpl. + friend class wxWebRequest; + friend class wxWebRequestImpl; + explicit wxWebResponse(const wxWebResponseImplPtr& impl); + + wxWebResponseImplPtr m_impl; +}; + +class WXDLLIMPEXP_NET wxWebRequest { public: enum State @@ -51,149 +121,55 @@ public: Storage_None }; - virtual ~wxWebRequest() { } + wxWebRequest(); + wxWebRequest(const wxWebRequest& other); + wxWebRequest& operator=(const wxWebRequest& other); + ~wxWebRequest(); - virtual void SetHeader(const wxString& name, const wxString& value) - { m_headers[name] = value; } + bool IsOk() const { return m_impl.get() != NULL; } - virtual void SetMethod(const wxString& method) { m_method = method; } + void SetHeader(const wxString& name, const wxString& value); + + void SetMethod(const wxString& method); void SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv = wxConvUTF8); bool SetData(const wxSharedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); - void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } + void SetIgnoreServerErrorStatus(bool ignore); - virtual void SetStorage(Storage storage) { m_storage = storage; } + void SetStorage(Storage storage); - Storage GetStorage() const { return m_storage; } + Storage GetStorage() const; - virtual void Start() = 0; + void Start(); - virtual void Cancel() = 0; + void Cancel(); - virtual wxWebResponse* GetResponse() const = 0; + wxWebResponse GetResponse() const; - virtual wxWebAuthChallenge* GetAuthChallenge() const = 0; + wxWebAuthChallenge GetAuthChallenge() const; - int GetId() const { return m_id; } + int GetId() const; - wxWebSession& GetSession() const { return m_session; } + wxWebSession& GetSession() const; - State GetState() const { return m_state; } + State GetState() const; - virtual wxFileOffset GetBytesSent() const = 0; + wxFileOffset GetBytesSent() const; - virtual wxFileOffset GetBytesExpectedToSend() const = 0; + wxFileOffset GetBytesExpectedToSend() const; - virtual wxFileOffset GetBytesReceived() const; + wxFileOffset GetBytesReceived() const; - virtual wxFileOffset GetBytesExpectedToReceive() const; - - void SetState(State state, const wxString& failMsg = ""); - - void ReportDataReceived(size_t sizeReceived); - -protected: - wxString m_method; - Storage m_storage; - wxWebRequestHeaderMap m_headers; - wxFileOffset m_dataSize; - wxSharedPtr m_dataStream; - - wxWebRequest(wxWebSession& session, int id); - - bool CheckServerStatus(); - - static bool IsActiveState(State state); + wxFileOffset GetBytesExpectedToReceive() const; private: - wxWebSession& m_session; - int m_id; - State m_state; - bool m_ignoreServerErrorStatus; - wxFileOffset m_bytesReceived; - wxCharBuffer m_dataText; + // Ctor is only used by wxWebSession. + friend class wxWebSession; + explicit wxWebRequest(const wxWebRequestImplPtr& impl); - void ProcessStateEvent(State state, const wxString& failMsg); - - wxDECLARE_NO_COPY_CLASS(wxWebRequest); -}; - -class WXDLLIMPEXP_NET wxWebResponse -{ -public: - virtual ~wxWebResponse(); - - virtual wxInt64 GetContentLength() const = 0; - - virtual wxString GetURL() const = 0; - - virtual wxString GetHeader(const wxString& name) const = 0; - - virtual wxString GetMimeType() const; - - virtual int GetStatus() const = 0; - - virtual wxString GetStatusText() const = 0; - - virtual wxInputStream* GetStream() const; - - virtual wxString GetSuggestedFileName() const; - - wxString AsString() const; - - virtual wxString GetFileName() const; - -protected: - wxWebRequest& m_request; - size_t m_readSize; - - wxWebResponse(wxWebRequest& request); - - // Called from derived class ctor to finish initialization which can't be - // performed in ctor itself as it needs to use pure virtual method. - void Init(); - - void* GetDataBuffer(size_t sizeNeeded); - - void ReportDataReceived(size_t sizeReceived); - -private: - // Called by wxWebRequest only. - void Finalize(); - - wxMemoryBuffer m_readBuffer; - mutable wxFFile m_file; - mutable wxScopedPtr m_stream; - - friend class wxWebRequest; - - wxDECLARE_NO_COPY_CLASS(wxWebResponse); -}; - -class WXDLLIMPEXP_NET wxWebAuthChallenge -{ -public: - enum Source - { - Source_Server, - Source_Proxy - }; - - virtual ~wxWebAuthChallenge() { } - - Source GetSource() const { return m_source; } - - virtual void SetCredentials(const wxString& user, const wxString& password) = 0; - -protected: - wxWebAuthChallenge(Source source): m_source(source) { } - -private: - Source m_source; - - wxDECLARE_NO_COPY_CLASS(wxWebAuthChallenge); + wxWebRequestImplPtr m_impl; }; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[]; @@ -204,45 +180,49 @@ extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[]; class WXDLLIMPEXP_NET wxWebSession { public: + // Default ctor creates an invalid session object, only IsOpened() can be + // called on it. + wxWebSession(); + + wxWebSession(const wxWebSession& other); + wxWebSession& operator=(const wxWebSession& other); + ~wxWebSession(); + // Objects of this class can't be created directly, use the following // factory functions to get access to them. static wxWebSession& GetDefault(); - static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); + static wxWebSession New(const wxString& backend = wxWebSessionBackendDefault); // Can be used to check if the given backend is available without actually // creating a session using it. static bool IsBackendAvailable(const wxString& backend); - virtual ~wxWebSession() { } + wxWebRequest + CreateRequest(wxEvtHandler* handler, const wxString& url, int id = wxID_ANY); - virtual wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY) = 0; + wxVersionInfo GetLibraryVersionInfo(); - virtual wxVersionInfo GetLibraryVersionInfo() = 0; - - virtual void SetHeader(const wxString& name, const wxString& value) - { m_headers[name] = value; } - - void SetTempDir(const wxString& dir) { m_tempDir = dir; } + void SetHeader(const wxString& name, const wxString& value); + void SetTempDir(const wxString& dir); wxString GetTempDir() const; -protected: - wxWebSession(); + bool IsOpened() const; - const wxWebRequestHeaderMap& GetHeaders() const { return m_headers; } + void Close(); + + wxWebSessionImpl* GetImpl() const { return m_impl.get(); } private: static void RegisterFactory(const wxString& backend, const wxSharedPtr& factory); - // Make it a friend to allow accessing our m_headers. - friend class wxWebRequest; - - wxWebRequestHeaderMap m_headers; - wxString m_tempDir; - static void InitFactoryMap(); + + explicit wxWebSession(const wxWebSessionImplPtr& impl); + + wxWebSessionImplPtr m_impl; }; class WXDLLIMPEXP_NET wxWebRequestEvent : public wxEvent @@ -251,7 +231,7 @@ public: wxWebRequestEvent(wxEventType type = wxEVT_NULL, int id = wxID_ANY, wxWebRequest::State state = wxWebRequest::State_Idle, - wxWebResponse* response = NULL, + const wxWebResponse& response = wxWebResponse(), const wxString& errorDesc = wxString()) : wxEvent(id, type), m_state(state), m_response(response), m_data(NULL), m_dataSize(0), @@ -260,7 +240,7 @@ public: wxWebRequest::State GetState() const { return m_state; } - wxWebResponse* GetResponse() const { return m_response; } + const wxWebResponse& GetResponse() const { return m_response; } const wxString& GetErrorDescription() const { return m_errorDescription; } @@ -279,7 +259,7 @@ public: private: wxWebRequest::State m_state; - wxWebResponse* const m_response; // non-owning, may be NULL + const wxWebResponse m_response; // may be invalid wxString m_responseFileName; const void* m_data; size_t m_dataSize; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 76ea78de21..1eea20b305 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -23,21 +23,28 @@ communicate the request status. The response data may be stored in memory, to a file or processed directly, see SetStorage() for details. - Example usage: + Example usage in an event handler function of some window (i.e. @c this in + the example below is a wxWindow pointer): @code // Create the request object - wxObjectDataPtr request( - wxWebSession::GetDefault().CreateRequest("https://www.wxwidgets.org/downloads/logos/blocks.png")); + wxWebRequest request = wxWebSession::GetDefault().CreateRequest( + this, + "https://www.wxwidgets.org/downloads/logos/blocks.png" + ); + + if ( !request.IsOk() ) { + // This is not expected, but handle the error somehow. + } // Bind state event - request->Bind(wxEVT_WEBREQUEST_STATE, [](wxWebRequestEvent& evt) { + Bind(wxEVT_WEBREQUEST_STATE, [](wxWebRequestEvent& evt) { switch (evt.GetState()) { // Request completed case wxWebRequest::State_Completed: { - wxImage logoImage(*evt->GetResponse()->GetStream()); + wxImage logoImage(*evt.GetResponse().GetStream()); if (logoImage.IsOK()) wxLogInfo("Image loaded"); break; @@ -51,7 +58,7 @@ }); // Start the request - request->Start(); + request.Start(); @endcode @section descriptions Implementation Descriptions @@ -110,7 +117,7 @@ @see wxWebResponse, wxWebSession */ -class wxWebRequest: public wxEvtHandler, public wxRefCounter +class wxWebRequest { public: /** @@ -158,6 +165,23 @@ public: Storage_None }; + /** + Default constructor creates an invalid object. + + Initialize it by assigning wxWebSession::CreateRequest() to it before + using it. + + @see IsOk() + */ + wxWebRequest(); + + /** + Check if the object is valid. + + No other methods can be used if this function returns @false. + */ + bool IsOk() const; + /** Send the request to the server asynchronously. @@ -176,18 +200,16 @@ public: Returns a response object after a successful request. Before sending a request or after a failed request this will return - @c NULL. - - Note that this pointer remains owned by wxWebRequest object and must - not be freed. + an invalid response object, i.e. such that wxWebResponse::IsOk() + returns @NULL. */ - wxWebResponse* GetResponse() const; + wxWebResponse GetResponse() const; /** Returns the current authentication challenge object while the request is in @c State_Unauthorized. */ - wxWebAuthChallenge* GetAuthChallenge() const; + wxWebAuthChallenge GetAuthChallenge() const; /** Returns the id specified while creating this request. @@ -377,6 +399,23 @@ public: class wxWebResponse { public: + /** + Default constructor creates an invalid object. + + Initialize it by assigning wxWebRequest::GetResponse() to it before + using it. + + @see IsOk() + */ + wxWebResponse(); + + /** + Check if the object is valid. + + No other methods can be used if this function returns @false. + */ + bool IsOk() const; + /** Returns the final URL. This URL might be different than the request URL when a redirection @@ -428,7 +467,10 @@ public: /** @class wxWebSession - This class handles session-wide parameters and data used by wxWebRequest + Session allows creating wxWebRequest objects used for the actual HTTP + requests. + + It also handles session-wide parameters and data used by wxWebRequest instances. Usually the default session available via wxWebSession::GetDefault() @@ -451,14 +493,27 @@ class wxWebSession { public: /** - Create a new request for the specified URL + Create a new request for the specified URL. + The specified objects will be notified via wxWebRequestEvent objects + when the request state changes, e.g. when it is completed. It must be + specified and its lifetime must be long enough to last until the + request is completed. In particular, if the handler is a top-level + window, the request must be cancelled before the window can be closed + and destroyed. + + @param handler + The handler object to notify, must be non-@NULL. @param url The URL of the HTTP resource for this request @param id Optional id sent with events + @return + The new request object, use wxWebRequest::IsOk() to check if its + creation has succeeded. */ - wxWebRequest* CreateRequest(const wxString& url, int id = wxID_ANY); + wxWebRequest + CreateRequest(wxEvtHandler* handler, const wxString& url, int id = wxID_ANY); /** Retrieve the version information about the implementation library used @@ -499,13 +554,15 @@ public: /** Creates a new wxWebSession object. + Use IsOpened() to check if the session creation succeeded. + @param backend The backend web session implementation to use. @return The created wxWebSession */ - static wxWebSession* New(const wxString& backend = wxWebSessionBackendDefault); + static wxWebSession New(const wxString& backend = wxWebSessionBackendDefault); /** Allows to check if the specified backend is available at runtime. @@ -514,6 +571,20 @@ public: before 10.9 does not have the @c NSURLSession implementation available. */ static bool IsBackendAvailable(const wxString& backend); + + /** + Return true if the session was successfully opened and can be used. + */ + bool IsOpened() const; + + /** + Close the session. + + This frees any resources associated with the session and puts it in an + invalid state. Another session object can be assigned to it later to + allow using this object again. + */ + void Close(); }; /** @@ -531,20 +602,16 @@ public: class wxWebRequestEvent : public wxEvent { public: - wxWebRequestEvent(); - wxWebRequestEvent(wxEventType type, int id, wxWebRequest::State state, - wxWebResponse* response = NULL, const wxString& errorDesc = ""); - /** Return the current state of the request */ wxWebRequest::State GetState() const; /** - The response with the state set to @c State_Complete or @c NULL for other - events. + The response with the state set to @c State_Complete or empty response + object for other events. */ - wxWebResponse* GetResponse() const; + const wxWebResponse& GetResponse() const; /** A textual error description for a client side error @@ -562,8 +629,6 @@ public: */ const wxString& GetResponseFileName() const; - void SetResponseFileName(const wxString& filename); - /** Only for @c wxEVT_WEBREQUEST_DATA events. The buffer is only valid inside the event handler. @@ -573,9 +638,6 @@ public: size_t GetDataSize() const; ///@} - - void SetDataBuffer(const void* buffer, size_t size); - }; wxEventType wxEVT_WEBREQUEST_STATE; diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 4baf5abc62..d2eaabf852 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -169,8 +169,6 @@ public: m_downloadProgressTimer.Bind(wxEVT_TIMER, &WebRequestFrame::OnProgressTimer, this); - - m_currentRequest = NULL; } void OnStartButton(wxCommandEvent& WXUNUSED(evt)) @@ -178,12 +176,11 @@ public: GetStatusBar()->SetStatusText("Started request..."); // Create request for the specified URL from the default session - wxObjectDataPtr request(wxWebSession::GetDefault().CreateRequest( - m_urlTextCtrl->GetValue())); - m_currentRequest = request.get(); + m_currentRequest = wxWebSession::GetDefault().CreateRequest(this, + m_urlTextCtrl->GetValue()); // Bind event for state change - request->Bind(wxEVT_WEBREQUEST_STATE, &WebRequestFrame::OnWebRequestState, this); + Bind(wxEVT_WEBREQUEST_STATE, &WebRequestFrame::OnWebRequestState, this); // Prepare request based on selected action switch (m_notebook->GetSelection()) @@ -199,12 +196,12 @@ public: // Set postdata if checked if ( m_postCheckBox->IsChecked() ) { - request->SetData(m_postRequestTextCtrl->GetValue(), + m_currentRequest.SetData(m_postRequestTextCtrl->GetValue(), m_postContentTypeTextCtrl->GetValue()); } break; case Page_Download: - request->SetStorage(wxWebRequest::Storage_File); + m_currentRequest.SetStorage(wxWebRequest::Storage_File); m_downloadGauge->SetValue(0); m_downloadGauge->Pulse(); m_downloadStaticText->SetLabel(""); @@ -212,8 +209,8 @@ public: GetStatusBar()->SetStatusText(""); break; case Page_Advanced: - request->SetStorage(wxWebRequest::Storage_None); - request->Bind(wxEVT_WEBREQUEST_DATA, &WebRequestFrame::OnRequestData, this); + m_currentRequest.SetStorage(wxWebRequest::Storage_None); + Bind(wxEVT_WEBREQUEST_DATA, &WebRequestFrame::OnRequestData, this); GetStatusBar()->SetStatusText("Counting..."); m_advCount = 0; @@ -224,13 +221,13 @@ public: m_startButton->Disable(); // Start the request (events will be sent on success or failure) - request->Start(); + m_currentRequest.Start(); } void OnCancelButton(wxCommandEvent& WXUNUSED(evt)) { - if ( m_currentRequest ) - m_currentRequest->Cancel(); + if ( m_currentRequest.IsOk() ) + m_currentRequest.Cancel(); } void OnWebRequestState(wxWebRequestEvent& evt) @@ -240,7 +237,7 @@ public: if ( evt.GetState() != wxWebRequest::State_Active ) { - m_currentRequest = NULL; + m_currentRequest = wxWebRequest(); m_downloadProgressTimer.Stop(); } @@ -251,18 +248,18 @@ public: { case Page_Image: { - wxImage img(*evt.GetResponse()->GetStream()); + wxImage img(*evt.GetResponse().GetStream()); m_imageStaticBitmap->SetBitmap(img); m_notebook->GetPage(Page_Image)->Layout(); - GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes image data", evt.GetResponse()->GetContentLength())); + GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes image data", evt.GetResponse().GetContentLength())); break; } case Page_Text: - m_textResponseTextCtrl->SetValue(evt.GetResponse()->AsString()); + m_textResponseTextCtrl->SetValue(evt.GetResponse().AsString()); GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes text data (Status: %d %s)", - evt.GetResponse()->GetContentLength(), - evt.GetResponse()->GetStatus(), - evt.GetResponse()->GetStatusText())); + evt.GetResponse().GetContentLength(), + evt.GetResponse().GetStatus(), + evt.GetResponse().GetStatusText())); break; case Page_Download: { @@ -273,7 +270,7 @@ public: // Ask the user where to save the file wxFileDialog fileDlg(this, "Save download", "", - evt.GetResponse()->GetSuggestedFileName(), "*.*", + evt.GetResponse().GetSuggestedFileName(), "*.*", wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if ( fileDlg.ShowModal() == wxID_OK ) { @@ -334,14 +331,14 @@ public: void OnProgressTimer(wxTimerEvent& WXUNUSED(evt)) { - if ( !m_currentRequest || m_currentRequest->GetBytesExpectedToReceive() <= 0 ) + if ( !m_currentRequest.IsOk() || m_currentRequest.GetBytesExpectedToReceive() <= 0 ) return; - m_downloadGauge->SetValue((m_currentRequest->GetBytesReceived() * 100) / - m_currentRequest->GetBytesExpectedToReceive()); + m_downloadGauge->SetValue((m_currentRequest.GetBytesReceived() * 100) / + m_currentRequest.GetBytesExpectedToReceive()); m_downloadStaticText->SetLabelText(wxString::Format("%lld/%lld", - m_currentRequest->GetBytesReceived(), m_currentRequest->GetBytesExpectedToReceive())); + m_currentRequest.GetBytesReceived(), m_currentRequest.GetBytesExpectedToReceive())); } void OnPostCheckBox(wxCommandEvent& WXUNUSED(evt)) @@ -382,7 +379,7 @@ private: wxButton* m_startButton; wxButton* m_cancelButton; wxStaticBitmap* m_imageStaticBitmap; - wxWebRequest* m_currentRequest; + wxWebRequest m_currentRequest; wxCheckBox* m_postCheckBox; wxTextCtrl* m_postContentTypeTextCtrl; diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 3f6b02cdb1..2f82d9d5fa 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -54,27 +54,34 @@ extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[] = "wxWebSes wxDEFINE_EVENT(wxEVT_WEBREQUEST_STATE, wxWebRequestEvent); wxDEFINE_EVENT(wxEVT_WEBREQUEST_DATA, wxWebRequestEvent); +static const wxStringCharType* wxNO_IMPL_MSG + = wxS("can't be used with an invalid/uninitialized object"); + +#define wxCHECK_IMPL(rc) wxCHECK_MSG( m_impl, (rc), wxNO_IMPL_MSG ) +#define wxCHECK_IMPL_VOID() wxCHECK_RET( m_impl, wxNO_IMPL_MSG ) + // -// wxWebRequest +// wxWebRequestImpl // -wxWebRequest::wxWebRequest(wxWebSession& session, int id) - : m_storage(Storage_Memory), - m_headers(session.m_headers), +wxWebRequestImpl::wxWebRequestImpl(wxWebSession& session, wxEvtHandler* handler, int id) + : m_storage(wxWebRequest::Storage_Memory), + m_headers(session.GetImpl()->GetHeaders()), m_dataSize(0), m_session(session), + m_handler(handler), m_id(id), - m_state(State_Idle), + m_state(wxWebRequest::State_Idle), m_ignoreServerErrorStatus(false), m_bytesReceived(0) { } -bool wxWebRequest::CheckServerStatus() +bool wxWebRequestImpl::CheckServerStatus() { - const wxWebResponse* resp = GetResponse(); + const wxWebResponseImplPtr& resp = GetResponse(); if ( resp && resp->GetStatus() >= 400 && !m_ignoreServerErrorStatus ) { - SetState(State_Failed, wxString::Format(_("Error: %s (%d)"), + SetState(wxWebRequest::State_Failed, wxString::Format(_("Error: %s (%d)"), resp->GetStatusText(), resp->GetStatus())); return false; } @@ -82,18 +89,18 @@ bool wxWebRequest::CheckServerStatus() return true; } -bool wxWebRequest::IsActiveState(State state) +bool wxWebRequestImpl::IsActiveState(wxWebRequest::State state) { - return (state == State_Active || state == State_Unauthorized); + return (state == wxWebRequest::State_Active || state == wxWebRequest::State_Unauthorized); } -void wxWebRequest::SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv) +void wxWebRequestImpl::SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv) { m_dataText = text.mb_str(conv); SetData(wxSharedPtr(new wxMemoryInputStream(m_dataText, m_dataText.length())), contentType); } -bool wxWebRequest::SetData(const wxSharedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize) +bool wxWebRequestImpl::SetData(const wxSharedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize) { if ( !dataStream->IsOk() ) return false; @@ -121,12 +128,12 @@ bool wxWebRequest::SetData(const wxSharedPtr& dataStream, const w return true; } -wxFileOffset wxWebRequest::GetBytesReceived() const +wxFileOffset wxWebRequestImpl::GetBytesReceived() const { return m_bytesReceived; } -wxFileOffset wxWebRequest::GetBytesExpectedToReceive() const +wxFileOffset wxWebRequestImpl::GetBytesExpectedToReceive() const { if ( GetResponse() ) return GetResponse()->GetContentLength(); @@ -134,7 +141,34 @@ wxFileOffset wxWebRequest::GetBytesExpectedToReceive() const return -1; } -void wxWebRequest::SetState(State state, const wxString & failMsg) +namespace +{ + +// Functor used with CallAfter() below. +// +// TODO-C++11: Replace with a lambda. +struct StateEventProcessor +{ + StateEventProcessor(wxWebRequestImpl& request, + wxWebRequest::State state, + const wxString& failMsg) + : m_request(request), m_state(state), m_failMsg(failMsg) + { + } + + void operator()() + { + m_request.ProcessStateEvent(m_state, m_failMsg); + } + + wxWebRequestImpl& m_request; + const wxWebRequest::State m_state; + const wxString m_failMsg; +}; + +} // anonymous namespace + +void wxWebRequestImpl::SetState(wxWebRequest::State state, const wxString & failMsg) { // Add a reference while the request is active if ( IsActiveState(state) && !IsActiveState(m_state) ) @@ -143,10 +177,10 @@ void wxWebRequest::SetState(State state, const wxString & failMsg) m_state = state; // Trigger the event in the main thread - CallAfter(&wxWebRequest::ProcessStateEvent, state, failMsg); + m_handler->CallAfter(StateEventProcessor(*this, state, failMsg)); } -void wxWebRequest::ReportDataReceived(size_t sizeReceived) +void wxWebRequestImpl::ReportDataReceived(size_t sizeReceived) { m_bytesReceived += sizeReceived; } @@ -231,7 +265,7 @@ SplitParameters(const wxString& s, wxWebRequestHeaderMap& parameters) } // namespace wxPrivate -void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) +void wxWebRequestImpl::ProcessStateEvent(wxWebRequest::State state, const wxString& failMsg) { if ( !IsActiveState(state) && GetResponse() ) GetResponse()->Finalize(); @@ -239,17 +273,17 @@ void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) wxString responseFileName; wxWebRequestEvent evt(wxEVT_WEBREQUEST_STATE, GetId(), state, - GetResponse(), failMsg); - if ( state == State_Completed && m_storage == Storage_File ) + wxWebResponse(GetResponse()), failMsg); + if ( state == wxWebRequest::State_Completed && m_storage == wxWebRequest::Storage_File ) { responseFileName = GetResponse()->GetFileName(); evt.SetResponseFileName(responseFileName); } - ProcessEvent(evt); + m_handler->ProcessEvent(evt); // Remove temporary file if it still exists - if ( state == State_Completed && m_storage == Storage_File && + if ( state == wxWebRequest::State_Completed && m_storage == wxWebRequest::Storage_File && wxFileExists(responseFileName) ) wxRemoveFile(responseFileName); @@ -259,21 +293,224 @@ void wxWebRequest::ProcessStateEvent(State state, const wxString& failMsg) } // -// wxWebResponse +// wxWebRequest // -wxWebResponse::wxWebResponse(wxWebRequest& request) : + +wxWebRequest::wxWebRequest() +{ +} + +wxWebRequest::wxWebRequest(const wxWebRequestImplPtr& impl) + : m_impl(impl) +{ +} + +wxWebRequest::wxWebRequest(const wxWebRequest& other) + : m_impl(other.m_impl) +{ +} + +wxWebRequest& wxWebRequest::operator=(const wxWebRequest& other) +{ + m_impl = other.m_impl; + return *this; +} + +wxWebRequest::~wxWebRequest() +{ +} + +void wxWebRequest::SetHeader(const wxString& name, const wxString& value) +{ + wxCHECK_IMPL_VOID(); + + m_impl->SetHeader(name, value); +} + +void wxWebRequest::SetMethod(const wxString& method) +{ + wxCHECK_IMPL_VOID(); + + m_impl->SetMethod(method); +} + +void wxWebRequest::SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv) +{ + wxCHECK_IMPL_VOID(); + + m_impl->SetData(text, contentType, conv); +} + +bool +wxWebRequest::SetData(const wxSharedPtr& dataStream, + const wxString& contentType, + wxFileOffset dataSize) +{ + wxCHECK_IMPL( false ); + + return m_impl->SetData(dataStream, contentType, dataSize); +} + +void wxWebRequest::SetIgnoreServerErrorStatus(bool ignore) +{ + wxCHECK_IMPL_VOID(); + + m_impl->SetIgnoreServerErrorStatus(ignore); +} + +void wxWebRequest::SetStorage(Storage storage) +{ + wxCHECK_IMPL_VOID(); + + m_impl->SetStorage(storage); +} + +wxWebRequest::Storage wxWebRequest::GetStorage() const +{ + wxCHECK_IMPL( Storage_None ); + + return m_impl->GetStorage(); +} + +void wxWebRequest::Start() +{ + wxCHECK_IMPL_VOID(); + + m_impl->Start(); +} + +void wxWebRequest::Cancel() +{ + wxCHECK_IMPL_VOID(); + + m_impl->Cancel(); +} + +wxWebResponse wxWebRequest::GetResponse() const +{ + wxCHECK_IMPL( wxWebResponse() ); + + return wxWebResponse(m_impl->GetResponse()); +} + +wxWebAuthChallenge wxWebRequest::GetAuthChallenge() const +{ + wxCHECK_IMPL( wxWebAuthChallenge() ); + + return wxWebAuthChallenge(m_impl->GetAuthChallenge()); +} + +int wxWebRequest::GetId() const +{ + wxCHECK_IMPL( wxID_ANY ); + + return m_impl->GetId(); +} + +wxWebSession& wxWebRequest::GetSession() const +{ + wxCHECK_IMPL( wxWebSession::GetDefault() ); + + return m_impl->GetSession(); +} + +wxWebRequest::State wxWebRequest::GetState() const +{ + wxCHECK_IMPL( State_Failed ); + + return m_impl->GetState(); +} + +wxFileOffset wxWebRequest::GetBytesSent() const +{ + wxCHECK_IMPL( wxInvalidOffset ); + + return m_impl->GetBytesSent(); +} + +wxFileOffset wxWebRequest::GetBytesExpectedToSend() const +{ + wxCHECK_IMPL( wxInvalidOffset ); + + return m_impl->GetBytesExpectedToSend(); +} + +wxFileOffset wxWebRequest::GetBytesReceived() const +{ + wxCHECK_IMPL( wxInvalidOffset ); + + return m_impl->GetBytesReceived(); +} + +wxFileOffset wxWebRequest::GetBytesExpectedToReceive() const +{ + wxCHECK_IMPL( wxInvalidOffset ); + + return m_impl->GetBytesExpectedToReceive(); +} + + +// +// wxWebAuthChallenge +// + +wxWebAuthChallenge::wxWebAuthChallenge() +{ +} + +wxWebAuthChallenge::wxWebAuthChallenge(const wxWebAuthChallengeImplPtr& impl) + : m_impl(impl) +{ +} + +wxWebAuthChallenge::wxWebAuthChallenge(const wxWebAuthChallenge& other) + : m_impl(other.m_impl) +{ +} + +wxWebAuthChallenge& wxWebAuthChallenge::operator=(const wxWebAuthChallenge& other) +{ + m_impl = other.m_impl; + return *this; +} + +wxWebAuthChallenge::~wxWebAuthChallenge() +{ +} + +wxWebAuthChallenge::Source wxWebAuthChallenge::GetSource() const +{ + wxCHECK_IMPL( Source_Server ); + + return m_impl->GetSource(); +} + +void +wxWebAuthChallenge::SetCredentials(const wxString& user, + const wxString& password) +{ + wxCHECK_IMPL_VOID(); + + m_impl->SetCredentials(user, password); +} + +// +// wxWebResponseImpl +// + +wxWebResponseImpl::wxWebResponseImpl(wxWebRequestImpl& request) : m_request(request), m_readSize(8 * 1024) { } -wxWebResponse::~wxWebResponse() +wxWebResponseImpl::~wxWebResponseImpl() { if ( wxFileExists(m_file.GetName()) ) wxRemoveFile(m_file.GetName()); } -void wxWebResponse::Init() +void wxWebResponseImpl::Init() { if ( m_request.GetStorage() == wxWebRequest::Storage_File ) { @@ -296,12 +533,12 @@ void wxWebResponse::Init() } } -wxString wxWebResponse::GetMimeType() const +wxString wxWebResponseImpl::GetMimeType() const { return GetHeader("Mime-Type"); } -wxInputStream * wxWebResponse::GetStream() const +wxInputStream * wxWebResponseImpl::GetStream() const { if ( !m_stream.get() ) { @@ -325,7 +562,7 @@ wxInputStream * wxWebResponse::GetStream() const return m_stream.get(); } -wxString wxWebResponse::GetSuggestedFileName() const +wxString wxWebResponseImpl::GetSuggestedFileName() const { wxString suggestedFilename; @@ -355,7 +592,7 @@ wxString wxWebResponse::GetSuggestedFileName() const return suggestedFilename; } -wxString wxWebResponse::AsString() const +wxString wxWebResponseImpl::AsString() const { if ( m_request.GetStorage() == wxWebRequest::Storage_Memory ) { @@ -367,12 +604,12 @@ wxString wxWebResponse::AsString() const return wxString(); } -void* wxWebResponse::GetDataBuffer(size_t sizeNeeded) +void* wxWebResponseImpl::GetDataBuffer(size_t sizeNeeded) { return m_readBuffer.GetAppendBuf(sizeNeeded); } -void wxWebResponse::ReportDataReceived(size_t sizeReceived) +void wxWebResponseImpl::ReportDataReceived(size_t sizeReceived) { m_readBuffer.UngetAppendBuf(sizeReceived); m_request.ReportDataReceived(sizeReceived); @@ -385,26 +622,125 @@ void wxWebResponse::ReportDataReceived(size_t sizeReceived) { wxWebRequestEvent evt(wxEVT_WEBREQUEST_DATA, m_request.GetId(), wxWebRequest::State_Active); evt.SetDataBuffer(m_readBuffer.GetData(), m_readBuffer.GetDataLen()); - m_request.ProcessEvent(evt); + m_request.GetHandler()->ProcessEvent(evt); } if ( m_request.GetStorage() != wxWebRequest::Storage_Memory ) m_readBuffer.Clear(); } -wxString wxWebResponse::GetFileName() const +wxString wxWebResponseImpl::GetFileName() const { return m_file.GetName(); } -void wxWebResponse::Finalize() +void wxWebResponseImpl::Finalize() { if ( m_request.GetStorage() == wxWebRequest::Storage_File ) m_file.Close(); } // -// wxWebSession +// wxWebResponse +// + +wxWebResponse::wxWebResponse() +{ +} + +wxWebResponse::wxWebResponse(const wxWebResponseImplPtr& impl) + : m_impl(impl) +{ +} + +wxWebResponse::wxWebResponse(const wxWebResponse& other) + : m_impl(other.m_impl) +{ +} + +wxWebResponse& wxWebResponse::operator=(const wxWebResponse& other) +{ + m_impl = other.m_impl; + return *this; +} + +wxWebResponse::~wxWebResponse() +{ +} + +wxInt64 wxWebResponse::GetContentLength() const +{ + wxCHECK_IMPL( -1 ); + + return m_impl->GetContentLength(); +} + +wxString wxWebResponse::GetURL() const +{ + wxCHECK_IMPL( wxString() ); + + return m_impl->GetURL(); +} + +wxString wxWebResponse::GetHeader(const wxString& name) const +{ + wxCHECK_IMPL( wxString() ); + + return m_impl->GetHeader(name); +} + +wxString wxWebResponse::GetMimeType() const +{ + wxCHECK_IMPL( wxString() ); + + return m_impl->GetMimeType(); +} + +int wxWebResponse::GetStatus() const +{ + wxCHECK_IMPL( -1 ); + + return m_impl->GetStatus(); +} + +wxString wxWebResponse::GetStatusText() const +{ + wxCHECK_IMPL( wxString() ); + + return m_impl->GetStatusText(); +} + +wxInputStream* wxWebResponse::GetStream() const +{ + wxCHECK_IMPL( NULL ); + + return m_impl->GetStream(); +} + +wxString wxWebResponse::GetSuggestedFileName() const +{ + wxCHECK_IMPL( wxString() ); + + return m_impl->GetSuggestedFileName(); +} + +wxString wxWebResponse::AsString() const +{ + wxCHECK_IMPL( wxString() ); + + return m_impl->AsString(); +} + +wxString wxWebResponse::GetFileName() const +{ + wxCHECK_IMPL( wxString() ); + + return m_impl->GetFileName(); +} + + +// +// wxWebSessionImpl // WX_DECLARE_STRING_HASH_MAP(wxSharedPtr, wxStringWebSessionFactoryMap); @@ -412,12 +748,12 @@ WX_DECLARE_STRING_HASH_MAP(wxSharedPtr, wxStringWebSessionF namespace { -wxScopedPtr gs_defaultSession; +wxWebSession gs_defaultSession; wxStringWebSessionFactoryMap gs_factoryMap; } // anonymous namespace -wxWebSession::wxWebSession() +wxWebSessionImpl::wxWebSessionImpl() { // Initialize the user-Agent header with a reasonable default SetHeader("User-Agent", wxString::Format("%s/1 wxWidgets/%d.%d.%d", @@ -425,7 +761,7 @@ wxWebSession::wxWebSession() wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)); } -wxString wxWebSession::GetTempDir() const +wxString wxWebSessionImpl::GetTempDir() const { if ( m_tempDir.empty() ) return wxStandardPaths::Get().GetTempDir(); @@ -433,26 +769,56 @@ wxString wxWebSession::GetTempDir() const return m_tempDir; } -// static -wxWebSession& wxWebSession::GetDefault() -{ - if ( gs_defaultSession == NULL ) - gs_defaultSession.reset(wxWebSession::New()); +// +// wxWebSession +// - return *gs_defaultSession; +wxWebSession::wxWebSession() +{ +} + +wxWebSession::wxWebSession(const wxWebSessionImplPtr& impl) + : m_impl(impl) +{ +} + +wxWebSession::wxWebSession(const wxWebSession& other) + : m_impl(other.m_impl) +{ +} + +wxWebSession& wxWebSession::operator=(const wxWebSession& other) +{ + m_impl = other.m_impl; + return *this; +} + +wxWebSession::~wxWebSession() +{ } // static -wxWebSession* wxWebSession::New(const wxString& backend) +wxWebSession& wxWebSession::GetDefault() +{ + if ( !gs_defaultSession.IsOpened() ) + gs_defaultSession = wxWebSession::New(); + + return gs_defaultSession; +} + +// static +wxWebSession wxWebSession::New(const wxString& backend) { if ( gs_factoryMap.empty() ) InitFactoryMap(); wxStringWebSessionFactoryMap::iterator factory = gs_factoryMap.find(backend); + + wxWebSessionImplPtr impl; if ( factory != gs_factoryMap.end() ) - return factory->second->Create(); - else - return NULL; + impl = factory->second->Create(); + + return wxWebSession(impl); } // static @@ -490,6 +856,52 @@ bool wxWebSession::IsBackendAvailable(const wxString& backend) return factory != gs_factoryMap.end(); } +wxWebRequest +wxWebSession::CreateRequest(wxEvtHandler* handler, const wxString& url, int id) +{ + wxCHECK_IMPL( wxWebRequest() ); + + return wxWebRequest(m_impl->CreateRequest(*this, handler, url, id)); +} + +wxVersionInfo wxWebSession::GetLibraryVersionInfo() +{ + wxCHECK_IMPL( wxVersionInfo() ); + + return m_impl->GetLibraryVersionInfo(); +} + +void wxWebSession::SetHeader(const wxString& name, const wxString& value) +{ + wxCHECK_IMPL_VOID(); + + m_impl->SetHeader(name, value); +} + +void wxWebSession::SetTempDir(const wxString& dir) +{ + wxCHECK_IMPL_VOID(); + + m_impl->SetTempDir(dir); +} + +wxString wxWebSession::GetTempDir() const +{ + wxCHECK_IMPL( wxString() ); + + return m_impl->GetTempDir(); +} + +bool wxWebSession::IsOpened() const +{ + return m_impl.get() != NULL; +} + +void wxWebSession::Close() +{ + m_impl.reset(NULL); +} + // ---------------------------------------------------------------------------- // Module ensuring all global/singleton objects are destroyed on shutdown. // ---------------------------------------------------------------------------- @@ -509,7 +921,7 @@ public: virtual void OnExit() wxOVERRIDE { gs_factoryMap.clear(); - gs_defaultSession.reset(); + gs_defaultSession.Close(); } private: diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 68c2cff8b1..98b43c51aa 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -55,8 +55,8 @@ static size_t wxCURLHeader(char *buffer, size_t size, size_t nitems, void *userd return 0; } -wxWebResponseCURL::wxWebResponseCURL(wxWebRequest& request) : - wxWebResponse(request) +wxWebResponseCURL::wxWebResponseCURL(wxWebRequestCURL& request) : + wxWebResponseImpl(request) { curl_easy_setopt(GetHandle(), CURLOPT_WRITEDATA, static_cast(this)); curl_easy_setopt(GetHandle(), CURLOPT_HEADERDATA, static_cast(this)); @@ -143,8 +143,13 @@ static size_t wxCURLRead(char *buffer, size_t size, size_t nitems, void *userdat return 0; } -wxWebRequestCURL::wxWebRequestCURL(wxWebSession & session, int id, const wxString & url): - wxWebRequest(session, id) +wxWebRequestCURL::wxWebRequestCURL(wxWebSession & session, + wxWebSessionCURL& sessionImpl, + wxEvtHandler* handler, + const wxString & url, + int id): + wxWebRequestImpl(session, handler, id), + m_sessionImpl(sessionImpl) { m_headerList = NULL; @@ -182,7 +187,7 @@ wxWebRequestCURL::~wxWebRequestCURL() void wxWebRequestCURL::Start() { - if ( GetState() != State_Idle ) + if ( GetState() != wxWebRequest::State_Idle ) return; m_response.reset(new wxWebResponseCURL(*this)); @@ -228,21 +233,21 @@ bool wxWebRequestCURL::StartRequest() { m_bytesSent = 0; - if ( static_cast(GetSession()).StartRequest(*this) ) + if ( m_sessionImpl.StartRequest(*this) ) { - SetState(State_Active); + SetState(wxWebRequest::State_Active); return true; } else { - SetState(State_Failed); + SetState(wxWebRequest::State_Failed); return false; } } void wxWebRequestCURL::Cancel() { - static_cast(GetSession()).CancelRequest(this); + m_sessionImpl.CancelRequest(this); } void wxWebRequestCURL::HandleCompletion() @@ -250,15 +255,15 @@ void wxWebRequestCURL::HandleCompletion() int status = m_response ? m_response->GetStatus() : 0; if ( status == 0) - SetState(State_Failed, GetError()); + SetState(wxWebRequest::State_Failed, GetError()); else if ( status == 401 || status == 407 ) { m_authChallenge.reset(new wxWebAuthChallengeCURL( (status == 407) ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); if ( m_authChallenge->Init() ) - SetState(State_Unauthorized, m_response->GetStatusText()); + SetState(wxWebRequest::State_Unauthorized, m_response->GetStatusText()); else - SetState(State_Failed); + SetState(wxWebRequest::State_Failed); } else if ( CheckServerStatus() ) SetState(wxWebRequest::State_Completed); @@ -291,11 +296,6 @@ void wxWebRequestCURL::DestroyHeaderList() } } -wxWebResponse* wxWebRequestCURL::GetResponse() const -{ - return m_response.get(); -} - wxFileOffset wxWebRequestCURL::GetBytesSent() const { return m_bytesSent; @@ -310,8 +310,9 @@ wxFileOffset wxWebRequestCURL::GetBytesExpectedToSend() const // wxWebAuthChallengeCURL // -wxWebAuthChallengeCURL::wxWebAuthChallengeCURL(Source source, wxWebRequestCURL& request) : - wxWebAuthChallenge(source), +wxWebAuthChallengeCURL::wxWebAuthChallengeCURL(wxWebAuthChallenge::Source source, + wxWebRequestCURL& request) : + wxWebAuthChallengeImpl(source), m_request(request) { } @@ -325,7 +326,7 @@ void wxWebAuthChallengeCURL::SetCredentials(const wxString& user, const wxString { wxString authStr = wxString::Format("%s:%s", user, password); curl_easy_setopt(m_request.GetHandle(), - (GetSource() == Source_Proxy) ? CURLOPT_PROXYUSERPWD : CURLOPT_USERPWD, + (GetSource() == wxWebAuthChallenge::Source_Proxy) ? CURLOPT_PROXYUSERPWD : CURLOPT_USERPWD, static_cast(authStr.mb_str())); m_request.StartRequest(); } @@ -373,7 +374,11 @@ wxWebSessionCURL::~wxWebSessionCURL() curl_global_cleanup(); } -wxWebRequest* wxWebSessionCURL::CreateRequest(const wxString& url, int id) +wxWebRequestImplPtr +wxWebSessionCURL::CreateRequest(wxWebSession& session, + wxEvtHandler* handler, + const wxString& url, + int id) { // Allocate our handle on demand. if ( !m_handle ) @@ -382,11 +387,11 @@ wxWebRequest* wxWebSessionCURL::CreateRequest(const wxString& url, int id) if ( !m_handle ) { wxLogDebug("curl_multi_init() failed"); - return NULL; + return wxWebRequestImplPtr(); } } - return new wxWebRequestCURL(*this, id, url); + return wxWebRequestImplPtr(new wxWebRequestCURL(session, *this, handler, url, id)); } static CURLMcode wx_curl_multi_wait(CURLM *multi_handle, int timeout_ms, diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 86ef8fc003..49504568aa 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -141,8 +141,13 @@ static void CALLBACK wxRequestStatusCallback( // wxWebRequestWinHTTP // -wxWebRequestWinHTTP::wxWebRequestWinHTTP(int id, wxWebSessionWinHTTP& session, const wxString& url): - wxWebRequest(session, id), +wxWebRequestWinHTTP::wxWebRequestWinHTTP(wxWebSession& session, + wxWebSessionWinHTTP& sessionWinHTTP, + wxEvtHandler* handler, + const wxString& url, + int id): + wxWebRequestImpl(session, handler, id), + m_sessionWinHTTP(sessionWinHTTP), m_url(url), m_connect(NULL), m_request(NULL), @@ -173,11 +178,11 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, if ( dwStatusInformationLength > 0 ) { if ( !m_response->ReportAvailableData(dwStatusInformationLength) && - GetState() != State_Cancelled ) + GetState() != wxWebRequest::State_Cancelled ) SetFailedWithLastError(); } else - SetState(State_Completed); + SetState(wxWebRequest::State_Completed); break; case WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE: WriteData(); @@ -185,7 +190,7 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: { LPWINHTTP_ASYNC_RESULT asyncResult = reinterpret_cast(lpvStatusInformation); - SetState(State_Failed, wxWinHTTPErrorToString(asyncResult->dwError)); + SetState(wxWebRequest::State_Failed, wxWinHTTPErrorToString(asyncResult->dwError)); break; } } @@ -217,7 +222,7 @@ void wxWebRequestWinHTTP::CreateResponse() m_response.reset(new wxWebResponseWinHTTP(*this)); // wxWebResponseWinHTTP ctor could have changed the state if its // initialization failed, so check for this. - if ( GetState() == State_Failed ) + if ( GetState() == wxWebRequest::State_Failed ) return; int status = m_response->GetStatus(); @@ -226,7 +231,7 @@ void wxWebRequestWinHTTP::CreateResponse() m_authChallenge.reset(new wxWebAuthChallengeWinHTTP( (status == 407) ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); if ( m_authChallenge->Init() ) - SetState(State_Unauthorized, m_response->GetStatusText()); + SetState(wxWebRequest::State_Unauthorized, m_response->GetStatusText()); else SetFailedWithLastError(); } @@ -244,12 +249,12 @@ void wxWebRequestWinHTTP::CreateResponse() void wxWebRequestWinHTTP::SetFailedWithLastError() { wxString failMessage = wxWinHTTPErrorToString(::GetLastError()); - SetState(State_Failed, failMessage); + SetState(wxWebRequest::State_Failed, failMessage); } void wxWebRequestWinHTTP::Start() { - if ( GetState() != State_Idle ) // Completed requests can not be restarted + if ( GetState() != wxWebRequest::State_Idle ) // Completed requests can not be restarted return; // Parse the URL @@ -264,7 +269,7 @@ void wxWebRequestWinHTTP::Start() // Open a connection m_connect = ::WinHttpConnect( - static_cast(GetSession()).GetHandle(), + m_sessionWinHTTP.GetHandle(), uri.GetServer().wc_str(), port, 0); if ( m_connect == NULL ) { @@ -328,7 +333,7 @@ void wxWebRequestWinHTTP::SendRequest() NULL, 0, m_dataSize, (DWORD_PTR)this) ) { - SetState(State_Active); + SetState(wxWebRequest::State_Active); } else SetFailedWithLastError(); @@ -336,7 +341,7 @@ void wxWebRequestWinHTTP::SendRequest() void wxWebRequestWinHTTP::Cancel() { - SetState(State_Cancelled); + SetState(wxWebRequest::State_Cancelled); if ( m_request != NULL ) { ::WinHttpCloseHandle(m_request); @@ -344,17 +349,12 @@ void wxWebRequestWinHTTP::Cancel() } } -wxWebResponse* wxWebRequestWinHTTP::GetResponse() const -{ - return m_response.get(); -} - // // wxWebResponseWinHTTP // wxWebResponseWinHTTP::wxWebResponseWinHTTP(wxWebRequestWinHTTP& request): - wxWebResponse(request), + wxWebResponseImpl(request), m_requestHandle(request.GetHandle()) { wxString contentLengthStr = wxWinHTTPQueryHeaderString(m_requestHandle, @@ -415,8 +415,9 @@ bool wxWebResponseWinHTTP::ReportAvailableData(DWORD dataLen) // // wxWebAuthChallengeWinHTTP // -wxWebAuthChallengeWinHTTP::wxWebAuthChallengeWinHTTP(Source source, wxWebRequestWinHTTP & request): - wxWebAuthChallenge(source), +wxWebAuthChallengeWinHTTP::wxWebAuthChallengeWinHTTP(wxWebAuthChallenge::Source source, + wxWebRequestWinHTTP & request): + wxWebAuthChallengeImpl(source), m_request(request), m_target(0), m_selectedScheme(0) @@ -519,12 +520,17 @@ void wxWebSessionWinHTTP::Init() m_initialized = true; } -wxWebRequest* wxWebSessionWinHTTP::CreateRequest(const wxString& url, int id) +wxWebRequestImplPtr +wxWebSessionWinHTTP::CreateRequest(wxWebSession& session, + wxEvtHandler* handler, + const wxString& url, + int id) { if ( !m_initialized ) Init(); - return new wxWebRequestWinHTTP(id, *this, url); + return wxWebRequestImplPtr( + new wxWebRequestWinHTTP(session, *this, handler, url, id)); } wxVersionInfo wxWebSessionWinHTTP::GetLibraryVersionInfo() diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index b42b7f858f..9283c67820 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -68,7 +68,7 @@ wxWebRequestURLSession* request = [self requestForTask:dataTask]; if (request) - static_cast(request->GetResponse())->HandleData(data); + request->GetResponseImplPtr()->HandleData(data); } - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error @@ -90,8 +90,13 @@ // // wxWebRequestURLSession // -wxWebRequestURLSession::wxWebRequestURLSession(wxWebSessionURLSession& session, const wxString& url, int id): - wxWebRequest(session, id), +wxWebRequestURLSession::wxWebRequestURLSession(wxWebSession& session, + wxWebSessionURLSession& sessionImpl, + wxEvtHandler* handler, + const wxString& url, + int winid): + wxWebRequestImpl(session, handler, winid), + m_sessionImpl(sessionImpl), m_url(url) { } @@ -103,8 +108,6 @@ wxWebRequestURLSession::~wxWebRequestURLSession() void wxWebRequestURLSession::Start() { - wxWebSessionURLSession& session = static_cast(GetSession()); - NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL: [NSURL URLWithString:wxCFStringRef(m_url).AsNSString()]]; if (m_method.empty()) @@ -127,20 +130,20 @@ void wxWebRequestURLSession::Start() // Create NSData from memory buffer NSData* data = [NSData dataWithBytes:memBuf.GetData() length:m_dataSize]; - m_task = [[session.GetSession() uploadTaskWithRequest:req fromData:data] retain]; + m_task = [[m_sessionImpl.GetSession() uploadTaskWithRequest:req fromData:data] retain]; } else { // Create data task - m_task = [[session.GetSession() dataTaskWithRequest:req] retain]; + m_task = [[m_sessionImpl.GetSession() dataTaskWithRequest:req] retain]; } // The session delegate needs to know which task is wrapped in which request - [session.GetDelegate() registerRequest:this task:m_task]; + [m_sessionImpl.GetDelegate() registerRequest:this task:m_task]; m_response.reset(new wxWebResponseURLSession(*this, m_task)); - SetState(State_Active); + SetState(wxWebRequest::State_Active); [m_task resume]; } @@ -152,13 +155,13 @@ void wxWebRequestURLSession::Cancel() void wxWebRequestURLSession::HandleCompletion() { if ( CheckServerStatus() ) - SetState(State_Completed); + SetState(wxWebRequest::State_Completed); } -wxWebAuthChallenge* wxWebRequestURLSession::GetAuthChallenge() const +wxWebAuthChallengeImplPtr wxWebRequestURLSession::GetAuthChallenge() const { wxFAIL_MSG("not implemented"); - return NULL; + return wxWebAuthChallengeImplPtr(); } wxFileOffset wxWebRequestURLSession::GetBytesSent() const @@ -185,8 +188,9 @@ wxFileOffset wxWebRequestURLSession::GetBytesExpectedToReceive() const // wxWebResponseURLSession // -wxWebResponseURLSession::wxWebResponseURLSession(wxWebRequest& request, WX_NSURLSessionTask task): - wxWebResponse(request) +wxWebResponseURLSession::wxWebResponseURLSession(wxWebRequestURLSession& request, + WX_NSURLSessionTask task): + wxWebResponseImpl(request) { m_task = [task retain]; @@ -260,9 +264,13 @@ wxWebSessionURLSession::~wxWebSessionURLSession() [m_delegate release]; } -wxWebRequest* wxWebSessionURLSession::CreateRequest(const wxString& url, int id) +wxWebRequestImplPtr +wxWebSessionURLSession::CreateRequest(wxWebSession& session, + wxEvtHandler* handler, + const wxString& url, + int winid) { - return new wxWebRequestURLSession(*this, url, id); + return wxWebRequestImplPtr(new wxWebRequestURLSession(session, *this, handler, url, winid)); } wxVersionInfo wxWebSessionURLSession::GetLibraryVersionInfo() diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 6d8d51a178..4bf92ec8b2 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -33,7 +33,7 @@ // disable running the test entirely. static const char* WX_TEST_WEBREQUEST_URL_DEFAULT = "https://httpbin.org"; -class RequestFixture +class RequestFixture : public wxEvtHandler { public: RequestFixture() @@ -57,9 +57,9 @@ public: void CreateAbs(const wxString& url) { - request.reset(wxWebSession::GetDefault().CreateRequest(url)); - request->Bind(wxEVT_WEBREQUEST_STATE, &RequestFixture::OnRequestState, this); - request->Bind(wxEVT_WEBREQUEST_DATA, &RequestFixture::OnData, this); + request = wxWebSession::GetDefault().CreateRequest(this, url); + Bind(wxEVT_WEBREQUEST_STATE, &RequestFixture::OnRequestState, this); + Bind(wxEVT_WEBREQUEST_DATA, &RequestFixture::OnData, this); } void OnRequestState(wxWebRequestEvent& evt) @@ -68,7 +68,7 @@ public: { case wxWebRequest::State_Unauthorized: case wxWebRequest::State_Completed: - if ( request->GetStorage() == wxWebRequest::Storage_File ) + if ( request.GetStorage() == wxWebRequest::Storage_File ) { wxFileName fn(evt.GetResponseFileName()); REQUIRE( fn.GetSize() == expectedFileSize ); @@ -94,17 +94,17 @@ public: void Run(wxWebRequest::State requiredState = wxWebRequest::State_Completed, int requiredStatus = 200) { - REQUIRE( request->GetState() == wxWebRequest::State_Idle ); - request->Start(); + REQUIRE( request.GetState() == wxWebRequest::State_Idle ); + request.Start(); loop.Run(); - REQUIRE( request->GetState() == requiredState ); + REQUIRE( request.GetState() == requiredState ); if (requiredStatus) - REQUIRE( request->GetResponse()->GetStatus() == requiredStatus ); + REQUIRE( request.GetResponse().GetStatus() == requiredStatus ); } wxString baseURL; wxEventLoop loop; - wxObjectDataPtr request; + wxWebRequest request; wxInt64 expectedFileSize; wxInt64 dataSize; }; @@ -119,9 +119,9 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") { Create("/bytes/65536"); Run(); - REQUIRE( request->GetResponse()->GetContentLength() == 65536 ); - REQUIRE( request->GetBytesExpectedToReceive() == 65536 ); - REQUIRE( request->GetBytesReceived() == 65536 ); + REQUIRE( request.GetResponse().GetContentLength() == 65536 ); + REQUIRE( request.GetBytesExpectedToReceive() == 65536 ); + REQUIRE( request.GetBytesReceived() == 65536 ); } SECTION("GET 404 error") @@ -139,7 +139,7 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") SECTION("POST form data") { Create("/post"); - request->SetData("app=WebRequestSample&version=1", "application/x-www-form-urlencoded"); + request.SetData("app=WebRequestSample&version=1", "application/x-www-form-urlencoded"); Run(); } @@ -147,25 +147,25 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") { Create("/base64/VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw=="); Run(); - REQUIRE( request->GetResponse()->AsString() == "The quick brown fox jumps over the lazy dog" ); + REQUIRE( request.GetResponse().AsString() == "The quick brown fox jumps over the lazy dog" ); } SECTION("GET 99KB to file") { expectedFileSize = 99 * 1024; Create(wxString::Format("/bytes/%lld", expectedFileSize)); - request->SetStorage(wxWebRequest::Storage_File); + request.SetStorage(wxWebRequest::Storage_File); Run(); - REQUIRE( request->GetBytesReceived() == expectedFileSize ); + REQUIRE( request.GetBytesReceived() == expectedFileSize ); } SECTION("Process 99KB data") { int processingSize = 99 * 1024; Create(wxString::Format("/bytes/%d", processingSize)); - request->SetStorage(wxWebRequest::Storage_None); + request.SetStorage(wxWebRequest::Storage_None); Run(); - REQUIRE( request->GetBytesReceived() == processingSize ); + REQUIRE( request.GetBytesReceived() == processingSize ); REQUIRE( dataSize == processingSize ); } @@ -175,8 +175,8 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") wxSharedPtr is(new wxFileInputStream("horse.png")); REQUIRE( is->IsOk() ); - request->SetData(is, "image/png"); - request->SetMethod("PUT"); + request.SetData(is, "image/png"); + request.SetMethod("PUT"); Run(); } @@ -184,25 +184,27 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") { Create("/digest-auth/auth/wxtest/wxwidgets"); Run(wxWebRequest::State_Unauthorized, 401); - REQUIRE( request->GetAuthChallenge() != NULL ); - request->GetAuthChallenge()->SetCredentials("wxtest", "wxwidgets"); + REQUIRE( request.GetAuthChallenge().IsOk() ); + request.GetAuthChallenge().SetCredentials("wxtest", "wxwidgets"); loop.Run(); - REQUIRE( request->GetResponse()->GetStatus() == 200 ); - REQUIRE( request->GetState() == wxWebRequest::State_Completed ); + REQUIRE( request.GetResponse().GetStatus() == 200 ); + REQUIRE( request.GetState() == wxWebRequest::State_Completed ); } SECTION("Server auth DIGEST") { Create("/digest-auth/auth/wxtest/wxwidgets"); Run(wxWebRequest::State_Unauthorized, 401); - REQUIRE( request->GetAuthChallenge() != NULL ); - request->GetAuthChallenge()->SetCredentials("wxtest", "wxwidgets"); + REQUIRE( request.GetAuthChallenge().IsOk() ); + request.GetAuthChallenge().SetCredentials("wxtest", "wxwidgets"); loop.Run(); - REQUIRE( request->GetResponse()->GetStatus() == 200 ); - REQUIRE( request->GetState() == wxWebRequest::State_Completed ); + REQUIRE( request.GetResponse().GetStatus() == 200 ); + REQUIRE( request.GetState() == wxWebRequest::State_Completed ); } } +WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); + namespace wxPrivate { WXDLLIMPEXP_NET wxString From 7b6c4cb9e98ec3843aefcd757f8a16435d524efb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 30 Dec 2020 14:26:06 +0100 Subject: [PATCH 118/218] Include required module before using check_c_source_compiles() Fix CMake build with 3.10, which gave the following errors CMake Error at build/cmake/init.cmake:321 (check_c_source_compiles): Unknown CMake command "check_c_source_compiles". Call Stack (most recent call first): build/cmake/main.cmake:16 (include) CMakeLists.txt:69 (include) previously. Apparently the required CheckCSourceCompiles module was already included from somewhere else with later CMake versions, but not with this one, so do include it explicitly. --- build/cmake/init.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index d9b78ba412..6dca1cc869 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -317,6 +317,7 @@ if (wxUSE_WEBREQUEST) endif() endif() + include(CheckCSourceCompiles) if(wxUSE_WEBREQUEST_WINHTTP) check_c_source_compiles("#include #include From a2a409f7a5908177a6a68825d9081296e94afba6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 30 Dec 2020 14:29:06 +0100 Subject: [PATCH 119/218] Remove references to non-existent wxWebRequest headers Remove the platform-specific wxWebRequest headers from the files lists and from MSVS 200x project files. This should have been done in e5bd5a926c (Move backend-specific wxWebRequest headers to private subdirs, 2020-12-26) manually, as update-setup-h script doesn't remove the old files from the variable definitions. It notably fixes CMake build under MSW and Mac, which failed due to not finding the referenced files. --- build/bakefiles/files.bkl | 6 ------ build/bakefiles/multilib.bkl | 4 ++-- build/cmake/files.cmake | 8 -------- build/msw/wx_vc7_net.vcproj | 3 --- build/msw/wx_vc8_net.vcproj | 4 ---- build/msw/wx_vc9_net.vcproj | 4 ---- 6 files changed, 2 insertions(+), 27 deletions(-) diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 9e13a46f20..00adccfbb5 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -757,9 +757,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/msw/urlmsw.cpp src/msw/webrequest_winhttp.cpp - - wx/msw/webrequest_winhttp.h - @@ -3523,9 +3520,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! $(NET_WIN32_SRC) $(NET_UNIX_SRC) $(NET_OSX_SRC) - - $(NET_WIN32_HDR) - $(NET_CMN_SRC) $(NET_PLATFORM_SRC) diff --git a/build/bakefiles/multilib.bkl b/build/bakefiles/multilib.bkl index c378688dd7..2dbd123173 100644 --- a/build/bakefiles/multilib.bkl +++ b/build/bakefiles/multilib.bkl @@ -49,14 +49,14 @@ WXUSINGDLL WXMAKINGDLL_NET $(NET_SRC) - $(NET_CMN_HDR) $(NET_PLATFORM_HDR) + $(NET_CMN_HDR) basedll $(NET_SRC) - $(NET_CMN_HDR) $(NET_PLATFORM_HDR) + $(NET_CMN_HDR) diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake index b9c3e24629..99d1e65f99 100644 --- a/build/cmake/files.cmake +++ b/build/cmake/files.cmake @@ -663,20 +663,12 @@ set(NET_OSX_SRC src/osx/webrequest_urlsession.mm ) -set(NET_OSX_HDR - wx/osx/webrequest_urlsession.h -) - set(NET_WIN32_SRC src/msw/sockmsw.cpp src/msw/urlmsw.cpp src/msw/webrequest_winhttp.cpp ) -set(NET_WIN32_HDR - wx/msw/webrequest_winhttp.h -) - set(NET_CMN_SRC src/common/fs_inet.cpp src/common/ftp.cpp diff --git a/build/msw/wx_vc7_net.vcproj b/build/msw/wx_vc7_net.vcproj index 4ba46bc2f9..ec9768344c 100644 --- a/build/msw/wx_vc7_net.vcproj +++ b/build/msw/wx_vc7_net.vcproj @@ -454,9 +454,6 @@ AdditionalDependencies=""..\..\lib\vc_dll\mswu\wx\msw""/> - - - - - - Date: Wed, 30 Dec 2020 14:41:17 +0100 Subject: [PATCH 120/218] Skip wxWebRequest authentication tests when using NSURLSession The NSURLSession-based backend is missing authentication support, so these tests always fail there, skip them for now. --- tests/net/webrequest.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 4bf92ec8b2..488fc1a0d2 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -42,6 +42,12 @@ public: dataSize = 0; } + static bool UsingNSURLSession() + { + return wxWebSession::GetDefault().GetLibraryVersionInfo().GetName() + == "URLSession"; + } + bool InitBaseURL() { if ( !wxGetEnv("WX_TEST_WEBREQUEST_URL", &baseURL) ) @@ -182,6 +188,12 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") SECTION("Server auth BASIC") { + if ( UsingNSURLSession() ) + { + WARN("NSURLSession backend doesn't support authentication, skipping."); + return; + } + Create("/digest-auth/auth/wxtest/wxwidgets"); Run(wxWebRequest::State_Unauthorized, 401); REQUIRE( request.GetAuthChallenge().IsOk() ); @@ -193,6 +205,12 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") SECTION("Server auth DIGEST") { + if ( UsingNSURLSession() ) + { + WARN("NSURLSession backend doesn't support authentication, skipping."); + return; + } + Create("/digest-auth/auth/wxtest/wxwidgets"); Run(wxWebRequest::State_Unauthorized, 401); REQUIRE( request.GetAuthChallenge().IsOk() ); From 989cafe53592453e1250eeb26d17c67f424f9083 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 4 Jan 2021 01:57:36 +0100 Subject: [PATCH 121/218] Take raw pointer and not wxSharedPtr<> in SetData() Using shared pointer seems to be ill-advised here, the stream shouldn't be shared as it's going to be used by wxWebRequest itself and can't be used by the application code in parallel, so the ownership transfer semantics is more appropriate. We could take a wxScopedPtr<> instead, but wx API takes ownership of raw pointers everywhere else, so do it here too. Incidentally fix a bug with calling IsOk() on a possibly null pointer. --- include/wx/private/webrequest.h | 4 ++-- include/wx/webrequest.h | 2 +- interface/wx/webrequest.h | 19 ++++++++++++++++--- src/common/webrequest.cpp | 25 +++++++++++++++++-------- tests/net/webrequest.cpp | 4 ++-- 5 files changed, 38 insertions(+), 16 deletions(-) diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index e77858ef57..b74bbd566b 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -56,7 +56,7 @@ public: void SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv = wxConvUTF8); - bool SetData(const wxSharedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); + bool SetData(wxScopedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } @@ -99,7 +99,7 @@ protected: wxWebRequest::Storage m_storage; wxWebRequestHeaderMap m_headers; wxFileOffset m_dataSize; - wxSharedPtr m_dataStream; + wxScopedPtr m_dataStream; wxWebRequestImpl(wxWebSession& session, wxEvtHandler* handler, int id); diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 0f9da9aa3f..2582021d1d 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -134,7 +134,7 @@ public: void SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv = wxConvUTF8); - bool SetData(const wxSharedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); + bool SetData(wxInputStream* dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); void SetIgnoreServerErrorStatus(bool ignore); diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 1eea20b305..dcde845b5a 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -269,10 +269,23 @@ public: @c GET and the given @a dataStream will be posted as the body of this request. + Example of use: + @code + std::unique_ptr stream(new wxFileInputStream("some_file.dat")); + if ( !stream->IsOk() ) { + // Handle error (due to e.g. file not found) here. + ... + return; + } + request.SetData(stream.release(), "application/octet-stream") + @endcode + @param dataStream The data in this stream will be posted as the request body. The - stream may be empty, which will result in sending 0 bytes of data, - but if not empty, should be valid. + pointer may be @NULL, which will result in sending 0 bytes of data, + but if not empty, should be valid, i.e. wxInputStream::IsOk() must + return @true. This object takes ownership of the passed in pointer + and will delete it, i.e. the pointer must be heap-allocated. @param contentType The value of HTTP "Content-Type" header, e.g. "application/octet-stream". @@ -284,7 +297,7 @@ public: dataSize is not specified and the attempt to determine stream size failed; @true in all the other cases. */ - bool SetData(const wxSharedPtr& dataStream, + bool SetData(wxInputStream* dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); /** diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 2f82d9d5fa..0c7134274b 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -97,17 +97,23 @@ bool wxWebRequestImpl::IsActiveState(wxWebRequest::State state) void wxWebRequestImpl::SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv) { m_dataText = text.mb_str(conv); - SetData(wxSharedPtr(new wxMemoryInputStream(m_dataText, m_dataText.length())), contentType); + + wxScopedPtr + stream(new wxMemoryInputStream(m_dataText, m_dataText.length())); + SetData(stream, contentType); } -bool wxWebRequestImpl::SetData(const wxSharedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize) +bool +wxWebRequestImpl::SetData(wxScopedPtr& dataStream, + const wxString& contentType, + wxFileOffset dataSize) { - if ( !dataStream->IsOk() ) - return false; + m_dataStream.reset(dataStream.release()); - m_dataStream = dataStream; - if ( m_dataStream.get() ) + if ( m_dataStream ) { + wxCHECK_MSG( m_dataStream->IsOk(), false, "can't use invalid stream" ); + if ( dataSize == wxInvalidOffset ) { // Determine data size @@ -342,13 +348,16 @@ void wxWebRequest::SetData(const wxString& text, const wxString& contentType, co } bool -wxWebRequest::SetData(const wxSharedPtr& dataStream, +wxWebRequest::SetData(wxInputStream* dataStream, const wxString& contentType, wxFileOffset dataSize) { + // Ensure that the stream is destroyed even we return below. + wxScopedPtr streamPtr(dataStream); + wxCHECK_IMPL( false ); - return m_impl->SetData(dataStream, contentType, dataSize); + return m_impl->SetData(streamPtr, contentType, dataSize); } void wxWebRequest::SetIgnoreServerErrorStatus(bool ignore) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 488fc1a0d2..cb8caede1e 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -178,10 +178,10 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") SECTION("PUT file data") { Create("/put"); - wxSharedPtr is(new wxFileInputStream("horse.png")); + wxScopedPtr is(new wxFileInputStream("horse.png")); REQUIRE( is->IsOk() ); - request.SetData(is, "image/png"); + request.SetData(is.release(), "image/png"); request.SetMethod("PUT"); Run(); } From 6e546a3d4b22f2650f889037050c6bb34e5747ac Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 4 Jan 2021 02:06:10 +0100 Subject: [PATCH 122/218] Don't use wxSharedPtr<> in factory registration code Shared ownership semantics again seems inappropriate here as we're not actually sharing the pointers here, so just use raw pointers instead (with C++11 we could use std::unique_ptr<>, but this is impossible with our own map and scoped pointer implementations). No real changes. --- include/wx/webrequest.h | 3 +-- src/common/webrequest.cpp | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 2582021d1d..98bd71f3fd 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -16,7 +16,6 @@ #include "wx/event.h" #include "wx/object.h" -#include "wx/sharedptr.h" #include "wx/stream.h" #include "wx/versioninfo.h" @@ -216,7 +215,7 @@ public: private: static void RegisterFactory(const wxString& backend, - const wxSharedPtr& factory); + wxWebSessionFactory* factory); static void InitFactoryMap(); diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 0c7134274b..7d87a533a0 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -752,7 +752,7 @@ wxString wxWebResponse::GetFileName() const // wxWebSessionImpl // -WX_DECLARE_STRING_HASH_MAP(wxSharedPtr, wxStringWebSessionFactoryMap); +WX_DECLARE_STRING_HASH_MAP(wxWebSessionFactory*, wxStringWebSessionFactoryMap); namespace { @@ -833,8 +833,12 @@ wxWebSession wxWebSession::New(const wxString& backend) // static void wxWebSession::RegisterFactory(const wxString& backend, - const wxSharedPtr& factory) + wxWebSessionFactory* factory) { + // Note that we don't have to check here that there is no registered + // backend with the same name yet because we're only called from + // InitFactoryMap() below. If this function becomes public, we'd need to + // free the previous pointer stored for this backend first here. gs_factoryMap[backend] = factory; } @@ -842,16 +846,13 @@ wxWebSession::RegisterFactory(const wxString& backend, void wxWebSession::InitFactoryMap() { #if wxUSE_WEBREQUEST_WINHTTP - RegisterFactory(wxWebSessionBackendWinHTTP, - wxSharedPtr(new wxWebSessionFactoryWinHTTP())); + RegisterFactory(wxWebSessionBackendWinHTTP, new wxWebSessionFactoryWinHTTP()); #endif #if wxUSE_WEBREQUEST_URLSESSION - RegisterFactory(wxWebSessionBackendURLSession, - wxSharedPtr(new wxWebSessionFactoryURLSession())); + RegisterFactory(wxWebSessionBackendURLSession, new wxWebSessionFactoryURLSession()); #endif #if wxUSE_WEBREQUEST_CURL - RegisterFactory(wxWebSessionBackendCURL, - wxSharedPtr(new wxWebSessionFactoryCURL())); + RegisterFactory(wxWebSessionBackendCURL, new wxWebSessionFactoryCURL()); #endif } @@ -929,6 +930,13 @@ public: virtual void OnExit() wxOVERRIDE { + for ( wxStringWebSessionFactoryMap::iterator it = gs_factoryMap.begin(); + it != gs_factoryMap.end(); + ++it ) + { + delete it->second; + } + gs_factoryMap.clear(); gs_defaultSession.Close(); } From f89781bfddb3eea2d73dc3478a83cc9b2d85eeca Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 4 Jan 2021 02:13:53 +0100 Subject: [PATCH 123/218] Simplify status bar updates in the webrequest sample Use wxLogStatus() to update the status bar, this is shorter and simpler than using GetStatusBar()->SetStatusText(wxString::Format(...)). Also use wxFrame::SetStatusText() which forwards to wxStatusBar method with the same name when we want to just clear the status bar. No real changes. --- samples/webrequest/webrequest.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index d2eaabf852..c0cdff31d8 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -165,7 +165,7 @@ public: CreateStatusBar(); - GetStatusBar()->SetStatusText(wxWebSession::GetDefault().GetLibraryVersionInfo().ToString()); + wxLogStatus(this, "%s", wxWebSession::GetDefault().GetLibraryVersionInfo().ToString()); m_downloadProgressTimer.Bind(wxEVT_TIMER, &WebRequestFrame::OnProgressTimer, this); @@ -173,7 +173,7 @@ public: void OnStartButton(wxCommandEvent& WXUNUSED(evt)) { - GetStatusBar()->SetStatusText("Started request..."); + wxLogStatus(this, "Started request..."); // Create request for the specified URL from the default session m_currentRequest = wxWebSession::GetDefault().CreateRequest(this, @@ -206,13 +206,13 @@ public: m_downloadGauge->Pulse(); m_downloadStaticText->SetLabel(""); m_downloadProgressTimer.Start(500); - GetStatusBar()->SetStatusText(""); + SetStatusText(""); break; case Page_Advanced: m_currentRequest.SetStorage(wxWebRequest::Storage_None); Bind(wxEVT_WEBREQUEST_DATA, &WebRequestFrame::OnRequestData, this); - GetStatusBar()->SetStatusText("Counting..."); + wxLogStatus(this, "Counting..."); m_advCount = 0; m_advCountStaticText->SetLabel("0"); break; @@ -251,22 +251,22 @@ public: wxImage img(*evt.GetResponse().GetStream()); m_imageStaticBitmap->SetBitmap(img); m_notebook->GetPage(Page_Image)->Layout(); - GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes image data", evt.GetResponse().GetContentLength())); + wxLogStatus(this, "Loaded %lld bytes image data", evt.GetResponse().GetContentLength()); break; } case Page_Text: m_textResponseTextCtrl->SetValue(evt.GetResponse().AsString()); - GetStatusBar()->SetStatusText(wxString::Format("Loaded %lld bytes text data (Status: %d %s)", + wxLogStatus(this, "Loaded %lld bytes text data (Status: %d %s)", evt.GetResponse().GetContentLength(), evt.GetResponse().GetStatus(), - evt.GetResponse().GetStatusText())); + evt.GetResponse().GetStatusText()); break; case Page_Download: { m_downloadGauge->SetValue(100); m_downloadStaticText->SetLabel(""); - GetStatusBar()->SetStatusText("Download completed"); + wxLogStatus(this, "Download completed"); // Ask the user where to save the file wxFileDialog fileDlg(this, "Save download", "", @@ -282,20 +282,20 @@ public: } case Page_Advanced: UpdateAdvCount(); - GetStatusBar()->SetStatusText(""); + SetStatusText(""); break; } break; case wxWebRequest::State_Failed: wxLogError("Web Request failed: %s", evt.GetErrorDescription()); - GetStatusBar()->SetStatusText(""); + SetStatusText(""); break; case wxWebRequest::State_Cancelled: m_downloadGauge->SetValue(0); m_downloadStaticText->SetLabel(""); - GetStatusBar()->SetStatusText("Cancelled"); + wxLogStatus(this, "Cancelled"); break; default: From d2dc11da4f85fa5389834edacdcac2ce0b90c682 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 4 Jan 2021 23:16:52 +0100 Subject: [PATCH 124/218] Allow starting request by pressing "Enter" in the sample Just a small ergonomic improvement. --- samples/webrequest/webrequest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index c0cdff31d8..51d40eed6c 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -51,9 +51,12 @@ public: mainSizer->Add(new wxStaticText(this, wxID_ANY, "Request URL:"), wxSizerFlags().Border()); m_urlTextCtrl = new wxTextCtrl(this, wxID_ANY, - "https://www.wxwidgets.org/downloads/logos/blocks.png"); + "https://www.wxwidgets.org/downloads/logos/blocks.png", + wxDefaultPosition, wxDefaultSize, + wxTE_PROCESS_ENTER); mainSizer->Add(m_urlTextCtrl, wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); + m_urlTextCtrl->Bind(wxEVT_TEXT_ENTER, &WebRequestFrame::OnStartButton, this); m_notebook = new wxNotebook(this, wxID_ANY); m_notebook->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, &WebRequestFrame::OnNotebookPageChanged, this); From dd23d2cf25019b933b7a862d24f92cced433efc2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 5 Jan 2021 00:26:49 +0100 Subject: [PATCH 125/218] Fix and simplify wxWebRequestImpl objects ref counting When cancelling a request it was possible for it to be deleted while it was still used from another thread. Fix this and make the code much more obviously correct by simply "locking" the request until the event generated by it is processed: now IncRef() and DecRef() calls are always balanced as they're called from ctor and dtor of StateEventProcessor helper only. --- src/common/webrequest.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 7d87a533a0..58fecf82ec 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -160,6 +160,15 @@ struct StateEventProcessor const wxString& failMsg) : m_request(request), m_state(state), m_failMsg(failMsg) { + // Ensure that the request object stays alive until this event is + // processed. + m_request.IncRef(); + } + + StateEventProcessor(const StateEventProcessor& other) + : m_request(other.m_request), m_state(other.m_state), m_failMsg(other.m_failMsg) + { + m_request.IncRef(); } void operator()() @@ -167,6 +176,11 @@ struct StateEventProcessor m_request.ProcessStateEvent(m_state, m_failMsg); } + ~StateEventProcessor() + { + m_request.DecRef(); + } + wxWebRequestImpl& m_request; const wxWebRequest::State m_state; const wxString m_failMsg; @@ -176,10 +190,6 @@ struct StateEventProcessor void wxWebRequestImpl::SetState(wxWebRequest::State state, const wxString & failMsg) { - // Add a reference while the request is active - if ( IsActiveState(state) && !IsActiveState(m_state) ) - IncRef(); - m_state = state; // Trigger the event in the main thread @@ -292,10 +302,6 @@ void wxWebRequestImpl::ProcessStateEvent(wxWebRequest::State state, const wxStri if ( state == wxWebRequest::State_Completed && m_storage == wxWebRequest::Storage_File && wxFileExists(responseFileName) ) wxRemoveFile(responseFileName); - - // Remove reference after the request is no longer active - if ( !IsActiveState(state) ) - DecRef(); } // From dbc1d9c40e0c8dfdd8a22d7c328dd630ae457ffd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 5 Jan 2021 00:38:16 +0100 Subject: [PATCH 126/218] Fix cancelling wxWebRequest under MSW A cancelled request is not supposed to end up in the "failed" state, but it did, resulting in showing an error in the webrequest sample after pressing on the "Cancel" button, which was clearly unwanted. --- src/msw/webrequest_winhttp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 49504568aa..46ed71bd7a 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -190,7 +190,13 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: { LPWINHTTP_ASYNC_RESULT asyncResult = reinterpret_cast(lpvStatusInformation); - SetState(wxWebRequest::State_Failed, wxWinHTTPErrorToString(asyncResult->dwError)); + // "Failing" with "cancelled" error is not actually an error if + // we're expecting it, i.e. if our Cancel() had been called. + if ( asyncResult->dwError == ERROR_WINHTTP_OPERATION_CANCELLED && + GetState() == wxWebRequest::State_Cancelled ) + SetState(wxWebRequest::State_Cancelled); + else + SetState(wxWebRequest::State_Failed, wxWinHTTPErrorToString(asyncResult->dwError)); break; } } From d22956a56a549ef9885132d11f3af0d3255b1501 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 5 Jan 2021 00:41:21 +0100 Subject: [PATCH 127/218] Tiny simplification in wxWebRequestWinHTTP code Add and use SetFailed(error) function for symmetry with the existing SetFailedWithLastError(). --- include/wx/msw/private/webrequest_winhttp.h | 6 +++++- src/msw/webrequest_winhttp.cpp | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/wx/msw/private/webrequest_winhttp.h b/include/wx/msw/private/webrequest_winhttp.h index ad21393ec1..91620bc444 100644 --- a/include/wx/msw/private/webrequest_winhttp.h +++ b/include/wx/msw/private/webrequest_winhttp.h @@ -109,7 +109,11 @@ private: void CreateResponse(); - void SetFailedWithLastError(); + // Retrieve the error message corresponding to the given error and set the + // state to failed with this message as error string. + void SetFailed(DWORD errorCode); + + void SetFailedWithLastError() { SetFailed(::GetLastError()); } friend class wxWebAuthChallengeWinHTTP; diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 46ed71bd7a..49532ea78a 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -196,7 +196,7 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, GetState() == wxWebRequest::State_Cancelled ) SetState(wxWebRequest::State_Cancelled); else - SetState(wxWebRequest::State_Failed, wxWinHTTPErrorToString(asyncResult->dwError)); + SetFailed(asyncResult->dwError); break; } } @@ -252,9 +252,9 @@ void wxWebRequestWinHTTP::CreateResponse() SetFailedWithLastError(); } -void wxWebRequestWinHTTP::SetFailedWithLastError() +void wxWebRequestWinHTTP::SetFailed(DWORD errorCode) { - wxString failMessage = wxWinHTTPErrorToString(::GetLastError()); + wxString failMessage = wxWinHTTPErrorToString(errorCode); SetState(wxWebRequest::State_Failed, failMessage); } From ec2ea5c7fa7cde5c6e1e56d601514a1ec3fb0049 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 6 Jan 2021 23:54:51 +0100 Subject: [PATCH 128/218] Handle request still in progress gracefully on shut down Cancel the request and wait until it actually is cancelled when exiting the sample. This is a bit ugly, especially the busy-waiting part, but still better than potentially crashing. --- samples/webrequest/webrequest.cpp | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 51d40eed6c..5b0bb505e2 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -45,6 +45,8 @@ public: // set the frame icon SetIcon(wxICON(sample)); + Bind(wxEVT_CLOSE_WINDOW, &WebRequestFrame::OnClose, this); + // Prepare UI controls wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); @@ -174,6 +176,18 @@ public: &WebRequestFrame::OnProgressTimer, this); } + virtual ~WebRequestFrame() + { + // We have to block until the web request completes, but we need to + // process events while doing it. + Hide(); + + while ( m_currentRequest.IsOk() ) + { + wxYield(); + } + } + void OnStartButton(wxCommandEvent& WXUNUSED(evt)) { wxLogStatus(this, "Started request..."); @@ -376,6 +390,35 @@ public: m_urlTextCtrl->SetValue(defaultURL); } + void OnClose(wxCloseEvent& event) + { + if ( m_currentRequest.IsOk() ) + { + if ( event.CanVeto() ) + { + wxMessageDialog dialog + ( + this, + "A web request is in progress, " + "closing the window will cancel it.", + "Please confirm", + wxYES_NO + ); + dialog.SetYesNoLabels("Cancel and close", "Don't close"); + + if ( dialog.ShowModal() != wxID_YES ) + { + event.Veto(); + return; + } + } + + m_currentRequest.Cancel(); + } + + event.Skip(); + } + private: wxNotebook* m_notebook; wxTextCtrl* m_urlTextCtrl; From c70ac66200829fb8f3fe577f6596fc2f21dde683 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 16:56:04 +0100 Subject: [PATCH 129/218] Simplify and make more robust wxWebSessionWinHTTP initialization Rename Init() to Open() as we need this method to return bool to indicate its success in order to avoid using non-initialized handle later. Init() is also reserved, by convention, for the common part of all class ctors in wx code. Remove m_initialized entirely, it doesn't seem to be obviously better to cache the failure to create a session than to retry doing it every time (in fact, it would seem to be worse) and not having it is simpler. This commit is best viewed ignoring white space. --- include/wx/msw/private/webrequest_winhttp.h | 3 +- src/msw/webrequest_winhttp.cpp | 59 +++++++++++---------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/include/wx/msw/private/webrequest_winhttp.h b/include/wx/msw/private/webrequest_winhttp.h index 91620bc444..dca28f6ce5 100644 --- a/include/wx/msw/private/webrequest_winhttp.h +++ b/include/wx/msw/private/webrequest_winhttp.h @@ -138,10 +138,9 @@ public: HINTERNET GetHandle() const { return m_handle; } private: - bool m_initialized; HINTERNET m_handle; - void Init(); + bool Open(); wxDECLARE_NO_COPY_CLASS(wxWebSessionWinHTTP); }; diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 49532ea78a..a56ce2c585 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -475,7 +475,6 @@ void wxWebAuthChallengeWinHTTP::SetCredentials(const wxString& user, // wxWebSessionWinHTTP::wxWebSessionWinHTTP(): - m_initialized(false), m_handle(NULL) { } @@ -486,7 +485,7 @@ wxWebSessionWinHTTP::~wxWebSessionWinHTTP() ::WinHttpCloseHandle(m_handle); } -void wxWebSessionWinHTTP::Init() +bool wxWebSessionWinHTTP::Open() { DWORD accessType; if ( wxCheckOsVersion(6, 3) ) @@ -497,33 +496,34 @@ void wxWebSessionWinHTTP::Init() m_handle = ::WinHttpOpen(GetHeaders().find("User-Agent")->second.wc_str(), accessType, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, WINHTTP_FLAG_ASYNC); - if ( m_handle != NULL ) + if ( !m_handle ) { - // Try to enable HTTP/2 (available since Win 10 1607) - DWORD protFlags = WINHTTP_PROTOCOL_FLAG_HTTP2; - ::WinHttpSetOption(m_handle, WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL, - &protFlags, sizeof(protFlags)); - - // Try to enable GZIP and DEFLATE (available since Win 8.1) - DWORD decompressFlags = WINHTTP_DECOMPRESSION_FLAG_ALL; - ::WinHttpSetOption(m_handle, WINHTTP_OPTION_DECOMPRESSION, - &decompressFlags, sizeof(decompressFlags)); - - // Try to enable modern TLS for older Windows versions - if ( !wxCheckOsVersion(6, 3) ) - { - DWORD securityFlags = WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | - WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 | - WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 | - WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; - ::WinHttpSetOption(m_handle, WINHTTP_OPTION_SECURE_PROTOCOLS, - &securityFlags, sizeof(securityFlags)); - } - } - else wxLogLastError("WinHttpOpen"); + return false; + } - m_initialized = true; + // Try to enable HTTP/2 (available since Win 10 1607) + DWORD protFlags = WINHTTP_PROTOCOL_FLAG_HTTP2; + ::WinHttpSetOption(m_handle, WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL, + &protFlags, sizeof(protFlags)); + + // Try to enable GZIP and DEFLATE (available since Win 8.1) + DWORD decompressFlags = WINHTTP_DECOMPRESSION_FLAG_ALL; + ::WinHttpSetOption(m_handle, WINHTTP_OPTION_DECOMPRESSION, + &decompressFlags, sizeof(decompressFlags)); + + // Try to enable modern TLS for older Windows versions + if ( !wxCheckOsVersion(6, 3) ) + { + DWORD securityFlags = WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; + ::WinHttpSetOption(m_handle, WINHTTP_OPTION_SECURE_PROTOCOLS, + &securityFlags, sizeof(securityFlags)); + } + + return true; } wxWebRequestImplPtr @@ -532,8 +532,11 @@ wxWebSessionWinHTTP::CreateRequest(wxWebSession& session, const wxString& url, int id) { - if ( !m_initialized ) - Init(); + if ( !m_handle ) + { + if ( !Open() ) + return wxWebRequestImplPtr(); + } return wxWebRequestImplPtr( new wxWebRequestWinHTTP(session, *this, handler, url, id)); From ccd2064ae8e6c243781c7b221a3216f8e90a653c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 17:21:02 +0100 Subject: [PATCH 130/218] Remove unnecessary use of __WXFUNCTION__ from wxLog code Just micro cleanup: there doesn't seem to be any need to show which function we're in as FormatMessage() is only called from a single place anyhow, so shorten and simplify the code. --- src/common/log.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/log.cpp b/src/common/log.cpp index 0084d0033b..968f871ea9 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -1076,8 +1076,8 @@ static const wxChar* GetSysErrorMsg(wxChar* szBuf, size_t sizeBuf, unsigned long NULL ) == 0 ) { - wxLogDebug(wxS("FormatMessage failed with error 0x%lx in %s"), - GetLastError(), __WXFUNCTION__ ? __WXFUNCTION__ : ""); + wxLogDebug(wxS("FormatMessage failed with error 0x%lx"), GetLastError()); + // if this happens, something is seriously wrong, so don't use _() here // for safety wxSprintf(szBuf, wxS("unknown error 0x%lx"), nErrCode); From 2869e1ccd6a4048407bc95f65efd79e59c340a0a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 17:22:04 +0100 Subject: [PATCH 131/218] Implement wxSysErrorMsg() in terms of wxSysErrorMsgStr() Instead of doing it the other way round, as it has several advantages: 1. wxSysErrorMsgStr() is not limited by the static buffer size any longer, i.e. doesn't truncate errors even longer than 1KiB. 2. Code is much simpler and more obviously correct. 3. We avoid an extra and absolutely unnecessary buffer copy. No real changes. --- src/common/log.cpp | 43 ++++++++++++++----------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/src/common/log.cpp b/src/common/log.cpp index 968f871ea9..8c99a88277 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -1056,7 +1056,7 @@ unsigned long wxSysErrorCode() #endif //Win/Unix } -static const wxChar* GetSysErrorMsg(wxChar* szBuf, size_t sizeBuf, unsigned long nErrCode) +wxString wxSysErrorMsgStr(unsigned long nErrCode) { if ( nErrCode == 0 ) nErrCode = wxSysErrorCode(); @@ -1080,33 +1080,29 @@ static const wxChar* GetSysErrorMsg(wxChar* szBuf, size_t sizeBuf, unsigned long // if this happens, something is seriously wrong, so don't use _() here // for safety - wxSprintf(szBuf, wxS("unknown error 0x%lx"), nErrCode); - return szBuf; + return wxString::Format(wxS("unknown error 0x%lx"), nErrCode); } + wxString str; // copy it to our buffer and free memory // Crashes on SmartPhone (FIXME) if( lpMsgBuf != 0 ) { - wxStrlcpy(szBuf, (const wxChar *)lpMsgBuf, sizeBuf); + str = static_cast(lpMsgBuf); LocalFree(lpMsgBuf); // returned string is ended with '\r\n' - bad - size_t len = wxStrlen(szBuf); + size_t len = str.length(); if ( len >= 2 ) { // truncate string - if ( szBuf[len - 2] == wxS('\r') ) - szBuf[len - 2] = wxS('\0'); + if ( str[len - 2] == wxS('\r') ) + str.Truncate(len - 2); } } - else - { - szBuf[0] = wxS('\0'); - } - return szBuf; + return str; #else // !__WINDOWS__ char buffer[1024]; char *errorMsg = buffer; @@ -1123,29 +1119,18 @@ static const wxChar* GetSysErrorMsg(wxChar* szBuf, size_t sizeBuf, unsigned long #endif // at this point errorMsg might not point to buffer anymore - szBuf[0] = wxS('\0'); - #if wxUSE_UNICODE - wxConvCurrent->MB2WC(szBuf, errorMsg, sizeBuf - 1); - szBuf[sizeBuf - 1] = wxS('\0'); - #else - wxStrlcpy(szBuf, errorMsg, sizeBuf); - #endif - return szBuf; + return errorMsg; #endif // __WINDOWS__/!__WINDOWS__ } -// get error message from system +// get error message from system as a char pointer: this function has to use a +// static buffer of fixed size, so should be avoided in favour of the function +// returning wxString const wxChar *wxSysErrorMsg(unsigned long nErrCode) { static wxChar s_szBuf[1024]; - return GetSysErrorMsg(s_szBuf, WXSIZEOF(s_szBuf), nErrCode); -} - -// get error message from system as wxString -wxString wxSysErrorMsgStr(unsigned long nErrCode) -{ - wxChar szBuf[1024]; - return GetSysErrorMsg(szBuf, WXSIZEOF(szBuf), nErrCode); + wxStrlcpy(s_szBuf, wxSysErrorMsgStr(nErrCode), WXSIZEOF(s_szBuf)); + return s_szBuf; } #endif // wxUSE_LOG From 5d256988bec54a3e73b14b31d299cfc4f5bd9804 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 17:41:49 +0100 Subject: [PATCH 132/218] Add wxMSWFormatMessage() and use it from other places Don't duplicate calls to ::FormatMessage(), which is difficult to use correctly, in wxCrashReport and wxWebRequestWinHTTP, but just reuse the same code that was already present in wxSysErrorMsgStr() after refactoring it into a reusable function allowing to specify the module name to use for the error code lookup (before falling back to interpreting it as system error code). This fixes not trimming the trailing "\r\n" from the string in the other places (wxWinHTTPErrorToString() had code to do it, but it was wrong, while wxCrashContext::GetExceptionString() didn't do it at all) and avoids duplication. --- include/wx/msw/private.h | 4 ++++ src/common/log.cpp | 30 ++++++++++++++++++++++-------- src/msw/crashrpt.cpp | 16 ++-------------- src/msw/webrequest_winhttp.cpp | 29 +++-------------------------- 4 files changed, 31 insertions(+), 48 deletions(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index c02ee410a2..cd49453c58 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -972,6 +972,10 @@ enum wxWinVersion WXDLLIMPEXP_BASE wxWinVersion wxGetWinVersion(); +// This is similar to wxSysErrorMsgStr(), but takes an extra HMODULE parameter +// specific to wxMSW. +WXDLLIMPEXP_BASE wxString wxMSWFormatMessage(DWORD nErrCode, HMODULE hModule = 0); + #if wxUSE_GUI && defined(__WXMSW__) // cursor stuff diff --git a/src/common/log.cpp b/src/common/log.cpp index 8c99a88277..f56c912dc7 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -1056,19 +1056,22 @@ unsigned long wxSysErrorCode() #endif //Win/Unix } -wxString wxSysErrorMsgStr(unsigned long nErrCode) -{ - if ( nErrCode == 0 ) - nErrCode = wxSysErrorCode(); - #if defined(__WINDOWS__) + +wxString wxMSWFormatMessage(DWORD nErrCode, HMODULE hModule) +{ + DWORD flags = FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS; + if ( hModule ) + flags |= FORMAT_MESSAGE_FROM_HMODULE; + // get error message from system LPVOID lpMsgBuf; if ( ::FormatMessage ( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, + flags, + hModule, nErrCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, @@ -1103,6 +1106,17 @@ wxString wxSysErrorMsgStr(unsigned long nErrCode) } return str; +} + +#endif // __WINDOWS__ + +wxString wxSysErrorMsgStr(unsigned long nErrCode) +{ + if ( nErrCode == 0 ) + nErrCode = wxSysErrorCode(); + +#if defined(__WINDOWS__) + return wxMSWFormatMessage(nErrCode); #else // !__WINDOWS__ char buffer[1024]; char *errorMsg = buffer; diff --git a/src/msw/crashrpt.cpp b/src/msw/crashrpt.cpp index 437f6634b2..02b23db2d3 100644 --- a/src/msw/crashrpt.cpp +++ b/src/msw/crashrpt.cpp @@ -28,6 +28,7 @@ #include "wx/msw/debughlp.h" #include "wx/msw/crashrpt.h" +#include "wx/msw/private.h" // ---------------------------------------------------------------------------- // classes @@ -356,20 +357,7 @@ wxString wxCrashContext::GetExceptionString() const default: // unknown exception, ask NTDLL for the name - if ( !::FormatMessage - ( - FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_HMODULE, - ::GetModuleHandle(wxT("NTDLL.DLL")), - code, - 0, - wxStringBuffer(s, 1024), - 1024, - 0 - ) ) - { - s.Printf(wxT("UNKNOWN_EXCEPTION(%d)"), code); - } + s = wxMSWFormatMessage(code, ::GetModuleHandle(wxT("NTDLL.DLL"))); } #undef CASE_EXCEPTION diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index a56ce2c585..bba759a2b7 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -16,6 +16,7 @@ #include "wx/mstream.h" #include "wx/uri.h" +#include "wx/msw/private.h" #include "wx/msw/private/webrequest_winhttp.h" #ifndef WX_PRECOMP @@ -59,31 +60,6 @@ // Helper functions -static wxString wxWinHTTPErrorToString(DWORD errorCode) -{ - wxString errorString; - - LPVOID msgBuf; - if ( FormatMessageW( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_HMODULE, - GetModuleHandle(TEXT("WINHTTP")), - errorCode, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPWSTR)&msgBuf, - 0, NULL) ) - { - errorString.assign((LPWSTR)msgBuf); - LocalFree(msgBuf); - // Truncate trailing \n\r - if ( errorString.size() > 2 ) - errorString.resize(errorString.size()); - } - return errorString; -} - static wxString wxWinHTTPQueryHeaderString(HINTERNET hRequest, DWORD dwInfoLevel, LPCWSTR pwszName = WINHTTP_HEADER_NAME_BY_INDEX) { @@ -254,7 +230,8 @@ void wxWebRequestWinHTTP::CreateResponse() void wxWebRequestWinHTTP::SetFailed(DWORD errorCode) { - wxString failMessage = wxWinHTTPErrorToString(errorCode); + wxString failMessage = wxMSWFormatMessage(errorCode, + GetModuleHandle(TEXT("WINHTTP"))); SetState(wxWebRequest::State_Failed, failMessage); } From 8c0855ad2579d64ffd384765c4c5cec6cbd2f171 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 18:44:05 +0100 Subject: [PATCH 133/218] Fix test for invalid WinHTTP session handle INVALID_HANDLE_VALUE is not used for WinHTTP handles and WinHttpOpen() returns NULL (0) and not INVALID_HANDLE_VALUE (-1). --- src/msw/webrequest_winhttp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index bba759a2b7..7010e3c83a 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -458,7 +458,7 @@ wxWebSessionWinHTTP::wxWebSessionWinHTTP(): wxWebSessionWinHTTP::~wxWebSessionWinHTTP() { - if ( m_handle != INVALID_HANDLE_VALUE ) + if ( m_handle ) ::WinHttpCloseHandle(m_handle); } From af13bdde80042ed694f930a71bb6eda0d39783fb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 20:53:30 +0100 Subject: [PATCH 134/218] Remove redundant assignment in wxWebResponseWinHTTP::GetStatus() No changes, just remove the unnecessary line -- status was already initialized as 0. --- src/msw/webrequest_winhttp.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 7010e3c83a..e941ff9bde 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -368,7 +368,6 @@ int wxWebResponseWinHTTP::GetStatus() const WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, WINHTTP_HEADER_NAME_BY_INDEX, &status, &statusSize, 0) ) { - status = 0; wxLogLastError("WinHttpQueryHeaders/status"); } From 5d236edeed4dcd409f6e131fe385ebe9a93b575c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 21:00:38 +0100 Subject: [PATCH 135/218] Ensure wxWebRequest is in idle state before starting it Check that current state is State_Idle in wxWebRequest itself only once instead of doing it in 2 (out of 3) wxWebRequestImpl implementations. Also assert if this is not the case instead of silently doing nothing which would surely be more difficult to debug. --- include/wx/private/webrequest.h | 1 + interface/wx/webrequest.h | 3 +++ src/common/webrequest.cpp | 3 +++ src/common/webrequest_curl.cpp | 3 --- src/msw/webrequest_winhttp.cpp | 3 --- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index b74bbd566b..fca59cf843 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -64,6 +64,7 @@ public: wxWebRequest::Storage GetStorage() const { return m_storage; } + // Precondition for this method checked by caller: current state is idle. virtual void Start() = 0; virtual void Cancel() = 0; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index dcde845b5a..90f3b16db1 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -187,6 +187,9 @@ public: Events will be triggered on success or failure. + The current state must be @c State_Idle, already started requests can't + be started again. + @see Cancel() */ void Start(); diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 58fecf82ec..f5b9c40e3b 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -391,6 +391,9 @@ void wxWebRequest::Start() { wxCHECK_IMPL_VOID(); + wxCHECK_RET( m_impl->GetState() == wxWebRequest::State_Idle, + "Completed requests can not be restarted" ); + m_impl->Start(); } diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 98b43c51aa..f9014ef7bd 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -187,9 +187,6 @@ wxWebRequestCURL::~wxWebRequestCURL() void wxWebRequestCURL::Start() { - if ( GetState() != wxWebRequest::State_Idle ) - return; - m_response.reset(new wxWebResponseCURL(*this)); if ( m_dataSize ) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index e941ff9bde..c48f88ac06 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -237,9 +237,6 @@ void wxWebRequestWinHTTP::SetFailed(DWORD errorCode) void wxWebRequestWinHTTP::Start() { - if ( GetState() != wxWebRequest::State_Idle ) // Completed requests can not be restarted - return; - // Parse the URL wxURI uri(m_url); bool isSecure = uri.GetScheme().IsSameAs("HTTPS", false); From 88a3e9c0a3e16fe36778c191713dc014094cc217 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 21:04:18 +0100 Subject: [PATCH 136/218] Use symbolic constants for HTTP ports and status codes No real changes, just avoid using raw numbers, which is not very readable, notably for HTTP_STATUS_PROXY_AUTH_REQ which is not really a well-known value. --- src/msw/webrequest_winhttp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index c48f88ac06..48e0d130b3 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -208,10 +208,10 @@ void wxWebRequestWinHTTP::CreateResponse() return; int status = m_response->GetStatus(); - if ( status == 401 || status == 407) + if ( status == HTTP_STATUS_DENIED || status == HTTP_STATUS_PROXY_AUTH_REQ ) { m_authChallenge.reset(new wxWebAuthChallengeWinHTTP( - (status == 407) ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); + status == HTTP_STATUS_PROXY_AUTH_REQ ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); if ( m_authChallenge->Init() ) SetState(wxWebRequest::State_Unauthorized, m_response->GetStatusText()); else @@ -243,7 +243,7 @@ void wxWebRequestWinHTTP::Start() int port; if ( !uri.HasPort() ) - port = isSecure ? 443 : 80; + port = isSecure ? INTERNET_DEFAULT_HTTPS_PORT : INTERNET_DEFAULT_HTTP_PORT; else port = wxAtoi(uri.GetPort()); From 8ace65bbecac12133271fff2e203ac314ee0b497 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 21:06:18 +0100 Subject: [PATCH 137/218] Use more readable case-insensitive comparison function IsSameAs(..., false) is not very clear, while CmpNoCase() hopefully is. No real changes. --- src/msw/webrequest_winhttp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 48e0d130b3..21796c977e 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -239,7 +239,7 @@ void wxWebRequestWinHTTP::Start() { // Parse the URL wxURI uri(m_url); - bool isSecure = uri.GetScheme().IsSameAs("HTTPS", false); + const bool isSecure = uri.GetScheme().CmpNoCase("HTTPS") == 0; int port; if ( !uri.HasPort() ) From aa7c6c3aa86e18ae98fad065d70ebad50351492d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 21:23:31 +0100 Subject: [PATCH 138/218] Switch to using WinHTTP for parsing URLs It seems better to rely on the well-tested WinHTTP URL parsing functions rather than on our own wxURI. It should also allow to support any new URI schemas if support for them is ever added to WinHTTP. --- src/msw/webrequest_winhttp.cpp | 38 ++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 21796c977e..a6c6c109aa 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -15,7 +15,6 @@ #if wxUSE_WEBREQUEST_WINHTTP #include "wx/mstream.h" -#include "wx/uri.h" #include "wx/msw/private.h" #include "wx/msw/private/webrequest_winhttp.h" @@ -238,19 +237,28 @@ void wxWebRequestWinHTTP::SetFailed(DWORD errorCode) void wxWebRequestWinHTTP::Start() { // Parse the URL - wxURI uri(m_url); - const bool isSecure = uri.GetScheme().CmpNoCase("HTTPS") == 0; + URL_COMPONENTS urlComps; + wxZeroMemory(urlComps); + urlComps.dwStructSize = sizeof(urlComps); + urlComps.dwSchemeLength = + urlComps.dwHostNameLength = + urlComps.dwUrlPathLength = + urlComps.dwExtraInfoLength = (DWORD)-1; - int port; - if ( !uri.HasPort() ) - port = isSecure ? INTERNET_DEFAULT_HTTPS_PORT : INTERNET_DEFAULT_HTTP_PORT; - else - port = wxAtoi(uri.GetPort()); + if ( !::WinHttpCrackUrl(m_url.wc_str(), m_url.length(), 0, &urlComps) ) + { + SetFailedWithLastError(); + return; + } // Open a connection - m_connect = ::WinHttpConnect( - m_sessionWinHTTP.GetHandle(), - uri.GetServer().wc_str(), port, 0); + m_connect = ::WinHttpConnect + ( + m_sessionWinHTTP.GetHandle(), + wxString(urlComps.lpszHostName, urlComps.dwHostNameLength), + urlComps.nPort, + 0 // reserved + ); if ( m_connect == NULL ) { SetFailedWithLastError(); @@ -265,16 +273,16 @@ void wxWebRequestWinHTTP::Start() else method = "GET"; - wxString objectName = uri.GetPath(); - if ( uri.HasQuery() ) - objectName += "?" + uri.GetQuery(); + wxString objectName(urlComps.lpszUrlPath, urlComps.dwUrlPathLength); + if ( urlComps.dwExtraInfoLength ) + objectName += "?" + wxString(urlComps.lpszExtraInfo, urlComps.dwExtraInfoLength); // Open a request m_request = ::WinHttpOpenRequest(m_connect, method.wc_str(), objectName.wc_str(), NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, - (isSecure) ? WINHTTP_FLAG_SECURE : 0); + urlComps.nScheme == INTERNET_SCHEME_HTTPS ? WINHTTP_FLAG_SECURE : 0); if ( m_request == NULL ) { SetFailedWithLastError(); From 1ebfda6d896f92807eaf254c31d495eb64bb591f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 21:26:17 +0100 Subject: [PATCH 139/218] Remove unnecessary cast from WinHttpSetStatusCallback() call This doesn't seem to be needed, our callback has the correct signature. If it's required for some non-MSVC compilers (e.g. MinGW with old SDK), it would be better to use the cast only conditionally to at least keep the MSVC build type-safe. --- src/msw/webrequest_winhttp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index a6c6c109aa..400bd1ed28 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -291,7 +291,7 @@ void wxWebRequestWinHTTP::Start() // Register callback if ( ::WinHttpSetStatusCallback(m_request, - (WINHTTP_STATUS_CALLBACK)wxRequestStatusCallback, + wxRequestStatusCallback, WINHTTP_CALLBACK_FLAG_READ_COMPLETE | WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE | WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE | From 24c7baa07edf123f295888e6ade29faf456bd5a7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 21:31:41 +0100 Subject: [PATCH 140/218] Add wxRESERVED_PARAM symbolic constant and use it instead of 0 This is more readable than just using "0" or "NULL" and shorter than writing a comment every time. No real changes. --- include/wx/msw/private.h | 4 ++++ src/msw/dialup.cpp | 4 ++-- src/msw/display.cpp | 2 +- src/msw/fontenum.cpp | 2 +- src/msw/registry.cpp | 36 +++++++++++++++------------------- src/msw/treectrl.cpp | 2 +- src/msw/webrequest_winhttp.cpp | 4 ++-- src/msw/window.cpp | 2 +- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index cd49453c58..e172ea0aa6 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -34,6 +34,10 @@ class WXDLLIMPEXP_FWD_CORE wxWindowBase; #define MAX_PATH 260 #endif +// Many MSW functions have parameters which are "reserved". Passing them this +// constant is more clear than just using "0" or "NULL". +#define wxRESERVED_PARAM 0 + // --------------------------------------------------------------------------- // standard icons from the resources // --------------------------------------------------------------------------- diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index 63e489813f..77e9b8d582 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -665,7 +665,7 @@ size_t wxDialUpManagerMSW::GetISPNames(wxArrayString& names) const { dwRet = ms_pfnRasEnumEntries ( - NULL, // reserved + wxRESERVED_PARAM, NULL, // default phone book (or all) rasEntries, // [out] buffer for the entries &size, // [in/out] size of the buffer @@ -963,7 +963,7 @@ bool wxDialUpManagerMSW::IsAlwaysOnline() const if ( pfnInternetGetConnectedState ) { DWORD flags = 0; - if ( pfnInternetGetConnectedState(&flags, 0 /* reserved */) ) + if ( pfnInternetGetConnectedState(&flags, wxRESERVED_PARAM) ) { // there is some connection to the net, see of which type isAlwaysOnline = (flags & (INTERNET_CONNECTION_LAN | diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 582b2c5623..f220fc8ac5 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -454,7 +454,7 @@ bool wxDisplayMSW::ChangeMode(const wxVideoMode& mode) ( GetName().t_str(), // display name pDevMode, // dev mode or NULL to reset - NULL, // reserved + wxRESERVED_PARAM, flags, NULL // pointer to video parameters (not used) ) ) diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp index 863e0469e9..8ff003ff07 100644 --- a/src/msw/fontenum.cpp +++ b/src/msw/fontenum.cpp @@ -147,7 +147,7 @@ void wxFontEnumeratorHelper::DoEnumerate() wxStrlcpy(lf.lfFaceName, m_facename.c_str(), WXSIZEOF(lf.lfFaceName)); lf.lfPitchAndFamily = 0; ::EnumFontFamiliesEx(hDC, &lf, (FONTENUMPROC)wxFontEnumeratorProc, - (LPARAM)this, 0 /* reserved */) ; + (LPARAM)this, wxRESERVED_PARAM) ; ::ReleaseDC(NULL, hDC); } diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 5a291b6e34..a4b14436e7 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -76,10 +76,6 @@ aStdKeys[] = // the registry name separator (perhaps one day MS will change it to '/' ;-) #define REG_SEPARATOR wxT('\\') -// useful for Windows programmers: makes somewhat more clear all these zeroes -// being passed to Windows APIs -#define RESERVED (0) - // ---------------------------------------------------------------------------- // macros // ---------------------------------------------------------------------------- @@ -383,7 +379,7 @@ bool wxRegKey::GetKeyInfo(size_t *pnSubKeys, (HKEY) m_hKey, NULL, // class name NULL, // (ptr to) size of class name buffer - RESERVED, + wxRESERVED_PARAM, REG_PARAM(SubKeys), // [out] number of subkeys REG_PARAM(MaxKeyLen), // [out] max length of a subkey name NULL, // longest subkey class name @@ -437,7 +433,7 @@ bool wxRegKey::Open(AccessMode mode) ( (HKEY) m_hRootKey, m_strKey.t_str(), - RESERVED, + wxRESERVED_PARAM, GetMSWAccessFlags(mode, m_viewMode), &tmpKey ); @@ -468,7 +464,7 @@ bool wxRegKey::Create(bool bOkIfExists) HKEY tmpKey; DWORD disposition; m_dwLastError = RegCreateKeyEx((HKEY) m_hRootKey, m_strKey.t_str(), - 0, // reserved and must be 0 + wxRESERVED_PARAM, NULL, // The user-defined class type of this key. REG_OPTION_NON_VOLATILE, // supports other values as well; see MS docs GetMSWAccessFlags(wxRegKey::Write, m_viewMode), @@ -756,7 +752,7 @@ bool wxRegKey::DeleteSelf() { m_dwLastError = (*pfnRegDeleteKeyEx)((HKEY) m_hRootKey, m_strKey.t_str(), GetMSWViewFlags(m_viewMode), - 0); // This parameter is reserved and must be zero. + wxRESERVED_PARAM); } else #endif // wxUSE_DYNLIB_CLASS @@ -817,7 +813,7 @@ bool wxRegKey::HasValue(const wxString& szValue) const LONG dwRet = ::RegQueryValueEx((HKEY) m_hKey, RegValueStr(szValue), - RESERVED, + wxRESERVED_PARAM, NULL, NULL, NULL); return dwRet == ERROR_SUCCESS; } @@ -864,7 +860,7 @@ wxRegKey::ValueType wxRegKey::GetValueType(const wxString& szValue) const return Type_None; DWORD dwType; - m_dwLastError = RegQueryValueEx((HKEY) m_hKey, RegValueStr(szValue), RESERVED, + m_dwLastError = RegQueryValueEx((HKEY) m_hKey, RegValueStr(szValue), wxRESERVED_PARAM, &dwType, NULL, NULL); if ( m_dwLastError != ERROR_SUCCESS ) { wxLogSysError(m_dwLastError, _("Can't read value of key '%s'"), @@ -879,7 +875,7 @@ bool wxRegKey::SetValue(const wxString& szValue, long lValue) { if ( CONST_CAST Open() ) { m_dwLastError = RegSetValueEx((HKEY) m_hKey, RegValueStr(szValue), - (DWORD) RESERVED, REG_DWORD, + wxRESERVED_PARAM, REG_DWORD, (RegString)&lValue, sizeof(lValue)); if ( m_dwLastError == ERROR_SUCCESS ) return true; @@ -896,7 +892,7 @@ bool wxRegKey::QueryValue(const wxString& szValue, long *plValue) const DWORD dwType, dwSize = sizeof(DWORD); RegString pBuf = (RegString)plValue; m_dwLastError = RegQueryValueEx((HKEY) m_hKey, RegValueStr(szValue), - RESERVED, + wxRESERVED_PARAM, &dwType, pBuf, &dwSize); if ( m_dwLastError != ERROR_SUCCESS ) { wxLogSysError(m_dwLastError, _("Can't read value of key '%s'"), @@ -921,7 +917,7 @@ bool wxRegKey::SetValue(const wxString& szValue, const wxMemoryBuffer& buffer) { if ( CONST_CAST Open() ) { m_dwLastError = RegSetValueEx((HKEY) m_hKey, RegValueStr(szValue), - (DWORD) RESERVED, REG_BINARY, + wxRESERVED_PARAM, REG_BINARY, (RegBinary)buffer.GetData(),buffer.GetDataLen()); if ( m_dwLastError == ERROR_SUCCESS ) return true; @@ -938,7 +934,7 @@ bool wxRegKey::QueryValue(const wxString& szValue, wxMemoryBuffer& buffer) const // first get the type and size of the data DWORD dwType, dwSize; m_dwLastError = RegQueryValueEx((HKEY) m_hKey, RegValueStr(szValue), - RESERVED, + wxRESERVED_PARAM, &dwType, NULL, &dwSize); if ( m_dwLastError == ERROR_SUCCESS ) { @@ -952,7 +948,7 @@ bool wxRegKey::QueryValue(const wxString& szValue, wxMemoryBuffer& buffer) const const RegBinary pBuf = (RegBinary)buffer.GetWriteBuf(dwSize); m_dwLastError = RegQueryValueEx((HKEY) m_hKey, RegValueStr(szValue), - RESERVED, + wxRESERVED_PARAM, &dwType, pBuf, &dwSize); @@ -986,7 +982,7 @@ bool wxRegKey::QueryValue(const wxString& szValue, DWORD dwType=REG_NONE, dwSize=0; m_dwLastError = RegQueryValueEx((HKEY) m_hKey, RegValueStr(szValue), - RESERVED, + wxRESERVED_PARAM, &dwType, NULL, &dwSize); if ( m_dwLastError == ERROR_SUCCESS ) { @@ -1012,7 +1008,7 @@ bool wxRegKey::QueryValue(const wxString& szValue, wxStringBufferLength strBuf(strValue, chars); m_dwLastError = RegQueryValueEx((HKEY) m_hKey, RegValueStr(szValue), - RESERVED, + wxRESERVED_PARAM, &dwType, (RegString)(wxChar*)strBuf, &dwSize); @@ -1063,7 +1059,7 @@ bool wxRegKey::SetValue(const wxString& szValue, const wxString& strValue) if ( CONST_CAST Open() ) { m_dwLastError = RegSetValueEx((HKEY) m_hKey, RegValueStr(szValue), - (DWORD) RESERVED, REG_SZ, + wxRESERVED_PARAM, REG_SZ, reinterpret_cast(wxMSW_CONV_LPCTSTR(strValue)), (strValue.Len() + 1)*sizeof(wxChar)); if ( m_dwLastError == ERROR_SUCCESS ) @@ -1110,7 +1106,7 @@ bool wxRegKey::GetNextValue(wxString& strValueName, long& lIndex) const m_dwLastError = RegEnumValue((HKEY) m_hKey, lIndex++, szValueName, &dwValueLen, - RESERVED, + wxRESERVED_PARAM, NULL, // [out] type NULL, // [out] buffer for value NULL); // [i/o] it's length @@ -1484,7 +1480,7 @@ bool KeyExists(WXHKEY hRootKey, ( (HKEY)hRootKey, szKey.t_str(), - RESERVED, + wxRESERVED_PARAM, // we might not have enough rights for rw access GetMSWAccessFlags(wxRegKey::Read, viewMode), &hkeyDummy diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 4ffad2d45e..735af50d56 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -2218,7 +2218,7 @@ void wxTreeCtrl::SortChildren(const wxTreeItemId& item) tvSort.hParent = HITEM(item); tvSort.lpfnCompare = wxTreeSortHelper::Compare; tvSort.lParam = (LPARAM)this; - if ( !TreeView_SortChildrenCB(GetHwnd(), &tvSort, 0 /* reserved */) ) + if ( !TreeView_SortChildrenCB(GetHwnd(), &tvSort, wxRESERVED_PARAM) ) wxLogLastError(wxS("TreeView_SortChildrenCB()")); } } diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 400bd1ed28..07ad198989 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -257,7 +257,7 @@ void wxWebRequestWinHTTP::Start() m_sessionWinHTTP.GetHandle(), wxString(urlComps.lpszHostName, urlComps.dwHostNameLength), urlComps.nPort, - 0 // reserved + wxRESERVED_PARAM ); if ( m_connect == NULL ) { @@ -296,7 +296,7 @@ void wxWebRequestWinHTTP::Start() WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE | WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE | WINHTTP_CALLBACK_FLAG_REQUEST_ERROR, - 0) == WINHTTP_INVALID_STATUS_CALLBACK ) + wxRESERVED_PARAM) == WINHTTP_INVALID_STATUS_CALLBACK ) { SetFailedWithLastError(); return; diff --git a/src/msw/window.cpp b/src/msw/window.cpp index c233df3354..88e30cb4d4 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -997,7 +997,7 @@ bool wxWindowMSW::EnableTouchEvents(int eventsMask) if ( !GestureFuncs::SetGestureConfig() ( m_hWnd, - 0, // Reserved, must be always 0. + wxRESERVED_PARAM, numConfigs, // Number of gesture configurations. ptrConfigs, // Pointer to the first one. sizeof(GESTURECONFIG) // Size of each configuration. From 780ce796b4b35466a6f4cea8b30fa89914f3367b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 21:50:26 +0100 Subject: [PATCH 141/218] Add wxWinHTTPSetOption() helper This allows to avoid using temporary variables just to be able to pass a pointer to them to WinHttpSetOption(). No real changes, just a simplification. --- src/msw/webrequest_winhttp.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 07ad198989..c99977a3de 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -95,6 +95,12 @@ static wxString wxWinHTTPQueryOptionString(HINTERNET hInternet, DWORD dwOption) return result; } +static inline +void wxWinHTTPSetOption(HINTERNET hInternet, DWORD dwOption, DWORD dwValue) +{ + ::WinHttpSetOption(hInternet, dwOption, &dwValue, sizeof(dwValue)); +} + static void CALLBACK wxRequestStatusCallback( HINTERNET WXUNUSED(hInternet), DWORD_PTR dwContext, @@ -484,24 +490,21 @@ bool wxWebSessionWinHTTP::Open() } // Try to enable HTTP/2 (available since Win 10 1607) - DWORD protFlags = WINHTTP_PROTOCOL_FLAG_HTTP2; - ::WinHttpSetOption(m_handle, WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL, - &protFlags, sizeof(protFlags)); + wxWinHTTPSetOption(m_handle, WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL, + WINHTTP_PROTOCOL_FLAG_HTTP2); // Try to enable GZIP and DEFLATE (available since Win 8.1) - DWORD decompressFlags = WINHTTP_DECOMPRESSION_FLAG_ALL; - ::WinHttpSetOption(m_handle, WINHTTP_OPTION_DECOMPRESSION, - &decompressFlags, sizeof(decompressFlags)); + wxWinHTTPSetOption(m_handle, WINHTTP_OPTION_DECOMPRESSION, + WINHTTP_DECOMPRESSION_FLAG_ALL); // Try to enable modern TLS for older Windows versions if ( !wxCheckOsVersion(6, 3) ) { - DWORD securityFlags = WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | - WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 | - WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 | - WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; - ::WinHttpSetOption(m_handle, WINHTTP_OPTION_SECURE_PROTOCOLS, - &securityFlags, sizeof(securityFlags)); + wxWinHTTPSetOption(m_handle, WINHTTP_OPTION_SECURE_PROTOCOLS, + WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2); } return true; From 6bb2a3b457f9fe655f40ec0de4455c60e5717dc2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 21:51:38 +0100 Subject: [PATCH 142/218] Reformat WinHTTP code No real changes, just try to avoid over long lines. Also use early returns in case of WinHTTP functions failures everywhere for consistency. This commit is best viewed ignoring whitespace-only changes. --- src/msw/webrequest_winhttp.cpp | 274 +++++++++++++++++++++------------ 1 file changed, 174 insertions(+), 100 deletions(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index c99977a3de..654866cd39 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -144,8 +144,10 @@ wxWebRequestWinHTTP::~wxWebRequestWinHTTP() ::WinHttpCloseHandle(m_connect); } -void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, - LPVOID lpvStatusInformation, DWORD dwStatusInformationLength) +void +wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, + LPVOID lpvStatusInformation, + DWORD dwStatusInformationLength) { switch ( dwInternetStatus ) { @@ -155,22 +157,29 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, else CreateResponse(); break; + case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: if ( dwStatusInformationLength > 0 ) { - if ( !m_response->ReportAvailableData(dwStatusInformationLength) && - GetState() != wxWebRequest::State_Cancelled ) + if ( !m_response->ReportAvailableData(dwStatusInformationLength) + && GetState() != wxWebRequest::State_Cancelled ) SetFailedWithLastError(); } else + { SetState(wxWebRequest::State_Completed); + } break; + case WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE: WriteData(); break; + case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: { - LPWINHTTP_ASYNC_RESULT asyncResult = reinterpret_cast(lpvStatusInformation); + LPWINHTTP_ASYNC_RESULT + asyncResult = reinterpret_cast(lpvStatusInformation); + // "Failing" with "cancelled" error is not actually an error if // we're expecting it, i.e. if our Cancel() had been called. if ( asyncResult->dwError == ERROR_WINHTTP_OPERATION_CANCELLED && @@ -188,49 +197,67 @@ void wxWebRequestWinHTTP::WriteData() int dataWriteSize = 8 * 1024; if ( m_dataWritten + dataWriteSize > m_dataSize ) dataWriteSize = m_dataSize - m_dataWritten; - if ( dataWriteSize ) + if ( !dataWriteSize ) { - m_dataWriteBuffer.Clear(); - m_dataWriteBuffer.GetWriteBuf(dataWriteSize); - m_dataStream->Read(m_dataWriteBuffer.GetData(), dataWriteSize); - - if ( !::WinHttpWriteData(m_request, m_dataWriteBuffer.GetData(), dataWriteSize, NULL) ) - SetFailedWithLastError(); - m_dataWritten += dataWriteSize; - } - else CreateResponse(); + return; + } + + m_dataWriteBuffer.Clear(); + m_dataWriteBuffer.GetWriteBuf(dataWriteSize); + m_dataStream->Read(m_dataWriteBuffer.GetData(), dataWriteSize); + + if ( !::WinHttpWriteData + ( + m_request, + m_dataWriteBuffer.GetData(), + dataWriteSize, + NULL // [out] bytes written, must be null in async mode + ) ) + { + SetFailedWithLastError(); + return; + } + + m_dataWritten += dataWriteSize; } void wxWebRequestWinHTTP::CreateResponse() { - if ( ::WinHttpReceiveResponse(m_request, NULL) ) + if ( !::WinHttpReceiveResponse(m_request, NULL) ) { - m_response.reset(new wxWebResponseWinHTTP(*this)); - // wxWebResponseWinHTTP ctor could have changed the state if its - // initialization failed, so check for this. - if ( GetState() == wxWebRequest::State_Failed ) - return; - - int status = m_response->GetStatus(); - if ( status == HTTP_STATUS_DENIED || status == HTTP_STATUS_PROXY_AUTH_REQ ) - { - m_authChallenge.reset(new wxWebAuthChallengeWinHTTP( - status == HTTP_STATUS_PROXY_AUTH_REQ ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); - if ( m_authChallenge->Init() ) - SetState(wxWebRequest::State_Unauthorized, m_response->GetStatusText()); - else - SetFailedWithLastError(); - } - else if ( CheckServerStatus() ) - { - // Start reading the response - if ( !m_response->ReadData() ) - SetFailedWithLastError(); - } - } - else SetFailedWithLastError(); + return; + } + + m_response.reset(new wxWebResponseWinHTTP(*this)); + // wxWebResponseWinHTTP ctor could have changed the state if its + // initialization failed, so check for this. + if ( GetState() == wxWebRequest::State_Failed ) + return; + + int status = m_response->GetStatus(); + if ( status == HTTP_STATUS_DENIED || status == HTTP_STATUS_PROXY_AUTH_REQ ) + { + m_authChallenge.reset(new wxWebAuthChallengeWinHTTP + ( + status == HTTP_STATUS_PROXY_AUTH_REQ + ? wxWebAuthChallenge::Source_Proxy + : wxWebAuthChallenge::Source_Server, + *this + )); + + if ( m_authChallenge->Init() ) + SetState(wxWebRequest::State_Unauthorized, m_response->GetStatusText()); + else + SetFailedWithLastError(); + } + else if ( CheckServerStatus() ) + { + // Start reading the response + if ( !m_response->ReadData() ) + SetFailedWithLastError(); + } } void wxWebRequestWinHTTP::SetFailed(DWORD errorCode) @@ -284,11 +311,17 @@ void wxWebRequestWinHTTP::Start() objectName += "?" + wxString(urlComps.lpszExtraInfo, urlComps.dwExtraInfoLength); // Open a request - m_request = ::WinHttpOpenRequest(m_connect, - method.wc_str(), objectName.wc_str(), - NULL, WINHTTP_NO_REFERER, - WINHTTP_DEFAULT_ACCEPT_TYPES, - urlComps.nScheme == INTERNET_SCHEME_HTTPS ? WINHTTP_FLAG_SECURE : 0); + m_request = ::WinHttpOpenRequest + ( + m_connect, + method.wc_str(), objectName.wc_str(), + NULL, // protocol version: use default, i.e. HTTP/1.1 + WINHTTP_NO_REFERER, + WINHTTP_DEFAULT_ACCEPT_TYPES, + urlComps.nScheme == INTERNET_SCHEME_HTTPS + ? WINHTTP_FLAG_SECURE + : 0 + ); if ( m_request == NULL ) { SetFailedWithLastError(); @@ -296,13 +329,16 @@ void wxWebRequestWinHTTP::Start() } // Register callback - if ( ::WinHttpSetStatusCallback(m_request, - wxRequestStatusCallback, - WINHTTP_CALLBACK_FLAG_READ_COMPLETE | - WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE | - WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE | - WINHTTP_CALLBACK_FLAG_REQUEST_ERROR, - wxRESERVED_PARAM) == WINHTTP_INVALID_STATUS_CALLBACK ) + if ( ::WinHttpSetStatusCallback + ( + m_request, + wxRequestStatusCallback, + WINHTTP_CALLBACK_FLAG_READ_COMPLETE | + WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE | + WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE | + WINHTTP_CALLBACK_FLAG_REQUEST_ERROR, + wxRESERVED_PARAM + ) == WINHTTP_INVALID_STATUS_CALLBACK ) { SetFailedWithLastError(); return; @@ -315,22 +351,31 @@ void wxWebRequestWinHTTP::SendRequest() { // Combine all headers to a string wxString allHeaders; - for ( wxWebRequestHeaderMap::const_iterator header = m_headers.begin(); header != m_headers.end(); ++header ) + for ( wxWebRequestHeaderMap::const_iterator header = m_headers.begin(); + header != m_headers.end(); + ++header ) + { allHeaders.append(wxString::Format("%s: %s\n", header->first, header->second)); + } if ( m_dataSize ) m_dataWritten = 0; // Send request - if ( ::WinHttpSendRequest(m_request, - allHeaders.wc_str(), allHeaders.length(), - NULL, 0, m_dataSize, - (DWORD_PTR)this) ) + if ( !::WinHttpSendRequest + ( + m_request, + allHeaders.wc_str(), allHeaders.length(), + NULL, 0, // No extra optional data right now + m_dataSize, + (DWORD_PTR)this + ) ) { - SetState(wxWebRequest::State_Active); - } - else SetFailedWithLastError(); + return; + } + + SetState(wxWebRequest::State_Active); } void wxWebRequestWinHTTP::Cancel() @@ -351,10 +396,10 @@ wxWebResponseWinHTTP::wxWebResponseWinHTTP(wxWebRequestWinHTTP& request): wxWebResponseImpl(request), m_requestHandle(request.GetHandle()) { - wxString contentLengthStr = wxWinHTTPQueryHeaderString(m_requestHandle, - WINHTTP_QUERY_CONTENT_LENGTH); + const wxString contentLengthStr = + wxWinHTTPQueryHeaderString(m_requestHandle, WINHTTP_QUERY_CONTENT_LENGTH); if ( contentLengthStr.empty() || - !contentLengthStr.ToLongLong(&m_contentLength) ) + !contentLengthStr.ToLongLong(&m_contentLength) ) m_contentLength = -1; Init(); @@ -367,17 +412,23 @@ wxString wxWebResponseWinHTTP::GetURL() const wxString wxWebResponseWinHTTP::GetHeader(const wxString& name) const { - return wxWinHTTPQueryHeaderString(m_requestHandle, - WINHTTP_QUERY_CUSTOM, name.wc_str()); + return wxWinHTTPQueryHeaderString(m_requestHandle, WINHTTP_QUERY_CUSTOM, + name.wc_str()); } int wxWebResponseWinHTTP::GetStatus() const { DWORD status = 0; DWORD statusSize = sizeof(status); - if ( !::WinHttpQueryHeaders(m_requestHandle, - WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, - WINHTTP_HEADER_NAME_BY_INDEX, &status, &statusSize, 0) ) + if ( !::WinHttpQueryHeaders + ( + m_requestHandle, + WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, + WINHTTP_HEADER_NAME_BY_INDEX, + &status, + &statusSize, + 0 // header index, unused with status code "header" + ) ) { wxLogLastError("WinHttpQueryHeaders/status"); } @@ -392,11 +443,13 @@ wxString wxWebResponseWinHTTP::GetStatusText() const bool wxWebResponseWinHTTP::ReadData() { - if ( ::WinHttpReadData(m_requestHandle, - GetDataBuffer(m_readSize), m_readSize, NULL) ) - return true; - else - return false; + return ::WinHttpReadData + ( + m_requestHandle, + GetDataBuffer(m_readSize), + m_readSize, + NULL // [out] bytes read, must be null in async mode + ) == TRUE; } bool wxWebResponseWinHTTP::ReportAvailableData(DWORD dataLen) @@ -423,37 +476,53 @@ bool wxWebAuthChallengeWinHTTP::Init() DWORD supportedSchemes; DWORD firstScheme; - if ( ::WinHttpQueryAuthSchemes(m_request.GetHandle(), - &supportedSchemes, &firstScheme, &m_target) ) + if ( !::WinHttpQueryAuthSchemes + ( + m_request.GetHandle(), + &supportedSchemes, + &firstScheme, + &m_target + ) ) { - if ( supportedSchemes & WINHTTP_AUTH_SCHEME_NEGOTIATE ) - m_selectedScheme = WINHTTP_AUTH_SCHEME_NEGOTIATE; - else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_NTLM ) - m_selectedScheme = WINHTTP_AUTH_SCHEME_NTLM; - else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_PASSPORT ) - m_selectedScheme = WINHTTP_AUTH_SCHEME_PASSPORT; - else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_DIGEST ) - m_selectedScheme = WINHTTP_AUTH_SCHEME_DIGEST; - else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_BASIC ) - m_selectedScheme = WINHTTP_AUTH_SCHEME_BASIC; - else - m_selectedScheme = 0; - - if ( m_selectedScheme ) - return true; + wxLogLastError("WinHttpQueryAuthSchemes"); + return false; } - return false; + if ( supportedSchemes & WINHTTP_AUTH_SCHEME_NEGOTIATE ) + m_selectedScheme = WINHTTP_AUTH_SCHEME_NEGOTIATE; + else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_NTLM ) + m_selectedScheme = WINHTTP_AUTH_SCHEME_NTLM; + else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_PASSPORT ) + m_selectedScheme = WINHTTP_AUTH_SCHEME_PASSPORT; + else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_DIGEST ) + m_selectedScheme = WINHTTP_AUTH_SCHEME_DIGEST; + else if ( supportedSchemes & WINHTTP_AUTH_SCHEME_BASIC ) + m_selectedScheme = WINHTTP_AUTH_SCHEME_BASIC; + else + m_selectedScheme = 0; + + return m_selectedScheme != 0; } -void wxWebAuthChallengeWinHTTP::SetCredentials(const wxString& user, - const wxString& password) +void +wxWebAuthChallengeWinHTTP::SetCredentials(const wxString& user, + const wxString& password) { - if ( ::WinHttpSetCredentials(m_request.GetHandle(), m_target, m_selectedScheme, - user.wc_str(), password.wc_str(), NULL) ) - m_request.SendRequest(); - else + if ( !::WinHttpSetCredentials + ( + m_request.GetHandle(), + m_target, + m_selectedScheme, + user.wc_str(), + password.wc_str(), + wxRESERVED_PARAM + ) ) + { m_request.SetFailedWithLastError(); + return; + } + + m_request.SendRequest(); } @@ -480,9 +549,14 @@ bool wxWebSessionWinHTTP::Open() else accessType = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY; - m_handle = ::WinHttpOpen(GetHeaders().find("User-Agent")->second.wc_str(), accessType, - WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, - WINHTTP_FLAG_ASYNC); + m_handle = ::WinHttpOpen + ( + GetHeaders().find("User-Agent")->second.wc_str(), + accessType, + WINHTTP_NO_PROXY_NAME, + WINHTTP_NO_PROXY_BYPASS, + WINHTTP_FLAG_ASYNC + ); if ( !m_handle ) { wxLogLastError("WinHttpOpen"); From b64ad7f06d1a4042793ddacf0c63e1a20059ff0b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 00:33:39 +0100 Subject: [PATCH 143/218] Test Basic, not Digest, authentication method in the test Basic authentication method unit test somehow used Digest authentication method. --- tests/net/webrequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index cb8caede1e..20c7843881 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -194,7 +194,7 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") return; } - Create("/digest-auth/auth/wxtest/wxwidgets"); + Create("/basic-auth/wxtest/wxwidgets"); Run(wxWebRequest::State_Unauthorized, 401); REQUIRE( request.GetAuthChallenge().IsOk() ); request.GetAuthChallenge().SetCredentials("wxtest", "wxwidgets"); From 8820bb960952630c0569041c83d32a1bed0bbc02 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 00:41:05 +0100 Subject: [PATCH 144/218] Test using wrong credentials in the auth unit tests too In addition to verifying that the correct password works, check that using a wrong one does not. --- tests/net/webrequest.cpp | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 20c7843881..d5ed0a5958 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -197,10 +197,22 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") Create("/basic-auth/wxtest/wxwidgets"); Run(wxWebRequest::State_Unauthorized, 401); REQUIRE( request.GetAuthChallenge().IsOk() ); - request.GetAuthChallenge().SetCredentials("wxtest", "wxwidgets"); - loop.Run(); - REQUIRE( request.GetResponse().GetStatus() == 200 ); - REQUIRE( request.GetState() == wxWebRequest::State_Completed ); + + SECTION("Good password") + { + request.GetAuthChallenge().SetCredentials("wxtest", "wxwidgets"); + loop.Run(); + CHECK( request.GetResponse().GetStatus() == 200 ); + CHECK( request.GetState() == wxWebRequest::State_Completed ); + } + + SECTION("Bad password") + { + request.GetAuthChallenge().SetCredentials("wxtest", "foobar"); + loop.Run(); + CHECK( request.GetResponse().GetStatus() == 401 ); + CHECK( request.GetState() == wxWebRequest::State_Unauthorized ); + } } SECTION("Server auth DIGEST") @@ -214,10 +226,22 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") Create("/digest-auth/auth/wxtest/wxwidgets"); Run(wxWebRequest::State_Unauthorized, 401); REQUIRE( request.GetAuthChallenge().IsOk() ); - request.GetAuthChallenge().SetCredentials("wxtest", "wxwidgets"); - loop.Run(); - REQUIRE( request.GetResponse().GetStatus() == 200 ); - REQUIRE( request.GetState() == wxWebRequest::State_Completed ); + + SECTION("Good password") + { + request.GetAuthChallenge().SetCredentials("wxtest", "wxwidgets"); + loop.Run(); + CHECK( request.GetResponse().GetStatus() == 200 ); + CHECK( request.GetState() == wxWebRequest::State_Completed ); + } + + SECTION("Bad password") + { + request.GetAuthChallenge().SetCredentials("foo", "bar"); + loop.Run(); + CHECK( request.GetResponse().GetStatus() == 401 ); + CHECK( request.GetState() == wxWebRequest::State_Unauthorized ); + } } } From f8aa5785ce170e5881fb9c3aac12b839ab49aaab Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 01:20:47 +0100 Subject: [PATCH 145/218] Make wxSecretValue always available, even when !wxUSE_SECRETSTORE This allows to write the code using this class without peppering it with wxUSE_SECRETSTORE checks that would otherwise be necessary to support Unix builds on system without libsecret. No real changes. --- include/wx/secretstore.h | 66 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/include/wx/secretstore.h b/include/wx/secretstore.h index 71c0c4cc64..cf74a5c983 100644 --- a/include/wx/secretstore.h +++ b/include/wx/secretstore.h @@ -12,10 +12,10 @@ #include "wx/defs.h" -#if wxUSE_SECRETSTORE - #include "wx/string.h" +#if wxUSE_SECRETSTORE + // Initial version of wxSecretStore required passing user name to Load(), which // didn't make much sense without support for multiple usernames per service, // so the API was changed to load the username too. Test for this symbol to @@ -168,6 +168,66 @@ private: wxSecretStoreImpl* const m_impl; }; -#endif // wxUSE_SECRETSTORE +#else // !wxUSE_SECRETSTORE + +// Provide stand in for wxSecretValue allowing to use it without having #if +// wxUSE_SECRETSTORE checks everywhere. Unlike the real version, this class +// doesn't provide any added security. +class wxSecretValue +{ +public: + wxSecretValue() { m_valid = false; } + + wxSecretValue(size_t size, const void *data) + { + Init(size, data); + } + + explicit wxSecretValue(const wxString& secret) + { + const wxScopedCharBuffer buf(secret.utf8_str()); + Init(buf.length(), buf.data()); + } + + bool IsOk() const { return m_valid; } + + bool operator==(const wxSecretValue& other) const + { + return m_valid == other.m_valid && m_data == other.m_data; + } + + bool operator!=(const wxSecretValue& other) const + { + return !(*this == other); + } + + size_t GetSize() const { return m_data.utf8_str().length(); } + + const void *GetData() const { return m_data.utf8_str().data(); } + + wxString GetAsString(const wxMBConv& conv = wxConvWhateverWorks) const + { + wxUnusedVar(conv); + return m_data; + } + + static void Wipe(size_t size, void *data) { memset(data, 0, size); } + static void WipeString(wxString& str) + { + str.assign(str.length(), '*'); + str.clear(); + } + +private: + void Init(size_t size, const void *data) + { + m_data = wxString::From8BitData(static_cast(data), size); + } + + wxString m_data; + bool m_valid; +}; + +#endif // wxUSE_SECRETSTORE/!wxUSE_SECRETSTORE #endif // _WX_SECRETSTORE_H_ From fe197d752764aa5c7c50da7d216fb67a0e833412 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 01:21:45 +0100 Subject: [PATCH 146/218] Add small wxSecretString helper for wiping strings values This is simpler and more robust than remembering to call WipeString() manually. --- include/wx/secretstore.h | 26 ++++++++++++++++++++++++++ interface/wx/secretstore.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/include/wx/secretstore.h b/include/wx/secretstore.h index cf74a5c983..989a1a33c9 100644 --- a/include/wx/secretstore.h +++ b/include/wx/secretstore.h @@ -230,4 +230,30 @@ private: #endif // wxUSE_SECRETSTORE/!wxUSE_SECRETSTORE +// Helper class ensuring WipeString() is called. +// +// It should only be used as a local variable and never polymorphically. +class wxSecretString : public wxString +{ +public: + wxSecretString() + { + } + + wxSecretString(const wxString& value) + : wxString(value) + { + } + + explicit wxSecretString(const wxSecretValue& value) + : wxString(value.GetAsString()) + { + } + + ~wxSecretString() + { + wxSecretValue::WipeString(*this); + } +}; + #endif // _WX_SECRETSTORE_H_ diff --git a/interface/wx/secretstore.h b/interface/wx/secretstore.h index 0a8c4afad0..f094e702de 100644 --- a/interface/wx/secretstore.h +++ b/interface/wx/secretstore.h @@ -7,6 +7,42 @@ ///////////////////////////////////////////////////////////////////////////// +/** + Temporary string whose contents will be overwritten when it is destroyed. + + Objects of this class must not be used polymorphically as it derives from + wxString which doesn't have a virtual destructor. Typically, they are used + as local variables, e.g. + @code + void TryToAuthenticate(const wxString& secretValue) + { + wxSecretString password(secretValue); + + ... use password as any wxString ... + + // Here password memory is overwritten to prevent the password from + // remaining in memory. + } + @endcode + + @since 3.1.5 + */ +class wxSecretString : public wxString +{ +public: + /// Default constructor creates an empty string. + wxSecretString(); + + /// Constructor from a plain string. + wxSecretString(const wxString& value); + + /// Constructor from a secret value. + explicit wxSecretString(const wxSecretValue& value); + + /// Destructor calls wxSecretValue::WipeString() + ~wxSecretString(); +}; + /** Represents the value of a secret in wxSecretStore. @@ -131,6 +167,8 @@ public: /** Overwrite the contents of the given string. + + @see wxSecretString */ static void WipeString(wxString& str); }; From 1e6d6be8bb3cb52aec65df19477abfbff7b822cf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 01:22:40 +0100 Subject: [PATCH 147/218] Add wxWebCredentials and use it in SetCredentials() Prefer using a class encapsulating both the user name and the password to using a pair of variables. --- include/wx/msw/private/webrequest_winhttp.h | 2 +- include/wx/private/webrequest.h | 3 +- include/wx/private/webrequest_curl.h | 2 +- include/wx/webrequest.h | 19 +++++++- interface/wx/webrequest.h | 48 ++++++++++++++++++--- src/common/webrequest.cpp | 5 +-- src/common/webrequest_curl.cpp | 10 ++++- src/msw/webrequest_winhttp.cpp | 7 ++- tests/net/webrequest.cpp | 15 +++++-- 9 files changed, 87 insertions(+), 24 deletions(-) diff --git a/include/wx/msw/private/webrequest_winhttp.h b/include/wx/msw/private/webrequest_winhttp.h index dca28f6ce5..044da9a9e5 100644 --- a/include/wx/msw/private/webrequest_winhttp.h +++ b/include/wx/msw/private/webrequest_winhttp.h @@ -53,7 +53,7 @@ public: bool Init(); - void SetCredentials(const wxString& user, const wxString& password) wxOVERRIDE; + void SetCredentials(const wxWebCredentials& cred) wxOVERRIDE; private: wxWebRequestWinHTTP& m_request; diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index fca59cf843..69e94d8dbb 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -27,8 +27,7 @@ public: wxWebAuthChallenge::Source GetSource() const { return m_source; } - virtual void - SetCredentials(const wxString& user, const wxString& password) = 0; + virtual void SetCredentials(const wxWebCredentials& cred) = 0; protected: explicit wxWebAuthChallengeImpl(wxWebAuthChallenge::Source source) diff --git a/include/wx/private/webrequest_curl.h b/include/wx/private/webrequest_curl.h index 42669a5530..f31adb806f 100644 --- a/include/wx/private/webrequest_curl.h +++ b/include/wx/private/webrequest_curl.h @@ -31,7 +31,7 @@ public: bool Init(); - void SetCredentials(const wxString& user, const wxString& password) wxOVERRIDE; + void SetCredentials(const wxWebCredentials& cred) wxOVERRIDE; private: wxWebRequestCURL& m_request; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 98bd71f3fd..4433d218ab 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -16,6 +16,7 @@ #include "wx/event.h" #include "wx/object.h" +#include "wx/secretstore.h" #include "wx/stream.h" #include "wx/versioninfo.h" @@ -33,6 +34,22 @@ typedef wxObjectDataPtr wxWebRequestImplPtr; typedef wxObjectDataPtr wxWebResponseImplPtr; typedef wxObjectDataPtr wxWebSessionImplPtr; +class wxWebCredentials +{ +public: + wxWebCredentials(const wxString& user, const wxSecretValue& password) + : m_user(user), m_password(password) + { + } + + const wxString& GetUser() const { return m_user; } + const wxSecretValue& GetPassword() const { return m_password; } + +private: + wxString m_user; + wxSecretValue m_password; +}; + class WXDLLIMPEXP_NET wxWebAuthChallenge { public: @@ -51,7 +68,7 @@ public: Source GetSource() const; - void SetCredentials(const wxString& user, const wxString& password); + void SetCredentials(const wxWebCredentials& cred); private: // Ctor is used by wxWebRequest only. diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 90f3b16db1..54db0b1529 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -372,7 +372,14 @@ public: Authentication challenge information available via wxWebRequest::GetAuthChallenge(). - Use SetCredentials() to provide user credentials. + Use SetCredentials() to provide user credentials, e.g. + @code + if ( request.GetState() == wxWebRequest::State_Unauthorized ) + { + wxWebCredentials cred("me", wxSecretValue("s3krit")); + request.GetAuthChallenge().SetCredentials(cred); + } + @endcode */ class wxWebAuthChallenge { @@ -394,12 +401,41 @@ public: /** Used to provide user credentials to the authentication challenge. - @param user - User name. - @param password - The users password. + @see wxWebCredentials */ - void SetCredentials(const wxString& user, const wxString& password); + void SetCredentials(const wxWebCredentials& cred); +}; + +/** + Simple class containing the username and password to use for authenticating. + + @since 3.1.5 + + @library{wxnet} + @category{net} + + @see wxWebAuthChallenge + */ +class wxWebCredentials +{ +public: + /** + Create the new credentials object. + + Note that the password is a wxSecretValue object, to construct it from + a string you need to explicitly use wxSecretValue ctor. + */ + wxWebCredentials(const wxString& user, const wxSecretValue& password); + + /// Return the user. + const wxString& GetUser() const; + + /** + Return the password. + + @see wxSecretString + */ + const wxSecretValue& GetPassword() const; }; /** diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index f5b9c40e3b..12d78039bf 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -504,12 +504,11 @@ wxWebAuthChallenge::Source wxWebAuthChallenge::GetSource() const } void -wxWebAuthChallenge::SetCredentials(const wxString& user, - const wxString& password) +wxWebAuthChallenge::SetCredentials(const wxWebCredentials& cred) { wxCHECK_IMPL_VOID(); - m_impl->SetCredentials(user, password); + m_impl->SetCredentials(cred); } // diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index f9014ef7bd..73f4e4c1c8 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -319,9 +319,15 @@ bool wxWebAuthChallengeCURL::Init() return true; } -void wxWebAuthChallengeCURL::SetCredentials(const wxString& user, const wxString& password) +void wxWebAuthChallengeCURL::SetCredentials(const wxWebCredentials& cred) { - wxString authStr = wxString::Format("%s:%s", user, password); + const wxSecretString authStr = + wxString::Format + ( + "%s:%s", + cred.GetUser(), + static_cast(wxSecretString(cred.GetPassword())) + ); curl_easy_setopt(m_request.GetHandle(), (GetSource() == wxWebAuthChallenge::Source_Proxy) ? CURLOPT_PROXYUSERPWD : CURLOPT_USERPWD, static_cast(authStr.mb_str())); diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 654866cd39..a097f5d144 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -505,16 +505,15 @@ bool wxWebAuthChallengeWinHTTP::Init() } void -wxWebAuthChallengeWinHTTP::SetCredentials(const wxString& user, - const wxString& password) +wxWebAuthChallengeWinHTTP::SetCredentials(const wxWebCredentials& cred) { if ( !::WinHttpSetCredentials ( m_request.GetHandle(), m_target, m_selectedScheme, - user.wc_str(), - password.wc_str(), + cred.GetUser().wc_str(), + wxSecretString(cred.GetPassword()).wc_str(), wxRESERVED_PARAM ) ) { diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index d5ed0a5958..7356789d46 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -108,6 +108,13 @@ public: REQUIRE( request.GetResponse().GetStatus() == requiredStatus ); } + // Precondition: we must have an auth challenge. + void UseCredentials(const wxString& user, const wxString& password) + { + request.GetAuthChallenge().SetCredentials( + wxWebCredentials(user, wxSecretValue(password))); + } + wxString baseURL; wxEventLoop loop; wxWebRequest request; @@ -200,7 +207,7 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") SECTION("Good password") { - request.GetAuthChallenge().SetCredentials("wxtest", "wxwidgets"); + UseCredentials("wxtest", "wxwidgets"); loop.Run(); CHECK( request.GetResponse().GetStatus() == 200 ); CHECK( request.GetState() == wxWebRequest::State_Completed ); @@ -208,7 +215,7 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") SECTION("Bad password") { - request.GetAuthChallenge().SetCredentials("wxtest", "foobar"); + UseCredentials("wxtest", "foobar"); loop.Run(); CHECK( request.GetResponse().GetStatus() == 401 ); CHECK( request.GetState() == wxWebRequest::State_Unauthorized ); @@ -229,7 +236,7 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") SECTION("Good password") { - request.GetAuthChallenge().SetCredentials("wxtest", "wxwidgets"); + UseCredentials("wxtest", "wxwidgets"); loop.Run(); CHECK( request.GetResponse().GetStatus() == 200 ); CHECK( request.GetState() == wxWebRequest::State_Completed ); @@ -237,7 +244,7 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") SECTION("Bad password") { - request.GetAuthChallenge().SetCredentials("foo", "bar"); + UseCredentials("foo", "bar"); loop.Run(); CHECK( request.GetResponse().GetStatus() == 401 ); CHECK( request.GetState() == wxWebRequest::State_Unauthorized ); From 31a441e814b091273cb1f23eb10536bbe24f4ef7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 01:26:17 +0100 Subject: [PATCH 148/218] Use separate test cases for wxWebRequest auth tests This allows to easily run both auth tests at once without all the other tests and it's not like we reuse much (or actually anything) by having them as sections in the same test case anyhow. This commit is best viewed ignoring whitespace-only changes. --- tests/net/webrequest.cpp | 108 +++++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 49 deletions(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 7356789d46..a64597464b 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -192,63 +192,73 @@ TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") request.SetMethod("PUT"); Run(); } +} - SECTION("Server auth BASIC") +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Auth::Basic", + "[net][webrequest][auth]") +{ + if ( !InitBaseURL() ) + return; + + if ( UsingNSURLSession() ) { - if ( UsingNSURLSession() ) - { - WARN("NSURLSession backend doesn't support authentication, skipping."); - return; - } - - Create("/basic-auth/wxtest/wxwidgets"); - Run(wxWebRequest::State_Unauthorized, 401); - REQUIRE( request.GetAuthChallenge().IsOk() ); - - SECTION("Good password") - { - UseCredentials("wxtest", "wxwidgets"); - loop.Run(); - CHECK( request.GetResponse().GetStatus() == 200 ); - CHECK( request.GetState() == wxWebRequest::State_Completed ); - } - - SECTION("Bad password") - { - UseCredentials("wxtest", "foobar"); - loop.Run(); - CHECK( request.GetResponse().GetStatus() == 401 ); - CHECK( request.GetState() == wxWebRequest::State_Unauthorized ); - } + WARN("NSURLSession backend doesn't support authentication, skipping."); + return; } - SECTION("Server auth DIGEST") + Create("/basic-auth/wxtest/wxwidgets"); + Run(wxWebRequest::State_Unauthorized, 401); + REQUIRE( request.GetAuthChallenge().IsOk() ); + + SECTION("Good password") { - if ( UsingNSURLSession() ) - { - WARN("NSURLSession backend doesn't support authentication, skipping."); - return; - } + UseCredentials("wxtest", "wxwidgets"); + loop.Run(); + CHECK( request.GetResponse().GetStatus() == 200 ); + CHECK( request.GetState() == wxWebRequest::State_Completed ); + } - Create("/digest-auth/auth/wxtest/wxwidgets"); - Run(wxWebRequest::State_Unauthorized, 401); - REQUIRE( request.GetAuthChallenge().IsOk() ); + SECTION("Bad password") + { + UseCredentials("wxtest", "foobar"); + loop.Run(); + CHECK( request.GetResponse().GetStatus() == 401 ); + CHECK( request.GetState() == wxWebRequest::State_Unauthorized ); + } +} - SECTION("Good password") - { - UseCredentials("wxtest", "wxwidgets"); - loop.Run(); - CHECK( request.GetResponse().GetStatus() == 200 ); - CHECK( request.GetState() == wxWebRequest::State_Completed ); - } +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Auth::Digest", + "[net][webrequest][auth]") +{ + if ( !InitBaseURL() ) + return; - SECTION("Bad password") - { - UseCredentials("foo", "bar"); - loop.Run(); - CHECK( request.GetResponse().GetStatus() == 401 ); - CHECK( request.GetState() == wxWebRequest::State_Unauthorized ); - } + if ( UsingNSURLSession() ) + { + WARN("NSURLSession backend doesn't support authentication, skipping."); + return; + } + + Create("/digest-auth/auth/wxtest/wxwidgets"); + Run(wxWebRequest::State_Unauthorized, 401); + REQUIRE( request.GetAuthChallenge().IsOk() ); + + SECTION("Good password") + { + UseCredentials("wxtest", "wxwidgets"); + loop.Run(); + CHECK( request.GetResponse().GetStatus() == 200 ); + CHECK( request.GetState() == wxWebRequest::State_Completed ); + } + + SECTION("Bad password") + { + UseCredentials("foo", "bar"); + loop.Run(); + CHECK( request.GetResponse().GetStatus() == 401 ); + CHECK( request.GetState() == wxWebRequest::State_Unauthorized ); } } From abcc31c6b29cc074862cf22ea7d625f2514b478e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 01:53:32 +0100 Subject: [PATCH 149/218] Update wxCredentialEntryDialog to use wxWebCredentials As a side effect, make wxWebCredentials default-constructible. Also demonstrate using wxCredentialEntryDialog in the sample. --- include/wx/generic/creddlgg.h | 16 ++++----- include/wx/webrequest.h | 3 +- interface/wx/creddlg.h | 56 ++++++++++++++++++++--------- interface/wx/webrequest.h | 3 +- samples/webrequest/webrequest.cpp | 58 +++++++++++++++++++++++++++---- src/generic/creddlgg.cpp | 28 ++++++++++----- 6 files changed, 120 insertions(+), 44 deletions(-) diff --git a/include/wx/generic/creddlgg.h b/include/wx/generic/creddlgg.h index d2f58d6a1b..9f99cb8b48 100644 --- a/include/wx/generic/creddlgg.h +++ b/include/wx/generic/creddlgg.h @@ -15,6 +15,7 @@ #if wxUSE_CREDENTIALDLG #include "wx/dialog.h" +#include "wx/webrequest.h" class WXDLLIMPEXP_CORE wxGenericCredentialEntryDialog : public wxDialog { @@ -23,28 +24,23 @@ public: wxGenericCredentialEntryDialog(wxWindow* parent, const wxString& message, const wxString& title, - const wxString& user = "", - const wxString& password = ""); + const wxWebCredentials& cred = wxWebCredentials()); bool Create(wxWindow* parent, const wxString& message, const wxString& title, - const wxString& user = "", - const wxString& password = ""); + const wxWebCredentials& cred = wxWebCredentials()); - wxString GetUser() const { return m_userTextCtrl->GetValue(); } void SetUser(const wxString& user) { m_userTextCtrl->SetValue(user); } - - wxString GetPassword() const { return m_passwordTextCtrl->GetValue(); } void SetPassword(const wxString& password) { m_passwordTextCtrl->SetValue(password); } + wxWebCredentials GetCredentials() const; + private: wxTextCtrl* m_userTextCtrl; wxTextCtrl* m_passwordTextCtrl; - void Init(const wxString& message, - const wxString& user, - const wxString& password); + void Init(const wxString& message, const wxWebCredentials& cred); wxDECLARE_NO_COPY_CLASS(wxGenericCredentialEntryDialog); }; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 4433d218ab..73ab9641d7 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -37,7 +37,8 @@ typedef wxObjectDataPtr wxWebSessionImplPtr; class wxWebCredentials { public: - wxWebCredentials(const wxString& user, const wxSecretValue& password) + wxWebCredentials(const wxString& user = wxString(), + const wxSecretValue& password = wxSecretValue()) : m_user(user), m_password(password) { } diff --git a/interface/wx/creddlg.h b/interface/wx/creddlg.h index 37b2b59646..e80d274ba5 100644 --- a/interface/wx/creddlg.h +++ b/interface/wx/creddlg.h @@ -9,8 +9,37 @@ @class wxCredentialEntryDialog This class represents a dialog that requests a user name and a password - from the user. It is implemented as a generic wxWidgets dialog on all - platforms. + from the user. + + Currently it is implemented as a generic wxWidgets dialog on all platforms. + + Simple example of using this dialog assuming @c MyFrame object has a member + @c m_request of wxWebRequest type: + @code + void MyFrame::OnWebRequestState(wxWebRequestEvent& evt) + { + if ( evt.GetState() == wxWebRequest::State_Unauthorized ) + { + wxCredentialEntryDialog dialog + ( + this, + wxString::Format + ( + "Please enter credentials for accessing " + "the web page at %s", + evt.GetResponse().GetURL() + ), + "My Application Title" + ); + if ( dialog.ShowModal() == wxID_OK ) + { + m_request.GetAuthChallenge(). + SetCredentials(dialog.GetCredentials()); + } + //else: the dialog was cancelled + } + } + @endcode @note For secure saving and loading users and passwords, have a look at wxSecretStore. @@ -41,8 +70,7 @@ public: */ wxCredentialEntryDialog(wxWindow* parent, const wxString& message, const wxString& title, - const wxString& user = "", - const wxString& password = ""); + const wxWebCredentials& cred = wxWebCredentials()); /** Create the dialog constructed using the default constructor. @@ -53,20 +81,19 @@ public: Message to show on the dialog. @param title The title of the dialog. - @param user - The default user value. - @param password - The default password. + @param cred + The default username and password to use (optional). */ bool Create(wxWindow* parent, const wxString& message, const wxString& title, - const wxString& user = "", - const wxString& password = ""); + const wxWebCredentials& cred = wxWebCredentials()); /** - Returns the entered user name. + Returns the credentials entered by the user. + + This should be called if ShowModal() returned ::wxID_OK. */ - wxString GetUser() const; + wxWebCredentials GetCredentials() const; /** Sets the current user name. @@ -77,11 +104,6 @@ public: */ void SetUser(const wxString& user); - /** - Returns the entered password. - */ - wxString GetPassword() const; - /** Sets the current password. diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 54db0b1529..61fe2e6b03 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -425,7 +425,8 @@ public: Note that the password is a wxSecretValue object, to construct it from a string you need to explicitly use wxSecretValue ctor. */ - wxWebCredentials(const wxString& user, const wxSecretValue& password); + wxWebCredentials(const wxString& user = wxString(), + const wxSecretValue& password = wxSecretValue()); /// Return the user. const wxString& GetUser() const; diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 5b0bb505e2..837754347d 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -20,6 +20,7 @@ #include "wx/notebook.h" #include "wx/artprov.h" +#include "wx/creddlg.h" #include "wx/webrequest.h" #include "wx/filedlg.h" #include "wx/image.h" @@ -252,11 +253,7 @@ public: m_startButton->Enable(evt.GetState() != wxWebRequest::State_Active); m_cancelButton->Enable(evt.GetState() == wxWebRequest::State_Active); - if ( evt.GetState() != wxWebRequest::State_Active ) - { - m_currentRequest = wxWebRequest(); - m_downloadProgressTimer.Stop(); - } + bool stillActive = false; switch (evt.GetState()) { @@ -315,8 +312,52 @@ public: wxLogStatus(this, "Cancelled"); break; - default: + case wxWebRequest::State_Unauthorized: + { + wxWebAuthChallenge + auth = m_currentRequest.GetAuthChallenge(); + if ( !auth.IsOk() ) + { + wxLogStatus("Unexpectedly missing auth challenge"); + break; + } + + wxCredentialEntryDialog dialog + ( + this, + wxString::Format + ( + "Please enter credentials for accessing\n" + "%s", + evt.GetResponse().GetURL() + ), + "wxWidgets web request sample", + m_credentials + ); + if ( dialog.ShowModal() == wxID_OK ) + { + m_credentials = dialog.GetCredentials(); + auth.SetCredentials(m_credentials); + wxLogStatus("Trying to authenticate..."); + + stillActive = true; + } + } break; + + case wxWebRequest::State_Active: + stillActive = true; + break; + + case wxWebRequest::State_Idle: + // Nothing special to do for this state. + break; + } + + if ( !stillActive ) + { + m_currentRequest = wxWebRequest(); + m_downloadProgressTimer.Stop(); } } @@ -438,6 +479,11 @@ private: wxStaticText* m_advCountStaticText; wxLongLong m_advCount; + + // Normally it would be a bad idea to permanently store credentials like + // this, we should use wxSecretStore to load them as needed, but let's keep + // things simple in this example. + wxWebCredentials m_credentials; }; class WebRequestApp : public wxApp diff --git a/src/generic/creddlgg.cpp b/src/generic/creddlgg.cpp index b290670869..87376bad72 100644 --- a/src/generic/creddlgg.cpp +++ b/src/generic/creddlgg.cpp @@ -29,25 +29,25 @@ wxGenericCredentialEntryDialog::wxGenericCredentialEntryDialog() wxGenericCredentialEntryDialog::wxGenericCredentialEntryDialog( wxWindow* parent, const wxString& message, const wxString& title, - const wxString& user, const wxString& password): + const wxWebCredentials& cred) : wxDialog(parent, wxID_ANY, title) { - Init(message, user, password); + Init(message, cred); } bool wxGenericCredentialEntryDialog::Create(wxWindow* parent, - const wxString& message, const wxString& title, const wxString& user, - const wxString& password) + const wxString& message, const wxString& title, + const wxWebCredentials& cred) { if ( !wxDialog::Create(parent, wxID_ANY, title) ) return false; - Init(message, user, password); + Init(message, cred); return true; } void wxGenericCredentialEntryDialog::Init(const wxString& message, - const wxString& user, const wxString& password) + const wxWebCredentials& cred) { wxSizer* topsizer = new wxBoxSizer(wxVERTICAL); @@ -55,13 +55,17 @@ void wxGenericCredentialEntryDialog::Init(const wxString& message, topsizer->Add(new wxStaticText(this, wxID_ANY, _("Username:")), wxSizerFlags().HorzBorder()); - m_userTextCtrl = new wxTextCtrl(this, wxID_ANY, user, wxDefaultPosition, wxSize(FromDIP(300), wxDefaultCoord)); + m_userTextCtrl = new wxTextCtrl(this, wxID_ANY, cred.GetUser(), + wxDefaultPosition, + wxSize(FromDIP(300), wxDefaultCoord)); topsizer->Add(m_userTextCtrl, wxSizerFlags().Expand().Border()); topsizer->Add(new wxStaticText(this, wxID_ANY, _("Password:")), wxSizerFlags().HorzBorder()); - m_passwordTextCtrl = new wxTextCtrl(this, wxID_ANY, password, - wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD); + m_passwordTextCtrl = new wxTextCtrl(this, wxID_ANY, + wxSecretString(cred.GetPassword()), + wxDefaultPosition, wxDefaultSize, + wxTE_PASSWORD); topsizer->Add(m_passwordTextCtrl, wxSizerFlags().Expand().Border()); topsizer->Add(CreateStdDialogButtonSizer(wxOK | wxCANCEL), wxSizerFlags().Expand().Border()); @@ -70,4 +74,10 @@ void wxGenericCredentialEntryDialog::Init(const wxString& message, m_userTextCtrl->SetFocus(); } +wxWebCredentials wxGenericCredentialEntryDialog::GetCredentials() const +{ + return wxWebCredentials(m_userTextCtrl->GetValue(), + wxSecretValue(m_passwordTextCtrl->GetValue())); +} + #endif // wxUSE_CREDENTIALDLG From 7d1a7ef9428f30dba9472a7cae9370105454271f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 20:07:51 +0100 Subject: [PATCH 150/218] Respect --disabled-sys-libs when checking for libcurl Don't use system libcurl if --disabled-sys-libs was used, but warn about it as this could be unexpected. We could consider including libcurl as submodule, and use the built-in version as a fallback, but it's a relatively big repository (100MiB+), so it's not clear if it would be a good idea to do it. --- configure | 21 +++++++++++++++------ configure.in | 35 ++++++++++++++++++++++++----------- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 4d04ebdcda..c9e3e6ee81 100755 --- a/configure +++ b/configure @@ -4098,6 +4098,7 @@ DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG DEFAULT_wxUSE_DMALLOC=no +DEFAULT_wxUSE_LIBCURL=auto DEFAULT_wxUSE_LIBGNOMEVFS=no DEFAULT_wxUSE_LIBMSPACK=no DEFAULT_wxUSE_LIBSDL=no @@ -23012,6 +23013,7 @@ fi if test "$wxUSE_WEBREQUEST" = "yes" -a "$wxUSE_LIBCURL" != "no"; then + if test "$wxUSE_SYS_LIBS" != "no" -o "$wxUSE_LIBCURL" = "yes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCURL" >&5 @@ -23072,15 +23074,15 @@ fi echo "$LIBCURL_PKG_ERRORS" >&5 - wxUSE_LIBCURL=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + wxUSE_LIBCURL=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } elif test $pkg_failed = untried; then - wxUSE_LIBCURL=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + wxUSE_LIBCURL=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } @@ -23090,10 +23092,17 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS" - LIBS="$LIBCURL_LIBS $LIBS" + wxUSE_LIBCURL=yes + CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS" + LIBS="$LIBCURL_LIBS $LIBS" fi + else + if test "$USE_WIN32" != 1 -a "$USE_DARWIN" != 1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for libcurl disabled due to --disable-sys-libs, use --with-libcurl explicitly if necessary" >&5 +$as_echo "$as_me: WARNING: Support for libcurl disabled due to --disable-sys-libs, use --with-libcurl explicitly if necessary" >&2;} + fi + fi fi diff --git a/configure.in b/configure.in index 5d0629ddce..14de083fd6 100644 --- a/configure.in +++ b/configure.in @@ -333,8 +333,9 @@ DEFAULT_wxUSE_STD_CONTAINERS_COMPATIBLY=$DEFAULT_STD_FLAG DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG -dnl libraries disabled by default +dnl libraries disabled by default or requiring some special handling DEFAULT_wxUSE_DMALLOC=no +DEFAULT_wxUSE_LIBCURL=auto DEFAULT_wxUSE_LIBGNOMEVFS=no DEFAULT_wxUSE_LIBMSPACK=no DEFAULT_wxUSE_LIBSDL=no @@ -2946,16 +2947,28 @@ dnl Check for libcurl dnl ------------------------------------------------------------------------ if test "$wxUSE_WEBREQUEST" = "yes" -a "$wxUSE_LIBCURL" != "no"; then - PKG_CHECK_MODULES(LIBCURL, [libcurl], - [ - CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS" - LIBS="$LIBCURL_LIBS $LIBS" - ], - [ - wxUSE_LIBCURL=no - AC_MSG_RESULT([not found]) - ] - ) + dnl We shouldn't depend on the external libcurl if system libraries are + dnl explicitly disabled, unless it is explicitly requested. + if test "$wxUSE_SYS_LIBS" != "no" -o "$wxUSE_LIBCURL" = "yes"; then + PKG_CHECK_MODULES(LIBCURL, [libcurl], + [ + wxUSE_LIBCURL=yes + CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS" + LIBS="$LIBCURL_LIBS $LIBS" + ], + [ + wxUSE_LIBCURL=no + AC_MSG_RESULT([not found]) + ] + ) + else + dnl Under Win32/macOS we have other backends for wxWebRequest, but + dnl under Unix it will be disabled without libcurl, so warn about it as + dnl this could be an unexpected consequence of disabling sys libs. + if test "$USE_WIN32" != 1 -a "$USE_DARWIN" != 1; then + AC_MSG_WARN([Support for libcurl disabled due to --disable-sys-libs, use --with-libcurl explicitly if necessary]) + fi + fi fi dnl ---------------------------------------------------------------- From d88762d2f1207d048f363746a88a3605df82308e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 20:42:38 +0100 Subject: [PATCH 151/218] Collect mutex and data protected by it in a single struct Also use critical section instead of a mutex, as this is more efficient under MSW. Main purpose of this commit is to make it clear that this mutex/critical section is only used together with the data from the same struct. No real changes. --- include/wx/private/webrequest_curl.h | 9 +++++++-- src/common/webrequest_curl.cpp | 12 ++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/wx/private/webrequest_curl.h b/include/wx/private/webrequest_curl.h index f31adb806f..b16481bb1d 100644 --- a/include/wx/private/webrequest_curl.h +++ b/include/wx/private/webrequest_curl.h @@ -145,8 +145,13 @@ private: wxMutex m_mutex; wxCondition m_condition; bool m_shuttingDown; - wxMutex m_cancelledMutex; - wxVector< wxObjectDataPtr > m_cancelledRequests; + + // MT-safe vector of requests for which Cancel() was called. + struct CancelledData + { + wxCriticalSection cs; + wxVector< wxObjectDataPtr > requests; + } m_cancelled; static int ms_activeSessions; diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 73f4e4c1c8..4ee6980d0f 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -448,11 +448,11 @@ wxThread::ExitCode wxWebSessionCURL::Entry() { // Handle cancelled requests { - wxMutexLocker lock(m_cancelledMutex); - while ( !m_cancelledRequests.empty() ) + wxCriticalSectionLocker lock(m_cancelled.cs); + while ( !m_cancelled.requests.empty() ) { - wxObjectDataPtr request(m_cancelledRequests.back()); - m_cancelledRequests.pop_back(); + wxObjectDataPtr request(m_cancelled.requests.back()); + m_cancelled.requests.pop_back(); curl_multi_remove_handle(m_handle, request->GetHandle()); request->SetState(wxWebRequest::State_Cancelled); } @@ -527,9 +527,9 @@ void wxWebSessionCURL::CancelRequest(wxWebRequestCURL* request) { // Add the request to a list of threads that will be removed from the curl // multi handle in the worker thread - wxMutexLocker lock(m_cancelledMutex); + wxCriticalSectionLocker lock(m_cancelled.cs); request->IncRef(); - m_cancelledRequests.push_back(wxObjectDataPtr(request)); + m_cancelled.requests.push_back(wxObjectDataPtr(request)); } wxVersionInfo wxWebSessionCURL::GetLibraryVersionInfo() From 29a36ef4ffe0dff1f54b5c1f0d10b3149cafd115 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 21:23:48 +0100 Subject: [PATCH 152/218] Unlock wxWebSessionCURL mutex before destroying it Mutexes must not be destroyed while locked and thread sanitizer correctly complains about this, so ensure that we do unlock the mutex before the worked thread terminates and the object is destroyed. --- src/common/webrequest_curl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 4ee6980d0f..b00ae82497 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -439,7 +439,8 @@ static CURLMcode wx_curl_multi_wait(CURLM *multi_handle, int timeout_ms, wxThread::ExitCode wxWebSessionCURL::Entry() { - m_mutex.Lock(); + // This mutex will be unlocked only while we're waiting on the condition. + wxMutexLocker lock(m_mutex); int activeRequests = -1; int repeats = 0; From 0588b0e7ce3d39cbfa105fd646573936c15bcf83 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 21:26:12 +0100 Subject: [PATCH 153/218] Extract all the wxWebRequest test sections in separate tests As in 31a441e814 (Use separate test cases for wxWebRequest auth tests, 2021-01-10), there is no real reason to use sections here as we don't reuse anything between them and using separate tests makes it easier to run individual tests and, especially, combinations of them. This commit is best viewed ignoring whitespace-only changes. --- tests/net/webrequest.cpp | 165 ++++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 70 deletions(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index a64597464b..6f0f442442 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -48,6 +48,8 @@ public: == "URLSession"; } + // All tests should call this function first and skip the test entirely if + // it returns false, as this indicates that web requests tests are disabled. bool InitBaseURL() { if ( !wxGetEnv("WX_TEST_WEBREQUEST_URL", &baseURL) ) @@ -122,81 +124,105 @@ public: wxInt64 dataSize; }; -TEST_CASE_METHOD(RequestFixture, "WebRequest", "[net][webrequest]") +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Get::Bytes", "[net][webrequest][get]") { - // Skip the test entirely if disabled. if ( !InitBaseURL() ) return; - SECTION("GET 64kb to memory") - { - Create("/bytes/65536"); - Run(); - REQUIRE( request.GetResponse().GetContentLength() == 65536 ); - REQUIRE( request.GetBytesExpectedToReceive() == 65536 ); - REQUIRE( request.GetBytesReceived() == 65536 ); - } - - SECTION("GET 404 error") - { - Create("/status/404"); - Run(wxWebRequest::State_Failed, 404); - } - - SECTION("Connect to invalid host") - { - CreateAbs("http://127.0.0.1:51234"); - Run(wxWebRequest::State_Failed, 0); - } - - SECTION("POST form data") - { - Create("/post"); - request.SetData("app=WebRequestSample&version=1", "application/x-www-form-urlencoded"); - Run(); - } - - SECTION("GET data as string") - { - Create("/base64/VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw=="); - Run(); - REQUIRE( request.GetResponse().AsString() == "The quick brown fox jumps over the lazy dog" ); - } - - SECTION("GET 99KB to file") - { - expectedFileSize = 99 * 1024; - Create(wxString::Format("/bytes/%lld", expectedFileSize)); - request.SetStorage(wxWebRequest::Storage_File); - Run(); - REQUIRE( request.GetBytesReceived() == expectedFileSize ); - } - - SECTION("Process 99KB data") - { - int processingSize = 99 * 1024; - Create(wxString::Format("/bytes/%d", processingSize)); - request.SetStorage(wxWebRequest::Storage_None); - Run(); - REQUIRE( request.GetBytesReceived() == processingSize ); - REQUIRE( dataSize == processingSize ); - } - - SECTION("PUT file data") - { - Create("/put"); - wxScopedPtr is(new wxFileInputStream("horse.png")); - REQUIRE( is->IsOk() ); - - request.SetData(is.release(), "image/png"); - request.SetMethod("PUT"); - Run(); - } + Create("/bytes/65536"); + Run(); + REQUIRE( request.GetResponse().GetContentLength() == 65536 ); + REQUIRE( request.GetBytesExpectedToReceive() == 65536 ); + REQUIRE( request.GetBytesReceived() == 65536 ); } TEST_CASE_METHOD(RequestFixture, - "WebRequest::Auth::Basic", - "[net][webrequest][auth]") + "WebRequest::Get::String", "[net][webrequest][get]") +{ + if ( !InitBaseURL() ) + return; + + Create("/base64/VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw=="); + Run(); + REQUIRE( request.GetResponse().AsString() == "The quick brown fox jumps over the lazy dog" ); +} + +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Get::File", "[net][webrequest][get]") +{ + if ( !InitBaseURL() ) + return; + + expectedFileSize = 99 * 1024; + Create(wxString::Format("/bytes/%lld", expectedFileSize)); + request.SetStorage(wxWebRequest::Storage_File); + Run(); + REQUIRE( request.GetBytesReceived() == expectedFileSize ); +} + +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Get::None", "[net][webrequest][get]") +{ + if ( !InitBaseURL() ) + return; + + int processingSize = 99 * 1024; + Create(wxString::Format("/bytes/%d", processingSize)); + request.SetStorage(wxWebRequest::Storage_None); + Run(); + REQUIRE( request.GetBytesReceived() == processingSize ); + REQUIRE( dataSize == processingSize ); +} + +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Error::HTTP", "[net][webrequest][error]") +{ + if ( !InitBaseURL() ) + return; + + Create("/status/404"); + Run(wxWebRequest::State_Failed, 404); +} + +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Error::Connect", "[net][webrequest][error]") +{ + if ( !InitBaseURL() ) + return; + + CreateAbs("http://127.0.0.1:51234"); + Run(wxWebRequest::State_Failed, 0); +} + +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Post", "[net][webrequest]") +{ + if ( !InitBaseURL() ) + return; + + Create("/post"); + request.SetData("app=WebRequestSample&version=1", "application/x-www-form-urlencoded"); + Run(); +} + +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Put", "[net][webrequest]") +{ + if ( !InitBaseURL() ) + return; + + Create("/put"); + wxScopedPtr is(new wxFileInputStream("horse.png")); + REQUIRE( is->IsOk() ); + + request.SetData(is.release(), "image/png"); + request.SetMethod("PUT"); + Run(); +} + +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Auth::Basic", "[net][webrequest][auth]") { if ( !InitBaseURL() ) return; @@ -229,8 +255,7 @@ TEST_CASE_METHOD(RequestFixture, } TEST_CASE_METHOD(RequestFixture, - "WebRequest::Auth::Digest", - "[net][webrequest][auth]") + "WebRequest::Auth::Digest", "[net][webrequest][auth]") { if ( !InitBaseURL() ) return; From 1d52f1cbb5aed0471a1253173c45f9f46b24dc41 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 01:11:44 +0100 Subject: [PATCH 154/218] Add a comment explaining mutex use in wxWebSessionCURL No real changes. --- include/wx/private/webrequest_curl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/wx/private/webrequest_curl.h b/include/wx/private/webrequest_curl.h index b16481bb1d..93990e4e5c 100644 --- a/include/wx/private/webrequest_curl.h +++ b/include/wx/private/webrequest_curl.h @@ -142,6 +142,9 @@ protected: private: CURLM* m_handle; + + // Mutex and condition are used together to signal to the worker thread to + // wake up and mutex is also used to protected m_shuttingDown field. wxMutex m_mutex; wxCondition m_condition; bool m_shuttingDown; From fd1d396406c5bdfbcfb558e89a465227f2d8d9ec Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 01:12:06 +0100 Subject: [PATCH 155/218] Use wxCondition::Signal() rather than Broadcast() The latter is unnecessary when there is only one thread to wake up. --- src/common/webrequest_curl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index b00ae82497..0b67cab259 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -361,7 +361,7 @@ wxWebSessionCURL::~wxWebSessionCURL() // Notify the work thread m_shuttingDown = true; wxMutexLocker lock(m_mutex); - m_condition.Broadcast(); + m_condition.Signal(); } // Wait for work thread to finish @@ -519,7 +519,7 @@ bool wxWebSessionCURL::StartRequest(wxWebRequestCURL & request) // Signal the worker thread to resume work wxMutexLocker lock(m_mutex); - m_condition.Broadcast(); + m_condition.Signal(); return true; } From de93f8be5bc177cca0b4abf42f2e2b08c0ec9592 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 01:15:28 +0100 Subject: [PATCH 156/218] Fix race condition when setting the request state to active Call SetState(State_Active) before signalling the worker thread, as otherwise it would be possible for it to wake up and set its state to something else before it was reset to "active" from the main thread. This fixed another TSAN error. --- src/common/webrequest_curl.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 0b67cab259..16527faf2f 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -230,16 +230,13 @@ bool wxWebRequestCURL::StartRequest() { m_bytesSent = 0; - if ( m_sessionImpl.StartRequest(*this) ) - { - SetState(wxWebRequest::State_Active); - return true; - } - else + if ( !m_sessionImpl.StartRequest(*this) ) { SetState(wxWebRequest::State_Failed); return false; } + + return true; } void wxWebRequestCURL::Cancel() @@ -517,6 +514,8 @@ bool wxWebSessionCURL::StartRequest(wxWebRequestCURL & request) return false; } + request.SetState(wxWebRequest::State_Active); + // Signal the worker thread to resume work wxMutexLocker lock(m_mutex); m_condition.Signal(); From 0f82a1e043ffe839de0bdef9e7b123365efb0872 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 01:24:55 +0100 Subject: [PATCH 157/218] Use atomic int for reference count in wxWebRequest classes This is required because these classes are copied in both the main and the worker threads and using plain int is MT-unsafe. --- include/wx/private/refcountermt.h | 42 +++++++++++++++++++++++++++++++ include/wx/private/webrequest.h | 10 +++++--- 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 include/wx/private/refcountermt.h diff --git a/include/wx/private/refcountermt.h b/include/wx/private/refcountermt.h new file mode 100644 index 0000000000..c40a326990 --- /dev/null +++ b/include/wx/private/refcountermt.h @@ -0,0 +1,42 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/private/refcountermt.h +// Purpose: wxRefCounterMT class: MT-safe version of wxRefCounter +// Author: Vadim Zeitlin +// Created: 2021-01-11 +// Copyright: (c) 2021 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_PRIVATE_REFCOUNTERMT_H_ +#define _WX_PRIVATE_REFCOUNTERMT_H_ + +#include "wx/atomic.h" + +// ---------------------------------------------------------------------------- +// Version of wxRefCounter with MT-safe count +// ---------------------------------------------------------------------------- + +class wxRefCounterMT +{ +public: + wxRefCounterMT() { m_count = 1; } + + void IncRef() { wxAtomicInc(m_count); } + void DecRef() + { + if ( wxAtomicDec(m_count) == 0 ) + delete this; + } + +protected: + virtual ~wxRefCounterMT() { } + +private: + // Ref count is atomic to allow IncRef() and DecRef() to be concurrently + // called from different threads. + wxAtomicInt m_count; + + wxDECLARE_NO_COPY_CLASS(wxRefCounterMT); +}; + +#endif // _WX_PRIVATE_REFCOUNTERMT_H_ diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index 69e94d8dbb..2b44af1fe0 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -14,13 +14,15 @@ #include "wx/hashmap.h" #include "wx/scopedptr.h" +#include "wx/private/refcountermt.h" + WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); // ---------------------------------------------------------------------------- // wxWebAuthChallengeImpl // ---------------------------------------------------------------------------- -class wxWebAuthChallengeImpl : public wxRefCounter +class wxWebAuthChallengeImpl : public wxRefCounterMT { public: virtual ~wxWebAuthChallengeImpl() { } @@ -43,7 +45,7 @@ private: // wxWebRequestImpl // ---------------------------------------------------------------------------- -class wxWebRequestImpl : public wxRefCounter +class wxWebRequestImpl : public wxRefCounterMT { public: virtual ~wxWebRequestImpl() { } @@ -123,7 +125,7 @@ private: // wxWebResponseImpl // ---------------------------------------------------------------------------- -class wxWebResponseImpl : public wxRefCounter +class wxWebResponseImpl : public wxRefCounterMT { public: virtual ~wxWebResponseImpl(); @@ -190,7 +192,7 @@ public: // wxWebSessionImpl // ---------------------------------------------------------------------------- -class wxWebSessionImpl : public wxRefCounter +class wxWebSessionImpl : public wxRefCounterMT { public: virtual ~wxWebSessionImpl() { } From 397940f5cf1c25f38ba4fb820093fb1a072f3b37 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 01:27:38 +0100 Subject: [PATCH 158/218] Set shut down flag after acquiring the mutex, not before As this flag is tested in the worker thread only when it owns the mutex, set it only after acquiring the mutex too to avoid any possibility of a data race. --- src/common/webrequest_curl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 16527faf2f..5a6208c6f9 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -356,8 +356,8 @@ wxWebSessionCURL::~wxWebSessionCURL() { { // Notify the work thread - m_shuttingDown = true; wxMutexLocker lock(m_mutex); + m_shuttingDown = true; m_condition.Signal(); } From 9149a3725d461ec40cfe1b6339a9e6b5713c50c0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 01:35:10 +0100 Subject: [PATCH 159/218] Assert that we have correct user data in libcurl callbacks Don't just silently ignore invalid user data value, this is not supposed to happen. Also use "userdata" name for the same parameter of all callbacks consistently. --- src/common/webrequest_curl.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 5a6208c6f9..f1458b1cd6 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -39,20 +39,18 @@ // wxWebResponseCURL // -static size_t wxCURLWriteData(void* buffer, size_t size, size_t nmemb, void* userp) +static size_t wxCURLWriteData(void* buffer, size_t size, size_t nmemb, void* userdata) { - if ( userp ) - return static_cast(userp)->WriteData(buffer, size * nmemb); - else - return 0; + wxCHECK_MSG( userdata, 0, "invalid curl write callback data" ); + + return static_cast(userdata)->WriteData(buffer, size * nmemb); } static size_t wxCURLHeader(char *buffer, size_t size, size_t nitems, void *userdata) { - if ( userdata ) - return static_cast(userdata)->AddHeaderData(buffer, size * nitems); - else - return 0; + wxCHECK_MSG( userdata, 0, "invalid curl header callback data" ); + + return static_cast(userdata)->AddHeaderData(buffer, size * nitems); } wxWebResponseCURL::wxWebResponseCURL(wxWebRequestCURL& request) : @@ -137,10 +135,9 @@ int wxWebResponseCURL::GetStatus() const static size_t wxCURLRead(char *buffer, size_t size, size_t nitems, void *userdata) { - if ( userdata ) - return static_cast(userdata)->ReadData(buffer, size * nitems); - else - return 0; + wxCHECK_MSG( userdata, 0, "invalid curl read callback data" ); + + return static_cast(userdata)->ReadData(buffer, size * nitems); } wxWebRequestCURL::wxWebRequestCURL(wxWebSession & session, From 252373e540e7b159f2593365da14b627dea1bcf9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 02:30:43 +0100 Subject: [PATCH 160/218] Allow a simple way to rest requesting the given URL in the test This does nothing more than just running a GET request for the given URL for testing purposes. --- tests/net/webrequest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 6f0f442442..d97eb2bc53 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -287,6 +287,23 @@ TEST_CASE_METHOD(RequestFixture, } } +// This test is not run by default and has to be explicitly selected to run. +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Manual", "[net][webrequest][auth][.]") +{ + // Allow getting 8-bit strings from the environment correctly. + setlocale(LC_ALL, ""); + + wxString url; + if ( !wxGetEnv("WX_TEST_WEBREQUEST_URL", &url) ) + { + FAIL("Specify WX_TEST_WEBREQUEST_URL"); + } + + CreateAbs(url); + Run(wxWebRequest::State_Completed, 0); +} + WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); namespace wxPrivate From df13c2bd2618bc4130fdb40eecbb1b49ead4a993 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 02:31:51 +0100 Subject: [PATCH 161/218] Properly percent-encode URLs passed to libcurl URLs can't contain non-ASCII characters, so use wxURI to encode them properly. --- src/common/webrequest_curl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index f1458b1cd6..428bd3961d 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -22,6 +22,8 @@ #include "wx/utils.h" #endif +#include "wx/uri.h" + // Define symbols that might be missing from older libcurl headers #ifndef CURL_AT_LEAST_VERSION #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z) @@ -156,8 +158,10 @@ wxWebRequestCURL::wxWebRequestCURL(wxWebSession & session, curl_easy_setopt(m_handle, CURLOPT_ERRORBUFFER, m_errorBuffer); // Set this request in the private pointer curl_easy_setopt(m_handle, CURLOPT_PRIVATE, static_cast(this)); - // Set URL to handle - curl_easy_setopt(m_handle, CURLOPT_URL, static_cast(url.mb_str())); + // Set URL to handle: note that we must use wxURI to escape characters not + // allowed in the URLs correctly (URL API is only available in libcurl + // since the relatively recent v7.62.0, so we don't want to rely on it). + curl_easy_setopt(m_handle, CURLOPT_URL, wxURI(url).BuildURI().utf8_str().data()); // Set callback functions curl_easy_setopt(m_handle, CURLOPT_WRITEFUNCTION, wxCURLWriteData); curl_easy_setopt(m_handle, CURLOPT_HEADERFUNCTION, wxCURLHeader); From c750661c40f42ae0ecc8f93149e4748b6994137d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 02:42:09 +0100 Subject: [PATCH 162/218] Use explicit encodings in wxWebRequestCURL At least in one place the code is still wrong when sending data as HTTP headers can contain only ASCII characters, but at least do our best to interpret the data we receive correctly. --- src/common/webrequest_curl.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 428bd3961d..7fc5f8cebe 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -74,7 +74,11 @@ size_t wxWebResponseCURL::WriteData(void* buffer, size_t size) size_t wxWebResponseCURL::AddHeaderData(const char * buffer, size_t size) { - wxString hdr(buffer, size); + // HTTP headers are supposed to only contain ASCII data, so any encoding + // should work here, but use Latin-1 for compatibility with some servers + // that send it directly and to at least avoid losing data entirely when + // the current encoding is UTF-8 but the input doesn't decode correctly. + wxString hdr = wxString::From8BitData(buffer, size); hdr.Trim(); if ( hdr.StartsWith("HTTP/") ) @@ -112,7 +116,12 @@ wxString wxWebResponseCURL::GetURL() const { char* urlp = NULL; curl_easy_getinfo(GetHandle(), CURLINFO_EFFECTIVE_URL, &urlp); - return wxString(urlp); + + // While URLs should contain ASCII characters only as per + // https://tools.ietf.org/html/rfc3986#section-2 we still want to avoid + // losing data if they somehow contain something else but are not in UTF-8 + // by interpreting it as Latin-1. + return wxString::From8BitData(urlp); } wxString wxWebResponseCURL::GetHeader(const wxString& name) const @@ -219,8 +228,10 @@ void wxWebRequestCURL::Start() for ( wxWebRequestHeaderMap::const_iterator it = m_headers.begin(); it != m_headers.end(); ++it ) { + // TODO: We need to implement RFC 2047 encoding here instead of blindly + // sending UTF-8 which is against the standard. wxString hdrStr = wxString::Format("%s: %s", it->first, it->second); - m_headerList = curl_slist_append(m_headerList, hdrStr.mb_str()); + m_headerList = curl_slist_append(m_headerList, hdrStr.utf8_str()); } curl_easy_setopt(m_handle, CURLOPT_HTTPHEADER, m_headerList); @@ -266,7 +277,9 @@ void wxWebRequestCURL::HandleCompletion() wxString wxWebRequestCURL::GetError() const { - return wxString(m_errorBuffer); + // We don't know what encoding is used for libcurl errors, so do whatever + // is needed in order to interpret this data at least somehow. + return wxString(m_errorBuffer, wxConvWhateverWorks); } size_t wxWebRequestCURL::ReadData(char* buffer, size_t size) @@ -328,7 +341,7 @@ void wxWebAuthChallengeCURL::SetCredentials(const wxWebCredentials& cred) ); curl_easy_setopt(m_request.GetHandle(), (GetSource() == wxWebAuthChallenge::Source_Proxy) ? CURLOPT_PROXYUSERPWD : CURLOPT_USERPWD, - static_cast(authStr.mb_str())); + authStr.utf8_str().data()); m_request.StartRequest(); } From 451b97170b4c854565c08f2ebadfdb66a17a6e66 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 02:51:05 +0100 Subject: [PATCH 163/218] Small tweak to wxCredentialEntryDialog docs consistency Don't use the article for just one parameter. --- interface/wx/creddlg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/creddlg.h b/interface/wx/creddlg.h index e80d274ba5..f0c653d0ad 100644 --- a/interface/wx/creddlg.h +++ b/interface/wx/creddlg.h @@ -80,7 +80,7 @@ public: @param message Message to show on the dialog. @param title - The title of the dialog. + Title of the dialog. @param cred The default username and password to use (optional). */ From 054892f2505578d76b9a12e9b75e2c79eb502efb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 02:54:48 +0100 Subject: [PATCH 164/218] Fix wording of wxWebRequestEvent::GetResponseFileName() docs Also document that the returned string is the full path and not just the name of the file. --- interface/wx/webrequest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 61fe2e6b03..29559b89f6 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -673,7 +673,7 @@ public: const wxString& GetErrorDescription() const; /** - Returns a file name to a temporary file containing the response data + Returns the full path of a temporary file containing the response data when the state is @c State_Completed and storage is @Storage_File. The file will be removed after the event handlers are called. You can From e530016723830868f3bffa82b46bb36150d11ac5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 02:55:51 +0100 Subject: [PATCH 165/218] Remove unnecessary trailing backslashes from the sample Multiline strings don't need backslashes for continuation. --- samples/webrequest/webrequest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 837754347d..ff7fd891b1 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -111,8 +111,8 @@ public: wxPanel* downloadPanel = new wxPanel(m_notebook); wxSizer* downloadSizer = new wxBoxSizer(wxVERTICAL); wxStaticText* downloadHeader = new wxStaticText(downloadPanel, wxID_ANY, - "The URL will be downloaded to a file.\n"\ - "Progress will be shown and you will be asked, where\n"\ + "The URL will be downloaded to a file.\n" + "Progress will be shown and you will be asked, where\n" "to save the file when the download completed."); downloadSizer->Add(downloadHeader, wxSizerFlags().Expand().Border()); downloadSizer->AddStretchSpacer(); @@ -130,8 +130,8 @@ public: wxPanel* advancedPanel = new wxPanel(m_notebook); wxSizer* advSizer = new wxBoxSizer(wxVERTICAL); wxStaticText* advHeader = new wxStaticText(advancedPanel, wxID_ANY, - "As an example of processing data while\n"\ - "it's being received from the server every\n"\ + "As an example of processing data while\n" + "it's being received from the server every\n" "zero byte in the response will be counted below."); advSizer->Add(advHeader, wxSizerFlags().Expand().Border()); From 76167e271bc707fcf8077305ba0714ec5075b00a Mon Sep 17 00:00:00 2001 From: Catalin Raceanu Date: Mon, 11 Jan 2021 02:57:15 +0100 Subject: [PATCH 166/218] Insert comma for clarity in a message in the sample No real changes. --- samples/webrequest/webrequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index ff7fd891b1..f122533028 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -131,7 +131,7 @@ public: wxSizer* advSizer = new wxBoxSizer(wxVERTICAL); wxStaticText* advHeader = new wxStaticText(advancedPanel, wxID_ANY, "As an example of processing data while\n" - "it's being received from the server every\n" + "it's being received from the server, every\n" "zero byte in the response will be counted below."); advSizer->Add(advHeader, wxSizerFlags().Expand().Border()); From 4986850c6344e8b26f60112cca5d5bce653d1ca1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 03:02:25 +0100 Subject: [PATCH 167/218] Rename wxWebSession::SetHeader() to AddCommonHeader() The old name wasn't very clear and it was confusing to have methods with the same name in wxWebSession and wxWebRequest. --- include/wx/private/webrequest.h | 2 +- include/wx/webrequest.h | 2 +- interface/wx/webrequest.h | 5 ++++- src/common/webrequest.cpp | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index 2b44af1fe0..3f3bca6158 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -205,7 +205,7 @@ public: virtual wxVersionInfo GetLibraryVersionInfo() = 0; - void SetHeader(const wxString& name, const wxString& value) + void AddCommonHeader(const wxString& name, const wxString& value) { m_headers[name] = value; } void SetTempDir(const wxString& dir) { m_tempDir = dir; } diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 73ab9641d7..75eb170d7a 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -220,7 +220,7 @@ public: wxVersionInfo GetLibraryVersionInfo(); - void SetHeader(const wxString& name, const wxString& value); + void AddCommonHeader(const wxString& name, const wxString& value); void SetTempDir(const wxString& dir); wxString GetTempDir() const; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 29559b89f6..25e1a3f0fa 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -581,10 +581,13 @@ public: A good example for a session-wide request header is the @c User-Agent header. + Calling this function with the same header name again replaces the + previously used value. + @param name Name of the header @param value String value of the header */ - void SetHeader(const wxString& name, const wxString& value); + void AddCommonHeader(const wxString& name, const wxString& value); /** Override the default temporary directory that may be used by the diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 12d78039bf..eb3ce57102 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -773,7 +773,7 @@ wxStringWebSessionFactoryMap gs_factoryMap; wxWebSessionImpl::wxWebSessionImpl() { // Initialize the user-Agent header with a reasonable default - SetHeader("User-Agent", wxString::Format("%s/1 wxWidgets/%d.%d.%d", + AddCommonHeader("User-Agent", wxString::Format("%s/1 wxWidgets/%d.%d.%d", wxTheApp->GetAppName(), wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)); } @@ -889,11 +889,11 @@ wxVersionInfo wxWebSession::GetLibraryVersionInfo() return m_impl->GetLibraryVersionInfo(); } -void wxWebSession::SetHeader(const wxString& name, const wxString& value) +void wxWebSession::AddCommonHeader(const wxString& name, const wxString& value) { wxCHECK_IMPL_VOID(); - m_impl->SetHeader(name, value); + m_impl->AddCommonHeader(name, value); } void wxWebSession::SetTempDir(const wxString& dir) From 000856a3420d629a13b29c981b0bcaa4e804a534 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 03:16:21 +0100 Subject: [PATCH 168/218] Make wxWebCredentials available even when wxUSE_WEBREQUEST==0 This fixed build with wxUSE_CREDENTIALDLG==1 but wxUSE_WEBREQUEST==0. No real changes, this commit just moves the code around. --- include/wx/webrequest.h | 44 ++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 75eb170d7a..68b785b9e9 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -12,28 +12,11 @@ #include "wx/defs.h" -#if wxUSE_WEBREQUEST - -#include "wx/event.h" -#include "wx/object.h" #include "wx/secretstore.h" -#include "wx/stream.h" -#include "wx/versioninfo.h" - -class wxWebResponse; -class wxWebSession; -class wxWebSessionFactory; - -class wxWebAuthChallengeImpl; -class wxWebRequestImpl; -class wxWebResponseImpl; -class wxWebSessionImpl; - -typedef wxObjectDataPtr wxWebAuthChallengeImplPtr; -typedef wxObjectDataPtr wxWebRequestImplPtr; -typedef wxObjectDataPtr wxWebResponseImplPtr; -typedef wxObjectDataPtr wxWebSessionImplPtr; +// Note that this class is intentionally defined outside of wxUSE_WEBREQUEST +// test as it's also used in wxCredentialEntryDialog and can be made available +// even if wxWebRequest itself is disabled. class wxWebCredentials { public: @@ -51,6 +34,27 @@ private: wxSecretValue m_password; }; +#if wxUSE_WEBREQUEST + +#include "wx/event.h" +#include "wx/object.h" +#include "wx/stream.h" +#include "wx/versioninfo.h" + +class wxWebResponse; +class wxWebSession; +class wxWebSessionFactory; + +class wxWebAuthChallengeImpl; +class wxWebRequestImpl; +class wxWebResponseImpl; +class wxWebSessionImpl; + +typedef wxObjectDataPtr wxWebAuthChallengeImplPtr; +typedef wxObjectDataPtr wxWebRequestImplPtr; +typedef wxObjectDataPtr wxWebResponseImplPtr; +typedef wxObjectDataPtr wxWebSessionImplPtr; + class WXDLLIMPEXP_NET wxWebAuthChallenge { public: From 3b87af5738e0fe31f1439cb4f5e9a4bbb4ead8ca Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 14:18:42 +0100 Subject: [PATCH 169/218] Fix the build when implicit wxString conversions are disabled This corrects a bug introduced in 5d256988be (Add wxMSWFormatMessage() and use it from other places, 2021-01-09). --- src/common/log.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/log.cpp b/src/common/log.cpp index f56c912dc7..b6f4fcdcee 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -1143,7 +1143,8 @@ wxString wxSysErrorMsgStr(unsigned long nErrCode) const wxChar *wxSysErrorMsg(unsigned long nErrCode) { static wxChar s_szBuf[1024]; - wxStrlcpy(s_szBuf, wxSysErrorMsgStr(nErrCode), WXSIZEOF(s_szBuf)); + wxStrlcpy(s_szBuf, (const wxChar*)wxSysErrorMsgStr(nErrCode).c_str(), + WXSIZEOF(s_szBuf)); return s_szBuf; } From d3b93a48b33525bd66c40866009375a619b0006b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 02:16:14 +0100 Subject: [PATCH 170/218] Remove wxWebSessionBackendDefault and just use empty string There doesn't seem to be any reason to have this constant, so don't define it and just interpret empty value of backend as meaning to choose the default one in wxWebSession::New(). --- include/wx/webrequest.h | 3 +-- src/common/webrequest.cpp | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 68b785b9e9..2f9ffb51e1 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -193,7 +193,6 @@ private: wxWebRequestImplPtr m_impl; }; -extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[]; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[]; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendURLSession[]; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[]; @@ -213,7 +212,7 @@ public: // factory functions to get access to them. static wxWebSession& GetDefault(); - static wxWebSession New(const wxString& backend = wxWebSessionBackendDefault); + static wxWebSession New(const wxString& backend = wxString()); // Can be used to check if the given backend is available without actually // creating a session using it. diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index eb3ce57102..d5380b48be 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -43,14 +43,6 @@ extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[] = "wxWebSes extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendURLSession[] = "wxWebSessionBackendURLSession"; extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[] = "wxWebSessionBackendCURL"; -#if wxUSE_WEBREQUEST_WINHTTP -extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[] = "wxWebSessionBackendWinHTTP"; -#elif wxUSE_WEBREQUEST_URLSESSION -extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[] = "wxWebSessionBackendURLSession"; -#elif wxUSE_WEBREQUEST_CURL -extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendDefault[] = "wxWebSessionBackendCURL"; -#endif - wxDEFINE_EVENT(wxEVT_WEBREQUEST_STATE, wxWebRequestEvent); wxDEFINE_EVENT(wxEVT_WEBREQUEST_DATA, wxWebRequestEvent); @@ -824,11 +816,23 @@ wxWebSession& wxWebSession::GetDefault() } // static -wxWebSession wxWebSession::New(const wxString& backend) +wxWebSession wxWebSession::New(const wxString& backendOrig) { if ( gs_factoryMap.empty() ) InitFactoryMap(); + wxString backend = backendOrig; + if ( backend.empty() ) + { +#if wxUSE_WEBREQUEST_WINHTTP + backend = wxWebSessionBackendWinHTTP; +#elif wxUSE_WEBREQUEST_URLSESSION + backend = wxWebSessionBackendURLSession; +#elif wxUSE_WEBREQUEST_CURL + backend = wxWebSessionBackendCURL; +#endif + } + wxStringWebSessionFactoryMap::iterator factory = gs_factoryMap.find(backend); wxWebSessionImplPtr impl; From dceb24ad7c319ca5200dab92083f91b30af88a65 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 02:17:39 +0100 Subject: [PATCH 171/218] Add support for WXWEBREQUEST_BACKEND environment variable Defining this variable overrides the default backend choice. Document the variable itself and also extend wxWebSession::New() documentation. --- docs/doxygen/overviews/envvars.h | 6 ++++++ interface/wx/webrequest.h | 17 +++++++++++++++-- src/common/webrequest.cpp | 15 +++++++++------ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/docs/doxygen/overviews/envvars.h b/docs/doxygen/overviews/envvars.h index b3604df420..7a3426e5fc 100644 --- a/docs/doxygen/overviews/envvars.h +++ b/docs/doxygen/overviews/envvars.h @@ -26,5 +26,11 @@ wxWidgets programs. @c /usr/local or @c /usr). You can set WXPREFIX if you are for example distributing a binary version of an application and you don't know in advance where it will be installed.} +@itemdef{WXWEBREQUEST_BACKEND, + This variable can be set to override the choice of the default backend + used by wxWebRequest, see wxWebSession::New(). Most common use is to + set it to @c "CURL" to force using libcurl-based implementation under + MSW or macOS platforms where the native implementation would be chosed + by default.} */ diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 25e1a3f0fa..7973e1f197 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -610,15 +610,28 @@ public: /** Creates a new wxWebSession object. + @a backend may be specified explicitly by using of the predefined @c + wxWebSessionBackendWinHTTP, @c wxWebSessionBackendURLSession or @c + wxWebSessionBackendCURL constants to select the corresponding backend + or left empty to select the default backend. The default depends on the + the current platform: WinHTTP-based implementation is used under MSW, + NSURLSession-based one under macOS and libcurl-based otherwise. + + Further, if @c WXWEBREQUEST_BACKEND environment variable is defined, it + overrides the default backend selection, allowing to force the use of + libcurl-based implementation by default under MSW or macOS platforms, + for example. + Use IsOpened() to check if the session creation succeeded. @param backend - The backend web session implementation to use. + The backend web session implementation to use or empty to use the + default implementation as described above. @return The created wxWebSession */ - static wxWebSession New(const wxString& backend = wxWebSessionBackendDefault); + static wxWebSession New(const wxString& backend = wxString()); /** Allows to check if the specified backend is available at runtime. diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index d5380b48be..5de8f13949 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -39,9 +39,9 @@ #include "wx/private/webrequest_curl.h" #endif -extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[] = "wxWebSessionBackendWinHTTP"; -extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendURLSession[] = "wxWebSessionBackendURLSession"; -extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[] = "wxWebSessionBackendCURL"; +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[] = "WinHTTP"; +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendURLSession[] = "URLSession"; +extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[] = "CURL"; wxDEFINE_EVENT(wxEVT_WEBREQUEST_STATE, wxWebRequestEvent); wxDEFINE_EVENT(wxEVT_WEBREQUEST_DATA, wxWebRequestEvent); @@ -824,13 +824,16 @@ wxWebSession wxWebSession::New(const wxString& backendOrig) wxString backend = backendOrig; if ( backend.empty() ) { + if ( !wxGetEnv("WXWEBREQUEST_BACKEND", &backend) ) + { #if wxUSE_WEBREQUEST_WINHTTP - backend = wxWebSessionBackendWinHTTP; + backend = wxWebSessionBackendWinHTTP; #elif wxUSE_WEBREQUEST_URLSESSION - backend = wxWebSessionBackendURLSession; + backend = wxWebSessionBackendURLSession; #elif wxUSE_WEBREQUEST_CURL - backend = wxWebSessionBackendCURL; + backend = wxWebSessionBackendCURL; #endif + } } wxStringWebSessionFactoryMap::iterator factory = gs_factoryMap.find(backend); From 5713d17ab0eb4f2047fc68d0b2acbae7f8753d8e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 02:30:33 +0100 Subject: [PATCH 172/218] Clarify asynchronous nature of wxWebRequest::Cancel() in the docs --- interface/wx/webrequest.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 7973e1f197..c4b086131d 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -196,6 +196,10 @@ public: /** Cancel an active request. + + Note that cancelling is asynchronous, so the application needs to wait + until the request state becomes @c State_Cancelled to know when the + request was really cancelled. */ void Cancel(); From 228d2317537eb8ad95570df3983ea1996d0ab178 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 02:34:18 +0100 Subject: [PATCH 173/218] Avoid copying POST data in NSURLSession wxWebRequest code Just give the ownership of the buffer to NSData instead of copying it. --- src/osx/webrequest_urlsession.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 9283c67820..289b8f1b92 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -125,11 +125,11 @@ void wxWebRequestURLSession::Start() if (m_dataSize) { // Read all upload data to memory buffer - wxMemoryBuffer memBuf; - m_dataStream->Read(memBuf.GetWriteBuf(m_dataSize), m_dataSize); + void* const buf = malloc(m_dataSize); + m_dataStream->Read(buf, m_dataSize); - // Create NSData from memory buffer - NSData* data = [NSData dataWithBytes:memBuf.GetData() length:m_dataSize]; + // Create NSData from memory buffer, passing it ownership of the data. + NSData* data = [NSData dataWithBytesNoCopy:buf length:m_dataSize]; m_task = [[m_sessionImpl.GetSession() uploadTaskWithRequest:req fromData:data] retain]; } else From 468a961426b712568a2475001682b11793d01754 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 02:37:55 +0100 Subject: [PATCH 174/218] Rename methods called from libcurl to use more clear names Indicate that they're callbacks used by libcurl rather than normal methods used by the application code itself. No real changes. --- include/wx/private/webrequest_curl.h | 8 +++++--- src/common/webrequest_curl.cpp | 12 ++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/wx/private/webrequest_curl.h b/include/wx/private/webrequest_curl.h index 93990e4e5c..93e38b439c 100644 --- a/include/wx/private/webrequest_curl.h +++ b/include/wx/private/webrequest_curl.h @@ -72,7 +72,8 @@ public: wxString GetError() const; - size_t ReadData(char* buffer, size_t size); + // Method called from libcurl callback + size_t CURLOnRead(char* buffer, size_t size); private: wxWebSessionCURL& m_sessionImpl; @@ -104,9 +105,10 @@ public: wxString GetStatusText() const wxOVERRIDE { return m_statusText; } - size_t WriteData(void *buffer, size_t size); - size_t AddHeaderData(const char* buffer, size_t size); + // Methods called from libcurl callbacks + size_t CURLOnWrite(void *buffer, size_t size); + size_t CURLOnHeader(const char* buffer, size_t size); private: wxWebRequestHeaderMap m_headers; diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 7fc5f8cebe..52d3af48f6 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -45,14 +45,14 @@ static size_t wxCURLWriteData(void* buffer, size_t size, size_t nmemb, void* use { wxCHECK_MSG( userdata, 0, "invalid curl write callback data" ); - return static_cast(userdata)->WriteData(buffer, size * nmemb); + return static_cast(userdata)->CURLOnWrite(buffer, size * nmemb); } static size_t wxCURLHeader(char *buffer, size_t size, size_t nitems, void *userdata) { wxCHECK_MSG( userdata, 0, "invalid curl header callback data" ); - return static_cast(userdata)->AddHeaderData(buffer, size * nitems); + return static_cast(userdata)->CURLOnHeader(buffer, size * nitems); } wxWebResponseCURL::wxWebResponseCURL(wxWebRequestCURL& request) : @@ -64,7 +64,7 @@ wxWebResponseCURL::wxWebResponseCURL(wxWebRequestCURL& request) : Init(); } -size_t wxWebResponseCURL::WriteData(void* buffer, size_t size) +size_t wxWebResponseCURL::CURLOnWrite(void* buffer, size_t size) { void* buf = GetDataBuffer(size); memcpy(buf, buffer, size); @@ -72,7 +72,7 @@ size_t wxWebResponseCURL::WriteData(void* buffer, size_t size) return size; } -size_t wxWebResponseCURL::AddHeaderData(const char * buffer, size_t size) +size_t wxWebResponseCURL::CURLOnHeader(const char * buffer, size_t size) { // HTTP headers are supposed to only contain ASCII data, so any encoding // should work here, but use Latin-1 for compatibility with some servers @@ -148,7 +148,7 @@ static size_t wxCURLRead(char *buffer, size_t size, size_t nitems, void *userdat { wxCHECK_MSG( userdata, 0, "invalid curl read callback data" ); - return static_cast(userdata)->ReadData(buffer, size * nitems); + return static_cast(userdata)->CURLOnRead(buffer, size * nitems); } wxWebRequestCURL::wxWebRequestCURL(wxWebSession & session, @@ -282,7 +282,7 @@ wxString wxWebRequestCURL::GetError() const return wxString(m_errorBuffer, wxConvWhateverWorks); } -size_t wxWebRequestCURL::ReadData(char* buffer, size_t size) +size_t wxWebRequestCURL::CURLOnRead(char* buffer, size_t size) { if ( m_dataStream ) { From 9a8981241ebf07de874329bcec622f768f6befdf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 02:49:51 +0100 Subject: [PATCH 175/218] Check return value of curl_easy_init() Normally it is not supposed to fail, but still try not to crash if it does. --- src/common/webrequest_curl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 52d3af48f6..21f2832c77 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -162,6 +162,12 @@ wxWebRequestCURL::wxWebRequestCURL(wxWebSession & session, m_headerList = NULL; m_handle = curl_easy_init(); + if ( !m_handle ) + { + wxStrlcpy(m_errorBuffer, "libcurl initialization failed", CURL_ERROR_SIZE); + return; + } + // Set error buffer to get more detailed CURL status m_errorBuffer[0] = '\0'; curl_easy_setopt(m_handle, CURLOPT_ERRORBUFFER, m_errorBuffer); From 7af2f29602026f43dfe9cd9530263b63dbe17f82 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 02:52:00 +0100 Subject: [PATCH 176/218] Use more readable CmpNoCase() in wxWebRequestCURL code No real changes, just make case-insensitive comparisons more clear. --- src/common/webrequest_curl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 21f2832c77..075b49cdd4 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -207,13 +207,13 @@ void wxWebRequestCURL::Start() if ( m_dataSize ) { - if ( m_method.empty() || m_method.IsSameAs("POST", false) ) + if ( m_method.empty() || m_method.CmpNoCase("POST") == 0 ) { curl_easy_setopt(m_handle, CURLOPT_POSTFIELDSIZE_LARGE, static_cast(m_dataSize)); curl_easy_setopt(m_handle, CURLOPT_POST, 1L); } - else if ( m_method.IsSameAs("PUT", false) ) + else if ( m_method.CmpNoCase("PUT") == 0 ) { curl_easy_setopt(m_handle, CURLOPT_UPLOAD, 1L); curl_easy_setopt(m_handle, CURLOPT_INFILESIZE_LARGE, @@ -221,7 +221,7 @@ void wxWebRequestCURL::Start() } } - if ( m_method.IsSameAs("HEAD", false) ) + if ( m_method.CmpNoCase("HEAD") == 0 ) { curl_easy_setopt(m_handle, CURLOPT_NOBODY, 1L); } From 646d8014ec513a310ce75a3d51659295686e236b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 02:54:13 +0100 Subject: [PATCH 177/218] Check if specified HTTP method is incompatible with posting data Currently data can be used with POST or PUT HTTP methods only. --- src/common/webrequest_curl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 075b49cdd4..25c2ec28ed 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -219,6 +219,12 @@ void wxWebRequestCURL::Start() curl_easy_setopt(m_handle, CURLOPT_INFILESIZE_LARGE, static_cast(m_dataSize)); } + else + { + wxFAIL_MSG(wxString::Format( + "Supplied data is ignored when using method %s", m_method + )); + } } if ( m_method.CmpNoCase("HEAD") == 0 ) From 6c1e1164d9f3cdeec554df051fcc5e656f56d842 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 02:57:30 +0100 Subject: [PATCH 178/218] Remove unnecessary cast to "void*" No real changes. --- src/common/webrequest_curl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 25c2ec28ed..ab1cfceb77 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -298,7 +298,7 @@ size_t wxWebRequestCURL::CURLOnRead(char* buffer, size_t size) { if ( m_dataStream ) { - m_dataStream->Read((void*)buffer, size); + m_dataStream->Read(buffer, size); size_t readSize = m_dataStream->LastRead(); m_bytesSent += readSize; return readSize; From 591d02c97922c67ff9f3af6304142b5019d204f0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 03:00:35 +0100 Subject: [PATCH 179/218] Increase default buffer size for wxWebRequest operations Use 64KiB rather than 8KiB, as the latter seems rather small nowadays. Also add a symbolic constant for this number. --- include/wx/private/webrequest.h | 3 +++ src/common/webrequest.cpp | 2 +- src/msw/webrequest_winhttp.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index 3f3bca6158..4a515daa02 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -18,6 +18,9 @@ WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); +// Default buffer size when a fixed-size buffer must be used. +const int wxWEBREQUEST_BUFFER_SIZE = 64 * 1024; + // ---------------------------------------------------------------------------- // wxWebAuthChallengeImpl // ---------------------------------------------------------------------------- diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 5de8f13949..7193786731 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -509,7 +509,7 @@ wxWebAuthChallenge::SetCredentials(const wxWebCredentials& cred) wxWebResponseImpl::wxWebResponseImpl(wxWebRequestImpl& request) : m_request(request), - m_readSize(8 * 1024) + m_readSize(wxWEBREQUEST_BUFFER_SIZE) { } diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index a097f5d144..75ec43edb2 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -194,7 +194,7 @@ wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, void wxWebRequestWinHTTP::WriteData() { - int dataWriteSize = 8 * 1024; + int dataWriteSize = wxWEBREQUEST_BUFFER_SIZE; if ( m_dataWritten + dataWriteSize > m_dataSize ) dataWriteSize = m_dataSize - m_dataWritten; if ( !dataWriteSize ) From 67ad831a31b08ae68616501217e371b9e7b3dfa4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 03:07:11 +0100 Subject: [PATCH 180/218] Improve documentation of wxWebRequest storage methods Indicate which methods should be used with each storage type to process the data later. --- interface/wx/webrequest.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index c4b086131d..15abd01074 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -152,15 +152,29 @@ public: */ enum Storage { - /// All data is collected in memory until the request is complete + /** + All data is collected in memory until the request is complete. + + It can be later retrieved using wxWebResponse::AsString() or + wxWebResponse::GetStream(). + */ Storage_Memory, - /// The data is written to a file on disk + /** + The data is written to a file on disk as it is received. + + This file can be later read from using wxWebResponse::GetStream() + or otherwise processed using wxWebRequestEvent::GetResponseFileName(). + */ Storage_File, /** The data is not stored by the request and is only available via events. + + Data can be retrieved using wxWebRequestEvent::GetDataBuffer() and + wxWebRequestEvent::GetDataSize() methods from wxEVT_WEBREQUEST_DATA + handler. */ Storage_None }; @@ -694,7 +708,7 @@ public: /** Returns the full path of a temporary file containing the response data - when the state is @c State_Completed and storage is @Storage_File. + when the state is @c State_Completed and storage is @c Storage_File. The file will be removed after the event handlers are called. You can move the file to a location of your choice if you want to process the From a1e0b7e2924db993da723d2bcdb5021cd59b3183 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 03:09:56 +0100 Subject: [PATCH 181/218] Slightly simplify code removing temporary file There is no need to check the state and storage type again when we had just done it. --- src/common/webrequest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 7193786731..d1d51d2662 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -290,9 +290,9 @@ void wxWebRequestImpl::ProcessStateEvent(wxWebRequest::State state, const wxStri m_handler->ProcessEvent(evt); - // Remove temporary file if it still exists - if ( state == wxWebRequest::State_Completed && m_storage == wxWebRequest::Storage_File && - wxFileExists(responseFileName) ) + // Remove temporary file if we're using one and if it still exists: it + // could have been deleted or moved away by the event handler. + if ( !responseFileName.empty() && wxFileExists(responseFileName) ) wxRemoveFile(responseFileName); } From 3da03b3b7b906d3991a991a54a59d7fe3a8e6caf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 03:14:18 +0100 Subject: [PATCH 182/218] Clarify values returned by wxWebRequest progress methods Make it clear which values change and which remain constant. --- interface/wx/webrequest.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 15abd01074..db900dabb7 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -367,13 +367,26 @@ public: */ State GetState() const; - /// Returns the number of bytes sent to the server. + /** + Returns the number of bytes sent to the server. + + This value grows monotonically from 0 to GetBytesExpectedToSend(). + */ wxFileOffset GetBytesSent() const; - /// Returns the number of bytes expected to be sent to the server. + /** + Returns the total number of bytes expected to be sent to the server. + + This value stays unchanged throughout the request duration. + */ wxFileOffset GetBytesExpectedToSend() const; - /// Returns the number of bytes received from the server. + /** + Returns the number of bytes received from the server. + + This value grows monotonically from 0 to GetBytesExpectedToReceive() + (unless it is unknown). + */ wxFileOffset GetBytesReceived() const; /** From d0f56b1d04856a90604c0128a3a94b12f29eb594 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 03:25:16 +0100 Subject: [PATCH 183/218] Document wxWebResponse::GetContentLength() Also change its return type from wxInt64 to wxFileOffset for consistency with all the other length/progress-related functions in wxWebRequest. --- include/wx/msw/private/webrequest_winhttp.h | 4 ++-- include/wx/osx/private/webrequest_urlsession.h | 2 +- include/wx/private/webrequest.h | 2 +- include/wx/private/webrequest_curl.h | 2 +- include/wx/webrequest.h | 2 +- interface/wx/webrequest.h | 10 ++++++++++ src/common/webrequest.cpp | 2 +- src/common/webrequest_curl.cpp | 4 ++-- src/osx/webrequest_urlsession.mm | 2 +- 9 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/wx/msw/private/webrequest_winhttp.h b/include/wx/msw/private/webrequest_winhttp.h index 044da9a9e5..11f2755528 100644 --- a/include/wx/msw/private/webrequest_winhttp.h +++ b/include/wx/msw/private/webrequest_winhttp.h @@ -24,7 +24,7 @@ class wxWebResponseWinHTTP : public wxWebResponseImpl public: wxWebResponseWinHTTP(wxWebRequestWinHTTP& request); - wxInt64 GetContentLength() const wxOVERRIDE { return m_contentLength; } + wxFileOffset GetContentLength() const wxOVERRIDE { return m_contentLength; } wxString GetURL() const wxOVERRIDE; @@ -40,7 +40,7 @@ public: private: HINTERNET m_requestHandle; - wxInt64 m_contentLength; + wxFileOffset m_contentLength; wxDECLARE_NO_COPY_CLASS(wxWebResponseWinHTTP); }; diff --git a/include/wx/osx/private/webrequest_urlsession.h b/include/wx/osx/private/webrequest_urlsession.h index 770b42d305..bea7502b96 100644 --- a/include/wx/osx/private/webrequest_urlsession.h +++ b/include/wx/osx/private/webrequest_urlsession.h @@ -29,7 +29,7 @@ public: ~wxWebResponseURLSession(); - wxInt64 GetContentLength() const wxOVERRIDE; + wxFileOffset GetContentLength() const wxOVERRIDE; wxString GetURL() const wxOVERRIDE; diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index 4a515daa02..fc0848472a 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -133,7 +133,7 @@ class wxWebResponseImpl : public wxRefCounterMT public: virtual ~wxWebResponseImpl(); - virtual wxInt64 GetContentLength() const = 0; + virtual wxFileOffset GetContentLength() const = 0; virtual wxString GetURL() const = 0; diff --git a/include/wx/private/webrequest_curl.h b/include/wx/private/webrequest_curl.h index 93e38b439c..47c13f43e1 100644 --- a/include/wx/private/webrequest_curl.h +++ b/include/wx/private/webrequest_curl.h @@ -95,7 +95,7 @@ class wxWebResponseCURL : public wxWebResponseImpl public: explicit wxWebResponseCURL(wxWebRequestCURL& request); - wxInt64 GetContentLength() const wxOVERRIDE; + wxFileOffset GetContentLength() const wxOVERRIDE; wxString GetURL() const wxOVERRIDE; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 2f9ffb51e1..f73fe75040 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -93,7 +93,7 @@ public: bool IsOk() const { return m_impl.get() != NULL; } - wxInt64 GetContentLength() const; + wxFileOffset GetContentLength() const; wxString GetURL() const; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index db900dabb7..fbee289ab8 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -394,6 +394,8 @@ public: This value is based on the @c Content-Length header, if none is found it will return -1. + + @see wxWebResponse::GetContentLength() */ wxFileOffset GetBytesExpectedToReceive() const; ///@} @@ -515,6 +517,14 @@ public: */ wxString GetHeader(const wxString& name) const; + /** + Get the length of returned data if available. + + Returns the value specified in the @c Content-Length: response header + of @c -1 if not available. + */ + wxFileOffset GetContentLength() const; + /** Returns the MIME type of the response (if available). */ diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index d1d51d2662..831418a9b5 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -677,7 +677,7 @@ wxWebResponse::~wxWebResponse() { } -wxInt64 wxWebResponse::GetContentLength() const +wxFileOffset wxWebResponse::GetContentLength() const { wxCHECK_IMPL( -1 ); diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index ab1cfceb77..71a11b7e90 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -99,7 +99,7 @@ size_t wxWebResponseCURL::CURLOnHeader(const char * buffer, size_t size) return size; } -wxInt64 wxWebResponseCURL::GetContentLength() const +wxFileOffset wxWebResponseCURL::GetContentLength() const { #if CURL_AT_LEAST_VERSION(7, 55, 0) curl_off_t len = 0; @@ -108,7 +108,7 @@ wxInt64 wxWebResponseCURL::GetContentLength() const #else double len = 0; curl_easy_getinfo(GetHandle(), CURLINFO_CONTENT_LENGTH_DOWNLOAD, &len); - return (wxInt64)len; + return (wxFileOffset)len; #endif } diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 289b8f1b92..917cb1b862 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -209,7 +209,7 @@ void wxWebResponseURLSession::HandleData(WX_NSData data) ReportDataReceived(data.length); } -wxInt64 wxWebResponseURLSession::GetContentLength() const +wxFileOffset wxWebResponseURLSession::GetContentLength() const { return m_task.response.expectedContentLength; } From 20a3317839b84ec5eef7c4984908deb33d92f813 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 03:34:40 +0100 Subject: [PATCH 184/218] Rename wxWebRequestEvent::GetResponseFileName() to GetDataFile() This is shorter and doesn't imply that just the name (and not the full path) is being returned. Also rename wxWebResponse::GetFileName() to GetDataFile() for the same reasons and for consistency. And document this previously undocumented method. --- include/wx/private/webrequest.h | 2 +- include/wx/webrequest.h | 8 ++++---- interface/wx/webrequest.h | 11 +++++++++-- samples/webrequest/webrequest.cpp | 2 +- src/common/webrequest.cpp | 16 ++++++++-------- tests/net/webrequest.cpp | 2 +- 6 files changed, 24 insertions(+), 17 deletions(-) diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index fc0848472a..8a7725004a 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -151,7 +151,7 @@ public: wxString AsString() const; - virtual wxString GetFileName() const; + virtual wxString GetDataFile() const; protected: wxWebRequestImpl& m_request; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index f73fe75040..42e6312ad5 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -111,7 +111,7 @@ public: wxString AsString() const; - wxString GetFileName() const; + wxString GetDataFile() const; protected: // Ctor is used by wxWebRequest and wxWebRequestImpl. @@ -264,9 +264,9 @@ public: const wxString& GetErrorDescription() const { return m_errorDescription; } - const wxString& GetResponseFileName() const { return m_responseFileName; } + const wxString& GetDataFile() const { return m_dataFile; } - void SetResponseFileName(const wxString& filename) { m_responseFileName = filename; } + void SetDataFile(const wxString& dataFile) { m_dataFile = dataFile; } const void* GetDataBuffer() const { return m_data; } @@ -280,7 +280,7 @@ public: private: wxWebRequest::State m_state; const wxWebResponse m_response; // may be invalid - wxString m_responseFileName; + wxString m_dataFile; const void* m_data; size_t m_dataSize; wxString m_errorDescription; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index fbee289ab8..1d8cf06a36 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -164,7 +164,7 @@ public: The data is written to a file on disk as it is received. This file can be later read from using wxWebResponse::GetStream() - or otherwise processed using wxWebRequestEvent::GetResponseFileName(). + or otherwise processed using wxWebRequestEvent::GetDataFile(). */ Storage_File, @@ -550,6 +550,13 @@ public: */ wxString GetSuggestedFileName() const; + /** + Returns the full path of the file to which data is being saved. + + This is only valid when storage mode is @c Storage_File. + */ + wxString GetDataFile() const; + /** Returns all response data as a string. @@ -737,7 +744,7 @@ public: move the file to a location of your choice if you want to process the contents outside the event handler. */ - const wxString& GetResponseFileName() const; + const wxString& GetDataFile() const; /** Only for @c wxEVT_WEBREQUEST_DATA events. The buffer is only valid diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index f122533028..5dca3b3188 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -288,7 +288,7 @@ public: wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if ( fileDlg.ShowModal() == wxID_OK ) { - if ( !wxRenameFile(evt.GetResponseFileName(), fileDlg.GetPath()) ) + if ( !wxRenameFile(evt.GetDataFile(), fileDlg.GetPath()) ) wxLogError("Could not move file"); } diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 831418a9b5..7f90e3340c 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -278,22 +278,22 @@ void wxWebRequestImpl::ProcessStateEvent(wxWebRequest::State state, const wxStri if ( !IsActiveState(state) && GetResponse() ) GetResponse()->Finalize(); - wxString responseFileName; + wxString dataFile; wxWebRequestEvent evt(wxEVT_WEBREQUEST_STATE, GetId(), state, wxWebResponse(GetResponse()), failMsg); if ( state == wxWebRequest::State_Completed && m_storage == wxWebRequest::Storage_File ) { - responseFileName = GetResponse()->GetFileName(); - evt.SetResponseFileName(responseFileName); + dataFile = GetResponse()->GetDataFile(); + evt.SetDataFile(dataFile); } m_handler->ProcessEvent(evt); // Remove temporary file if we're using one and if it still exists: it // could have been deleted or moved away by the event handler. - if ( !responseFileName.empty() && wxFileExists(responseFileName) ) - wxRemoveFile(responseFileName); + if ( !dataFile.empty() && wxFileExists(dataFile) ) + wxRemoveFile(dataFile); } // @@ -638,7 +638,7 @@ void wxWebResponseImpl::ReportDataReceived(size_t sizeReceived) m_readBuffer.Clear(); } -wxString wxWebResponseImpl::GetFileName() const +wxString wxWebResponseImpl::GetDataFile() const { return m_file.GetName(); } @@ -740,11 +740,11 @@ wxString wxWebResponse::AsString() const return m_impl->AsString(); } -wxString wxWebResponse::GetFileName() const +wxString wxWebResponse::GetDataFile() const { wxCHECK_IMPL( wxString() ); - return m_impl->GetFileName(); + return m_impl->GetDataFile(); } diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index d97eb2bc53..94de431152 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -78,7 +78,7 @@ public: case wxWebRequest::State_Completed: if ( request.GetStorage() == wxWebRequest::Storage_File ) { - wxFileName fn(evt.GetResponseFileName()); + wxFileName fn(evt.GetDataFile()); REQUIRE( fn.GetSize() == expectedFileSize ); } wxFALLTHROUGH; From 3f783b15f0987aa90cd811ae063fc68e01a71b3f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 14:52:14 +0100 Subject: [PATCH 185/218] Add another explicit conversion from wxString to "const wchar_t*" Fix build in wxUSE_STL=1 configuration. --- src/msw/webrequest_winhttp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 75ec43edb2..7374b99852 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -288,7 +288,7 @@ void wxWebRequestWinHTTP::Start() m_connect = ::WinHttpConnect ( m_sessionWinHTTP.GetHandle(), - wxString(urlComps.lpszHostName, urlComps.dwHostNameLength), + wxString(urlComps.lpszHostName, urlComps.dwHostNameLength).wc_str(), urlComps.nPort, wxRESERVED_PARAM ); From ea3d25336c33482a0f074a920439c037eaa11ce3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 14:53:24 +0100 Subject: [PATCH 186/218] Fix typo in WXWEBREQUEST_BACKEND documentation Thanks codespell. --- docs/doxygen/overviews/envvars.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/doxygen/overviews/envvars.h b/docs/doxygen/overviews/envvars.h index 7a3426e5fc..c869bc5faa 100644 --- a/docs/doxygen/overviews/envvars.h +++ b/docs/doxygen/overviews/envvars.h @@ -30,7 +30,7 @@ wxWidgets programs. This variable can be set to override the choice of the default backend used by wxWebRequest, see wxWebSession::New(). Most common use is to set it to @c "CURL" to force using libcurl-based implementation under - MSW or macOS platforms where the native implementation would be chosed + MSW or macOS platforms where the native implementation would be chosen by default.} */ From 5e8a14ff41849b5f568d411c953a0971de041c90 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 14:59:14 +0100 Subject: [PATCH 187/218] Update dialogs sample to use wxWebCredentials too This should have been done in abcc31c6b2 (Update wxCredentialEntryDialog to use wxWebCredentials, 2021-01-10). --- samples/dialogs/dialogs.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 76be189904..8a8f1998fc 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -1160,10 +1160,20 @@ void MyFrame::CredentialEntry(wxCommandEvent& WXUNUSED(event)) wxCredentialEntryDialog dialog(this, "A login is required", "Credentials"); if (dialog.ShowModal() == wxID_OK) { - wxMessageBox( - wxString::Format("User: %s Password: %s", - dialog.GetUser(), dialog.GetPassword()), - "Credentials", wxOK | wxICON_INFORMATION, this); + const wxWebCredentials credentials = dialog.GetCredentials(); + const wxString& password = wxSecretString(credentials.GetPassword()); + wxMessageBox + ( + wxString::Format + ( + "User: %s Password: %s", + credentials.GetUser(), + password + ), + "Credentials", + wxOK | wxICON_INFORMATION, + this + ); } } #endif // wxUSE_CREDENTIALDLG From 0ccc6d4047525ec48cb956a8c4e51901bef37079 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 19:15:37 +0100 Subject: [PATCH 188/218] Remove useless wxWebAuthChallengeCURL::Init() This just always returned true, so simply remove it to simplify the code. --- include/wx/private/webrequest_curl.h | 2 -- src/common/webrequest_curl.cpp | 10 +--------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/wx/private/webrequest_curl.h b/include/wx/private/webrequest_curl.h index 47c13f43e1..ac3e53634b 100644 --- a/include/wx/private/webrequest_curl.h +++ b/include/wx/private/webrequest_curl.h @@ -29,8 +29,6 @@ public: wxWebAuthChallengeCURL(wxWebAuthChallenge::Source source, wxWebRequestCURL& request); - bool Init(); - void SetCredentials(const wxWebCredentials& cred) wxOVERRIDE; private: diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 71a11b7e90..3e9c7053cd 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -278,10 +278,7 @@ void wxWebRequestCURL::HandleCompletion() { m_authChallenge.reset(new wxWebAuthChallengeCURL( (status == 407) ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); - if ( m_authChallenge->Init() ) - SetState(wxWebRequest::State_Unauthorized, m_response->GetStatusText()); - else - SetState(wxWebRequest::State_Failed); + SetState(wxWebRequest::State_Unauthorized, m_response->GetStatusText()); } else if ( CheckServerStatus() ) SetState(wxWebRequest::State_Completed); @@ -337,11 +334,6 @@ wxWebAuthChallengeCURL::wxWebAuthChallengeCURL(wxWebAuthChallenge::Source source { } -bool wxWebAuthChallengeCURL::Init() -{ - return true; -} - void wxWebAuthChallengeCURL::SetCredentials(const wxWebCredentials& cred) { const wxSecretString authStr = From d2840d2516e391b8f26cf5aea888cd40016ecca3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 13 Jan 2021 00:01:21 +0100 Subject: [PATCH 189/218] Add some wxLogTrace() calls to wxWebRequestURLSession code This is helpful when trying to understand what is going on, especially because CFNETWORK_DIAGNOSTICS, which is supposed to do the same thing at native level, doesn't seem to work (at least under 10.14). --- include/wx/private/webrequest.h | 3 +++ src/common/webrequest.cpp | 2 ++ src/osx/webrequest_urlsession.mm | 24 ++++++++++++++++++++---- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index 8a7725004a..a2f9299ca2 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -21,6 +21,9 @@ WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); // Default buffer size when a fixed-size buffer must be used. const int wxWEBREQUEST_BUFFER_SIZE = 64 * 1024; +// Trace mask used for the messages in wxWebRequest code. +#define wxTRACE_WEBREQUEST "webrequest" + // ---------------------------------------------------------------------------- // wxWebAuthChallengeImpl // ---------------------------------------------------------------------------- diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 7f90e3340c..93e967a896 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -182,6 +182,8 @@ struct StateEventProcessor void wxWebRequestImpl::SetState(wxWebRequest::State state, const wxString & failMsg) { + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: state => %d", this, state); + m_state = state; // Trigger the event in the main thread diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 917cb1b862..5d7f517b13 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -67,6 +67,9 @@ wxUnusedVar(session); wxWebRequestURLSession* request = [self requestForTask:dataTask]; + + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: didReceiveData", request); + if (request) request->GetResponseImplPtr()->HandleData(data); } @@ -77,9 +80,18 @@ wxWebRequestURLSession* request = [self requestForTask:task]; if (error) + { + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: didCompleteWithError, error=%s", + request, wxCFStringRefFromGet([error description]).AsString()); + request->SetState(wxWebRequest::State_Failed, wxCFStringRefFromGet(error.localizedDescription).AsString()); + } else + { + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: completed successfully", request); + request->HandleCompletion(); + } // After the task is completed it no longer needs to be mapped [m_requests removeObjectForKey:task]; @@ -108,12 +120,13 @@ wxWebRequestURLSession::~wxWebRequestURLSession() void wxWebRequestURLSession::Start() { + wxString method = m_method; + if ( method.empty() ) + method = m_dataSize ? wxASCII_STR("POST") : wxASCII_STR("GET"); + NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL: [NSURL URLWithString:wxCFStringRef(m_url).AsNSString()]]; - if (m_method.empty()) - req.HTTPMethod = m_dataSize ? @"POST" : @"GET"; - else - req.HTTPMethod = wxCFStringRef(m_method).AsNSString(); + req.HTTPMethod = wxCFStringRef(method).AsNSString(); // Set request headers for (wxWebRequestHeaderMap::const_iterator it = m_headers.begin(); it != m_headers.end(); ++it) @@ -138,6 +151,9 @@ void wxWebRequestURLSession::Start() m_task = [[m_sessionImpl.GetSession() dataTaskWithRequest:req] retain]; } + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: start \"%s %s\"", + this, method, m_url); + // The session delegate needs to know which task is wrapped in which request [m_sessionImpl.GetDelegate() registerRequest:this task:m_task]; From e80b65b1327634ca281bd7518ec2d0d49e9d5057 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 00:44:46 +0100 Subject: [PATCH 190/218] Add timeout to wxWebRequest test Ensure that the test terminates even if we don't get the expected event. --- tests/net/webrequest.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 94de431152..188a6ff0b0 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -33,7 +33,7 @@ // disable running the test entirely. static const char* WX_TEST_WEBREQUEST_URL_DEFAULT = "https://httpbin.org"; -class RequestFixture : public wxEvtHandler +class RequestFixture : public wxTimer { public: RequestFixture() @@ -93,18 +93,31 @@ public: } } + void Notify() wxOVERRIDE + { + WARN("Exiting loop on timeout"); + loop.Exit(); + } + void OnData(wxWebRequestEvent& evt) { // Count all bytes recieved via data event for Storage_None dataSize += evt.GetDataSize(); } + void RunLoopWithTimeout() + { + StartOnce(10000); // Ensure that we exit the loop after 10s. + loop.Run(); + Stop(); + } + void Run(wxWebRequest::State requiredState = wxWebRequest::State_Completed, int requiredStatus = 200) { REQUIRE( request.GetState() == wxWebRequest::State_Idle ); request.Start(); - loop.Run(); + RunLoopWithTimeout(); REQUIRE( request.GetState() == requiredState ); if (requiredStatus) REQUIRE( request.GetResponse().GetStatus() == requiredStatus ); @@ -240,7 +253,7 @@ TEST_CASE_METHOD(RequestFixture, SECTION("Good password") { UseCredentials("wxtest", "wxwidgets"); - loop.Run(); + RunLoopWithTimeout(); CHECK( request.GetResponse().GetStatus() == 200 ); CHECK( request.GetState() == wxWebRequest::State_Completed ); } @@ -248,7 +261,7 @@ TEST_CASE_METHOD(RequestFixture, SECTION("Bad password") { UseCredentials("wxtest", "foobar"); - loop.Run(); + RunLoopWithTimeout(); CHECK( request.GetResponse().GetStatus() == 401 ); CHECK( request.GetState() == wxWebRequest::State_Unauthorized ); } @@ -273,7 +286,7 @@ TEST_CASE_METHOD(RequestFixture, SECTION("Good password") { UseCredentials("wxtest", "wxwidgets"); - loop.Run(); + RunLoopWithTimeout(); CHECK( request.GetResponse().GetStatus() == 200 ); CHECK( request.GetState() == wxWebRequest::State_Completed ); } @@ -281,7 +294,7 @@ TEST_CASE_METHOD(RequestFixture, SECTION("Bad password") { UseCredentials("foo", "bar"); - loop.Run(); + RunLoopWithTimeout(); CHECK( request.GetResponse().GetStatus() == 401 ); CHECK( request.GetState() == wxWebRequest::State_Unauthorized ); } From 70e7861a7d345895cddc7680882725048268273c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 14 Jan 2021 23:07:27 +0100 Subject: [PATCH 191/218] Implement authentication support for wxWebRequest under Mac Add wxWebAuthChallengeURLSession and use the appropriate delegate callback to create it. --- .../wx/osx/private/webrequest_urlsession.h | 35 ++++++- src/osx/webrequest_urlsession.mm | 99 ++++++++++++++++++- tests/net/webrequest.cpp | 18 ---- 3 files changed, 128 insertions(+), 24 deletions(-) diff --git a/include/wx/osx/private/webrequest_urlsession.h b/include/wx/osx/private/webrequest_urlsession.h index bea7502b96..4ecf0a6abf 100644 --- a/include/wx/osx/private/webrequest_urlsession.h +++ b/include/wx/osx/private/webrequest_urlsession.h @@ -14,6 +14,7 @@ #include "wx/private/webrequest.h" +DECLARE_WXCOCOA_OBJC_CLASS(NSURLCredential); DECLARE_WXCOCOA_OBJC_CLASS(NSURLSession); DECLARE_WXCOCOA_OBJC_CLASS(NSURLSessionTask); DECLARE_WXCOCOA_OBJC_CLASS(wxWebSessionDelegate); @@ -22,6 +23,29 @@ class wxWebSessionURLSession; class wxWebRequestURLSession; class wxWebResponseURLSession; +class wxWebAuthChallengeURLSession : public wxWebAuthChallengeImpl +{ +public: + wxWebAuthChallengeURLSession(wxWebAuthChallenge::Source source, + wxWebRequestURLSession& request) + : wxWebAuthChallengeImpl(source), + m_request(request) + { + } + + ~wxWebAuthChallengeURLSession(); + + void SetCredentials(const wxWebCredentials& cred) wxOVERRIDE; + + WX_NSURLCredential GetURLCredential() const { return m_cred; } + +private: + wxWebRequestURLSession& m_request; + WX_NSURLCredential m_cred = NULL; + + wxDECLARE_NO_COPY_CLASS(wxWebAuthChallengeURLSession); +}; + class wxWebResponseURLSession : public wxWebResponseImpl { public: @@ -67,7 +91,8 @@ public: wxWebResponseImplPtr GetResponse() const wxOVERRIDE { return m_response; } - wxWebAuthChallengeImplPtr GetAuthChallenge() const wxOVERRIDE; + wxWebAuthChallengeImplPtr GetAuthChallenge() const wxOVERRIDE + { return m_authChallenge; } wxFileOffset GetBytesSent() const wxOVERRIDE; @@ -79,14 +104,22 @@ public: void HandleCompletion(); + void HandleChallenge(wxWebAuthChallengeURLSession* challenge); + + void OnSetCredentials(const wxWebCredentials& cred); + wxWebResponseURLSession* GetResponseImplPtr() const { return m_response.get(); } + wxWebAuthChallengeURLSession* GetAuthChallengeImplPtr() const + { return m_authChallenge.get(); } + private: wxWebSessionURLSession& m_sessionImpl; wxString m_url; WX_NSURLSessionTask m_task; wxObjectDataPtr m_response; + wxObjectDataPtr m_authChallenge; wxDECLARE_NO_COPY_CLASS(wxWebRequestURLSession); }; diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 5d7f517b13..18be4f1eb3 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -97,6 +97,60 @@ [m_requests removeObjectForKey:task]; } +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task + didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge + completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler +{ + wxUnusedVar(session); + + wxWebRequestURLSession* request = [self requestForTask:task]; + wxCHECK_RET( request, "received authentication challenge for an unknown task" ); + + NSURLProtectionSpace* const space = [challenge protectionSpace]; + + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: didReceiveChallenge for %s", + request, + wxCFStringRefFromGet([space description]).AsString()); + + // We need to distinguish between session-wide and task-specific + // authentication challenges, we're only really interested in the latter + // ones here (but apparently there is no way to get just them, even though + // the documentation seems to imply that session-wide challenges shouldn't + // be sent to this task-specific delegate -- but they're, at least under + // 10.14). + const auto authMethod = space.authenticationMethod; + if ( authMethod == NSURLAuthenticationMethodHTTPBasic || + authMethod == NSURLAuthenticationMethodHTTPDigest ) + { + if ( auto* const authChallenge = request->GetAuthChallengeImplPtr() ) + { + // We're going to get called until we don't provide the correct + // credentials, so don't use them again (and again, and again...) + // if we had already used them unsuccessfully. + if ( !challenge.previousFailureCount ) + { + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: using credentials", request); + + completionHandler(NSURLSessionAuthChallengeUseCredential, + authChallenge->GetURLCredential()); + + return; + } + + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: not using failing credentials again", request); + } + + request->HandleChallenge(new wxWebAuthChallengeURLSession( + [space isProxy] ? wxWebAuthChallenge::Source_Proxy + : wxWebAuthChallenge::Source_Server, + *request + )); + } + + completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); +} + @end // @@ -170,14 +224,22 @@ void wxWebRequestURLSession::Cancel() void wxWebRequestURLSession::HandleCompletion() { - if ( CheckServerStatus() ) - SetState(wxWebRequest::State_Completed); + switch ( m_response->GetStatus() ) + { + case 401: + case 407: + SetState(wxWebRequest::State_Unauthorized, m_response->GetStatusText()); + break; + + default: + if ( CheckServerStatus() ) + SetState(wxWebRequest::State_Completed); + } } -wxWebAuthChallengeImplPtr wxWebRequestURLSession::GetAuthChallenge() const +void wxWebRequestURLSession::HandleChallenge(wxWebAuthChallengeURLSession* challenge) { - wxFAIL_MSG("not implemented"); - return wxWebAuthChallengeImplPtr(); + m_authChallenge.reset(challenge); } wxFileOffset wxWebRequestURLSession::GetBytesSent() const @@ -200,6 +262,33 @@ wxFileOffset wxWebRequestURLSession::GetBytesExpectedToReceive() const return m_task.countOfBytesExpectedToReceive; } +// +// wxWebAuthChallengeURLSession +// + +wxWebAuthChallengeURLSession::~wxWebAuthChallengeURLSession() +{ + [m_cred release]; +} + +void wxWebAuthChallengeURLSession::SetCredentials(const wxWebCredentials& cred) +{ + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: setting credentials", &m_request); + + [m_cred release]; + + m_cred = [NSURLCredential + credentialWithUser:wxCFStringRef(cred.GetUser()).AsNSString() + password:wxCFStringRef(wxSecretString(cred.GetPassword())).AsNSString() + persistence:NSURLCredentialPersistenceNone + ]; + + [m_cred retain]; + + m_request.Start(); +} + + // // wxWebResponseURLSession // diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 188a6ff0b0..8e54152600 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -42,12 +42,6 @@ public: dataSize = 0; } - static bool UsingNSURLSession() - { - return wxWebSession::GetDefault().GetLibraryVersionInfo().GetName() - == "URLSession"; - } - // All tests should call this function first and skip the test entirely if // it returns false, as this indicates that web requests tests are disabled. bool InitBaseURL() @@ -240,12 +234,6 @@ TEST_CASE_METHOD(RequestFixture, if ( !InitBaseURL() ) return; - if ( UsingNSURLSession() ) - { - WARN("NSURLSession backend doesn't support authentication, skipping."); - return; - } - Create("/basic-auth/wxtest/wxwidgets"); Run(wxWebRequest::State_Unauthorized, 401); REQUIRE( request.GetAuthChallenge().IsOk() ); @@ -273,12 +261,6 @@ TEST_CASE_METHOD(RequestFixture, if ( !InitBaseURL() ) return; - if ( UsingNSURLSession() ) - { - WARN("NSURLSession backend doesn't support authentication, skipping."); - return; - } - Create("/digest-auth/auth/wxtest/wxwidgets"); Run(wxWebRequest::State_Unauthorized, 401); REQUIRE( request.GetAuthChallenge().IsOk() ); From 4e1bece87ec6723bb68d61b700ba5b6f831879ee Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 00:53:21 +0100 Subject: [PATCH 192/218] Fix end state of cancelled requests in Mac implementation Don't set the state to State_Failed if the request was cancelled. --- src/osx/webrequest_urlsession.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 18be4f1eb3..fb8a126458 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -84,7 +84,10 @@ wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: didCompleteWithError, error=%s", request, wxCFStringRefFromGet([error description]).AsString()); - request->SetState(wxWebRequest::State_Failed, wxCFStringRefFromGet(error.localizedDescription).AsString()); + if ( error.code == NSURLErrorCancelled ) + request->SetState(wxWebRequest::State_Cancelled); + else + request->SetState(wxWebRequest::State_Failed, wxCFStringRefFromGet(error.localizedDescription).AsString()); } else { From 168408620d6d63faf084d2717ba22a3a39f9e6f8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 00:53:45 +0100 Subject: [PATCH 193/218] Add wxWebRequest::Cancel() unit test Check that the request does get cancelled and has the correct state. --- tests/net/webrequest.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 8e54152600..7f77ee9b25 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -282,6 +282,19 @@ TEST_CASE_METHOD(RequestFixture, } } +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Cancel", "[net][webrequest]") +{ + if ( !InitBaseURL() ) + return; + + Create("/delay/10"); + request.Start(); + request.Cancel(); + RunLoopWithTimeout(); + REQUIRE( request.GetState() == wxWebRequest::State_Cancelled ); +} + // This test is not run by default and has to be explicitly selected to run. TEST_CASE_METHOD(RequestFixture, "WebRequest::Manual", "[net][webrequest][auth][.]") From f9d7a06c37cf2b950f835269da311cbd24055233 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 00:56:49 +0100 Subject: [PATCH 194/218] Fix tags for WebRequest::Manual() unit test Don't give it any tags other than "." as we don't want to execute it when these tags are specified, only when it's explicitly selected by using its name on the command line. --- tests/net/webrequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 7f77ee9b25..dd3f2a0593 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -297,7 +297,7 @@ TEST_CASE_METHOD(RequestFixture, // This test is not run by default and has to be explicitly selected to run. TEST_CASE_METHOD(RequestFixture, - "WebRequest::Manual", "[net][webrequest][auth][.]") + "WebRequest::Manual", "[.]") { // Allow getting 8-bit strings from the environment correctly. setlocale(LC_ALL, ""); From f85f716cea79473b343f0c4585f864dfaa38eef7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 02:52:15 +0100 Subject: [PATCH 195/218] Show more information about the request result in manual test Show the HTTP status as well as data retrieved by the server. --- tests/net/webrequest.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index dd3f2a0593..115ae97b14 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -309,7 +309,16 @@ TEST_CASE_METHOD(RequestFixture, } CreateAbs(url); - Run(wxWebRequest::State_Completed, 0); + request.Start(); + RunLoopWithTimeout(); + + WARN("Request state " << request.GetState()); + wxWebResponse response = request.GetResponse(); + REQUIRE( response.IsOk() ); + WARN("Status: " << response.GetStatus() + << " (" << response.GetStatusText() << ")\n" << + "Body length: " << response.GetContentLength() << "\n" << + "Body: " << response.AsString() << "\n"); } WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); From 798d2bb080d4c6a41947884042a6e7da9a8f9620 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 02:54:30 +0100 Subject: [PATCH 196/218] Accept everything instead of nothing in wxWebRequestWinHTTP This is consistent with the other implementations and generally makes more sense. --- src/msw/webrequest_winhttp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 7374b99852..6643bd2099 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -311,13 +311,14 @@ void wxWebRequestWinHTTP::Start() objectName += "?" + wxString(urlComps.lpszExtraInfo, urlComps.dwExtraInfoLength); // Open a request + static const wchar_t* acceptedTypes[] = { L"*/*", NULL }; m_request = ::WinHttpOpenRequest ( m_connect, method.wc_str(), objectName.wc_str(), NULL, // protocol version: use default, i.e. HTTP/1.1 WINHTTP_NO_REFERER, - WINHTTP_DEFAULT_ACCEPT_TYPES, + acceptedTypes, urlComps.nScheme == INTERNET_SCHEME_HTTPS ? WINHTTP_FLAG_SECURE : 0 From bafbcfa90fd5c6ee18df8d0599305b119803b4fb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 02:56:45 +0100 Subject: [PATCH 197/218] Add tracing statements to WinHTTP code too This again can be very useful for debugging. --- src/msw/webrequest_winhttp.cpp | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 6643bd2099..9aa07a0f3d 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -149,6 +149,9 @@ wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength) { + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: callback %08x, len=%zu", + this, dwInternetStatus, dwStatusInformationLength); + switch ( dwInternetStatus ) { case WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE: @@ -194,6 +197,8 @@ wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, void wxWebRequestWinHTTP::WriteData() { + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: writing data", this); + int dataWriteSize = wxWEBREQUEST_BUFFER_SIZE; if ( m_dataWritten + dataWriteSize > m_dataSize ) dataWriteSize = m_dataSize - m_dataWritten; @@ -224,6 +229,8 @@ void wxWebRequestWinHTTP::WriteData() void wxWebRequestWinHTTP::CreateResponse() { + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: creating response", this); + if ( !::WinHttpReceiveResponse(m_request, NULL) ) { SetFailedWithLastError(); @@ -269,6 +276,17 @@ void wxWebRequestWinHTTP::SetFailed(DWORD errorCode) void wxWebRequestWinHTTP::Start() { + wxString method; + if ( !m_method.empty() ) + method = m_method; + else if ( m_dataSize ) + method = "POST"; + else + method = "GET"; + + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: start \"%s %s\"", + this, method, m_url); + // Parse the URL URL_COMPONENTS urlComps; wxZeroMemory(urlComps); @@ -298,14 +316,6 @@ void wxWebRequestWinHTTP::Start() return; } - wxString method; - if ( !m_method.empty() ) - method = m_method; - else if ( m_dataSize ) - method = "POST"; - else - method = "GET"; - wxString objectName(urlComps.lpszUrlPath, urlComps.dwUrlPathLength); if ( urlComps.dwExtraInfoLength ) objectName += "?" + wxString(urlComps.lpszExtraInfo, urlComps.dwExtraInfoLength); @@ -381,6 +391,8 @@ void wxWebRequestWinHTTP::SendRequest() void wxWebRequestWinHTTP::Cancel() { + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: cancelling", this); + SetState(wxWebRequest::State_Cancelled); if ( m_request != NULL ) { @@ -403,6 +415,9 @@ wxWebResponseWinHTTP::wxWebResponseWinHTTP(wxWebRequestWinHTTP& request): !contentLengthStr.ToLongLong(&m_contentLength) ) m_contentLength = -1; + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: receiving %llu bytes", + &request, m_contentLength); + Init(); } @@ -444,6 +459,8 @@ wxString wxWebResponseWinHTTP::GetStatusText() const bool wxWebResponseWinHTTP::ReadData() { + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: reading data", &m_request); + return ::WinHttpReadData ( m_requestHandle, From ef08d499cec8c33fc4308cb951aa9dcb15d5db49 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 02:59:54 +0100 Subject: [PATCH 198/218] Remove unnecessary SetIgnoreServerErrorStatus() from the API It's up to the application code to decide how it handles the HTTP status codes it gets back from server, there is no need to have a special method for handling them in wxWebRequest itself. We also shouldn't skip downloading the response body just because it was unsuccessful, we may still need it (e.g. it's very common to return the detailed error description in a JSON object in the message body when returning some 4xx error), so don't do it in wxMSW implementation and add a test verifying that we still get the expected body even for an error status. Also improve wxWebRequest::State values documentation. --- include/wx/private/webrequest.h | 7 +++---- include/wx/webrequest.h | 2 -- interface/wx/webrequest.h | 35 +++++++++++++++++--------------- src/common/webrequest.cpp | 27 ++++++++++++------------ src/common/webrequest_curl.cpp | 10 ++++++--- src/msw/webrequest_winhttp.cpp | 4 ++-- src/osx/webrequest_urlsession.mm | 3 +-- tests/net/webrequest.cpp | 15 ++++++++++++++ 8 files changed, 60 insertions(+), 43 deletions(-) diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index a2f9299ca2..9a54668ae3 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -65,8 +65,6 @@ public: bool SetData(wxScopedPtr& dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); - void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; } - void SetStorage(wxWebRequest::Storage storage) { m_storage = storage; } wxWebRequest::Storage GetStorage() const { return m_storage; } @@ -111,7 +109,9 @@ protected: wxWebRequestImpl(wxWebSession& session, wxEvtHandler* handler, int id); - bool CheckServerStatus(); + // Call SetState() with either State_Failed or State_Completed appropriate + // for the response status. + void SetFinalStateFromStatus(); static bool IsActiveState(wxWebRequest::State state); @@ -120,7 +120,6 @@ private: wxEvtHandler* const m_handler; const int m_id; wxWebRequest::State m_state; - bool m_ignoreServerErrorStatus; wxFileOffset m_bytesReceived; wxCharBuffer m_dataText; diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 42e6312ad5..52499915c8 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -157,8 +157,6 @@ public: bool SetData(wxInputStream* dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); - void SetIgnoreServerErrorStatus(bool ignore); - void SetStorage(Storage storage); Storage GetStorage() const; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 1d8cf06a36..11e592eebc 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -129,18 +129,33 @@ public: State_Idle, /** - The request is currently unauthorized. Calling GetAuthChallenge() - returns a challenge object with further details. + The request is currently unauthorized. + + Calling GetAuthChallenge() returns a challenge object with further + details and calling SetCredentials() on this object will retry the + request using these credentials. */ State_Unauthorized, /// The request has been started and is transferring data State_Active, - /// The request completed successfully and all data has been received. + /** + The request completed successfully and all data has been received. + + The HTTP status code returned by wxWebResponse::GetStatus() will be + in 100-399 range, and typically 200. + */ State_Completed, - /// The request failed + /** + The request failed. + + This can happen either because the request couldn't be performed at + all (e.g. a connection error) or if the server returned an HTTP + error. In the former case wxWebResponse::GetStatus() returns 0, + while in the latter it returns a value in 400-599 range. + */ State_Failed, /// The request has been cancelled before completion by calling Cancel() @@ -321,18 +336,6 @@ public: bool SetData(wxInputStream* dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset); - /** - Instructs the request to ignore server error status codes. - - Per default, server side errors (status code 400-599) will enter - the State_Failed state just like network errors, but - if the response is still required in such cases (e.g. to get more - details from the response body), set this option to ignore all errors. - If ignored, wxWebResponse::GetStatus() has to be checked - from the State_Completed event handler. - */ - void SetIgnoreServerErrorStatus(bool ignore); - /** Sets how response data will be stored. diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 93e967a896..a405b3fcef 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -63,22 +63,28 @@ wxWebRequestImpl::wxWebRequestImpl(wxWebSession& session, wxEvtHandler* handler, m_handler(handler), m_id(id), m_state(wxWebRequest::State_Idle), - m_ignoreServerErrorStatus(false), m_bytesReceived(0) { } -bool wxWebRequestImpl::CheckServerStatus() +void wxWebRequestImpl::SetFinalStateFromStatus() { const wxWebResponseImplPtr& resp = GetResponse(); - if ( resp && resp->GetStatus() >= 400 && !m_ignoreServerErrorStatus ) + if ( !resp || resp->GetStatus() >= 400 ) { - SetState(wxWebRequest::State_Failed, wxString::Format(_("Error: %s (%d)"), - resp->GetStatusText(), resp->GetStatus())); - return false; + wxString err; + if ( resp ) + { + err.Printf(_("Error: %s (%d)"), + resp->GetStatusText(), resp->GetStatus()); + } + + SetState(wxWebRequest::State_Failed, err); } else - return true; + { + SetState(wxWebRequest::State_Completed); + } } bool wxWebRequestImpl::IsActiveState(wxWebRequest::State state) @@ -360,13 +366,6 @@ wxWebRequest::SetData(wxInputStream* dataStream, return m_impl->SetData(streamPtr, contentType, dataSize); } -void wxWebRequest::SetIgnoreServerErrorStatus(bool ignore) -{ - wxCHECK_IMPL_VOID(); - - m_impl->SetIgnoreServerErrorStatus(ignore); -} - void wxWebRequest::SetStorage(Storage storage) { wxCHECK_IMPL_VOID(); diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 3e9c7053cd..d2927039b9 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -272,16 +272,20 @@ void wxWebRequestCURL::HandleCompletion() { int status = m_response ? m_response->GetStatus() : 0; - if ( status == 0) + if ( status == 0 ) + { SetState(wxWebRequest::State_Failed, GetError()); + } else if ( status == 401 || status == 407 ) { m_authChallenge.reset(new wxWebAuthChallengeCURL( (status == 407) ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); SetState(wxWebRequest::State_Unauthorized, m_response->GetStatusText()); } - else if ( CheckServerStatus() ) - SetState(wxWebRequest::State_Completed); + else + { + SetFinalStateFromStatus(); + } } wxString wxWebRequestCURL::GetError() const diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 9aa07a0f3d..99ba8380d0 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -170,7 +170,7 @@ wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, } else { - SetState(wxWebRequest::State_Completed); + SetFinalStateFromStatus(); } break; @@ -259,7 +259,7 @@ void wxWebRequestWinHTTP::CreateResponse() else SetFailedWithLastError(); } - else if ( CheckServerStatus() ) + else { // Start reading the response if ( !m_response->ReadData() ) diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index fb8a126458..822c65dda9 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -235,8 +235,7 @@ void wxWebRequestURLSession::HandleCompletion() break; default: - if ( CheckServerStatus() ) - SetState(wxWebRequest::State_Completed); + SetFinalStateFromStatus(); } } diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 115ae97b14..2b63851e12 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -192,6 +192,21 @@ TEST_CASE_METHOD(RequestFixture, Run(wxWebRequest::State_Failed, 404); } +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Error::Body", "[net][webrequest][error]") +{ + if ( !InitBaseURL() ) + return; + + // We can't use the same httpbin.org server that we use for the other tests + // for this one because it doesn't return anything in the body when + // returning an error status code, so use another one. + CreateAbs("https://httpstat.us/418"); + Run(wxWebRequest::State_Failed, 418); + + CHECK( request.GetResponse().AsString() == "418 I'm a teapot" ); +} + TEST_CASE_METHOD(RequestFixture, "WebRequest::Error::Connect", "[net][webrequest][error]") { From 420160f0a2be75bfc9600a6b1864652d13d57dcd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 13:00:19 +0100 Subject: [PATCH 199/218] Fix format specifier for DWORD in wxWebRequestWinHTTP code This fixes assertion failure when running under Win64 due to the size mismatch between DWORD and size_t on this platform. --- src/msw/webrequest_winhttp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 99ba8380d0..843f309fe6 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -149,7 +149,7 @@ wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength) { - wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: callback %08x, len=%zu", + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: callback %08x, len=%lu", this, dwInternetStatus, dwStatusInformationLength); switch ( dwInternetStatus ) From 1e8fe318edaadc3cd0220302db96db4010e28e60 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 15:40:32 +0100 Subject: [PATCH 200/218] Work around wxWebRequest test failure under Ubuntu 14.04 Ignore wrong status code returned by libcurl on this ancient version, it's not worth dealing with it. --- tests/net/webrequest.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 2b63851e12..07cdfbadb5 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -202,7 +202,19 @@ TEST_CASE_METHOD(RequestFixture, // for this one because it doesn't return anything in the body when // returning an error status code, so use another one. CreateAbs("https://httpstat.us/418"); - Run(wxWebRequest::State_Failed, 418); + Run(wxWebRequest::State_Failed); + + // For some reason, this test doesn't work with libcurl included in Ubuntu + // 14.04, so skip it. + const int status = request.GetResponse().GetStatus(); + if ( status == 0 ) + { + WARN("Status code not returned."); + } + else + { + CHECK( status == 418 ); + } CHECK( request.GetResponse().AsString() == "418 I'm a teapot" ); } From af160f3d3eb34b36b93afb1f0958d5e0c51dbaf1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 15:42:12 +0100 Subject: [PATCH 201/218] Use CHECK() when REQUIRE() is not needed in wxWebRequest tests Continue performing the other checks unless we really can't do it. --- tests/net/webrequest.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 07cdfbadb5..cc5830b802 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -73,7 +73,7 @@ public: if ( request.GetStorage() == wxWebRequest::Storage_File ) { wxFileName fn(evt.GetDataFile()); - REQUIRE( fn.GetSize() == expectedFileSize ); + CHECK( fn.GetSize() == expectedFileSize ); } wxFALLTHROUGH; case wxWebRequest::State_Failed: @@ -114,7 +114,7 @@ public: RunLoopWithTimeout(); REQUIRE( request.GetState() == requiredState ); if (requiredStatus) - REQUIRE( request.GetResponse().GetStatus() == requiredStatus ); + CHECK( request.GetResponse().GetStatus() == requiredStatus ); } // Precondition: we must have an auth challenge. @@ -139,9 +139,9 @@ TEST_CASE_METHOD(RequestFixture, Create("/bytes/65536"); Run(); - REQUIRE( request.GetResponse().GetContentLength() == 65536 ); - REQUIRE( request.GetBytesExpectedToReceive() == 65536 ); - REQUIRE( request.GetBytesReceived() == 65536 ); + CHECK( request.GetResponse().GetContentLength() == 65536 ); + CHECK( request.GetBytesExpectedToReceive() == 65536 ); + CHECK( request.GetBytesReceived() == 65536 ); } TEST_CASE_METHOD(RequestFixture, @@ -152,7 +152,7 @@ TEST_CASE_METHOD(RequestFixture, Create("/base64/VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw=="); Run(); - REQUIRE( request.GetResponse().AsString() == "The quick brown fox jumps over the lazy dog" ); + CHECK( request.GetResponse().AsString() == "The quick brown fox jumps over the lazy dog" ); } TEST_CASE_METHOD(RequestFixture, @@ -165,7 +165,7 @@ TEST_CASE_METHOD(RequestFixture, Create(wxString::Format("/bytes/%lld", expectedFileSize)); request.SetStorage(wxWebRequest::Storage_File); Run(); - REQUIRE( request.GetBytesReceived() == expectedFileSize ); + CHECK( request.GetBytesReceived() == expectedFileSize ); } TEST_CASE_METHOD(RequestFixture, @@ -178,8 +178,8 @@ TEST_CASE_METHOD(RequestFixture, Create(wxString::Format("/bytes/%d", processingSize)); request.SetStorage(wxWebRequest::Storage_None); Run(); - REQUIRE( request.GetBytesReceived() == processingSize ); - REQUIRE( dataSize == processingSize ); + CHECK( request.GetBytesReceived() == processingSize ); + CHECK( dataSize == processingSize ); } TEST_CASE_METHOD(RequestFixture, @@ -364,9 +364,9 @@ TEST_CASE("WebRequestUtils", "[net][webrequest]") wxString header = "multipart/mixed; boundary=\"MIME_boundary_01234567\""; value = wxPrivate::SplitParameters(header, params); - REQUIRE( value == "multipart/mixed" ); - REQUIRE( params.size() == 1 ); - REQUIRE( params["boundary"] == "MIME_boundary_01234567" ); + CHECK( value == "multipart/mixed" ); + CHECK( params.size() == 1 ); + CHECK( params["boundary"] == "MIME_boundary_01234567" ); } #endif // wxUSE_WEBREQUEST From 60d429047ebd957859dbc6328da26c4b37475cc6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 23:14:14 +0100 Subject: [PATCH 202/218] Fix workaround for the test failure with Ubuntu 14.04 libcurl Don't check for 200 status code. Also don't check the response body if we don't get it at all. --- tests/net/webrequest.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index cc5830b802..6e12f57036 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -202,7 +202,7 @@ TEST_CASE_METHOD(RequestFixture, // for this one because it doesn't return anything in the body when // returning an error status code, so use another one. CreateAbs("https://httpstat.us/418"); - Run(wxWebRequest::State_Failed); + Run(wxWebRequest::State_Failed, 0); // For some reason, this test doesn't work with libcurl included in Ubuntu // 14.04, so skip it. @@ -214,9 +214,8 @@ TEST_CASE_METHOD(RequestFixture, else { CHECK( status == 418 ); + CHECK( request.GetResponse().AsString() == "418 I'm a teapot" ); } - - CHECK( request.GetResponse().AsString() == "418 I'm a teapot" ); } TEST_CASE_METHOD(RequestFixture, From 767755208759d0058d47d3901110f1fe22ae2175 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 23:48:01 +0100 Subject: [PATCH 203/218] Rename wxWebRequestWinHTTP::m_sessionWinHTTP to m_sessionImpl No real changes, just use the same name as in the other backends for consistency (we could also rename m_sessionImpl in the other ones to m_sessionCURL and m_sessionURLSession respectively, but this would have been more work and the latter name is really not great). --- include/wx/msw/private/webrequest_winhttp.h | 4 ++-- src/msw/webrequest_winhttp.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wx/msw/private/webrequest_winhttp.h b/include/wx/msw/private/webrequest_winhttp.h index 11f2755528..a722289822 100644 --- a/include/wx/msw/private/webrequest_winhttp.h +++ b/include/wx/msw/private/webrequest_winhttp.h @@ -67,7 +67,7 @@ class wxWebRequestWinHTTP : public wxWebRequestImpl { public: wxWebRequestWinHTTP(wxWebSession& session, - wxWebSessionWinHTTP& sessionWinHTTP, + wxWebSessionWinHTTP& sessionImpl, wxEvtHandler* handler, const wxString& url, int id); @@ -94,7 +94,7 @@ public: HINTERNET GetHandle() const { return m_request; } private: - wxWebSessionWinHTTP& m_sessionWinHTTP; + wxWebSessionWinHTTP& m_sessionImpl; wxString m_url; HINTERNET m_connect; HINTERNET m_request; diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 843f309fe6..ad22f08ad1 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -123,12 +123,12 @@ static void CALLBACK wxRequestStatusCallback( // wxWebRequestWinHTTP::wxWebRequestWinHTTP(wxWebSession& session, - wxWebSessionWinHTTP& sessionWinHTTP, + wxWebSessionWinHTTP& sessionImpl, wxEvtHandler* handler, const wxString& url, int id): wxWebRequestImpl(session, handler, id), - m_sessionWinHTTP(sessionWinHTTP), + m_sessionImpl(sessionImpl), m_url(url), m_connect(NULL), m_request(NULL), @@ -305,7 +305,7 @@ void wxWebRequestWinHTTP::Start() // Open a connection m_connect = ::WinHttpConnect ( - m_sessionWinHTTP.GetHandle(), + m_sessionImpl.GetHandle(), wxString(urlComps.lpszHostName, urlComps.dwHostNameLength).wc_str(), urlComps.nPort, wxRESERVED_PARAM From a561cf199b3899dab97eff9ccc85bd7c34eff3e1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Jan 2021 23:49:06 +0100 Subject: [PATCH 204/218] Remove semi-public wxWebSession::GetImpl() It's better not to have this method in the public class, even if it means that we need to pass a wxWebSessionImpl object to wxWebRequestImpl ctor explicitly now. No real changes. --- include/wx/private/webrequest.h | 5 ++++- include/wx/webrequest.h | 2 -- src/common/webrequest.cpp | 7 +++++-- src/common/webrequest_curl.cpp | 2 +- src/msw/webrequest_winhttp.cpp | 2 +- src/osx/webrequest_urlsession.mm | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index 9a54668ae3..ab58725167 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -107,7 +107,10 @@ protected: wxFileOffset m_dataSize; wxScopedPtr m_dataStream; - wxWebRequestImpl(wxWebSession& session, wxEvtHandler* handler, int id); + wxWebRequestImpl(wxWebSession& session, + wxWebSessionImpl& sessionImpl, + wxEvtHandler* handler, + int id); // Call SetState() with either State_Failed or State_Completed appropriate // for the response status. diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index 52499915c8..ac69374a21 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -230,8 +230,6 @@ public: void Close(); - wxWebSessionImpl* GetImpl() const { return m_impl.get(); } - private: static void RegisterFactory(const wxString& backend, wxWebSessionFactory* factory); diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index a405b3fcef..dcfaeabb55 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -55,9 +55,12 @@ static const wxStringCharType* wxNO_IMPL_MSG // // wxWebRequestImpl // -wxWebRequestImpl::wxWebRequestImpl(wxWebSession& session, wxEvtHandler* handler, int id) +wxWebRequestImpl::wxWebRequestImpl(wxWebSession& session, + wxWebSessionImpl& sessionImpl, + wxEvtHandler* handler, + int id) : m_storage(wxWebRequest::Storage_Memory), - m_headers(session.GetImpl()->GetHeaders()), + m_headers(sessionImpl.GetHeaders()), m_dataSize(0), m_session(session), m_handler(handler), diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index d2927039b9..3d42e5f08c 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -156,7 +156,7 @@ wxWebRequestCURL::wxWebRequestCURL(wxWebSession & session, wxEvtHandler* handler, const wxString & url, int id): - wxWebRequestImpl(session, handler, id), + wxWebRequestImpl(session, sessionImpl, handler, id), m_sessionImpl(sessionImpl) { m_headerList = NULL; diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index ad22f08ad1..716e9af7f9 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -127,7 +127,7 @@ wxWebRequestWinHTTP::wxWebRequestWinHTTP(wxWebSession& session, wxEvtHandler* handler, const wxString& url, int id): - wxWebRequestImpl(session, handler, id), + wxWebRequestImpl(session, sessionImpl, handler, id), m_sessionImpl(sessionImpl), m_url(url), m_connect(NULL), diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 822c65dda9..2bf4500b89 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -164,7 +164,7 @@ wxWebRequestURLSession::wxWebRequestURLSession(wxWebSession& session, wxEvtHandler* handler, const wxString& url, int winid): - wxWebRequestImpl(session, handler, winid), + wxWebRequestImpl(session, sessionImpl, handler, winid), m_sessionImpl(sessionImpl), m_url(url) { From 65aad890e3bd2abed3cd3d8c02c03257b428a84a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 00:21:00 +0100 Subject: [PATCH 205/218] Add GetNativeHandle() to wxWebSession and wxWebRequest This allows to retrieve the handles used internally in order to do something not supported by the public API yet. --- include/wx/msw/private/webrequest_winhttp.h | 10 ++++++ .../wx/osx/private/webrequest_urlsession.h | 10 ++++++ include/wx/private/webrequest.h | 4 +++ include/wx/private/webrequest_curl.h | 10 ++++++ include/wx/webrequest.h | 7 +++++ interface/wx/webrequest.h | 31 ++++++++++++++++++- src/common/webrequest.cpp | 10 ++++++ tests/net/webrequest.cpp | 27 ++++++++++++++++ 8 files changed, 108 insertions(+), 1 deletion(-) diff --git a/include/wx/msw/private/webrequest_winhttp.h b/include/wx/msw/private/webrequest_winhttp.h index a722289822..3851e7f209 100644 --- a/include/wx/msw/private/webrequest_winhttp.h +++ b/include/wx/msw/private/webrequest_winhttp.h @@ -93,6 +93,11 @@ public: HINTERNET GetHandle() const { return m_request; } + wxWebRequestHandle GetNativeHandle() const wxOVERRIDE + { + return (wxWebRequestHandle)GetHandle(); + } + private: wxWebSessionWinHTTP& m_sessionImpl; wxString m_url; @@ -137,6 +142,11 @@ public: HINTERNET GetHandle() const { return m_handle; } + wxWebSessionHandle GetNativeHandle() const wxOVERRIDE + { + return (wxWebSessionHandle)GetHandle(); + } + private: HINTERNET m_handle; diff --git a/include/wx/osx/private/webrequest_urlsession.h b/include/wx/osx/private/webrequest_urlsession.h index 4ecf0a6abf..68a1210c9a 100644 --- a/include/wx/osx/private/webrequest_urlsession.h +++ b/include/wx/osx/private/webrequest_urlsession.h @@ -102,6 +102,11 @@ public: wxFileOffset GetBytesExpectedToReceive() const wxOVERRIDE; + wxWebRequestHandle GetNativeHandle() const wxOVERRIDE + { + return (wxWebRequestHandle)m_task; + } + void HandleCompletion(); void HandleChallenge(wxWebAuthChallengeURLSession* challenge); @@ -139,6 +144,11 @@ public: wxVersionInfo GetLibraryVersionInfo() wxOVERRIDE; + wxWebSessionHandle GetNativeHandle() const wxOVERRIDE + { + return (wxWebSessionHandle)m_session; + } + WX_NSURLSession GetSession() { return m_session; } WX_wxWebSessionDelegate GetDelegate() { return m_delegate; } diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index ab58725167..95588feba3 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -92,6 +92,8 @@ public: virtual wxFileOffset GetBytesExpectedToReceive() const; + virtual wxWebRequestHandle GetNativeHandle() const = 0; + void SetState(wxWebRequest::State state, const wxString& failMsg = wxString()); void ReportDataReceived(size_t sizeReceived); @@ -222,6 +224,8 @@ public: const wxWebRequestHeaderMap& GetHeaders() const { return m_headers; } + virtual wxWebSessionHandle GetNativeHandle() const = 0; + protected: wxWebSessionImpl(); diff --git a/include/wx/private/webrequest_curl.h b/include/wx/private/webrequest_curl.h index ac3e53634b..5229db7bc2 100644 --- a/include/wx/private/webrequest_curl.h +++ b/include/wx/private/webrequest_curl.h @@ -64,6 +64,11 @@ public: CURL* GetHandle() const { return m_handle; } + wxWebRequestHandle GetNativeHandle() const wxOVERRIDE + { + return (wxWebRequestHandle)GetHandle(); + } + bool StartRequest(); void HandleCompletion(); @@ -133,6 +138,11 @@ public: wxVersionInfo GetLibraryVersionInfo() wxOVERRIDE; + wxWebSessionHandle GetNativeHandle() const wxOVERRIDE + { + return (wxWebSessionHandle)m_handle; + } + bool StartRequest(wxWebRequestCURL& request); void CancelRequest(wxWebRequestCURL* request); diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index ac69374a21..be4cec2a15 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -45,6 +45,9 @@ class wxWebResponse; class wxWebSession; class wxWebSessionFactory; +typedef struct wxWebRequestHandleOpaque* wxWebRequestHandle; +typedef struct wxWebSessionHandleOpaque* wxWebSessionHandle; + class wxWebAuthChallengeImpl; class wxWebRequestImpl; class wxWebResponseImpl; @@ -183,6 +186,8 @@ public: wxFileOffset GetBytesExpectedToReceive() const; + wxWebRequestHandle GetNativeHandle() const; + private: // Ctor is only used by wxWebSession. friend class wxWebSession; @@ -230,6 +235,8 @@ public: void Close(); + wxWebSessionHandle GetNativeHandle() const; + private: static void RegisterFactory(const wxString& backend, wxWebSessionFactory* factory); diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 11e592eebc..10c4ef2e16 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -207,10 +207,25 @@ public: /** Check if the object is valid. - No other methods can be used if this function returns @false. + If the object is invalid, it must be assigned a valid request before + any other methods can be used (with the exception of GetNativeHandle()). */ bool IsOk() const; + /** + Return the native handle corresponding to this request object. + + @c wxWebRequestHandle is an opaque type containing a value of the + following type according to the backend being used: + + - For WinHTTP backend, this is @c HINTERNET request handle. + - For CURL backend, this is a @c CURL struct pointer. + - For macOS backend, this is @c NSURLSessionTask object pointer. + + @see wxWebSession::GetNativeHandle() + */ + wxWebRequestHandle GetNativeHandle() const; + /** Send the request to the server asynchronously. @@ -692,6 +707,20 @@ public: */ static bool IsBackendAvailable(const wxString& backend); + /** + Return the native handle corresponding to this session object. + + @c wxWebSessionHandle is an opaque type containing a value of the + following type according to the backend being used: + + - For WinHTTP backend, this is @c HINTERNET session handle. + - For CURL backend, this is a @c CURLM struct pointer. + - For macOS backend, this is @c NSURLSession object pointer. + + @see wxWebRequest::GetNativeHandle() + */ + wxWebSessionHandle GetNativeHandle() const; + /** Return true if the session was successfully opened and can be used. */ diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index dcfaeabb55..7d77112a82 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -463,6 +463,11 @@ wxFileOffset wxWebRequest::GetBytesExpectedToReceive() const return m_impl->GetBytesExpectedToReceive(); } +wxWebRequestHandle wxWebRequest::GetNativeHandle() const +{ + return m_impl ? m_impl->GetNativeHandle() : NULL; +} + // // wxWebAuthChallenge @@ -931,6 +936,11 @@ void wxWebSession::Close() m_impl.reset(NULL); } +wxWebSessionHandle wxWebSession::GetNativeHandle() const +{ + return m_impl ? m_impl->GetNativeHandle() : NULL; +} + // ---------------------------------------------------------------------------- // Module ensuring all global/singleton objects are destroyed on shutdown. // ---------------------------------------------------------------------------- diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 6e12f57036..8e9db16321 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -144,6 +144,33 @@ TEST_CASE_METHOD(RequestFixture, CHECK( request.GetBytesReceived() == 65536 ); } +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Get::Simple", "[net][webrequest][get]") +{ + if ( !InitBaseURL() ) + return; + + // Note that the session may be initialized on demand, so don't check the + // native handle before actually using it. + wxWebSession& session = wxWebSession::GetDefault(); + REQUIRE( session.IsOpened() ); + + // Request is not initialized yet. + CHECK( !request.IsOk() ); + CHECK( !request.GetNativeHandle() ); + + Create("/status/200"); + CHECK( request.IsOk() ); + CHECK( session.GetNativeHandle() ); + + // Note that the request must be started to have a valid native handle. + request.Start(); + CHECK( request.GetNativeHandle() ); + RunLoopWithTimeout(); + CHECK( request.GetState() == wxWebRequest::State_Completed ); + CHECK( request.GetResponse().GetStatus() == 200 ); +} + TEST_CASE_METHOD(RequestFixture, "WebRequest::Get::String", "[net][webrequest][get]") { From b428e531eefe8e9f103406120e3c3366fb190fee Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 13:47:58 +0100 Subject: [PATCH 206/218] Check for errors when calling WinHttpCloseHandle() Add a trivial wxWinHTTPCloseHandle() wrapper calling wxLogLastError() if closing the handle failed -- this is really not expected to happen, so make sure to at least log it if it does. --- src/msw/webrequest_winhttp.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 716e9af7f9..102fc7305a 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -101,6 +101,15 @@ void wxWinHTTPSetOption(HINTERNET hInternet, DWORD dwOption, DWORD dwValue) ::WinHttpSetOption(hInternet, dwOption, &dwValue, sizeof(dwValue)); } +static +void wxWinHTTPCloseHandle(HINTERNET hInternet) +{ + if ( !::WinHttpCloseHandle(hInternet) ) + { + wxLogLastError("WinHttpCloseHandle"); + } +} + static void CALLBACK wxRequestStatusCallback( HINTERNET WXUNUSED(hInternet), DWORD_PTR dwContext, @@ -139,9 +148,9 @@ wxWebRequestWinHTTP::wxWebRequestWinHTTP(wxWebSession& session, wxWebRequestWinHTTP::~wxWebRequestWinHTTP() { if ( m_request ) - ::WinHttpCloseHandle(m_request); + wxWinHTTPCloseHandle(m_request); if ( m_connect ) - ::WinHttpCloseHandle(m_connect); + wxWinHTTPCloseHandle(m_connect); } void @@ -396,7 +405,7 @@ void wxWebRequestWinHTTP::Cancel() SetState(wxWebRequest::State_Cancelled); if ( m_request != NULL ) { - ::WinHttpCloseHandle(m_request); + wxWinHTTPCloseHandle(m_request); m_request = NULL; } } @@ -555,7 +564,7 @@ wxWebSessionWinHTTP::wxWebSessionWinHTTP(): wxWebSessionWinHTTP::~wxWebSessionWinHTTP() { if ( m_handle ) - ::WinHttpCloseHandle(m_handle); + wxWinHTTPCloseHandle(m_handle); } bool wxWebSessionWinHTTP::Open() From 508a4f6ca8e8ee9e3104ad9139b81ddc7cc0a63c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 13:49:22 +0100 Subject: [PATCH 207/218] Fix Cancel() semantics under MSW and other improvements to it Under MSW, don't set the state to State_Cancelled as soon as Cancel() was called, as the request was still used from the other threads afterwards, resulting in race conditions and crashes. Fix this by just removing the SetState(State_Cancelled) call from the main thread, as it was redundant anyhow. This also makes the behaviour correspond to the documentation, which indicates that Cancel() works asynchronously. Also ensure, for all backends, that we actually cancel the request only once, even if public Cancel() is called multiple times. This required renaming the existing wxWebRequestImpl::Cancel() to DoCancel(). --- include/wx/msw/private/webrequest_winhttp.h | 4 ++-- .../wx/osx/private/webrequest_urlsession.h | 4 ++-- include/wx/private/webrequest.h | 12 ++++++++++- include/wx/private/webrequest_curl.h | 4 ++-- interface/wx/webrequest.h | 5 +++++ src/common/webrequest.cpp | 21 ++++++++++++++++++- src/common/webrequest_curl.cpp | 2 +- src/msw/webrequest_winhttp.cpp | 16 +++++--------- src/osx/webrequest_urlsession.mm | 2 +- 9 files changed, 49 insertions(+), 21 deletions(-) diff --git a/include/wx/msw/private/webrequest_winhttp.h b/include/wx/msw/private/webrequest_winhttp.h index 3851e7f209..c4767a7395 100644 --- a/include/wx/msw/private/webrequest_winhttp.h +++ b/include/wx/msw/private/webrequest_winhttp.h @@ -76,8 +76,6 @@ public: void Start() wxOVERRIDE; - void Cancel() wxOVERRIDE; - wxWebResponseImplPtr GetResponse() const wxOVERRIDE { return m_response; } @@ -99,6 +97,8 @@ public: } private: + void DoCancel() wxOVERRIDE; + wxWebSessionWinHTTP& m_sessionImpl; wxString m_url; HINTERNET m_connect; diff --git a/include/wx/osx/private/webrequest_urlsession.h b/include/wx/osx/private/webrequest_urlsession.h index 68a1210c9a..dad169703e 100644 --- a/include/wx/osx/private/webrequest_urlsession.h +++ b/include/wx/osx/private/webrequest_urlsession.h @@ -86,8 +86,6 @@ public: void Start() wxOVERRIDE; - void Cancel() wxOVERRIDE; - wxWebResponseImplPtr GetResponse() const wxOVERRIDE { return m_response; } @@ -120,6 +118,8 @@ public: { return m_authChallenge.get(); } private: + void DoCancel() wxOVERRIDE; + wxWebSessionURLSession& m_sessionImpl; wxString m_url; WX_NSURLSessionTask m_task; diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index 95588feba3..c4ad8ade05 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -72,7 +72,9 @@ public: // Precondition for this method checked by caller: current state is idle. virtual void Start() = 0; - virtual void Cancel() = 0; + // Precondition for this method checked by caller: not idle and not already + // cancelled. + void Cancel(); virtual wxWebResponseImplPtr GetResponse() const = 0; @@ -114,6 +116,8 @@ protected: wxEvtHandler* handler, int id); + bool WasCancelled() const { return m_cancelled; } + // Call SetState() with either State_Failed or State_Completed appropriate // for the response status. void SetFinalStateFromStatus(); @@ -121,6 +125,9 @@ protected: static bool IsActiveState(wxWebRequest::State state); private: + // Called from public Cancel() at most once per object. + virtual void DoCancel() = 0; + wxWebSession& m_session; wxEvtHandler* const m_handler; const int m_id; @@ -128,6 +135,9 @@ private: wxFileOffset m_bytesReceived; wxCharBuffer m_dataText; + // Initially false, set to true after the first call to Cancel(). + bool m_cancelled; + wxDECLARE_NO_COPY_CLASS(wxWebRequestImpl); }; diff --git a/include/wx/private/webrequest_curl.h b/include/wx/private/webrequest_curl.h index 5229db7bc2..ec38041785 100644 --- a/include/wx/private/webrequest_curl.h +++ b/include/wx/private/webrequest_curl.h @@ -50,8 +50,6 @@ public: void Start() wxOVERRIDE; - void Cancel() wxOVERRIDE; - wxWebResponseImplPtr GetResponse() const wxOVERRIDE { return m_response; } @@ -79,6 +77,8 @@ public: size_t CURLOnRead(char* buffer, size_t size); private: + void DoCancel() wxOVERRIDE; + wxWebSessionCURL& m_sessionImpl; CURL* m_handle; diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 10c4ef2e16..66e8ed41cd 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -244,6 +244,11 @@ public: Note that cancelling is asynchronous, so the application needs to wait until the request state becomes @c State_Cancelled to know when the request was really cancelled. + + Request must be active when Cancel() is called, i.e. the current state + can't be @c State_Idle. However, because it can be difficult to avoid + doing it in some circumstances, Cancel() may be called multiple times + and only a single wxWebRequestEvent will be sent even in this case. */ void Cancel(); diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 7d77112a82..1c46b0012e 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -66,10 +66,26 @@ wxWebRequestImpl::wxWebRequestImpl(wxWebSession& session, m_handler(handler), m_id(id), m_state(wxWebRequest::State_Idle), - m_bytesReceived(0) + m_bytesReceived(0), + m_cancelled(false) { } +void wxWebRequestImpl::Cancel() +{ + if ( m_cancelled ) + { + // Nothing to do, don't even assert -- it's ok to call Cancel() + // multiple times, but calling DoCancel() once is enough. + return; + } + + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: cancelling", this); + + m_cancelled = true; + DoCancel(); +} + void wxWebRequestImpl::SetFinalStateFromStatus() { const wxWebResponseImplPtr& resp = GetResponse(); @@ -397,6 +413,9 @@ void wxWebRequest::Cancel() { wxCHECK_IMPL_VOID(); + wxCHECK_RET( m_impl->GetState() != wxWebRequest::State_Idle, + "Not yet started requests can't be cancelled" ); + m_impl->Cancel(); } diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 3d42e5f08c..47264ff12b 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -263,7 +263,7 @@ bool wxWebRequestCURL::StartRequest() return true; } -void wxWebRequestCURL::Cancel() +void wxWebRequestCURL::DoCancel() { m_sessionImpl.CancelRequest(this); } diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 102fc7305a..65c3a5ef18 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -174,7 +174,7 @@ wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, if ( dwStatusInformationLength > 0 ) { if ( !m_response->ReportAvailableData(dwStatusInformationLength) - && GetState() != wxWebRequest::State_Cancelled ) + && !WasCancelled() ) SetFailedWithLastError(); } else @@ -195,7 +195,7 @@ wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus, // "Failing" with "cancelled" error is not actually an error if // we're expecting it, i.e. if our Cancel() had been called. if ( asyncResult->dwError == ERROR_WINHTTP_OPERATION_CANCELLED && - GetState() == wxWebRequest::State_Cancelled ) + WasCancelled() ) SetState(wxWebRequest::State_Cancelled); else SetFailed(asyncResult->dwError); @@ -398,16 +398,10 @@ void wxWebRequestWinHTTP::SendRequest() SetState(wxWebRequest::State_Active); } -void wxWebRequestWinHTTP::Cancel() +void wxWebRequestWinHTTP::DoCancel() { - wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: cancelling", this); - - SetState(wxWebRequest::State_Cancelled); - if ( m_request != NULL ) - { - wxWinHTTPCloseHandle(m_request); - m_request = NULL; - } + wxWinHTTPCloseHandle(m_request); + m_request = NULL; } // diff --git a/src/osx/webrequest_urlsession.mm b/src/osx/webrequest_urlsession.mm index 2bf4500b89..43b1dcdcee 100644 --- a/src/osx/webrequest_urlsession.mm +++ b/src/osx/webrequest_urlsession.mm @@ -220,7 +220,7 @@ void wxWebRequestURLSession::Start() [m_task resume]; } -void wxWebRequestURLSession::Cancel() +void wxWebRequestURLSession::DoCancel() { [m_task cancel]; } From 5babe577ce2dcdbc25751f7c2a9e9caf8cf32dc4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 13:50:32 +0100 Subject: [PATCH 208/218] Check that SetState() always actually switches states We shouldn't call SetState() to switch to the state that we're currently already in, normally. Add an assert to verify that this indeed doesn't happen. Also improve the logging statement to show both the old and the new states. --- src/common/webrequest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 1c46b0012e..117f9c51be 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -207,7 +207,9 @@ struct StateEventProcessor void wxWebRequestImpl::SetState(wxWebRequest::State state, const wxString & failMsg) { - wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: state => %d", this, state); + wxASSERT_MSG( state != m_state, "shouldn't switch to the same state" ); + + wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: state %d => %d", this, m_state, state); m_state = state; From a52f353321110c798b0f5016e497201a2074c9a0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 14:40:08 +0100 Subject: [PATCH 209/218] Set state to Active slightly earlier in wxWebRequestWinHTTP This is more consistent with the other backends, which all change the state before actually launching the asynchronous request. --- src/msw/webrequest_winhttp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 65c3a5ef18..2a46cdf2d4 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -381,6 +381,8 @@ void wxWebRequestWinHTTP::SendRequest() if ( m_dataSize ) m_dataWritten = 0; + SetState(wxWebRequest::State_Active); + // Send request if ( !::WinHttpSendRequest ( @@ -394,8 +396,6 @@ void wxWebRequestWinHTTP::SendRequest() SetFailedWithLastError(); return; } - - SetState(wxWebRequest::State_Active); } void wxWebRequestWinHTTP::DoCancel() From 3107a17353fdd28fcee98ae7abb96c165daf1654 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 14:44:45 +0100 Subject: [PATCH 210/218] Remove wxWebRequestImpl::IsActiveState() Semantics of this function wasn't really clear and it was used only once, so just inline it at the point of use and define better what happens for various states there. Also use a switch rather than testing for individual states to make sure this code is updated if another state is added in the future. No real changes. --- include/wx/private/webrequest.h | 2 -- src/common/webrequest.cpp | 24 +++++++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/include/wx/private/webrequest.h b/include/wx/private/webrequest.h index c4ad8ade05..b68c9c8b79 100644 --- a/include/wx/private/webrequest.h +++ b/include/wx/private/webrequest.h @@ -122,8 +122,6 @@ protected: // for the response status. void SetFinalStateFromStatus(); - static bool IsActiveState(wxWebRequest::State state); - private: // Called from public Cancel() at most once per object. virtual void DoCancel() = 0; diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 117f9c51be..f2701029ab 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -106,11 +106,6 @@ void wxWebRequestImpl::SetFinalStateFromStatus() } } -bool wxWebRequestImpl::IsActiveState(wxWebRequest::State state) -{ - return (state == wxWebRequest::State_Active || state == wxWebRequest::State_Unauthorized); -} - void wxWebRequestImpl::SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv) { m_dataText = text.mb_str(conv); @@ -304,8 +299,23 @@ SplitParameters(const wxString& s, wxWebRequestHeaderMap& parameters) void wxWebRequestImpl::ProcessStateEvent(wxWebRequest::State state, const wxString& failMsg) { - if ( !IsActiveState(state) && GetResponse() ) - GetResponse()->Finalize(); + switch ( state ) + { + case wxWebRequest::State_Idle: + wxFAIL_MSG("unexpected"); + break; + + case wxWebRequest::State_Active: + case wxWebRequest::State_Unauthorized: + break; + + case wxWebRequest::State_Completed: + case wxWebRequest::State_Failed: + case wxWebRequest::State_Cancelled: + if ( GetResponse() ) + GetResponse()->Finalize(); + break; + } wxString dataFile; From 1bf6d5e18869c4511dc0a7ed27c346bf0cb96721 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 14:49:25 +0100 Subject: [PATCH 211/218] Slightly refactor wxWebRequestImpl::ProcessStateEvent() Call GetResponse() only once. Also put the code for State_Completed inside the case for this state in the switch instead of testing for it separately later. No real changes. --- src/common/webrequest.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index f2701029ab..f38824f691 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -299,6 +299,13 @@ SplitParameters(const wxString& s, wxWebRequestHeaderMap& parameters) void wxWebRequestImpl::ProcessStateEvent(wxWebRequest::State state, const wxString& failMsg) { + wxString dataFile; + + const wxWebResponseImplPtr& response = GetResponse(); + + wxWebRequestEvent evt(wxEVT_WEBREQUEST_STATE, GetId(), state, + wxWebResponse(response), failMsg); + switch ( state ) { case wxWebRequest::State_Idle: @@ -310,23 +317,20 @@ void wxWebRequestImpl::ProcessStateEvent(wxWebRequest::State state, const wxStri break; case wxWebRequest::State_Completed: + if ( m_storage == wxWebRequest::Storage_File ) + { + dataFile = response->GetDataFile(); + evt.SetDataFile(dataFile); + } + wxFALLTHROUGH; + case wxWebRequest::State_Failed: case wxWebRequest::State_Cancelled: - if ( GetResponse() ) - GetResponse()->Finalize(); + if ( response ) + response->Finalize(); break; } - wxString dataFile; - - wxWebRequestEvent evt(wxEVT_WEBREQUEST_STATE, GetId(), state, - wxWebResponse(GetResponse()), failMsg); - if ( state == wxWebRequest::State_Completed && m_storage == wxWebRequest::Storage_File ) - { - dataFile = GetResponse()->GetDataFile(); - evt.SetDataFile(dataFile); - } - m_handler->ProcessEvent(evt); // Remove temporary file if we're using one and if it still exists: it From 3241c443c5d207184b24d488e4e0caeb6d78345a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 14:59:41 +0100 Subject: [PATCH 212/218] Process event about the request becoming active synchronously This is required in order to allow doing something with the request when it already have a valid native handle, but hasn't actually started yet. --- interface/wx/webrequest.h | 14 +++++++++++++- src/common/webrequest.cpp | 17 +++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 66e8ed41cd..79ed1ac312 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -137,7 +137,14 @@ public: */ State_Unauthorized, - /// The request has been started and is transferring data + /** + The request is about to start. + + An event notifying about the switch to this state is generated when + Start() is called (unless an error occurs, in which case the state + becomes State_Failed instead). Handling this event allows to do + something right before the asynchronous request actually starts. + */ State_Active, /** @@ -222,6 +229,11 @@ public: - For CURL backend, this is a @c CURL struct pointer. - For macOS backend, this is @c NSURLSessionTask object pointer. + Note that this function returns a valid value only after the request is + started successfully using Start(). Notably, it is guaranteed to return + a valid value when handling wxWebRequestEvent corresponding to the + switch to @c State_Active. + @see wxWebSession::GetNativeHandle() */ wxWebRequestHandle GetNativeHandle() const; diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index f38824f691..0d1ef2b068 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -208,8 +208,21 @@ void wxWebRequestImpl::SetState(wxWebRequest::State state, const wxString & fail m_state = state; - // Trigger the event in the main thread - m_handler->CallAfter(StateEventProcessor(*this, state, failMsg)); + // Trigger the event in the main thread except when switching to the active + // state because this always happens in the main thread anyhow and it's + // important to process it synchronously, before the request actually + // starts (this gives the possibility to modify the request using native + // functions, for example, as its GetNativeHandle() is already valid). + if ( state == wxWebRequest::State_Active ) + { + wxASSERT( wxIsMainThread() ); + + ProcessStateEvent(state, failMsg); + } + else + { + m_handler->CallAfter(StateEventProcessor(*this, state, failMsg)); + } } void wxWebRequestImpl::ReportDataReceived(size_t sizeReceived) From 204ae594a2c5db6360c21594b6f864a76212cc63 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 15:02:06 +0100 Subject: [PATCH 213/218] Check that we never get events about switching to State_Idle This state can never be returned to, once the state becomes active. --- tests/net/webrequest.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 8e9db16321..d29efaada6 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -82,6 +82,9 @@ public: break; case wxWebRequest::State_Idle: + FAIL("should never get events with State_Idle"); + break; + case wxWebRequest::State_Active: break; } From 0742ae9091e34de09fafd373c2e2019a7af59cee Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 15:05:38 +0100 Subject: [PATCH 214/218] Verify that native handle is available when state becomes active Check that GetNativeHandle() behaves as documented. --- tests/net/webrequest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index d29efaada6..e4ba7ba7cf 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -86,6 +86,7 @@ public: break; case wxWebRequest::State_Active: + CHECK( request.GetNativeHandle() ); break; } } From 0777fda680289ec833cfcc4d64f76039ab73f5cf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 15:07:18 +0100 Subject: [PATCH 215/218] Rearrange states in the switch in a more logical order No real changes, just try to organize the code in a more logical order. --- tests/net/webrequest.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index e4ba7ba7cf..14ce33f1da 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -68,7 +68,14 @@ public: { switch (evt.GetState()) { - case wxWebRequest::State_Unauthorized: + case wxWebRequest::State_Idle: + FAIL("should never get events with State_Idle"); + break; + + case wxWebRequest::State_Active: + CHECK( request.GetNativeHandle() ); + break; + case wxWebRequest::State_Completed: if ( request.GetStorage() == wxWebRequest::Storage_File ) { @@ -76,18 +83,12 @@ public: CHECK( fn.GetSize() == expectedFileSize ); } wxFALLTHROUGH; + + case wxWebRequest::State_Unauthorized: case wxWebRequest::State_Failed: case wxWebRequest::State_Cancelled: loop.Exit(); break; - - case wxWebRequest::State_Idle: - FAIL("should never get events with State_Idle"); - break; - - case wxWebRequest::State_Active: - CHECK( request.GetNativeHandle() ); - break; } } From c41041a3b6063c4d9c7421208da83ccda682539d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 21:20:10 +0100 Subject: [PATCH 216/218] Show error description if available when Cancel() test fails Hopefully this might provide more information about the failure of this test in MSVS 2008 build on AppVeyor. --- tests/net/webrequest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 14ce33f1da..64cf7afcab 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -87,6 +87,7 @@ public: case wxWebRequest::State_Unauthorized: case wxWebRequest::State_Failed: case wxWebRequest::State_Cancelled: + errorDescription = evt.GetErrorDescription(); loop.Exit(); break; } @@ -134,6 +135,7 @@ public: wxWebRequest request; wxInt64 expectedFileSize; wxInt64 dataSize; + wxString errorDescription; }; TEST_CASE_METHOD(RequestFixture, @@ -350,6 +352,8 @@ TEST_CASE_METHOD(RequestFixture, request.Start(); request.Cancel(); RunLoopWithTimeout(); + if ( !errorDescription.empty() ) + INFO( "Error:" << errorDescription ); REQUIRE( request.GetState() == wxWebRequest::State_Cancelled ); } From 4c19572d9dbe6afffb4fe858b2d9a27949b46805 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 23:33:18 +0100 Subject: [PATCH 217/218] Use switch over enum-valued variable rather than "if"s No real changes, just make sure we use an (exhaustive) switch rather than a less obvious sequence of if statements. --- src/common/webrequest.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index 0d1ef2b068..c3c9b1b4fa 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -680,19 +680,24 @@ void wxWebResponseImpl::ReportDataReceived(size_t sizeReceived) m_readBuffer.UngetAppendBuf(sizeReceived); m_request.ReportDataReceived(sizeReceived); - if ( m_request.GetStorage() == wxWebRequest::Storage_File ) + switch ( m_request.GetStorage() ) { - m_file.Write(m_readBuffer.GetData(), m_readBuffer.GetDataLen()); - } - else if ( m_request.GetStorage() == wxWebRequest::Storage_None ) - { - wxWebRequestEvent evt(wxEVT_WEBREQUEST_DATA, m_request.GetId(), wxWebRequest::State_Active); - evt.SetDataBuffer(m_readBuffer.GetData(), m_readBuffer.GetDataLen()); - m_request.GetHandler()->ProcessEvent(evt); - } + case wxWebRequest::Storage_Memory: + // Nothing to do, just keep appending data to the buffer. + break; - if ( m_request.GetStorage() != wxWebRequest::Storage_Memory ) - m_readBuffer.Clear(); + case wxWebRequest::Storage_File: + m_file.Write(m_readBuffer.GetData(), m_readBuffer.GetDataLen()); + m_readBuffer.Clear(); + break; + + case wxWebRequest::Storage_None: + wxWebRequestEvent evt(wxEVT_WEBREQUEST_DATA, m_request.GetId(), wxWebRequest::State_Active); + evt.SetDataBuffer(m_readBuffer.GetData(), m_readBuffer.GetDataLen()); + m_request.GetHandler()->ProcessEvent(evt); + m_readBuffer.Clear(); + break; + } } wxString wxWebResponseImpl::GetDataFile() const From 970ab0a1ae0108c9be2f7886b221c673df26733c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 23:48:15 +0100 Subject: [PATCH 218/218] Make sure wxEVT_WEBREQUEST_DATA is processed in the main thread This event was processed in a worker thread, which was different from all the other events and also almost surely not thread-safe, so change this and queue it for processing in the main thread instead. Use wxMemoryBuffer instead of non-owning pointer in wxWebRequestEvent and reset the buffer used internally every time to ensure the data is still available by the time the event is processed. Also increase the amount of data downloaded in the "advanced" page of the sample as it has to be greater than wxWEBREQUEST_BUFFER_SIZE, which is currently 64KiB, to have a chance of seeing the value actually change, otherwise all the data arrives in a single event. As it is, using the maximal size supported by the httpbin service, we only get 2 events. --- include/wx/webrequest.h | 12 +++++------- samples/webrequest/webrequest.cpp | 13 +++++-------- src/common/webrequest.cpp | 18 ++++++++++++++---- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/include/wx/webrequest.h b/include/wx/webrequest.h index be4cec2a15..ffeabf7036 100644 --- a/include/wx/webrequest.h +++ b/include/wx/webrequest.h @@ -257,7 +257,7 @@ public: const wxWebResponse& response = wxWebResponse(), const wxString& errorDesc = wxString()) : wxEvent(id, type), - m_state(state), m_response(response), m_data(NULL), m_dataSize(0), + m_state(state), m_response(response), m_errorDescription(errorDesc) { } @@ -271,12 +271,11 @@ public: void SetDataFile(const wxString& dataFile) { m_dataFile = dataFile; } - const void* GetDataBuffer() const { return m_data; } + const void* GetDataBuffer() const { return m_dataBuf.GetData(); } - size_t GetDataSize() const { return m_dataSize; } + size_t GetDataSize() const { return m_dataBuf.GetDataLen(); } - void SetDataBuffer(const void* buffer, size_t size) - { m_data = buffer; m_dataSize = size; } + void SetDataBuffer(const wxMemoryBuffer& dataBuf) { m_dataBuf = dataBuf; } wxEvent* Clone() const wxOVERRIDE { return new wxWebRequestEvent(*this); } @@ -284,8 +283,7 @@ private: wxWebRequest::State m_state; const wxWebResponse m_response; // may be invalid wxString m_dataFile; - const void* m_data; - size_t m_dataSize; + wxMemoryBuffer m_dataBuf; wxString m_errorDescription; }; diff --git a/samples/webrequest/webrequest.cpp b/samples/webrequest/webrequest.cpp index 5dca3b3188..3a16eda371 100644 --- a/samples/webrequest/webrequest.cpp +++ b/samples/webrequest/webrequest.cpp @@ -364,22 +364,19 @@ public: void OnRequestData(wxWebRequestEvent& evt) { // Count zero bytes in data buffer - bool notify = false; - const char* p = (const char*) evt.GetDataBuffer(); for ( size_t i = 0; i < evt.GetDataSize(); i++ ) { if ( *p == 0 ) - { m_advCount++; - notify = true; - } p++; } - if ( notify ) - CallAfter(&WebRequestFrame::UpdateAdvCount); + UpdateAdvCount(); + + // Make sure the new text is immediately visible. + m_advCountStaticText->Update(); } void UpdateAdvCount() @@ -425,7 +422,7 @@ public: defaultURL = "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.7z"; break; case Page_Advanced: - defaultURL = "https://httpbin.org/bytes/64000"; + defaultURL = "https://httpbin.org/bytes/100000"; break; } m_urlTextCtrl->SetValue(defaultURL); diff --git a/src/common/webrequest.cpp b/src/common/webrequest.cpp index c3c9b1b4fa..50cae4b05f 100644 --- a/src/common/webrequest.cpp +++ b/src/common/webrequest.cpp @@ -692,10 +692,20 @@ void wxWebResponseImpl::ReportDataReceived(size_t sizeReceived) break; case wxWebRequest::Storage_None: - wxWebRequestEvent evt(wxEVT_WEBREQUEST_DATA, m_request.GetId(), wxWebRequest::State_Active); - evt.SetDataBuffer(m_readBuffer.GetData(), m_readBuffer.GetDataLen()); - m_request.GetHandler()->ProcessEvent(evt); - m_readBuffer.Clear(); + wxWebRequestEvent* const evt = new wxWebRequestEvent + ( + wxEVT_WEBREQUEST_DATA, + m_request.GetId(), + wxWebRequest::State_Active + ); + evt->SetDataBuffer(m_readBuffer); + + m_request.GetHandler()->QueueEvent(evt); + + // Make sure we switch to a different buffer instead of just + // clearing the current one, which will be needed by the event + // handler when it's finally called in the main thread. + m_readBuffer = wxMemoryBuffer(); break; } }