Always use wxDynamicLibrary in wxMSW and remove checks for it
Force wxUSE_DYNLIB_CLASS to be 1 when using wxMSW and remove checks for it being 0 from the code. No real changes.
This commit is contained in:
parent
0473e6ba6b
commit
c2f3a3db01
30 changed files with 47 additions and 226 deletions
|
|
@ -168,8 +168,8 @@ else()
|
|||
set(wxUSE_DIALUP_MANAGER_DEFAULT ON)
|
||||
endif()
|
||||
wx_option(wxUSE_DIALUP_MANAGER "use dialup network classes" ${wxUSE_DIALUP_MANAGER_DEFAULT})
|
||||
wx_option(wxUSE_DYNLIB_CLASS "use wxLibrary class for DLL loading")
|
||||
wx_option(wxUSE_DYNAMIC_LOADER "use (new) wxDynamicLibrary class")
|
||||
wx_option(wxUSE_DYNLIB_CLASS "use wxDynamicLibrary class for DLL loading")
|
||||
wx_option(wxUSE_DYNAMIC_LOADER "use wxPluginLibrary and wxPluginManager classes")
|
||||
wx_option(wxUSE_EXCEPTIONS "build exception-safe library")
|
||||
wx_option(wxUSE_EXTENDED_RTTI "use extended RTTI (XTI)" OFF)
|
||||
wx_option(wxUSE_FFILE "use wxFFile class")
|
||||
|
|
|
|||
|
|
@ -174,7 +174,6 @@
|
|||
#cmakedefine01 wxUSE_STD_CONTAINERS
|
||||
|
||||
#cmakedefine01 wxUSE_STD_IOSTREAM
|
||||
|
||||
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -728,8 +728,8 @@ WX_ARG_FEATURE(cmdline, [ --enable-cmdline use wxCmdLineParser cla
|
|||
WX_ARG_FEATURE(datetime, [ --enable-datetime use wxDateTime class], wxUSE_DATETIME)
|
||||
WX_ARG_FEATURE(debugreport, [ --enable-debugreport use wxDebugReport class], wxUSE_DEBUGREPORT)
|
||||
WX_ARG_FEATURE(dialupman, [ --enable-dialupman use dialup network classes], wxUSE_DIALUP_MANAGER)
|
||||
WX_ARG_FEATURE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS)
|
||||
WX_ARG_FEATURE(dynamicloader, [ --enable-dynamicloader use (new) wxDynamicLibrary class], wxUSE_DYNAMIC_LOADER)
|
||||
WX_ARG_FEATURE(dynlib, [ --enable-dynlib use wxDynamicLibrary class for DLL loading], wxUSE_DYNLIB_CLASS)
|
||||
WX_ARG_FEATURE(dynamicloader, [ --enable-dynamicloader use wxPluginLibrary and wxPluginManager classes], wxUSE_DYNAMIC_LOADER)
|
||||
WX_ARG_FEATURE(exceptions, [ --enable-exceptions build exception-safe library], wxUSE_EXCEPTIONS)
|
||||
WX_ARG_FEATURE(ffile, [ --enable-ffile use wxFFile class], wxUSE_FFILE)
|
||||
WX_ARG_FEATURE(file, [ --enable-file use wxFile class], wxUSE_FILE)
|
||||
|
|
@ -4981,7 +4981,7 @@ if test "$TOOLKIT" != "MSW"; then
|
|||
wxUSE_DYNAMIC_LOADER=no
|
||||
wxUSE_DYNLIB_CLASS=no
|
||||
else
|
||||
AC_MSG_WARN([Assuming wxLibrary class works on this platform])
|
||||
AC_MSG_WARN([Assuming wxDynamicLibrary class works on this platform])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -487,9 +487,11 @@
|
|||
#define wxUSE_DIALUP_MANAGER 1
|
||||
|
||||
// Compile in classes for run-time DLL loading and function calling.
|
||||
// Required by wxUSE_DIALUP_MANAGER.
|
||||
//
|
||||
// This setting is for Win32 only
|
||||
// This is required by wxMSW implementation and so is always enabled there,
|
||||
// regardless of the value here. For the other ports this option can be
|
||||
// disabled to save a tiny amount of code, but there is typically no reason to
|
||||
// do it.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -488,9 +488,11 @@
|
|||
#define wxUSE_DIALUP_MANAGER 1
|
||||
|
||||
// Compile in classes for run-time DLL loading and function calling.
|
||||
// Required by wxUSE_DIALUP_MANAGER.
|
||||
//
|
||||
// This setting is for Win32 only
|
||||
// This is required by wxMSW implementation and so is always enabled there,
|
||||
// regardless of the value here. For the other ports this option can be
|
||||
// disabled to save a tiny amount of code, but there is typically no reason to
|
||||
// do it.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -193,6 +193,12 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
/* wxMSW implementation requires wxDynamicLibrary. */
|
||||
#if defined(__WXMSW__) && !wxUSE_DYNLIB_CLASS
|
||||
# undef wxUSE_DYNLIB_CLASS
|
||||
# define wxUSE_DYNLIB_CLASS 1
|
||||
#endif /* !wxUSE_DYNLIB_CLASS */
|
||||
|
||||
/*
|
||||
un/redefine the options which we can't compile (after checking that they're
|
||||
defined
|
||||
|
|
@ -215,7 +221,7 @@
|
|||
#endif /* !wxUSE_ACTIVITYINDICATOR && !_MSC_VER */
|
||||
|
||||
/* MinGW-w64 (32 and 64 bit) has winhttp.h available, legacy MinGW does not. */
|
||||
#if (!defined(_MSC_VER) && !defined(__MINGW64_VERSION_MAJOR)) || !wxUSE_DYNLIB_CLASS
|
||||
#if (!defined(_MSC_VER) && !defined(__MINGW64_VERSION_MAJOR))
|
||||
#undef wxUSE_WEBREQUEST_WINHTTP
|
||||
#define wxUSE_WEBREQUEST_WINHTTP 0
|
||||
#endif
|
||||
|
|
@ -290,49 +296,6 @@
|
|||
# endif
|
||||
#endif /* !wxUSE_DYNAMIC_LOADER */
|
||||
|
||||
#if !wxUSE_DYNLIB_CLASS
|
||||
# if wxUSE_DBGHELP
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_DBGHELP requires wxUSE_DYNLIB_CLASS"
|
||||
# else
|
||||
# undef wxUSE_DBGHELP
|
||||
# define wxUSE_DBGHELP 0
|
||||
# endif
|
||||
# endif
|
||||
# if wxUSE_DC_TRANSFORM_MATRIX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_DC_TRANSFORM_MATRIX requires wxUSE_DYNLIB_CLASS"
|
||||
# else
|
||||
# undef wxUSE_DC_TRANSFORM_MATRIX
|
||||
# define wxUSE_DC_TRANSFORM_MATRIX 0
|
||||
# endif
|
||||
# endif
|
||||
# if wxUSE_UXTHEME
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_UXTHEME requires wxUSE_DYNLIB_CLASS"
|
||||
# else
|
||||
# undef wxUSE_UXTHEME
|
||||
# define wxUSE_UXTHEME 0
|
||||
# endif
|
||||
# endif
|
||||
# if wxUSE_MEDIACTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_MEDIACTRL requires wxUSE_DYNLIB_CLASS"
|
||||
# else
|
||||
# undef wxUSE_MEDIACTRL
|
||||
# define wxUSE_MEDIACTRL 0
|
||||
# endif
|
||||
# endif
|
||||
# if wxUSE_INKEDIT
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_INKEDIT requires wxUSE_DYNLIB_CLASS"
|
||||
# else
|
||||
# undef wxUSE_INKEDIT
|
||||
# define wxUSE_INKEDIT 0
|
||||
# endif
|
||||
# endif
|
||||
#endif /* !wxUSE_DYNLIB_CLASS */
|
||||
|
||||
#if !wxUSE_OLE
|
||||
# if wxUSE_ACTIVEX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
#include "wx/dynlib.h"
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
||||
namespace wxMSWImpl
|
||||
{
|
||||
|
||||
|
|
@ -71,13 +69,6 @@ private:
|
|||
static SetThreadDpiAwarenessContext_t ms_pfnSetThreadDpiAwarenessContext;
|
||||
};
|
||||
|
||||
#else // !wxUSE_DYNLIB_CLASS
|
||||
|
||||
// Just a stub to avoid littering the code with wxUSE_DYNLIB_CLASS checks.
|
||||
class AutoSystemDpiAware { };
|
||||
|
||||
#endif // wxUSE_DYNLIB_CLASS/!wxUSE_DYNLIB_CLASS
|
||||
|
||||
} // namespace wxMSWImpl
|
||||
|
||||
#endif // _WX_MSW_DPI_AWARE_H_
|
||||
|
|
|
|||
|
|
@ -488,9 +488,11 @@
|
|||
#define wxUSE_DIALUP_MANAGER 1
|
||||
|
||||
// Compile in classes for run-time DLL loading and function calling.
|
||||
// Required by wxUSE_DIALUP_MANAGER.
|
||||
//
|
||||
// This setting is for Win32 only
|
||||
// This is required by wxMSW implementation and so is always enabled there,
|
||||
// regardless of the value here. For the other ports this option can be
|
||||
// disabled to save a tiny amount of code, but there is typically no reason to
|
||||
// do it.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -75,9 +75,7 @@ protected:
|
|||
// wxUSE_OLE as OleInitialize() is not called then
|
||||
#if wxUSE_OLE
|
||||
virtual bool DoAutoCompleteStrings(const wxArrayString& choices) override;
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
virtual bool DoAutoCompleteFileNames(int flags) override;
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
virtual bool DoAutoCompleteCustom(wxTextCompleter *completer) override;
|
||||
#endif // wxUSE_OLE
|
||||
|
||||
|
|
|
|||
|
|
@ -564,10 +564,6 @@ public:
|
|||
// synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false
|
||||
void GenerateMouseLeave();
|
||||
|
||||
// virtual function for implementing internal idle
|
||||
// behaviour
|
||||
virtual void OnInternalIdle() override;
|
||||
|
||||
#if wxUSE_MENUS && !defined(__WXUNIVERSAL__)
|
||||
virtual bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu);
|
||||
|
||||
|
|
|
|||
|
|
@ -494,9 +494,11 @@
|
|||
#define wxUSE_DIALUP_MANAGER 1
|
||||
|
||||
// Compile in classes for run-time DLL loading and function calling.
|
||||
// Required by wxUSE_DIALUP_MANAGER.
|
||||
//
|
||||
// This setting is for Win32 only
|
||||
// This is required by wxMSW implementation and so is always enabled there,
|
||||
// regardless of the value here. For the other ports this option can be
|
||||
// disabled to save a tiny amount of code, but there is typically no reason to
|
||||
// do it.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace
|
|||
inline bool SupportsPerMonitorDPI()
|
||||
{
|
||||
static bool s_checkDPI =
|
||||
#if defined(__WXMSW__) && wxUSE_DYNLIB_CLASS
|
||||
#if defined(__WXMSW__)
|
||||
// Only check the DPI when GetDpiForWindow is available because the old
|
||||
// method (GetDeviceCaps) is a lot slower (about 1500 times).
|
||||
// And when GetDpiForWindow is not available (for example older Windows
|
||||
|
|
|
|||
|
|
@ -484,9 +484,11 @@
|
|||
#define wxUSE_DIALUP_MANAGER 1
|
||||
|
||||
// Compile in classes for run-time DLL loading and function calling.
|
||||
// Required by wxUSE_DIALUP_MANAGER.
|
||||
//
|
||||
// This setting is for Win32 only
|
||||
// This is required by wxMSW implementation and so is always enabled there,
|
||||
// regardless of the value here. For the other ports this option can be
|
||||
// disabled to save a tiny amount of code, but there is typically no reason to
|
||||
// do it.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -487,9 +487,11 @@
|
|||
#define wxUSE_DIALUP_MANAGER 1
|
||||
|
||||
// Compile in classes for run-time DLL loading and function calling.
|
||||
// Required by wxUSE_DIALUP_MANAGER.
|
||||
//
|
||||
// This setting is for Win32 only
|
||||
// This is required by wxMSW implementation and so is always enabled there,
|
||||
// regardless of the value here. For the other ports this option can be
|
||||
// disabled to save a tiny amount of code, but there is typically no reason to
|
||||
// do it.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -315,10 +315,6 @@ wxEventLoopBase* wxGUIAppTraits::CreateEventLoop()
|
|||
// Stuff for using console from the GUI applications
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
||||
#include <wx/dynlib.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
|
@ -584,20 +580,6 @@ bool wxGUIAppTraits::WriteToStderr(const wxString& text)
|
|||
return s_consoleStderr.IsOkToUse() && s_consoleStderr.Write(text);
|
||||
}
|
||||
|
||||
#else // !wxUSE_DYNLIB_CLASS
|
||||
|
||||
bool wxGUIAppTraits::CanUseStderr()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxGUIAppTraits::WriteToStderr(const wxString& WXUNUSED(text))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_DYNLIB_CLASS/!wxUSE_DYNLIB_CLASS
|
||||
|
||||
WXHWND wxGUIAppTraits::GetMainHWND() const
|
||||
{
|
||||
const wxWindow* const w = wxApp::GetMainTopWindow();
|
||||
|
|
@ -869,8 +851,6 @@ void wxApp::OnQueryEndSession(wxCloseEvent& event)
|
|||
// system DLL versions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
|
@ -975,16 +955,6 @@ int wxApp::GetComCtl32Version()
|
|||
return s_verComCtl32;
|
||||
}
|
||||
|
||||
#else // !wxUSE_DYNLIB_CLASS
|
||||
|
||||
/* static */
|
||||
int wxApp::GetComCtl32Version()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // wxUSE_DYNLIB_CLASS/!wxUSE_DYNLIB_CLASS
|
||||
|
||||
#if wxUSE_EXCEPTIONS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ bool wxMSWDateControls::CheckInitialization()
|
|||
// it's enough to give the error only once
|
||||
s_initResult = false;
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
INITCOMMONCONTROLSEX icex;
|
||||
icex.dwSize = sizeof(icex);
|
||||
icex.dwICC = ICC_DATE_CLASSES;
|
||||
|
|
@ -71,7 +70,6 @@ bool wxMSWDateControls::CheckInitialization()
|
|||
s_initResult = (*pfnInitCommonControlsEx)(&icex);
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
}
|
||||
|
||||
return s_initResult != 0;
|
||||
|
|
|
|||
|
|
@ -69,11 +69,9 @@
|
|||
//
|
||||
// We also load some GDI functions not present in MinGW libraries
|
||||
// dynamically.
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
#include "wx/dynlib.h"
|
||||
#include "wx/dynlib.h"
|
||||
|
||||
#define USE_DYNAMIC_GDI_FUNCS
|
||||
#endif
|
||||
#define USE_DYNAMIC_GDI_FUNCS
|
||||
#endif // _MSC_VER/!_MSC_VER
|
||||
|
||||
using namespace wxMSWImpl;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "wx/msw/debughlp.h"
|
||||
|
||||
#if wxUSE_DBGHELP && wxUSE_DYNLIB_CLASS
|
||||
#if wxUSE_DBGHELP
|
||||
|
||||
#include "wx/scopedarray.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@
|
|||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
||||
#include "wx/dynlib.h"
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
|
|
@ -282,6 +279,3 @@ WXHMODULE wxDynamicLibrary::MSWGetModuleHandle(const wxString& name, void *addr)
|
|||
|
||||
return hmod;
|
||||
}
|
||||
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
|
||||
|
|
|
|||
|
|
@ -96,8 +96,6 @@ wxIMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase);
|
|||
namespace
|
||||
{
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
||||
typedef BOOL (WINAPI *GetProcessUserModeExceptionPolicy_t)(LPDWORD);
|
||||
typedef BOOL (WINAPI *SetProcessUserModeExceptionPolicy_t)(DWORD);
|
||||
|
||||
|
|
@ -111,8 +109,6 @@ DWORD gs_oldExceptionPolicyFlags = 0;
|
|||
|
||||
bool gs_changedPolicy = false;
|
||||
|
||||
#endif // #if wxUSE_DYNLIB_CLASS
|
||||
|
||||
/*
|
||||
Since Windows 7 by default (callback) exceptions aren't swallowed anymore
|
||||
with native x64 applications. Exceptions can occur in a file dialog when
|
||||
|
|
@ -122,7 +118,6 @@ by using SetProcessUserModeExceptionPolicy.
|
|||
*/
|
||||
void ChangeExceptionPolicy()
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
gs_changedPolicy = false;
|
||||
|
||||
wxLoadedDLL dllKernel32(wxT("kernel32.dll"));
|
||||
|
|
@ -146,19 +141,15 @@ void ChangeExceptionPolicy()
|
|||
{
|
||||
gs_changedPolicy = true;
|
||||
}
|
||||
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
}
|
||||
|
||||
void RestoreExceptionPolicy()
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
if (gs_changedPolicy)
|
||||
{
|
||||
gs_changedPolicy = false;
|
||||
(void) gs_pfnSetProcessUserModeExceptionPolicy(gs_oldExceptionPolicyFlags);
|
||||
}
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
}
|
||||
|
||||
#if wxUSE_IFILEOPENDIALOG
|
||||
|
|
|
|||
|
|
@ -134,7 +134,6 @@ bool wxFrame::Create(wxWindow *parent,
|
|||
|
||||
// In case the application is run elevated, allow the
|
||||
// TaskbarButtonCreated and WM_COMMAND messages through.
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
typedef BOOL (WINAPI *ChangeWindowMessageFilter_t)(UINT message,
|
||||
DWORD dwFlag);
|
||||
wxDynamicLibrary dllUser32(wxT("user32.dll"));
|
||||
|
|
@ -147,10 +146,6 @@ bool wxFrame::Create(wxWindow *parent,
|
|||
wxMSGFLT_ADD);
|
||||
pfnChangeWindowMessageFilter(WM_COMMAND, wxMSGFLT_ADD);
|
||||
}
|
||||
#else
|
||||
ChangeWindowMessageFilter(wxMsgTaskbarButtonCreated, wxMSGFLT_ADD);
|
||||
ChangeWindowMessageFilter(WM_COMMAND, wxMSGFLT_ADD);
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
}
|
||||
#endif // wxUSE_TASKBARBUTTON
|
||||
|
||||
|
|
|
|||
|
|
@ -181,7 +181,6 @@ static bool IsPerMonitorDPIAware(HWND hwnd)
|
|||
|
||||
// Determine if 'Per Monitor v2' DPI awareness is enabled in the
|
||||
// applications manifest.
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
#define WXDPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((WXDPI_AWARENESS_CONTEXT)-4)
|
||||
typedef WXDPI_AWARENESS_CONTEXT(WINAPI * GetWindowDpiAwarenessContext_t)(HWND hwnd);
|
||||
typedef BOOL(WINAPI * AreDpiAwarenessContextsEqual_t)(WXDPI_AWARENESS_CONTEXT dpiContextA, WXDPI_AWARENESS_CONTEXT dpiContextB);
|
||||
|
|
@ -206,7 +205,6 @@ static bool IsPerMonitorDPIAware(HWND hwnd)
|
|||
dpiAware = true;
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
|
||||
return dpiAware;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,8 +87,6 @@ ShellFunctions gs_shellFuncs;
|
|||
|
||||
void ResolveShellFunctions()
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
||||
// start with the newest functions, fall back to the oldest ones
|
||||
// first check for SHGetFolderPath (shell32.dll 5.0)
|
||||
wxString shellDllName(wxT("shell32"));
|
||||
|
|
@ -110,7 +108,6 @@ void ResolveShellFunctions()
|
|||
// because we also link to it statically, so it's ok
|
||||
|
||||
gs_shellFuncs.initialized = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "wx/msw/private.h"
|
||||
#include "wx/msw/taskbarbutton.h"
|
||||
#include "wx/dynlib.h"
|
||||
#include "wx/scopedptr.h"
|
||||
#include "wx/msw/private/comptr.h"
|
||||
#include "wx/msw/private/cotaskmemptr.h"
|
||||
|
|
@ -31,10 +32,6 @@
|
|||
#include <shlwapi.h>
|
||||
#include <initguid.h>
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
#include "wx/dynlib.h"
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Redefine the interfaces: ITaskbarList3, IObjectCollection,
|
||||
// ICustomDestinationList, IShellLink, IShellItem, IApplicationDocumentLists
|
||||
|
|
@ -322,7 +319,6 @@ inline HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar)
|
|||
HRESULT hr = E_FAIL;
|
||||
ppropvar->vt = VT_LPWSTR;
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
typedef HRESULT (WINAPI *SHStrDupW_t)(LPCWSTR, LPWSTR*);
|
||||
static SHStrDupW_t s_pfnSHStrDupW = nullptr;
|
||||
if ( !s_pfnSHStrDupW )
|
||||
|
|
@ -338,11 +334,6 @@ inline HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar)
|
|||
{
|
||||
hr = s_pfnSHStrDupW(psz, &ppropvar->pwszVal);
|
||||
}
|
||||
#elif defined (_MSC_VER)
|
||||
hr = SHStrDupW(psz, &ppropvar->pwszVal);
|
||||
#else
|
||||
wxUnusedVar(psz);
|
||||
#endif
|
||||
|
||||
if ( FAILED(hr) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -813,8 +813,6 @@ void wxTextEntry::GetSelection(long *from, long *to) const
|
|||
|
||||
#ifdef HAS_AUTOCOMPLETE
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
||||
bool wxTextEntry::DoAutoCompleteFileNames(int flags)
|
||||
{
|
||||
DWORD dwFlags = 0;
|
||||
|
|
@ -847,8 +845,6 @@ bool wxTextEntry::DoAutoCompleteFileNames(int flags)
|
|||
return true;
|
||||
}
|
||||
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
|
||||
void wxTextEntry::MSWProcessSpecialKey(wxKeyEvent& WXUNUSED(event))
|
||||
{
|
||||
wxFAIL_MSG(wxS("Must be overridden if can be called"));
|
||||
|
|
|
|||
|
|
@ -1061,7 +1061,6 @@ void wxTopLevelWindowMSW::DoSetIcons()
|
|||
|
||||
wxContentProtection wxTopLevelWindowMSW::GetContentProtection() const
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
typedef BOOL(WINAPI *GetWindowDisplayAffinity_t)(HWND, DWORD *);
|
||||
|
||||
wxDynamicLibrary dllUser32("user32.dll");
|
||||
|
|
@ -1075,13 +1074,12 @@ wxContentProtection wxTopLevelWindowMSW::GetContentProtection() const
|
|||
else if (affinity & WDA_MONITOR)
|
||||
return wxCONTENT_PROTECTION_ENABLED;
|
||||
}
|
||||
#endif
|
||||
|
||||
return wxCONTENT_PROTECTION_NONE;
|
||||
}
|
||||
|
||||
bool wxTopLevelWindowMSW::SetContentProtection(wxContentProtection contentProtection)
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
typedef BOOL(WINAPI *SetWindowDisplayAffinity_t)(HWND, DWORD);
|
||||
|
||||
wxDynamicLibrary dllUser32("user32.dll");
|
||||
|
|
@ -1096,7 +1094,7 @@ bool wxTopLevelWindowMSW::SetContentProtection(wxContentProtection contentProtec
|
|||
else
|
||||
wxLogLastError("SetWindowDisplayAffinity");
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ bool wxGetHostName(wxChar *buf, int maxSize)
|
|||
// get full hostname (with domain name if possible)
|
||||
bool wxGetFullHostName(wxChar *buf, int maxSize)
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS && wxUSE_SOCKETS
|
||||
#if wxUSE_SOCKETS
|
||||
// TODO should use GetComputerNameEx() when available
|
||||
|
||||
// we don't want to always link with Winsock DLL as we might not use it at
|
||||
|
|
@ -235,7 +235,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_DYNLIB_CLASS && wxUSE_SOCKETS
|
||||
#endif // wxUSE_SOCKETS
|
||||
|
||||
return wxGetHostName(buf, maxSize);
|
||||
}
|
||||
|
|
@ -1040,7 +1040,6 @@ OSVERSIONINFOEXW wxGetWindowsVersionInfo()
|
|||
|
||||
// The simplest way to get the version is to call the kernel
|
||||
// RtlGetVersion() directly, if it is available.
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
wxDynamicLibrary dllNtDll;
|
||||
if ( dllNtDll.Load(wxS("ntdll.dll"), wxDL_VERBATIM | wxDL_QUIET) )
|
||||
{
|
||||
|
|
@ -1053,7 +1052,6 @@ OSVERSIONINFOEXW wxGetWindowsVersionInfo()
|
|||
return info;
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
|
||||
#ifdef __VISUALC__
|
||||
#pragma warning(push)
|
||||
|
|
@ -1198,7 +1196,7 @@ bool wxIsPlatform64Bit()
|
|||
{
|
||||
#if defined(__WIN64__)
|
||||
return true; // 64-bit programs run only on Win64
|
||||
#elif wxUSE_DYNLIB_CLASS // Win32
|
||||
#else // Win32
|
||||
// 32-bit programs run on both 32-bit and 64-bit Windows so check
|
||||
typedef BOOL (WINAPI *IsWow64Process_t)(HANDLE, BOOL *);
|
||||
|
||||
|
|
@ -1214,8 +1212,6 @@ bool wxIsPlatform64Bit()
|
|||
//else: running under a system without Win64 support
|
||||
|
||||
return wow64 != FALSE;
|
||||
#else
|
||||
return false;
|
||||
#endif // Win64/Win32
|
||||
}
|
||||
|
||||
|
|
@ -1342,8 +1338,6 @@ wxString wxGetCpuArchitecureNameFromImageType(USHORT imageType)
|
|||
// Wrap IsWow64Process2 API (Available since Win10 1511)
|
||||
BOOL wxIsWow64Process2(HANDLE hProcess, USHORT* pProcessMachine, USHORT* pNativeMachine)
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS // Win32
|
||||
|
||||
typedef BOOL(WINAPI *IsWow64Process2_t)(HANDLE, USHORT *, USHORT *);
|
||||
|
||||
wxDynamicLibrary dllKernel32("kernel32.dll");
|
||||
|
|
@ -1352,8 +1346,7 @@ BOOL wxIsWow64Process2(HANDLE hProcess, USHORT* pProcessMachine, USHORT* pNative
|
|||
|
||||
if (pfnIsWow64Process2)
|
||||
return pfnIsWow64Process2(hProcess, pProcessMachine, pNativeMachine);
|
||||
else
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,9 +50,7 @@
|
|||
// Dynamic library function defs.
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
static wxDynamicLibrary s_mprLib;
|
||||
#endif
|
||||
|
||||
typedef DWORD (WINAPI* WNetOpenEnumPtr)(DWORD, DWORD, DWORD, LPNETRESOURCE, LPHANDLE);
|
||||
typedef DWORD (WINAPI* WNetEnumResourcePtr)(HANDLE, LPDWORD, LPVOID, LPDWORD);
|
||||
|
|
@ -405,14 +403,12 @@ wxArrayString wxFSVolumeBase::GetVolumes(int flagsSet, int flagsUnset)
|
|||
{
|
||||
::InterlockedExchange(&s_cancelSearch, FALSE); // reset
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
if (!s_mprLib.IsLoaded() && s_mprLib.Load(wxT("mpr.dll")))
|
||||
{
|
||||
s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(wxT("WNetOpenEnumW"));
|
||||
s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(wxT("WNetEnumResourceW"));
|
||||
s_pWNetCloseEnum = (WNetCloseEnumPtr)s_mprLib.GetSymbol(wxT("WNetCloseEnum"));
|
||||
}
|
||||
#endif
|
||||
|
||||
wxArrayString list;
|
||||
|
||||
|
|
|
|||
|
|
@ -1357,8 +1357,6 @@ void wxWebViewIEImpl::FindClear()
|
|||
|
||||
bool wxWebViewIEImpl::EnableControlFeature(long flag, bool enable)
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
||||
wxDynamicLibrary urlMon(wxT("urlmon.dll"));
|
||||
if( urlMon.IsLoaded() &&
|
||||
urlMon.HasSymbol("CoInternetSetFeatureEnabled") &&
|
||||
|
|
@ -1386,11 +1384,6 @@ bool wxWebViewIEImpl::EnableControlFeature(long flag, bool enable)
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
wxUnusedVar(flag);
|
||||
wxUnusedVar(enable);
|
||||
return false;
|
||||
#endif // wxUSE_DYNLIB_CLASS/!wxUSE_DYNLIB_CLASS
|
||||
}
|
||||
|
||||
void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt)
|
||||
|
|
|
|||
|
|
@ -117,10 +117,6 @@
|
|||
#include "wx/msw/uxtheme.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
#define HAVE_TRACKMOUSEEVENT
|
||||
#endif // everything needed for TrackMouseEvent()
|
||||
|
||||
#ifndef MAPVK_VK_TO_CHAR
|
||||
// Contrary to MS claims that this is present starting with Win2k, it is
|
||||
// missing from the SDK released for Windows 5.2 build 3790, aka XP 64-bit
|
||||
|
|
@ -727,7 +723,6 @@ wxWindowMSW::MSWShowWithEffect(bool show,
|
|||
wxShowEffect effect,
|
||||
unsigned timeout)
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
if ( effect == wxSHOW_EFFECT_NONE ||
|
||||
(GetParent() && !GetParent()->IsShownOnScreen()) )
|
||||
return Show(show);
|
||||
|
|
@ -807,9 +802,6 @@ wxWindowMSW::MSWShowWithEffect(bool show,
|
|||
}
|
||||
|
||||
return true;
|
||||
#else // wxUSE_DYNLIB_CLASS
|
||||
return Show(show);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Raise the window to the top of the Z order
|
||||
|
|
@ -1662,24 +1654,6 @@ bool wxWindowMSW::IsMouseInWindow() const
|
|||
return hwnd != nullptr;
|
||||
}
|
||||
|
||||
void wxWindowMSW::OnInternalIdle()
|
||||
{
|
||||
#ifndef HAVE_TRACKMOUSEEVENT
|
||||
// Check if we need to send a LEAVE event
|
||||
if ( m_mouseInWindow )
|
||||
{
|
||||
// note that we should generate the leave event whether the window has
|
||||
// or doesn't have mouse capture
|
||||
if ( !IsMouseInWindow() )
|
||||
{
|
||||
GenerateMouseLeave();
|
||||
}
|
||||
}
|
||||
#endif // !HAVE_TRACKMOUSEEVENT
|
||||
|
||||
wxWindowBase::OnInternalIdle();
|
||||
}
|
||||
|
||||
// Set this window to be the child of 'parent'.
|
||||
bool wxWindowMSW::Reparent(wxWindowBase *parent)
|
||||
{
|
||||
|
|
@ -3185,7 +3159,6 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
|
|||
wParam);
|
||||
break;
|
||||
|
||||
#ifdef HAVE_TRACKMOUSEEVENT
|
||||
case WM_MOUSELEAVE:
|
||||
// filter out excess WM_MOUSELEAVE events sent after PopupMenu()
|
||||
// (on XP at least)
|
||||
|
|
@ -3199,7 +3172,6 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
|
|||
// ensure windows XP themes work properly as the mouse moves
|
||||
// over widgets like buttons. So don't set processed to true here.
|
||||
break;
|
||||
#endif // HAVE_TRACKMOUSEEVENT
|
||||
|
||||
#if wxUSE_MOUSEWHEEL
|
||||
case WM_MOUSEWHEEL:
|
||||
|
|
@ -4771,8 +4743,6 @@ wxWindowMSW::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
|
|||
// DPI
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
||||
namespace wxMSWImpl
|
||||
{
|
||||
|
||||
|
|
@ -4782,14 +4752,11 @@ AutoSystemDpiAware::ms_pfnSetThreadDpiAwarenessContext =
|
|||
|
||||
} // namespace wxMSWImpl
|
||||
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
static wxSize GetWindowDPI(HWND hwnd)
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
typedef UINT (WINAPI *GetDpiForWindow_t)(HWND hwnd);
|
||||
static GetDpiForWindow_t s_pfnGetDpiForWindow = nullptr;
|
||||
static bool s_initDone = false;
|
||||
|
|
@ -4806,7 +4773,6 @@ static wxSize GetWindowDPI(HWND hwnd)
|
|||
const int dpi = static_cast<int>(s_pfnGetDpiForWindow(hwnd));
|
||||
return wxSize(dpi, dpi);
|
||||
}
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
|
||||
return wxSize();
|
||||
}
|
||||
|
|
@ -4816,7 +4782,6 @@ static wxSize GetWindowDPI(HWND hwnd)
|
|||
/*extern*/
|
||||
int wxGetSystemMetrics(int nIndex, const wxWindow* window)
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
if ( !window )
|
||||
window = wxApp::GetMainTopWindow();
|
||||
|
||||
|
|
@ -4839,9 +4804,6 @@ int wxGetSystemMetrics(int nIndex, const wxWindow* window)
|
|||
return s_pfnGetSystemMetricsForDpi(nIndex, (UINT)dpi);
|
||||
}
|
||||
}
|
||||
#else
|
||||
wxUnusedVar(window);
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
|
||||
return ::GetSystemMetrics(nIndex);
|
||||
}
|
||||
|
|
@ -4854,7 +4816,6 @@ bool wxSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWi
|
|||
// uiAction values corresponding to strings and use a temporary wide buffer
|
||||
// for them, and convert the returned value to ANSI after the call. Instead
|
||||
// of doing all this, just don't use it at all in the deprecated ANSI build.
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
if ( !window )
|
||||
window = wxApp::GetMainTopWindow();
|
||||
|
||||
|
|
@ -4880,9 +4841,6 @@ bool wxSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWi
|
|||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
wxUnusedVar(window);
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
|
||||
return ::SystemParametersInfo(uiAction, uiParam, pvParam, fWinIni) == TRUE;
|
||||
}
|
||||
|
|
@ -6009,7 +5967,6 @@ bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags)
|
|||
// Generate an ENTER event
|
||||
m_mouseInWindow = true;
|
||||
|
||||
#ifdef HAVE_TRACKMOUSEEVENT
|
||||
typedef BOOL (WINAPI *_TrackMouseEvent_t)(LPTRACKMOUSEEVENT);
|
||||
static _TrackMouseEvent_t s_pfn_TrackMouseEvent;
|
||||
static bool s_initDone = false;
|
||||
|
|
@ -6036,7 +5993,6 @@ bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags)
|
|||
|
||||
(*s_pfn_TrackMouseEvent)(&trackinfo);
|
||||
}
|
||||
#endif // HAVE_TRACKMOUSEEVENT
|
||||
|
||||
wxMouseEvent event(wxEVT_ENTER_WINDOW);
|
||||
InitMouseEvent(event, x, y, flags);
|
||||
|
|
@ -6044,7 +6000,6 @@ bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags)
|
|||
(void)HandleWindowEvent(event);
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_TRACKMOUSEEVENT
|
||||
else // mouse not in window
|
||||
{
|
||||
// Check if we need to send a LEAVE event
|
||||
|
|
@ -6055,7 +6010,6 @@ bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags)
|
|||
GenerateMouseLeave();
|
||||
}
|
||||
}
|
||||
#endif // HAVE_TRACKMOUSEEVENT
|
||||
|
||||
// Windows often generates mouse events even if mouse position hasn't
|
||||
// changed (http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/66576)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue